viewgate-wrapper 1.4.1 → 1.5.1

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,EAod7B,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;AA4FhC,eAAO,MAAM,eAAe,EAAE,EA4e7B,CAAC"}
@@ -24,6 +24,8 @@ declare const translations: {
24
24
  readyForReview: string;
25
25
  noComments: string;
26
26
  deleteConfirm: string;
27
+ markReady: string;
28
+ reopen: string;
27
29
  };
28
30
  es: {
29
31
  enterMode: string;
@@ -47,6 +49,8 @@ declare const translations: {
47
49
  readyForReview: string;
48
50
  noComments: string;
49
51
  deleteConfirm: string;
52
+ markReady: string;
53
+ reopen: string;
50
54
  };
51
55
  };
52
56
  export interface SemanticReference {
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CjB,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;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,9 +1,9 @@
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 S, useContext as $e, useCallback as te, useEffect as ue } from "react";
3
- var Y = { exports: {} }, D = {};
2
+ import Ae, { createContext as Le, useState as C, useContext as $e, useCallback as te, useEffect as ue } from "react";
3
+ var Y = { exports: {} }, N = {};
4
4
  var de;
5
- function Fe() {
6
- if (de) return D;
5
+ function Ge() {
6
+ if (de) return N;
7
7
  de = 1;
8
8
  var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
9
9
  function r(n, a, s) {
@@ -21,11 +21,11 @@ function Fe() {
21
21
  props: s
22
22
  };
23
23
  }
24
- return D.Fragment = t, D.jsx = r, D.jsxs = r, D;
24
+ return N.Fragment = t, N.jsx = r, N.jsxs = r, N;
25
25
  }
26
- var N = {};
26
+ var D = {};
27
27
  var fe;
28
- function Ge() {
28
+ function Fe() {
29
29
  return fe || (fe = 1, process.env.NODE_ENV !== "production" && (function() {
30
30
  function e(o) {
31
31
  if (o == null) return null;
@@ -33,15 +33,15 @@ function Ge() {
33
33
  return o.$$typeof === z ? null : o.displayName || o.name || null;
34
34
  if (typeof o == "string") return o;
35
35
  switch (o) {
36
- case O:
36
+ case j:
37
37
  return "Fragment";
38
38
  case H:
39
39
  return "Profiler";
40
- case k:
40
+ case $:
41
41
  return "StrictMode";
42
42
  case W:
43
43
  return "Suspense";
44
- case T:
44
+ case R:
45
45
  return "SuspenseList";
46
46
  case K:
47
47
  return "Activity";
@@ -54,14 +54,14 @@ function Ge() {
54
54
  return "Portal";
55
55
  case X:
56
56
  return o.displayName || "Context";
57
- case F:
57
+ case G:
58
58
  return (o._context.displayName || "Context") + ".Consumer";
59
59
  case Z:
60
60
  var f = o.render;
61
61
  return o = o.displayName, o || (o = f.displayName || f.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
62
- case G:
62
+ case F:
63
63
  return f = o.displayName || null, f !== null ? f : e(o.type) || "Memo";
64
- case P:
64
+ case T:
65
65
  f = o._payload, o = o._init;
66
66
  try {
67
67
  return e(o(f));
@@ -82,17 +82,17 @@ function Ge() {
82
82
  }
83
83
  if (f) {
84
84
  f = console;
85
- var x = f.error, y = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
86
- return x.call(
85
+ var y = f.error, x = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
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
- y
89
+ x
90
90
  ), t(o);
91
91
  }
92
92
  }
93
93
  function n(o) {
94
- if (o === O) return "<>";
95
- if (typeof o == "object" && o !== null && o.$$typeof === P)
94
+ if (o === j) return "<>";
95
+ if (typeof o == "object" && o !== null && o.$$typeof === T)
96
96
  return "<...>";
97
97
  try {
98
98
  var f = e(o);
@@ -116,14 +116,14 @@ function Ge() {
116
116
  return o.key !== void 0;
117
117
  }
118
118
  function c(o, f) {
119
- function x() {
119
+ function y() {
120
120
  I || (I = !0, console.error(
121
121
  "%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)",
122
122
  f
123
123
  ));
124
124
  }
125
- x.isReactWarning = !0, Object.defineProperty(o, "key", {
126
- get: x,
125
+ y.isReactWarning = !0, Object.defineProperty(o, "key", {
126
+ get: y,
127
127
  configurable: !0
128
128
  });
129
129
  }
@@ -133,14 +133,14 @@ function Ge() {
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, x, y, U, Q) {
137
- var w = x.ref;
136
+ function d(o, f, y, x, U, Q) {
137
+ var w = y.ref;
138
138
  return o = {
139
- $$typeof: $,
139
+ $$typeof: L,
140
140
  type: o,
141
141
  key: f,
142
- props: x,
143
- _owner: y
142
+ props: y,
143
+ _owner: x
144
144
  }, (w !== void 0 ? w : null) !== null ? Object.defineProperty(o, "ref", {
145
145
  enumerable: !1,
146
146
  get: u
@@ -166,13 +166,13 @@ function Ge() {
166
166
  value: Q
167
167
  }), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
168
168
  }
169
- function p(o, f, x, y, U, Q) {
169
+ function p(o, f, y, x, U, Q) {
170
170
  var w = f.children;
171
171
  if (w !== void 0)
172
- if (y)
173
- if (_(w)) {
174
- for (y = 0; y < w.length; y++)
175
- g(w[y]);
172
+ if (x)
173
+ if (O(w)) {
174
+ for (x = 0; x < w.length; x++)
175
+ g(w[x]);
176
176
  Object.freeze && Object.freeze(w);
177
177
  } else
178
178
  console.error(
@@ -181,86 +181,86 @@ function Ge() {
181
181
  else g(w);
182
182
  if (h.call(f, "key")) {
183
183
  w = e(o);
184
- var V = Object.keys(f).filter(function(Ve) {
184
+ var _ = Object.keys(f).filter(function(Ve) {
185
185
  return Ve !== "key";
186
186
  });
187
- y = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", le[w + y] || (V = 0 < V.length ? "{" + V.join(": ..., ") + ": ...}" : "{}", console.error(
187
+ x = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", le[w + x] || (_ = 0 < _.length ? "{" + _.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
- y,
194
+ x,
195
195
  w,
196
- V,
196
+ _,
197
197
  w
198
- ), le[w + y] = !0);
198
+ ), le[w + x] = !0);
199
199
  }
200
- if (w = null, x !== void 0 && (r(x), w = "" + x), i(f) && (r(f.key), w = "" + f.key), "key" in f) {
201
- x = {};
200
+ if (w = null, y !== void 0 && (r(y), w = "" + y), i(f) && (r(f.key), w = "" + f.key), "key" in f) {
201
+ y = {};
202
202
  for (var ee in f)
203
- ee !== "key" && (x[ee] = f[ee]);
204
- } else x = f;
203
+ ee !== "key" && (y[ee] = f[ee]);
204
+ } else y = f;
205
205
  return w && c(
206
- x,
206
+ y,
207
207
  typeof o == "function" ? o.displayName || o.name || "Unknown" : o
208
208
  ), d(
209
209
  o,
210
210
  w,
211
- x,
211
+ y,
212
212
  a(),
213
213
  U,
214
214
  Q
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
+ v(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === T && (o._payload.status === "fulfilled" ? v(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
219
219
  }
220
220
  function v(o) {
221
- return typeof o == "object" && o !== null && o.$$typeof === $;
221
+ return typeof o == "object" && o !== null && o.$$typeof === L;
222
222
  }
223
- var C = Ae, $ = /* @__PURE__ */ Symbol.for("react.transitional.element"), M = /* @__PURE__ */ Symbol.for("react.portal"), O = /* @__PURE__ */ Symbol.for("react.fragment"), k = /* @__PURE__ */ Symbol.for("react.strict_mode"), H = /* @__PURE__ */ Symbol.for("react.profiler"), F = /* @__PURE__ */ Symbol.for("react.consumer"), X = /* @__PURE__ */ Symbol.for("react.context"), Z = /* @__PURE__ */ Symbol.for("react.forward_ref"), W = /* @__PURE__ */ Symbol.for("react.suspense"), T = /* @__PURE__ */ Symbol.for("react.suspense_list"), G = /* @__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 = C.__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 S = Ae, L = /* @__PURE__ */ Symbol.for("react.transitional.element"), M = /* @__PURE__ */ Symbol.for("react.portal"), j = /* @__PURE__ */ Symbol.for("react.fragment"), $ = /* @__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"), T = /* @__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, O = Array.isArray, P = console.createTask ? console.createTask : function() {
224
224
  return null;
225
225
  };
226
- C = {
226
+ S = {
227
227
  react_stack_bottom_frame: function(o) {
228
228
  return o();
229
229
  }
230
230
  };
231
- var I, oe = {}, ie = C.react_stack_bottom_frame.bind(
232
- C,
231
+ var I, oe = {}, ie = S.react_stack_bottom_frame.bind(
232
+ S,
233
233
  s
234
- )(), ce = j(n(s)), le = {};
235
- N.Fragment = O, N.jsx = function(o, f, x) {
236
- var y = 1e4 > m.recentlyCreatedOwnerStacks++;
234
+ )(), ce = P(n(s)), le = {};
235
+ D.Fragment = j, D.jsx = function(o, f, y) {
236
+ var x = 1e4 > m.recentlyCreatedOwnerStacks++;
237
237
  return p(
238
238
  o,
239
239
  f,
240
- x,
240
+ y,
241
241
  !1,
242
- y ? Error("react-stack-top-frame") : ie,
243
- y ? j(n(o)) : ce
242
+ x ? Error("react-stack-top-frame") : ie,
243
+ x ? P(n(o)) : ce
244
244
  );
245
- }, N.jsxs = function(o, f, x) {
246
- var y = 1e4 > m.recentlyCreatedOwnerStacks++;
245
+ }, D.jsxs = function(o, f, y) {
246
+ var x = 1e4 > m.recentlyCreatedOwnerStacks++;
247
247
  return p(
248
248
  o,
249
249
  f,
250
- x,
250
+ y,
251
251
  !0,
252
- y ? Error("react-stack-top-frame") : ie,
253
- y ? j(n(o)) : ce
252
+ x ? Error("react-stack-top-frame") : ie,
253
+ x ? P(n(o)) : ce
254
254
  );
255
255
  };
256
- })()), N;
256
+ })()), D;
257
257
  }
258
258
  var me;
259
259
  function Ie() {
260
- return me || (me = 1, process.env.NODE_ENV === "production" ? Y.exports = Fe() : Y.exports = Ge()), Y.exports;
260
+ return me || (me = 1, process.env.NODE_ENV === "production" ? Y.exports = Ge() : Y.exports = Fe()), Y.exports;
261
261
  }
262
262
  var l = Ie();
263
- const De = {
263
+ const Ne = {
264
264
  en: {
265
265
  enterMode: "🚀 Enter Feedback Mode",
266
266
  exitMode: "✨ Exit Mode",
@@ -282,7 +282,9 @@ const De = {
282
282
  pending: "Pending",
283
283
  readyForReview: "Ready for Review",
284
284
  noComments: "No comments found.",
285
- deleteConfirm: "Are you sure you want to close/delete this comment?"
285
+ deleteConfirm: "Are you sure you want to close/delete this comment?",
286
+ markReady: "Mark as Ready",
287
+ reopen: "Reopen"
286
288
  },
287
289
  es: {
288
290
  enterMode: "🚀 Activar Modo Comentarios",
@@ -305,27 +307,29 @@ const De = {
305
307
  pending: "Pendiente",
306
308
  readyForReview: "Lista para revisión",
307
309
  noComments: "No hay comentarios.",
308
- deleteConfirm: "¿Estás seguro de que deseas cerrar y eliminar este comentario?"
310
+ deleteConfirm: "¿Estás seguro de que deseas cerrar y eliminar este comentario?",
311
+ markReady: "Marcar como Listo",
312
+ reopen: "Reabrir"
309
313
  }
310
- }, be = Le(void 0), Ne = () => {
314
+ }, be = Le(void 0), De = () => {
311
315
  const e = $e(be);
312
316
  if (!e) throw new Error("useViewGate must be used within a ViewGateProvider");
313
317
  return e;
314
318
  }, It = ({ children: e, language: t = "es", apiKey: r, baseUrl: n = "https://view-gate.vercel.app" }) => {
315
- const [a, s] = S([]), i = (u, d) => {
319
+ const [a, s] = C([]), i = (u, d) => {
316
320
  const p = Date.now();
317
321
  s((g) => [...g, { id: p, message: u, type: d }]), setTimeout(() => {
318
322
  s((g) => g.filter((v) => v.id !== p));
319
323
  }, 4e3);
320
- }, c = De[t];
321
- return /* @__PURE__ */ l.jsxs(be.Provider, { "data-source-path": "/src/components/ViewGateProvider.tsx:113", value: { addToast: i, language: t, t: c, apiKey: r, baseUrl: n }, children: [
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: [
322
326
  e,
323
- /* @__PURE__ */ l.jsx(Ft, { "data-source-path": "/src/components/ViewGateProvider.tsx:115" }),
324
- /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:116", className: "vg-toasts", children: a.map((u) => /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:118", className: `vg-toast vg-glassmorphism vg-animate-slide ${u.type}`, children: [
325
- /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateProvider.tsx:119", style: { fontSize: "20px" }, children: u.type === "success" ? "✅" : "❌" }),
326
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:120", children: [
327
- /* @__PURE__ */ l.jsx("strong", { "data-source-path": "/src/components/ViewGateProvider.tsx:121", style: { display: "block" }, children: u.type === "success" ? c.successHeader : c.errorHeader }),
328
- /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateProvider.tsx:122", style: { fontSize: "14px" }, children: u.message })
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 })
329
333
  ] })
330
334
  ] }, u.id)) })
331
335
  ] });
@@ -348,15 +352,15 @@ const He = /* @__PURE__ */ (() => {
348
352
  );
349
353
  return () => (e += 1, `u${t()}${e}`);
350
354
  })();
351
- function R(e) {
355
+ function k(e) {
352
356
  const t = [];
353
357
  for (let r = 0, n = e.length; r < n; r++)
354
358
  t.push(e[r]);
355
359
  return t;
356
360
  }
357
- let A = null;
361
+ let V = null;
358
362
  function Ee(e = {}) {
359
- return A || (e.includeStyleProperties ? (A = e.includeStyleProperties, A) : (A = R(window.getComputedStyle(document.documentElement)), A));
363
+ return V || (e.includeStyleProperties ? (V = e.includeStyleProperties, V) : (V = k(window.getComputedStyle(document.documentElement)), V));
360
364
  }
361
365
  function q(e, t) {
362
366
  const n = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
@@ -370,7 +374,7 @@ function ze(e) {
370
374
  const t = q(e, "border-top-width"), r = q(e, "border-bottom-width");
371
375
  return e.clientHeight + t + r;
372
376
  }
373
- function Se(e, t = {}) {
377
+ function Ce(e, t = {}) {
374
378
  const r = t.width || We(e), n = t.height || ze(e);
375
379
  return { width: r, height: n };
376
380
  }
@@ -470,7 +474,7 @@ function ne(e) {
470
474
  function rt(e, t) {
471
475
  return `data:${t};base64,${e}`;
472
476
  }
473
- async function Ce(e, t, r) {
477
+ async function Se(e, t, r) {
474
478
  const n = await fetch(e, t);
475
479
  if (n.status === 404)
476
480
  throw new Error(`Resource "${n.url}" not found`);
@@ -498,7 +502,7 @@ async function ae(e, t, r) {
498
502
  r.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
499
503
  let a;
500
504
  try {
501
- const s = await Ce(e, r.fetchRequestInit, ({ res: i, result: c }) => (t || (t = i.headers.get("Content-Type") || ""), tt(c)));
505
+ const s = await Se(e, r.fetchRequestInit, ({ res: i, result: c }) => (t || (t = i.headers.get("Content-Type") || ""), tt(c)));
502
506
  a = rt(s, t);
503
507
  } catch (s) {
504
508
  a = r.imagePlaceholder || "";
@@ -539,7 +543,7 @@ async function lt(e, t, r) {
539
543
  if (Re(t))
540
544
  return t;
541
545
  let s = [];
542
- return ct(e) && e.assignedNodes ? s = R(e.assignedNodes()) : b(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 || b(e, HTMLVideoElement) || await s.reduce((i, c) => i.then(() => J(c, r)).then((u) => {
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) => {
543
547
  u && t.appendChild(u);
544
548
  }), Promise.resolve()), t;
545
549
  }
@@ -593,11 +597,11 @@ async function J(e, t, r) {
593
597
  return !r && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((n) => it(n, t)).then((n) => lt(e, n, t)).then((n) => mt(e, n, t)).then((n) => pt(n, t));
594
598
  }
595
599
  const ke = /url\((['"]?)([^'"]+?)\1\)/g, ht = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, gt = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
596
- function xt(e) {
600
+ function yt(e) {
597
601
  const t = e.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
598
602
  return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
599
603
  }
600
- function yt(e) {
604
+ function xt(e) {
601
605
  const t = [];
602
606
  return e.replace(ke, (r, n, a) => (t.push(a), r)), t.filter((r) => !ne(r));
603
607
  }
@@ -605,7 +609,7 @@ async function wt(e, t, r, n, a) {
605
609
  try {
606
610
  const s = r ? Me(t, r) : t, i = se(t);
607
611
  let c;
608
- return a || (c = await ae(s, i, n)), e.replace(xt(t), `$1${c}$3`);
612
+ return a || (c = await ae(s, i, n)), e.replace(yt(t), `$1${c}$3`);
609
613
  } catch {
610
614
  }
611
615
  return e;
@@ -628,9 +632,9 @@ async function Pe(e, t, r) {
628
632
  if (!Te(e))
629
633
  return e;
630
634
  const n = vt(e, r);
631
- return yt(n).reduce((s, i) => s.then((c) => wt(c, i, t, r)), Promise.resolve(n));
635
+ return xt(n).reduce((s, i) => s.then((c) => wt(c, i, t, r)), Promise.resolve(n));
632
636
  }
633
- async function L(e, t, r) {
637
+ async function A(e, t, r) {
634
638
  var n;
635
639
  const a = (n = t.style) === null || n === void 0 ? void 0 : n.getPropertyValue(e);
636
640
  if (a) {
@@ -640,7 +644,7 @@ async function L(e, t, r) {
640
644
  return !1;
641
645
  }
642
646
  async function bt(e, t) {
643
- 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);
647
+ await A("background", e, t) || await A("background-image", e, t), await A("mask", e, t) || await A("-webkit-mask", e, t) || await A("mask-image", e, t) || await A("-webkit-mask-image", e, t);
644
648
  }
645
649
  async function Et(e, t) {
646
650
  const r = b(e, HTMLImageElement);
@@ -659,14 +663,14 @@ async function Et(e, t) {
659
663
  c.decode && (c.decode = s), c.loading === "lazy" && (c.loading = "eager"), r ? (e.srcset = "", e.src = a) : e.href.baseVal = a;
660
664
  });
661
665
  }
662
- async function St(e, t) {
663
- const n = R(e.childNodes).map((a) => je(a, t));
666
+ async function Ct(e, t) {
667
+ const n = k(e.childNodes).map((a) => je(a, t));
664
668
  await Promise.all(n).then(() => e);
665
669
  }
666
670
  async function je(e, t) {
667
- b(e, Element) && (await bt(e, t), await Et(e, t), await St(e, t));
671
+ b(e, Element) && (await bt(e, t), await Et(e, t), await Ct(e, t));
668
672
  }
669
- function Ct(e, t) {
673
+ function St(e, t) {
670
674
  const { style: r } = e;
671
675
  t.backgroundColor && (r.backgroundColor = t.backgroundColor), t.width && (r.width = `${t.width}px`), t.height && (r.height = `${t.height}px`);
672
676
  const n = t.style;
@@ -674,19 +678,19 @@ function Ct(e, t) {
674
678
  r[a] = n[a];
675
679
  }), e;
676
680
  }
677
- const xe = {};
678
- async function ye(e) {
679
- let t = xe[e];
681
+ const ye = {};
682
+ async function xe(e) {
683
+ let t = ye[e];
680
684
  if (t != null)
681
685
  return t;
682
686
  const n = await (await fetch(e)).text();
683
- return t = { url: e, cssText: n }, xe[e] = t, t;
687
+ return t = { url: e, cssText: n }, ye[e] = t, t;
684
688
  }
685
689
  async function we(e, t) {
686
690
  let r = e.cssText;
687
691
  const n = /url\(["']?([^"')]+)["']?\)/g, s = (r.match(/url\([^)]+\)/g) || []).map(async (i) => {
688
692
  let c = i.replace(n, "$1");
689
- 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]));
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]));
690
694
  });
691
695
  return Promise.all(s).then(() => r);
692
696
  }
@@ -721,10 +725,10 @@ async function Rt(e, t) {
721
725
  return e.forEach((a) => {
722
726
  if ("cssRules" in a)
723
727
  try {
724
- R(a.cssRules || []).forEach((s, i) => {
728
+ k(a.cssRules || []).forEach((s, i) => {
725
729
  if (s.type === CSSRule.IMPORT_RULE) {
726
730
  let c = i + 1;
727
- const u = s.href, d = ye(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) => ve(p).forEach((g) => {
728
732
  try {
729
733
  a.insertRule(g, g.startsWith("@import") ? c += 1 : a.cssRules.length);
730
734
  } catch (v) {
@@ -741,7 +745,7 @@ async function Rt(e, t) {
741
745
  });
742
746
  } catch (s) {
743
747
  const i = e.find((c) => c.href == null) || document.styleSheets[0];
744
- a.href != null && n.push(ye(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) => ve(c).forEach((u) => {
745
749
  i.insertRule(u, i.cssRules.length);
746
750
  })).catch((c) => {
747
751
  console.error("Error loading remote stylesheet", c);
@@ -750,7 +754,7 @@ async function Rt(e, t) {
750
754
  }), Promise.all(n).then(() => (e.forEach((a) => {
751
755
  if ("cssRules" in a)
752
756
  try {
753
- R(a.cssRules || []).forEach((s) => {
757
+ k(a.cssRules || []).forEach((s) => {
754
758
  r.push(s);
755
759
  });
756
760
  } catch (s) {
@@ -764,7 +768,7 @@ function kt(e) {
764
768
  async function Tt(e, t) {
765
769
  if (e.ownerDocument == null)
766
770
  throw new Error("Provided element is not within a Document");
767
- const r = R(e.ownerDocument.styleSheets), n = await Rt(r, t);
771
+ const r = k(e.ownerDocument.styleSheets), n = await Rt(r, t);
768
772
  return kt(n);
769
773
  }
770
774
  function Oe(e) {
@@ -797,11 +801,11 @@ async function Ot(e, t) {
797
801
  }
798
802
  }
799
803
  async function _t(e, t = {}) {
800
- const { width: r, height: n } = Se(e, t), a = await J(e, t, !0);
801
- return await Ot(a, t), await je(a, t), Ct(a, t), await Be(a, r, n);
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);
802
806
  }
803
807
  async function Vt(e, t = {}) {
804
- 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;
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;
805
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;
806
810
  }
807
811
  async function At(e, t = {}) {
@@ -852,8 +856,8 @@ const Lt = (e) => {
852
856
  signature: i,
853
857
  source: t
854
858
  };
855
- }, Ft = () => {
856
- const { addToast: e, language: t, t: r, apiKey: n, baseUrl: a } = Ne(), [s, i] = S(!1), [c, u] = S(null), [d, p] = S(null), [g, v] = S(""), [C, $] = S(!1), [M, O] = S(!1), [k, H] = S(!1), [F, X] = S([]), [Z, W] = S(!1), T = te(async () => {
859
+ }, 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, L] = C(!1), [M, j] = C(!1), [$, H] = C(!1), [G, X] = C([]), [Z, W] = C(!1), R = te(async () => {
857
861
  if (n) {
858
862
  W(!0);
859
863
  try {
@@ -872,9 +876,9 @@ const Lt = (e) => {
872
876
  }
873
877
  }, [n, a]);
874
878
  ue(() => {
875
- (s || k) && T();
876
- }, [s, k, T]);
877
- const G = te((m) => {
879
+ R();
880
+ }, [R]);
881
+ const F = te((m) => {
878
882
  if (!s || d) return;
879
883
  const h = document.elementFromPoint(m.clientX, m.clientY);
880
884
  if (!h || h.id === "viewgate-overlay" || h.closest("#viewgate-ui")) {
@@ -889,13 +893,13 @@ const Lt = (e) => {
889
893
  previewText: (h.innerText || "").slice(0, 100) || (h.getAttribute("placeholder") || "").slice(0, 100) || h.tagName.toLowerCase(),
890
894
  semanticReference: $t(h)
891
895
  });
892
- }, [s, d]), P = te(async (m) => {
896
+ }, [s, d]), T = te(async (m) => {
893
897
  if (!(!s || d) && c) {
894
- m.preventDefault(), m.stopPropagation(), O(!0);
898
+ m.preventDefault(), m.stopPropagation(), j(!0);
895
899
  try {
896
- const h = c.element.style.display, _ = window.getComputedStyle(c.element).display === "inline";
897
- _ && (c.element.style.display = "inline-block");
898
- const j = await At(c.element, {
900
+ const h = c.element.style.display, O = window.getComputedStyle(c.element).display === "inline";
901
+ O && (c.element.style.display = "inline-block");
902
+ const P = await At(c.element, {
899
903
  backgroundColor: "#ffffff",
900
904
  pixelRatio: 2,
901
905
  skipFonts: !0,
@@ -905,21 +909,21 @@ const Lt = (e) => {
905
909
  // Extra padding for better look
906
910
  }
907
911
  });
908
- _ && (c.element.style.display = h), p({ ...c, visualPreview: j });
912
+ O && (c.element.style.display = h), p({ ...c, visualPreview: P });
909
913
  } catch (h) {
910
914
  console.error("Failed to capture preview:", h), p(c);
911
915
  } finally {
912
- O(!1), u(null);
916
+ j(!1), u(null);
913
917
  }
914
918
  }
915
- }, [s, c, d, k]);
916
- ue(() => (s && !d ? document.body.classList.add("vg-cursor-pointer") : document.body.classList.remove("vg-cursor-pointer"), window.addEventListener("mousemove", G), window.addEventListener("click", P, !0), () => {
917
- document.body.classList.remove("vg-cursor-pointer"), window.removeEventListener("mousemove", G), window.removeEventListener("click", P, !0);
918
- }), [s, d, G, P]);
919
+ }, [s, c, d, $]);
920
+ ue(() => (s && !d ? document.body.classList.add("vg-cursor-pointer") : document.body.classList.remove("vg-cursor-pointer"), window.addEventListener("mousemove", F), window.addEventListener("click", T, !0), () => {
921
+ document.body.classList.remove("vg-cursor-pointer"), window.removeEventListener("mousemove", F), window.removeEventListener("click", T, !0);
922
+ }), [s, d, F, T]);
919
923
  const K = async () => {
920
924
  if (!d || !g.trim()) return;
921
- $(!0);
922
- const { semanticReference: m } = d, [h, _] = m.source.split(":"), j = _ || "0";
925
+ L(!0);
926
+ const { semanticReference: m } = d, [h, O] = m.source.split(":"), P = O || "0";
923
927
  try {
924
928
  if (!(await fetch(`${a}/api/annotations`, {
925
929
  method: "POST",
@@ -929,22 +933,22 @@ const Lt = (e) => {
929
933
  },
930
934
  body: JSON.stringify({
931
935
  filePath: h,
932
- line: parseInt(j),
936
+ line: parseInt(P),
933
937
  url: window.location.href,
934
938
  message: g,
935
939
  componentName: m.componentPath || d.tag,
936
940
  reference: m
937
941
  })
938
942
  })).ok) throw new Error("Backend failed");
939
- e(r.success, "success"), p(null), v(""), i(!1), T();
943
+ e(r.success, "success"), p(null), v(""), i(!1), R();
940
944
  } catch (I) {
941
945
  console.error(I), e(r.error, "error");
942
946
  } finally {
943
- $(!1);
947
+ L(!1);
944
948
  }
945
949
  }, z = (m) => m.split("/").pop()?.split("\\").pop() || "unknown";
946
950
  return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
947
- /* @__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: [
951
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:257", style: { position: "fixed", bottom: "30px", right: "30px", zIndex: 99999 }, id: "viewgate-ui", children: [
948
952
  /* @__PURE__ */ l.jsx(
949
953
  "button",
950
954
  {
@@ -954,11 +958,11 @@ const Lt = (e) => {
954
958
  children: s ? r.exitMode : r.enterMode
955
959
  }
956
960
  ),
957
- F.length > 0 && /* @__PURE__ */ l.jsx(
961
+ G.length > 0 && /* @__PURE__ */ l.jsx(
958
962
  "button",
959
963
  {
960
964
  onClick: () => {
961
- H(!k), i(!1), p(null);
965
+ H(!$), i(!1), p(null);
962
966
  },
963
967
  className: "vg-button-ghost",
964
968
  style: { padding: "12px 24px", fontSize: "15px", marginLeft: "12px", background: "white" },
@@ -966,7 +970,7 @@ const Lt = (e) => {
966
970
  }
967
971
  )
968
972
  ] }),
969
- M && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:284", style: {
973
+ M && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:282", style: {
970
974
  position: "fixed",
971
975
  top: 0,
972
976
  left: 0,
@@ -978,11 +982,11 @@ const Lt = (e) => {
978
982
  justifyContent: "center",
979
983
  zIndex: 1e5,
980
984
  cursor: "wait"
981
- }, 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: [
982
- /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:298", className: "vg-spinner" }),
985
+ }, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:295", 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:296", className: "vg-spinner" }),
983
987
  "Capturing..."
984
988
  ] }) }),
985
- s && c && !d && !M && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:306", style: {
989
+ s && c && !d && !M && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:304", style: {
986
990
  position: "fixed",
987
991
  top: c.rect.top,
988
992
  left: c.rect.left,
@@ -996,7 +1000,7 @@ const Lt = (e) => {
996
1000
  boxShadow: "0 0 15px rgba(37, 19, 236, 0.2)",
997
1001
  transition: "all 0.1s ease-out"
998
1002
  } }),
999
- d && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:324", className: "vg-animate-fade", style: {
1003
+ d && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:322", className: "vg-animate-fade", style: {
1000
1004
  position: "fixed",
1001
1005
  top: 0,
1002
1006
  left: 0,
@@ -1008,33 +1012,33 @@ const Lt = (e) => {
1008
1012
  alignItems: "center",
1009
1013
  justifyContent: "center",
1010
1014
  zIndex: 99999
1011
- }, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:337", className: "vg-glassmorphism vg-animate-slide", style: {
1015
+ }, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:335", className: "vg-glassmorphism vg-animate-slide", style: {
1012
1016
  padding: "32px",
1013
1017
  width: "460px",
1014
1018
  background: "white",
1015
1019
  color: "#0f172a"
1016
1020
  }, children: [
1017
- /* @__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 }),
1018
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:345", style: { marginBottom: "20px" }, children: [
1019
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:346", style: { display: "flex", flexWrap: "wrap", gap: "8px", alignItems: "center" }, children: [
1020
- 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: [
1021
+ /* @__PURE__ */ l.jsx("h2", { "data-source-path": "/src/components/ViewGateOverlay.tsx:341", 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:343", style: { marginBottom: "20px" }, children: [
1023
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:344", 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:346", className: "vg-badge", style: { backgroundColor: "#f5f3ff", color: "#7c3aed", borderColor: "#ddd6fe" }, children: [
1021
1025
  "📦 ",
1022
1026
  d.semanticReference.componentPath
1023
- ] }) : /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:352", className: "vg-badge", children: d.tag }),
1024
- 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: [
1027
+ ] }) : /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:350", 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:355", className: "vg-badge", style: { backgroundColor: "#fdf2f8", color: "#db2777", borderColor: "#fbcfe8" }, children: [
1025
1029
  "📄 ",
1026
1030
  z(d.semanticReference.source.split(":")[0] || "unknown")
1027
- ] }) }) : /* @__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: [
1031
+ ] }) }) : /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:360", className: "vg-badge", style: { backgroundColor: "#f0f9ff", color: "#0369a1", borderColor: "#bae6fd", maxWidth: "300px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
1028
1032
  "🆔 ",
1029
1033
  d.semanticReference.signature
1030
1034
  ] })
1031
1035
  ] }),
1032
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:367", style: { marginTop: "8px", fontSize: "11px", color: "#94a3b8" }, children: [
1036
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:365", style: { marginTop: "8px", fontSize: "11px", color: "#94a3b8" }, children: [
1033
1037
  "🎯 ",
1034
1038
  d.semanticReference.selector
1035
1039
  ] })
1036
1040
  ] }),
1037
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:373", style: {
1041
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:371", style: {
1038
1042
  backgroundColor: "#f8fafc",
1039
1043
  borderRadius: "8px",
1040
1044
  border: "1px solid #e2e8f0",
@@ -1043,8 +1047,8 @@ const Lt = (e) => {
1043
1047
  display: "flex",
1044
1048
  flexDirection: "column"
1045
1049
  }, children: [
1046
- /* @__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 }),
1047
- /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:385", style: {
1050
+ /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:380", 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:383", style: {
1048
1052
  padding: "12px",
1049
1053
  display: "flex",
1050
1054
  justifyContent: "center",
@@ -1066,7 +1070,7 @@ const Lt = (e) => {
1066
1070
  borderRadius: "4px"
1067
1071
  }
1068
1072
  }
1069
- ) : /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:408", style: { fontSize: "13px", color: "#64748b", fontStyle: "italic" }, children: [
1073
+ ) : /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:406", style: { fontSize: "13px", color: "#64748b", fontStyle: "italic" }, children: [
1070
1074
  '"',
1071
1075
  d.previewText,
1072
1076
  '"'
@@ -1083,7 +1087,7 @@ const Lt = (e) => {
1083
1087
  autoFocus: !0
1084
1088
  }
1085
1089
  ),
1086
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:424", style: { display: "flex", justifyContent: "flex-end", gap: "12px", marginTop: "24px" }, children: [
1090
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:422", style: { display: "flex", justifyContent: "flex-end", gap: "12px", marginTop: "24px" }, children: [
1087
1091
  /* @__PURE__ */ l.jsx(
1088
1092
  "button",
1089
1093
  {
@@ -1097,14 +1101,14 @@ const Lt = (e) => {
1097
1101
  {
1098
1102
  onClick: K,
1099
1103
  className: "vg-button-primary",
1100
- disabled: C || !g.trim(),
1101
- style: { opacity: C || !g.trim() ? 0.6 : 1 },
1102
- children: C ? r.submitting : r.send
1104
+ disabled: S || !g.trim(),
1105
+ style: { opacity: S || !g.trim() ? 0.6 : 1 },
1106
+ children: S ? r.submitting : r.send
1103
1107
  }
1104
1108
  )
1105
1109
  ] })
1106
1110
  ] }) }),
1107
- k && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:446", className: "vg-animate-fade", style: {
1111
+ $ && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:444", className: "vg-animate-fade", style: {
1108
1112
  position: "fixed",
1109
1113
  top: 0,
1110
1114
  left: 0,
@@ -1116,7 +1120,7 @@ const Lt = (e) => {
1116
1120
  alignItems: "center",
1117
1121
  justifyContent: "center",
1118
1122
  zIndex: 99999
1119
- }, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:459", className: "vg-glassmorphism vg-animate-slide", style: {
1123
+ }, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:457", className: "vg-glassmorphism vg-animate-slide", style: {
1120
1124
  padding: "32px",
1121
1125
  width: "600px",
1122
1126
  maxHeight: "80vh",
@@ -1125,40 +1129,62 @@ const Lt = (e) => {
1125
1129
  display: "flex",
1126
1130
  flexDirection: "column"
1127
1131
  }, children: [
1128
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:468", style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "20px" }, children: [
1129
- /* @__PURE__ */ l.jsx("h2", { "data-source-path": "/src/components/ViewGateOverlay.tsx:469", style: { margin: 0, fontSize: "24px", fontWeight: 800 }, children: r.feedbackHeader }),
1130
- /* @__PURE__ */ l.jsx("button", { "data-source-path": "/src/components/ViewGateOverlay.tsx:470", onClick: () => H(!1), className: "vg-button-ghost", style: { padding: "6px 12px" }, children: "✕" })
1132
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:466", style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "20px" }, children: [
1133
+ /* @__PURE__ */ l.jsx("h2", { "data-source-path": "/src/components/ViewGateOverlay.tsx:467", style: { margin: 0, fontSize: "24px", fontWeight: 800 }, children: r.feedbackHeader }),
1134
+ /* @__PURE__ */ l.jsx("button", { "data-source-path": "/src/components/ViewGateOverlay.tsx:468", onClick: () => H(!1), className: "vg-button-ghost", style: { padding: "6px 12px" }, children: "✕" })
1131
1135
  ] }),
1132
- /* @__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..." }) : F.length === 0 ? /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:477", style: { textAlign: "center", padding: "40px", color: "#64748b" }, children: r.noComments }) : F.map((m) => /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:480", style: {
1136
+ /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:471", 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:473", style: { textAlign: "center", padding: "40px", color: "#64748b" }, children: "Cargando..." }) : G.length === 0 ? /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:475", style: { textAlign: "center", padding: "40px", color: "#64748b" }, children: r.noComments }) : G.map((m) => /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:478", style: {
1133
1137
  border: "1px solid #e2e8f0",
1134
1138
  borderRadius: "12px",
1135
1139
  padding: "16px",
1136
1140
  backgroundColor: m.status === "ready_for_review" ? "#f0fdf4" : "#fff"
1137
1141
  }, children: [
1138
- /* @__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: [
1139
- 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: [
1142
+ /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:484", style: { display: "flex", justifyContent: "space-between", marginBottom: "12px" }, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:485", 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:487", className: "vg-badge", style: { backgroundColor: "#dcfce7", color: "#166534", borderColor: "#bbf7d0" }, children: [
1140
1144
  "✓ ",
1141
1145
  r.readyForReview
1142
- ] }) : /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:491", className: "vg-badge", style: { backgroundColor: "#fef3c7", color: "#92400e", borderColor: "#fde68a" }, children: [
1146
+ ] }) : /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:489", className: "vg-badge", style: { backgroundColor: "#fef3c7", color: "#92400e", borderColor: "#fde68a" }, children: [
1143
1147
  "⏳ ",
1144
1148
  r.pending
1145
1149
  ] }),
1146
- /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:493", style: { fontSize: "12px", color: "#64748b" }, children: new Date(m.timestamp).toLocaleString() })
1150
+ /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:491", style: { fontSize: "12px", color: "#64748b" }, children: new Date(m.timestamp).toLocaleString() })
1147
1151
  ] }) }),
1148
- /* @__PURE__ */ l.jsxs("p", { "data-source-path": "/src/components/ViewGateOverlay.tsx:499", style: { margin: "0 0 12px 0", fontSize: "15px", fontWeight: 600 }, children: [
1152
+ /* @__PURE__ */ l.jsxs("p", { "data-source-path": "/src/components/ViewGateOverlay.tsx:497", style: { margin: "0 0 12px 0", fontSize: "15px", fontWeight: 600 }, children: [
1149
1153
  '"',
1150
1154
  m.message,
1151
1155
  '"'
1152
1156
  ] }),
1153
- /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:501", style: { display: "flex", gap: "6px", flexWrap: "wrap", marginBottom: "16px" }, children: [
1154
- /* @__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" }),
1155
- 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) })
1157
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:499", style: { display: "flex", gap: "6px", flexWrap: "wrap", marginBottom: "16px" }, children: [
1158
+ /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:500", 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:504", className: "vg-badge", style: { backgroundColor: "#f1f5f9", color: "#475569", border: "none" }, children: z(m.filePath) })
1156
1160
  ] }),
1157
- m.status === "ready_for_review" && /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:513", style: { display: "flex", gap: "8px", justifyContent: "flex-end", borderTop: "1px solid #e2e8f0", paddingTop: "16px", marginTop: "8px" }, children: [
1158
- /* @__PURE__ */ l.jsxs(
1161
+ /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:510", style: { display: "flex", gap: "8px", justifyContent: "flex-end", borderTop: "1px solid #e2e8f0", paddingTop: "16px", marginTop: "8px" }, children: [
1162
+ m.status === "pending" ? /* @__PURE__ */ l.jsxs(
1163
+ "button",
1164
+ {
1165
+ "data-source-path": "/src/components/ViewGateOverlay.tsx:512",
1166
+ className: "vg-button-primary",
1167
+ style: { display: "flex", alignItems: "center", gap: "6px" },
1168
+ onClick: async () => {
1169
+ try {
1170
+ (await fetch(`${a}/api/annotations/${m._id}`, {
1171
+ method: "PATCH",
1172
+ headers: { "Content-Type": "application/json", "x-api-key": n },
1173
+ body: JSON.stringify({ status: "ready_for_review" })
1174
+ })).ok && (R(), e(r.success, "success"));
1175
+ } catch {
1176
+ e(r.error, "error");
1177
+ }
1178
+ },
1179
+ children: [
1180
+ "✅ ",
1181
+ r.markReady
1182
+ ]
1183
+ }
1184
+ ) : /* @__PURE__ */ l.jsxs(
1159
1185
  "button",
1160
1186
  {
1161
- "data-source-path": "/src/components/ViewGateOverlay.tsx:514",
1187
+ "data-source-path": "/src/components/ViewGateOverlay.tsx:534",
1162
1188
  className: "vg-button-ghost",
1163
1189
  style: { display: "flex", alignItems: "center", gap: "6px" },
1164
1190
  onClick: async () => {
@@ -1167,20 +1193,21 @@ const Lt = (e) => {
1167
1193
  method: "PATCH",
1168
1194
  headers: { "Content-Type": "application/json", "x-api-key": n },
1169
1195
  body: JSON.stringify({ status: "pending" })
1170
- })).ok && (T(), e(r.success, "success"));
1196
+ })).ok && (R(), e(r.success, "success"));
1171
1197
  } catch {
1198
+ e(r.error, "error");
1172
1199
  }
1173
1200
  },
1174
1201
  children: [
1175
- "✍️ ",
1176
- r.observe
1202
+ "🔄 ",
1203
+ r.reopen
1177
1204
  ]
1178
1205
  }
1179
1206
  ),
1180
1207
  /* @__PURE__ */ l.jsxs(
1181
1208
  "button",
1182
1209
  {
1183
- "data-source-path": "/src/components/ViewGateOverlay.tsx:534",
1210
+ "data-source-path": "/src/components/ViewGateOverlay.tsx:557",
1184
1211
  className: "vg-button-primary",
1185
1212
  style: { backgroundColor: "#ef4444", display: "flex", alignItems: "center", gap: "6px" },
1186
1213
  onClick: async () => {
@@ -1189,8 +1216,9 @@ const Lt = (e) => {
1189
1216
  (await fetch(`${a}/api/annotations/${m._id}`, {
1190
1217
  method: "DELETE",
1191
1218
  headers: { "x-api-key": n }
1192
- })).ok && (T(), e(r.success, "success"));
1219
+ })).ok && (R(), e(r.success, "success"));
1193
1220
  } catch {
1221
+ e(r.error, "error");
1194
1222
  }
1195
1223
  },
1196
1224
  children: [
@@ -1214,7 +1242,7 @@ function _e(e, t, r) {
1214
1242
  }).join(`
1215
1243
  `);
1216
1244
  }
1217
- function Dt() {
1245
+ function Nt() {
1218
1246
  return {
1219
1247
  name: "vite-plugin-viewgate",
1220
1248
  enforce: "pre",
@@ -1226,15 +1254,15 @@ function Dt() {
1226
1254
  }
1227
1255
  };
1228
1256
  }
1229
- function Nt(e) {
1257
+ function Dt(e) {
1230
1258
  const t = this.resourcePath;
1231
1259
  return t ? (process.env.NODE_ENV, _e(e, t, process.cwd())) : e;
1232
1260
  }
1233
1261
  export {
1234
1262
  It as ViewGate,
1235
- Ft as ViewGateOverlay,
1263
+ Gt as ViewGateOverlay,
1236
1264
  _e as transformSourcePaths,
1237
- Ne as useViewGate,
1238
- Nt as viewgateNextLoader,
1239
- Dt as viewgatePlugin
1265
+ De as useViewGate,
1266
+ Dt as viewgateNextLoader,
1267
+ Nt as viewgatePlugin
1240
1268
  };
@@ -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 W={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 T: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,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(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:{}},G={};var ie;function Ae(){if(ie)return G;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 G.Fragment=t,G.jsx=r,G.jsxs=r,G}var F={};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 V:return"Fragment";case B:return"Profiler";case N: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 P: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===V)return"<>";if(typeof o=="object"&&o!==null&&o.$$typeof===P)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:I,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(A(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 L=Object.keys(f).filter(function(Gt){return Gt!=="key"});w=0<L.length?"{key: someKey, "+L.join(": ..., ")+": ...}":"{key: someKey}",Ve[v+w]||(L=0<L.length?"{"+L.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"),T=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=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"?W.exports=Ae():W.exports=Le()),W.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?"},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?"}},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:113",value:{addToast:i,language:t,t:c,apiKey:r,baseUrl:n},children:[e,l.jsx(Pe,{"data-source-path":"/src/components/ViewGateProvider.tsx:115"}),l.jsx("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:116",className:"vg-toasts",children:a.map(u=>l.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:118",className:`vg-toast vg-glassmorphism vg-animate-slide ${u.type}`,children:[l.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:119",style:{fontSize:"20px"},children:u.type==="success"?"✅":"❌"}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:120",children:[l.jsx("strong",{"data-source-path":"/src/components/ViewGateProvider.tsx:121",style:{display:"block"},children:u.type==="success"?c.successHeader:c.errorHeader}),l.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:122",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 $(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function Me(e){const t=$(e,"border-left-width"),r=$(e,"border-right-width");return e.clientWidth+t+r}function He(e){const t=$(e,"border-top-width"),r=$(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 We(){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 $e(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||We(),d=t.canvasWidth||r,p=t.canvasHeight||n;return i.width=d*u,i.height=p*u,t.skipAutoScale||$e(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),[T,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(()=>{(s||T)&&P()},[s,T,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,T]);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),P()}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(!T),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})]})]})}),T&&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)})]}),m.status==="ready_for_review"&&l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:513",style:{display:"flex",gap:"8px",justifyContent:"flex-end",borderTop:"1px solid #e2e8f0",paddingTop:"16px",marginTop:"8px"},children:[l.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:514",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{}},children:["✍️ ",r.observe]}),l.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:534",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{}},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(`
7
+ <%s key={someKey} {...props} />`,w,v,L,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===P&&(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===I}var k=y,I=Symbol.for("react.transitional.element"),Y=Symbol.for("react.portal"),V=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"),T=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),P=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,A=Array.isArray,j=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=j(n(s)),Ve={};F.Fragment=V,F.jsx=function(o,f,x){var w=1e4>m.recentlyCreatedOwnerStacks++;return p(o,f,x,!1,w?Error("react-stack-top-frame"):Oe,w?j(n(o)):_e)},F.jsxs=function(o,f,x){var w=1e4>m.recentlyCreatedOwnerStacks++;return p(o,f,x,!0,w?Error("react-stack-top-frame"):Oe,w?j(n(o)):_e)}})()),F}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 O=null;function fe(e={}){return O||(e.includeStyleProperties?(O=e.includeStyleProperties,O):(O=R(window.getComputedStyle(document.documentElement)),O))}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 _(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 _("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)}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,I]=y.useState(!1),[Y,V]=y.useState(!1),[N,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(()=>{T()},[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]),P=y.useCallback(async m=>{if(!(!s||d)&&c){m.preventDefault(),m.stopPropagation(),V(!0);try{const h=c.element.style.display,A=window.getComputedStyle(c.element).display==="inline";A&&(c.element.style.display="inline-block");const j=await Ot(c.element,{backgroundColor:"#ffffff",pixelRatio:2,skipFonts:!0,style:{margin:"0",padding:"4px"}});A&&(c.element.style.display=h),p({...c,visualPreview:j})}catch(h){console.error("Failed to capture preview:",h),p(c)}finally{V(!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",P,!0),()=>{document.body.classList.remove("vg-cursor-pointer"),window.removeEventListener("mousemove",M),window.removeEventListener("click",P,!0)}),[s,d,M,P]);const se=async()=>{if(!d||!g.trim())return;I(!0);const{semanticReference:m}=d,[h,A]=m.source.split(":"),j=A||"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(j),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{I(!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:257",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:282",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:295",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:296",className:"vg-spinner"}),"Capturing..."]})}),s&&c&&!d&&!Y&&l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:304",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:322",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:335",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:341",style:{margin:"0 0 10px 0",fontSize:"24px",fontWeight:800},children:r.feedbackHeader}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:343",style:{marginBottom:"20px"},children:[l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:344",style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"},children:[d.semanticReference.componentPath?l.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:346",className:"vg-badge",style:{backgroundColor:"#f5f3ff",color:"#7c3aed",borderColor:"#ddd6fe"},children:["📦 ",d.semanticReference.componentPath]}):l.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:350",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:355",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:360",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:365",style:{marginTop:"8px",fontSize:"11px",color:"#94a3b8"},children:["🎯 ",d.semanticReference.selector]})]}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:371",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:380",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:383",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:406",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:422",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})]})]})}),N&&l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:444",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:457",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:466",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[l.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:467",style:{margin:0,fontSize:"24px",fontWeight:800},children:r.feedbackHeader}),l.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:468",onClick:()=>B(!1),className:"vg-button-ghost",style:{padding:"6px 12px"},children:"✕"})]}),l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:471",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:473",style:{textAlign:"center",padding:"40px",color:"#64748b"},children:"Cargando..."}):D.length===0?l.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:475",style:{textAlign:"center",padding:"40px",color:"#64748b"},children:r.noComments}):D.map(m=>l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:478",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:484",style:{display:"flex",justifyContent:"space-between",marginBottom:"12px"},children:l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:485",style:{display:"flex",gap:"8px",alignItems:"center"},children:[m.status==="ready_for_review"?l.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:487",className:"vg-badge",style:{backgroundColor:"#dcfce7",color:"#166534",borderColor:"#bbf7d0"},children:["✓ ",r.readyForReview]}):l.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:489",className:"vg-badge",style:{backgroundColor:"#fef3c7",color:"#92400e",borderColor:"#fde68a"},children:["⏳ ",r.pending]}),l.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:491",style:{fontSize:"12px",color:"#64748b"},children:new Date(m.timestamp).toLocaleString()})]})}),l.jsxs("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:497",style:{margin:"0 0 12px 0",fontSize:"15px",fontWeight:600},children:['"',m.message,'"']}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:499",style:{display:"flex",gap:"6px",flexWrap:"wrap",marginBottom:"16px"},children:[l.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:500",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:504",className:"vg-badge",style:{backgroundColor:"#f1f5f9",color:"#475569",border:"none"},children:X(m.filePath)})]}),l.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:510",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:512",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:534",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:557",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
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
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"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewgate-wrapper",
3
- "version": "1.4.1",
3
+ "version": "1.5.1",
4
4
  "type": "module",
5
5
  "main": "./dist/viewgate-wrapper.umd.cjs",
6
6
  "module": "./dist/viewgate-wrapper.js",