viewgate-wrapper 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"ViewGateOverlay.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,EAAoC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,wBAAwB,CAAC;AA4FhC,eAAO,MAAM,eAAe,EAAE,EA8e7B,CAAC"}
1
+ {"version":3,"file":"ViewGateOverlay.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,EAAoC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,wBAAwB,CAAC;AA+GhC,eAAO,MAAM,eAAe,EAAE,EA4e7B,CAAC"}
@@ -64,6 +64,11 @@ export interface SemanticReference {
64
64
  componentPath?: string;
65
65
  signature?: string;
66
66
  source?: string;
67
+ attributes?: Record<string, string>;
68
+ metadata?: {
69
+ hint?: string;
70
+ closestSource?: string;
71
+ };
67
72
  }
68
73
  interface ViewGateContextType {
69
74
  addToast: (message: string, type: 'success' | 'error') => void;
@@ -1 +1 @@
1
- {"version":3,"file":"ViewGateProvider.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuC,KAAK,SAAS,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAErF,OAAO,wBAAwB,CAAC;AAEhC,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDjB,CAAC;AAQF,MAAM,WAAW,iBAAiB;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,mBAAmB;IACzB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,KAAK,IAAI,CAAC;IAC/D,QAAQ,EAAE,QAAQ,CAAC;IACnB,CAAC,EAAE,OAAO,YAAY,CAAC,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,eAAO,MAAM,WAAW,2BAIvB,CAAC;AAEF,UAAU,aAAa;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA8BtC,CAAC"}
1
+ {"version":3,"file":"ViewGateProvider.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuC,KAAK,SAAS,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAErF,OAAO,wBAAwB,CAAC;AAEhC,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDjB,CAAC;AAQF,MAAM,WAAW,iBAAiB;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,aAAa,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;CACL;AAED,UAAU,mBAAmB;IACzB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,KAAK,IAAI,CAAC;IAC/D,QAAQ,EAAE,QAAQ,CAAC;IACnB,CAAC,EAAE,OAAO,YAAY,CAAC,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,eAAO,MAAM,WAAW,2BAIvB,CAAC;AAEF,UAAU,aAAa;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA8BtC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap";:root{--vg-primary: #2513ec;--vg-primary-gradient: linear-gradient(135deg, #2513ec 0%, #7e3ff2 100%);--vg-glass: rgba(255, 255, 255, .7);--vg-glass-border: rgba(255, 255, 255, .3);--vg-shadow: 0 8px 32px 0 rgba(31, 38, 135, .37);--vg-radius: 16px}body{font-family:Inter,system-ui,-apple-system,sans-serif!important;margin:0}.vg-glassmorphism{background:var(--vg-glass);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid var(--vg-glass-border);box-shadow:var(--vg-shadow);border-radius:var(--vg-radius)}.vg-button-primary{background:var(--vg-primary-gradient);color:#fff;border:none;padding:10px 24px;border-radius:12px;font-weight:600;cursor:pointer;transition:transform .2s,box-shadow .2s;box-shadow:0 4px 12px #2513ec4d}.vg-button-primary:hover{transform:translateY(-2px);box-shadow:0 6px 16px #2513ec66}.vg-button-ghost{background:transparent;color:#444;border:1px solid #ddd;padding:10px 24px;border-radius:12px;cursor:pointer;transition:background .2s}.vg-button-ghost:hover{background:#0000000d}.vg-badge{background:#2513ec1a;color:var(--vg-primary);padding:4px 12px;border-radius:20px;font-size:12px;font-family:JetBrains Mono,monospace;font-weight:700;border:1px solid rgba(37,19,236,.2)}.vg-textarea{width:100%;border:1.5px solid #eee;border-radius:12px;padding:12px;font-family:inherit;color:#0f172a;resize:none;transition:border-color .2s,box-shadow .2s;outline:none}.vg-textarea:focus{border-color:var(--vg-primary);box-shadow:0 0 0 4px #2513ec1a}@keyframes vg-slide-in{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes vg-fade-in{0%{opacity:0}to{opacity:1}}.vg-animate-slide{animation:vg-slide-in .3s cubic-bezier(.16,1,.3,1)}.vg-animate-fade{animation:vg-fade-in .2s ease-out}.vg-toasts{position:fixed;top:24px;right:24px;display:flex;flex-direction:column;gap:12px;z-index:100000}.vg-toast{padding:16px 24px;display:flex;align-items:center;gap:12px;min-width:300px}.vg-toast.success{background:#ecfdf5;border:1px solid #10b981;color:#065f46}.vg-toast.error{background:#fef2f2;border:1px solid #ef4444;color:#991b1b}.vg-cursor-pointer *{cursor:pointer!important}@keyframes vg-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.vg-spinner{border:4px solid rgba(255,255,255,.3);border-top:4px solid white;border-radius:50%;width:40px;height:40px;animation:vg-spin 1s linear infinite;margin-bottom:16px}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- import Ae, { createContext as Le, useState as C, useContext as $e, useCallback as te, useEffect as ue } from "react";
2
+ import Ae, { createContext as $e, useState as C, useContext as Le, useCallback as te, useEffect as ue } from "react";
3
3
  var Y = { exports: {} }, N = {};
4
4
  var de;
5
5
  function Ge() {
@@ -37,11 +37,11 @@ function Fe() {
37
37
  return "Fragment";
38
38
  case H:
39
39
  return "Profiler";
40
- case T:
40
+ case L:
41
41
  return "StrictMode";
42
42
  case W:
43
43
  return "Suspense";
44
- case R:
44
+ case k:
45
45
  return "SuspenseList";
46
46
  case K:
47
47
  return "Activity";
@@ -82,11 +82,11 @@ function Fe() {
82
82
  }
83
83
  if (f) {
84
84
  f = console;
85
- var y = f.error, x = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
85
+ var y = f.error, w = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
86
86
  return y.call(
87
87
  f,
88
88
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
89
- x
89
+ w
90
90
  ), t(o);
91
91
  }
92
92
  }
@@ -133,15 +133,15 @@ function Fe() {
133
133
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
134
134
  )), o = this.props.ref, o !== void 0 ? o : null;
135
135
  }
136
- function d(o, f, y, x, U, Q) {
137
- var w = y.ref;
136
+ function d(o, f, y, w, U, Q) {
137
+ var b = y.ref;
138
138
  return o = {
139
- $$typeof: $,
139
+ $$typeof: R,
140
140
  type: o,
141
141
  key: f,
142
142
  props: y,
143
- _owner: x
144
- }, (w !== void 0 ? w : null) !== null ? Object.defineProperty(o, "ref", {
143
+ _owner: w
144
+ }, (b !== void 0 ? b : null) !== null ? Object.defineProperty(o, "ref", {
145
145
  enumerable: !1,
146
146
  get: u
147
147
  }) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
@@ -166,48 +166,48 @@ function Fe() {
166
166
  value: Q
167
167
  }), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
168
168
  }
169
- function p(o, f, y, x, U, Q) {
170
- var w = f.children;
171
- if (w !== void 0)
172
- if (x)
173
- if (_(w)) {
174
- for (x = 0; x < w.length; x++)
175
- g(w[x]);
176
- Object.freeze && Object.freeze(w);
169
+ function p(o, f, y, w, U, Q) {
170
+ var b = f.children;
171
+ if (b !== void 0)
172
+ if (w)
173
+ if (_(b)) {
174
+ for (w = 0; w < b.length; w++)
175
+ g(b[w]);
176
+ Object.freeze && Object.freeze(b);
177
177
  } else
178
178
  console.error(
179
179
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
180
180
  );
181
- else g(w);
181
+ else g(b);
182
182
  if (h.call(f, "key")) {
183
- w = e(o);
183
+ b = e(o);
184
184
  var V = Object.keys(f).filter(function(Ve) {
185
185
  return Ve !== "key";
186
186
  });
187
- x = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", le[w + x] || (V = 0 < V.length ? "{" + V.join(": ..., ") + ": ...}" : "{}", console.error(
187
+ w = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", le[b + w] || (V = 0 < V.length ? "{" + V.join(": ..., ") + ": ...}" : "{}", console.error(
188
188
  `A props object containing a "key" prop is being spread into JSX:
189
189
  let props = %s;
190
190
  <%s {...props} />
191
191
  React keys must be passed directly to JSX without using spread:
192
192
  let props = %s;
193
193
  <%s key={someKey} {...props} />`,
194
- x,
195
194
  w,
195
+ b,
196
196
  V,
197
- w
198
- ), le[w + x] = !0);
197
+ b
198
+ ), le[b + w] = !0);
199
199
  }
200
- if (w = null, y !== void 0 && (r(y), w = "" + y), i(f) && (r(f.key), w = "" + f.key), "key" in f) {
200
+ if (b = null, y !== void 0 && (r(y), b = "" + y), i(f) && (r(f.key), b = "" + f.key), "key" in f) {
201
201
  y = {};
202
202
  for (var ee in f)
203
203
  ee !== "key" && (y[ee] = f[ee]);
204
204
  } else y = f;
205
- return w && c(
205
+ return b && c(
206
206
  y,
207
207
  typeof o == "function" ? o.displayName || o.name || "Unknown" : o
208
208
  ), d(
209
209
  o,
210
- w,
210
+ b,
211
211
  y,
212
212
  a(),
213
213
  U,
@@ -215,42 +215,42 @@ React keys must be passed directly to JSX without using spread:
215
215
  );
216
216
  }
217
217
  function g(o) {
218
- v(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === P && (o._payload.status === "fulfilled" ? v(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
218
+ x(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === P && (o._payload.status === "fulfilled" ? x(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
219
219
  }
220
- function v(o) {
221
- return typeof o == "object" && o !== null && o.$$typeof === $;
220
+ function x(o) {
221
+ return typeof o == "object" && o !== null && o.$$typeof === R;
222
222
  }
223
- var S = Ae, $ = /* @__PURE__ */ Symbol.for("react.transitional.element"), M = /* @__PURE__ */ Symbol.for("react.portal"), O = /* @__PURE__ */ Symbol.for("react.fragment"), T = /* @__PURE__ */ Symbol.for("react.strict_mode"), H = /* @__PURE__ */ Symbol.for("react.profiler"), G = /* @__PURE__ */ Symbol.for("react.consumer"), X = /* @__PURE__ */ Symbol.for("react.context"), Z = /* @__PURE__ */ Symbol.for("react.forward_ref"), W = /* @__PURE__ */ Symbol.for("react.suspense"), R = /* @__PURE__ */ Symbol.for("react.suspense_list"), F = /* @__PURE__ */ Symbol.for("react.memo"), P = /* @__PURE__ */ Symbol.for("react.lazy"), K = /* @__PURE__ */ Symbol.for("react.activity"), z = /* @__PURE__ */ Symbol.for("react.client.reference"), m = S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, h = Object.prototype.hasOwnProperty, _ = Array.isArray, j = console.createTask ? console.createTask : function() {
223
+ var E = Ae, R = /* @__PURE__ */ Symbol.for("react.transitional.element"), M = /* @__PURE__ */ Symbol.for("react.portal"), O = /* @__PURE__ */ Symbol.for("react.fragment"), L = /* @__PURE__ */ Symbol.for("react.strict_mode"), H = /* @__PURE__ */ Symbol.for("react.profiler"), G = /* @__PURE__ */ Symbol.for("react.consumer"), X = /* @__PURE__ */ Symbol.for("react.context"), Z = /* @__PURE__ */ Symbol.for("react.forward_ref"), W = /* @__PURE__ */ Symbol.for("react.suspense"), k = /* @__PURE__ */ Symbol.for("react.suspense_list"), F = /* @__PURE__ */ Symbol.for("react.memo"), P = /* @__PURE__ */ Symbol.for("react.lazy"), K = /* @__PURE__ */ Symbol.for("react.activity"), z = /* @__PURE__ */ Symbol.for("react.client.reference"), m = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, h = Object.prototype.hasOwnProperty, _ = Array.isArray, j = console.createTask ? console.createTask : function() {
224
224
  return null;
225
225
  };
226
- S = {
226
+ E = {
227
227
  react_stack_bottom_frame: function(o) {
228
228
  return o();
229
229
  }
230
230
  };
231
- var I, oe = {}, ie = S.react_stack_bottom_frame.bind(
232
- S,
231
+ var I, oe = {}, ie = E.react_stack_bottom_frame.bind(
232
+ E,
233
233
  s
234
234
  )(), ce = j(n(s)), le = {};
235
235
  D.Fragment = O, D.jsx = function(o, f, y) {
236
- var x = 1e4 > m.recentlyCreatedOwnerStacks++;
236
+ var w = 1e4 > m.recentlyCreatedOwnerStacks++;
237
237
  return p(
238
238
  o,
239
239
  f,
240
240
  y,
241
241
  !1,
242
- x ? Error("react-stack-top-frame") : ie,
243
- x ? j(n(o)) : ce
242
+ w ? Error("react-stack-top-frame") : ie,
243
+ w ? j(n(o)) : ce
244
244
  );
245
245
  }, D.jsxs = function(o, f, y) {
246
- var x = 1e4 > m.recentlyCreatedOwnerStacks++;
246
+ var w = 1e4 > m.recentlyCreatedOwnerStacks++;
247
247
  return p(
248
248
  o,
249
249
  f,
250
250
  y,
251
251
  !0,
252
- x ? Error("react-stack-top-frame") : ie,
253
- x ? j(n(o)) : ce
252
+ w ? Error("react-stack-top-frame") : ie,
253
+ w ? j(n(o)) : ce
254
254
  );
255
255
  };
256
256
  })()), D;
@@ -311,25 +311,25 @@ const Ne = {
311
311
  markReady: "Marcar como Listo",
312
312
  reopen: "Reabrir"
313
313
  }
314
- }, be = Le(void 0), De = () => {
315
- const e = $e(be);
314
+ }, ve = $e(void 0), De = () => {
315
+ const e = Le(ve);
316
316
  if (!e) throw new Error("useViewGate must be used within a ViewGateProvider");
317
317
  return e;
318
318
  }, It = ({ children: e, language: t = "es", apiKey: r, baseUrl: n = "https://view-gate.vercel.app" }) => {
319
319
  const [a, s] = C([]), i = (u, d) => {
320
320
  const p = Date.now();
321
321
  s((g) => [...g, { id: p, message: u, type: d }]), setTimeout(() => {
322
- s((g) => g.filter((v) => v.id !== p));
322
+ s((g) => g.filter((x) => x.id !== p));
323
323
  }, 4e3);
324
324
  }, c = Ne[t];
325
- return /* @__PURE__ */ l.jsxs(be.Provider, { "data-source-path": "/src/components/ViewGateProvider.tsx:117", value: { addToast: i, language: t, t: c, apiKey: r, baseUrl: n }, children: [
325
+ return /* @__PURE__ */ l.jsxs(ve.Provider, { "data-source-path": "/src/components/ViewGateProvider.tsx:122", value: { addToast: i, language: t, t: c, apiKey: r, baseUrl: n }, children: [
326
326
  e,
327
- /* @__PURE__ */ l.jsx(Gt, { "data-source-path": "/src/components/ViewGateProvider.tsx:119" }),
328
- /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:120", className: "vg-toasts", children: a.map((u) => /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:122", className: `vg-toast vg-glassmorphism vg-animate-slide ${u.type}`, children: [
329
- /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateProvider.tsx:123", style: { fontSize: "20px" }, children: u.type === "success" ? "✅" : "❌" }),
330
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:124", children: [
331
- /* @__PURE__ */ l.jsx("strong", { "data-source-path": "/src/components/ViewGateProvider.tsx:125", style: { display: "block" }, children: u.type === "success" ? c.successHeader : c.errorHeader }),
332
- /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateProvider.tsx:126", style: { fontSize: "14px" }, children: u.message })
327
+ /* @__PURE__ */ l.jsx(Gt, { "data-source-path": "/src/components/ViewGateProvider.tsx:124" }),
328
+ /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:125", className: "vg-toasts", children: a.map((u) => /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:127", className: `vg-toast vg-glassmorphism vg-animate-slide ${u.type}`, children: [
329
+ /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateProvider.tsx:128", style: { fontSize: "20px" }, children: u.type === "success" ? "✅" : "❌" }),
330
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:129", children: [
331
+ /* @__PURE__ */ l.jsx("strong", { "data-source-path": "/src/components/ViewGateProvider.tsx:130", style: { display: "block" }, children: u.type === "success" ? c.successHeader : c.errorHeader }),
332
+ /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateProvider.tsx:131", style: { fontSize: "14px" }, children: u.message })
333
333
  ] })
334
334
  ] }, u.id)) })
335
335
  ] });
@@ -352,7 +352,7 @@ const He = /* @__PURE__ */ (() => {
352
352
  );
353
353
  return () => (e += 1, `u${t()}${e}`);
354
354
  })();
355
- function k(e) {
355
+ function T(e) {
356
356
  const t = [];
357
357
  for (let r = 0, n = e.length; r < n; r++)
358
358
  t.push(e[r]);
@@ -360,7 +360,7 @@ function k(e) {
360
360
  }
361
361
  let A = null;
362
362
  function Ee(e = {}) {
363
- return A || (e.includeStyleProperties ? (A = e.includeStyleProperties, A) : (A = k(window.getComputedStyle(document.documentElement)), A));
363
+ return A || (e.includeStyleProperties ? (A = e.includeStyleProperties, A) : (A = T(window.getComputedStyle(document.documentElement)), A));
364
364
  }
365
365
  function q(e, t) {
366
366
  const n = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
@@ -374,7 +374,7 @@ function ze(e) {
374
374
  const t = q(e, "border-top-width"), r = q(e, "border-bottom-width");
375
375
  return e.clientHeight + t + r;
376
376
  }
377
- function Ce(e, t = {}) {
377
+ function Se(e, t = {}) {
378
378
  const r = t.width || We(e), n = t.height || ze(e);
379
379
  return { width: r, height: n };
380
380
  }
@@ -387,9 +387,9 @@ function Ue() {
387
387
  const r = t && t.env ? t.env.devicePixelRatio : null;
388
388
  return r && (e = parseInt(r, 10), Number.isNaN(e) && (e = 1)), e || window.devicePixelRatio || 1;
389
389
  }
390
- const E = 16384;
390
+ const S = 16384;
391
391
  function Ye(e) {
392
- (e.width > E || e.height > E) && (e.width > E && e.height > E ? e.width > e.height ? (e.height *= E / e.width, e.width = E) : (e.width *= E / e.height, e.height = E) : e.width > E ? (e.height *= E / e.width, e.width = E) : (e.width *= E / e.height, e.height = E));
392
+ (e.width > S || e.height > S) && (e.width > S && e.height > S ? e.width > e.height ? (e.height *= S / e.width, e.width = S) : (e.width *= S / e.height, e.height = S) : e.width > S ? (e.height *= S / e.width, e.width = S) : (e.width *= S / e.height, e.height = S));
393
393
  }
394
394
  function B(e) {
395
395
  return new Promise((t, r) => {
@@ -408,11 +408,11 @@ async function Be(e, t, r) {
408
408
  const n = "http://www.w3.org/2000/svg", a = document.createElementNS(n, "svg"), s = document.createElementNS(n, "foreignObject");
409
409
  return a.setAttribute("width", `${t}`), a.setAttribute("height", `${r}`), a.setAttribute("viewBox", `0 0 ${t} ${r}`), s.setAttribute("width", "100%"), s.setAttribute("height", "100%"), s.setAttribute("x", "0"), s.setAttribute("y", "0"), s.setAttribute("externalResourcesRequired", "true"), a.appendChild(s), s.appendChild(e), qe(a);
410
410
  }
411
- const b = (e, t) => {
411
+ const v = (e, t) => {
412
412
  if (e instanceof t)
413
413
  return !0;
414
414
  const r = Object.getPrototypeOf(e);
415
- return r === null ? !1 : r.constructor.name === t.name || b(r, t);
415
+ return r === null ? !1 : r.constructor.name === t.name || v(r, t);
416
416
  };
417
417
  function Je(e) {
418
418
  const t = e.getPropertyValue("content");
@@ -474,7 +474,7 @@ function ne(e) {
474
474
  function rt(e, t) {
475
475
  return `data:${t};base64,${e}`;
476
476
  }
477
- async function Se(e, t, r) {
477
+ async function Ce(e, t, r) {
478
478
  const n = await fetch(e, t);
479
479
  if (n.status === 404)
480
480
  throw new Error(`Resource "${n.url}" not found`);
@@ -502,7 +502,7 @@ async function ae(e, t, r) {
502
502
  r.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
503
503
  let a;
504
504
  try {
505
- const s = await Se(e, r.fetchRequestInit, ({ res: i, result: c }) => (t || (t = i.headers.get("Content-Type") || ""), tt(c)));
505
+ const s = await Ce(e, r.fetchRequestInit, ({ res: i, result: c }) => (t || (t = i.headers.get("Content-Type") || ""), tt(c)));
506
506
  a = rt(s, t);
507
507
  } catch (s) {
508
508
  a = r.imagePlaceholder || "";
@@ -535,7 +535,7 @@ async function ot(e, t) {
535
535
  return e.cloneNode(!1);
536
536
  }
537
537
  async function it(e, t) {
538
- return b(e, HTMLCanvasElement) ? st(e) : b(e, HTMLVideoElement) ? at(e, t) : b(e, HTMLIFrameElement) ? ot(e, t) : e.cloneNode(Re(e));
538
+ return v(e, HTMLCanvasElement) ? st(e) : v(e, HTMLVideoElement) ? at(e, t) : v(e, HTMLIFrameElement) ? ot(e, t) : e.cloneNode(Re(e));
539
539
  }
540
540
  const ct = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", Re = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
541
541
  async function lt(e, t, r) {
@@ -543,7 +543,7 @@ async function lt(e, t, r) {
543
543
  if (Re(t))
544
544
  return t;
545
545
  let s = [];
546
- return ct(e) && e.assignedNodes ? s = k(e.assignedNodes()) : b(e, HTMLIFrameElement) && (!((n = e.contentDocument) === null || n === void 0) && n.body) ? s = k(e.contentDocument.body.childNodes) : s = k(((a = e.shadowRoot) !== null && a !== void 0 ? a : e).childNodes), s.length === 0 || b(e, HTMLVideoElement) || await s.reduce((i, c) => i.then(() => J(c, r)).then((u) => {
546
+ return ct(e) && e.assignedNodes ? s = T(e.assignedNodes()) : v(e, HTMLIFrameElement) && (!((n = e.contentDocument) === null || n === void 0) && n.body) ? s = T(e.contentDocument.body.childNodes) : s = T(((a = e.shadowRoot) !== null && a !== void 0 ? a : e).childNodes), s.length === 0 || v(e, HTMLVideoElement) || await s.reduce((i, c) => i.then(() => J(c, r)).then((u) => {
547
547
  u && t.appendChild(u);
548
548
  }), Promise.resolve()), t;
549
549
  }
@@ -554,20 +554,20 @@ function ut(e, t, r) {
554
554
  const a = window.getComputedStyle(e);
555
555
  a.cssText ? (n.cssText = a.cssText, n.transformOrigin = a.transformOrigin) : Ee(r).forEach((s) => {
556
556
  let i = a.getPropertyValue(s);
557
- s === "font-size" && i.endsWith("px") && (i = `${Math.floor(parseFloat(i.substring(0, i.length - 2))) - 0.1}px`), b(e, HTMLIFrameElement) && s === "display" && i === "inline" && (i = "block"), s === "d" && t.getAttribute("d") && (i = `path(${t.getAttribute("d")})`), n.setProperty(s, i, a.getPropertyPriority(s));
557
+ s === "font-size" && i.endsWith("px") && (i = `${Math.floor(parseFloat(i.substring(0, i.length - 2))) - 0.1}px`), v(e, HTMLIFrameElement) && s === "display" && i === "inline" && (i = "block"), s === "d" && t.getAttribute("d") && (i = `path(${t.getAttribute("d")})`), n.setProperty(s, i, a.getPropertyPriority(s));
558
558
  });
559
559
  }
560
560
  function dt(e, t) {
561
- b(e, HTMLTextAreaElement) && (t.innerHTML = e.value), b(e, HTMLInputElement) && t.setAttribute("value", e.value);
561
+ v(e, HTMLTextAreaElement) && (t.innerHTML = e.value), v(e, HTMLInputElement) && t.setAttribute("value", e.value);
562
562
  }
563
563
  function ft(e, t) {
564
- if (b(e, HTMLSelectElement)) {
564
+ if (v(e, HTMLSelectElement)) {
565
565
  const n = Array.from(t.children).find((a) => e.value === a.getAttribute("value"));
566
566
  n && n.setAttribute("selected", "");
567
567
  }
568
568
  }
569
569
  function mt(e, t, r) {
570
- return b(t, Element) && (ut(e, t, r), Ke(e, t, r), dt(e, t), ft(e, t)), t;
570
+ return v(t, Element) && (ut(e, t, r), Ke(e, t, r), dt(e, t), ft(e, t)), t;
571
571
  }
572
572
  async function pt(e, t) {
573
573
  const r = e.querySelectorAll ? e.querySelectorAll("use") : [];
@@ -614,7 +614,7 @@ async function wt(e, t, r, n, a) {
614
614
  }
615
615
  return e;
616
616
  }
617
- function vt(e, { preferredFontFormat: t }) {
617
+ function bt(e, { preferredFontFormat: t }) {
618
618
  return t ? e.replace(gt, (r) => {
619
619
  for (; ; ) {
620
620
  const [n, , a] = ht.exec(r) || [];
@@ -631,10 +631,10 @@ function Te(e) {
631
631
  async function Pe(e, t, r) {
632
632
  if (!Te(e))
633
633
  return e;
634
- const n = vt(e, r);
634
+ const n = bt(e, r);
635
635
  return xt(n).reduce((s, i) => s.then((c) => wt(c, i, t, r)), Promise.resolve(n));
636
636
  }
637
- async function L(e, t, r) {
637
+ async function $(e, t, r) {
638
638
  var n;
639
639
  const a = (n = t.style) === null || n === void 0 ? void 0 : n.getPropertyValue(e);
640
640
  if (a) {
@@ -643,12 +643,12 @@ async function L(e, t, r) {
643
643
  }
644
644
  return !1;
645
645
  }
646
- async function bt(e, t) {
647
- await L("background", e, t) || await L("background-image", e, t), await L("mask", e, t) || await L("-webkit-mask", e, t) || await L("mask-image", e, t) || await L("-webkit-mask-image", e, t);
646
+ async function vt(e, t) {
647
+ await $("background", e, t) || await $("background-image", e, t), await $("mask", e, t) || await $("-webkit-mask", e, t) || await $("mask-image", e, t) || await $("-webkit-mask-image", e, t);
648
648
  }
649
649
  async function Et(e, t) {
650
- const r = b(e, HTMLImageElement);
651
- if (!(r && !ne(e.src)) && !(b(e, SVGImageElement) && !ne(e.href.baseVal)))
650
+ const r = v(e, HTMLImageElement);
651
+ if (!(r && !ne(e.src)) && !(v(e, SVGImageElement) && !ne(e.href.baseVal)))
652
652
  return;
653
653
  const n = r ? e.src : e.href.baseVal, a = await ae(n, se(n), t);
654
654
  await new Promise((s, i) => {
@@ -663,14 +663,14 @@ async function Et(e, t) {
663
663
  c.decode && (c.decode = s), c.loading === "lazy" && (c.loading = "eager"), r ? (e.srcset = "", e.src = a) : e.href.baseVal = a;
664
664
  });
665
665
  }
666
- async function Ct(e, t) {
667
- const n = k(e.childNodes).map((a) => je(a, t));
666
+ async function St(e, t) {
667
+ const n = T(e.childNodes).map((a) => je(a, t));
668
668
  await Promise.all(n).then(() => e);
669
669
  }
670
670
  async function je(e, t) {
671
- b(e, Element) && (await bt(e, t), await Et(e, t), await Ct(e, t));
671
+ v(e, Element) && (await vt(e, t), await Et(e, t), await St(e, t));
672
672
  }
673
- function St(e, t) {
673
+ function Ct(e, t) {
674
674
  const { style: r } = e;
675
675
  t.backgroundColor && (r.backgroundColor = t.backgroundColor), t.width && (r.width = `${t.width}px`), t.height && (r.height = `${t.height}px`);
676
676
  const n = t.style;
@@ -690,11 +690,11 @@ async function we(e, t) {
690
690
  let r = e.cssText;
691
691
  const n = /url\(["']?([^"')]+)["']?\)/g, s = (r.match(/url\([^)]+\)/g) || []).map(async (i) => {
692
692
  let c = i.replace(n, "$1");
693
- return c.startsWith("https://") || (c = new URL(c, e.url).href), Se(c, t.fetchRequestInit, ({ result: u }) => (r = r.replace(i, `url(${u})`), [i, u]));
693
+ return c.startsWith("https://") || (c = new URL(c, e.url).href), Ce(c, t.fetchRequestInit, ({ result: u }) => (r = r.replace(i, `url(${u})`), [i, u]));
694
694
  });
695
695
  return Promise.all(s).then(() => r);
696
696
  }
697
- function ve(e) {
697
+ function be(e) {
698
698
  if (e == null)
699
699
  return [];
700
700
  const t = [], r = /(\/\*[\s\S]*?\*\/)/gi;
@@ -725,16 +725,16 @@ async function Rt(e, t) {
725
725
  return e.forEach((a) => {
726
726
  if ("cssRules" in a)
727
727
  try {
728
- k(a.cssRules || []).forEach((s, i) => {
728
+ T(a.cssRules || []).forEach((s, i) => {
729
729
  if (s.type === CSSRule.IMPORT_RULE) {
730
730
  let c = i + 1;
731
- const u = s.href, d = xe(u).then((p) => we(p, t)).then((p) => ve(p).forEach((g) => {
731
+ const u = s.href, d = xe(u).then((p) => we(p, t)).then((p) => be(p).forEach((g) => {
732
732
  try {
733
733
  a.insertRule(g, g.startsWith("@import") ? c += 1 : a.cssRules.length);
734
- } catch (v) {
734
+ } catch (x) {
735
735
  console.error("Error inserting rule from remote css", {
736
736
  rule: g,
737
- error: v
737
+ error: x
738
738
  });
739
739
  }
740
740
  })).catch((p) => {
@@ -745,7 +745,7 @@ async function Rt(e, t) {
745
745
  });
746
746
  } catch (s) {
747
747
  const i = e.find((c) => c.href == null) || document.styleSheets[0];
748
- a.href != null && n.push(xe(a.href).then((c) => we(c, t)).then((c) => ve(c).forEach((u) => {
748
+ a.href != null && n.push(xe(a.href).then((c) => we(c, t)).then((c) => be(c).forEach((u) => {
749
749
  i.insertRule(u, i.cssRules.length);
750
750
  })).catch((c) => {
751
751
  console.error("Error loading remote stylesheet", c);
@@ -754,7 +754,7 @@ async function Rt(e, t) {
754
754
  }), Promise.all(n).then(() => (e.forEach((a) => {
755
755
  if ("cssRules" in a)
756
756
  try {
757
- k(a.cssRules || []).forEach((s) => {
757
+ T(a.cssRules || []).forEach((s) => {
758
758
  r.push(s);
759
759
  });
760
760
  } catch (s) {
@@ -768,7 +768,7 @@ function kt(e) {
768
768
  async function Tt(e, t) {
769
769
  if (e.ownerDocument == null)
770
770
  throw new Error("Provided element is not within a Document");
771
- const r = k(e.ownerDocument.styleSheets), n = await Rt(r, t);
771
+ const r = T(e.ownerDocument.styleSheets), n = await Rt(r, t);
772
772
  return kt(n);
773
773
  }
774
774
  function Oe(e) {
@@ -801,17 +801,17 @@ async function Ot(e, t) {
801
801
  }
802
802
  }
803
803
  async function _t(e, t = {}) {
804
- const { width: r, height: n } = Ce(e, t), a = await J(e, t, !0);
805
- return await Ot(a, t), await je(a, t), St(a, t), await Be(a, r, n);
804
+ const { width: r, height: n } = Se(e, t), a = await J(e, t, !0);
805
+ return await Ot(a, t), await je(a, t), Ct(a, t), await Be(a, r, n);
806
806
  }
807
807
  async function Vt(e, t = {}) {
808
- const { width: r, height: n } = Ce(e, t), a = await _t(e, t), s = await B(a), i = document.createElement("canvas"), c = i.getContext("2d"), u = t.pixelRatio || Ue(), d = t.canvasWidth || r, p = t.canvasHeight || n;
808
+ const { width: r, height: n } = Se(e, t), a = await _t(e, t), s = await B(a), i = document.createElement("canvas"), c = i.getContext("2d"), u = t.pixelRatio || Ue(), d = t.canvasWidth || r, p = t.canvasHeight || n;
809
809
  return i.width = d * u, i.height = p * u, t.skipAutoScale || Ye(i), i.style.width = `${d}`, i.style.height = `${p}`, t.backgroundColor && (c.fillStyle = t.backgroundColor, c.fillRect(0, 0, i.width, i.height)), c.drawImage(s, 0, 0, i.width, i.height), i;
810
810
  }
811
811
  async function At(e, t = {}) {
812
812
  return (await Vt(e, t)).toDataURL();
813
813
  }
814
- const Lt = (e) => {
814
+ const $t = (e) => {
815
815
  const r = Object.keys(e).find((s) => s.startsWith("__reactFiber$") || s.startsWith("__reactInternalInstance$"));
816
816
  if (!r) return "";
817
817
  const n = [];
@@ -825,39 +825,58 @@ const Lt = (e) => {
825
825
  a = a.return;
826
826
  }
827
827
  return n.join(" > ") || "Generic Component";
828
- }, $t = (e) => {
829
- const t = e.getAttribute("data-source-path") || "unknown:0", r = Lt(e), a = ((c) => {
830
- const u = [];
831
- let d = c;
832
- for (; d && d.nodeType === Node.ELEMENT_NODE; ) {
833
- let p = d.nodeName.toLowerCase();
834
- if (d.id) {
835
- p += "#" + d.id, u.unshift(p);
828
+ }, Lt = (e) => {
829
+ let t = "unknown:0", r = e;
830
+ for (; r; ) {
831
+ const d = r.getAttribute("data-source-path");
832
+ if (d) {
833
+ t = d;
834
+ break;
835
+ }
836
+ r = r.parentElement;
837
+ }
838
+ const n = $t(e), s = ((d) => {
839
+ const p = [];
840
+ let g = d;
841
+ for (; g && g.nodeType === Node.ELEMENT_NODE; ) {
842
+ let x = g.nodeName.toLowerCase();
843
+ if (g.id) {
844
+ x += "#" + g.id, p.unshift(x);
836
845
  break;
837
846
  } else {
838
- let g = d, v = 1;
839
- for (; g.previousElementSibling; )
840
- g = g.previousElementSibling, g.nodeName.toLowerCase() === p && v++;
841
- v > 1 && (p += `:nth-of-type(${v})`);
847
+ let E = g, R = 1;
848
+ for (; E.previousElementSibling; )
849
+ E = E.previousElementSibling, E.nodeName.toLowerCase() === x && R++;
850
+ R > 1 && (x += `:nth-of-type(${R})`);
842
851
  }
843
- u.unshift(p), d = d.parentElement;
852
+ p.unshift(x), g = g.parentElement;
844
853
  }
845
- return u.join(" > ");
846
- })(e), s = (e.innerText || "").slice(0, 50).trim(), i = `${e.tagName.toLowerCase()}-${s.replace(/\s+/g, "_")}-${a.split(" > ").slice(-2).join("_")}`;
854
+ return p.join(" > ");
855
+ })(e), i = (e.innerText || "").slice(0, 50).trim(), c = {};
856
+ ["placeholder", "aria-label", "name", "type", "alt", "title", "value", "role"].forEach((d) => {
857
+ const p = e.getAttribute(d);
858
+ p && (c[d] = p);
859
+ });
860
+ const u = `${e.tagName.toLowerCase()}-${i.replace(/\s+/g, "_")}-${s.split(" > ").slice(-2).join("_")}`;
847
861
  return {
848
862
  tag: e.tagName.toLowerCase(),
849
863
  id: e.id || "",
850
864
  classes: e.className || "",
851
865
  text: (e.innerText || "").slice(0, 100).trim(),
852
- selector: a,
853
- outerHtml: (e.outerHTML || "").slice(0, 500),
854
- parentContext: (e.parentElement?.innerText || "").slice(0, 100).trim(),
855
- componentPath: r,
856
- signature: i,
857
- source: t
866
+ selector: s,
867
+ outerHtml: (e.outerHTML || "").slice(0, 1e3),
868
+ // Increased context
869
+ parentContext: (e.parentElement?.innerText || "").slice(0, 150).trim(),
870
+ componentPath: n,
871
+ signature: u,
872
+ source: t,
873
+ attributes: c,
874
+ metadata: {
875
+ hint: `Edit ${t.split(":")[0]} at line ${t.split(":")[1] || "?"}`
876
+ }
858
877
  };
859
878
  }, Gt = () => {
860
- const { addToast: e, language: t, t: r, apiKey: n, baseUrl: a } = De(), [s, i] = C(!1), [c, u] = C(null), [d, p] = C(null), [g, v] = C(""), [S, $] = C(!1), [M, O] = C(!1), [T, H] = C(!1), [G, X] = C([]), [Z, W] = C(!1), R = te(async () => {
879
+ const { addToast: e, language: t, t: r, apiKey: n, baseUrl: a } = De(), [s, i] = C(!1), [c, u] = C(null), [d, p] = C(null), [g, x] = C(""), [E, R] = C(!1), [M, O] = C(!1), [L, H] = C(!1), [G, X] = C([]), [Z, W] = C(!1), k = te(async () => {
861
880
  if (n) {
862
881
  W(!0);
863
882
  try {
@@ -876,8 +895,8 @@ const Lt = (e) => {
876
895
  }
877
896
  }, [n, a]);
878
897
  ue(() => {
879
- (s || T) && R();
880
- }, [s, T, R]);
898
+ k();
899
+ }, [k]);
881
900
  const F = te((m) => {
882
901
  if (!s || d) return;
883
902
  const h = document.elementFromPoint(m.clientX, m.clientY);
@@ -891,7 +910,7 @@ const Lt = (e) => {
891
910
  rect: h.getBoundingClientRect(),
892
911
  element: h,
893
912
  previewText: (h.innerText || "").slice(0, 100) || (h.getAttribute("placeholder") || "").slice(0, 100) || h.tagName.toLowerCase(),
894
- semanticReference: $t(h)
913
+ semanticReference: Lt(h)
895
914
  });
896
915
  }, [s, d]), P = te(async (m) => {
897
916
  if (!(!s || d) && c) {
@@ -916,13 +935,13 @@ const Lt = (e) => {
916
935
  O(!1), u(null);
917
936
  }
918
937
  }
919
- }, [s, c, d, T]);
938
+ }, [s, c, d, L]);
920
939
  ue(() => (s && !d ? document.body.classList.add("vg-cursor-pointer") : document.body.classList.remove("vg-cursor-pointer"), window.addEventListener("mousemove", F), window.addEventListener("click", P, !0), () => {
921
940
  document.body.classList.remove("vg-cursor-pointer"), window.removeEventListener("mousemove", F), window.removeEventListener("click", P, !0);
922
941
  }), [s, d, F, P]);
923
942
  const K = async () => {
924
943
  if (!d || !g.trim()) return;
925
- $(!0);
944
+ R(!0);
926
945
  const { semanticReference: m } = d, [h, _] = m.source.split(":"), j = _ || "0";
927
946
  try {
928
947
  if (!(await fetch(`${a}/api/annotations`, {
@@ -940,15 +959,15 @@ const Lt = (e) => {
940
959
  reference: m
941
960
  })
942
961
  })).ok) throw new Error("Backend failed");
943
- e(r.success, "success"), p(null), v(""), i(!1), R();
962
+ e(r.success, "success"), p(null), x(""), i(!1), k();
944
963
  } catch (I) {
945
964
  console.error(I), e(r.error, "error");
946
965
  } finally {
947
- $(!1);
966
+ R(!1);
948
967
  }
949
968
  }, z = (m) => m.split("/").pop()?.split("\\").pop() || "unknown";
950
969
  return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
951
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:259", style: { position: "fixed", bottom: "30px", right: "30px", zIndex: 99999 }, id: "viewgate-ui", children: [
970
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:276", style: { position: "fixed", bottom: "30px", right: "30px", zIndex: 99999 }, id: "viewgate-ui", children: [
952
971
  /* @__PURE__ */ l.jsx(
953
972
  "button",
954
973
  {
@@ -962,7 +981,7 @@ const Lt = (e) => {
962
981
  "button",
963
982
  {
964
983
  onClick: () => {
965
- H(!T), i(!1), p(null);
984
+ H(!L), i(!1), p(null);
966
985
  },
967
986
  className: "vg-button-ghost",
968
987
  style: { padding: "12px 24px", fontSize: "15px", marginLeft: "12px", background: "white" },
@@ -970,7 +989,7 @@ const Lt = (e) => {
970
989
  }
971
990
  )
972
991
  ] }),
973
- M && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:284", style: {
992
+ M && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:301", style: {
974
993
  position: "fixed",
975
994
  top: 0,
976
995
  left: 0,
@@ -982,11 +1001,11 @@ const Lt = (e) => {
982
1001
  justifyContent: "center",
983
1002
  zIndex: 1e5,
984
1003
  cursor: "wait"
985
- }, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:297", className: "vg-glassmorphism", style: { padding: "30px 50px", fontWeight: 700, display: "flex", flexDirection: "column", alignItems: "center", backgroundColor: "rgba(0,0,0,0.7)", color: "white", border: "1px solid rgba(255,255,255,0.1)" }, children: [
986
- /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:298", className: "vg-spinner" }),
1004
+ }, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:314", className: "vg-glassmorphism", style: { padding: "30px 50px", fontWeight: 700, display: "flex", flexDirection: "column", alignItems: "center", backgroundColor: "rgba(0,0,0,0.7)", color: "white", border: "1px solid rgba(255,255,255,0.1)" }, children: [
1005
+ /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:315", className: "vg-spinner" }),
987
1006
  "Capturing..."
988
1007
  ] }) }),
989
- s && c && !d && !M && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:306", style: {
1008
+ s && c && !d && !M && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:323", style: {
990
1009
  position: "fixed",
991
1010
  top: c.rect.top,
992
1011
  left: c.rect.left,
@@ -1000,7 +1019,7 @@ const Lt = (e) => {
1000
1019
  boxShadow: "0 0 15px rgba(37, 19, 236, 0.2)",
1001
1020
  transition: "all 0.1s ease-out"
1002
1021
  } }),
1003
- d && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:324", className: "vg-animate-fade", style: {
1022
+ d && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:341", className: "vg-animate-fade", style: {
1004
1023
  position: "fixed",
1005
1024
  top: 0,
1006
1025
  left: 0,
@@ -1012,33 +1031,33 @@ const Lt = (e) => {
1012
1031
  alignItems: "center",
1013
1032
  justifyContent: "center",
1014
1033
  zIndex: 99999
1015
- }, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:337", className: "vg-glassmorphism vg-animate-slide", style: {
1034
+ }, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:354", className: "vg-glassmorphism vg-animate-slide", style: {
1016
1035
  padding: "32px",
1017
1036
  width: "460px",
1018
1037
  background: "white",
1019
1038
  color: "#0f172a"
1020
1039
  }, children: [
1021
- /* @__PURE__ */ l.jsx("h2", { "data-source-path": "/src/components/ViewGateOverlay.tsx:343", style: { margin: "0 0 10px 0", fontSize: "24px", fontWeight: 800 }, children: r.feedbackHeader }),
1022
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:345", style: { marginBottom: "20px" }, children: [
1023
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:346", style: { display: "flex", flexWrap: "wrap", gap: "8px", alignItems: "center" }, children: [
1024
- d.semanticReference.componentPath ? /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:348", className: "vg-badge", style: { backgroundColor: "#f5f3ff", color: "#7c3aed", borderColor: "#ddd6fe" }, children: [
1040
+ /* @__PURE__ */ l.jsx("h2", { "data-source-path": "/src/components/ViewGateOverlay.tsx:360", style: { margin: "0 0 10px 0", fontSize: "24px", fontWeight: 800 }, children: r.feedbackHeader }),
1041
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:362", style: { marginBottom: "20px" }, children: [
1042
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:363", style: { display: "flex", flexWrap: "wrap", gap: "8px", alignItems: "center" }, children: [
1043
+ d.semanticReference.componentPath ? /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:365", className: "vg-badge", style: { backgroundColor: "#f5f3ff", color: "#7c3aed", borderColor: "#ddd6fe" }, children: [
1025
1044
  "📦 ",
1026
1045
  d.semanticReference.componentPath
1027
- ] }) : /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:352", className: "vg-badge", children: d.tag }),
1028
- d.semanticReference.source && !d.semanticReference.source.startsWith("unknown") ? /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:357", className: "vg-badge", style: { backgroundColor: "#fdf2f8", color: "#db2777", borderColor: "#fbcfe8" }, children: [
1046
+ ] }) : /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:369", className: "vg-badge", children: d.tag }),
1047
+ d.semanticReference.source && !d.semanticReference.source.startsWith("unknown") ? /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:374", className: "vg-badge", style: { backgroundColor: "#fdf2f8", color: "#db2777", borderColor: "#fbcfe8" }, children: [
1029
1048
  "📄 ",
1030
1049
  z(d.semanticReference.source.split(":")[0] || "unknown")
1031
- ] }) }) : /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:362", className: "vg-badge", style: { backgroundColor: "#f0f9ff", color: "#0369a1", borderColor: "#bae6fd", maxWidth: "300px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
1050
+ ] }) }) : /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:379", className: "vg-badge", style: { backgroundColor: "#f0f9ff", color: "#0369a1", borderColor: "#bae6fd", maxWidth: "300px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
1032
1051
  "🆔 ",
1033
1052
  d.semanticReference.signature
1034
1053
  ] })
1035
1054
  ] }),
1036
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:367", style: { marginTop: "8px", fontSize: "11px", color: "#94a3b8" }, children: [
1055
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:384", style: { marginTop: "8px", fontSize: "11px", color: "#94a3b8" }, children: [
1037
1056
  "🎯 ",
1038
1057
  d.semanticReference.selector
1039
1058
  ] })
1040
1059
  ] }),
1041
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:373", style: {
1060
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:390", style: {
1042
1061
  backgroundColor: "#f8fafc",
1043
1062
  borderRadius: "8px",
1044
1063
  border: "1px solid #e2e8f0",
@@ -1047,8 +1066,8 @@ const Lt = (e) => {
1047
1066
  display: "flex",
1048
1067
  flexDirection: "column"
1049
1068
  }, children: [
1050
- /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:382", style: { padding: "8px 12px", fontSize: "10px", color: "#94a3b8", textTransform: "uppercase", fontWeight: 700, borderBottom: "1px solid #f1f5f9" }, children: r.preview }),
1051
- /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:385", style: {
1069
+ /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:399", style: { padding: "8px 12px", fontSize: "10px", color: "#94a3b8", textTransform: "uppercase", fontWeight: 700, borderBottom: "1px solid #f1f5f9" }, children: r.preview }),
1070
+ /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:402", style: {
1052
1071
  padding: "12px",
1053
1072
  display: "flex",
1054
1073
  justifyContent: "center",
@@ -1070,7 +1089,7 @@ const Lt = (e) => {
1070
1089
  borderRadius: "4px"
1071
1090
  }
1072
1091
  }
1073
- ) : /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:408", style: { fontSize: "13px", color: "#64748b", fontStyle: "italic" }, children: [
1092
+ ) : /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:425", style: { fontSize: "13px", color: "#64748b", fontStyle: "italic" }, children: [
1074
1093
  '"',
1075
1094
  d.previewText,
1076
1095
  '"'
@@ -1081,13 +1100,13 @@ const Lt = (e) => {
1081
1100
  {
1082
1101
  className: "vg-textarea",
1083
1102
  value: g,
1084
- onChange: (m) => v(m.target.value),
1103
+ onChange: (m) => x(m.target.value),
1085
1104
  rows: 4,
1086
1105
  placeholder: r.placeholder,
1087
1106
  autoFocus: !0
1088
1107
  }
1089
1108
  ),
1090
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:424", style: { display: "flex", justifyContent: "flex-end", gap: "12px", marginTop: "24px" }, children: [
1109
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:441", style: { display: "flex", justifyContent: "flex-end", gap: "12px", marginTop: "24px" }, children: [
1091
1110
  /* @__PURE__ */ l.jsx(
1092
1111
  "button",
1093
1112
  {
@@ -1101,14 +1120,14 @@ const Lt = (e) => {
1101
1120
  {
1102
1121
  onClick: K,
1103
1122
  className: "vg-button-primary",
1104
- disabled: S || !g.trim(),
1105
- style: { opacity: S || !g.trim() ? 0.6 : 1 },
1106
- children: S ? r.submitting : r.send
1123
+ disabled: E || !g.trim(),
1124
+ style: { opacity: E || !g.trim() ? 0.6 : 1 },
1125
+ children: E ? r.submitting : r.send
1107
1126
  }
1108
1127
  )
1109
1128
  ] })
1110
1129
  ] }) }),
1111
- T && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:446", className: "vg-animate-fade", style: {
1130
+ L && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:463", className: "vg-animate-fade", style: {
1112
1131
  position: "fixed",
1113
1132
  top: 0,
1114
1133
  left: 0,
@@ -1120,7 +1139,7 @@ const Lt = (e) => {
1120
1139
  alignItems: "center",
1121
1140
  justifyContent: "center",
1122
1141
  zIndex: 99999
1123
- }, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:459", className: "vg-glassmorphism vg-animate-slide", style: {
1142
+ }, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:476", className: "vg-glassmorphism vg-animate-slide", style: {
1124
1143
  padding: "32px",
1125
1144
  width: "600px",
1126
1145
  maxHeight: "80vh",
@@ -1129,40 +1148,40 @@ const Lt = (e) => {
1129
1148
  display: "flex",
1130
1149
  flexDirection: "column"
1131
1150
  }, children: [
1132
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:468", style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "20px" }, children: [
1133
- /* @__PURE__ */ l.jsx("h2", { "data-source-path": "/src/components/ViewGateOverlay.tsx:469", style: { margin: 0, fontSize: "24px", fontWeight: 800 }, children: r.feedbackHeader }),
1134
- /* @__PURE__ */ l.jsx("button", { "data-source-path": "/src/components/ViewGateOverlay.tsx:470", onClick: () => H(!1), className: "vg-button-ghost", style: { padding: "6px 12px" }, children: "✕" })
1151
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:485", style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "20px" }, children: [
1152
+ /* @__PURE__ */ l.jsx("h2", { "data-source-path": "/src/components/ViewGateOverlay.tsx:486", style: { margin: 0, fontSize: "24px", fontWeight: 800 }, children: r.feedbackHeader }),
1153
+ /* @__PURE__ */ l.jsx("button", { "data-source-path": "/src/components/ViewGateOverlay.tsx:487", onClick: () => H(!1), className: "vg-button-ghost", style: { padding: "6px 12px" }, children: "✕" })
1135
1154
  ] }),
1136
- /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:473", style: { overflowY: "auto", flex: 1, paddingRight: "8px", display: "flex", flexDirection: "column", gap: "16px" }, children: Z ? /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:475", style: { textAlign: "center", padding: "40px", color: "#64748b" }, children: "Cargando..." }) : G.length === 0 ? /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:477", style: { textAlign: "center", padding: "40px", color: "#64748b" }, children: r.noComments }) : G.map((m) => /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:480", style: {
1155
+ /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:490", style: { overflowY: "auto", flex: 1, paddingRight: "8px", display: "flex", flexDirection: "column", gap: "16px" }, children: Z ? /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:492", style: { textAlign: "center", padding: "40px", color: "#64748b" }, children: "Cargando..." }) : G.length === 0 ? /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:494", style: { textAlign: "center", padding: "40px", color: "#64748b" }, children: r.noComments }) : G.map((m) => /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:497", style: {
1137
1156
  border: "1px solid #e2e8f0",
1138
1157
  borderRadius: "12px",
1139
1158
  padding: "16px",
1140
1159
  backgroundColor: m.status === "ready_for_review" ? "#f0fdf4" : "#fff"
1141
1160
  }, children: [
1142
- /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:486", style: { display: "flex", justifyContent: "space-between", marginBottom: "12px" }, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:487", style: { display: "flex", gap: "8px", alignItems: "center" }, children: [
1143
- m.status === "ready_for_review" ? /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:489", className: "vg-badge", style: { backgroundColor: "#dcfce7", color: "#166534", borderColor: "#bbf7d0" }, children: [
1161
+ /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:503", style: { display: "flex", justifyContent: "space-between", marginBottom: "12px" }, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:504", style: { display: "flex", gap: "8px", alignItems: "center" }, children: [
1162
+ m.status === "ready_for_review" ? /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:506", className: "vg-badge", style: { backgroundColor: "#dcfce7", color: "#166534", borderColor: "#bbf7d0" }, children: [
1144
1163
  "✓ ",
1145
1164
  r.readyForReview
1146
- ] }) : /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:491", className: "vg-badge", style: { backgroundColor: "#fef3c7", color: "#92400e", borderColor: "#fde68a" }, children: [
1165
+ ] }) : /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:508", className: "vg-badge", style: { backgroundColor: "#fef3c7", color: "#92400e", borderColor: "#fde68a" }, children: [
1147
1166
  "⏳ ",
1148
1167
  r.pending
1149
1168
  ] }),
1150
- /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:493", style: { fontSize: "12px", color: "#64748b" }, children: new Date(m.timestamp).toLocaleString() })
1169
+ /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:510", style: { fontSize: "12px", color: "#64748b" }, children: new Date(m.timestamp).toLocaleString() })
1151
1170
  ] }) }),
1152
- /* @__PURE__ */ l.jsxs("p", { "data-source-path": "/src/components/ViewGateOverlay.tsx:499", style: { margin: "0 0 12px 0", fontSize: "15px", fontWeight: 600 }, children: [
1171
+ /* @__PURE__ */ l.jsxs("p", { "data-source-path": "/src/components/ViewGateOverlay.tsx:516", style: { margin: "0 0 12px 0", fontSize: "15px", fontWeight: 600 }, children: [
1153
1172
  '"',
1154
1173
  m.message,
1155
1174
  '"'
1156
1175
  ] }),
1157
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:501", style: { display: "flex", gap: "6px", flexWrap: "wrap", marginBottom: "16px" }, children: [
1158
- /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:502", className: "vg-badge", style: { backgroundColor: "#f1f5f9", color: "#475569", border: "none" }, children: m.componentName || "UI Element" }),
1159
- m.filePath && m.filePath !== "unknown" && /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:506", className: "vg-badge", style: { backgroundColor: "#f1f5f9", color: "#475569", border: "none" }, children: z(m.filePath) })
1176
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:518", style: { display: "flex", gap: "6px", flexWrap: "wrap", marginBottom: "16px" }, children: [
1177
+ /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:519", className: "vg-badge", style: { backgroundColor: "#f1f5f9", color: "#475569", border: "none" }, children: m.componentName || "UI Element" }),
1178
+ m.filePath && m.filePath !== "unknown" && /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:523", className: "vg-badge", style: { backgroundColor: "#f1f5f9", color: "#475569", border: "none" }, children: z(m.filePath) })
1160
1179
  ] }),
1161
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:512", style: { display: "flex", gap: "8px", justifyContent: "flex-end", borderTop: "1px solid #e2e8f0", paddingTop: "16px", marginTop: "8px" }, children: [
1180
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:529", style: { display: "flex", gap: "8px", justifyContent: "flex-end", borderTop: "1px solid #e2e8f0", paddingTop: "16px", marginTop: "8px" }, children: [
1162
1181
  m.status === "pending" ? /* @__PURE__ */ l.jsxs(
1163
1182
  "button",
1164
1183
  {
1165
- "data-source-path": "/src/components/ViewGateOverlay.tsx:514",
1184
+ "data-source-path": "/src/components/ViewGateOverlay.tsx:531",
1166
1185
  className: "vg-button-primary",
1167
1186
  style: { display: "flex", alignItems: "center", gap: "6px" },
1168
1187
  onClick: async () => {
@@ -1171,7 +1190,7 @@ const Lt = (e) => {
1171
1190
  method: "PATCH",
1172
1191
  headers: { "Content-Type": "application/json", "x-api-key": n },
1173
1192
  body: JSON.stringify({ status: "ready_for_review" })
1174
- })).ok && (R(), e(r.success, "success"));
1193
+ })).ok && (k(), e(r.success, "success"));
1175
1194
  } catch {
1176
1195
  e(r.error, "error");
1177
1196
  }
