react-grab 0.1.48-dev.e563133 → 0.1.48-dev.edbb603
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -58
- package/dist/{copy-content-3sDfOP1b.d.ts → copy-content-CNRKFr6F.d.ts} +12 -1
- package/dist/{copy-content-TZDC2S2A.d.cts → copy-content-CtYUWe5l.d.cts} +12 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/core-BZQvwiOm.cjs +14 -0
- package/dist/core-DV8a5P0n.js +14 -0
- package/dist/{execute-context-menu-action-qMuJC5wG.cjs → execute-context-menu-action-C0mr8c_t.cjs} +1 -1
- package/dist/execute-context-menu-action-CpBRRPa7.js +9 -0
- package/dist/freeze-updates-BIZWfo7M.js +52 -0
- package/dist/freeze-updates-CnpYC0Mi.cjs +52 -0
- package/dist/{index-DDf5jObx.d.cts → index-BgTe-uWs.d.cts} +1 -1
- package/dist/{index-DWvC_uKW.d.ts → index-CdWMNcJF.d.ts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.global.js +20 -20
- package/dist/index.js +1 -1
- package/dist/{open-file-djB6VdRN.cjs → open-file-5jC10hyN.cjs} +1 -1
- package/dist/{open-file-CWAKzV7d.js → open-file-DsaiIltl.js} +1 -1
- package/dist/primitives.cjs +2 -2
- package/dist/primitives.d.cts +40 -2
- package/dist/primitives.d.ts +40 -2
- package/dist/primitives.js +2 -2
- package/dist/{renderer-B0TpSoAf.js → renderer-CM9v68rB.js} +1 -1
- package/dist/{renderer-BqkijmsE.cjs → renderer-DXSY4SBD.cjs} +1 -1
- package/package.json +2 -2
- package/dist/core-CzNdf_9v.js +0 -14
- package/dist/core-Duvvh_P0.cjs +0 -14
- package/dist/execute-context-menu-action-BAFetckA.js +0 -9
- package/dist/freeze-updates-BmjaUWo5.js +0 -52
- package/dist/freeze-updates-ajWXmT_s.cjs +0 -52
package/README.md
CHANGED
|
@@ -114,72 +114,31 @@ if (process.env.NODE_ENV === "development") {
|
|
|
114
114
|
}
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
##
|
|
117
|
+
## Build your own React Grab
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
Build a custom interface with the selection engine from `react-grab/primitives`. Use its APIs for hit testing, source context, page freezing, clipboard access, and editor navigation.
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
### Customize hit testing
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
import { registerPlugin } from "react-grab";
|
|
123
|
+
Scope hit testing to a container or replace the default element filter with your own rules.
|
|
125
124
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
hooks: {
|
|
129
|
-
onElementSelect: (element) => {
|
|
130
|
-
console.log("Selected:", element.tagName);
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
});
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
If writing in React, register inside a `useEffect`:
|
|
125
|
+
```typescript
|
|
126
|
+
import { getElementAtPoint, isElementGrabbable } from "react-grab/primitives";
|
|
137
127
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
shortcut: "M",
|
|
149
|
-
onAction: (context) => {
|
|
150
|
-
console.log("Action on:", context.element);
|
|
151
|
-
context.hideContextMenu();
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
],
|
|
128
|
+
export const getPickerTarget = (
|
|
129
|
+
event: PointerEvent,
|
|
130
|
+
appElement: Element,
|
|
131
|
+
toolbarElement: Element,
|
|
132
|
+
): Element | null =>
|
|
133
|
+
getElementAtPoint(event.clientX, event.clientY, {
|
|
134
|
+
container: appElement,
|
|
135
|
+
filter: (candidate) =>
|
|
136
|
+
isElementGrabbable(candidate) &&
|
|
137
|
+
!toolbarElement.contains(candidate),
|
|
155
138
|
});
|
|
156
|
-
|
|
157
|
-
return () => unregisterPlugin("my-plugin");
|
|
158
|
-
}, []);
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Actions use a `target` field to control where they appear. Omit `target` (or set `"context-menu"`) for the right-click menu, or set `"toolbar"` for the toolbar dropdown:
|
|
162
|
-
|
|
163
|
-
```js
|
|
164
|
-
actions: [
|
|
165
|
-
{
|
|
166
|
-
id: "inspect",
|
|
167
|
-
label: "Inspect",
|
|
168
|
-
shortcut: "I",
|
|
169
|
-
onAction: (ctx) => console.dir(ctx.element),
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
id: "toggle-freeze",
|
|
173
|
-
label: "Freeze",
|
|
174
|
-
// Only show in the toolbar
|
|
175
|
-
target: "toolbar",
|
|
176
|
-
isActive: () => isFrozen,
|
|
177
|
-
onAction: () => toggleFreeze(),
|
|
178
|
-
},
|
|
179
|
-
];
|
|
180
139
|
```
|
|
181
140
|
|
|
182
|
-
|
|
141
|
+
Add `data-react-grab-ignore` to your picker interface so hit testing skips its subtree.
|
|
183
142
|
|
|
184
143
|
## Resources & Contributing Back
|
|
185
144
|
|
|
@@ -25,6 +25,17 @@ interface Position {
|
|
|
25
25
|
x: number;
|
|
26
26
|
y: number;
|
|
27
27
|
}
|
|
28
|
+
interface ElementAtPointOptions {
|
|
29
|
+
container?: Element;
|
|
30
|
+
filter?: (element: Element) => boolean;
|
|
31
|
+
}
|
|
32
|
+
interface ElementBounds {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
borderRadius: string;
|
|
38
|
+
}
|
|
28
39
|
type DeepPartial<T> = { [P in keyof T]?: T[P] extends object ? T[P] extends ((...args: unknown[]) => unknown) ? T[P] : DeepPartial<T[P]> : T[P] };
|
|
29
40
|
interface Theme {
|
|
30
41
|
/**
|
|
@@ -771,4 +782,4 @@ interface CopyContentOptions {
|
|
|
771
782
|
}
|
|
772
783
|
declare const copyContent: (content: string, options?: CopyContentOptions) => boolean;
|
|
773
784
|
//#endregion
|
|
774
|
-
export {
|
|
785
|
+
export { Rect as A, PluginConfig as C, ReactGrabAPI as D, PromptModeContext as E, ToolbarState as F, SettableOptions as M, SourceInfo as N, ReactGrabRendererProps as O, Theme as P, Plugin as S, Position as T, ElementSelectedEventDetail as _, ActionContext as a, Options as b, AgentContext as c, DeepPartial as d, DragRect as f, ElementLabelVariant as g, ElementLabelContext as h, Fiber as i, SelectedElementPayload as j, ReactGrabState as k, ContextMenuAction as l, ElementBounds as m, isInstrumentationActive as n, ActionContextHooks as o, ElementAtPointOptions as p, StackFrame as r, ActivationMode as s, copyContent as t, ContextMenuActionContext as u, GrabbedBox as v, PluginHooks as w, OverlayBounds as x, OpenFileActionHooks as y };
|
|
@@ -25,6 +25,17 @@ interface Position {
|
|
|
25
25
|
x: number;
|
|
26
26
|
y: number;
|
|
27
27
|
}
|
|
28
|
+
interface ElementAtPointOptions {
|
|
29
|
+
container?: Element;
|
|
30
|
+
filter?: (element: Element) => boolean;
|
|
31
|
+
}
|
|
32
|
+
interface ElementBounds {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
borderRadius: string;
|
|
38
|
+
}
|
|
28
39
|
type DeepPartial<T> = { [P in keyof T]?: T[P] extends object ? T[P] extends ((...args: unknown[]) => unknown) ? T[P] : DeepPartial<T[P]> : T[P] };
|
|
29
40
|
interface Theme {
|
|
30
41
|
/**
|
|
@@ -771,4 +782,4 @@ interface CopyContentOptions {
|
|
|
771
782
|
}
|
|
772
783
|
declare const copyContent: (content: string, options?: CopyContentOptions) => boolean;
|
|
773
784
|
//#endregion
|
|
774
|
-
export {
|
|
785
|
+
export { Rect as A, PluginConfig as C, ReactGrabAPI as D, PromptModeContext as E, ToolbarState as F, SettableOptions as M, SourceInfo as N, ReactGrabRendererProps as O, Theme as P, Plugin as S, Position as T, ElementSelectedEventDetail as _, ActionContext as a, Options as b, AgentContext as c, DeepPartial as d, DragRect as f, ElementLabelVariant as g, ElementLabelContext as h, Fiber as i, SelectedElementPayload as j, ReactGrabState as k, ContextMenuAction as l, ElementBounds as m, isInstrumentationActive as n, ActionContextHooks as o, ElementAtPointOptions as p, StackFrame as r, ActivationMode as s, copyContent as t, ContextMenuActionContext as u, GrabbedBox as v, PluginHooks as w, OverlayBounds as x, OpenFileActionHooks as y };
|
package/dist/core/index.cjs
CHANGED
|
@@ -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-
|
|
9
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../core-BZQvwiOm.cjs`),t=require(`../freeze-updates-CnpYC0Mi.cjs`),n=require(`../open-file-5jC10hyN.cjs`);exports.DEFAULT_THEME=e.l,exports.copyContent=n.n,exports.formatElementInfo=n.r,exports.generateSnippet=e.n,exports.getStack=n.s,exports.init=e.t,exports.isInstrumentationActive=t.U;
|
package/dist/core/index.d.cts
CHANGED
|
@@ -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 {
|
|
10
|
-
import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "../index-
|
|
9
|
+
import { C as PluginConfig, D as ReactGrabAPI, M as SettableOptions, N as SourceInfo, O as ReactGrabRendererProps, S as Plugin, a as ActionContext, b as Options, c as AgentContext, l as ContextMenuAction, n as isInstrumentationActive, t as copyContent, w as PluginHooks, x as OverlayBounds } from "../copy-content-CtYUWe5l.cjs";
|
|
10
|
+
import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "../index-BgTe-uWs.cjs";
|
|
11
11
|
export { ActionContext, AgentContext, ContextMenuAction, DEFAULT_THEME, Options, OverlayBounds, Plugin, PluginConfig, PluginHooks, ReactGrabAPI, ReactGrabRendererProps, SettableOptions, SourceInfo, copyContent, formatElementInfo, generateSnippet, getStack, init, isInstrumentationActive };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -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 {
|
|
10
|
-
import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "../index-
|
|
9
|
+
import { C as PluginConfig, D as ReactGrabAPI, M as SettableOptions, N as SourceInfo, O as ReactGrabRendererProps, S as Plugin, a as ActionContext, b as Options, c as AgentContext, l as ContextMenuAction, n as isInstrumentationActive, t as copyContent, w as PluginHooks, x as OverlayBounds } from "../copy-content-CNRKFr6F.js";
|
|
10
|
+
import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "../index-CdWMNcJF.js";
|
|
11
11
|
export { ActionContext, AgentContext, ContextMenuAction, DEFAULT_THEME, Options, OverlayBounds, Plugin, PluginConfig, PluginHooks, ReactGrabAPI, ReactGrabRendererProps, SettableOptions, SourceInfo, copyContent, formatElementInfo, generateSnippet, getStack, init, isInstrumentationActive };
|
package/dist/core/index.js
CHANGED
|
@@ -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{
|
|
9
|
+
import{l as e,n as t,t as n}from"../core-DV8a5P0n.js";import{U as r}from"../freeze-updates-BIZWfo7M.js";import{n as i,r as a,s as o}from"../open-file-DsaiIltl.js";export{e as DEFAULT_THEME,i as copyContent,a as formatElementInfo,t as generateSnippet,o as getStack,n as init,r as isInstrumentationActive};
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
const e=require(`./execute-context-menu-action-C0mr8c_t.cjs`),t=require(`./freeze-updates-CnpYC0Mi.cjs`),n=require(`./open-file-5jC10hyN.cjs`);var r=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
10
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-contain-size:initial;--tw-contain-layout:initial;--tw-contain-paint:initial;--tw-contain-style:initial}}}@layer theme{:root,:host{--font-sans:"Geist", ui-sans-serif, system-ui, sans-serif;--font-serif:ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-500:oklch(63.7% .237 25.331);--spacing:4px;--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--radius-sm:4px;--ease-out:cubic-bezier(0, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--ease-drawer:cubic-bezier(.32, .72, 0, 1);--ease-spring:cubic-bezier(.34, 1.56, .64, 1)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.a11y-hitbox{position:relative}.a11y-hitbox:before{content:"";pointer-events:auto;width:100%;min-width:24px;height:100%;min-height:24px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-1\\/2{top:50%}.top-\\[2px\\]{top:2px}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-full{right:100%}.bottom-\\[2px\\]{bottom:2px}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-full{left:100%}.z-1{z-index:1}.z-10{z-index:10}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.-m-0\\.5{margin:calc(var(--spacing) * -.5)}.-m-4{margin:calc(var(--spacing) * -4)}.m-0{margin:calc(var(--spacing) * 0)}.-mx-2{margin-inline:calc(var(--spacing) * -2)}.-my-1\\.5{margin-block:calc(var(--spacing) * -1.5)}.-mt-\\[8px\\]{margin-top:-8px}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-1\\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2\\.5{margin-right:calc(var(--spacing) * 2.5)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2\\.5{margin-left:calc(var(--spacing) * 2.5)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.ml-px{margin-left:1px}.no-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.no-scrollbar::-webkit-scrollbar{width:0;height:0;display:none}.line-clamp-5{-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.list-item{display:list-item}.size-0{width:calc(var(--spacing) * 0);height:calc(var(--spacing) * 0)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-\\[12px\\]{width:12px;height:12px}.size-\\[16px\\]{width:16px;height:16px}.h-\\[8px\\]{height:8px}.h-\\[17px\\]{height:17px}.h-\\[20px\\]{height:20px}.h-\\[24px\\]{height:24px}.h-fit{height:fit-content}.max-h-\\[var\\(--rg-edit-list-max-h\\)\\]{max-height:var(--rg-edit-list-max-h)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-\\[28px\\]{min-height:28px}.w-\\[2px\\]{width:2px}.w-\\[calc\\(100\\%\\+16px\\)\\]{width:calc(100% + 16px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\\[280px\\]{max-width:280px}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\\[36px\\]{min-width:36px}.min-w-\\[100px\\]{min-width:100px}.min-w-\\[150px\\]{min-width:150px}.flex-1{flex:1}.flex-shrink,.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.-rotate-90{rotate:-90deg}.rotate-0{rotate:0deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.interactive-scale{transition:transform .4s cubic-bezier(.34,1.56,.64,1)}@media (hover:hover) and (pointer:fine){.interactive-scale:hover{transform:scale(1.05)}}.interactive-scale:active{transition:transform 60ms cubic-bezier(0,0,.2,1);transform:scale(.96)}.press-scale{transition:transform .4s cubic-bezier(.34,1.56,.64,1)}.press-scale:active{transition:transform 60ms cubic-bezier(0,0,.2,1);transform:scale(.97)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.resize{resize:both}.resize-none{resize:none}.grid-cols-\\[0fr\\]{grid-template-columns:0fr}.grid-cols-\\[1fr\\]{grid-template-columns:1fr}.grid-rows-\\[0fr\\]{grid-template-rows:0fr}.grid-rows-\\[1fr\\]{grid-template-rows:1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-\\[5px\\]{gap:5px}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:4px}.rounded-\\[1px\\]{border-radius:1px}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[6px\\]{border-radius:6px}.rounded-\\[13px\\]{border-radius:13px}.rounded-\\[14px\\]{border-radius:14px}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.rounded-t{border-top-left-radius:4px;border-top-right-radius:4px}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-l{border-top-left-radius:4px;border-bottom-left-radius:4px}.rounded-l-\\[10px\\]{border-top-left-radius:10px;border-bottom-left-radius:10px}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-tl{border-top-left-radius:4px}.rounded-r{border-top-right-radius:4px;border-bottom-right-radius:4px}.rounded-r-\\[10px\\]{border-top-right-radius:10px;border-bottom-right-radius:10px}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-tr{border-top-right-radius:4px}.rounded-b{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.rounded-b-\\[6px\\]{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.rounded-b-\\[10px\\]{border-bottom-right-radius:10px;border-bottom-left-radius:10px}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-br{border-bottom-right-radius:4px}.rounded-bl{border-bottom-left-radius:4px}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.\\[border-width\\:0\\.5px\\]{border-width:.5px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-4{border-top-style:var(--tw-border-style);border-top-width:4px}.\\[border-top-width\\:0\\.5px\\]{border-top-width:.5px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-dotted{--tw-border-style:dotted;border-style:dotted}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\[var\\(--rg-border-button\\)\\]{border-color:var(--rg-border-button)}.border-t-\\[var\\(--rg-border-subtle\\)\\]{border-top-color:var(--rg-border-subtle)}.bg-\\[\\#f00\\]{background-color:red}.bg-\\[var\\(--rg-error-bg\\)\\]{background-color:var(--rg-error-bg)}.bg-\\[var\\(--rg-panel-bg\\)\\]{background-color:var(--rg-panel-bg)}.bg-\\[var\\(--rg-submit-bg\\)\\]{background-color:var(--rg-submit-bg)}.bg-\\[var\\(--rg-surface-active\\)\\]{background-color:var(--rg-surface-active)}.bg-\\[var\\(--rg-surface-hover\\)\\]{background-color:var(--rg-surface-hover)}.bg-\\[var\\(--rg-text-primary\\)\\]{background-color:var(--rg-text-primary)}.bg-\\[var\\(--rg-text-secondary\\)\\]{background-color:var(--rg-text-secondary)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.p-0{padding:calc(var(--spacing) * 0)}.p-1{padding:calc(var(--spacing) * 1)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-0\\.25{padding-inline:calc(var(--spacing) * .25)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-\\[3px\\]{padding-inline:3px}.py-0{padding-block:calc(var(--spacing) * 0)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-0\\.25{padding-block:calc(var(--spacing) * .25)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-px{padding-block:1px}.pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.text-center{text-align:center}.text-justify{text-align:justify}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.font-serif{font-family:var(--font-serif)}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.leading-3\\.5{--tw-leading:calc(var(--spacing) * 3.5);line-height:calc(var(--spacing) * 3.5)}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-extralight{--tw-font-weight:var(--font-weight-extralight);font-weight:var(--font-weight-extralight)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.font-thin{--tw-font-weight:var(--font-weight-thin);font-weight:var(--font-weight-thin)}.break-normal{overflow-wrap:normal;word-break:normal}.break-words,.wrap-break-word{overflow-wrap:break-word}.break-all{word-break:break-all}.break-keep{word-break:keep-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-break-spaces{white-space:break-spaces}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-\\[var\\(--rg-error-text\\)\\]{color:var(--rg-error-text)}.text-\\[var\\(--rg-submit-fg\\)\\]{color:var(--rg-submit-fg)}.text-\\[var\\(--rg-text-primary\\)\\]{color:var(--rg-text-primary)}.text-\\[var\\(--rg-text-primary-85\\)\\]{color:var(--rg-text-primary-85)}.text-\\[var\\(--rg-text-secondary\\)\\]{color:var(--rg-text-secondary)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.\\[box-shadow\\:var\\(--rg-shadow\\)\\]{box-shadow:var(--rg-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.\\[filter\\:var\\(--rg-drop-shadow\\)\\]{filter:var(--rg-drop-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-columns\\]{transition-property:grid-template-columns;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-rows\\]{transition-property:grid-template-rows;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,transform\\]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[padding\\,border-radius\\,transform\\]{transition-property:padding,border-radius,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[top\\,left\\,width\\,height\\,opacity\\,border-radius\\]{transition-property:top,left,width,height,opacity,border-radius;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,color\\]{transition-property:transform,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.delay-\\[80ms\\]{transition-delay:80ms}.duration-60{--tw-duration:60ms;transition-duration:60ms}.duration-75{--tw-duration:75ms;transition-duration:75ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-120{--tw-duration:.12s;transition-duration:.12s}.duration-140{--tw-duration:.14s;transition-duration:.14s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-180{--tw-duration:.18s;transition-duration:.18s}.duration-220{--tw-duration:.22s;transition-duration:.22s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-400{--tw-duration:.4s;transition-duration:.4s}.ease-\\[cubic-bezier\\(0\\,0\\,0\\.2\\,1\\)\\]{--tw-ease:cubic-bezier(0,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-drawer{--tw-ease:var(--ease-drawer);transition-timing-function:var(--ease-drawer)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.ease-spring{--tw-ease:var(--ease-spring);transition-timing-function:var(--ease-spring)}.will-change-\\[opacity\\,transform\\]{will-change:opacity,transform}.will-change-transform{will-change:transform}.contain-layout{--tw-contain-layout:layout;contain:var(--tw-contain-size,) var(--tw-contain-layout,) var(--tw-contain-paint,) var(--tw-contain-style,)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[corner-shape\\:superellipse\\(1\\.25\\)\\]{corner-shape:superellipse(1.25)}.\\[font-synthesis\\:none\\]{font-synthesis:none}@media (hover:hover){.group-hover\\:text-\\[var\\(--rg-text-primary\\)\\]:is(:where(.group):hover *){color:var(--rg-text-primary)}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.hover\\:bg-\\[var\\(--rg-error-bg-hover\\)\\]:hover{background-color:var(--rg-error-bg-hover)}.hover\\:bg-\\[var\\(--rg-surface-active\\)\\]:hover{background-color:var(--rg-surface-active)}.hover\\:bg-\\[var\\(--rg-surface-hover\\)\\]:hover{background-color:var(--rg-surface-hover)}.hover\\:text-\\[var\\(--rg-text-primary\\)\\]:hover{color:var(--rg-text-primary)}}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-40:disabled{opacity:.4}}:host{all:initial;direction:ltr}:host,[data-rg-theme=dark]{--rg-panel-bg:#161616;--rg-text-primary:#fff;--rg-text-secondary:#a7a7a7;--rg-surface-hover:#ffffff1a;--rg-surface-active:#ffffff26;--rg-border-subtle:#ffffff1a;--rg-border-button:#fff3;--rg-submit-bg:#fff;--rg-submit-fg:#161616;--rg-error-text:#f87171;--rg-error-bg:#3d1515;--rg-error-bg-hover:#4d1f1f;--rg-shadow:0 2px 8px #00000014;--rg-drop-shadow:drop-shadow(0px 2px 8px #00000014);--rg-shimmer-from:#a1a1aa;--rg-shimmer-to:#d4d4d8;--rg-text-primary-85:#ffffffd9}@media (prefers-color-scheme:dark){:host:not([data-rg-theme]){--rg-panel-bg:#fff;--rg-text-primary:#171717;--rg-text-secondary:#737373;--rg-surface-hover:#0000000d;--rg-surface-active:#00000014;--rg-border-subtle:#00000014;--rg-border-button:#00000026;--rg-submit-bg:#171717;--rg-submit-fg:#fff;--rg-error-text:#dc2626;--rg-error-bg:#fee2e2;--rg-error-bg-hover:#fecaca;--rg-shadow:0 2px 12px #0000001a;--rg-drop-shadow:drop-shadow(0px 2px 12px #0000001a);--rg-shimmer-from:#71717a;--rg-shimmer-to:#a1a1aa;--rg-text-primary-85:#171717d9}}:host([data-rg-theme=light]),[data-rg-theme=light]{--rg-panel-bg:#fff;--rg-text-primary:#171717;--rg-text-secondary:#737373;--rg-surface-hover:#0000000d;--rg-surface-active:#00000014;--rg-border-subtle:#00000014;--rg-border-button:#00000026;--rg-submit-bg:#171717;--rg-submit-fg:#fff;--rg-error-text:#dc2626;--rg-error-bg:#fee2e2;--rg-error-bg-hover:#fecaca;--rg-shadow:0 2px 12px #0000001a;--rg-drop-shadow:drop-shadow(0px 2px 12px #0000001a);--rg-shimmer-from:#71717a;--rg-shimmer-to:#a1a1aa;--rg-text-primary-85:#171717d9}@keyframes rg-slot-enter-up{0%{filter:blur(2px);opacity:0;transform:translateY(.5em)scale(.5)}to{filter:blur();opacity:1;transform:translateY(0)scale(1)}}@keyframes rg-slot-exit-up{0%{filter:blur();opacity:1;transform:translateY(0)scale(1)}to{filter:blur(2px);opacity:0;transform:translateY(-.5em)scale(.5)}}@keyframes rg-slot-enter-down{0%{filter:blur(2px);opacity:0;transform:translateY(-.5em)scale(.5)}to{filter:blur();opacity:1;transform:translateY(0)scale(1)}}@keyframes rg-slot-exit-down{0%{filter:blur();opacity:1;transform:translateY(0)scale(1)}to{filter:blur(2px);opacity:0;transform:translateY(.5em)scale(.5)}}@keyframes rg-slot-enter-fade{0%{filter:blur(2px);opacity:0;transform:scale(.5)}to{filter:blur();opacity:1;transform:scale(1)}}@keyframes rg-slot-exit-fade{0%{filter:blur();opacity:1;transform:scale(1)}to{filter:blur(2px);opacity:0;transform:scale(.5)}}.rg-slot-column{vertical-align:top;display:inline-block;position:relative}.rg-slot-sizer{visibility:hidden;white-space:pre;display:inline-block}.rg-slot-cell{white-space:pre;will-change:transform, filter, opacity;animation-duration:var(--rg-slot-dur,.35s);animation-timing-function:var(--rg-slot-ease,cubic-bezier(.34, 1.56, .64, 1));animation-fill-mode:both;display:inline-block;position:absolute;top:0;left:0}.rg-slot-cell.rg-slot-enter[data-dir="1"]{animation-name:rg-slot-enter-up}.rg-slot-cell.rg-slot-enter[data-dir="-1"]{animation-name:rg-slot-enter-down}.rg-slot-cell.rg-slot-enter[data-dir="0"]{animation-name:rg-slot-enter-fade}.rg-slot-cell.rg-slot-exit[data-dir="1"]{animation-name:rg-slot-exit-up}.rg-slot-cell.rg-slot-exit[data-dir="-1"]{animation-name:rg-slot-exit-down}.rg-slot-cell.rg-slot-exit[data-dir="0"]{animation-name:rg-slot-exit-fade}@media (prefers-reduced-motion:reduce){:host,:host *,:host :before,:host :after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}:host :focus,:host :focus-visible{box-shadow:none!important;outline:none!important}@keyframes shake{0%,to{translate:0}15%,45%{translate:calc(-3px * var(--rg-shake-x,1)) calc(-3px * var(--rg-shake-y,0))}30%,60%{translate:calc(3px * var(--rg-shake-x,1)) calc(3px * var(--rg-shake-y,0))}75%{translate:calc(-2px * var(--rg-shake-x,1)) calc(-2px * var(--rg-shake-y,0))}90%{translate:calc(2px * var(--rg-shake-x,1)) calc(2px * var(--rg-shake-y,0))}}@keyframes icon-loader-spin{0%{opacity:1}50%{opacity:.5}to{opacity:.2}}.icon-loader-bar{animation:.5s linear infinite icon-loader-spin}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.shimmer-text{background:linear-gradient(90deg, var(--rg-shimmer-from) 0%, var(--rg-shimmer-to) 25%, var(--rg-shimmer-from) 50%, var(--rg-shimmer-to) 75%, var(--rg-shimmer-from) 100%);color:#0000;background-size:200% 100%;-webkit-background-clip:text;background-clip:text;animation:2.5s linear infinite shimmer}.animate-shake,.animate-shake-vertical{will-change:translate;animation:.3s ease-out shake}@keyframes tooltip-fade-in{0%{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}.animate-tooltip-fade-in{will-change:transform, opacity;animation:.1s ease-out tooltip-fade-in}.animate-shake-vertical{--rg-shake-x:0;--rg-shake-y:1}@supports (-webkit-touch-callout:none){textarea[data-react-grab-input]{font-size:16px}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-contain-size{syntax:"*";inherits:false}@property --tw-contain-layout{syntax:"*";inherits:false}@property --tw-contain-paint{syntax:"*";inherits:false}@property --tw-contain-style{syntax:"*";inherits:false}`;function i(e){return typeof e==`object`&&!!e&&(Object.getPrototypeOf(e)===Object.prototype||Array.isArray(e))}function a(e,t,n,r){!r&&e[t]===n||(n===void 0?delete e[t]:e[t]=n)}function o(e,t,n){let r=Object.keys(t);for(let i=0;i<r.length;i+=1){let o=r[i];a(e,o,t[o],n)}}function s(e,t){if(typeof t==`function`&&(t=t(e)),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let r=t[n];e[n]!==r&&a(e,n,r)}a(e,`length`,r)}else o(e,t)}function c(e,t,n=[]){let r,s=e;if(t.length>1){r=t.shift();let i=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let i=0;i<r.length;i++)c(e,[r[i]].concat(t),n);return}else if(a&&i===`function`){for(let i=0;i<e.length;i++)r(e[i],i)&&c(e,[i].concat(t),n);return}else if(a&&i===`object`){let{from:i=0,to:a=e.length-1,by:o=1}=r;for(let r=i;r<=a;r+=o)c(e,[r].concat(t),n);return}else if(t.length>1){c(e[r],t,[r].concat(n));return}s=e[r],n=[r].concat(n)}let l=t[0];typeof l==`function`&&(l=l(s,n),l===s)||r===void 0&&l==null||(r===void 0||i(s)&&i(l)&&!Array.isArray(l)?o(s,l):a(e,r,l))}function l(e){let t=Array.isArray(e);function n(...n){t&&n.length===1?s(e,n[0]):c(e,n)}return[e,n]}function u(e){return t=>(i(t)&&e(t),t)}const d=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),f=e=>{let t=0,n=e.previousElementSibling;for(;n;)t+=1,n=n.previousElementSibling;return t},p=new WeakMap,m=e=>{if(e.anchorElement.isConnected)return e.anchorElement;let n=e.anchorElement.tagName,r=t.G(e.anchorParentFiber);if(t.J(r)){let i=r.stateNode;if(!t.nt(i)||!i.isConnected)return null;let a=i.children[e.anchorIndexInParent];return a&&a.tagName===n?a:null}for(let e of t.W(r)){let r=e.stateNode;if(t.nt(r)&&r.isConnected&&r.tagName===n)return r}return null},h=(e,t)=>{let n=e;for(let e of t){let t=(e.isShadowChild?n.shadowRoot?.children:n.children)?.[e.childIndex];if(!t)return null;n=t}return n},g=e=>{let n=[],r=e,i=t.q(r);for(;r&&!i;){let e=r.parentElement;if(e)n.unshift({childIndex:f(r),isShadowChild:!1}),r=e;else{let e=r.getRootNode();if(!t.gn(e))break;n.unshift({childIndex:f(r),isShadowChild:!0}),r=e.host}i=t.q(r)}let a=i?.return;return!r||!a?null:{anchorElement:r,anchorParentFiber:a,anchorIndexInParent:f(r),domPath:n,targetTagName:e.tagName}},_=(e,t)=>e.anchorElement.isConnected&&e.anchorIndexInParent===f(e.anchorElement)&&h(e.anchorElement,e.domPath)===t,v=e=>{if(!e.isConnected)return;let t=p.get(e);if(t&&_(t,e))return;let n=g(e);n&&p.set(e,n)},y=e=>{if(e.isConnected)return e;let t=p.get(e);if(!t)return null;let n=m(t);if(!n)return null;let r=h(n,t.domPath);return r&&r.isConnected&&r.tagName===t.targetTagName?r:null},b=e=>{let t=y(e)??e;return v(t),t},x=e=>{for(let t=0;t<e.frozenElements.length;t+=1)e.frozenElements[t]=b(e.frozenElements[t]);e.frozenElement=e.frozenElement&&b(e.frozenElement),e.detectedElement=e.detectedElement&&b(e.detectedElement),e.contextMenuElement=e.contextMenuElement&&b(e.contextMenuElement);for(let t of e.labelInstances)if(t.element&&=b(t.element),t.elements)for(let e=0;e<t.elements.length;e+=1)t.elements[e]=b(t.elements[e]);for(let t of e.grabbedBoxes)t.element&&=b(t.element)},S=e=>({selectionInteractionLockDepth:0,wasActivatedByToggle:!1,pendingCommentMode:!1,keyHoldDuration:e.keyHoldDuration,dragStart:{x:t.It,y:t.It},copyStart:{x:t.It,y:t.It},copyOffsetFromCenterX:0,detectedElement:null,frozenElement:null,frozenElements:[],frozenDragRect:null,lastGrabbedElement:null,selectionFilePath:null,selectionLineNumber:null,inputText:``,grabbedBoxes:[],labelInstances:[],isTouchMode:!1,activationTimestamp:null,previouslyFocusedElement:null,contextMenuPosition:null,contextMenuElement:null,contextMenuClickOffset:null}),ee=n=>{let[r,i]=l(S(n)),[a,o]=e.yt({x:t.It,y:t.It}),[s,c]=e.yt(0),[f,p]=e.yt({state:`idle`}),m=e=>{i(u(t=>{e(t),t.frozenElement=t.frozenElements.length>0?t.frozenElements[0]:null,t.frozenDragRect=null;for(let e of t.frozenElements)v(e)}))},h=()=>{m(e=>{e.frozenElements=[]})},g=e=>{p(t=>t.state===`active`?{...t,phase:e}:t)},_={startHold:e=>{e!==void 0&&i(`keyHoldDuration`,e),p({state:`holding`,startedAt:Date.now()})},releaseHold:()=>{f().state===`holding`&&p({state:`idle`})},activate:()=>{e.dt(()=>{p({state:`active`,phase:`hovering`,isPromptMode:!1,isPendingDismiss:!1}),i(`activationTimestamp`,Date.now()),i(`previouslyFocusedElement`,document.activeElement)})},deactivate:()=>{e.dt(()=>{p({state:`idle`}),i(u(e=>{e.wasActivatedByToggle=!1,e.pendingCommentMode=!1,e.inputText=``,e.frozenElement=null,e.frozenElements=[],e.frozenDragRect=null,e.activationTimestamp=null,e.previouslyFocusedElement=null,e.contextMenuPosition=null,e.contextMenuElement=null,e.contextMenuClickOffset=null,e.isTouchMode&&(e.detectedElement=null)}))})},toggle:()=>{r.activationTimestamp===null?(i(`wasActivatedByToggle`,!0),_.activate()):_.deactivate()},freeze:()=>{if(f().state===`active`){let e=r.frozenElement??r.detectedElement;e&&(v(e),i(`frozenElement`,e)),g(`frozen`)}},unfreeze:()=>{f().state===`active`&&e.dt(()=>{i(u(e=>{e.frozenElement=null,e.frozenElements=[],e.frozenDragRect=null})),g(`hovering`)})},startDrag:(t,n)=>{f().state===`active`&&e.dt(()=>{n||h(),i(`dragStart`,{x:t.x+window.scrollX,y:t.y+window.scrollY}),g(`dragging-select`)})},startDragReposition:()=>{let e=f();e.state===`active`&&e.phase===`dragging-select`&&g(`dragging-reposition`)},stopDragReposition:()=>{let e=f();e.state===`active`&&e.phase===`dragging-reposition`&&g(`dragging-select`)},shiftDragStart:e=>{let t=f();t.state===`active`&&t.phase===`dragging-reposition`&&i(`dragStart`,t=>({x:t.x+e.x,y:t.y+e.y}))},endDrag:()=>{let n=f();n.state===`active`&&(n.phase===`dragging-select`||n.phase===`dragging-reposition`)&&e.dt(()=>{i(`dragStart`,{x:t.It,y:t.It}),g(`justDragged`)})},cancelDrag:()=>{let n=f();n.state===`active`&&(n.phase===`dragging-select`||n.phase===`dragging-reposition`)&&e.dt(()=>{i(`dragStart`,{x:t.It,y:t.It}),g(`hovering`)})},finishJustDragged:()=>{let e=f();e.state===`active`&&e.phase===`justDragged`&&g(`hovering`)},startCopy:()=>{let e=f().state===`active`;p({state:`copying`,startedAt:Date.now(),wasActive:e})},completeCopy:()=>{let e=f(),t=e.state===`copying`?e.wasActive:!1;p({state:`justCopied`,copiedAt:Date.now(),wasActive:t})},finishJustCopied:()=>{let t=f();t.state===`justCopied`&&(t.wasActive&&!r.wasActivatedByToggle?e.dt(()=>{h(),p({state:`active`,phase:`hovering`,isPromptMode:!1,isPendingDismiss:!1})}):_.deactivate())},enterPromptMode:(n,r)=>{let{x:a}=d(t.Z(r));v(r),e.dt(()=>{i(`copyStart`,n),i(`copyOffsetFromCenterX`,n.x-a),o(n),i(`frozenElement`,r),i(`wasActivatedByToggle`,!0),f().state===`active`?p(e=>e.state===`active`?{...e,isPromptMode:!0,phase:`frozen`}:e):(p({state:`active`,phase:`frozen`,isPromptMode:!0,isPendingDismiss:!1}),i(`activationTimestamp`,Date.now()),i(`previouslyFocusedElement`,document.activeElement))})},exitPromptMode:()=>{p(e=>e.state===`active`?{...e,isPromptMode:!1,isPendingDismiss:!1}:e)},setInputText:e=>{i(`inputText`,e)},clearInputText:()=>{i(`inputText`,``)},setPendingDismiss:e=>{p(t=>t.state===`active`?{...t,isPendingDismiss:e}:t)},setPointer:e=>{o(t=>t.x===e.x&&t.y===e.y?t:e)},setDetectedElement:e=>{e&&v(e),i(`detectedElement`,e)},setFrozenElement:e=>{m(t=>{t.frozenElements=[e]})},setFrozenElements:e=>{m(t=>{t.frozenElements=e})},toggleFrozenElement:e=>{m(t=>{let n=t.frozenElements.indexOf(e);n>=0?t.frozenElements.splice(n,1):t.frozenElements.push(e)})},addFrozenElements:e=>{m(t=>{for(let n of e)t.frozenElements.includes(n)||t.frozenElements.push(n)})},setFrozenDragRect:e=>{i(`frozenDragRect`,e)},relinkLiveElements:()=>{i(u(x))},setCopyStart:(e,n)=>{let{x:r}=d(t.Z(n));i(`copyStart`,e),i(`copyOffsetFromCenterX`,e.x-r)},setLastGrabbed:e=>{i(`lastGrabbedElement`,e)},setWasActivatedByToggle:e=>{i(`wasActivatedByToggle`,e)},setPendingCommentMode:e=>{i(`pendingCommentMode`,e)},setTouchMode:e=>{i(`isTouchMode`,e)},incrementSelectionInteractionLockDepth:()=>{i(`selectionInteractionLockDepth`,e=>e+1)},decrementSelectionInteractionLockDepth:()=>{i(`selectionInteractionLockDepth`,e=>Math.max(0,e-1))},setSelectionSource:(t,n)=>{e.dt(()=>{i(`selectionFilePath`,t),i(`selectionLineNumber`,n)})},incrementViewportVersion:()=>{c(e=>e+1)},addGrabbedBox:e=>{e.element&&v(e.element),i(`grabbedBoxes`,t=>[...t,e])},removeGrabbedBox:e=>{i(`grabbedBoxes`,t=>t.filter(t=>t.id!==e))},clearGrabbedBoxes:()=>{i(`grabbedBoxes`,[])},addLabelInstance:e=>{e.element&&v(e.element);for(let t of e.elements??[])v(t);i(`labelInstances`,t=>[...t,e])},updateLabelInstance:(t,n,a)=>{let o=r.labelInstances.findIndex(e=>e.id===t);o!==-1&&e.dt(()=>{i(`labelInstances`,o,`status`,n),a===void 0?n!==`error`&&i(`labelInstances`,o,`errorMessage`,void 0):i(`labelInstances`,o,`errorMessage`,a)})},removeLabelInstance:e=>{i(`labelInstances`,t=>t.filter(t=>t.id!==e))},clearLabelInstances:()=>{i(`labelInstances`,[])},showContextMenu:(n,r)=>{let{x:a,y:o}=d(t.Z(r));v(r),e.dt(()=>{i(`contextMenuPosition`,n),i(`contextMenuElement`,r),i(`contextMenuClickOffset`,{x:n.x-a,y:n.y-o})})},hideContextMenu:()=>{e.dt(()=>{i(`contextMenuPosition`,null),i(`contextMenuElement`,null),i(`contextMenuClickOffset`,null)})},updateContextMenuPosition:()=>{let n=r.contextMenuElement,a=r.contextMenuClickOffset;if(!n||!a||!e.K(n))return;let{x:o,y:s}=d(t.Z(n));i(`contextMenuPosition`,{x:o+a.x,y:s+a.y})}};return{store:r,actions:_,pointer:a,viewportVersion:s,current:f}},te=e=>{if(!document.body)return;let n=document.querySelectorAll(`[${t.cn}]`);for(let t of n)t!==e&&t.parentNode!==e&&(t.shadowRoot||t.remove());document.body.appendChild(e)},C=e=>{if(document.body){te(e);return}let t=()=>{document.removeEventListener(`DOMContentLoaded`,t),te(e)};document.addEventListener(`DOMContentLoaded`,t,{once:!0})},ne=e=>{let n=document.querySelectorAll(`[${t.cn}]`);for(let e of n){let n=e.shadowRoot?.querySelector(`[${t.cn}]`);if(n instanceof HTMLDivElement)return{root:n,host:e};e.remove()}let r=document.createElement(`div`);r.setAttribute(t.cn,`true`),t.T(r),r.style.zIndex=String(t.on),r.style.position=`fixed`,r.style.inset=`0`,r.style.pointerEvents=`none`,r.style.contain=`strict`;let i=r.attachShadow({mode:`open`}),a=document.createElement(`style`),o=t.E();o&&(a.nonce=o),a.textContent=`@import url("https://fonts.googleapis.com/css2?family=Geist:wght@500&display=swap");\n${e??``}`,i.appendChild(a);let s=document.createElement(`div`);return s.setAttribute(t.cn,`true`),i.appendChild(s),C(r),setTimeout(()=>{te(r)},t.Pt),{root:s,host:r}},re=t=>{let[r,i]=e.yt(void 0),a=0;return e.mt(e.Ct(t,e=>{let t=++a;if(!e){i(void 0);return}let r=n.i(e)??void 0;i(r),n.o(e).then(e=>{a===t&&i(e??r)}).catch(()=>{a===t&&i(r)})})),[r,i]},w=[`data-theme`,`data-mode`,`data-color-scheme`,`data-bs-theme`,`data-mui-color-scheme`,`data-mantine-color-scheme`],ie=[{attribute:`data-dark`,theme:`dark`},{attribute:`data-light`,theme:`light`}],T=(e,t,n)=>{let[r,i,a]=[e,t,n].map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*r+.7152*i+.0722*a},ae=(t,n=0)=>{let r=e.B(t),i=r?e.H(r):null;return!i||i.alpha<=n?null:T(i.red,i.green,i.blue)},oe=e=>{let t=ae(e);return t===null?null:t<.18?`dark`:`light`},se=e=>oe(getComputedStyle(e).backgroundColor),ce=()=>{let e=ae(getComputedStyle(document.documentElement).color,t.Rt);return e===null?null:e>.6?`dark`:null},le=()=>{let e=document.createElement(`div`);e.style.cssText=`position:fixed;width:0;height:0;background-color:Canvas!important`,document.documentElement.appendChild(e);let t=oe(getComputedStyle(e).backgroundColor);return e.remove(),t},ue=e=>{let t=e.toLowerCase();return t===`dark`?`dark`:t===`light`?`light`:null},E=e=>{let t=e.style.colorScheme||getComputedStyle(e).colorScheme;return t?t.trim().toLowerCase().split(/\s+/):[]},de=e=>{let t=E(e),n=t.includes(`dark`);return n===t.includes(`light`)?null:n?`dark`:`light`},fe=e=>{if(e.classList.contains(`dark`))return`dark`;if(e.classList.contains(`light`))return`light`;for(let t of w){let n=e.getAttribute(t);if(!n)continue;let r=ue(n);if(r)return r}for(let{attribute:t,theme:n}of ie)if(e.hasAttribute(t))return n;return null},pe=(e,t)=>{for(let n of e){if(!n)continue;let e=t(n);if(e)return e}return null},me=()=>{let e=[document.documentElement,document.body],t=[document.body,document.documentElement];return pe(e,fe)??pe(e,de)??pe(t,se)??ce()??le()??`light`},he=e=>e===`dark`?`light`:`dark`,D=()=>{let e=[];for(let t of[document.documentElement,document.body]){if(!t)continue;e.push(t.className);for(let n of w)e.push(t.getAttribute(n)??``);for(let{attribute:n}of ie)e.push(t.hasAttribute(n)?`1`:``);let n=t.style;e.push(n.colorScheme,n.backgroundColor,n.color);for(let t=0;t<n.length;t++){let r=n[t];r.startsWith(`--`)&&e.push(`${r}:${n.getPropertyValue(r)}`)}}return e.join(`|`)},ge={attributes:!0,attributeFilter:[`class`,`style`,...w,...ie.map(({attribute:e})=>e)]},_e=(e,n)=>{let r=null,i=null,a=null,o=t=>{if(t===i&&r!==null)return getComputedStyle(document.body??document.documentElement).backgroundColor,r;i=t;let a=he(me());return a!==r&&(r=a,e.setAttribute(`data-rg-theme`,a),n?.(a)),a},s=()=>o(D()),c=()=>{a!==null&&(t.S(a),a=null)},l=()=>{a===null&&(a=t.C(()=>{a=null,s()}))},u=s(),d=()=>{let e=D();if(e===i){l();return}c(),o(e)},f=new MutationObserver(d);f.observe(document.documentElement,ge);let p=null;document.body?f.observe(document.body,ge):(p=new MutationObserver((e,t)=>{document.body&&(t.disconnect(),p=null,f.observe(document.body,ge),d())}),p.observe(document.documentElement,{childList:!0}));let m=()=>{i=null,l()},h=window.matchMedia(`(prefers-color-scheme: dark)`);return h.addEventListener(`change`,m),{theme:u,cleanup:()=>{p?.disconnect(),f.disconnect(),h.removeEventListener(`change`,m),c()}}},O=()=>{},ve=()=>({activate:O,deactivate:O,toggle:O,comment:O,isActive:()=>!1,isEnabled:()=>!1,setEnabled:O,getToolbarState:()=>null,setToolbarState:O,onToolbarStateChange:()=>O,reset:O,dispose:O,copyElement:()=>Promise.resolve(!1),getSource:()=>Promise.resolve(null),getStackContext:()=>Promise.resolve(``),getState:()=>({isActive:!1,isDragging:!1,isCopying:!1,isPromptMode:!1,isSelectionBoxVisible:!1,isDragBoxVisible:!1,targetElement:null,dragBounds:null,grabbedBoxes:[],labelInstances:[],selectionFilePath:null,toolbarState:null}),setOptions:O,registerPlugin:O,unregisterPlugin:O,getPlugins:()=>[],getDisplayName:()=>null}),ye=()=>{let e=new AbortController;return{signal:e.signal,abort:()=>e.abort(),addWindowListener:(t,n,r={})=>{window.addEventListener(t,n,{...r,signal:e.signal})},addDocumentListener:(t,n,r={})=>{document.addEventListener(t,n,{...r,signal:e.signal})}}},be=(e,t=`Unknown error`)=>e instanceof Error&&e.message?e.message:t,xe=e=>e instanceof Error?e:Error(String(e)),Se=Symbol(`aborted-promise-result`),Ce=async(e,t)=>{if(!t)return e;if(t.aborted)return Se;let n=()=>{},r=new Promise(e=>{n=()=>e(Se)});t.addEventListener(`abort`,n,{once:!0});try{return await Promise.race([e,r])}finally{t.removeEventListener(`abort`,n)}},k={status:`cancelled`},we=e=>({functionName:e.functionName,fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,isServer:e.isServer,isSymbolicated:e.isSymbolicated}),Te=async(e,r)=>{let i={maxLines:r},[a,o,s,c]=await Promise.all([n.a(e,i),n.c(e,i),n.l(e),n.s(e)]);return{tagName:t.D(e),componentName:s?.componentName??void 0,content:`[${a}]`,source:s,stackContext:o,frames:(c??[]).map(we)}},Ee=async(e,t)=>{let n=await Promise.all(e.map(e=>Te(e,t))),r=new Map;for(let e of n)r.has(e.content)||r.set(e.content,e);let i=[...r.values()];return i.length>0?{content:i.map(e=>e.content).join(`
|
|
11
|
+
`),entries:i}:null},De=(e,t,n)=>{if(e?.entries)return t===e.content?e.entries:e.entries.length===1?[{...e.entries[0],content:t,commentText:n}]:e.entries.map(e=>({...e,commentText:n}))},Oe=async(e,t,r,i)=>{if(e.signal?.aborted||await Ce(t.onBeforeCopy(r),e.signal)===Se)return k;let a=!1,o=!1,s=``;try{let c=await Ce(e.getContent?Promise.resolve(e.getContent(r)).then(e=>({content:e})):Ee(r,e.maxContextLines),e.signal);if(c===Se)return k;let l=c?.content;if(l?.trim()){let u=await Ce(t.transformCopyContent(l,r),e.signal);if(u===Se)return k;s=i?`${i}\n${u}`:u,o=!0,a=n.n(s,{componentName:e.componentName,entries:De(c,s,i)})}}catch(n){if(!o&&e.signal?.aborted)return k;t.onCopyError(xe(n))}return!o&&e.signal?.aborted?k:(a&&t.onCopySuccess(r,s),t.onAfterCopy(r,a),{status:a?`succeeded`:`failed`})},ke=e=>{let n=[],r=e;for(;r;){n.unshift(r);let e=r.getRootNode();if(t.gn(e)){r=e.host;continue}if(!t.hn(e))break;r=t.mn(e.defaultView)}return n},A=(e,t)=>{if(e===t)return 0;let n=ke(e),r=ke(t),i=Math.min(n.length,r.length);for(let e=0;e<i;e+=1){let t=n[e],i=r[e];if(t===i)continue;let a=t.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0}return n.length-r.length},j=(e,t)=>{let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return Math.max(0,i-n)*Math.max(0,a-r)},Ae=(e,t)=>e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top,je=e=>e.sort(A),M=t=>{if(t.width<=0||t.height<=0)return[];let n=window.innerWidth,r=window.innerHeight,i=t.x,a=t.y,o=t.x+t.width,s=t.y+t.height,c=i+t.width/2,l=a+t.height/2,u=e.z(Math.ceil(t.width/32),3,20),d=e.z(Math.ceil(t.height/32),3,20),f=u*d,p=f>100?Math.sqrt(100/f):1,m=e.z(Math.floor(u*p),3,20),h=e.z(Math.floor(d*p),3,20),g=new Set,_=[],v=(t,i)=>{let a=e.z(Math.round(t),0,n-1),o=e.z(Math.round(i),0,r-1),s=`${a}:${o}`;g.has(s)||(g.add(s),_.push({x:a,y:o}))};v(i+1,a+1),v(o-1,a+1),v(i+1,s-1),v(o-1,s-1),v(c,a+1),v(c,s-1),v(i+1,l),v(o-1,l),v(c,l);for(let e=0;e<m;e+=1){let n=i+(e+.5)/m*t.width;for(let e=0;e<h;e+=1)v(n,a+(e+.5)/h*t.height)}return _},N=(e,n,r)=>{let i={left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height},a=new Set,o=M(e);t.h();try{for(let e of o){let n=t.g(e.x,e.y);for(let e of n)a.add(e)}}finally{t.m()}let s=[];for(let e of a){if(t.et(e)&&t.x(e)||!r&&t.b(e)||!t.dn(e)||!n(e))continue;let a=t.Z(e);if(a.width<=0||a.height<=0)continue;let o={left:a.x,top:a.y,right:a.x+a.width,bottom:a.y+a.height};r?j(i,o)/(a.width*a.height)>=.75&&s.push(e):Ae(o,i)&&s.push(e)}return je(s)},Me=e=>{let n=new Set(e),r=[];for(let i=e.length-1;i>=0;--i){let a=e[i];if(!n.has(a))continue;let o=a,s=t.pn(o),c=!1;for(;s;){let e=o.getRootNode();if(n.has(s)&&t.gn(e)&&e.host===s)n.delete(s);else if(n.has(s)){c=!0;break}o=s,s=t.pn(o)}c||r.push(a)}return r.reverse()},Ne=(e,t,n=!0)=>Me(N(e,t,n)),Pe=(t,n)=>t.width<=0?0:e.z((n.x-t.x)/t.width,0,1),Fe=()=>{t.Q(),t.d()},Ie=e=>({borderRadius:`0px`,height:e.height,width:e.width,x:e.pageX-window.scrollX,y:e.pageY-window.scrollY}),Le=e=>({pageX:e.x+window.scrollX,pageY:e.y+window.scrollY,width:e.width,height:e.height}),Re=e=>({borderRadius:`0px`,height:e.height,width:e.width,x:e.x,y:e.y}),ze=(e,n,r)=>{let i=(e,t,n,r)=>{let i=[],a=e,o=0;for(;a&&i.length<n&&o<100;)r(a)&&i.push(a),a=t(a),o+=1;return i},a=i(t.pn(e),t.pn,6,n);a.reverse();let o=a.map((e,t)=>({element:e,depth:t,isLast:!0})),s=a.length,c=i(e.previousElementSibling,e=>e.previousElementSibling,7,r),l=i(e.nextElementSibling,e=>e.nextElementSibling,7,r),u=Math.min(c.length,Math.max(3,7-l.length)),d=Math.min(l.length,7-u),f=[...c.slice(0,u).reverse(),e,...l.slice(0,d)],p=i(e.firstElementChild,e=>e.nextElementSibling,6,n),m=f.length-1,h=p.length-1;return f.forEach((t,n)=>{o.push({element:t,depth:s,isLast:n===m}),t===e&&p.forEach((e,t)=>{o.push({element:e,depth:s+1,isLast:t===h})})}),o},Be=e=>e.namespaceURI===`http://www.w3.org/2000/svg`&&e.tagName!==`svg`,P=e=>{let t=e.getBoundingClientRect();return t.width>=16||t.height>=16},Ve=(e,t)=>t(e)&&!Be(e)&&P(e),He=new Set([`c`,`C`,`с`,`С`,`ȼ`,`Ȼ`,`ↄ`,`Ↄ`,`ᴄ`,`ᶜ`,`ⱼ`,`ⅽ`,`Ⅽ`,`ç`,`Ç`,`ć`,`Ć`,`č`,`Č`,`ĉ`,`Ĉ`,`ċ`,`Ċ`]),Ue=(e,t)=>t===`KeyC`?!0:!e||e.length!==1?!1:He.has(e),We=(e,t)=>{if(!e||!t)return!1;let n=e.toLowerCase();return t===`Space`?n===`space`||n===` `:t.startsWith(`Key`)?t.slice(3).toLowerCase()===n:t.startsWith(`Digit`)?t.slice(5)===n:!1},Ge={meta:`metaKey`,cmd:`metaKey`,command:`metaKey`,win:`metaKey`,windows:`metaKey`,ctrl:`ctrlKey`,control:`ctrlKey`,shift:`shiftKey`,alt:`altKey`,option:`altKey`,opt:`altKey`},Ke=e=>{let t=e.split(`+`).map(e=>e.trim().toLowerCase()),n={metaKey:!1,ctrlKey:!1,shiftKey:!1,altKey:!1,key:null};for(let e of t){let t=Ge[e];t?n[t]=!0:n.key=e}return n},qe=e=>{if(typeof e==`function`)return e;let t=Ke(e),n=t.key;return e=>{if(n===null){let n=t.metaKey?e.metaKey||e.key===`Meta`:!0,r=t.ctrlKey?e.ctrlKey||e.key===`Control`:!0,i=t.shiftKey?e.shiftKey||e.key===`Shift`:!0,a=t.altKey?e.altKey||e.key===`Alt`:!0,o=n&&r&&i&&a,s=[t.metaKey,t.ctrlKey,t.shiftKey,t.altKey].filter(Boolean).length,c=[e.metaKey||e.key===`Meta`,e.ctrlKey||e.key===`Control`,e.shiftKey||e.key===`Shift`,e.altKey||e.key===`Alt`].filter(Boolean).length;return o&&c>=s}let r=e.key?.toLowerCase()===n||We(n,e.code),i=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey?(t.metaKey?e.metaKey:!0)&&(t.ctrlKey?e.ctrlKey:!0)&&(t.shiftKey?e.shiftKey:!0)&&(t.altKey?e.altKey:!0):!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey;return r&&i}},Je=t=>!t||typeof t==`function`?{metaKey:e.R(),ctrlKey:!e.R(),shiftKey:!1,altKey:!1,key:null}:Ke(t),Ye=(t,n)=>{if(n.activationKey)return qe(n.activationKey)(t);let r=(e.R()?t.metaKey:t.ctrlKey)&&!t.shiftKey&&!t.altKey;return!!(t.key&&r&&Ue(t.key,t.code))},Xe=(e,r,i)=>{try{if(i.onOpenFile(e,r))return;n.t(e,r,i.transformOpenFileUrl).catch(n=>{t.u(n instanceof t.N?n:new t.N(e,r,n))})}catch(n){t.u(n instanceof t.N?n:new t.N(e,r,n))}},Ze=e=>{if(e.length===0)return{x:0,y:0,width:0,height:0};if(e.length===1)return e[0];let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x+a.width),i=Math.max(i,a.y+a.height);return{x:t,y:n,width:r-t,height:i-n}},Qe=t=>{let n=getComputedStyle(t),r={};for(let t of e.M)r[t]=n.getPropertyValue(t);return r},$e=t=>{let n={};for(let r of e.S)n[r]=t.getPropertyValue(r);return n},et=e=>{try{let t=e.parentElement;if(!t)return null;let n=e.namespaceURI,r=e.tagName.toLowerCase(),i=n&&n!==`http://www.w3.org/1999/xhtml`?e.ownerDocument.createElementNS(n,r):e.ownerDocument.createElement(r),a=`style`in i?i.style:null;a instanceof CSSStyleDeclaration&&a.setProperty(`display`,`none`,`important`),t.appendChild(i);try{return $e(getComputedStyle(i))}finally{i.remove()}}catch{return null}},tt=new Set([`display`,`width`,`height`]),F=(e,t,n)=>e.kind===`color`?!1:e.cssProperties.some(e=>tt.has(e))?I(e):e.cssProperties.every(e=>{let r=t[e],i=n[e];return r===void 0||i===void 0?!1:r===i}),I=t=>{if(t.kind===`color`)return!1;if(t.kind===`enum`)return t.key===`font-weight`?t.original===`400`:t.options[0]?.value===t.original;let{key:n,original:r}=t;return n.startsWith(`padding`)||n.startsWith(`margin`)||n.includes(`gap`)||n===`border-width`||n.endsWith(`-radius`)||n===`border-radius`?r===0:n===`opacity`?r===100:n===`letter-spacing`||n===`z-index`?r===0:e.O.has(n)?!1:!!(n===`width`||n===`height`||n===`width,height`||n.startsWith(`max-`)||n.startsWith(`min-`)||n===`line-height`)},nt=e=>{let t=e.trim();if(!t||t===`auto`||t===`normal`||t===`none`)return null;let n=Number.parseFloat(t);return Number.isFinite(n)?t.endsWith(`%`)?{value:n,unit:`%`}:t.endsWith(`rem`)||t.endsWith(`em`)?{value:n*16,unit:`px`}:t.endsWith(`px`)?{value:n,unit:`px`}:{value:n,unit:``}:null},rt=(n,r)=>{let i=nt(n[r]);if(i)return i;if(r===`line-height`){let r=nt(n[`font-size`]);return r?{value:e.y(r.value*t.Et),unit:r.unit||`px`}:null}return e.T.has(r)?{value:0,unit:`px`}:null},it=(e,t)=>{let n=rt(e,t[0]);if(!n)return null;for(let r=1;r<t.length;r++){let i=rt(e,t[r]);if(!i||i.unit!==n.unit||Math.abs(i.value-n.value)>=.5)return null}return n},at=(t,n)=>t===`opacity`?{value:Math.round(n.value*100),unit:`%`}:e.N.has(t)?{value:e.y(n.value),unit:``}:{value:e.y(n.value),unit:n.unit||`px`},ot=e=>e!==null,st=(e,t)=>{let n=t.map(t=>{let n=t.longhands.length===1?rt(e,t.longhands[0]):it(e,t.longhands);return n?{definition:t,value:n}:null}).filter(ot),r=new Map;for(let e of n)for(let t of e.definition.longhands){let n=r.get(t);(!n||e.definition.longhands.length>n.definition.longhands.length)&&r.set(t,e)}let i=new Set(r.values());return n.map(e=>({...e,isCanonical:i.has(e)}))},L=(t,n,r)=>t===`opacity`?{min:0,max:100}:t===`z-index`?{min:e.F,max:e.P}:t===`letter-spacing`?{min:-10,max:20}:t===`font-size`?{min:8,max:96}:t===`line-height`?{min:0,max:120}:t.includes(`radius`)?{min:0,max:96}:t===`width`||t===`height`||t===`width,height`||t.startsWith(`min-`)||t.startsWith(`max-`)?{min:0,max:Math.max(512,Math.ceil(n*2))}:e.O.has(t)?{min:e.k,max:512}:r===`%`?{min:0,max:100}:{min:t.startsWith(`margin`)?e.D:0,max:e.j},R=(t,n,r)=>{let i=at(t.key,n),a=i.unit===`px`&&Math.abs(i.value)>1e7,o=L(t.key,a?0:i.value,i.unit),s=i.value<0?o.min:o.max,c=a?s:i.value;return{kind:`numeric`,key:t.key,label:t.label,cssProperties:t.longhands,min:o.min,max:o.max,value:c,original:c,unit:i.unit,tailwindAliases:e.l(t.key),isPrioritized:!1,isDefault:!1,isCanonical:r}},z=(n,r,i,a=!1)=>{let o=e.B(i),s=o?e.H(o):null,c=s!==null&&s.alpha!==0;if(!c&&!a)return null;let l=c&&o?o:t.Ct;return{kind:`color`,key:n,label:r,cssProperties:[n],value:l,original:l,tailwindAliases:e.l(n),isPrioritized:a,isDefault:!1,isCanonical:!0}},B=(t,n,r)=>{let i=n.trim(),a=r??t.options;return!a||!a.some(e=>e.value===i)?null:{kind:`enum`,key:t.key,label:t.label,cssProperties:[t.key],value:i,original:i,options:a,tailwindAliases:e.l(t.key),isPrioritized:!1,isDefault:!1,isCanonical:!0}},ct=new Map(`background-color.color.padding.padding-left,padding-right.padding-top,padding-bottom.padding-top.padding-right.padding-bottom.padding-left.margin.margin-left,margin-right.margin-top,margin-bottom.margin-top.margin-right.margin-bottom.margin-left.font-family.font-size.font-weight.font-style.line-height.letter-spacing.text-transform.text-align.text-decoration-line.white-space.word-break.overflow-wrap.font-variant-numeric.border-radius.border-top-left-radius,border-top-right-radius.border-bottom-left-radius,border-bottom-right-radius.border-top-left-radius,border-bottom-left-radius.border-top-right-radius,border-bottom-right-radius.border-top-left-radius.border-top-right-radius.border-bottom-left-radius.border-bottom-right-radius.width,height.width.height.max-width.max-height.min-width.min-height.opacity.gap.row-gap.column-gap.border-width.border-top-width.border-right-width.border-bottom-width.border-left-width.border-color.align-items.justify-content.top,right,bottom,left.left,right.top,bottom.top.right.bottom.left.z-index`.split(`.`).map((e,t)=>[e,t])),lt=e=>ct.get(e.key)??1/0,ut=e=>e.map((e,t)=>({property:e,index:t})).sort((e,t)=>{let n=lt(e.property)-lt(t.property);return n===0?e.index-t.index:n}).map(e=>e.property),V=t=>{let n=Qe(t),r=getComputedStyle(t),i=$e(r),a=et(t),o=[],s=new Set,c=e=>{s.has(e.key)||(o.push(e),s.add(e.key))};for(let t of e.b)for(let e of st(n,t))c(R(e.definition,e.value,e.isCanonical));for(let t of e.A){let e=rt(n,t.key);e&&c(R({key:t.key,label:t.label,longhands:[t.key]},e,!0))}for(let{key:t,label:n,alwaysShow:i}of e.C){let a=r.getPropertyValue(t);if(!i&&(!a||e.V(a)))continue;let o=z(t,n,a,i);o&&c(o)}let l=r.getPropertyValue(e.E.key);if(l){let t=B(e.E,l,e.I(l));t&&c(t)}for(let t of e.w){let e=r.getPropertyValue(t.key);if(!e)continue;let n=B(t,e);n&&c(n)}return dt(o,e.c(t),i,a)},dt=(e,t,n,r)=>{let i=[],a=[];for(let o of e)if(o.isPrioritized||t.has(o.key))i.push({...o,isPrioritized:!0,isDefault:!1});else{let e=r?F(o,n,r):I(o);a.push({...o,isDefault:e})}return[...ut(i),...ut(a)]},ft=[{keyword:`letter`,family:`letter-spacing`},{keyword:`tracking`,family:`letter-spacing`},{keyword:`leading`,family:`line-height`},{keyword:`line-height`,family:`line-height`},{keyword:`lineheight`,family:`line-height`},{keyword:`radius`,family:`radius`},{keyword:`rounded`,family:`radius`},{keyword:`corner`,family:`radius`},{keyword:`font-size`,family:`font-size`},{keyword:`fontsize`,family:`font-size`},{keyword:`text`,family:`font-size`},{keyword:`stroke`,family:`border-width`},{keyword:`border-width`,family:`border-width`},{keyword:`borderwidth`,family:`border-width`},{keyword:`space`,family:`spacing`},{keyword:`gap`,family:`spacing`},{keyword:`gutter`,family:`spacing`},{keyword:`inset`,family:`spacing`},{keyword:`padding`,family:`spacing`},{keyword:`margin`,family:`spacing`},{keyword:`size`,family:`size`},{keyword:`width`,family:`size`},{keyword:`height`,family:`size`}],pt=e=>{let t=e.toLowerCase();for(let{keyword:e,family:n}of ft)if(t.includes(e))return n;return null},H=e=>e.includes(`radius`)?`radius`:e.endsWith(`-width`)&&e.includes(`border`)?`border-width`:e===`font-size`?`font-size`:e===`line-height`?`line-height`:e===`letter-spacing`?`letter-spacing`:e.startsWith(`padding`)||e.startsWith(`margin`)||e.endsWith(`gap`)||e===`top`||e===`right`||e===`bottom`||e===`left`||e.startsWith(`inset`)?`spacing`:e===`width`||e===`height`||e.startsWith(`min-`)||e.startsWith(`max-`)?`size`:null,mt=t=>{let n=nt(t);return!n||n.unit!==`px`?null:e.y(n.value)},U=(e,t)=>t===null?!0:e.length===t.length?e<t:e.length<t.length,ht=(e,t,n)=>{if(n===1){for(let n of e)if(n>t)return n;return null}for(let n=e.length-1;n>=0;n--)if(e[n]<t)return e[n];return null},gt=(e,t,n)=>{let r=(t===1?Math.floor(e/n)+1:Math.ceil(e/n)-1)*n;return r<0?null:r};let W=null;const _t=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),vt=()=>{let e=Array.from(document.adoptedStyleSheets??[]),t=document.styleSheets.length;if(W&&W.documentSheetCount===t&&_t(W.adoptedSheets,e))return W.names;let n=new Set;for(let t of[...document.styleSheets,...e]){let e;try{e=t.cssRules}catch{continue}yt(e,n)}return W={documentSheetCount:t,adoptedSheets:e,names:n},n},yt=(e,t)=>{for(let n of Array.from(e))if(n instanceof CSSStyleRule){let e=n.style;for(let n=0;n<e.length;n++){let r=e.item(n);r.startsWith(`--`)&&t.add(r)}}else n instanceof CSSGroupingRule&&yt(n.cssRules,t)},bt={hasTokens:!1,matchColor:()=>null,matchLength:()=>null,stepLength:()=>null},xt=t=>{if(typeof document>`u`)return bt;let n=vt();if(n.size===0)return bt;let r=getComputedStyle(t),i=new Map,a=new Map,o=new Map,s=null;for(let t of n){let n=r.getPropertyValue(t).trim();if(!n)continue;let c=mt(n);if(c!==null){t===`--spacing`&&c>0&&(s=c);let e=pt(t);if(e!==null){let n=a.get(c);n?n.push({name:t,family:e}):a.set(c,[{name:t,family:e}]);let r=o.get(e);r?r.add(c):o.set(e,new Set([c]))}continue}let l=e.B(n);if(l){let e=l.toLowerCase();U(t,i.get(e)??null)&&i.set(e,t)}}if(i.size===0&&a.size===0)return bt;let c=new Map;for(let[e,t]of o)c.set(e,Array.from(t).sort((e,t)=>e-t));return{hasTokens:!0,matchColor:t=>{let n=e.B(t)?.toLowerCase();return n?i.get(n)??null:null},matchLength:(e,t)=>{let n=H(t);if(n===null)return null;let r=a.get(Math.round(e));if(!r)return null;let i=null;for(let e of r)e.family===n&&U(e.name,i)&&(i=e.name);return i},stepLength:(e,t,n)=>{let r=H(n);if(r===null)return null;let i=Math.round(e),a=c.get(r);return a&&a.length>=2?ht(a,i,t):(r===`spacing`||r===`size`)&&s?gt(i,t,s):a?ht(a,i,t):null}}},St=t=>t.kind===`color`||t.kind===`enum`?t.value:t.key===`opacity`&&t.unit===`%`?e._(t.value/100):`${e._(t.value)}${t.unit}`,Ct=(e,t,n)=>{if(!n?.hasTokens)return null;let{edit:r}=t;return r.kind===`color`?n.matchColor(r.value):r.kind===`numeric`&&r.unit===`px`?n.matchLength(r.value,e):null},G=e=>{let t=new Map;for(let n of e.edits){let e=St(n);for(let r of n.cssProperties)t.set(r,{edit:n,cssValue:e})}let n=!1;return{lines:Array.from(t,([t,r])=>{let i=Ct(t,r,e.designTokens);i&&(n=!0);let a=i?` /* var(${i}) */`:``;return`${t}: ${r.cssValue};${a}`}),usesToken:n}},K=e=>e.filePath?`${e.filePath}:${e.lineNumber}`:``,wt=e=>["```css",...e,"```"].join(`
|
|
12
|
+
`),Tt=e=>{if(e.length===0)return``;let t=e.map(e=>{let{lines:t,usesToken:n}=G(e);return{header:K(e),cssLines:t,usesToken:n}}),n=[`Apply these style changes canonically (CSS = visual intent; choose the source change that best expresses the underlying layout intent):`];if(t.some(e=>e.usesToken)&&n.push("Prefer the design token shown in each `/* var(--token) */` comment over the raw value when it matches the project's intent."),t.length===1){let[e]=t;return e.header&&n.push(`\n${e.header}`),n.push(wt(e.cssLines)),n.join(`
|
|
13
|
+
`)}for(let e of t)n.push(e.header?`\n${e.header}`:``),n.push(wt(e.cssLines));return n.join(`
|
|
14
|
+
`)},Et=e=>`style`in e&&e.style instanceof CSSStyleDeclaration,q=e=>{let t=new Map,n=Et(e)?e:null;return{apply:(e,r)=>{if(n)for(let i of e)t.has(i)||t.set(i,{value:n.style.getPropertyValue(i),priority:n.style.getPropertyPriority(i)}),n.style.setProperty(i,r)},restore:()=>{if(!n){t.clear();return}for(let[e,{value:r,priority:i}]of t)r?n.style.setProperty(e,r,i):n.style.removeProperty(e);t.clear()},hasAppliedStyles:()=>t.size>0}},J=(e,t)=>{for(let n of t){let t=e.edits.findIndex(e=>e.key===n.key);t>=0?e.edits[t]=n:e.edits.push(n)}},Dt=(e,t)=>({element:e.element,preview:e.preview,filePath:e.filePath??``,lineNumber:e.lineNumber??0,edits:t,designTokens:e.designTokens}),Ot=r=>{let[i,a]=e.yt(null),[o,s]=e.yt(!1),c=[],l=[],u=e=>{l=e},d=()=>{let e=i()!==null;a(null),s(!1),c=[],l=[],e&&r.onClose?.()},f=()=>{i()?.preview.restore();for(let e=c.length-1;e>=0;e--)c[e].preview.restore();d()},p=e=>{n.o(e).then(t=>{t&&a(n=>!n||n.element!==e||n.componentName?n:{...n,componentName:t})})},m=(e,n,o={})=>{if(i()!==null)return!1;let s=V(e);if(s.length===0)return!1;let c=o.filePath??r.store.selectionFilePath??void 0,l=o.lineNumber??r.store.selectionLineNumber??void 0;return a({element:e,position:n,properties:s,preview:q(e),filePath:c,lineNumber:l,componentName:o.componentName,tagName:o.tagName??t.D(e),initialSearchQuery:o.initialSearchQuery,designTokens:xt(e)}),p(e),r.isActivated()||r.activateRenderer(),r.actions.setPointer(n),r.actions.setFrozenElement(e),r.actions.freeze(),r.onOpen?.(),!0},h=(e,o)=>{let s=i();if(!s||s.element===e)return!1;let u=V(e);return u.length===0?!1:((l.length>0||s.preview.hasAppliedStyles())&&c.push(Dt(s,l)),l=[],a({element:e,position:o,properties:u,preview:q(e),tagName:t.D(e),hasSessionEdits:c.some(e=>e.edits.length>0),designTokens:xt(e)}),n.l(e).then(t=>{if(t){for(let n of c)n.element===e&&!n.filePath&&(n.filePath=t.filePath,n.lineNumber=t.lineNumber??0);a(n=>!n||n.element!==e||n.filePath?n:{...n,filePath:t.filePath,lineNumber:t.lineNumber??void 0})}}).catch(()=>void 0),p(e),r.actions.setPointer(o),r.actions.setFrozenElement(e),!0)},g=(e,t)=>[...c,Dt(e,t)],_=e=>{let t=new Map;for(let n of e){if(n.edits.length===0)continue;let e=t.get(n.element);if(e){!e.filePath&&n.filePath&&(e.filePath=n.filePath,e.lineNumber=n.lineNumber),J(e,n.edits);continue}t.set(n.element,{filePath:n.filePath,lineNumber:n.lineNumber,edits:[...n.edits],designTokens:n.designTokens})}return Array.from(t.values())},v=e=>{let t=new Set;for(let n of e)n.edits.length>0&&t.add(n.element);for(let n=e.length-1;n>=0;n--){let r=e[n];r.edits.length===0&&!t.has(r.element)&&r.preview.restore()}};return{state:i,trigger:m,switchToElement:h,setPendingEdits:u,dismiss:()=>{i()!==null&&(f(),r.store.wasActivatedByToggle?r.deactivateRenderer():r.actions.unfreeze())},closePreservingRenderer:()=>{i()!==null&&(f(),r.actions.unfreeze())},submit:e=>{let t=i();if(!t)return;let n=t.element,a=g(t,e),o=Tt(_(a));v(a),d(),r.store.wasActivatedByToggle||r.actions.unfreeze(),r.performCopyWithLabel({element:n,cursorX:t.position.x,extraPrompt:o||void 0,shouldDeactivateAfter:r.store.wasActivatedByToggle})},resetWithDiscard:f,isOpen:()=>i()!==null,isInteracting:o,setInteracting:s}},kt={enabled:!0,hue:0,selectionBox:{enabled:!0},dragBox:{enabled:!0},grabbedBoxes:{enabled:!0},elementLabel:{enabled:!0},toolbar:{enabled:!0}},At=(e,t)=>({enabled:t.enabled??e.enabled,hue:t.hue??e.hue,selectionBox:{enabled:t.selectionBox?.enabled??e.selectionBox.enabled},dragBox:{enabled:t.dragBox?.enabled??e.dragBox.enabled},grabbedBoxes:{enabled:t.grabbedBoxes?.enabled??e.grabbedBoxes.enabled},elementLabel:{enabled:t.elementLabel?.enabled??e.elementLabel.enabled},toolbar:{enabled:t.toolbar?.enabled??e.toolbar.enabled}}),jt={activationMode:`toggle`,keyHoldDuration:100,allowActivationInsideInput:!0,activationKey:void 0,getContent:void 0,maxContextLines:3,freezeReactUpdates:!0},Mt=(n={})=>{let r=new Map,i=[],a={},o=!1,[s,c]=l({theme:kt,options:{...jt,...n},actions:[]}),u=e=>{let t=kt,r={...jt,...n},i=[];for(let{config:n}of e)if(n.theme&&(t=At(t,n.theme)),n.options&&(r={...r,...n.options}),n.actions)for(let e of n.actions)i.push(e);return{theme:t,options:r,actions:i}},d=e=>{c(`theme`,e.theme),c(`options`,{...e.options,...a}),c(`actions`,e.actions)},f=()=>{d(u(i))},p=(e,t)=>{a[e]=t,c(`options`,e,()=>t)},m=[`activationMode`,`keyHoldDuration`,`allowActivationInsideInput`,`activationKey`,`getContent`,`maxContextLines`,`freezeReactUpdates`],h=e=>{if(!o)for(let t of m)e[t]!==void 0&&p(t,e[t])},g=({plugin:e,config:n})=>{try{let r=n.cleanup?.();Promise.resolve(r).catch(n=>{t.u(new t.P(e.name,n))})}catch(n){t.u(new t.P(e.name,n))}},_=(e,n)=>{let r;try{r=e.setup?.(n,re)??{};let t=r.cleanup?.bind(r);return{...r,cleanup:t,theme:e.theme?r.theme?At(At(kt,e.theme),r.theme):e.theme:r.theme,options:e.options?{...e.options,...r.options}:r.options,actions:e.actions?[...e.actions,...r.actions??[]]:r.actions,hooks:e.hooks?{...e.hooks,...r.hooks}:r.hooks}}catch(n){throw r&&g({plugin:e,config:r}),new t.I(e.name,n)}},v=(e,n)=>{if(o)return;let a={plugin:e,config:_(e,n)},s=r.get(e.name),c=new Map(r);c.set(e.name,a);let l;try{l=u(c.values())}catch(n){throw g(a),new t.I(e.name,n)}r.set(e.name,a),i=Array.from(r.values()),d(l),s&&g(s)},y=e=>{if(o)return;let t=r.get(e);t&&(r.delete(e),i=Array.from(r.values()),g(t),f())},b=()=>{if(o)return;o=!0;let e=i;r.clear(),i=[],e.forEach(g),f()},x=()=>i.map(({plugin:e})=>e.name),S=(e,...n)=>{for(let{plugin:r,config:a}of i){let i=a.hooks?.[e];if(i)try{let a=i(...n);a&&Promise.resolve(a).catch(n=>{t.u(new t.F(r.name,String(e),n))})}catch(n){t.u(new t.F(r.name,String(e),n))}}},ee=(e,...n)=>{let r=!1;for(let{plugin:a,config:o}of i){let i=o.hooks?.[e];if(i)try{i(...n)===!0&&(r=!0)}catch(n){t.u(new t.F(a.name,String(e),n))}}return r},te=async(e,...n)=>{for(let{plugin:r,config:a}of i){let i=a.hooks?.[e];if(i)try{await i(...n)}catch(n){t.u(new t.F(r.name,String(e),n))}}},C=async(e,n,...r)=>{let a=n;for(let{plugin:n,config:o}of i){let i=o.hooks?.[e];if(i)try{a=await i(a,...r)}catch(r){t.u(new t.F(n.name,String(e),r))}}return a},ne=(e,n,...r)=>{let a=n;for(let{plugin:n,config:o}of i){let i=o.hooks?.[e];if(i)try{a=i(a,...r)}catch(r){t.u(new t.F(n.name,String(e),r))}}return a},re={onActivate:()=>S(`onActivate`),onDeactivate:()=>S(`onDeactivate`),onElementHover:e=>S(`onElementHover`,e),onElementSelect:e=>{let n=!1,r=[];for(let{plugin:a,config:o}of i){let i=o.hooks?.onElementSelect;if(i)try{let o=i(e);if(o){if(n=!0,o===!0)continue;r.push(o.catch(e=>(t.u(new t.F(a.name,`onElementSelect`,e)),!1)))}}catch(e){t.u(new t.F(a.name,`onElementSelect`,e))}}let a=r.length>0?Promise.all(r).then(e=>e.every(Boolean)):void 0;return{wasIntercepted:n,pendingResult:a}},onDragStart:(e,t)=>S(`onDragStart`,e,t),onDragEnd:(e,t)=>S(`onDragEnd`,e,t),onBeforeCopy:async e=>te(`onBeforeCopy`,e),transformCopyContent:async(e,t)=>C(`transformCopyContent`,e,t),onAfterCopy:(e,t)=>S(`onAfterCopy`,e,t),onCopySuccess:(e,t)=>S(`onCopySuccess`,e,t),onCopyError:e=>S(`onCopyError`,e),onStateChange:e=>S(`onStateChange`,e),onPromptModeChange:(e,t)=>S(`onPromptModeChange`,e,t),onSelectionBox:(e,t,n)=>S(`onSelectionBox`,e,t,n),onDragBox:(e,t)=>S(`onDragBox`,e,t),onGrabbedBox:(e,t)=>S(`onGrabbedBox`,e,t),onElementLabel:(e,t,n)=>S(`onElementLabel`,e,t,n),onContextMenu:(e,t)=>S(`onContextMenu`,e,t),onOpenFile:(e,t)=>ee(`onOpenFile`,e,t),transformHtmlContent:async(e,t)=>C(`transformHtmlContent`,e,t),transformAgentContext:async(e,t)=>C(`transformAgentContext`,e,t),transformActionContext:e=>ne(`transformActionContext`,e),transformOpenFileUrl:(e,t,n)=>ne(`transformOpenFileUrl`,e,t,n)};return e.bt()&&e.wt(b),{register:v,unregister:y,getPluginNames:x,setOptions:h,dispose:b,store:s,hooks:re}},Nt=e=>`${e}-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,Pt=e=>{let t=e.bounds.x+e.bounds.width/2,n=e.bounds.width/2,r=e.mouseX===void 0?void 0:e.mouseX-t;return{id:Nt(`label`),bounds:e.bounds,boundsMultiple:e.boundsMultiple,tagName:e.tagName,componentName:e.componentName,status:e.status,createdAt:Date.now(),element:e.element,elements:e.elements,mouseX:e.mouseX,mouseXOffsetFromCenter:r,mouseXOffsetRatio:r!==void 0&&n>0?r/n:void 0,hideArrow:e.hideArrow}},Ft=(e,n,r)=>{let i=new Map,a=e=>{let t=i.get(e);t!==void 0&&(window.clearTimeout(t),i.delete(e))},o=()=>{for(let e of i.values())window.clearTimeout(e);i.clear()},s=()=>{o(),e.clearLabelInstances(),r?.()},c=n=>{a(n);let r=window.setTimeout(()=>{e.updateLabelInstance(n,`fading`);let t=window.setTimeout(()=>{i.delete(n),e.removeLabelInstance(n)},125);i.set(n,t)},t.Tt);i.set(n,r)};return{createInstance:(t,n,r,i,a)=>{s();let o=Pt({bounds:t,tagName:n,componentName:r,status:i,element:a?.element,mouseX:a?.mouseX,elements:a?.elements,boundsMultiple:a?.boundsMultiple,hideArrow:a?.hideArrow});return e.addLabelInstance(o),o.id},createPerElementInstances:(n,r)=>{s();let i=[];for(let a of n){let n=Pt({bounds:t.Z(a.element),tagName:a.tagName,componentName:a.componentName,status:r,element:a.element,mouseX:a.mouseX});e.addLabelInstance(n),i.push(n.id)}return i},updateAfterCopy:(t,n,r)=>{n?(e.updateLabelInstance(t,`copied`),c(t)):(a(t),e.updateLabelInstance(t,`error`,r||`Unknown error`))},markRetrying:t=>{a(t),e.updateLabelInstance(t,`copying`)},dismissInstance:t=>{a(t),e.removeLabelInstance(t)},cancelAllFades:o,clearAll:s,handleHoverChange:(e,t)=>{if(t){a(e);return}let r=n().find(t=>t.id===e);r&&(r.status===`copied`||r.status===`fading`)&&c(e)}}},It=e=>{let t=window.innerWidth,n=window.innerHeight,r=Math.max(0,e.x),i=Math.min(t,e.x+e.width),a=Math.max(0,e.y),o=Math.min(n,e.y+e.height);return{x:(r+i)/2,y:(a+o)/2}},Lt=(n,r,i)=>{let a=[],o=(e,r)=>{let a=It(i(e)),o=t.p(a.x,a.y).filter(n),s=o.indexOf(e);return s===-1?null:o[s+r]??null},s=e=>{let t=o(e,1);return t&&(a.push(e),a.length>50&&(a=a.slice(-50))),t},c=t=>{if(a.length>0){let t=a.pop();if(e.K(t))return t}return o(t,-1)},l=(e,t)=>{let n=e=>t?e.nextElementSibling:e.previousElementSibling,i=n(e);for(;i;){if(r(i))return a=[],i;i=n(i)}return null};return{findNext:(e,t)=>{switch(e){case`ArrowUp`:return s(t);case`ArrowDown`:return c(t);case`ArrowRight`:return l(t,!0);case`ArrowLeft`:return l(t,!1);default:return null}},clearHistory:()=>{a=[]}}},Rt=e=>{let{metaKey:t,ctrlKey:n,shiftKey:r,altKey:i}=Je(e.activationKey);return{metaKey:t,ctrlKey:n,shiftKey:r,altKey:i}},zt=()=>{let e=new WeakSet,t=Object.getOwnPropertyDescriptor(KeyboardEvent.prototype,`key`),n=!1;if(t?.get&&!t.get.__reactGrabPatched){n=!0;let r=t.get,i=function(){return e.has(this)?``:r.call(this)};i.__reactGrabPatched=!0,Object.defineProperty(KeyboardEvent.prototype,`key`,{get:i,configurable:!0})}return{claimedEvents:e,originalKeyDescriptor:t,restore:()=>{n&&t&&Object.defineProperty(KeyboardEvent.prototype,`key`,t)}}},Bt=(e,t)=>({top:t<25,bottom:t>window.innerHeight-25,left:e<25,right:e>window.innerWidth-25}),Vt=(e,n,r)=>{let i=null,a=()=>{if(!n()){o();return}let s=e(),c=Bt(s.x,s.y),l=0,u=0;if(c.top&&(u-=10),c.bottom&&(u+=10),c.left&&(l-=10),c.right&&(l+=10),l!==0||u!==0){let e=window.scrollX,t=window.scrollY;window.scrollBy(l,u);let n=window.scrollX-e,i=window.scrollY-t;(n!==0||i!==0)&&r?.({x:n,y:i})}i=c.top||c.bottom||c.left||c.right?t.C(a):null},o=()=>{i!==null&&(t.S(i),i=null)};return{start:a,stop:o,isActive:()=>i!==null}},Ht=()=>{let e=globalThis;return!!(e.chrome?.runtime?.id||e.browser?.runtime?.id)},Ut=e=>{try{let t=`0.1.48-dev.edbb603`,n=`data:image/svg+xml;base64,${btoa(`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 294 294"><path fill="#ff40e0" d="M145 47c25-20 50-27 67-17 16 9 23 30 20 60 0 2-1 5-1 7l-2 13h-1l-12-4c-8-3-17-5-25-6l-17-3c-10-1-20-1-29-1-10 0-20 0-29 1-6 8-11 16-16 24-5 9-9 17-13 26 4 9 8 18 13 26s10 16 16 24l11 14c5 7 11 13 18 19l10 8s-1 0 0 0l-11 9c-17 14-35 22-49 22-6 0-13-2-18-5-16-9-23-30-20-59 1-3 1-5 1-8-30-12-48-29-48-50 0-18 14-35 41-47 2-1 5-2 7-3 0-2 0-5-1-7-3-30 4-51 20-60 18-10 42-3 68 17M71 201c-1 2-1 4-1 5-2 24 3 41 13 47h1c11 7 30 1 51-15-10-9-18-18-26-29-13-1-26-4-38-8m9-38c-3 9-5 17-7 26 8 2 17 4 25 6-3-5-6-10-9-16-3-5-6-10-9-16m-19-53c-2 1-3 1-5 2-21 10-34 23-34 35 0 13 14 27 39 37 3-12 7-25 12-37-5-12-9-24-12-37m37-10c-8 1-17 3-25 6 2 8 4 16 7 25 3-5 6-11 9-16zm-3-61c-4-1-8 0-12 2-10 7-15 24-13 47 0 2 0 3 1 5 12-4 25-6 38-8 8-10 16-20 26-29-15-11-29-17-40-17m111 2c-4-2-8-3-12-2-11 0-25 5-40 17 10 9 19 19 26 29 13 2 26 4 39 8v-5c3-23-2-40-13-47m-61 23c-7 6-13 13-19 19h37c-6-6-12-13-18-19"/><mask id="a"><path fill="#fff" d="m235 85-133 27 28 133 133-27Z"/></mask><path fill="#ff40e0" d="m137 130 76 11c8 1 9 11 3 15l-28 16-4 32c-1 8-10 10-14 4l-41-66c-3-6 1-13 8-12" mask="url(#a)"/></svg>`)}`;console.log(`%cReact Grab${` v${t}`}%c\nhttps://react-grab.com`,`background: #330039; color: #ffffff; border: 1px solid #d75fcb; padding: 4px 4px 4px 24px; border-radius: 4px; background-image: url("${n}"); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px center; display: inline-block; margin-bottom: 4px;`,``),e&&navigator.onLine&&!Ht()&&fetch(`https://www.react-grab.com/api/version?source=browser&v=${t}&t=${Date.now()}`,{referrerPolicy:`origin`,keepalive:!0,priority:`low`,cache:`no-store`}).then(e=>e.text()).then(e=>{e&&e!==t&&console.warn(`[React Grab] v${t} is outdated (latest: v${e}). Run \`npx grab@latest upgrade\` to upgrade.`)}).catch(()=>null)}catch{}},Wt=e=>typeof e==`object`&&!!e,Gt=e=>{if(!Wt(e))return null;let t={};return typeof e.enabled==`boolean`&&(t.enabled=e.enabled),(e.activationMode===`toggle`||e.activationMode===`hold`)&&(t.activationMode=e.activationMode),typeof e.keyHoldDuration==`number`&&Number.isFinite(e.keyHoldDuration)&&(t.keyHoldDuration=e.keyHoldDuration),typeof e.allowActivationInsideInput==`boolean`&&(t.allowActivationInsideInput=e.allowActivationInsideInput),typeof e.activationKey==`string`&&(t.activationKey=e.activationKey),typeof e.maxContextLines==`number`&&Number.isFinite(e.maxContextLines)&&(t.maxContextLines=e.maxContextLines),typeof e.freezeReactUpdates==`boolean`&&(t.freezeReactUpdates=e.freezeReactUpdates),typeof e.telemetry==`boolean`&&(t.telemetry=e.telemetry),Object.keys(t).length===0?null:t},Kt=()=>{if(typeof window>`u`)return null;try{let e=(document.currentScript instanceof HTMLScriptElement?document.currentScript:null)?.getAttribute(`data-options`);return e?Gt(JSON.parse(e)):null}catch{return null}},qt=e=>e===`Enter`||e===`NumpadEnter`,Jt=(e,t)=>e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height,Yt=(e=>({name:e.name,setup:(t,n)=>({actions:[typeof e.contextMenuAction==`function`?e.contextMenuAction(t,n):e.contextMenuAction],cleanup:e.cleanup})}))({name:`copy`,contextMenuAction:{id:`copy`,label:`Copy`,shortcut:`C`,showInToolbarMenu:!0,onAction:e=>{e.copy?.()}}}),Xt={name:`comment`,setup:()=>({actions:[{id:`comment`,label:`Comment`,shortcut:`Enter`,shortcutModifier:!1,showInToolbarMenu:!0,onAction:e=>{e.enterPromptMode?.()}}]})},Zt={name:`edit`,setup:()=>({actions:[{id:`edit`,label:`Style`,shortcut:`S`,shortcutModifier:!1,showInToolbarMenu:!0,onAction:e=>{e.enterEditMode?.()}}]})},Qt={name:`open`,actions:[{id:`open`,label:`Open`,shortcut:`O`,enabled:e=>!!e.filePath,onAction:e=>{e.filePath&&(Xe(e.filePath,e.lineNumber,e.hooks),e.hideContextMenu(),e.cleanup())}}]},$t=e=>{let t=e.left+e.width/2,n=e.top+e.height/2,r=n,i=window.innerHeight-n,a=t,o=window.innerWidth-t,s=Math.min(r,i,a,o);return s===r?`top`:s===a?`left`:s===o?`right`:`bottom`},en=()=>{let[t,n]=e.yt(!1),[r,i]=e.yt(null),a=e.r(),o=()=>{let t=r();return e.K(t)?t:null},s=()=>{i(null),a.clear(),n(!1)};return{selectedElement:o,isPendingDismiss:t,select:(e,t)=>{i(e),n(!1),t?.shouldPromptBeforeMouseHandoff?a.arm():a.clear()},clear:s,consumeMouseHandoff:()=>a.consume()&&o()!==null,showDismissPrompt:()=>o()?t()?!1:(n(!0),!0):(s(),!1),takeSelection:t=>{let n=o()??(e.K(t)?t:null);return s(),n}}},Y=e=>{t.u(new t.R(`Toolbar state change subscriber failed`,e))},tn=(e,t)=>{for(let n of e)try{Promise.resolve(n(t)).catch(Y)}catch(e){Y(e)}},X=(e,t)=>{try{e()}catch(e){t.push(e)}},nn=e=>{let n=new Map,r=new Map,i=new Map,a=new Map,o=(e,t)=>{let o=i.get(e);o&&(i.delete(e),X(()=>o.disconnect(),t));for(let n of[...i.keys()])`host`in n&&n.ownerDocument===e&&s(n,t);for(let n of[...a.keys()])n.ownerDocument===e&&c(n,t);let l=r.get(e);r.delete(e),l&&X(l,t);let u=n.get(e);n.delete(e),u&&X(u,t)},s=(e,t)=>{let n=i.get(e);if(n){i.delete(e),X(()=>n.disconnect(),t);for(let n of e.querySelectorAll(`*`))l(n,t)}},c=(e,n)=>{let r=a.get(e);r&&(a.delete(e),X(()=>r.abortController.abort(),n),X(()=>e.removeAttribute(t.Zt),n),r.document&&o(r.document,n))},l=(e,n)=>{t.et(e)&&c(e,n),e.shadowRoot&&s(e.shadowRoot,n)},u=(e,t)=>{for(let n of e.querySelectorAll(`*`))l(n,t);l(e,t)},d=t=>{n.has(t)||(n.set(t,e(t)),f(t),g(t))},f=e=>{let t=e.defaultView?.Element.prototype;if(!t)return;let i=t.attachShadow,a=new Proxy(i,{apply:(t,r,i)=>{let a=Reflect.apply(t,r,i);return a.mode===`open`&&r.isConnected&&n.has(e)&&g(a),a}});t.attachShadow=a,r.set(e,()=>{t.attachShadow===a&&(t.attachShadow=i)})},p=e=>{if(a.has(e))return;let n={abortController:new AbortController,document:null};a.set(e,n);let r=()=>{let r=[],i=t.x(e);if(n.document&&n.document!==i&&o(n.document,r),n.document=i,!i){e.removeAttribute(t.Zt),t.l(r,`Cleaning up replaced frame document failed`);return}e.setAttribute(t.Zt,``),d(i),t.l(r,`Cleaning up replaced frame document failed`)};e.addEventListener(`load`,r,{signal:n.abortController.signal}),r()},m=e=>{t.y(e)||(t.et(e)&&p(e),e.shadowRoot&&g(e.shadowRoot))},h=e=>{if(m(e),!t.y(e))for(let t of e.querySelectorAll(`*`))m(t)},g=e=>{if(i.has(e))return;let n=`defaultView`in e?e.defaultView:e.ownerDocument.defaultView;if(!n)return;let r=new n.MutationObserver(e=>{let n=[];for(let r of e){for(let e of r.removedNodes)t.nt(e)&&u(e,n);for(let e of r.addedNodes)t.nt(e)&&h(e)}t.l(n,`Cleaning up removed frame documents failed`)});i.set(e,r),r.observe(e,{childList:!0,subtree:!0});for(let t of e.querySelectorAll(`*`))m(t)};return d(document),()=>{let e=[];for(let t of[...a.keys()])c(t,e);for(let[t,n]of i)i.delete(t),X(()=>n.disconnect(),e);for(let[t,n]of r)r.delete(t),X(n,e);for(let[t,r]of n)n.delete(t),r&&X(r,e);t.l(e,`Cleaning up same-origin frame documents failed`)}},rn=(e,t)=>{window.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),e.stopImmediatePropagation())},an=(e,t,n)=>({bubbles:!0,cancelable:!0,composed:!0,clientX:t,clientY:n,screenX:e.screenX,screenY:e.screenY,button:e.button,buttons:e.buttons,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}),on=e=>{let n=t.$(e.view,e.clientX,e.clientY);rn(e,new PointerEvent(e.type,{...an(e,n.x,n.y),pointerId:e.pointerId,pointerType:e.pointerType,isPrimary:e.isPrimary,pressure:e.pressure,tangentialPressure:e.tangentialPressure,tiltX:e.tiltX,tiltY:e.tiltY,twist:e.twist,width:e.width,height:e.height}))},sn=e=>{let n=t.$(e.view,e.clientX,e.clientY);rn(e,new MouseEvent(e.type,an(e,n.x,n.y)))},cn=e=>{rn(e,new KeyboardEvent(e.type,{bubbles:!0,cancelable:!0,composed:!0,key:e.key,code:e.code,location:e.location,repeat:e.repeat,isComposing:e.isComposing,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}))},ln=e=>nn(n=>{if(n===document)return;let r=n.defaultView;if(!r)return;let i=new AbortController,a=t.c(n),o=t.a(n),s={capture:!0,signal:i.signal},c=t=>{e.shouldForwardInteraction()&&on(t)},l=t=>{e.shouldForwardInteraction()&&sn(t)},u=t=>{(e.shouldForwardInteraction()||e.shouldForwardKeyboardEvent(t))&&cn(t)},d=t=>{e.shouldForwardInteraction()&&e.shouldForwardViewportEvent(n)&&window.dispatchEvent(new Event(t.type))};return r.addEventListener(`pointermove`,c,s),r.addEventListener(`pointerdown`,c,s),r.addEventListener(`pointerup`,c,s),r.addEventListener(`pointercancel`,c,s),r.addEventListener(`contextmenu`,l,s),r.addEventListener(`click`,l,s),r.addEventListener(`keydown`,u,s),r.addEventListener(`keyup`,u,s),r.addEventListener(`keypress`,u,s),r.addEventListener(`scroll`,d,s),r.addEventListener(`resize`,d,s),()=>{i.abort();let e=[];for(let t of[a,o])try{t()}catch(t){e.push(t)}t.l(e,`Cleaning up frame event forwarding failed`)}}),un=(e,n)=>{let r=n.ownerDocument;for(;r;){if(r===e)return!0;r=t.mn(r.defaultView)?.ownerDocument??null}return!1};let dn=null;const fn=new Map,pn=()=>typeof window>`u`?dn:window.__REACT_GRAB__??dn??null,mn=e=>{if(dn=e,typeof window<`u`&&(e?window.__REACT_GRAB__=e:delete window.__REACT_GRAB__),e)for(let[n,r]of fn){fn.delete(n);try{e.registerPlugin(r)}catch(e){t.u(e instanceof t.I?e:new t.I(n,e))}}},hn=e=>{dn===e&&(dn=null),typeof window<`u`&&window.__REACT_GRAB__===e&&delete window.__REACT_GRAB__},gn=e=>{let t=pn();if(t){t.registerPlugin(e);return}fn.set(e.name,e)},_n=e=>{let t=pn();if(t){t.unregisterPlugin(e);return}fn.delete(e)},vn=async(e,t={})=>(await Promise.allSettled(e.map(e=>n.r(e,t)))).map(e=>e.status===`fulfilled`?e.value:``),yn=[Yt,Zt,Xt,Qt],bn={status:`cancelled`};let xn=!1;const Sn=new Set,Cn=i=>{if(typeof window>`u`)return ve();let a={enabled:!0,activationMode:`toggle`,keyHoldDuration:100,allowActivationInsideInput:!0,...Kt(),...i};if(a.enabled===!1||xn)return ve();xn=!0,t.fn(a.container??null),Ut(a.telemetry!==!1);let{enabled:o,telemetry:s,container:c,...l}=a;return e.vt(i=>{let a=!1,o=new AbortController,s=null,c,u=Mt(l),{store:f,actions:p,pointer:m,viewportVersion:h,current:g}=ee({keyHoldDuration:u.store.options.keyHoldDuration??100}),_=e.ht(()=>g().state===`holding`),v=e.ht(()=>g().state===`active`),y=e.ht(()=>{let e=g();return e.state===`active`&&e.phase===`frozen`}),b=e.ht(()=>{let e=g();return e.state===`active`&&(e.phase===`dragging-select`||e.phase===`dragging-reposition`)}),x=e.ht(()=>{if(!b())return!1;let e=Math.abs(m().x+window.scrollX-f.dragStart.x),t=Math.abs(m().y+window.scrollY-f.dragStart.y);return e>2||t>2}),S=e.ht(()=>{let e=g();return e.state===`active`&&e.phase===`dragging-reposition`}),te=e.ht(()=>{let e=g();return e.state===`active`&&e.phase===`justDragged`}),C=e.ht(()=>g().state===`copying`),w=e.ht(()=>f.selectionInteractionLockDepth>0),ie=e.ht(()=>g().state===`justCopied`),T=e.ht(()=>{let e=g();return e.state===`active`&&!!e.isPromptMode}),ae=e.ht(()=>f.pendingCommentMode||T()),oe=e.ht(()=>{let e=g();return e.state===`active`&&!!e.isPromptMode&&!!e.isPendingDismiss}),se=new Map,ce=(e,t)=>{se.has(e)||se.set(e,document.body.style[e]),document.body.style[e]=t},le=e=>{let t=se.get(e);t!==void 0&&(document.body.style[e]=t,se.delete(e))};e.mt(e.Ct(v,(e,n)=>{e&&!n?(t.r(m().x,m().y),ce(`touchAction`,`none`)):!e&&n&&(t.i(),le(`touchAction`))}));let ue=e.o(),[E,de]=e.yt(ue?!ue.collapsed:!0),[fe,pe]=e.yt(0),[me,he]=e.yt(0),[D,ge]=e.yt(ue),[O,ve]=e.yt(!1),xe=e.a(e=>e.shiftKey),[k,we]=e.yt(null),[Te,Ee]=e.yt(null),[De,ke]=e.yt(null),A=Ot({store:f,actions:p,isActivated:v,activateRenderer:()=>Bn(),deactivateRenderer:()=>Q(),performCopyWithLabel:e=>Zt(e),onOpen:()=>{Ei(),N?.(),N=Ti(wi,Ee)},onClose:()=>{N?.(),N=null,Ee(null)}}),j=e.ht(()=>f.contextMenuPosition!==null||A.isOpen()),Ae=e.ht(()=>j()||k()!==null),je,M=null,N=null,Me=!1,Be=new WeakMap,P=en(),He=()=>!E()||T()||w()||j()||P.isPendingDismiss(),We=()=>{Be=new WeakMap},Ge=()=>{ct(!1),We()},Ke=t=>{let n=D()??e.o(),r={edge:n?.edge??`bottom`,ratio:n?.ratio??.5,collapsed:n?.collapsed??!1,enabled:n?.enabled??!0,defaultAction:n?.defaultAction??`copy`,...t};e.s(r),ge(r),tn(Sn,r)},Je=()=>{R.timerId!==null&&(clearTimeout(R.timerId),R.timerId=null)},Qe=()=>{R.copyWaiting=!1,R.holdTimerFired=!1,R.startTimestamp=null};e.mt(()=>{if(g().state!==`holding`){Je();return}R.startTimestamp=Date.now(),R.timerId=window.setTimeout(()=>{if(R.timerId=null,R.copyWaiting){R.holdTimerFired=!0;return}p.activate()},f.keyHoldDuration),e.wt(Je)}),e.mt(()=>{let n=g();if(n.state!==`active`||n.phase!==`justDragged`)return;let r=setTimeout(()=>{p.finishJustDragged()},t.Tt);e.wt(()=>clearTimeout(r))}),e.mt(()=>{if(g().state!==`justCopied`)return;let n=setTimeout(()=>{p.finishJustCopied()},t.Tt);e.wt(()=>clearTimeout(n))}),e.mt(e.Ct(_,(e,t=!1)=>{!t||e||!v()||(u.store.options.activationMode!==`hold`&&p.setWasActivatedByToggle(!0),u.hooks.onActivate())}));let $e=(e,t,n)=>{tt(e,t,n),p.clearInputText()},et=()=>{let e=f.frozenElement||Y();e&&p.enterPromptMode({x:m().x,y:m().y},e)},tt=(e,t,n)=>{p.setCopyStart({x:t,y:n},e)},F={lastDetectionTimestamp:0,pendingDetectionScheduledAt:0,latestPointerX:0,latestPointerY:0},I=null,[nt,rt]=e.yt(null),[it,at]=e.yt(0),ot=(e,t)=>{I!==null&&clearTimeout(I),rt(null),I=window.setTimeout(()=>{rt({x:e,y:t}),I=null},32)},st=()=>{I!==null&&(clearTimeout(I),I=null),rt(null),kn()},L=null,R={timerId:null,startTimestamp:null,copyWaiting:!1,holdTimerFired:!1},z=null,[B,ct]=e.yt(!1),lt=0,ut=!1,V=null,dt=()=>{ut=!0,V!==null&&window.clearTimeout(V),V=window.setTimeout(()=>{ut=!1,V=null},t.Tt)},ft=()=>{V!==null&&(window.clearTimeout(V),V=null),ut=!1},pt=0,H=null,mt=null,[U,ht]=e.yt(!1),[gt,W]=e.yt(null),[_t,vt]=e.yt(null),[yt,bt]=re(_t),xt=e.ht(()=>A.isOpen()?t.mt:ae()?t.st:U()?gt():v()?t.lt:null),St=e=>Ve(e,t.v),Ct=Lt(t.v,St,t.Z),G=Vt(m,()=>b(),e=>{if(S()){if(p.shiftDragStart(e),z){z={x:z.x+e.x,y:z.y+e.y};return}let{pageX:t,pageY:n}=vn(m().x,m().y);z={x:t,y:n}}}),K=e.ht(()=>v()&&!C()),wt=new Map,Tt=(e,n)=>{let r=Nt(`grabbed`),i={id:r,bounds:e,createdAt:Date.now(),element:n};p.addGrabbedBox(i),u.hooks.onGrabbedBox(e,n);let a=window.setTimeout(()=>{wt.delete(r),p.removeGrabbedBox(r)},t.Tt+125);wt.set(r,a)},Et=async e=>{let r=await Promise.all(e.map(async e=>{let r=await n.l(e),i=r?.componentName??null,a=r?.filePath,o=r?.lineNumber??void 0,s=r?.columnNumber??void 0;i||=n.i(e);let c=t.tt(e)?e.innerText?.slice(0,100):void 0;return{tagName:t.D(e),id:e.id||void 0,className:e.getAttribute(`class`)||void 0,textContent:c,componentName:i??void 0,filePath:a,lineNumber:o,columnNumber:s}}));a||window.dispatchEvent(new CustomEvent(`react-grab:element-selected`,{detail:{elements:r}}))},q=new Map,J=Ft(p,()=>f.labelInstances,()=>q.clear()),Dt=e=>{for(let t of e)f.labelInstances.find(e=>e.id===t)?.status===`copying`&&(q.delete(t),J.dismissInstance(t))},kt=()=>{o.abort()},At=()=>(o.signal.aborted&&!a&&(o=new AbortController),o.signal),jt=()=>(kt(),At()),Pt=()=>{kt(),s=null,Dt(f.labelInstances.filter(e=>e.status===`copying`).map(e=>e.id))},It=async(e,t,n)=>{let r,i;try{if(r=await e(n),r.status===`cancelled`)return r;r.status===`failed`&&(i=`Failed to copy`)}catch(e){if(n.aborted)return bn;r={status:`failed`},i=be(e,`Action failed`)}if(t)for(let e of t)J.updateAfterCopy(e,r.status===`succeeded`,i);return r},Ht=(e,t,n,r)=>{if(e){for(let e of n)q.delete(e);return}let i={operation:t,siblingIds:new Set(n),shouldDeactivateAfter:r};for(let e of n)q.set(e,i)},Ut=async(e,t,n,r=jt())=>{if(r.aborted)return!1;ft(),g().state!==`copying`&&p.startCopy();let i=await It(e,t,r);if(i.status===`cancelled`)return!1;let a=i.status===`succeeded`;return t&&Ht(a,e,t,!!n),g().state===`copying`?(a&&p.completeCopy(),n?Q():a?(p.activate(),dt()):(p.activate(),p.unfreeze()),!0):!0},Wt=e=>{let t=q.get(e);if(!t)return;let n=[...t.siblingIds];for(let e of n)J.markRetrying(e),q.delete(e);Ut(t.operation,n,t.shouldDeactivateAfter).then(e=>{e||Dt(n)})},Gt=e=>{q.get(e)?.siblingIds.delete(e),q.delete(e),J.dismissInstance(e)},Kt=(e,r,i,a)=>{let o=e[0],s=a??(o?n.i(o):null),c=o?t.D(o):null,l=s??c??void 0;return Oe({getContent:u.store.options.getContent,componentName:l,maxContextLines:u.store.options.maxContextLines,signal:r},u.hooks,e,i)},Yt=async(e,n,r,i=At())=>{if(e.length===0||i.aborted)return bn;let a=[],o=[];for(let n of e){let{wasIntercepted:e,pendingResult:r}=u.hooks.onElementSelect(n);e||a.push(n),r&&o.push(r),u.store.theme.grabbedBoxes.enabled&&Tt(t.Z(n),n)}if(await t.w(),i.aborted)return bn;let s;if(a.length>0&&(s=await Kt(a,i,n,r),s.status===`cancelled`))return s;if(o.length>0){let e=await Ce(Promise.all(o),i);if(e===Se)return s?.status===`succeeded`?s:bn;if(!e.every(Boolean))throw new t.A}return i.aborted&&!s?bn:(Et(e).catch(e=>{t.u(new t.R(`Element selection notification failed`,e))}),s??{status:`succeeded`})},Xt=e=>{let r=jt(),i={},o=!1;s=i,n.o(e.primaryElement).then(async t=>{if(r.aborted||s!==i){Dt(e.labelInstanceIds);return}s=null,o=!0,await Ut(n=>Yt(e.targetElements,e.extraPrompt,t??void 0,n),e.labelInstanceIds.length>0?e.labelInstanceIds:null,e.shouldDeactivateAfter,r)?e.onComplete?.():Dt(e.labelInstanceIds)}).catch(c=>{if(r.aborted){Dt(e.labelInstanceIds);return}if(a||!o&&s!==i)return;t.u(new t.R(`Copy operation failed`,c));let l=be(c,`Action failed`);for(let t of e.labelInstanceIds)J.updateAfterCopy(t,!1,l);e.labelInstanceIds.length>0&&Ht(!1,t=>n.o(e.primaryElement).then(n=>t.aborted?bn:Yt(e.targetElements,e.extraPrompt,n??void 0,t)),e.labelInstanceIds,!!e.shouldDeactivateAfter),g().state===`copying`&&(e.shouldDeactivateAfter?Q():(p.activate(),p.unfreeze()))}).finally(()=>{s===i&&(s=null)})},Zt=e=>{let{element:n,cursorX:r,selectedElements:i,extraPrompt:a,shouldDeactivateAfter:o,onComplete:s,dragRect:c}=e,l=i??[n],u=c??f.frozenDragRect,d=l.length>1,m=!d&&n===cn()?_n():void 0,h=u&&d?Ie(u):m??t.Z(n),g=d?h.x+h.width/2:r,_=t.D(n);ft(),p.startCopy();let v=_?J.createInstance(h,_,void 0,`copying`,{element:n,mouseX:g,elements:i}):null;Xt({primaryElement:n,targetElements:l,labelInstanceIds:v?[v]:[],extraPrompt:a,shouldDeactivateAfter:o,onComplete:s})},Qt=e=>{let{elements:t,labelEntries:n,shouldDeactivateAfter:r,onComplete:i}=e,a=t[0];ft(),p.startCopy(),Xt({primaryElement:a,targetElements:t,labelInstanceIds:J.createPerElementInstances(n,`copying`),shouldDeactivateAfter:r,onComplete:i})},Y=e.ht(()=>{if(h(),!K()||x()||w()||P.isPendingDismiss())return null;let t=f.detectedElement;return e.K(t)?t:null}),X=e.ht(()=>f.frozenElement||(y()?null:Y())),nn=e.ht(()=>!v()||T()||B()||C()||Ae()||P.isPendingDismiss()?null:xe()?y()?X():Y()??f.frozenElement:P.selectedElement()),rn=e.ht(()=>{let e=nn();return e?ze(e,t.v,St):[]}),an=e.ht(()=>{let e=nn();return e?Math.max(0,rn().findIndex(t=>t.element===e)):0}),on=e.ht(()=>nn()!==null);e.mt(()=>{if(!f.detectedElement)return;let t=1,n=setInterval(()=>{if(e.K(f.detectedElement)||p.relinkLiveElements(),!e.K(f.detectedElement)){if(t>0){--t;return}Ir()}},100);e.wt(()=>clearInterval(n))}),e.mt(e.Ct(X,e=>{if(H!==null&&(clearTimeout(H),H=null),!e){vt(null);return}H=window.setTimeout(()=>{H=null,vt(e)},100)})),e.wt(()=>{H!==null&&(clearTimeout(H),H=null)}),e.mt(()=>{let n=f.frozenElements;e.wt(t.s(n))}),e.mt(e.Ct(v,n=>{n&&u.store.options.freezeReactUpdates&&e.wt(t.t())}));let sn=()=>{if(f.isTouchMode&&b()){let n=f.detectedElement;return!e.K(n)||t.b(n)?void 0:n}let n=X();if(!(!n||t.b(n)))return n},cn=e.ht(()=>sn()),dn=()=>cn()?f.isTouchMode&&b()?K():K()&&!x():!1,fn=e.xt(()=>f.frozenElements,n=>e.ht(()=>(h(),t.Z(n)))),pn=e.ht(()=>{let e=f.frozenElements;if(e.length===0)return[];let t=f.frozenDragRect;return t&&e.length>1?[Ie(t)]:fn().map(e=>e())}),mn=e.ht(()=>{if(!B()||f.pendingCommentMode||U())return null;let n=f.detectedElement;return!e.K(n)||t.b(n)||f.frozenElements.includes(n)?null:n}),gn=e.ht(()=>{h();let e=mn();if(e)return t.Z(e)}),_n=e.ht(()=>{h();let e=f.frozenElements;if(e.length>0){let t=pn();if(e.length===1){let e=t[0];if(e)return e}let n=f.frozenDragRect;return n?t[0]??Ie(n):Re(Ze(t))}let n=cn();if(n)return t.Z(n)}),vn=(e,t)=>({pageX:e+window.scrollX,pageY:t+window.scrollY}),Cn=(e,t)=>{let{pageX:n,pageY:r}=vn(e,t);return{x:Math.abs(n-f.dragStart.x),y:Math.abs(r-f.dragStart.y)}},wn=(e,t)=>{let{pageX:n,pageY:r}=vn(e,t),i=Math.min(f.dragStart.x,n),a=Math.min(f.dragStart.y,r),o=Math.abs(n-f.dragStart.x),s=Math.abs(r-f.dragStart.y);return{x:i-window.scrollX,y:a-window.scrollY,width:o,height:s}},Tn=e=>e.code===`Space`||e.key===` `,En=()=>{if(!b())return;p.startDragReposition();let{pageX:e,pageY:t}=vn(m().x,m().y);z={x:e,y:t}},Dn=()=>{p.stopDragReposition(),z=null},On=e.ht(()=>{if(h(),x())return Re(wn(m().x,m().y))}),kn=e.ht(()=>{if(it(),!x())return[];let e=nt();if(!e)return[];let n=wn(e.x,e.y),r=Ne(n,t.v);return r.length>0?r:Ne(n,t.v,!1)}),An=e.ht(()=>(h(),kn().map(e=>t.Z(e)))),jn=e.ht(()=>{let e=An();if(e.length>0)return e;let t=gn();return t?[...pn(),t]:pn()}),Mn=e.xt(()=>f.frozenElements,r=>{let i=t.D(r)||`element`,a=n.i(r)??void 0;return{read:e.ht(()=>{if(h(),!e.K(r))return null;let n=t.Z(r),o=Be.get(r);return{tagName:i,componentName:a,bounds:n,mouseX:o===void 0?void 0:n.x+n.width*o}})}}),Nn=e.ht(()=>{if(T()||f.frozenElements.length<2)return[];let e=[];for(let t of Mn())t.read()!==null&&e.push(t);return e}),Pn=e.ht(()=>{if(T())return null;let e=mn();return e?(h(),{tagName:t.D(e)||`element`,componentName:n.i(e)??void 0,bounds:t.Z(e),mouseX:m().x}):null}),Fn=e.ht(()=>{if(C()||T()){h();let e=f.frozenElement||Y();return e?{x:d(t.Z(e)).x+f.copyOffsetFromCenterX,y:f.copyStart.y}:{x:f.copyStart.x,y:f.copyStart.y}}return{x:m().x,y:m().y}}),In=e.ht(()=>{if(!B()||f.frozenElements.length!==1)return;h();let n=f.frozenElements[0];if(!e.K(n))return;let r=Be.get(n);if(r===void 0)return;let i=t.Z(n);return i.x+i.width*r});e.mt(e.Ct(()=>[Y(),f.lastGrabbedElement],([e,t])=>{t&&e&&t!==e&&p.setLastGrabbed(null),e&&u.hooks.onElementHover(e)})),e.mt(e.Ct(()=>Y(),e=>{let t=++pt,r=()=>{pt===t&&p.setSelectionSource(null,null)};if(!e){r();return}n.l(e).then(e=>{if(pt===t){if(!e){r();return}p.setSelectionSource(e.filePath,e.lineNumber)}}).catch(()=>{pt===t&&p.setSelectionSource(null,null)})}));let Ln=e.ht(()=>f.grabbedBoxes.map(e=>({id:e.id,bounds:e.bounds,createdAt:e.createdAt}))),Rn=e.ht(()=>f.labelInstances.map(e=>({id:e.id,status:e.status,tagName:e.tagName,componentName:e.componentName,createdAt:e.createdAt})));e.mt(e.Ct(e.ht(()=>{let e=v(),t=b(),n=C(),r=T(),i=Y(),a=On(),o=u.store.theme.enabled,s=u.store.theme.selectionBox.enabled,c=u.store.theme.dragBox.enabled,l=x(),d=X(),p=ie();return{isActive:e,isDragging:t,isCopying:n,isPromptMode:r,isSelectionBoxVisible:!!(o&&s&&e&&!n&&!p&&!t&&d!=null),isDragBoxVisible:!!(o&&c&&e&&!n&&l),targetElement:i,dragBounds:a?{x:a.x,y:a.y,width:a.width,height:a.height}:null,grabbedBoxes:[...Ln()],labelInstances:[...Rn()],selectionFilePath:f.selectionFilePath,toolbarState:D()}}),e=>{u.hooks.onStateChange(e)})),e.mt(e.Ct(()=>{let t=T();return{inputMode:t,position:t?m():e.Dt(m),target:t?Y():e.Dt(Y)}},({inputMode:e,position:t,target:n})=>{u.hooks.onPromptModeChange(e,{x:t.x,y:t.y,targetElement:n})})),e.mt(e.Ct(()=>[$r(),_n(),Y()],([e,t,n])=>{u.hooks.onSelectionBox(!!e,t??null,n)})),e.mt(e.Ct(()=>[li(),On()],([e,t])=>{u.hooks.onDragBox(!!e,t??null)})),e.mt(e.Ct(()=>{let t=di();return[t,ui(),t?Fn():e.Dt(Fn),t?Y():e.Dt(Y),f.selectionFilePath,f.selectionLineNumber]},([e,n,r,i,a,o])=>{u.hooks.onElementLabel(e,n,{x:r.x,y:r.y,content:``,element:i??void 0,tagName:i&&t.D(i)||void 0,filePath:a??void 0,lineNumber:o??void 0})}));let Z=null,zn=e=>{if(e){if(!Z){Z=document.createElement(`style`),Z.setAttribute(`data-react-grab-cursor`,``);let e=t.E();e&&(Z.nonce=e),t.T(Z),document.head.appendChild(Z)}Z.textContent=`* { cursor: ${e} !important; }`}else Z&&=(Z.remove(),null)};e.mt(e.Ct(()=>[v(),C(),T()],([e,t,n])=>{zn(t?`progress`:e&&!n?`crosshair`:null)}));let Bn=()=>{let e=_();p.activate(),e||u.hooks.onActivate()},Q=()=>{Pt();let n=b(),r=f.previouslyFocusedElement;Dn(),p.deactivate(),A.resetWithDiscard(),Ei(),Ge(),gr(),P.clear(),ht(!1),W(null),n&&(le(`userSelect`),st()),L&&window.clearTimeout(L),G.stop(),t.tt(r)&&r!==document.body&&r!==document.activeElement&&e.K(r)&&r.focus({preventScroll:!0}),u.hooks.onDeactivate()},Vn=()=>{_()&&p.releaseHold(),v()||C()?Q():Pt(),ft()},Hn=()=>{p.setWasActivatedByToggle(!0),Bn()},Un=()=>{let e=[...f.frozenElements],n=f.frozenElement||Y(),r=T()?f.inputText.trim():``;if(!n){Q();return}let i=e.length>0?e:[n],a=i.map(e=>t.Z(e))[0],{x:o,y:s}=d(a),c=o+f.copyOffsetFromCenterX;p.setPointer({x:o,y:s}),p.exitPromptMode(),p.clearInputText(),Zt({element:n,cursorX:c,selectedElements:i,extraPrompt:r||void 0,shouldDeactivateAfter:!0})},Wn=()=>{if(T()){if(oe()){p.clearInputText(),Q();return}p.setPendingDismiss(!0),he(e=>e+1)}},Gn=()=>{if(P.isPendingDismiss()){yr();return}p.clearInputText(),Q()},Kn=()=>{p.setPendingDismiss(!1)},qn=()=>{if(A.isOpen()){A.dismiss();return}let e=f.frozenElement||Y();e&&A.trigger(e,{x:m().x,y:m().y})},Jn=(e,n)=>{if(!A.isOpen()||f.contextMenuPosition!==null)return!1;let r=t.p(e,n).find(t.v);if(!r)return!1;let i=A.switchToElement(r,{x:e,y:n});return i&&t.o([r]),i},Yn=e=>({filePath:f.selectionFilePath??void 0,lineNumber:f.selectionLineNumber??void 0,componentName:yt(),tagName:t.D(e)||void 0}),Xn=()=>{mt=null,ht(!1),p.setPendingCommentMode(!1),W(null)},Zn=n=>{let r=f.frozenElement||Y();if(!r)return!1;let i={x:m().x,y:m().y},a=u.store.actions.find(e=>e.id===n);return a?n===`edit`?A.trigger(r,i,Yn(r))?(p.clearInputText(),p.exitPromptMode(),Xn(),!0):!0:(p.clearInputText(),p.exitPromptMode(),Xn(),e.t(a,Tr(r,i))||tr(r,i),!0):(p.clearInputText(),p.exitPromptMode(),Xn(),ki(t.lt),tr(r,i),!0)},Qn=e=>{if(C()){Q();return}if(v()){if(xt()!==e&&T()&&Zn(e))return;if(xt()!==e&&f.pendingCommentMode){p.setPendingCommentMode(!1),mt=e,W(e),ht(!0);return}if(xt()!==e&&U()){mt=e,W(e);return}Q();return}E()&&(mt=e,W(e),ht(!0),Hn())},$n=()=>{Qn(D()?.defaultAction??`copy`)},er=(e,t,n)=>{Xn(),p.clearInputText(),p.enterPromptMode({x:t,y:n},e)},tr=(e,t)=>{Ge(),Di(),p.showContextMenu(t,e),gr(),u.hooks.onContextMenu(e,t)},nr=(n,r)=>{let i=mt;if(mt=null,W(null),!i)return;if(i===`edit`){A.trigger(n,r,Yn(n));return}let a=u.store.actions.find(e=>e.id===i);if(!a){ki(t.lt),tr(n,r);return}e.t(a,Tr(n,r))||tr(n,r)},rr=()=>{if(E()){if(v()&&ae()){Q();return}p.setPendingCommentMode(!0),v()||Hn()}},ir=(e,n,r)=>{let i=r&&B()&&!b()&&!f.pendingCommentMode&&!U();if(He()||y()&&!i)return;if(p.setPointer({x:e,y:n}),F.latestPointerX=e,F.latestPointerY=n,i){let r=t.f(e,n);r!==f.detectedElement&&p.setDetectedElement(r);return}let a=performance.now(),o=F.pendingDetectionScheduledAt>0&&a-F.pendingDetectionScheduledAt<200;if(!x()&&a-F.lastDetectionTimestamp>=32&&!o&&(F.lastDetectionTimestamp=a,F.pendingDetectionScheduledAt=a,setTimeout(()=>{if(He()||x()){F.pendingDetectionScheduledAt=0;return}let e=t.f(F.latestPointerX,F.latestPointerY);e!==f.detectedElement&&p.setDetectedElement(e),F.pendingDetectionScheduledAt=0})),b()){if(S()){let{pageX:t,pageY:r}=vn(e,n);z&&p.shiftDragStart({x:t-z.x,y:r-z.y}),z={x:t,y:r}}ot(e,n);let t=Bt(e,n),r=t.top||t.bottom||t.left||t.right;r&&!G.isActive()?G.start():!r&&G.isActive()&&G.stop()}},ar=(e,t,n)=>{if(!K()||w())return!1;!n&&B()&&Ge();let r=P.selectedElement()!==null;return p.startDrag({x:e,y:t},n||r),p.setPointer({x:e,y:t}),ce(`userSelect`,`none`),ot(e,t),u.hooks.onDragStart(e+window.scrollX,t+window.scrollY),!0},or=(e,r)=>{let i=f.frozenElements.includes(e),a=f.frozenElements.length===0;if(!i){let i=Pe(t.Z(e),r);Be.set(e,i),a&&bt(n.i(e)??void 0)}p.toggleFrozenElement(e),t.d();let o=f.frozenElements.includes(e);if(o||Be.delete(e),f.frozenElements.length===0){Ge(),p.unfreeze();return}t.o(f.frozenElements),ct(!0),p.setPointer(r),p.setLastGrabbed(o?e:f.frozenElements[f.frozenElements.length-1]),p.freeze(),gr()},sr=()=>{let r=f.frozenElements.filter(e.K),i=r.map(e=>{let r=t.D(e)||`element`,i=n.i(e)??void 0,a=Be.get(e),o=t.Z(e);return{element:e,tagName:r,componentName:i,mouseX:a===void 0?o.x+o.width/2:o.x+o.width*a}});if(Ge(),r.length===0){p.unfreeze();return}if(r.length===1){Zt({element:r[0],cursorX:i[0].mouseX,selectedElements:r,shouldDeactivateAfter:f.wasActivatedByToggle});return}Qt({elements:r,labelEntries:i,shouldDeactivateAfter:f.wasActivatedByToggle})},cr=(e,n,r)=>{let i=Ne(e,t.v),a=i.length>0?i:Ne(e,t.v,!1);if(a.length===0)return;let o=r&&!f.pendingCommentMode&&!U();if(o&&p.addFrozenElements(a),t.o(o?f.frozenElements:a),u.hooks.onDragEnd(a,e),o){let e=a[a.length-1];ct(!0),t.d(),p.setPointer(d(t.Z(e))),p.setLastGrabbed(e),p.freeze(),gr();return}let s=a[0],c=d(t.Z(s));p.setPointer(c),p.setFrozenElements(a);let l=Le(e);if(p.setFrozenDragRect(l),p.freeze(),p.setLastGrabbed(s),f.pendingCommentMode){er(s,c.x,c.y);return}if(U()){ht(!1),mt?nr(s,c):tr(s,c);return}let m=f.wasActivatedByToggle&&!n;Zt({element:s,cursorX:c.x,selectedElements:a,shouldDeactivateAfter:m,dragRect:l})},lr=n=>{for(let r of f.frozenElements)if(e.K(r)&&Jt(n,t.Z(r)))return r;return null},ur=(n,r,i,a)=>{let o=e.K(f.frozenElement)?f.frozenElement:null,s=P.selectedElement(),c=()=>t.p(n,r).find(t.v)??null;if(a&&!f.pendingCommentMode&&!U()){let e=c();e!==null&&or(e,{x:n,y:r});return}let l=c()??(e.K(f.detectedElement)?f.detectedElement:null),h=s??l??o;if(!h)return;let g,_,v=l===null&&o===h,y=s===h;if(v)g=m().x,_=m().y;else if(y){let e=d(t.Z(h));g=e.x,_=e.y}else g=n,_=r;if(f.pendingCommentMode){er(h,g,_),P.clear();return}if(U()){ht(!1);let{wasIntercepted:e}=u.hooks.onElementSelect(h);if(e)return;P.clear(),t.o([h]),p.setFrozenElement(h);let n={x:g,y:_};p.setPointer(n),p.freeze(),mt?nr(h,n):tr(h,n);return}let b=f.wasActivatedByToggle&&!i;p.setLastGrabbed(h),Zt({element:h,cursorX:g,shouldDeactivateAfter:b}),P.clear()},dr=()=>{b()&&(Dn(),st(),p.cancelDrag(),G.stop(),le(`userSelect`),Ir())},fr=(e,t,n,r)=>{if(!b())return;st();let i=Cn(e,t),a=i.x>2||i.y>2,o=a?wn(e,t):null;a?p.endDrag():p.cancelDrag(),Dn(),G.stop(),le(`userSelect`),o?cr(o,n,r):ur(e,t,n,r)},$=ye(),pr=ln({shouldForwardInteraction:()=>v()||_()||b()||w(),shouldForwardKeyboardEvent:e=>Ye(e,u.store.options),shouldForwardViewportEvent:e=>{let t=f.frozenElement??Y();return t&&un(e,t)?!0:f.frozenElements.some(t=>un(e,t))}}),mr=zt(),hr=t=>{let n;try{n=mr.originalKeyDescriptor?.get?mr.originalKeyDescriptor.get.call(t):t.key}catch{return!1}let r=n===`Enter`||qt(t.code),i=v()||_();return r&&i&&!T()&&!P.isPendingDismiss()&&!f.wasActivatedByToggle?e.L(t,`data-react-grab-input`)?!1:(mr.claimedEvents.add(t),t.preventDefault(),t.stopImmediatePropagation(),!0):!1};$.addDocumentListener(`keydown`,t.un(hr),{capture:!0}),$.addDocumentListener(`keyup`,t.un(hr),{capture:!0}),$.addDocumentListener(`keypress`,t.un(hr),{capture:!0});let gr=()=>{Ct.clearHistory(),P.clear()},_r=(e,n=!1)=>{p.setFrozenElement(e),p.freeze(),P.select(e,{shouldPromptBeforeMouseHandoff:n});let r=d(t.Z(e));p.setPointer(r),f.contextMenuPosition!==null&&p.showContextMenu(r,e)},vr=()=>{P.showDismissPrompt()&&he(e=>e+1)},yr=()=>{P.clear(),p.unfreeze(),gr()},br=()=>{let e=P.takeSelection(f.frozenElement);if(!e){yr();return}let n=d(t.Z(e));gr(),p.setLastGrabbed(e),Zt({element:e,cursorX:n.x,shouldDeactivateAfter:f.wasActivatedByToggle})},xr=e=>t.rt.has(e.key)?e.key:e.key===`Tab`?e.shiftKey?`ArrowLeft`:`ArrowRight`:null,Sr=(e,n={})=>{if(!v()||T()||B()||P.isPendingDismiss()&&!n.allowPendingKeyboardSelection)return!1;let r=xr(e);if(!r||Ae())return!1;let i=X(),a=!i;if(!i){let e=t.ln()?.getBoundingClientRect();i=e?t.f(e.left+e.width/2,e.top+e.height/2):t.f(window.innerWidth/2,window.innerHeight/2)}if(!i)return!1;let o=r===`ArrowUp`||r===`ArrowDown`,s=Ct.findNext(r,i);if(!s&&!o&&!a)return!1;let c=s??i;return e.preventDefault(),e.stopPropagation(),_r(c,!0),!0},Cr=t=>t.metaKey||t.ctrlKey||t.altKey||t.repeat||e.G(t)||!v()||C()||w()||Ae()?null:f.frozenElement||Y(),wr=t=>{let n=Cr(t);if(!n)return null;let r=e.i(u.store.actions,t);return r?{element:n,action:r}:null},Tr=(e,n)=>{let r=t.Z(e);return bi({element:e,filePath:f.selectionFilePath??void 0,lineNumber:f.selectionLineNumber??void 0,tagName:t.D(e)||void 0,componentName:yt(),position:n,shouldDeferHideContextMenu:!1,performWithFeedbackOptions:{fallbackBounds:r,fallbackSelectionBounds:[r],position:n}})},Er=/^[a-zA-Z0-9-]$/,Dr=e=>{if(!e.key||e.key.length!==1||!Er.test(e.key))return!1;let t=Cr(e);return!t||!A.trigger(t,{x:m().x,y:m().y},{initialSearchQuery:e.key})?!1:(Xn(),e.preventDefault(),e.stopImmediatePropagation(),!0)},Or=t=>{let n=wr(t);if(!n)return!1;let{element:r,action:i}=n;return T()?Zn(i.id)?(t.preventDefault(),t.stopImmediatePropagation(),!0):!1:e.t(i,Tr(r,{x:m().x,y:m().y}))?(t.preventDefault(),t.stopImmediatePropagation(),!0):!1},kr=()=>{let e=f.selectionFilePath,t=f.selectionLineNumber;e&&Xe(e,t??void 0,u.hooks)},Ar=e=>e.key?.toLowerCase()!==`o`||!v()||!(e.metaKey||e.ctrlKey)||!f.selectionFilePath?!1:(e.preventDefault(),e.stopPropagation(),kr(),!0),jr=e=>{if(!v()||C()||f.contextMenuPosition!==null||A.isOpen())return!1;let n=e.key===`F10`&&e.shiftKey,r=e.key===`ContextMenu`;if(!n&&!r)return!1;let i=f.frozenElements,a=i.length>1,o=(a?i[0]:null)||f.frozenElement||Y();if(!o)return!1;e.preventDefault(),e.stopPropagation();let s=d(t.Z(o));return a?t.o(i):(t.o([o]),p.setFrozenElement(o)),p.setPointer(s),p.freeze(),tr(o,s),!0},Mr=e.ht(()=>rn().map(e=>({tagName:t.D(e.element)||`element`,componentName:n.i(e.element)??void 0,depth:e.depth,isLast:e.isLast}))),Nr=e.ht(()=>({items:Mr(),activeIndex:an()})),Pr=n=>{if(!(!u.store.options.allowActivationInsideInput&&e.G(n))&&!(!Ye(n,u.store.options)&&((n.metaKey||n.ctrlKey)&&!t.Nt.includes(n.key)&&!qt(n.code)&&(v()&&!f.wasActivatedByToggle?Q():_()&&(Je(),Qe(),p.releaseHold())),!qt(n.code)||!_()))){if((v()||_())&&!T()&&(n.preventDefault(),qt(n.code)&&n.stopImmediatePropagation()),v()){if(f.wasActivatedByToggle&&u.store.options.activationMode!==`hold`||n.repeat)return;L!==null&&window.clearTimeout(L),L=window.setTimeout(()=>{Q()},200);return}if(_()&&n.repeat){if(R.copyWaiting){let e=R.holdTimerFired;Qe(),e&&p.activate()}return}if(!(C()||ie())&&!_()){let t=u.store.options.keyHoldDuration??100;e.G(n)?e.U(n)?t+=600:t+=400:e.W()&&(t+=600),Qe(),p.startHold(t)}}},Fr=e=>{if(!P.isPendingDismiss())return!1;if(qt(e.code))return!0;let n=t.rt.has(e.key),r=wr(e)!==null;return!n&&!r?!1:n?Sr(e,{allowPendingKeyboardSelection:!0}):Or(e)?(gr(),!0):!1};$.addWindowListener(`keydown`,t.un(n=>{if(xr(n)&&e.G(n)||Fr(n))return;if(hr(n),!E()){Ye(n,u.store.options)&&!n.repeat&&pe(e=>e+1);return}let r=qt(n.code)&&_()&&!T(),i=e.L(n,t.Yt);if(T()&&Ye(n,u.store.options)&&!n.repeat&&!i){n.preventDefault(),n.stopPropagation(),Wn();return}if(n.key===`Escape`&&C()){Q();return}if(n.key===`Escape`&&Ae()){k()!==null&&Ei();return}let a=e.L(n,`data-react-grab-ignore-events`)&&!r;if(T()||a)return T()&&!i&&Or(n)||(n.key===`Escape`&&(T()?Wn():f.wasActivatedByToggle&&Q()),a&&t.rt.has(n.key)&&Sr(n)),void 0;if(b()&&Tn(n)){n.repeat||En(),n.preventDefault(),n.stopPropagation();return}if(n.key===`Escape`&&(_()||f.wasActivatedByToggle)){Q();return}v()&&!t.Nt.includes(n.key)&&n.preventDefault();let o=Date.now()-lt<200;Sr(n)||Ar(n)||jr(n)||Or(n)||Dr(n)||o||Pr(n)}),{capture:!0}),$.addWindowListener(`keyup`,t.un(t=>{if(hr(t))return;if(Tn(t)&&S()&&(Dn(),t.preventDefault(),t.stopPropagation()),t.key===`Shift`&&B()){b()&&dr(),sr();return}if(e.L(t,`data-react-grab-ignore-events`))return;let n=Rt(u.store.options),r=n.metaKey||n.ctrlKey?e.R()?!t.metaKey:!t.ctrlKey:n.shiftKey&&!t.shiftKey||n.altKey&&!t.altKey,i=u.store.options.activationKey?typeof u.store.options.activationKey==`function`?u.store.options.activationKey(t):qe(u.store.options.activationKey)(t):Ue(t.key,t.code);if(ie()||ut){(i||r)&&(ft(),Q());return}if(!_()&&!v()||T())return;let a=!!u.store.options.activationKey,o=u.store.options.activationMode===`hold`,s=b();if(v()){let e=j();if(r){if(f.wasActivatedByToggle&&u.store.options.activationMode!==`hold`||e)return;Q()}else if(o&&i){if(L!==null&&(window.clearTimeout(L),L=null),e||s)return;Q()}else !a&&i&&L!==null&&(window.clearTimeout(L),L=null);return}if(i||r){if(f.wasActivatedByToggle&&u.store.options.activationMode!==`hold`)return;if(_()||R.holdTimerFired&&r){Je();let n=(R.startTimestamp?Date.now()-R.startTimestamp:0)>=200,r=R.holdTimerFired&&n&&(u.store.options.allowActivationInsideInput||!e.G(t));Qe(),r?p.activate():p.releaseHold()}else Q()}}),{capture:!0}),$.addDocumentListener(`copy`,()=>{_()&&(R.copyWaiting=!0)}),$.addWindowListener(`keypress`,t.un(hr),{capture:!0}),$.addWindowListener(`pointermove`,t.un(t=>{if(!t.isPrimary)return;let n=t.pointerType===`touch`;if(p.setTouchMode(n),!e.L(t,`data-react-grab-ignore-events`)&&!He()&&!(n&&!_()&&!v())){if((n?_():v())&&!T()&&y()&&!t.shiftKey&&!B()){if(P.consumeMouseHandoff()){vr();return}p.unfreeze(),gr()}ir(t.clientX,t.clientY,t.shiftKey)}}),{passive:!0,capture:!0}),$.addWindowListener(`pointerdown`,t.un(t=>{if(t.button===0&&t.isPrimary&&(p.setTouchMode(t.pointerType===`touch`),Me=!1,!(!b()&&e.L(t,`data-react-grab-ignore-events`)))){if(j()){Jn(t.clientX,t.clientY)&&(Me=!0,t.preventDefault(),t.stopImmediatePropagation());return}if(T()){let e=_n();e&&t.clientX>=e.x&&t.clientX<=e.x+e.width&&t.clientY>=e.y&&t.clientY<=e.y+e.height?Un():Wn();return}if(P.isPendingDismiss()){t.preventDefault(),t.stopImmediatePropagation();return}if(w()){t.preventDefault(),t.stopImmediatePropagation();return}if(ar(t.clientX,t.clientY,t.shiftKey)){if(t.pointerId!==void 0)try{document.documentElement.setPointerCapture(t.pointerId)}catch{}t.preventDefault(),t.stopImmediatePropagation()}}}),{capture:!0}),$.addWindowListener(`pointerup`,t.un(t=>{if(t.button!==0||!t.isPrimary||e.L(t,`data-react-grab-ignore-events`)||j())return;let n=K()||w()||b(),r=t.metaKey||t.ctrlKey;fr(t.clientX,t.clientY,r,t.shiftKey),n&&(t.preventDefault(),t.stopImmediatePropagation())}),{capture:!0}),$.addWindowListener(`contextmenu`,t.un(n=>{if(!K()||C()||T()||A.isOpen())return;let r=e.L(n,`data-react-grab-ignore-events`),i={x:n.clientX,y:n.clientY},a=r&&f.frozenElements.length>1?lr(i):null,o=P.isPendingDismiss();if(r&&!a&&!o&&!on())return;if(j()){n.preventDefault();return}n.preventDefault(),n.stopPropagation();let s=a??t.f(n.clientX,n.clientY);if(!s)return;let c=f.frozenElements;c.length>1&&c.includes(s)?t.o(c):(t.o([s]),p.setFrozenElement(s)),p.setPointer(i),p.freeze(),tr(s,i)}),{capture:!0}),$.addWindowListener(`pointercancel`,t.un(e=>{e.isPrimary&&dr()}),{capture:!0}),$.addWindowListener(`click`,t.un(t=>{if(!e.L(t,`data-react-grab-ignore-events`)){if(Me){Me=!1,t.preventDefault(),t.stopImmediatePropagation();return}j()||(K()||te())&&(t.preventDefault(),t.stopImmediatePropagation(),f.wasActivatedByToggle&&!T()&&!t.shiftKey&&(_()?p.setWasActivatedByToggle(!1):Q()))}}),{capture:!0}),$.addDocumentListener(`visibilitychange`,()=>{if(document.hidden){p.clearGrabbedBoxes();let e=f.activationTimestamp;v()&&!T()&&e!==null&&Date.now()-e>500&&Q()}}),$.addWindowListener(`blur`,()=>{dr(),_()&&(Je(),p.releaseHold(),Qe()),Ge()}),$.addWindowListener(`focus`,()=>{lt=Date.now()}),$.addWindowListener(`focusin`,n=>{e.L(n,t.cn)&&n.stopPropagation()},{capture:!0});let Ir=()=>{if(!(f.isTouchMode&&!_()&&!v())&&!He()&&!y()&&!b()&&f.frozenElements.length===0){let e=t.f(m().x,m().y);p.setDetectedElement(e)}},Lr=null,Rr=null,zr=()=>{Fe(),Ir(),at(e=>e+1),p.incrementViewportVersion(),p.updateContextMenuPosition()},Br=()=>{t._(),zr()};$.addWindowListener(`scroll`,zr,{capture:!0});let Vr=window.innerWidth,Hr=window.innerHeight;$.addWindowListener(`resize`,()=>{let e=window.innerWidth,n=window.innerHeight;if(Vr>0&&Hr>0){let r=e/Vr,i=n/Hr,a=Math.abs(r-i)<t.an,o=Math.abs(r-1)>t.an;a&&o&&p.setPointer({x:m().x*r,y:m().y*i})}Vr=e,Hr=n,Br()});let Ur=window.visualViewport;if(Ur){let{signal:e}=$;Ur.addEventListener(`resize`,Br,{signal:e}),Ur.addEventListener(`scroll`,zr,{signal:e})}let Wr=()=>{Rr===null&&(Rr=t.C(()=>{Rr=null,p.incrementViewportVersion()}))};e.mt(()=>{if(u.store.theme.enabled&&(v()||C()||f.labelInstances.length>0||f.grabbedBoxes.length>0)){if(Lr!==null)return;Lr=window.setInterval(()=>{p.relinkLiveElements(),Wr()},100);return}Lr!==null&&(window.clearInterval(Lr),Lr=null),Rr!==null&&(t.S(Rr),Rr=null)}),e.wt(()=>{Lr!==null&&window.clearInterval(Lr),Rr!==null&&t.S(Rr)}),$.addDocumentListener(`copy`,t.un(t=>{T()||e.L(t,`data-react-grab-ignore-events`)||K()&&t.preventDefault()}),{capture:!0}),e.wt(()=>{pr(),$.abort(),I!==null&&window.clearTimeout(I),L&&window.clearTimeout(L),ft(),M?.(),M=null,N?.(),N=null,wt.forEach(e=>window.clearTimeout(e)),wt.clear(),J.cancelAllFades(),q.clear(),G.stop(),t.i(),le(`userSelect`),le(`touchAction`),zn(null),mr.restore(),t.fn(null)});let{root:Gr,host:Kr}=ne(r);e.wt(_e(Kr).cleanup);let qr=e.ht(()=>u.store.theme.enabled),Jr=e.ht(()=>u.store.theme.selectionBox.enabled),Yr=e.ht(()=>u.store.theme.elementLabel.enabled),Xr=e.ht(()=>u.store.theme.dragBox.enabled),Zr=e.ht(()=>ie()||O()&&!y()||A.isInteracting()),Qr=e.ht(()=>An().length>0),$r=e.ht(()=>!qr()||!Jr()||Zr()?!1:Qr()?!0:dn()),ei=e.ht(()=>{let e=cn();if(e)return t.D(e)||void 0}),ti=e.ht(()=>!qr()||j()||!Yr()||Zr()?!1:dn()),ni=new Map,ri=n=>{let r=n.elements?.filter(e.K)??[],i=n.element,a=null;r.length>0?a=r.map(t.Z):i&&e.K(i)&&(a=[t.Z(i)]);let o=n.bounds,s=n.boundsMultiple;a&&(o=a.length>1?Re(Ze(a)):a[0],n.boundsMultiple!==void 0&&(s=n.boundsMultiple.length>1&&n.boundsMultiple.length===n.elements?.length?a:[o]));let c=ni.get(n.id),l=c?.boundsMultiple,u=l===s||l!==void 0&&s!==void 0&&l.length===s.length&&l.every((e,t)=>e.x===s[t].x&&e.y===s[t].y&&e.width===s[t].width&&e.height===s[t].height);if(c&&c.status===n.status&&c.errorMessage===n.errorMessage&&c.bounds.x===o.x&&c.bounds.y===o.y&&c.bounds.width===o.width&&c.bounds.height===o.height&&u)return c;let d=o.x+o.width/2,f=o.width/2,p;p=n.mouseXOffsetRatio!==void 0&&f>0?d+n.mouseXOffsetRatio*f:n.mouseXOffsetFromCenter===void 0?n.mouseX??d:d+n.mouseXOffsetFromCenter;let m={...n,bounds:o,boundsMultiple:s,mouseX:p};return ni.set(n.id,m),m},ii=e.ht(()=>{if(!qr()||!u.store.theme.grabbedBoxes.enabled)return[];h();let e=new Set(f.labelInstances.map(e=>e.id));for(let t of ni.keys())e.has(t)||ni.delete(t);return f.labelInstances.map(ri)}),ai=e.ht(()=>new Map(ii().map(e=>[e.id,e]))),oi=new Map,si=e.ht(()=>{let e=ii(),t=new Set(e.map(e=>e.id));for(let e of oi.keys())t.has(e)||oi.delete(e);return e.map(e=>{let t=oi.get(e.id);if(t)return t;let n=e.id,r={read:()=>ai().get(n)??null};return oi.set(n,r),r})}),ci=e.ht(()=>!qr()||!u.store.theme.grabbedBoxes.enabled?[]:(h(),f.grabbedBoxes.map(n=>e.K(n.element)?{...n,bounds:t.Z(n.element)}:n))),li=e.ht(()=>qr()&&Xr()&&K()&&x()),ui=e.ht(()=>C()?`processing`:`hover`),di=e.ht(()=>{if(!qr())return!1;let e=Yr(),t=T(),n=C(),r=K(),i=b(),a=!!X(),o=O(),s=y();return!e||t||o&&!s?!1:n?!0:r&&!i&&a}),fi=e.ht(()=>{h();let e=f.contextMenuElement;return e?t.Z(e):null}),pi=e.ht(()=>(h(),f.contextMenuPosition)),mi=e.ht(()=>{let e=f.contextMenuElement;if(!e)return;let n=f.frozenElements.length;return n>1?`${n} elements`:t.D(e)||void 0}),[hi]=re(()=>f.frozenElements.length>1?null:f.contextMenuElement),[gi]=e._t(()=>f.contextMenuElement,async e=>e?n.l(e):null),_i=async e=>{p.incrementSelectionInteractionLockDepth();try{return await e()}finally{p.decrementSelectionInteractionLockDepth()}},vi=(e,n,r,i,a)=>async o=>{await _i(async()=>{let s=a?.fallbackBounds??null,c=a?.fallbackSelectionBounds??[],l=a?.position??f.contextMenuPosition??m(),u=pn(),d=fi()??s,h=n.length>1,g=h?Re(Ze(u)):d,_=f.wasActivatedByToggle,v;if(v=h?u:d?[d]:c,p.hideContextMenu(),g){let t=h?g.x+g.width/2:l.x,a=J.createInstance(g,r||`element`,i,`copying`,{element:e,mouseX:t,elements:h?n:void 0,boundsMultiple:v}),s=!1,c;try{s=await o(),s||(c=`Failed to copy`)}catch(e){c=be(e,`Action failed`)}J.updateAfterCopy(a,s,c)}else try{await o()}catch(e){t.u(new t.R(`Action failed without feedback bounds`,e))}_?Q():p.unfreeze()})},yi=()=>{setTimeout(()=>{p.hideContextMenu()},0)},bi=e=>{let{element:t,filePath:n,lineNumber:r,tagName:i,componentName:a,position:o,performWithFeedbackOptions:s,shouldDeferHideContextMenu:c,onBeforeCopy:l,onBeforePrompt:d,customEnterPromptMode:m}=e,h=f.frozenElements.length>0?f.frozenElements:[t],g=c?yi:p.hideContextMenu,_={element:t,elements:h,filePath:n,lineNumber:r,componentName:a,tagName:i,enterPromptMode:m??(()=>{J.clearAll(),Xn(),d?.(),$e(t,o.x,o.y),p.setPointer({x:o.x,y:o.y}),p.setFrozenElement(t),et(),v()||Bn(),g()}),enterEditMode:()=>{A.trigger(t,o,{filePath:n,lineNumber:r,componentName:a,tagName:i})&&Xn(),g()},copy:()=>{Xn(),l?.(),Zt({element:t,cursorX:o.x,selectedElements:h.length>1?h:void 0,shouldDeactivateAfter:f.wasActivatedByToggle}),g()},hooks:{transformHtmlContent:u.hooks.transformHtmlContent,onOpenFile:u.hooks.onOpenFile,transformOpenFileUrl:u.hooks.transformOpenFileUrl},performWithFeedback:vi(t,h,i,a,s),hideContextMenu:g,cleanup:()=>{f.wasActivatedByToggle?Q():p.unfreeze()}},y=u.hooks.transformActionContext(_);return{..._,...y}},xi=e.ht(()=>{let e=f.contextMenuElement;if(!e)return;let t=gi(),n=f.contextMenuPosition??m();return bi({element:e,filePath:t?.filePath,lineNumber:t?.lineNumber??void 0,tagName:mi(),componentName:hi(),position:n,shouldDeferHideContextMenu:!0,onBeforeCopy:()=>{P.clear()},customEnterPromptMode:()=>{J.clearAll(),Xn(),p.clearInputText(),p.enterPromptMode(n,e),yi()}})}),Si=()=>{setTimeout(()=>{p.hideContextMenu(),Q()},0)},Ci=()=>{if(!je)return null;let e=je.getBoundingClientRect(),t=$t(e);return t===`left`||t===`right`?{x:t===`left`?e.right:e.left,y:e.top+e.height/2,edge:t}:{x:e.left+e.width/2,y:t===`top`?e.bottom:e.top,edge:t}},wi=()=>{let e=Ci();if(e)return e;let t=A.state();return t?{x:t.position.x,y:t.position.y,edge:`bottom`}:null},Ti=(e,n)=>{let r=null,i=()=>{let a=e();a&&n(a),r=t.C(i)};return i(),()=>{r!==null&&(t.S(r),r=null)}};e.mt(()=>{if(!on())return;let t=Ti(Ci,ke);e.wt(()=>{t(),ke(null)})});let Ei=()=>{M?.(),M=null,we(null)},Di=()=>{p.hideContextMenu(),Ei(),A.dismiss()},Oi=()=>{k()===null?(p.hideContextMenu(),A.isOpen()&&A.closePreservingRenderer(),M?.(),M=Ti(Ci,we)):Ei()},ki=e=>{Ke({defaultAction:e})},Ai=n=>{let r=f.labelInstances.find(e=>e.id===n);if(!r?.element||!e.K(r.element))return;let i=r.element,a=d(t.Z(i)),o={x:r.mouseX??a.x,y:a.y},s=r.elements&&r.elements.length>0?r.elements.filter(t=>e.K(t)):[i];setTimeout(()=>{Ei(),A.isOpen()&&A.closePreservingRenderer(),v()||(p.setWasActivatedByToggle(!0),Bn()),p.setPointer(o),p.setFrozenElements(s),s.length>1&&r.bounds&&p.setFrozenDragRect(Le(r.bounds)),p.freeze(),p.showContextMenu(o,i)},0)};e.mt(()=>{let e=u.store.theme.hue;e===0?Gr.style.filter=``:Gr.style.filter=`hue-rotate(${e}deg)`}),u.store.theme.enabled&&Promise.resolve().then(()=>require(`./renderer-DXSY4SBD.cjs`)).then(({ReactGrabRenderer:t})=>{a||(c=e.$(()=>e.ft(t,{get selectionVisible(){return $r()},get selectionBounds(){return _n()},get selectionBoundsMultiple(){return jn()},get selectionShouldSnap(){return f.frozenElements.length>0||An().length>0},get selectionElementsCount(){return f.frozenElements.length},get frozenLabelEntryAccessors(){return Nn()},get pendingShiftPreviewEntry(){return Pn()??void 0},get selectionFilePath(){return f.selectionFilePath??void 0},get selectionLineNumber(){return f.selectionLineNumber??void 0},get selectionTagName(){return ei()},get selectionComponentName(){return yt()},get selectionLabelVisible(){return ti()},selectionLabelStatus:`idle`,get hierarchyState(){return Nr()},get hierarchyMenuPosition(){return De()},get labelInstances(){return ii()},get labelInstanceAccessors(){return si()},get dragVisible(){return li()},get dragBounds(){return On()},get grabbedBoxes(){return ci()},get mouseX(){return e.Q(()=>f.frozenElements.length>1)()?void 0:In()??Fn().x},get isFrozen(){return y()||v()||O()},get inputValue(){return f.inputText},get isPromptMode(){return T()},onShowContextMenuInstance:Ai,onRetryInstance:Wt,onAcknowledgeErrorInstance:Gt,get onLabelInstanceHoverChange(){return J.handleHoverChange},get onInputChange(){return p.setInputText},onInputSubmit:()=>void Un(),onToggleExpand:qn,get selectionLabelShakeCount(){return me()},onConfirmDismiss:Gn,onOpenSelectionFile:kr,get discardPrompt(){return e.Q(()=>!!P.isPendingDismiss())()?{isKeyboardSelection:!0,onConfirm:Gn,onCopy:br}:oe()?{onConfirm:Gn,onCancel:Kn}:void 0},get toolbarVisible(){return u.store.theme.toolbar.enabled},get isActive(){return v()},onToggleActive:$n,onActivateAction:Qn,get activeActionId(){return xt()},get enabled(){return E()},get shakeCount(){return fe()},onToolbarStateChange:e=>{ge(e),e.enabled!==E()&&(de(e.enabled),e.enabled||(Vn(),Di())),tn(Sn,e)},onSubscribeToToolbarStateChanges:e=>(Sn.add(e),()=>{Sn.delete(e)}),onToolbarSelectHoverChange:ve,onToolbarRef:e=>{je=e},get contextMenuPosition(){return pi()},get contextMenuBounds(){return fi()},get contextMenuTagName(){return mi()},get contextMenuComponentName(){return hi()},get contextMenuHasFilePath(){return!!gi()?.filePath},get actions(){return u.store.actions},get actionContext(){return xi()},onContextMenuDismiss:Si,onContextMenuHide:yi,get toolbarMenuPosition(){return k()},get toolbarMenuActions(){return u.store.actions.filter(e=>e.showInToolbarMenu===!0)},get defaultActionId(){return D()?.defaultAction??`copy`},onSetDefaultAction:ki,onToggleToolbarMenu:Oi,onToolbarMenuDismiss:Ei,get editPanelState(){return A.state()},get editPanelPosition(){return Te()},get onEditPanelDismiss(){return A.dismiss},get onEditPanelSubmit(){return A.submit},get onEditPanelPendingEditsChange(){return A.setPendingEdits},get onEditPanelInteractingChange(){return A.setInteracting}}),Gr))}).catch(e=>{console.warn(`[react-grab] Failed to load renderer:`,e)});let ji={activate:()=>{p.setPendingCommentMode(!1),!v()&&E()&&Hn()},deactivate:()=>{v()||C()?Q():Pt()},toggle:()=>{v()||C()?Q():E()&&Hn()},comment:rr,isActive:()=>v(),isEnabled:()=>E(),setEnabled:e=>{e!==E()&&(de(e),Ke({enabled:e,collapsed:!e}),e||(Vn(),Di()))},getToolbarState:()=>D()??e.o(),setToolbarState:t=>{let n=D()??e.o(),r=t.collapsed??n?.collapsed??!1,i={edge:t.edge??n?.edge??`bottom`,ratio:t.ratio??n?.ratio??.5,collapsed:r,enabled:t.enabled??!r,defaultAction:t.defaultAction??n?.defaultAction??`copy`};e.s(i),ge(i),i.enabled!==E()&&(de(i.enabled),i.enabled||(Vn(),Di())),tn(Sn,i)},onToolbarStateChange:e=>(Sn.add(e),()=>{Sn.delete(e)}),reset:()=>{Vn(),Di(),p.clearGrabbedBoxes(),J.clearAll(),p.setSelectionSource(null,null)},dispose:()=>{a=!0,xn=!1;try{Pt(),J.clearAll(),c?.(),M?.(),M=null,N?.(),N=null,Sn.clear(),i()}finally{hn(ji)}},copyElement:async e=>{let t=Array.isArray(e)?e:[e];return t.length===0?!1:(await Kt(t,At())).status===`succeeded`},getSource:async e=>{let t=await n.l(e);return t?{filePath:t.filePath,lineNumber:t.lineNumber,componentName:t.componentName}:null},getStackContext:e=>n.c(e,{maxLines:u.store.options.maxContextLines}),getState:()=>({isActive:v(),isDragging:b(),isCopying:C(),isPromptMode:T(),isSelectionBoxVisible:!!$r(),isDragBoxVisible:!!li(),targetElement:Y(),dragBounds:On()??null,grabbedBoxes:[...Ln()],labelInstances:[...Rn()],selectionFilePath:f.selectionFilePath,toolbarState:D()}),setOptions:e=>{u.setOptions(e)},registerPlugin:e=>{u.register(e,ji)},unregisterPlugin:e=>{u.unregister(e)},getPlugins:()=>u.getPluginNames(),getDisplayName:n.i};for(let e of yn)u.register(e,ji);return setTimeout(()=>{n.d(!0)},t.Ft),ji})};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return mn}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return gn}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return kt}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return vn}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return _n}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return pn}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Cn}});
|