@@ -1184,7 +1203,7 @@ const Lt = (e) => {
1184
1203
  ) : /* @__PURE__ */ l.jsxs(
1185
1204
  "button",
1186
1205
  {
1187
- "data-source-path": "/src/components/ViewGateOverlay.tsx:536",
1206
+ "data-source-path": "/src/components/ViewGateOverlay.tsx:553",
1188
1207
  className: "vg-button-ghost",
1189
1208
  style: { display: "flex", alignItems: "center", gap: "6px" },
1190
1209
  onClick: async () => {
@@ -1193,7 +1212,7 @@ const Lt = (e) => {
1193
1212
  method: "PATCH",
1194
1213
  headers: { "Content-Type": "application/json", "x-api-key": n },
1195
1214
  body: JSON.stringify({ status: "pending" })
1196
- })).ok && (R(), e(r.success, "success"));
1215
+ })).ok && (k(), e(r.success, "success"));
1197
1216
  } catch {
1198
1217
  e(r.error, "error");
1199
1218
  }
@@ -1207,7 +1226,7 @@ const Lt = (e) => {
1207
1226
  /* @__PURE__ */ l.jsxs(
1208
1227
  "button",
1209
1228
  {
1210
- "data-source-path": "/src/components/ViewGateOverlay.tsx:559",
1229
+ "data-source-path": "/src/components/ViewGateOverlay.tsx:576",
1211
1230
  className: "vg-button-primary",
1212
1231
  style: { backgroundColor: "#ef4444", display: "flex", alignItems: "center", gap: "6px" },
1213
1232
  onClick: async () => {
@@ -1216,7 +1235,7 @@ const Lt = (e) => {
1216
1235
  (await fetch(`${a}/api/annotations/${m._id}`, {
1217
1236
  method: "DELETE",
1218
1237
  headers: { "x-api-key": n }
1219
- })).ok && (R(), e(r.success, "success"));
1238
+ })).ok && (k(), e(r.success, "success"));
1220
1239
  } catch {
1221
1240
  e(r.error, "error");
1222
1241
  }
@@ -1238,7 +1257,7 @@ function _e(e, t, r) {
1238
1257
  return e.split(`
1239
1258
  `).map((c, u) => {
1240
1259
  const d = u + 1;
1241
- return c.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g, (p, g, v) => p.includes("data-source-path") || v === "Fragment" || v === "React.Fragment" ? p : `${g}<${v} data-source-path="${a}:${d}"`);
1260
+ return c.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g, (p, g, x) => p.includes("data-source-path") || x === "Fragment" || x === "React.Fragment" ? p : `${g}<${x} data-source-path="${a}:${d}"`);
1242
1261
  }).join(`
1243
1262
  `);
1244
1263
  }
@@ -1,10 +1,10 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap";:root{--vg-primary: #2513ec;--vg-primary-gradient: linear-gradient(135deg, #2513ec 0%, #7e3ff2 100%);--vg-glass: rgba(255, 255, 255, .7);--vg-glass-border: rgba(255, 255, 255, .3);--vg-shadow: 0 8px 32px 0 rgba(31, 38, 135, .37);--vg-radius: 16px}body{font-family:Inter,system-ui,-apple-system,sans-serif!important;margin:0}.vg-glassmorphism{background:var(--vg-glass);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid var(--vg-glass-border);box-shadow:var(--vg-shadow);border-radius:var(--vg-radius)}.vg-button-primary{background:var(--vg-primary-gradient);color:#fff;border:none;padding:10px 24px;border-radius:12px;font-weight:600;cursor:pointer;transition:transform .2s,box-shadow .2s;box-shadow:0 4px 12px #2513ec4d}.vg-button-primary:hover{transform:translateY(-2px);box-shadow:0 6px 16px #2513ec66}.vg-button-ghost{background:transparent;color:#444;border:1px solid #ddd;padding:10px 24px;border-radius:12px;cursor:pointer;transition:background .2s}.vg-button-ghost:hover{background:#0000000d}.vg-badge{background:#2513ec1a;color:var(--vg-primary);padding:4px 12px;border-radius:20px;font-size:12px;font-family:JetBrains Mono,monospace;font-weight:700;border:1px solid rgba(37,19,236,.2)}.vg-textarea{width:100%;border:1.5px solid #eee;border-radius:12px;padding:12px;font-family:inherit;color:#0f172a;resize:none;transition:border-color .2s,box-shadow .2s;outline:none}.vg-textarea:focus{border-color:var(--vg-primary);box-shadow:0 0 0 4px #2513ec1a}@keyframes vg-slide-in{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes vg-fade-in{0%{opacity:0}to{opacity:1}}.vg-animate-slide{animation:vg-slide-in .3s cubic-bezier(.16,1,.3,1)}.vg-animate-fade{animation:vg-fade-in .2s ease-out}.vg-toasts{position:fixed;top:24px;right:24px;display:flex;flex-direction:column;gap:12px;z-index:100000}.vg-toast{padding:16px 24px;display:flex;align-items:center;gap:12px;min-width:300px}.vg-toast.success{background:#ecfdf5;border:1px solid #10b981;color:#065f46}.vg-toast.error{background:#fef2f2;border:1px solid #ef4444;color:#991b1b}.vg-cursor-pointer *{cursor:pointer!important}@keyframes vg-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.vg-spinner{border:4px solid rgba(255,255,255,.3);border-top:4px solid white;border-radius:50%;width:40px;height:40px;animation:vg-spin 1s linear infinite;margin-bottom:16px}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- (function(C,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],y):(C=typeof globalThis<"u"?globalThis:C||self,y(C.ViewGateWrapper={},C.React))})(this,(function(C,y){"use strict";var $={exports:{}},F={};var ie;function Ae(){if(ie)return F;ie=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,s){var i=null;if(s!==void 0&&(i=""+s),a.key!==void 0&&(i=""+a.key),"key"in a){s={};for(var c in a)c!=="key"&&(s[c]=a[c])}else s=a;return a=s.ref,{$$typeof:e,type:n,key:i,ref:a!==void 0?a:null,props:s}}return F.Fragment=t,F.jsx=r,F.jsxs=r,F}var I={};var ce;function Le(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&(function(){function e(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===X?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case A:return"Fragment";case B:return"Profiler";case P:return"StrictMode";case J:return"Suspense";case T:return"SuspenseList";case se:return"Activity"}if(typeof o=="object")switch(typeof o.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),o.$$typeof){case Y:return"Portal";case re:return o.displayName||"Context";case D:return(o._context.displayName||"Context")+".Consumer";case ne:var f=o.render;return o=o.displayName,o||(o=f.displayName||f.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case M:return f=o.displayName||null,f!==null?f:e(o.type)||"Memo";case j:f=o._payload,o=o._init;try{return e(o(f))}catch{}}return null}function t(o){return""+o}function r(o){try{t(o);var f=!1}catch{f=!0}if(f){f=console;var x=f.error,w=typeof Symbol=="function"&&Symbol.toStringTag&&o[Symbol.toStringTag]||o.constructor.name||"Object";return x.call(f,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",w),t(o)}}function n(o){if(o===A)return"<>";if(typeof o=="object"&&o!==null&&o.$$typeof===j)return"<...>";try{var f=e(o);return f?"<"+f+">":"<...>"}catch{return"<...>"}}function a(){var o=m.A;return o===null?null:o.getOwner()}function s(){return Error("react-stack-top-frame")}function i(o){if(h.call(o,"key")){var f=Object.getOwnPropertyDescriptor(o,"key").get;if(f&&f.isReactWarning)return!1}return o.key!==void 0}function c(o,f){function x(){H||(H=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",f))}x.isReactWarning=!0,Object.defineProperty(o,"key",{get:x,configurable:!0})}function u(){var o=e(this.type);return je[o]||(je[o]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),o=this.props.ref,o!==void 0?o:null}function d(o,f,x,w,Z,ae){var v=x.ref;return o={$$typeof:N,type:o,key:f,props:x,_owner:w},(v!==void 0?v:null)!==null?Object.defineProperty(o,"ref",{enumerable:!1,get:u}):Object.defineProperty(o,"ref",{enumerable:!1,value:null}),o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(o,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(o,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.defineProperty(o,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ae}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o}function p(o,f,x,w,Z,ae){var v=f.children;if(v!==void 0)if(w)if(L(v)){for(w=0;w<v.length;w++)g(v[w]);Object.freeze&&Object.freeze(v)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(v);if(h.call(f,"key")){v=e(o);var G=Object.keys(f).filter(function(Gt){return Gt!=="key"});w=0<G.length?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}",Ve[v+w]||(G=0<G.length?"{"+G.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
+ (function(R,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],y):(R=typeof globalThis<"u"?globalThis:R||self,y(R.ViewGateWrapper={},R.React))})(this,(function(R,y){"use strict";var H={exports:{}},F={};var ie;function Ae(){if(ie)return F;ie=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,s){var i=null;if(s!==void 0&&(i=""+s),a.key!==void 0&&(i=""+a.key),"key"in a){s={};for(var c in a)c!=="key"&&(s[c]=a[c])}else s=a;return a=s.ref,{$$typeof:e,type:n,key:i,ref:a!==void 0?a:null,props:s}}return F.Fragment=t,F.jsx=r,F.jsxs=r,F}var I={};var ce;function Le(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&(function(){function e(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===X?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case A:return"Fragment";case B:return"Profiler";case N:return"StrictMode";case J:return"Suspense";case P:return"SuspenseList";case se:return"Activity"}if(typeof o=="object")switch(typeof o.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),o.$$typeof){case Y:return"Portal";case re:return o.displayName||"Context";case D:return(o._context.displayName||"Context")+".Consumer";case ne:var f=o.render;return o=o.displayName,o||(o=f.displayName||f.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case M:return f=o.displayName||null,f!==null?f:e(o.type)||"Memo";case j:f=o._payload,o=o._init;try{return e(o(f))}catch{}}return null}function t(o){return""+o}function r(o){try{t(o);var f=!1}catch{f=!0}if(f){f=console;var x=f.error,b=typeof Symbol=="function"&&Symbol.toStringTag&&o[Symbol.toStringTag]||o.constructor.name||"Object";return x.call(f,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",b),t(o)}}function n(o){if(o===A)return"<>";if(typeof o=="object"&&o!==null&&o.$$typeof===j)return"<...>";try{var f=e(o);return f?"<"+f+">":"<...>"}catch{return"<...>"}}function a(){var o=m.A;return o===null?null:o.getOwner()}function s(){return Error("react-stack-top-frame")}function i(o){if(h.call(o,"key")){var f=Object.getOwnPropertyDescriptor(o,"key").get;if(f&&f.isReactWarning)return!1}return o.key!==void 0}function c(o,f){function x(){$||($=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",f))}x.isReactWarning=!0,Object.defineProperty(o,"key",{get:x,configurable:!0})}function u(){var o=e(this.type);return je[o]||(je[o]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),o=this.props.ref,o!==void 0?o:null}function d(o,f,x,b,Z,ae){var v=x.ref;return o={$$typeof:k,type:o,key:f,props:x,_owner:b},(v!==void 0?v:null)!==null?Object.defineProperty(o,"ref",{enumerable:!1,get:u}):Object.defineProperty(o,"ref",{enumerable:!1,value:null}),o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(o,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(o,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.defineProperty(o,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ae}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o}function p(o,f,x,b,Z,ae){var v=f.children;if(v!==void 0)if(b)if(L(v)){for(b=0;b<v.length;b++)g(v[b]);Object.freeze&&Object.freeze(v)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(v);if(h.call(f,"key")){v=e(o);var G=Object.keys(f).filter(function(Gt){return Gt!=="key"});b=0<G.length?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}",Ve[v+b]||(G=0<G.length?"{"+G.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
3
3
  let props = %s;
4
4
  <%s {...props} />
5
5
  React keys must be passed directly to JSX without using spread:
6
6
  let props = %s;
7
- <%s key={someKey} {...props} />`,w,v,G,v),Ve[v+w]=!0)}if(v=null,x!==void 0&&(r(x),v=""+x),i(f)&&(r(f.key),v=""+f.key),"key"in f){x={};for(var oe in f)oe!=="key"&&(x[oe]=f[oe])}else x=f;return v&&c(x,typeof o=="function"?o.displayName||o.name||"Unknown":o),d(o,v,x,a(),Z,ae)}function g(o){b(o)?o._store&&(o._store.validated=1):typeof o=="object"&&o!==null&&o.$$typeof===j&&(o._payload.status==="fulfilled"?b(o._payload.value)&&o._payload.value._store&&(o._payload.value._store.validated=1):o._store&&(o._store.validated=1))}function b(o){return typeof o=="object"&&o!==null&&o.$$typeof===N}var k=y,N=Symbol.for("react.transitional.element"),Y=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),re=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),X=Symbol.for("react.client.reference"),m=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,h=Object.prototype.hasOwnProperty,L=Array.isArray,O=console.createTask?console.createTask:function(){return null};k={react_stack_bottom_frame:function(o){return o()}};var H,je={},Oe=k.react_stack_bottom_frame.bind(k,s)(),_e=O(n(s)),Ve={};I.Fragment=A,I.jsx=function(o,f,x){var w=1e4>m.recentlyCreatedOwnerStacks++;return p(o,f,x,!1,w?Error("react-stack-top-frame"):Oe,w?O(n(o)):_e)},I.jsxs=function(o,f,x){var w=1e4>m.recentlyCreatedOwnerStacks++;return p(o,f,x,!0,w?Error("react-stack-top-frame"):Oe,w?O(n(o)):_e)}})()),I}var le;function Ge(){return le||(le=1,process.env.NODE_ENV==="production"?$.exports=Ae():$.exports=Le()),$.exports}var l=Ge();const Fe={en:{enterMode:"🚀 Enter Feedback Mode",exitMode:"✨ Exit Mode",feedbackHeader:"Feedback",selectedElement:"Selected element:",line:"Line",placeholder:"Tell us what you'd like to change...",cancel:"Cancel",send:"Send Feedback",submitting:"Submitting...",success:"Your feedback has been submitted successfully!",error:"Failed to submit feedback. Check backend connection.",successHeader:"Success",errorHeader:"Error",preview:"Preview",viewComments:"👀 View Comments",close:"Close",observe:"Observe",pending:"Pending",readyForReview:"Ready for Review",noComments:"No comments found.",deleteConfirm:"Are you sure you want to close/delete this comment?",markReady:"Mark as Ready",reopen:"Reopen"},es:{enterMode:"🚀 Activar Modo Comentarios",exitMode:"✨ Salir del Modo",feedbackHeader:"Comentarios",selectedElement:"Elemento seleccionado:",line:"Línea",placeholder:"Cuéntanos qué te gustaría cambiar...",cancel:"Cancelar",send:"Enviar Comentarios",submitting:"Enviando...",success:"¡Tus comentarios se han enviado con éxito!",error:"Error al enviar comentarios. Revisa la conexión con el servidor.",successHeader:"Éxito",errorHeader:"Error",preview:"Vista previa",viewComments:"👀 Ver Comentarios",close:"Cerrar",observe:"Observar",pending:"Pendiente",readyForReview:"Lista para revisión",noComments:"No hay comentarios.",deleteConfirm:"¿Estás seguro de que deseas cerrar y eliminar este comentario?",markReady:"Marcar como Listo",reopen:"Reabrir"}},ue=y.createContext(void 0),de=()=>{const e=y.useContext(ue);if(!e)throw new Error("useViewGate must be used within a ViewGateProvider");return e},Ie=({children:e,language:t="es",apiKey:r,baseUrl:n="https://view-gate.vercel.app"})=>{const[a,s]=y.useState([]),i=(u,d)=>{const p=Date.now();s(g=>[...g,{id:p,message:u,type:d}]),setTimeout(()=>{s(g=>g.filter(b=>b.id!==p))},4e3)},c=Fe[t];return l.jsxs(ue.Provider,{"data-source-path":"/src/components/ViewGateProvider.tsx:117",value:{addToast:i,language:t,t:c,apiKey:r,baseUrl:n},children:[e,l.jsx(Pe,{"data-source-path":"/src/components/ViewGateProvider.tsx:119"}),l.jsx("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:120",className:"vg-toasts",children:a.map(u=>l.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:122",className:`vg-toast vg-glassmorphism vg-animate-slide ${u.type}`,children:[l.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:123",style:{fontSize:"20px"},children:u.type==="success"?"✅":"❌"}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:124",children:[l.jsx("strong",{"data-source-path":"/src/components/ViewGateProvider.tsx:125",style:{display:"block"},children:u.type==="success"?c.successHeader:c.errorHeader}),l.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:126",style:{fontSize:"14px"},children:u.message})]})]},u.id))})]})};function Ne(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(a),t&&(n.href=t),a.href=e,a.href}const De=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function R(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let _=null;function fe(e={}){return _||(e.includeStyleProperties?(_=e.includeStyleProperties,_):(_=R(window.getComputedStyle(document.documentElement)),_))}function W(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function Me(e){const t=W(e,"border-left-width"),r=W(e,"border-right-width");return e.clientWidth+t+r}function He(e){const t=W(e,"border-top-width"),r=W(e,"border-bottom-width");return e.clientHeight+t+r}function me(e,t={}){const r=t.width||Me(e),n=t.height||He(e);return{width:r,height:n}}function $e(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const S=16384;function We(e){(e.width>S||e.height>S)&&(e.width>S&&e.height>S?e.width>e.height?(e.height*=S/e.width,e.width=S):(e.width*=S/e.height,e.height=S):e.width>S?(e.height*=S/e.width,e.width=S):(e.width*=S/e.height,e.height=S))}function z(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function ze(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ue(e,t,r){const n="http://www.w3.org/2000/svg",a=document.createElementNS(n,"svg"),s=document.createElementNS(n,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),a.appendChild(s),s.appendChild(e),ze(a)}const E=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||E(r,t)};function Ye(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Be(e,t){return fe(t).map(r=>{const n=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${n}${a?" !important":""};`}).join(" ")}function Je(e,t,r,n){const a=`.${e}:${t}`,s=r.cssText?Ye(r):Be(r,n);return document.createTextNode(`${a}{${s}}`)}function pe(e,t,r,n){const a=window.getComputedStyle(e,r),s=a.getPropertyValue("content");if(s===""||s==="none")return;const i=De();try{t.className=`${t.className} ${i}`}catch{return}const c=document.createElement("style");c.appendChild(Je(i,r,a,n)),t.appendChild(c)}function Xe(e,t,r){pe(e,t,":before",r),pe(e,t,":after",r)}const he="application/font-woff",ge="image/jpeg",Ze={woff:he,woff2:he,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:ge,jpeg:ge,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function qe(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function q(e){const t=qe(e).toLowerCase();return Ze[t]||""}function Ke(e){return e.split(/,/)[1]}function K(e){return e.search(/^(data:)/)!==-1}function Qe(e,t){return`data:${t};base64,${e}`}async function ye(e,t,r){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const a=await n.blob();return new Promise((s,i)=>{const c=new FileReader;c.onerror=i,c.onloadend=()=>{try{s(r({res:n,result:c.result}))}catch(u){i(u)}},c.readAsDataURL(a)})}const Q={};function et(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function ee(e,t,r){const n=et(e,t,r.includeQueryParams);if(Q[n]!=null)return Q[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const s=await ye(e,r.fetchRequestInit,({res:i,result:c})=>(t||(t=i.headers.get("Content-Type")||""),Ke(c)));a=Qe(s,t)}catch(s){a=r.imagePlaceholder||"";let i=`Failed to fetch resource: ${e}`;s&&(i=typeof s=="string"?s:s.message),i&&console.warn(i)}return Q[n]=a,a}async function tt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):z(t)}async function rt(e,t){if(e.currentSrc){const s=document.createElement("canvas"),i=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,i?.drawImage(e,0,0,s.width,s.height);const c=s.toDataURL();return z(c)}const r=e.poster,n=q(r),a=await ee(r,n,t);return z(a)}async function nt(e,t){var r;try{if(!((r=e?.contentDocument)===null||r===void 0)&&r.body)return await U(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function st(e,t){return E(e,HTMLCanvasElement)?tt(e):E(e,HTMLVideoElement)?rt(e,t):E(e,HTMLIFrameElement)?nt(e,t):e.cloneNode(xe(e))}const at=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",xe=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ot(e,t,r){var n,a;if(xe(t))return t;let s=[];return at(e)&&e.assignedNodes?s=R(e.assignedNodes()):E(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?s=R(e.contentDocument.body.childNodes):s=R(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),s.length===0||E(e,HTMLVideoElement)||await s.reduce((i,c)=>i.then(()=>U(c,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function it(e,t,r){const n=t.style;if(!n)return;const a=window.getComputedStyle(e);a.cssText?(n.cssText=a.cssText,n.transformOrigin=a.transformOrigin):fe(r).forEach(s=>{let i=a.getPropertyValue(s);s==="font-size"&&i.endsWith("px")&&(i=`${Math.floor(parseFloat(i.substring(0,i.length-2)))-.1}px`),E(e,HTMLIFrameElement)&&s==="display"&&i==="inline"&&(i="block"),s==="d"&&t.getAttribute("d")&&(i=`path(${t.getAttribute("d")})`),n.setProperty(s,i,a.getPropertyPriority(s))})}function ct(e,t){E(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),E(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function lt(e,t){if(E(e,HTMLSelectElement)){const n=Array.from(t.children).find(a=>e.value===a.getAttribute("value"));n&&n.setAttribute("selected","")}}function ut(e,t,r){return E(t,Element)&&(it(e,t,r),Xe(e,t,r),ct(e,t),lt(e,t)),t}async function dt(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const n={};for(let s=0;s<r.length;s++){const c=r[s].getAttribute("xlink:href");if(c){const u=e.querySelector(c),d=document.querySelector(c);!u&&d&&!n[c]&&(n[c]=await U(d,t,!0))}}const a=Object.values(n);if(a.length){const s="http://www.w3.org/1999/xhtml",i=document.createElementNS(s,"svg");i.setAttribute("xmlns",s),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const c=document.createElementNS(s,"defs");i.appendChild(c);for(let u=0;u<a.length;u++)c.appendChild(a[u]);e.appendChild(i)}return e}async function U(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>st(n,t)).then(n=>ot(e,n,t)).then(n=>ut(e,n,t)).then(n=>dt(n,t))}const we=/url\((['"]?)([^'"]+?)\1\)/g,ft=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,mt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function pt(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function ht(e){const t=[];return e.replace(we,(r,n,a)=>(t.push(a),r)),t.filter(r=>!K(r))}async function gt(e,t,r,n,a){try{const s=r?Ne(t,r):t,i=q(t);let c;return a||(c=await ee(s,i,n)),e.replace(pt(t),`$1${c}$3`)}catch{}return e}function yt(e,{preferredFontFormat:t}){return t?e.replace(mt,r=>{for(;;){const[n,,a]=ft.exec(r)||[];if(!a)return"";if(a===t)return`src: ${n};`}}):e}function ve(e){return e.search(we)!==-1}async function be(e,t,r){if(!ve(e))return e;const n=yt(e,r);return ht(n).reduce((s,i)=>s.then(c=>gt(c,i,t,r)),Promise.resolve(n))}async function V(e,t,r){var n;const a=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(a){const s=await be(a,null,r);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function xt(e,t){await V("background",e,t)||await V("background-image",e,t),await V("mask",e,t)||await V("-webkit-mask",e,t)||await V("mask-image",e,t)||await V("-webkit-mask-image",e,t)}async function wt(e,t){const r=E(e,HTMLImageElement);if(!(r&&!K(e.src))&&!(E(e,SVGImageElement)&&!K(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,a=await ee(n,q(n),t);await new Promise((s,i)=>{e.onload=s,e.onerror=t.onImageErrorHandler?(...u)=>{try{s(t.onImageErrorHandler(...u))}catch(d){i(d)}}:i;const c=e;c.decode&&(c.decode=s),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function vt(e,t){const n=R(e.childNodes).map(a=>Ee(a,t));await Promise.all(n).then(()=>e)}async function Ee(e,t){E(e,Element)&&(await xt(e,t),await wt(e,t),await vt(e,t))}function bt(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(a=>{r[a]=n[a]}),e}const Se={};async function Ce(e){let t=Se[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Se[e]=t,t}async function Re(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,s=(r.match(/url\([^)]+\)/g)||[]).map(async i=>{let c=i.replace(n,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),ye(c,t.fetchRequestInit,({result:u})=>(r=r.replace(i,`url(${u})`),[i,u]))});return Promise.all(s).then(()=>r)}function ke(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(n);if(u===null)break;t.push(u[0])}n=n.replace(a,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(i,"gi");for(;;){let u=s.exec(n);if(u===null){if(u=c.exec(n),u===null)break;s.lastIndex=c.lastIndex}else c.lastIndex=s.lastIndex;t.push(u[0])}return t}async function Et(e,t){const r=[],n=[];return e.forEach(a=>{if("cssRules"in a)try{R(a.cssRules||[]).forEach((s,i)=>{if(s.type===CSSRule.IMPORT_RULE){let c=i+1;const u=s.href,d=Ce(u).then(p=>Re(p,t)).then(p=>ke(p).forEach(g=>{try{a.insertRule(g,g.startsWith("@import")?c+=1:a.cssRules.length)}catch(b){console.error("Error inserting rule from remote css",{rule:g,error:b})}})).catch(p=>{console.error("Error loading remote css",p.toString())});n.push(d)}})}catch(s){const i=e.find(c=>c.href==null)||document.styleSheets[0];a.href!=null&&n.push(Ce(a.href).then(c=>Re(c,t)).then(c=>ke(c).forEach(u=>{i.insertRule(u,i.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",s)}}),Promise.all(n).then(()=>(e.forEach(a=>{if("cssRules"in a)try{R(a.cssRules||[]).forEach(s=>{r.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${a.href}`,s)}}),r))}function St(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>ve(t.style.getPropertyValue("src")))}async function Ct(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=R(e.ownerDocument.styleSheets),n=await Et(r,t);return St(n)}function Te(e){return e.trim().replace(/["']/g,"")}function Rt(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(s=>{t.add(Te(s))}),Array.from(n.children).forEach(s=>{s instanceof HTMLElement&&r(s)})}return r(e),t}async function kt(e,t){const r=await Ct(e,t),n=Rt(e);return(await Promise.all(r.filter(s=>n.has(Te(s.style.fontFamily))).map(s=>{const i=s.parentStyleSheet?s.parentStyleSheet.href:null;return be(s.cssText,i,t)}))).join(`
8
- `)}async function Tt(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await kt(e,t);if(r){const n=document.createElement("style"),a=document.createTextNode(r);n.appendChild(a),e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}}async function Pt(e,t={}){const{width:r,height:n}=me(e,t),a=await U(e,t,!0);return await Tt(a,t),await Ee(a,t),bt(a,t),await Ue(a,r,n)}async function jt(e,t={}){const{width:r,height:n}=me(e,t),a=await Pt(e,t),s=await z(a),i=document.createElement("canvas"),c=i.getContext("2d"),u=t.pixelRatio||$e(),d=t.canvasWidth||r,p=t.canvasHeight||n;return i.width=d*u,i.height=p*u,t.skipAutoScale||We(i),i.style.width=`${d}`,i.style.height=`${p}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,i.width,i.height)),c.drawImage(s,0,0,i.width,i.height),i}async function Ot(e,t={}){return(await jt(e,t)).toDataURL()}const _t=e=>{const r=Object.keys(e).find(s=>s.startsWith("__reactFiber$")||s.startsWith("__reactInternalInstance$"));if(!r)return"";const n=[];let a=e[r];for(;a;){const s=a.type;if(typeof s=="function"){const i=s.displayName||s.name;i&&!i.includes("ViewGate")&&!n.includes(i)&&n.unshift(i)}a=a.return}return n.join(" > ")||"Generic Component"},Vt=e=>{const t=e.getAttribute("data-source-path")||"unknown:0",r=_t(e),a=(c=>{const u=[];let d=c;for(;d&&d.nodeType===Node.ELEMENT_NODE;){let p=d.nodeName.toLowerCase();if(d.id){p+="#"+d.id,u.unshift(p);break}else{let g=d,b=1;for(;g.previousElementSibling;)g=g.previousElementSibling,g.nodeName.toLowerCase()===p&&b++;b>1&&(p+=`:nth-of-type(${b})`)}u.unshift(p),d=d.parentElement}return u.join(" > ")})(e),s=(e.innerText||"").slice(0,50).trim(),i=`${e.tagName.toLowerCase()}-${s.replace(/\s+/g,"_")}-${a.split(" > ").slice(-2).join("_")}`;return{tag:e.tagName.toLowerCase(),id:e.id||"",classes:e.className||"",text:(e.innerText||"").slice(0,100).trim(),selector:a,outerHtml:(e.outerHTML||"").slice(0,500),parentContext:(e.parentElement?.innerText||"").slice(0,100).trim(),componentPath:r,signature:i,source:t}},Pe=()=>{const{addToast:e,language:t,t:r,apiKey:n,baseUrl:a}=de(),[s,i]=y.useState(!1),[c,u]=y.useState(null),[d,p]=y.useState(null),[g,b]=y.useState(""),[k,N]=y.useState(!1),[Y,A]=y.useState(!1),[P,B]=y.useState(!1),[D,re]=y.useState([]),[ne,J]=y.useState(!1),T=y.useCallback(async()=>{if(n){J(!0);try{const m=await fetch(`${a}/api/annotations`,{headers:{"x-api-key":n}});if(m.ok){const h=await m.json();re(h)}}catch(m){console.error("Failed to fetch annotations",m)}finally{J(!1)}}},[n,a]);y.useEffect(()=>{(s||P)&&T()},[s,P,T]);const M=y.useCallback(m=>{if(!s||d)return;const h=document.elementFromPoint(m.clientX,m.clientY);if(!h||h.id==="viewgate-overlay"||h.closest("#viewgate-ui")){u(null);return}h.getAttribute("data-source-path"),u({tag:h.tagName.toLowerCase(),source:h.getAttribute("data-source-path")||"unknown:0",rect:h.getBoundingClientRect(),element:h,previewText:(h.innerText||"").slice(0,100)||(h.getAttribute("placeholder")||"").slice(0,100)||h.tagName.toLowerCase(),semanticReference:Vt(h)})},[s,d]),j=y.useCallback(async m=>{if(!(!s||d)&&c){m.preventDefault(),m.stopPropagation(),A(!0);try{const h=c.element.style.display,L=window.getComputedStyle(c.element).display==="inline";L&&(c.element.style.display="inline-block");const O=await Ot(c.element,{backgroundColor:"#ffffff",pixelRatio:2,skipFonts:!0,style:{margin:"0",padding:"4px"}});L&&(c.element.style.display=h),p({...c,visualPreview:O})}catch(h){console.error("Failed to capture preview:",h),p(c)}finally{A(!1),u(null)}}},[s,c,d,P]);y.useEffect(()=>(s&&!d?document.body.classList.add("vg-cursor-pointer"):document.body.classList.remove("vg-cursor-pointer"),window.addEventListener("mousemove",M),window.addEventListener("click",j,!0),()=>{document.body.classList.remove("vg-cursor-pointer"),window.removeEventListener("mousemove",M),window.removeEventListener("click",j,!0)}),[s,d,M,j]);const se=async()=>{if(!d||!g.trim())return;N(!0);const{semanticReference:m}=d,[h,L]=m.source.split(":"),O=L||"0";try{if(!(await fetch(`${a}/api/annotations`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({filePath:h,line:parseInt(O),url:window.location.href,message:g,componentName:m.componentPath||d.tag,reference:m})})).ok)throw new Error("Backend failed");e(r.success,"success"),p(null),b(""),i(!1),T()}catch(H){console.error(H),e(r.error,"error")}finally{N(!1)}},X=m=>m.split("/").pop()?.split("\\").pop()||"unknown";return l.jsxs(l.Fragment,{children:[l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:259",style:{position:"fixed",bottom:"30px",right:"30px",zIndex:99999},id:"viewgate-ui",children:[l.jsx("button",{onClick:()=>i(!s),className:"vg-button-primary",style:{padding:"12px 24px",fontSize:"15px"},children:s?r.exitMode:r.enterMode}),D.length>0&&l.jsx("button",{onClick:()=>{B(!P),i(!1),p(null)},className:"vg-button-ghost",style:{padding:"12px 24px",fontSize:"15px",marginLeft:"12px",background:"white"},children:r.viewComments})]}),Y&&l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:284",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(255,255,255,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e5,cursor:"wait"},children:l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:297",className:"vg-glassmorphism",style:{padding:"30px 50px",fontWeight:700,display:"flex",flexDirection:"column",alignItems:"center",backgroundColor:"rgba(0,0,0,0.7)",color:"white",border:"1px solid rgba(255,255,255,0.1)"},children:[l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:298",className:"vg-spinner"}),"Capturing..."]})}),s&&c&&!d&&!Y&&l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:306",style:{position:"fixed",top:c.rect.top,left:c.rect.left,width:c.rect.width,height:c.rect.height,border:"2px solid var(--vg-primary)",backgroundColor:"rgba(37, 19, 236, 0.05)",pointerEvents:"none",zIndex:99998,borderRadius:"4px",boxShadow:"0 0 15px rgba(37, 19, 236, 0.2)",transition:"all 0.1s ease-out"}}),d&&l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:324",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:99999},children:l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:337",className:"vg-glassmorphism vg-animate-slide",style:{padding:"32px",width:"460px",background:"white",color:"#0f172a"},children:[l.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:343",style:{margin:"0 0 10px 0",fontSize:"24px",fontWeight:800},children:r.feedbackHeader}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:345",style:{marginBottom:"20px"},children:[l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:346",style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"},children:[d.semanticReference.componentPath?l.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:348",className:"vg-badge",style:{backgroundColor:"#f5f3ff",color:"#7c3aed",borderColor:"#ddd6fe"},children:["📦 ",d.semanticReference.componentPath]}):l.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:352",className:"vg-badge",children:d.tag}),d.semanticReference.source&&!d.semanticReference.source.startsWith("unknown")?l.jsx(l.Fragment,{children:l.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:357",className:"vg-badge",style:{backgroundColor:"#fdf2f8",color:"#db2777",borderColor:"#fbcfe8"},children:["📄 ",X(d.semanticReference.source.split(":")[0]||"unknown")]})}):l.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:362",className:"vg-badge",style:{backgroundColor:"#f0f9ff",color:"#0369a1",borderColor:"#bae6fd",maxWidth:"300px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["🆔 ",d.semanticReference.signature]})]}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:367",style:{marginTop:"8px",fontSize:"11px",color:"#94a3b8"},children:["🎯 ",d.semanticReference.selector]})]}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:373",style:{backgroundColor:"#f8fafc",borderRadius:"8px",border:"1px solid #e2e8f0",marginBottom:"20px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:382",style:{padding:"8px 12px",fontSize:"10px",color:"#94a3b8",textTransform:"uppercase",fontWeight:700,borderBottom:"1px solid #f1f5f9"},children:r.preview}),l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:385",style:{padding:"12px",display:"flex",justifyContent:"center",alignItems:"center",minHeight:"60px",maxHeight:"150px",overflow:"hidden",backgroundColor:"white"},children:d.visualPreview?l.jsx("img",{src:d.visualPreview,alt:"Element Preview",style:{maxWidth:"100%",maxHeight:"120px",objectFit:"contain",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderRadius:"4px"}}):l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:408",style:{fontSize:"13px",color:"#64748b",fontStyle:"italic"},children:['"',d.previewText,'"']})})]}),l.jsx("textarea",{className:"vg-textarea",value:g,onChange:m=>b(m.target.value),rows:4,placeholder:r.placeholder,autoFocus:!0}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:424",style:{display:"flex",justifyContent:"flex-end",gap:"12px",marginTop:"24px"},children:[l.jsx("button",{onClick:()=>p(null),className:"vg-button-ghost",children:r.cancel}),l.jsx("button",{onClick:se,className:"vg-button-primary",disabled:k||!g.trim(),style:{opacity:k||!g.trim()?.6:1},children:k?r.submitting:r.send})]})]})}),P&&l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:446",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:99999},children:l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:459",className:"vg-glassmorphism vg-animate-slide",style:{padding:"32px",width:"600px",maxHeight:"80vh",background:"white",color:"#0f172a",display:"flex",flexDirection:"column"},children:[l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:468",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[l.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:469",style:{margin:0,fontSize:"24px",fontWeight:800},children:r.feedbackHeader}),l.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:470",onClick:()=>B(!1),className:"vg-button-ghost",style:{padding:"6px 12px"},children:"✕"})]}),l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:473",style:{overflowY:"auto",flex:1,paddingRight:"8px",display:"flex",flexDirection:"column",gap:"16px"},children:ne?l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:475",style:{textAlign:"center",padding:"40px",color:"#64748b"},children:"Cargando..."}):D.length===0?l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:477",style:{textAlign:"center",padding:"40px",color:"#64748b"},children:r.noComments}):D.map(m=>l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:480",style:{border:"1px solid #e2e8f0",borderRadius:"12px",padding:"16px",backgroundColor:m.status==="ready_for_review"?"#f0fdf4":"#fff"},children:[l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:486",style:{display:"flex",justifyContent:"space-between",marginBottom:"12px"},children:l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:487",style:{display:"flex",gap:"8px",alignItems:"center"},children:[m.status==="ready_for_review"?l.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:489",className:"vg-badge",style:{backgroundColor:"#dcfce7",color:"#166534",borderColor:"#bbf7d0"},children:["✓ ",r.readyForReview]}):l.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:491",className:"vg-badge",style:{backgroundColor:"#fef3c7",color:"#92400e",borderColor:"#fde68a"},children:["⏳ ",r.pending]}),l.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:493",style:{fontSize:"12px",color:"#64748b"},children:new Date(m.timestamp).toLocaleString()})]})}),l.jsxs("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:499",style:{margin:"0 0 12px 0",fontSize:"15px",fontWeight:600},children:['"',m.message,'"']}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:501",style:{display:"flex",gap:"6px",flexWrap:"wrap",marginBottom:"16px"},children:[l.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:502",className:"vg-badge",style:{backgroundColor:"#f1f5f9",color:"#475569",border:"none"},children:m.componentName||"UI Element"}),m.filePath&&m.filePath!=="unknown"&&l.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:506",className:"vg-badge",style:{backgroundColor:"#f1f5f9",color:"#475569",border:"none"},children:X(m.filePath)})]}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:512",style:{display:"flex",gap:"8px",justifyContent:"flex-end",borderTop:"1px solid #e2e8f0",paddingTop:"16px",marginTop:"8px"},children:[m.status==="pending"?l.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:514",className:"vg-button-primary",style:{display:"flex",alignItems:"center",gap:"6px"},onClick:async()=>{try{(await fetch(`${a}/api/annotations/${m._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({status:"ready_for_review"})})).ok&&(T(),e(r.success,"success"))}catch{e(r.error,"error")}},children:["✅ ",r.markReady]}):l.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:536",className:"vg-button-ghost",style:{display:"flex",alignItems:"center",gap:"6px"},onClick:async()=>{try{(await fetch(`${a}/api/annotations/${m._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({status:"pending"})})).ok&&(T(),e(r.success,"success"))}catch{e(r.error,"error")}},children:["🔄 ",r.reopen]}),l.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:559",className:"vg-button-primary",style:{backgroundColor:"#ef4444",display:"flex",alignItems:"center",gap:"6px"},onClick:async()=>{if(window.confirm(r.deleteConfirm))try{(await fetch(`${a}/api/annotations/${m._id}`,{method:"DELETE",headers:{"x-api-key":n}})).ok&&(T(),e(r.success,"success"))}catch{e(r.error,"error")}},children:["🗑️ ",r.close]})]})]},m._id))})]})})]})};function te(e,t,r){if(!t.endsWith(".tsx")&&!t.endsWith(".jsx")||t.includes("node_modules"))return e;const n=c=>c.replace(/\\/g,"/"),a=n(t).replace(n(r),"");return e.split(`
9
- `).map((c,u)=>{const d=u+1;return c.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g,(p,g,b)=>p.includes("data-source-path")||b==="Fragment"||b==="React.Fragment"?p:`${g}<${b} data-source-path="${a}:${d}"`)}).join(`
10
- `)}function At(){return{name:"vite-plugin-viewgate",enforce:"pre",transform(e,t){return{code:te(e,t,process.cwd()),map:null}}}}function Lt(e){const t=this.resourcePath;return t?(process.env.NODE_ENV,te(e,t,process.cwd())):e}C.ViewGate=Ie,C.ViewGateOverlay=Pe,C.transformSourcePaths=te,C.useViewGate=de,C.viewgateNextLoader=Lt,C.viewgatePlugin=At,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}));
7
+ <%s key={someKey} {...props} />`,b,v,G,v),Ve[v+b]=!0)}if(v=null,x!==void 0&&(r(x),v=""+x),i(f)&&(r(f.key),v=""+f.key),"key"in f){x={};for(var oe in f)oe!=="key"&&(x[oe]=f[oe])}else x=f;return v&&c(x,typeof o=="function"?o.displayName||o.name||"Unknown":o),d(o,v,x,a(),Z,ae)}function g(o){w(o)?o._store&&(o._store.validated=1):typeof o=="object"&&o!==null&&o.$$typeof===j&&(o._payload.status==="fulfilled"?w(o._payload.value)&&o._payload.value._store&&(o._payload.value._store.validated=1):o._store&&(o._store.validated=1))}function w(o){return typeof o=="object"&&o!==null&&o.$$typeof===k}var C=y,k=Symbol.for("react.transitional.element"),Y=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),re=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),X=Symbol.for("react.client.reference"),m=C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,h=Object.prototype.hasOwnProperty,L=Array.isArray,O=console.createTask?console.createTask:function(){return null};C={react_stack_bottom_frame:function(o){return o()}};var $,je={},Oe=C.react_stack_bottom_frame.bind(C,s)(),_e=O(n(s)),Ve={};I.Fragment=A,I.jsx=function(o,f,x){var b=1e4>m.recentlyCreatedOwnerStacks++;return p(o,f,x,!1,b?Error("react-stack-top-frame"):Oe,b?O(n(o)):_e)},I.jsxs=function(o,f,x){var b=1e4>m.recentlyCreatedOwnerStacks++;return p(o,f,x,!0,b?Error("react-stack-top-frame"):Oe,b?O(n(o)):_e)}})()),I}var le;function Ge(){return le||(le=1,process.env.NODE_ENV==="production"?H.exports=Ae():H.exports=Le()),H.exports}var l=Ge();const Fe={en:{enterMode:"🚀 Enter Feedback Mode",exitMode:"✨ Exit Mode",feedbackHeader:"Feedback",selectedElement:"Selected element:",line:"Line",placeholder:"Tell us what you'd like to change...",cancel:"Cancel",send:"Send Feedback",submitting:"Submitting...",success:"Your feedback has been submitted successfully!",error:"Failed to submit feedback. Check backend connection.",successHeader:"Success",errorHeader:"Error",preview:"Preview",viewComments:"👀 View Comments",close:"Close",observe:"Observe",pending:"Pending",readyForReview:"Ready for Review",noComments:"No comments found.",deleteConfirm:"Are you sure you want to close/delete this comment?",markReady:"Mark as Ready",reopen:"Reopen"},es:{enterMode:"🚀 Activar Modo Comentarios",exitMode:"✨ Salir del Modo",feedbackHeader:"Comentarios",selectedElement:"Elemento seleccionado:",line:"Línea",placeholder:"Cuéntanos qué te gustaría cambiar...",cancel:"Cancelar",send:"Enviar Comentarios",submitting:"Enviando...",success:"¡Tus comentarios se han enviado con éxito!",error:"Error al enviar comentarios. Revisa la conexión con el servidor.",successHeader:"Éxito",errorHeader:"Error",preview:"Vista previa",viewComments:"👀 Ver Comentarios",close:"Cerrar",observe:"Observar",pending:"Pendiente",readyForReview:"Lista para revisión",noComments:"No hay comentarios.",deleteConfirm:"¿Estás seguro de que deseas cerrar y eliminar este comentario?",markReady:"Marcar como Listo",reopen:"Reabrir"}},ue=y.createContext(void 0),de=()=>{const e=y.useContext(ue);if(!e)throw new Error("useViewGate must be used within a ViewGateProvider");return e},Ie=({children:e,language:t="es",apiKey:r,baseUrl:n="https://view-gate.vercel.app"})=>{const[a,s]=y.useState([]),i=(u,d)=>{const p=Date.now();s(g=>[...g,{id:p,message:u,type:d}]),setTimeout(()=>{s(g=>g.filter(w=>w.id!==p))},4e3)},c=Fe[t];return l.jsxs(ue.Provider,{"data-source-path":"/src/components/ViewGateProvider.tsx:122",value:{addToast:i,language:t,t:c,apiKey:r,baseUrl:n},children:[e,l.jsx(Pe,{"data-source-path":"/src/components/ViewGateProvider.tsx:124"}),l.jsx("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:125",className:"vg-toasts",children:a.map(u=>l.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:127",className:`vg-toast vg-glassmorphism vg-animate-slide ${u.type}`,children:[l.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:128",style:{fontSize:"20px"},children:u.type==="success"?"✅":"❌"}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:129",children:[l.jsx("strong",{"data-source-path":"/src/components/ViewGateProvider.tsx:130",style:{display:"block"},children:u.type==="success"?c.successHeader:c.errorHeader}),l.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:131",style:{fontSize:"14px"},children:u.message})]})]},u.id))})]})};function Ne(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(a),t&&(n.href=t),a.href=e,a.href}const De=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function T(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let _=null;function fe(e={}){return _||(e.includeStyleProperties?(_=e.includeStyleProperties,_):(_=T(window.getComputedStyle(document.documentElement)),_))}function W(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function Me(e){const t=W(e,"border-left-width"),r=W(e,"border-right-width");return e.clientWidth+t+r}function $e(e){const t=W(e,"border-top-width"),r=W(e,"border-bottom-width");return e.clientHeight+t+r}function me(e,t={}){const r=t.width||Me(e),n=t.height||$e(e);return{width:r,height:n}}function He(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const S=16384;function We(e){(e.width>S||e.height>S)&&(e.width>S&&e.height>S?e.width>e.height?(e.height*=S/e.width,e.width=S):(e.width*=S/e.height,e.height=S):e.width>S?(e.height*=S/e.width,e.width=S):(e.width*=S/e.height,e.height=S))}function z(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function ze(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ue(e,t,r){const n="http://www.w3.org/2000/svg",a=document.createElementNS(n,"svg"),s=document.createElementNS(n,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),a.appendChild(s),s.appendChild(e),ze(a)}const E=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||E(r,t)};function Ye(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Be(e,t){return fe(t).map(r=>{const n=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${n}${a?" !important":""};`}).join(" ")}function Je(e,t,r,n){const a=`.${e}:${t}`,s=r.cssText?Ye(r):Be(r,n);return document.createTextNode(`${a}{${s}}`)}function pe(e,t,r,n){const a=window.getComputedStyle(e,r),s=a.getPropertyValue("content");if(s===""||s==="none")return;const i=De();try{t.className=`${t.className} ${i}`}catch{return}const c=document.createElement("style");c.appendChild(Je(i,r,a,n)),t.appendChild(c)}function Xe(e,t,r){pe(e,t,":before",r),pe(e,t,":after",r)}const he="application/font-woff",ge="image/jpeg",Ze={woff:he,woff2:he,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:ge,jpeg:ge,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function qe(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function q(e){const t=qe(e).toLowerCase();return Ze[t]||""}function Ke(e){return e.split(/,/)[1]}function K(e){return e.search(/^(data:)/)!==-1}function Qe(e,t){return`data:${t};base64,${e}`}async function ye(e,t,r){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const a=await n.blob();return new Promise((s,i)=>{const c=new FileReader;c.onerror=i,c.onloadend=()=>{try{s(r({res:n,result:c.result}))}catch(u){i(u)}},c.readAsDataURL(a)})}const Q={};function et(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function ee(e,t,r){const n=et(e,t,r.includeQueryParams);if(Q[n]!=null)return Q[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const s=await ye(e,r.fetchRequestInit,({res:i,result:c})=>(t||(t=i.headers.get("Content-Type")||""),Ke(c)));a=Qe(s,t)}catch(s){a=r.imagePlaceholder||"";let i=`Failed to fetch resource: ${e}`;s&&(i=typeof s=="string"?s:s.message),i&&console.warn(i)}return Q[n]=a,a}async function tt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):z(t)}async function rt(e,t){if(e.currentSrc){const s=document.createElement("canvas"),i=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,i?.drawImage(e,0,0,s.width,s.height);const c=s.toDataURL();return z(c)}const r=e.poster,n=q(r),a=await ee(r,n,t);return z(a)}async function nt(e,t){var r;try{if(!((r=e?.contentDocument)===null||r===void 0)&&r.body)return await U(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function st(e,t){return E(e,HTMLCanvasElement)?tt(e):E(e,HTMLVideoElement)?rt(e,t):E(e,HTMLIFrameElement)?nt(e,t):e.cloneNode(xe(e))}const at=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",xe=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ot(e,t,r){var n,a;if(xe(t))return t;let s=[];return at(e)&&e.assignedNodes?s=T(e.assignedNodes()):E(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?s=T(e.contentDocument.body.childNodes):s=T(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),s.length===0||E(e,HTMLVideoElement)||await s.reduce((i,c)=>i.then(()=>U(c,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function it(e,t,r){const n=t.style;if(!n)return;const a=window.getComputedStyle(e);a.cssText?(n.cssText=a.cssText,n.transformOrigin=a.transformOrigin):fe(r).forEach(s=>{let i=a.getPropertyValue(s);s==="font-size"&&i.endsWith("px")&&(i=`${Math.floor(parseFloat(i.substring(0,i.length-2)))-.1}px`),E(e,HTMLIFrameElement)&&s==="display"&&i==="inline"&&(i="block"),s==="d"&&t.getAttribute("d")&&(i=`path(${t.getAttribute("d")})`),n.setProperty(s,i,a.getPropertyPriority(s))})}function ct(e,t){E(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),E(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function lt(e,t){if(E(e,HTMLSelectElement)){const n=Array.from(t.children).find(a=>e.value===a.getAttribute("value"));n&&n.setAttribute("selected","")}}function ut(e,t,r){return E(t,Element)&&(it(e,t,r),Xe(e,t,r),ct(e,t),lt(e,t)),t}async function dt(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const n={};for(let s=0;s<r.length;s++){const c=r[s].getAttribute("xlink:href");if(c){const u=e.querySelector(c),d=document.querySelector(c);!u&&d&&!n[c]&&(n[c]=await U(d,t,!0))}}const a=Object.values(n);if(a.length){const s="http://www.w3.org/1999/xhtml",i=document.createElementNS(s,"svg");i.setAttribute("xmlns",s),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const c=document.createElementNS(s,"defs");i.appendChild(c);for(let u=0;u<a.length;u++)c.appendChild(a[u]);e.appendChild(i)}return e}async function U(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>st(n,t)).then(n=>ot(e,n,t)).then(n=>ut(e,n,t)).then(n=>dt(n,t))}const we=/url\((['"]?)([^'"]+?)\1\)/g,ft=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,mt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function pt(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function ht(e){const t=[];return e.replace(we,(r,n,a)=>(t.push(a),r)),t.filter(r=>!K(r))}async function gt(e,t,r,n,a){try{const s=r?Ne(t,r):t,i=q(t);let c;return a||(c=await ee(s,i,n)),e.replace(pt(t),`$1${c}$3`)}catch{}return e}function yt(e,{preferredFontFormat:t}){return t?e.replace(mt,r=>{for(;;){const[n,,a]=ft.exec(r)||[];if(!a)return"";if(a===t)return`src: ${n};`}}):e}function be(e){return e.search(we)!==-1}async function ve(e,t,r){if(!be(e))return e;const n=yt(e,r);return ht(n).reduce((s,i)=>s.then(c=>gt(c,i,t,r)),Promise.resolve(n))}async function V(e,t,r){var n;const a=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(a){const s=await ve(a,null,r);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function xt(e,t){await V("background",e,t)||await V("background-image",e,t),await V("mask",e,t)||await V("-webkit-mask",e,t)||await V("mask-image",e,t)||await V("-webkit-mask-image",e,t)}async function wt(e,t){const r=E(e,HTMLImageElement);if(!(r&&!K(e.src))&&!(E(e,SVGImageElement)&&!K(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,a=await ee(n,q(n),t);await new Promise((s,i)=>{e.onload=s,e.onerror=t.onImageErrorHandler?(...u)=>{try{s(t.onImageErrorHandler(...u))}catch(d){i(d)}}:i;const c=e;c.decode&&(c.decode=s),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function bt(e,t){const n=T(e.childNodes).map(a=>Ee(a,t));await Promise.all(n).then(()=>e)}async function Ee(e,t){E(e,Element)&&(await xt(e,t),await wt(e,t),await bt(e,t))}function vt(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(a=>{r[a]=n[a]}),e}const Se={};async function Ce(e){let t=Se[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Se[e]=t,t}async function Re(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,s=(r.match(/url\([^)]+\)/g)||[]).map(async i=>{let c=i.replace(n,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),ye(c,t.fetchRequestInit,({result:u})=>(r=r.replace(i,`url(${u})`),[i,u]))});return Promise.all(s).then(()=>r)}function ke(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(n);if(u===null)break;t.push(u[0])}n=n.replace(a,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(i,"gi");for(;;){let u=s.exec(n);if(u===null){if(u=c.exec(n),u===null)break;s.lastIndex=c.lastIndex}else c.lastIndex=s.lastIndex;t.push(u[0])}return t}async function Et(e,t){const r=[],n=[];return e.forEach(a=>{if("cssRules"in a)try{T(a.cssRules||[]).forEach((s,i)=>{if(s.type===CSSRule.IMPORT_RULE){let c=i+1;const u=s.href,d=Ce(u).then(p=>Re(p,t)).then(p=>ke(p).forEach(g=>{try{a.insertRule(g,g.startsWith("@import")?c+=1:a.cssRules.length)}catch(w){console.error("Error inserting rule from remote css",{rule:g,error:w})}})).catch(p=>{console.error("Error loading remote css",p.toString())});n.push(d)}})}catch(s){const i=e.find(c=>c.href==null)||document.styleSheets[0];a.href!=null&&n.push(Ce(a.href).then(c=>Re(c,t)).then(c=>ke(c).forEach(u=>{i.insertRule(u,i.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",s)}}),Promise.all(n).then(()=>(e.forEach(a=>{if("cssRules"in a)try{T(a.cssRules||[]).forEach(s=>{r.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${a.href}`,s)}}),r))}function St(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>be(t.style.getPropertyValue("src")))}async function Ct(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=T(e.ownerDocument.styleSheets),n=await Et(r,t);return St(n)}function Te(e){return e.trim().replace(/["']/g,"")}function Rt(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(s=>{t.add(Te(s))}),Array.from(n.children).forEach(s=>{s instanceof HTMLElement&&r(s)})}return r(e),t}async function kt(e,t){const r=await Ct(e,t),n=Rt(e);return(await Promise.all(r.filter(s=>n.has(Te(s.style.fontFamily))).map(s=>{const i=s.parentStyleSheet?s.parentStyleSheet.href:null;return ve(s.cssText,i,t)}))).join(`
8
+ `)}async function Tt(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await kt(e,t);if(r){const n=document.createElement("style"),a=document.createTextNode(r);n.appendChild(a),e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}}async function Pt(e,t={}){const{width:r,height:n}=me(e,t),a=await U(e,t,!0);return await Tt(a,t),await Ee(a,t),vt(a,t),await Ue(a,r,n)}async function jt(e,t={}){const{width:r,height:n}=me(e,t),a=await Pt(e,t),s=await z(a),i=document.createElement("canvas"),c=i.getContext("2d"),u=t.pixelRatio||He(),d=t.canvasWidth||r,p=t.canvasHeight||n;return i.width=d*u,i.height=p*u,t.skipAutoScale||We(i),i.style.width=`${d}`,i.style.height=`${p}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,i.width,i.height)),c.drawImage(s,0,0,i.width,i.height),i}async function Ot(e,t={}){return(await jt(e,t)).toDataURL()}const _t=e=>{const r=Object.keys(e).find(s=>s.startsWith("__reactFiber$")||s.startsWith("__reactInternalInstance$"));if(!r)return"";const n=[];let a=e[r];for(;a;){const s=a.type;if(typeof s=="function"){const i=s.displayName||s.name;i&&!i.includes("ViewGate")&&!n.includes(i)&&n.unshift(i)}a=a.return}return n.join(" > ")||"Generic Component"},Vt=e=>{let t="unknown:0",r=e;for(;r;){const d=r.getAttribute("data-source-path");if(d){t=d;break}r=r.parentElement}const n=_t(e),s=(d=>{const p=[];let g=d;for(;g&&g.nodeType===Node.ELEMENT_NODE;){let w=g.nodeName.toLowerCase();if(g.id){w+="#"+g.id,p.unshift(w);break}else{let C=g,k=1;for(;C.previousElementSibling;)C=C.previousElementSibling,C.nodeName.toLowerCase()===w&&k++;k>1&&(w+=`:nth-of-type(${k})`)}p.unshift(w),g=g.parentElement}return p.join(" > ")})(e),i=(e.innerText||"").slice(0,50).trim(),c={};["placeholder","aria-label","name","type","alt","title","value","role"].forEach(d=>{const p=e.getAttribute(d);p&&(c[d]=p)});const u=`${e.tagName.toLowerCase()}-${i.replace(/\s+/g,"_")}-${s.split(" > ").slice(-2).join("_")}`;return{tag:e.tagName.toLowerCase(),id:e.id||"",classes:e.className||"",text:(e.innerText||"").slice(0,100).trim(),selector:s,outerHtml:(e.outerHTML||"").slice(0,1e3),parentContext:(e.parentElement?.innerText||"").slice(0,150).trim(),componentPath:n,signature:u,source:t,attributes:c,metadata:{hint:`Edit ${t.split(":")[0]} at line ${t.split(":")[1]||"?"}`}}},Pe=()=>{const{addToast:e,language:t,t:r,apiKey:n,baseUrl:a}=de(),[s,i]=y.useState(!1),[c,u]=y.useState(null),[d,p]=y.useState(null),[g,w]=y.useState(""),[C,k]=y.useState(!1),[Y,A]=y.useState(!1),[N,B]=y.useState(!1),[D,re]=y.useState([]),[ne,J]=y.useState(!1),P=y.useCallback(async()=>{if(n){J(!0);try{const m=await fetch(`${a}/api/annotations`,{headers:{"x-api-key":n}});if(m.ok){const h=await m.json();re(h)}}catch(m){console.error("Failed to fetch annotations",m)}finally{J(!1)}}},[n,a]);y.useEffect(()=>{P()},[P]);const M=y.useCallback(m=>{if(!s||d)return;const h=document.elementFromPoint(m.clientX,m.clientY);if(!h||h.id==="viewgate-overlay"||h.closest("#viewgate-ui")){u(null);return}h.getAttribute("data-source-path"),u({tag:h.tagName.toLowerCase(),source:h.getAttribute("data-source-path")||"unknown:0",rect:h.getBoundingClientRect(),element:h,previewText:(h.innerText||"").slice(0,100)||(h.getAttribute("placeholder")||"").slice(0,100)||h.tagName.toLowerCase(),semanticReference:Vt(h)})},[s,d]),j=y.useCallback(async m=>{if(!(!s||d)&&c){m.preventDefault(),m.stopPropagation(),A(!0);try{const h=c.element.style.display,L=window.getComputedStyle(c.element).display==="inline";L&&(c.element.style.display="inline-block");const O=await Ot(c.element,{backgroundColor:"#ffffff",pixelRatio:2,skipFonts:!0,style:{margin:"0",padding:"4px"}});L&&(c.element.style.display=h),p({...c,visualPreview:O})}catch(h){console.error("Failed to capture preview:",h),p(c)}finally{A(!1),u(null)}}},[s,c,d,N]);y.useEffect(()=>(s&&!d?document.body.classList.add("vg-cursor-pointer"):document.body.classList.remove("vg-cursor-pointer"),window.addEventListener("mousemove",M),window.addEventListener("click",j,!0),()=>{document.body.classList.remove("vg-cursor-pointer"),window.removeEventListener("mousemove",M),window.removeEventListener("click",j,!0)}),[s,d,M,j]);const se=async()=>{if(!d||!g.trim())return;k(!0);const{semanticReference:m}=d,[h,L]=m.source.split(":"),O=L||"0";try{if(!(await fetch(`${a}/api/annotations`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({filePath:h,line:parseInt(O),url:window.location.href,message:g,componentName:m.componentPath||d.tag,reference:m})})).ok)throw new Error("Backend failed");e(r.success,"success"),p(null),w(""),i(!1),P()}catch($){console.error($),e(r.error,"error")}finally{k(!1)}},X=m=>m.split("/").pop()?.split("\\").pop()||"unknown";return l.jsxs(l.Fragment,{children:[l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:276",style:{position:"fixed",bottom:"30px",right:"30px",zIndex:99999},id:"viewgate-ui",children:[l.jsx("button",{onClick:()=>i(!s),className:"vg-button-primary",style:{padding:"12px 24px",fontSize:"15px"},children:s?r.exitMode:r.enterMode}),D.length>0&&l.jsx("button",{onClick:()=>{B(!N),i(!1),p(null)},className:"vg-button-ghost",style:{padding:"12px 24px",fontSize:"15px",marginLeft:"12px",background:"white"},children:r.viewComments})]}),Y&&l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:301",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(255,255,255,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e5,cursor:"wait"},children:l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:314",className:"vg-glassmorphism",style:{padding:"30px 50px",fontWeight:700,display:"flex",flexDirection:"column",alignItems:"center",backgroundColor:"rgba(0,0,0,0.7)",color:"white",border:"1px solid rgba(255,255,255,0.1)"},children:[l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:315",className:"vg-spinner"}),"Capturing..."]})}),s&&c&&!d&&!Y&&l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:323",style:{position:"fixed",top:c.rect.top,left:c.rect.left,width:c.rect.width,height:c.rect.height,border:"2px solid var(--vg-primary)",backgroundColor:"rgba(37, 19, 236, 0.05)",pointerEvents:"none",zIndex:99998,borderRadius:"4px",boxShadow:"0 0 15px rgba(37, 19, 236, 0.2)",transition:"all 0.1s ease-out"}}),d&&l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:341",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:99999},children:l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:354",className:"vg-glassmorphism vg-animate-slide",style:{padding:"32px",width:"460px",background:"white",color:"#0f172a"},children:[l.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:360",style:{margin:"0 0 10px 0",fontSize:"24px",fontWeight:800},children:r.feedbackHeader}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:362",style:{marginBottom:"20px"},children:[l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:363",style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"},children:[d.semanticReference.componentPath?l.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:365",className:"vg-badge",style:{backgroundColor:"#f5f3ff",color:"#7c3aed",borderColor:"#ddd6fe"},children:["📦 ",d.semanticReference.componentPath]}):l.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:369",className:"vg-badge",children:d.tag}),d.semanticReference.source&&!d.semanticReference.source.startsWith("unknown")?l.jsx(l.Fragment,{children:l.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:374",className:"vg-badge",style:{backgroundColor:"#fdf2f8",color:"#db2777",borderColor:"#fbcfe8"},children:["📄 ",X(d.semanticReference.source.split(":")[0]||"unknown")]})}):l.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:379",className:"vg-badge",style:{backgroundColor:"#f0f9ff",color:"#0369a1",borderColor:"#bae6fd",maxWidth:"300px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["🆔 ",d.semanticReference.signature]})]}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:384",style:{marginTop:"8px",fontSize:"11px",color:"#94a3b8"},children:["🎯 ",d.semanticReference.selector]})]}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:390",style:{backgroundColor:"#f8fafc",borderRadius:"8px",border:"1px solid #e2e8f0",marginBottom:"20px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:399",style:{padding:"8px 12px",fontSize:"10px",color:"#94a3b8",textTransform:"uppercase",fontWeight:700,borderBottom:"1px solid #f1f5f9"},children:r.preview}),l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:402",style:{padding:"12px",display:"flex",justifyContent:"center",alignItems:"center",minHeight:"60px",maxHeight:"150px",overflow:"hidden",backgroundColor:"white"},children:d.visualPreview?l.jsx("img",{src:d.visualPreview,alt:"Element Preview",style:{maxWidth:"100%",maxHeight:"120px",objectFit:"contain",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderRadius:"4px"}}):l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:425",style:{fontSize:"13px",color:"#64748b",fontStyle:"italic"},children:['"',d.previewText,'"']})})]}),l.jsx("textarea",{className:"vg-textarea",value:g,onChange:m=>w(m.target.value),rows:4,placeholder:r.placeholder,autoFocus:!0}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:441",style:{display:"flex",justifyContent:"flex-end",gap:"12px",marginTop:"24px"},children:[l.jsx("button",{onClick:()=>p(null),className:"vg-button-ghost",children:r.cancel}),l.jsx("button",{onClick:se,className:"vg-button-primary",disabled:C||!g.trim(),style:{opacity:C||!g.trim()?.6:1},children:C?r.submitting:r.send})]})]})}),N&&l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:463",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:99999},children:l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:476",className:"vg-glassmorphism vg-animate-slide",style:{padding:"32px",width:"600px",maxHeight:"80vh",background:"white",color:"#0f172a",display:"flex",flexDirection:"column"},children:[l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:485",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[l.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:486",style:{margin:0,fontSize:"24px",fontWeight:800},children:r.feedbackHeader}),l.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:487",onClick:()=>B(!1),className:"vg-button-ghost",style:{padding:"6px 12px"},children:"✕"})]}),l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:490",style:{overflowY:"auto",flex:1,paddingRight:"8px",display:"flex",flexDirection:"column",gap:"16px"},children:ne?l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:492",style:{textAlign:"center",padding:"40px",color:"#64748b"},children:"Cargando..."}):D.length===0?l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:494",style:{textAlign:"center",padding:"40px",color:"#64748b"},children:r.noComments}):D.map(m=>l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:497",style:{border:"1px solid #e2e8f0",borderRadius:"12px",padding:"16px",backgroundColor:m.status==="ready_for_review"?"#f0fdf4":"#fff"},children:[l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:503",style:{display:"flex",justifyContent:"space-between",marginBottom:"12px"},children:l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:504",style:{display:"flex",gap:"8px",alignItems:"center"},children:[m.status==="ready_for_review"?l.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:506",className:"vg-badge",style:{backgroundColor:"#dcfce7",color:"#166534",borderColor:"#bbf7d0"},children:["✓ ",r.readyForReview]}):l.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:508",className:"vg-badge",style:{backgroundColor:"#fef3c7",color:"#92400e",borderColor:"#fde68a"},children:["⏳ ",r.pending]}),l.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:510",style:{fontSize:"12px",color:"#64748b"},children:new Date(m.timestamp).toLocaleString()})]})}),l.jsxs("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:516",style:{margin:"0 0 12px 0",fontSize:"15px",fontWeight:600},children:['"',m.message,'"']}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:518",style:{display:"flex",gap:"6px",flexWrap:"wrap",marginBottom:"16px"},children:[l.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:519",className:"vg-badge",style:{backgroundColor:"#f1f5f9",color:"#475569",border:"none"},children:m.componentName||"UI Element"}),m.filePath&&m.filePath!=="unknown"&&l.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:523",className:"vg-badge",style:{backgroundColor:"#f1f5f9",color:"#475569",border:"none"},children:X(m.filePath)})]}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:529",style:{display:"flex",gap:"8px",justifyContent:"flex-end",borderTop:"1px solid #e2e8f0",paddingTop:"16px",marginTop:"8px"},children:[m.status==="pending"?l.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:531",className:"vg-button-primary",style:{display:"flex",alignItems:"center",gap:"6px"},onClick:async()=>{try{(await fetch(`${a}/api/annotations/${m._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({status:"ready_for_review"})})).ok&&(P(),e(r.success,"success"))}catch{e(r.error,"error")}},children:["✅ ",r.markReady]}):l.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:553",className:"vg-button-ghost",style:{display:"flex",alignItems:"center",gap:"6px"},onClick:async()=>{try{(await fetch(`${a}/api/annotations/${m._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({status:"pending"})})).ok&&(P(),e(r.success,"success"))}catch{e(r.error,"error")}},children:["🔄 ",r.reopen]}),l.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:576",className:"vg-button-primary",style:{backgroundColor:"#ef4444",display:"flex",alignItems:"center",gap:"6px"},onClick:async()=>{if(window.confirm(r.deleteConfirm))try{(await fetch(`${a}/api/annotations/${m._id}`,{method:"DELETE",headers:{"x-api-key":n}})).ok&&(P(),e(r.success,"success"))}catch{e(r.error,"error")}},children:["🗑️ ",r.close]})]})]},m._id))})]})})]})};function te(e,t,r){if(!t.endsWith(".tsx")&&!t.endsWith(".jsx")||t.includes("node_modules"))return e;const n=c=>c.replace(/\\/g,"/"),a=n(t).replace(n(r),"");return e.split(`
9
+ `).map((c,u)=>{const d=u+1;return c.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g,(p,g,w)=>p.includes("data-source-path")||w==="Fragment"||w==="React.Fragment"?p:`${g}<${w} data-source-path="${a}:${d}"`)}).join(`
10
+ `)}function At(){return{name:"vite-plugin-viewgate",enforce:"pre",transform(e,t){return{code:te(e,t,process.cwd()),map:null}}}}function Lt(e){const t=this.resourcePath;return t?(process.env.NODE_ENV,te(e,t,process.cwd())):e}R.ViewGate=Ie,R.ViewGateOverlay=Pe,R.transformSourcePaths=te,R.useViewGate=de,R.viewgateNextLoader=Lt,R.viewgatePlugin=At,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
@@ -22,7 +22,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
22
22
  tools: [
23
23
  {
24
24
  name: "get_annotations",
25
- description: "Get all UI annotations/feedback from the client",
25
+ description: "Retrieves all feedback annotations (comments). IMPORTANT: Use the 'reference' object (selector, outerHtml, source) to perform INSTANT EDITS in the code. If 'source' exists, go directly to that file/line. Avoid unnecessary browser validation for simple UI changes.",
26
26
  inputSchema: {
27
27
  type: "object",
28
28
  properties: {},
@@ -69,11 +69,17 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
69
69
  throw new Error(`Backend responded with ${response.status}`);
70
70
  }
71
71
  const annotations = await response.json();
72
+ const annotationsWithTips = annotations.map((ann) => ({
73
+ ...ann,
74
+ _ia_hint: ann.reference?.source && ann.reference.source !== 'unknown:0'
75
+ ? `ACTION: Go to ${ann.reference.source.split(':')[0]} around line ${ann.reference.source.split(':')[1]} to apply the fix.`
76
+ : `ACTION: Use selector "${ann.reference?.selector}" and check outerHtml to identify the element in the code.`
77
+ }));
72
78
  return {
73
79
  content: [
74
80
  {
75
81
  type: "text",
76
- text: JSON.stringify(annotations, null, 2),
82
+ text: JSON.stringify(annotationsWithTips, null, 2),
77
83
  },
78
84
  ],
79
85
  };
@@ -31,7 +31,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
31
31
  tools: [
32
32
  {
33
33
  name: "get_annotations",
34
- description: "Get all UI annotations/feedback from the client",
34
+ description: "Retrieves all feedback annotations (comments). IMPORTANT: Use the 'reference' object (selector, outerHtml, source) to perform INSTANT EDITS in the code. If 'source' exists, go directly to that file/line. Avoid unnecessary browser validation for simple UI changes.",
35
35
  inputSchema: {
36
36
  type: "object",
37
37
  properties: {},
@@ -79,12 +79,18 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
79
79
  throw new Error(`Backend responded with ${response.status}`);
80
80
  }
81
81
  const annotations = await response.json();
82
+ const annotationsWithTips = annotations.map((ann: any) => ({
83
+ ...ann,
84
+ _ia_hint: ann.reference?.source && ann.reference.source !== 'unknown:0'
85
+ ? `ACTION: Go to ${ann.reference.source.split(':')[0]} around line ${ann.reference.source.split(':')[1]} to apply the fix.`
86
+ : `ACTION: Use selector "${ann.reference?.selector}" and check outerHtml to identify the element in the code.`
87
+ }));
82
88
 
83
89
  return {
84
90
  content: [
85
91
  {
86
92
  type: "text",
87
- text: JSON.stringify(annotations, null, 2),
93
+ text: JSON.stringify(annotationsWithTips, null, 2),
88
94
  },
89
95
  ],
90
96
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewgate-wrapper",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "type": "module",
5
5
  "main": "./dist/viewgate-wrapper.umd.cjs",
6
6
  "module": "./dist/viewgate-wrapper.js",