viewgate-wrapper 1.10.21 → 1.10.22

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,17 +1,17 @@
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;500;600;700;800&display=swap";body{margin:0!important;padding:0!important}:root{--vg-primary: #6366f1;--vg-primary-glow: rgba(99, 102, 241, .5);--vg-primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);--vg-bg-glass: rgba(255, 255, 255, .7);--vg-radius: 16px;--vg-font-main: "Inter", system-ui, sans-serif;--vg-font-alt: "Inter", system-ui, sans-serif;--placeholder-color: #94a3b8;--vg-glass-border: rgba(255, 255, 255, .3);--vg-shadow-premium: 0 20px 50px rgba(0, 0, 0, .1)}.vg-container,.vg-container *{box-sizing:border-box}.vg-container{font-family:var(--vg-font-main);-webkit-font-smoothing:antialiased}.vg-glassmorphism{background:var(--vg-bg-glass);backdrop-filter:blur(16px) saturate(180%);-webkit-backdrop-filter:blur(16px) saturate(180%);border:1px solid var(--vg-glass-border);box-shadow:0 8px 32px #0000001a;border-radius:var(--vg-radius);position:relative}.vg-button-primary{background:var(--vg-primary-gradient);color:#fff;border:none;padding:12px 24px;font-family:var(--vg-font-main);font-size:14px;font-weight:700;cursor:pointer;transition:all .2s ease;border-radius:99px;display:flex;align-items:center;justify-content:center;gap:8px;box-shadow:0 4px 12px #6366f14d}.vg-button-primary:hover{transform:translateY(-2px);box-shadow:0 6px 20px #6366f166}.vg-button-primary:disabled,.vg-button-ghost:disabled{opacity:.5;cursor:not-allowed;filter:grayscale(.4);transform:none!important;box-shadow:none!important;pointer-events:none}.vg-button-ghost{background:#fffc;color:#1e293b;border:1px solid #e2e8f0;padding:10px 24px;font-family:var(--vg-font-main);font-size:14px;font-weight:600;cursor:pointer;transition:all .2s ease;border-radius:99px;display:flex;align-items:center;justify-content:center;gap:8px}.vg-button-ghost:hover{background:#fff;border-color:#cbd5e1;box-shadow:0 4px 12px #0000000d}.vg-badge{background:#f1f5f9;color:#64748b;padding:4px 12px;font-size:11px;border-radius:99px;font-weight:600;display:inline-flex;align-items:center;gap:6px}.vg-textarea{width:100%;box-sizing:border-box;border:1px solid #e2e8f0;border-radius:12px;padding:12px;font-family:var(--vg-font-main);font-size:15px;color:#0f172a;resize:none;outline:none;background:#f8fafc;transition:all .2s ease}.vg-textarea:focus{background:#fff;border-color:var(--vg-primary);box-shadow:0 0 0 4px #6366f11a}@keyframes vg-fade-in{0%{opacity:0}to{opacity:1}}@keyframes vg-slide-in{0%{transform:translateY(30px) scale(.96);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}@keyframes vg-pop-in{0%{transform:scale(.6);opacity:0}70%{transform:scale(1.08);opacity:1}to{transform:scale(1);opacity:1}}@keyframes vg-slide-up-fade{0%{transform:translateY(12px) scale(.95);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}.vg-animate-pop{animation:vg-pop-in .4s cubic-bezier(.34,1.56,.64,1) forwards}.vg-animate-slide-up{animation:vg-slide-up-fade .5s cubic-bezier(.22,1,.36,1) forwards}.vg-button-primary,.vg-button-ghost,.vg-pin-container,.vg-action-bar,.vg-glassmorphism{transition:all .3s cubic-bezier(.4,0,.2,1)}.vg-animate-slide{animation:vg-slide-in .5s cubic-bezier(.22,1,.36,1) forwards}.vg-animate-fade{animation:vg-fade-in .35s cubic-bezier(.22,1,.36,1) forwards}.vg-toasts{position:fixed;top:24px;right:24px;display:flex;flex-direction:column;gap:12px}.vg-toast{padding:12px 20px;display:flex;align-items:center;gap:12px;min-width:300px;border-radius:12px;box-shadow:0 10px 30px #0000001a;background:#fff}.vg-toast.success{border-left:6px solid #22c55e}.vg-toast.error{border-left:6px solid #ef4444}.vg-backdrop-blur{position:fixed;top:0;left:0;width:100%;height:100%;-webkit-backdrop-filter:blur(8px) grayscale(.2);backdrop-filter:blur(8px) grayscale(.2);background:#0000001a;pointer-events:none;transition:opacity .3s ease,clip-path .2s cubic-bezier(.19,1,.22,1)}.vg-selection-pulse{position:fixed;pointer-events:none;border:2px solid var(--vg-primary);border-radius:8px;box-shadow:0 0 0 0 var(--vg-primary-glow);animation:vg-pulse 2s infinite;transition:all .2s cubic-bezier(.19,1,.22,1)}@keyframes vg-pulse{0%{box-shadow:0 0 0 0 var(--vg-primary-glow)}70%{box-shadow:0 0 0 15px #6366f100}to{box-shadow:0 0 #6366f100}}.vg-selection-label{position:absolute;top:-40px;left:0;background:var(--vg-primary-gradient);color:#fff;padding:8px 16px;border-radius:20px;font-size:13px;font-weight:700;white-space:nowrap;box-shadow:0 4px 12px #6366f14d;display:flex;align-items:center;gap:8px}.vg-pin-container{transition:transform .2s ease}.vg-pin-container:hover{transform:scale(1.1)}.vg-formal-pin{width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,#f97316,#ea580c);border:3px solid white;box-shadow:0 4px 12px #ea580c66;display:flex;align-items:center;justify-content:center;color:#fff;transition:all .2s ease}.vg-formal-pin.ready{background:linear-gradient(135deg,#10b981,#059669);box-shadow:0 4px 12px #10b98166}.vg-formal-pin.mixed{background:linear-gradient(135deg,#10b981,#059669);border:3px solid #f97316;box-shadow:0 4px 15px #f9731666}.vg-formal-pin.modal-variant{background:linear-gradient(135deg,#f59e0b,#d97706);box-shadow:0 4px 12px #f59e0b66;border-style:dashed}.vg-pin-tooltip{position:absolute;top:calc(100% + 12px);left:50%;transform:translate(-50%);padding:16px;border-radius:16px;background:#ffffffe6;backdrop-filter:blur(12px) saturate(160%);-webkit-backdrop-filter:blur(12px) saturate(160%);color:#1e293b;width:320px;font-size:13px;box-shadow:0 10px 40px #00000026;opacity:0;visibility:hidden;pointer-events:none;transition:all .3s cubic-bezier(.19,1,.22,1);border:1px solid rgba(255,255,255,.5);z-index:1000;overflow:hidden}.vg-tooltip-scroll{scrollbar-width:thin;scrollbar-color:rgba(99,102,241,.2) transparent;overflow-y:auto;overflow-x:hidden;padding-right:12px;scroll-behavior:smooth}.vg-tooltip-scroll::-webkit-scrollbar{width:4px}.vg-tooltip-scroll::-webkit-scrollbar-track{background:transparent}.vg-tooltip-scroll::-webkit-scrollbar-thumb{background:#6366f14d;border-radius:10px}.vg-tooltip-scroll::-webkit-scrollbar-thumb:hover{background:#6366f180}.vg-text-wrap{word-break:break-word;overflow-wrap:break-word;word-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;white-space:pre-wrap}.vg-line-clamp-2{display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;word-break:break-word;max-height:2.8em}.vg-pin-badge{position:absolute;top:-8px;right:-8px;background:#f43f5e;color:#fff;font-size:10px;font-weight:800;width:20px;height:20px;border-radius:50%;display:flex;align-items:center;justify-content:center;border:2px solid white;box-shadow:0 4px 12px #f43f5e66;z-index:2}.vg-pin-tooltip.vg-top{top:auto;bottom:calc(100% + 12px)}.vg-pin-container:hover .vg-pin-tooltip{opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%) translateY(-5px)}.vg-action-bar{display:flex;gap:12px;padding:0;background:transparent;border:none;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}.vg-custom-scrollbar::-webkit-scrollbar{width:6px}.vg-custom-scrollbar::-webkit-scrollbar-track{background:transparent}.vg-custom-scrollbar::-webkit-scrollbar-thumb{background:#6366f166;border-radius:10px;transition:all .2s ease}.vg-custom-scrollbar::-webkit-scrollbar-thumb:hover{background:#6366f1b3}.vg-spinner{border:3px solid rgba(99,102,241,.1);border-top:3px solid var(--vg-primary);border-radius:50%;width:32px;height:32px;animation:vg-spin .8s linear infinite}@keyframes vg-spin{to{transform:rotate(360deg)}}.vg-animate-spin{animation:vg-spin .8s linear infinite}.vg-cursor-pointer,.vg-cursor-pointer *{cursor:pointer!important}.vg-url-tag{position:relative;cursor:help;transition:all .2s ease}.vg-url-tag:hover{background:#f1f5f9!important;border-color:var(--vg-primary)!important}.vg-url-tooltip{position:fixed;left:0;top:0;background:#0f172a;color:#fff;padding:8px 14px;border-radius:10px;font-size:11px;font-weight:500;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .2s ease,transform .2s ease;box-shadow:0 10px 25px -5px #0006;z-index:2147483647;border:1px solid rgba(255,255,255,.1)}.vg-url-tooltip.visible{opacity:1}.vg-url-tooltip:after{content:"";position:absolute;left:50%;transform:translate(-50%);border-width:6px;border-style:solid}.vg-url-tooltip.vg-top:after{top:100%;border-color:#0f172a transparent transparent transparent}.vg-url-tooltip.vg-bottom:after{bottom:100%;border-color:transparent transparent #0f172a transparent}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- (function(N,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):(N=typeof globalThis<"u"?globalThis:N||self,m(N.ViewGateWrapper={},N.React,N.ReactDOM))})(this,(function(N,m,Vt){"use strict";var we={exports:{}},de={};var Ye;function Tt(){if(Ye)return de;Ye=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,s){var c=null;if(s!==void 0&&(c=""+s),a.key!==void 0&&(c=""+a.key),"key"in a){s={};for(var i in a)i!=="key"&&(s[i]=a[i])}else s=a;return a=s.ref,{$$typeof:e,type:n,key:c,ref:a!==void 0?a:null,props:s}}return de.Fragment=t,de.jsx=r,de.jsxs=r,de}var ue={};var Xe;function Pt(){return Xe||(Xe=1,process.env.NODE_ENV!=="production"&&(function(){function e(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===me?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case oe:return"Fragment";case je:return"Profiler";case Re:return"StrictMode";case Fe:return"Suspense";case D:return"SuspenseList";case kt:return"Activity"}if(typeof d=="object")switch(typeof d.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),d.$$typeof){case $:return"Portal";case B:return d.displayName||"Context";case I:return(d._context.displayName||"Context")+".Consumer";case T:var y=d.render;return d=d.displayName,d||(d=y.displayName||y.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case W:return y=d.displayName||null,y!==null?y:e(d.type)||"Memo";case _e:y=d._payload,d=d._init;try{return e(d(y))}catch{}}return null}function t(d){return""+d}function r(d){try{t(d);var y=!1}catch{y=!0}if(y){y=console;var b=y.error,S=typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object";return b.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",S),t(d)}}function n(d){if(d===oe)return"<>";if(typeof d=="object"&&d!==null&&d.$$typeof===_e)return"<...>";try{var y=e(d);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function a(){var d=ie.A;return d===null?null:d.getOwner()}function s(){return Error("react-stack-top-frame")}function c(d){if(Oe.call(d,"key")){var y=Object.getOwnPropertyDescriptor(d,"key").get;if(y&&y.isReactWarning)return!1}return d.key!==void 0}function i(d,y){function b(){Q||(Q=!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)",y))}b.isReactWarning=!0,Object.defineProperty(d,"key",{get:b,configurable:!0})}function u(){var d=e(this.type);return te[d]||(te[d]=!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.")),d=this.props.ref,d!==void 0?d:null}function p(d,y,b,S,ce,Y){var k=b.ref;return d={$$typeof:z,type:d,key:y,props:b,_owner:S},(k!==void 0?k:null)!==null?Object.defineProperty(d,"ref",{enumerable:!1,get:u}):Object.defineProperty(d,"ref",{enumerable:!1,value:null}),d._store={},Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(d,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(d,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ce}),Object.defineProperty(d,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.freeze&&(Object.freeze(d.props),Object.freeze(d)),d}function f(d,y,b,S,ce,Y){var k=y.children;if(k!==void 0)if(S)if(Ve(k)){for(S=0;S<k.length;S++)g(k[S]);Object.freeze&&Object.freeze(k)}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(k);if(Oe.call(y,"key")){k=e(d);var O=Object.keys(y).filter(function(We){return We!=="key"});S=0<O.length?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}",he[k+S]||(O=0<O.length?"{"+O.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
+ (function(M,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):(M=typeof globalThis<"u"?globalThis:M||self,m(M.ViewGateWrapper={},M.React,M.ReactDOM))})(this,(function(M,m,Vt){"use strict";var ve={exports:{}},ue={};var Ye;function At(){if(Ye)return ue;Ye=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,s){var c=null;if(s!==void 0&&(c=""+s),a.key!==void 0&&(c=""+a.key),"key"in a){s={};for(var i in a)i!=="key"&&(s[i]=a[i])}else s=a;return a=s.ref,{$$typeof:e,type:n,key:c,ref:a!==void 0?a:null,props:s}}return ue.Fragment=t,ue.jsx=r,ue.jsxs=r,ue}var pe={};var Xe;function Tt(){return Xe||(Xe=1,process.env.NODE_ENV!=="production"&&(function(){function e(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===fe?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case oe:return"Fragment";case _e:return"Profiler";case je:return"StrictMode";case Oe:return"Suspense";case F:return"SuspenseList";case kt:return"Activity"}if(typeof d=="object")switch(typeof d.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),d.$$typeof){case Y:return"Portal";case X:return d.displayName||"Context";case L:return(d._context.displayName||"Context")+".Consumer";case V:var y=d.render;return d=d.displayName,d||(d=y.displayName||y.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case H:return y=d.displayName||null,y!==null?y:e(d.type)||"Memo";case Ve:y=d._payload,d=d._init;try{return e(d(y))}catch{}}return null}function t(d){return""+d}function r(d){try{t(d);var y=!1}catch{y=!0}if(y){y=console;var b=y.error,S=typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object";return b.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",S),t(d)}}function n(d){if(d===oe)return"<>";if(typeof d=="object"&&d!==null&&d.$$typeof===Ve)return"<...>";try{var y=e(d);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function a(){var d=ie.A;return d===null?null:d.getOwner()}function s(){return Error("react-stack-top-frame")}function c(d){if(Ae.call(d,"key")){var y=Object.getOwnPropertyDescriptor(d,"key").get;if(y&&y.isReactWarning)return!1}return d.key!==void 0}function i(d,y){function b(){q||(q=!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)",y))}b.isReactWarning=!0,Object.defineProperty(d,"key",{get:b,configurable:!0})}function u(){var d=e(this.type);return te[d]||(te[d]=!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.")),d=this.props.ref,d!==void 0?d:null}function p(d,y,b,S,ce,J){var k=b.ref;return d={$$typeof:D,type:d,key:y,props:b,_owner:S},(k!==void 0?k:null)!==null?Object.defineProperty(d,"ref",{enumerable:!1,get:u}):Object.defineProperty(d,"ref",{enumerable:!1,value:null}),d._store={},Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(d,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(d,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ce}),Object.defineProperty(d,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.freeze&&(Object.freeze(d.props),Object.freeze(d)),d}function f(d,y,b,S,ce,J){var k=y.children;if(k!==void 0)if(S)if(Te(k)){for(S=0;S<k.length;S++)h(k[S]);Object.freeze&&Object.freeze(k)}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 h(k);if(Ae.call(y,"key")){k=e(d);var A=Object.keys(y).filter(function(He){return He!=="key"});S=0<A.length?"{key: someKey, "+A.join(": ..., ")+": ...}":"{key: someKey}",ge[k+S]||(A=0<A.length?"{"+A.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} />`,S,k,O,k),he[k+S]=!0)}if(k=null,b!==void 0&&(r(b),k=""+b),c(y)&&(r(y.key),k=""+y.key),"key"in y){b={};for(var U in y)U!=="key"&&(b[U]=y[U])}else b=y;return k&&i(b,typeof d=="function"?d.displayName||d.name||"Unknown":d),p(d,k,b,a(),ce,Y)}function g(d){_(d)?d._store&&(d._store.validated=1):typeof d=="object"&&d!==null&&d.$$typeof===_e&&(d._payload.status==="fulfilled"?_(d._payload.value)&&d._payload.value._store&&(d._payload.value._store.validated=1):d._store&&(d._store.validated=1))}function _(d){return typeof d=="object"&&d!==null&&d.$$typeof===z}var A=m,z=Symbol.for("react.transitional.element"),$=Symbol.for("react.portal"),oe=Symbol.for("react.fragment"),Re=Symbol.for("react.strict_mode"),je=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),B=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),Fe=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),_e=Symbol.for("react.lazy"),kt=Symbol.for("react.activity"),me=Symbol.for("react.client.reference"),ie=A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Oe=Object.prototype.hasOwnProperty,Ve=Array.isArray,L=console.createTask?console.createTask:function(){return null};A={react_stack_bottom_frame:function(d){return d()}};var Q,te={},fe=A.react_stack_bottom_frame.bind(A,s)(),H=L(n(s)),he={};ue.Fragment=oe,ue.jsx=function(d,y,b){var S=1e4>ie.recentlyCreatedOwnerStacks++;return f(d,y,b,!1,S?Error("react-stack-top-frame"):fe,S?L(n(d)):H)},ue.jsxs=function(d,y,b){var S=1e4>ie.recentlyCreatedOwnerStacks++;return f(d,y,b,!0,S?Error("react-stack-top-frame"):fe,S?L(n(d)):H)}})()),ue}var Je;function At(){return Je||(Je=1,process.env.NODE_ENV==="production"?we.exports=Tt():we.exports=Pt()),we.exports}var o=At();const Gt=({children:e})=>{const t=m.useRef(null),[r,n]=m.useState(null);return m.useEffect(()=>{if(t.current&&!t.current.shadowRoot){const a=t.current.attachShadow({mode:"open"});document.querySelectorAll("style[data-vite-dev-id], style:not([data-vite-dev-id])").forEach(i=>{(i.textContent?.includes(".vg-")||i.textContent?.includes("--vg-"))&&a.appendChild(i.cloneNode(!0))});const c=document.createElement("link");c.rel="stylesheet",c.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap",a.appendChild(c),n(a)}},[]),o.jsx("div",{"data-source-path":"/src/components/ShadowRootWrapper.tsx:38",ref:t,id:"viewgate-shadow-host",children:r&&Vt.createPortal(e,r)})};const Ze=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();const Nt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Mt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase());const Ke=e=>{const t=Mt(e);return t.charAt(0).toUpperCase()+t.slice(1)};var It={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Lt=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const zt=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:s,iconNode:c,...i},u)=>m.createElement("svg",{ref:u,...It,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Ze("lucide",a),...!s&&!Lt(i)&&{"aria-hidden":"true"},...i},[...c.map(([p,f])=>m.createElement(p,f)),...Array.isArray(s)?s:[s]]));const V=(e,t)=>{const r=m.forwardRef(({className:n,...a},s)=>m.createElement(zt,{ref:s,iconNode:t,className:Ze(`lucide-${Nt(Ke(e))}`,`lucide-${e}`,n),...a}));return r.displayName=Ke(e),r};const Dt=V("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const ne=V("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Qe=V("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);const qe=V("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const Ft=V("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const Wt=V("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const et=V("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);const Ht=V("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const ve=V("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);const Ut=V("mouse-pointer-2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]);const $t=V("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const Bt=V("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const Yt=V("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const tt=V("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const Te=V("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Xt={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:"Delete comment",markReady:"Mark as Ready",reopen:"Reopen",review:"Review",confirmDelete:"Are you sure you want to permanently delete this comment? This action cannot be undone.",markReadyConfirm:"Complete review",confirmMarkReady:"Do you want to mark this comment as ready? it will be moved to the completed state.",reopenConfirm:"Reopen comment",confirmReopen:"Do you want to set this comment back to pending status?",yes:"Yes, confirm",no:"No, cancel",deleteSuccess:"Comment deleted successfully.",updateSuccess:"Updated successfully.",navigating:"Redirecting to review...",selectToComment:"Click to comment",feedbackSubheader:"What would you like to improve here?",sendFeedback:"Send Comment",edit:"Edit",save:"Save",commentDetails:"Comment Details",annotations:"Comments",viewAll:"View All",exitConfirmTitle:"Close ViewGate?",exitConfirmMessage:"Are you sure you want to close ViewGate? You can reopen it at any time by adding ?viewgate=true to your URL."},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:"Eliminar comentario",markReady:"Marcar como Listo",reopen:"Reabrir",review:"Revisar",confirmDelete:"¿Estás seguro de que deseas eliminar permanentemente este comentario? Esta acción no se puede deshacer.",markReadyConfirm:"Finalizar revisión",confirmMarkReady:"¿Deseas marcar este comentario como listo? Pasará al estado completado.",reopenConfirm:"Reabrir comentario",confirmReopen:"¿Deseas volver a poner este comentario en estado pendiente?",yes:"Sí, confirmar",no:"No, cancelar",deleteSuccess:"El comentario ha sido eliminado.",updateSuccess:"Actualizado correctamente.",navigating:"Redirigiendo a revisión...",selectToComment:"Haz clic para comentar",feedbackSubheader:"¿Qué te gustaría mejorar aquí?",sendFeedback:"Enviar Comentario",edit:"Editar",save:"Guardar",commentDetails:"Detalles del Comentario",annotations:"Comentarios",viewAll:"Ver Todos",exitConfirmTitle:"¿Cerrar ViewGate?",exitConfirmMessage:"¿Estás seguro de que deseas cerrar ViewGate? Puedes volver a activarlo en cualquier momento agregando ?viewgate=true a la URL."}},rt=m.createContext(void 0),nt=()=>{const e=m.useContext(rt);if(!e)throw new Error("useViewGate must be used within a ViewGateProvider");return e},Pe="viewgate_enabled",Jt=()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).has("viewgate")?(sessionStorage.setItem(Pe,"true"),!0):sessionStorage.getItem(Pe)==="true",Zt=({children:e,language:t="es",apiKey:r,baseUrl:n="https://view-gate.vercel.app"})=>{const[a,s]=m.useState(!1),[c,i]=m.useState([]);m.useEffect(()=>{s(Jt())},[]);const u=()=>{if(sessionStorage.removeItem(Pe),s(!1),typeof window<"u"){const g=new URL(window.location.href);g.searchParams.delete("viewgate"),window.history.replaceState({},"",g.toString())}},p=(g,_)=>{const A=Date.now();i(z=>[...z,{id:A,message:g,type:_}]),setTimeout(()=>{i(z=>z.filter($=>$.id!==A))},4e3)},f=Xt[t];return o.jsxs(rt.Provider,{"data-source-path":"/src/components/ViewGateProvider.tsx:252",value:{addToast:p,language:t,t:f,apiKey:r,baseUrl:n,disableViewGate:u,hasActiveToasts:c.length>0},children:[e,a&&o.jsx(Gt,{"data-source-path":"/src/components/ViewGateProvider.tsx:263",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:264",className:"vg-container",children:[o.jsx(Et,{"data-source-path":"/src/components/ViewGateProvider.tsx:265"}),o.jsx("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:266",className:"vg-toasts",style:{zIndex:2147483646},children:c.map(g=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:268",className:`vg-toast vg-animate-slide ${g.type}`,children:[g.type==="success"?o.jsx(ne,{"data-source-path":"/src/components/ViewGateProvider.tsx:270",size:24,color:"#22c55e"}):o.jsx(Dt,{"data-source-path":"/src/components/ViewGateProvider.tsx:272",size:24,color:"#ef4444"}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:274",children:[o.jsx("strong",{"data-source-path":"/src/components/ViewGateProvider.tsx:275",style:{display:"block",fontSize:"13px",color:"#0f172a",textTransform:"uppercase",marginBottom:"2px"},children:g.type==="success"?f.successHeader:f.errorHeader}),o.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:278",style:{fontSize:"14px",color:"#000000"},children:g.message})]})]},g.id))})]})})]})};function Kt(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 Qt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function K(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let ae=null;function at(e={}){return ae||(e.includeStyleProperties?(ae=e.includeStyleProperties,ae):(ae=K(window.getComputedStyle(document.documentElement)),ae))}function be(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function qt(e){const t=be(e,"border-left-width"),r=be(e,"border-right-width");return e.clientWidth+t+r}function er(e){const t=be(e,"border-top-width"),r=be(e,"border-bottom-width");return e.clientHeight+t+r}function st(e,t={}){const r=t.width||qt(e),n=t.height||er(e);return{width:r,height:n}}function tr(){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 M=16384;function rr(e){(e.width>M||e.height>M)&&(e.width>M&&e.height>M?e.width>e.height?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M):e.width>M?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M))}function Se(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 nr(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function ar(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),nr(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function sr(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function or(e,t){return at(t).map(r=>{const n=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${n}${a?" !important":""};`}).join(" ")}function ir(e,t,r,n){const a=`.${e}:${t}`,s=r.cssText?sr(r):or(r,n);return document.createTextNode(`${a}{${s}}`)}function ot(e,t,r,n){const a=window.getComputedStyle(e,r),s=a.getPropertyValue("content");if(s===""||s==="none")return;const c=Qt();try{t.className=`${t.className} ${c}`}catch{return}const i=document.createElement("style");i.appendChild(ir(c,r,a,n)),t.appendChild(i)}function cr(e,t,r){ot(e,t,":before",r),ot(e,t,":after",r)}const it="application/font-woff",ct="image/jpeg",lr={woff:it,woff2:it,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:ct,jpeg:ct,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function dr(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ae(e){const t=dr(e).toLowerCase();return lr[t]||""}function ur(e){return e.split(/,/)[1]}function Ge(e){return e.search(/^(data:)/)!==-1}function pr(e,t){return`data:${t};base64,${e}`}async function lt(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,c)=>{const i=new FileReader;i.onerror=c,i.onloadend=()=>{try{s(r({res:n,result:i.result}))}catch(u){c(u)}},i.readAsDataURL(a)})}const Ne={};function mr(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 Me(e,t,r){const n=mr(e,t,r.includeQueryParams);if(Ne[n]!=null)return Ne[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const s=await lt(e,r.fetchRequestInit,({res:c,result:i})=>(t||(t=c.headers.get("Content-Type")||""),ur(i)));a=pr(s,t)}catch(s){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;s&&(c=typeof s=="string"?s:s.message),c&&console.warn(c)}return Ne[n]=a,a}async function fr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Se(t)}async function hr(e,t){if(e.currentSrc){const s=document.createElement("canvas"),c=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,c?.drawImage(e,0,0,s.width,s.height);const i=s.toDataURL();return Se(i)}const r=e.poster,n=Ae(r),a=await Me(r,n,t);return Se(a)}async function gr(e,t){var r;try{if(!((r=e?.contentDocument)===null||r===void 0)&&r.body)return await Ce(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function xr(e,t){return P(e,HTMLCanvasElement)?fr(e):P(e,HTMLVideoElement)?hr(e,t):P(e,HTMLIFrameElement)?gr(e,t):e.cloneNode(dt(e))}const yr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",dt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function wr(e,t,r){var n,a;if(dt(t))return t;let s=[];return yr(e)&&e.assignedNodes?s=K(e.assignedNodes()):P(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||P(e,HTMLVideoElement)||await s.reduce((c,i)=>c.then(()=>Ce(i,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function vr(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):at(r).forEach(s=>{let c=a.getPropertyValue(s);s==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&s==="display"&&c==="inline"&&(c="block"),s==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),n.setProperty(s,c,a.getPropertyPriority(s))})}function br(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Sr(e,t){if(P(e,HTMLSelectElement)){const n=Array.from(t.children).find(a=>e.value===a.getAttribute("value"));n&&n.setAttribute("selected","")}}function Cr(e,t,r){return P(t,Element)&&(vr(e,t,r),cr(e,t,r),br(e,t),Sr(e,t)),t}async function Er(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 i=r[s].getAttribute("xlink:href");if(i){const u=e.querySelector(i),p=document.querySelector(i);!u&&p&&!n[i]&&(n[i]=await Ce(p,t,!0))}}const a=Object.values(n);if(a.length){const s="http://www.w3.org/1999/xhtml",c=document.createElementNS(s,"svg");c.setAttribute("xmlns",s),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const i=document.createElementNS(s,"defs");c.appendChild(i);for(let u=0;u<a.length;u++)i.appendChild(a[u]);e.appendChild(c)}return e}async function Ce(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>xr(n,t)).then(n=>wr(e,n,t)).then(n=>Cr(e,n,t)).then(n=>Er(n,t))}const ut=/url\((['"]?)([^'"]+?)\1\)/g,kr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Rr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function jr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function _r(e){const t=[];return e.replace(ut,(r,n,a)=>(t.push(a),r)),t.filter(r=>!Ge(r))}async function Or(e,t,r,n,a){try{const s=r?Kt(t,r):t,c=Ae(t);let i;return a||(i=await Me(s,c,n)),e.replace(jr(t),`$1${i}$3`)}catch{}return e}function Vr(e,{preferredFontFormat:t}){return t?e.replace(Rr,r=>{for(;;){const[n,,a]=kr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${n};`}}):e}function pt(e){return e.search(ut)!==-1}async function mt(e,t,r){if(!pt(e))return e;const n=Vr(e,r);return _r(n).reduce((s,c)=>s.then(i=>Or(i,c,t,r)),Promise.resolve(n))}async function se(e,t,r){var n;const a=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(a){const s=await mt(a,null,r);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function Tr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function Pr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Ge(e.src))&&!(P(e,SVGImageElement)&&!Ge(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,a=await Me(n,Ae(n),t);await new Promise((s,c)=>{e.onload=s,e.onerror=t.onImageErrorHandler?(...u)=>{try{s(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const i=e;i.decode&&(i.decode=s),i.loading==="lazy"&&(i.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function Ar(e,t){const n=K(e.childNodes).map(a=>ft(a,t));await Promise.all(n).then(()=>e)}async function ft(e,t){P(e,Element)&&(await Tr(e,t),await Pr(e,t),await Ar(e,t))}function Gr(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 ht={};async function gt(e){let t=ht[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},ht[e]=t,t}async function xt(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,s=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let i=c.replace(n,"$1");return i.startsWith("https://")||(i=new URL(i,e.url).href),lt(i,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(s).then(()=>r)}function yt(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,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",i=new RegExp(c,"gi");for(;;){let u=s.exec(n);if(u===null){if(u=i.exec(n),u===null)break;s.lastIndex=i.lastIndex}else i.lastIndex=s.lastIndex;t.push(u[0])}return t}async function Nr(e,t){const r=[],n=[];return e.forEach(a=>{if("cssRules"in a)try{K(a.cssRules||[]).forEach((s,c)=>{if(s.type===CSSRule.IMPORT_RULE){let i=c+1;const u=s.href,p=gt(u).then(f=>xt(f,t)).then(f=>yt(f).forEach(g=>{try{a.insertRule(g,g.startsWith("@import")?i+=1:a.cssRules.length)}catch(_){console.error("Error inserting rule from remote css",{rule:g,error:_})}})).catch(f=>{console.error("Error loading remote css",f.toString())});n.push(p)}})}catch(s){const c=e.find(i=>i.href==null)||document.styleSheets[0];a.href!=null&&n.push(gt(a.href).then(i=>xt(i,t)).then(i=>yt(i).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(i=>{console.error("Error loading remote stylesheet",i)})),console.error("Error inlining remote css file",s)}}),Promise.all(n).then(()=>(e.forEach(a=>{if("cssRules"in a)try{K(a.cssRules||[]).forEach(s=>{r.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${a.href}`,s)}}),r))}function Mr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function Ir(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=K(e.ownerDocument.styleSheets),n=await Nr(r,t);return Mr(n)}function wt(e){return e.trim().replace(/["']/g,"")}function Lr(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(s=>{t.add(wt(s))}),Array.from(n.children).forEach(s=>{s instanceof HTMLElement&&r(s)})}return r(e),t}async function zr(e,t){const r=await Ir(e,t),n=Lr(e);return(await Promise.all(r.filter(s=>n.has(wt(s.style.fontFamily))).map(s=>{const c=s.parentStyleSheet?s.parentStyleSheet.href:null;return mt(s.cssText,c,t)}))).join(`
8
- `)}async function Dr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await zr(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 Fr(e,t={}){const{width:r,height:n}=st(e,t),a=await Ce(e,t,!0);return await Dr(a,t),await ft(a,t),Gr(a,t),await ar(a,r,n)}async function Wr(e,t={}){const{width:r,height:n}=st(e,t),a=await Fr(e,t),s=await Se(a),c=document.createElement("canvas"),i=c.getContext("2d"),u=t.pixelRatio||tr(),p=t.canvasWidth||r,f=t.canvasHeight||n;return c.width=p*u,c.height=f*u,t.skipAutoScale||rr(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(i.fillStyle=t.backgroundColor,i.fillRect(0,0,c.width,c.height)),i.drawImage(s,0,0,c.width,c.height),c}async function Hr(e,t={}){return(await Wr(e,t)).toDataURL()}const Ee=2147483647,Ie=Ee,Le=2e6,Ur=Ee-10,$r=Ee-5,Br=Ee-15,F="data-vg-pin-id",Yr=()=>{const e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"},vt=(e,t)=>{if(!e)return"";try{const r=new Date(e);return isNaN(r.getTime())?"":new Intl.DateTimeFormat(t==="es"?"es-ES":"en-US",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(r)}catch{return""}},bt=({url:e,className:t,style:r,tooltipStyle:n,onHover:a})=>{const s=m.useRef(null),c=()=>{if(!s.current||!a)return;const i=s.current.getBoundingClientRect(),u=i.top,p=window.innerHeight-i.bottom,f=u<140&&p>u?"bottom":"top";a({url:e,x:i.left+i.width/2,y:f==="top"?i.top:i.bottom,direction:f})};return o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:106",ref:s,className:`vg-url-tag ${t||""}`,style:r,onMouseEnter:c,onMouseMove:c,onMouseLeave:()=>a?.(null),children:[o.jsx(Wt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:114",size:r?.fontSize?parseInt(r.fontSize)+1:10}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:115",style:{maxWidth:r?.maxWidth||"150px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:new URL(e).pathname})]})},pe=e=>{const t=[],r=[],n=[];let a=e;for(;a&&a.nodeType===Node.ELEMENT_NODE;){if(a.id&&!a.id.startsWith("vg-")&&!a.id.includes(":")){t.unshift(`#${a.id}`),n.unshift(`${a.localName}#${a.id}`);break}let s=a.localName;const c=Array.from(a.parentNode?.children||[]).indexOf(a),i=`${a.localName}[${c}]`;n.unshift(i);const u=a.getAttribute("data-testid")||a.getAttribute("data-qa");if(u&&r.push(`[data-testid="${u}"]`),a.getAttribute("placeholder"),a.getAttribute("aria-label"),a.getAttribute("role"),a.getAttribute("name"),a.getAttribute("title"),u){s=`[${a.hasAttribute("data-testid")?"data-testid":"data-qa"}="${u}"]`,t.unshift(s);break}const p=Array.from(a.parentNode?.children||[]).filter(f=>f.localName===a?.localName);if(p.length>1){const f=p.indexOf(a)+1;s+=`:nth-of-type(${f})`}t.unshift(s),a=a.parentElement}return{selector:t.join(" > "),fallbacks:r,vgPath:n.join(" > ")}},Xr=e=>{const{vgPath:t}=pe(e);return{vgPath:t,classHash:e.className,parentTag:e.parentElement?.tagName.toLowerCase(),neighborCount:e.parentElement?.children.length,ariaLabel:e.getAttribute("aria-label")||void 0,role:e.getAttribute("role")||void 0,name:e.getAttribute("name")||void 0,type:e.getAttribute("type")||void 0,placeholder:e.getAttribute("placeholder")||void 0,textSnippet:(e.innerText||"").slice(0,30).trim()}},Jr=(()=>{let e=null,t=null;return r=>{if(!r||typeof window>"u"||typeof document>"u")return r;if(r.includes("oklch")||r.includes("oklab")||r.includes("lab(")||r.includes("lch(")||r.includes("color("))try{if(e||(e=document.createElement("canvas"),e.width=1,e.height=1),t||(t=e.getContext("2d",{willReadFrequently:!0})),t){t.fillStyle="#000000",t.fillStyle=r;const s=t.fillStyle;if(s&&!s.includes("oklch")&&!s.includes("oklab"))return s}const n=document.createElement("div");n.style.color=r,document.body.appendChild(n);const a=getComputedStyle(n).color;return document.body.removeChild(n),a&&!a.includes("oklch")?a:"rgb(0,0,0)"}catch{return"rgb(0,0,0)"}return r}})(),Zr=(e,t,r,n)=>new Promise(a=>{const s=new Image;s.onload=()=>{const c=document.createElement("canvas"),i=2,u=t.width+r*2,p=t.height+r*2;c.width=u*i,c.height=p*i;const f=c.getContext("2d");if(f){f.imageSmoothingEnabled=!0,f.imageSmoothingQuality="high";const g=(t.left-r)*n,_=(t.top-r)*n,A=u*n,z=p*n;f.drawImage(s,g,_,A,z,0,0,c.width,c.height)}a(c.toDataURL("image/png",.9))},s.onerror=()=>a(""),s.src=e}),Kr=e=>{const t=window.getComputedStyle(e),r={};return["display","position","margin","padding","font-size","color","background-color","width","height","z-index"].forEach(a=>{const s=t.getPropertyValue(a);r[a]=Jr(s)}),r},Qr=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 c=s.displayName||s.name;c&&!c.includes("ViewGate")&&!n.includes(c)&&n.unshift(c)}a=a.return}return n.join(" > ")||"Generic Component"},qr=e=>{if(!e)return!1;const t=window.getComputedStyle(e),r=e.getBoundingClientRect(),n=e.getAttribute("role");if(n&&["listbox","menu","combobox","tooltip","option"].includes(n))return!1;const s=120;return r.width<s&&r.height<s||t.position!=="fixed"&&t.position!=="absolute"?!1:!!(e.closest('[role="dialog"]')||e.closest('[aria-modal="true"]')||e.classList.contains("modal")||e.classList.contains("modal-content"))},ee=e=>{if(!e.isConnected)return!1;const t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden"||t.opacity==="0"||e.offsetWidth===0||e.offsetHeight===0)return!1;let r=e.parentElement;for(;r;){const a=window.getComputedStyle(r);if(a.display==="none"||a.visibility==="hidden"||a.opacity==="0")return!1;r=r.parentElement}const n=e.getBoundingClientRect();return!(n.width===0||n.height===0||n.top===0&&n.left===0&&n.width>window.innerWidth*.9)},St=(e,t=document)=>{const r=t.querySelector(e);if(r)return r;const n=t.querySelectorAll("*");for(const a of Array.from(n)){const s=a.shadowRoot;if(s){const c=St(e,s);if(c)return c}}return null},Ct=(e,t)=>{let r=document.elementFromPoint(e,t);for(;r&&r.shadowRoot;){const n=r.shadowRoot.elementFromPoint(e,t);if(!n||n===r)break;r=n}return r},en=e=>{if(!e.tag)return null;const t=Array.from(document.getElementsByTagName(e.tag));let r=null,n=0;for(const a of t){if(!ke(a,e))continue;let s=0;const c=a.getAttribute("placeholder"),i=e.attributes?.placeholder||e.fingerprint?.placeholder;i&&c===i&&(s+=6);const u=a.getAttribute("type"),p=e.attributes?.type||e.fingerprint?.type;if(p&&u===p&&(s+=2),a.innerText?.trim()===e.text.trim()&&(s+=5),e.fingerprint?.vgPath){const{vgPath:f}=pe(a);(f===e.vgPath||e.fingerprint?.vgPath===f)&&(s+=10)}s>n&&s>=7&&(n=s,r=a)}return r},ke=(e,t)=>{if(e.tagName.toLowerCase()!==t.tag.toLowerCase())return!1;const r=e.getAttribute("placeholder"),n=t.attributes?.placeholder||t.fingerprint?.placeholder;if(n&&r&&n!==r)return!1;const a=e.getAttribute("type"),s=t.attributes?.type||t.fingerprint?.type;return!(s&&a&&s!==a)},tn=(e,t)=>{if(t){const c=Array.from(document.querySelectorAll(`[${F}="${t}"]`));if(c.length>0){const i=c.filter(u=>ke(u,e));if(i.length===0)c.forEach(u=>u.removeAttribute(F));else{const u=i.find(f=>{const{vgPath:g}=pe(f);return g===e.vgPath||e.fingerprint?.vgPath===g}),p=u&&ee(u)?u:i.find(f=>!(!ee(f)||e.metadata?.isModal&&!f.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')));return p?(c.forEach(f=>{f!==p&&f.removeAttribute(F)}),p):null}}}const n=(e.selector?Array.from(document.querySelectorAll(e.selector)):[]).filter(c=>ke(c,e));let a=n.find(c=>{const{vgPath:i}=pe(c);return i===e.vgPath||e.fingerprint?.vgPath===i})||n[0]||null;if(a&&ee(a))if(e.metadata?.isModal&&!a.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))a=null;else return a;if(e.fallbackSelectors)for(const c of e.fallbackSelectors){const i=St(c);if(i&&ke(i,e)&&ee(i)){if(e.metadata?.isModal&&!i.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))continue;return i}}const s=en(e);return s&&ee(s)?e.metadata?.isModal&&!s.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')?null:s:null},ze=e=>({tag:e.tagName.toLowerCase(),text:(e.innerText||e.getAttribute("placeholder")||"").slice(0,50).trim(),role:e.getAttribute("role")||void 0,type:e.getAttribute("type")||void 0}),rn=e=>{const t=e.parentElement;if(!t)return;const r=Array.from(t.children).filter(c=>c!==e).slice(0,5).map(c=>ze(c)),n=Array.from(t.children),a=n.indexOf(e);let s="middle";return a===0&&(s="start"),a===n.length-1&&(s="end"),{target:{...ze(e),location:`${s} of ${t.tagName.toLowerCase()}`},parent:ze(t),siblings:r}},nn=e=>{let t="unknown:0",r=e;for(;r;){const f=r.getAttribute("data-source-path");if(f){t=f;break}r=r.parentElement}const n=Qr(e),{selector:a,fallbacks:s,vgPath:c}=pe(e),i={};["placeholder","aria-label","name","type","alt","title","value","role"].forEach(f=>{const g=e.getAttribute(f);g&&(i[f]=g)});const u=!!e.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'),p=`${e.tagName.toLowerCase()}-${(e.innerText||"").slice(0,20).replace(/\s+/g,"_")}-${a.split(" > ").slice(-1)}`;return{tag:e.tagName.toLowerCase(),id:e.id||"",classes:e.className||"",text:(e.innerText||"").slice(0,100).trim(),selector:a,vgPath:c,outerHtml:e.outerHTML,parentContext:(e.parentElement?.innerText||"").slice(0,150).trim(),componentPath:n,signature:p,source:t,attributes:i,fallbackSelectors:[...new Set(s)].slice(0,5),domPath:[],viewportSize:{width:window.innerWidth,height:window.innerHeight},uiContext:rn(e),fingerprint:Xr(e),metadata:{hint:`Edit ${t.split(":")[0]} at line ${t.split(":")[1]||"?"}`,computedStyles:Kr(e),viewportBreakpoint:Yr(),outerHtml:e.outerHTML.slice(0,1500),scrollPosition:{x:window.scrollX,y:window.scrollY},isModal:u}}},Et=()=>{const{addToast:e,language:t,t:r,apiKey:n,baseUrl:a,disableViewGate:s,hasActiveToasts:c}=nt(),[i,u]=m.useState(!1),[p,f]=m.useState(null),[g,_]=m.useState(null),[A,z]=m.useState(""),[$,oe]=m.useState(!1),[Re,je]=m.useState(!1),[I,B]=m.useState(!1),[T,Fe]=m.useState([]),[D,W]=m.useState(null),[_e,kt]=m.useState(!1),[me,ie]=m.useState(!1),[Oe,Ve]=m.useState({}),[L,Q]=m.useState(null),[te,fe]=m.useState(!1),[H,he]=m.useState(null),[d,y]=m.useState([]),b=m.useMemo(()=>{if(!L)return T;const l=d.find(x=>x.annotations.some(w=>w._id===L));return l?l.annotations:T.filter(x=>x._id===L)},[L,T,d]),[S,ce]=m.useState(()=>{if(typeof window>"u")return{top:24,right:24};const l=localStorage.getItem("vg-exit-pos");return l?JSON.parse(l):{top:24,right:24}}),[Y,k]=m.useState(!1),O=m.useRef(null),[U,We]=m.useState(()=>{if(typeof window>"u")return{bottom:30,right:30};const l=localStorage.getItem("vg-bar-pos");return l?JSON.parse(l):{bottom:30,right:30}}),[ge,Rt]=m.useState(!1),X=m.useRef(null),on=l=>{l.preventDefault(),l.stopPropagation();const x=l.currentTarget.parentElement?.getBoundingClientRect();x&&(k(!0),O.current={x:l.clientX,y:l.clientY,top:S.top,right:S.right,width:x.width,height:x.height})},cn=l=>{l.preventDefault(),l.stopPropagation();const x=l.currentTarget.parentElement?.getBoundingClientRect();x&&(Rt(!0),X.current={x:l.clientX,y:l.clientY,bottom:U.bottom,right:U.right,width:x.width,height:x.height})};m.useEffect(()=>{if(!Y&&!ge)return;const l=w=>{if(Y&&O.current){const E=w.clientX-O.current.x,R=w.clientY-O.current.y;let j=O.current.top+R,h=O.current.right-E;const v=10;j=Math.max(v,Math.min(window.innerHeight-O.current.height-v,j)),h=Math.max(v,Math.min(window.innerWidth-O.current.width-v,h)),ce({top:j,right:h})}if(ge&&X.current){const E=w.clientX-X.current.x,R=w.clientY-X.current.y;let j=X.current.bottom-R,h=X.current.right-E;const v=10;j=Math.max(v,Math.min(window.innerHeight-X.current.height-v,j)),h=Math.max(v,Math.min(window.innerWidth-X.current.width-v,h)),We({bottom:j,right:h})}},x=()=>{Y&&(k(!1),localStorage.setItem("vg-exit-pos",JSON.stringify(S)),O.current=null),ge&&(Rt(!1),localStorage.setItem("vg-bar-pos",JSON.stringify(U)),X.current=null)};return window.addEventListener("mousemove",l),window.addEventListener("mouseup",x),()=>{window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",x)}},[Y,ge,S,U]);const[jt,He]=m.useState(null),[_t,Ot]=m.useState(""),[kn,Rn]=m.useState({}),xe=m.useRef(null),ye=m.useRef(null),le=m.useCallback(()=>{ye.current||(ye.current=requestAnimationFrame(()=>{const l=new Map,x=new Set(T.map(h=>h._id));document.querySelectorAll(`[${F}]`).forEach(h=>{const v=h.getAttribute(F);v&&!x.has(v)&&h.removeAttribute(F)});const E=Array.from(document.querySelectorAll('[role="dialog"], [aria-modal="true"], .modal, .modal-content')).find(h=>qr(h)&&ee(h)),R=!!E;T.forEach(h=>{if(!h.reference)return;const v=tn(h.reference,h._id);if(!v||!ee(v))return;const G=!!h.reference.metadata?.isModal;let J=!1;if(R?J=E.contains(v):J=!G,!J)return;const Z=v.getAttribute(F);Z!==h._id&&(document.querySelectorAll(`[${F}="${h._id}"]`).forEach(C=>{C.removeAttribute(F)}),Z||v.setAttribute(F,h._id)),l.has(v)||l.set(v,[]),l.get(v).push(h)});const j=[];l.forEach((h,v)=>{const G=v.getBoundingClientRect(),J=G.left+G.width/2,Z=G.top+G.height/2;if(J>=0&&J<=window.innerWidth&&Z>=0&&Z<=window.innerHeight){const C=document.elementFromPoint(J,Z);if(C&&!v.contains(C)&&!xe.current?.contains(C))return}j.push({id:h[0]._id,element:v,rect:G,annotations:h.sort((C,q)=>new Date(q.timestamp||q.createdAt).getTime()-new Date(C.timestamp||C.createdAt).getTime()),isModal:!!h[0].reference?.metadata?.isModal})}),y(j),ye.current=null}))},[T]),re=m.useCallback(async()=>{if(n){ie(!0);try{const l=await fetch(`${a}/api/annotations`,{headers:{"x-api-key":n}});if(l.ok){const E=((await l.json()).data||[]).reduce((R,j)=>R.find(v=>v._id===j._id)?R:R.concat([j]),[]);Fe(E)}}catch(l){console.error("Failed to fetch annotations",l)}finally{ie(!1)}}},[n,a]);m.useEffect(()=>{I&&T.length===0&&!me&&B(!1)},[I,T.length,me]),m.useEffect(()=>{if(T.length===0){le();return}if(!i){le();const l=new MutationObserver(()=>le()),x=new ResizeObserver(()=>le()),w=()=>le();return l.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),x.observe(document.documentElement),window.addEventListener("scroll",w,!0),()=>{l.disconnect(),x.disconnect(),window.removeEventListener("scroll",w,!0),ye.current&&cancelAnimationFrame(ye.current)}}},[i,T.length,le]),m.useEffect(()=>{re()},[re]),m.useEffect(()=>{xe.current=document.getElementById("viewgate-shadow-host")},[]);const Ue=m.useCallback(l=>{if(!i||g)return;const x=Ct(l.clientX,l.clientY);if(!x||xe.current?.contains(x)||x.closest(".vg-no-capture")){f(null);return}const w=x.getBoundingClientRect();f({tag:x.tagName.toLowerCase(),source:x.getAttribute("data-source-path")||"unknown:0",rect:w,element:x,previewText:(x.innerText||"").slice(0,100)||(x.getAttribute("placeholder")||"").slice(0,100)||x.tagName.toLowerCase(),semanticReference:{...nn(x),normalizedOffset:{x:(l.clientX-w.left)/w.width,y:(l.clientY-w.top)/w.height}}})},[i,g]),$e=m.useCallback(async l=>{if(!i||g)return;const x=Ct(l.clientX,l.clientY);if(!(!x||xe.current?.contains(x)||x.closest(".vg-no-capture"))&&p){l.preventDefault(),l.stopPropagation(),je(!0);try{const R=await Hr(document.body,{pixelRatio:2,cacheBust:!0,width:window.innerWidth,height:window.innerHeight,backgroundColor:"#ffffff",filter:v=>{const G=v;return!(xe.current?.contains(G)||G.id==="viewgate-ui"||G.classList?.contains("vg-no-capture"))}}),j=await Zr(R,p.rect,32,2),h={...p.semanticReference,metadata:{...p.semanticReference.metadata,elementScreenshot:j}};_({...p,visualPreview:j,semanticReference:h})}catch(w){console.error("Failed to capture high-fidelity preview:",w),_(p)}finally{je(!1),f(null)}}},[i,p,g]);m.useEffect(()=>{const l=x=>{if(x.key==="Escape"){g?_(null):I?B(!1):i&&u(!1);return}const E=(()=>{let h=document.activeElement;for(;h&&h.shadowRoot&&h.shadowRoot.activeElement;)h=h.shadowRoot.activeElement;return h})();if(["input","textarea"].includes((E?.tagName||"").toLowerCase())||E?.isContentEditable)return;const j=x.key.toLowerCase();j==="c"&&!g&&!I&&u(h=>!h),j==="v"&&!g&&(T.length>0||I)&&(B(h=>!h),I||u(!1))};return i&&!g?document.body.classList.add("vg-cursor-pointer"):document.body.classList.remove("vg-cursor-pointer"),window.addEventListener("keydown",l),window.addEventListener("mousemove",Ue,!0),window.addEventListener("click",$e,!0),()=>{document.body.classList.remove("vg-cursor-pointer"),window.removeEventListener("keydown",l),window.removeEventListener("mousemove",Ue,!0),window.removeEventListener("click",$e,!0)}},[i,g,I,T,Ue,$e]);const ln=async()=>{if(!g||!A.trim())return;oe(!0);const{semanticReference:l}=g,[x,w]=(l.source||"").split(":"),E=w||"0";try{if(!(await fetch(`${a}/api/annotations`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({filePath:x,line:parseInt(E),url:window.location.href,message:A,componentName:l.componentPath||g.tag,reference:{...l,viewport:{width:window.innerWidth,height:window.innerHeight},userAgent:navigator.userAgent,timestamp:new Date().toISOString()}})})).ok)throw new Error("Backend failed");e(r.success,"success"),_(null),z(""),u(!1),re()}catch(R){console.error(R),e(r.error,"error")}finally{oe(!1)}};return o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1275",className:"vg-container",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1276",className:"vg-no-capture",children:[!c&&o.jsxs("div",{style:{position:"fixed",top:`${S.top}px`,right:`${S.right}px`,zIndex:Ie+10,display:"flex",alignItems:"center",gap:"8px",transition:Y?"none":"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:[o.jsx("div",{onMouseDown:on,style:{width:"20px",height:"32px",borderRadius:"6px",backgroundColor:"rgba(255, 255, 255, 0.85)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"#1e293b",opacity:i?0:1,visibility:i?"hidden":"visible",transition:"all 0.2s",border:"1px solid rgba(0,0,0,0.1)",boxShadow:"0 2px 8px rgba(0,0,0,0.05)"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor="white",l.currentTarget.style.color="#000000"},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.85)",l.currentTarget.style.color="#1e293b"},children:o.jsx(et,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1320",size:14})}),o.jsx("button",{onClick:l=>{l.stopPropagation(),W({title:r.exitConfirmTitle||"Close ViewGate?",message:r.exitConfirmMessage||"Are you sure you want to close ViewGate?",type:"danger",onConfirm:()=>s()})},title:"Cerrar ViewGate",style:{width:"40px",height:"40px",borderRadius:"12px",backgroundColor:"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid rgba(0,0,0,0.05)",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",cursor:"pointer",color:"#64748b",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},onMouseEnter:l=>{l.currentTarget.style.transform="scale(1.1) rotate(90deg)",l.currentTarget.style.color="#ef4444",l.currentTarget.style.backgroundColor="white"},onMouseLeave:l=>{l.currentTarget.style.transform="scale(1) rotate(0deg)",l.currentTarget.style.color="#64748b",l.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.9)"},children:o.jsx(Te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1360",size:20,strokeWidth:2.5})})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1366",style:{position:"fixed",bottom:`${U.bottom}px`,right:`${U.right}px`,zIndex:Ie,display:"flex",alignItems:"center",gap:"8px",transition:ge?"none":"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)"},id:"viewgate-ui",children:[o.jsx("div",{onMouseDown:cn,style:{width:"24px",height:"40px",borderRadius:"10px",backgroundColor:"rgba(255, 255, 255, 0.85)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"#1e293b",opacity:i?0:1,visibility:i?"hidden":"visible",transition:"all 0.2s",border:"1px solid rgba(0,0,0,0.1)",boxShadow:"0 2px 8px rgba(0,0,0,0.05)"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor="white",l.currentTarget.style.color="#000000"},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.85)",l.currentTarget.style.color="#1e293b"},className:"vg-animate-slide-up",children:o.jsx(et,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1409",size:16})}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1412",className:"vg-action-bar vg-animate-slide-up",style:{transition:"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)"},children:[o.jsx("button",{onClick:()=>u(!i),className:"vg-button-primary vg-animate-pop",style:{padding:"12px 24px",background:i?"#ef4444":void 0},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1421",style:{display:"flex",alignItems:"center",gap:"10px"},children:[i?o.jsx(Te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1422",size:20,className:"vg-animate-pop"}):o.jsx(ve,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1422",size:20,className:"vg-animate-pop"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1423",children:i?r.exitMode:r.enterMode})]})}),T.length>0&&o.jsxs("button",{onClick:()=>{B(!I),u(!1),_(null)},className:"vg-button-ghost vg-animate-pop",style:{animationDelay:"0.1s"},children:[o.jsx(Ft,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1436",size:20}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1437",children:r.viewComments})]})]})]}),Re&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1445",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(255,255,255,0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Ie+1,cursor:"wait"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1451",className:"vg-glassmorphism",style:{padding:"30px 50px",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1452",className:"vg-spinner"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1453",style:{fontWeight:600,fontSize:"14px",color:"#000000"},children:"Capturando..."})]})}),i&&!g&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1460",className:"vg-backdrop-blur",style:{opacity:1,clipPath:p?`polygon(
7
+ <%s key={someKey} {...props} />`,S,k,A,k),ge[k+S]=!0)}if(k=null,b!==void 0&&(r(b),k=""+b),c(y)&&(r(y.key),k=""+y.key),"key"in y){b={};for(var $ in y)$!=="key"&&(b[$]=y[$])}else b=y;return k&&i(b,typeof d=="function"?d.displayName||d.name||"Unknown":d),p(d,k,b,a(),ce,J)}function h(d){O(d)?d._store&&(d._store.validated=1):typeof d=="object"&&d!==null&&d.$$typeof===Ve&&(d._payload.status==="fulfilled"?O(d._payload.value)&&d._payload.value._store&&(d._payload.value._store.validated=1):d._store&&(d._store.validated=1))}function O(d){return typeof d=="object"&&d!==null&&d.$$typeof===D}var G=m,D=Symbol.for("react.transitional.element"),Y=Symbol.for("react.portal"),oe=Symbol.for("react.fragment"),je=Symbol.for("react.strict_mode"),_e=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),X=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),Oe=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),Ve=Symbol.for("react.lazy"),kt=Symbol.for("react.activity"),fe=Symbol.for("react.client.reference"),ie=G.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ae=Object.prototype.hasOwnProperty,Te=Array.isArray,z=console.createTask?console.createTask:function(){return null};G={react_stack_bottom_frame:function(d){return d()}};var q,te={},he=G.react_stack_bottom_frame.bind(G,s)(),U=z(n(s)),ge={};pe.Fragment=oe,pe.jsx=function(d,y,b){var S=1e4>ie.recentlyCreatedOwnerStacks++;return f(d,y,b,!1,S?Error("react-stack-top-frame"):he,S?z(n(d)):U)},pe.jsxs=function(d,y,b){var S=1e4>ie.recentlyCreatedOwnerStacks++;return f(d,y,b,!0,S?Error("react-stack-top-frame"):he,S?z(n(d)):U)}})()),pe}var Je;function Pt(){return Je||(Je=1,process.env.NODE_ENV==="production"?ve.exports=At():ve.exports=Tt()),ve.exports}var o=Pt();const Gt=({children:e})=>{const t=m.useRef(null),[r,n]=m.useState(null);return m.useEffect(()=>{if(t.current&&!t.current.shadowRoot){const a=t.current.attachShadow({mode:"open"});document.querySelectorAll("style[data-vite-dev-id], style:not([data-vite-dev-id])").forEach(i=>{(i.textContent?.includes(".vg-")||i.textContent?.includes("--vg-"))&&a.appendChild(i.cloneNode(!0))});const c=document.createElement("link");c.rel="stylesheet",c.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap",a.appendChild(c),n(a)}},[]),o.jsx("div",{"data-source-path":"/src/components/ShadowRootWrapper.tsx:38",ref:t,id:"viewgate-shadow-host",children:r&&Vt.createPortal(e,r)})};const Ze=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();const Nt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Mt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase());const Ke=e=>{const t=Mt(e);return t.charAt(0).toUpperCase()+t.slice(1)};var It={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Lt=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const zt=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:s,iconNode:c,...i},u)=>m.createElement("svg",{ref:u,...It,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Ze("lucide",a),...!s&&!Lt(i)&&{"aria-hidden":"true"},...i},[...c.map(([p,f])=>m.createElement(p,f)),...Array.isArray(s)?s:[s]]));const T=(e,t)=>{const r=m.forwardRef(({className:n,...a},s)=>m.createElement(zt,{ref:s,iconNode:t,className:Ze(`lucide-${Nt(Ke(e))}`,`lucide-${e}`,n),...a}));return r.displayName=Ke(e),r};const Dt=T("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const ne=T("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Qe=T("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);const qe=T("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const Ft=T("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const Wt=T("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const et=T("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);const Ht=T("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const be=T("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);const Ut=T("mouse-pointer-2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]);const $t=T("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const Bt=T("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const Yt=T("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const tt=T("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const Pe=T("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Xt={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:"Delete comment",markReady:"Mark as Ready",reopen:"Reopen",review:"Review",confirmDelete:"Are you sure you want to permanently delete this comment? This action cannot be undone.",markReadyConfirm:"Complete review",confirmMarkReady:"Do you want to mark this comment as ready? it will be moved to the completed state.",reopenConfirm:"Reopen comment",confirmReopen:"Do you want to set this comment back to pending status?",yes:"Yes, confirm",no:"No, cancel",deleteSuccess:"Comment deleted successfully.",updateSuccess:"Updated successfully.",navigating:"Redirecting to review...",selectToComment:"Click to comment",feedbackSubheader:"What would you like to improve here?",sendFeedback:"Send Comment",edit:"Edit",save:"Save",commentDetails:"Comment Details",annotations:"Comments",viewAll:"View All",exitConfirmTitle:"Close ViewGate?",exitConfirmMessage:"Are you sure you want to close ViewGate? You can reopen it at any time by adding ?viewgate=true to your URL."},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:"Eliminar comentario",markReady:"Marcar como Listo",reopen:"Reabrir",review:"Revisar",confirmDelete:"¿Estás seguro de que deseas eliminar permanentemente este comentario? Esta acción no se puede deshacer.",markReadyConfirm:"Finalizar revisión",confirmMarkReady:"¿Deseas marcar este comentario como listo? Pasará al estado completado.",reopenConfirm:"Reabrir comentario",confirmReopen:"¿Deseas volver a poner este comentario en estado pendiente?",yes:"Sí, confirmar",no:"No, cancelar",deleteSuccess:"El comentario ha sido eliminado.",updateSuccess:"Actualizado correctamente.",navigating:"Redirigiendo a revisión...",selectToComment:"Haz clic para comentar",feedbackSubheader:"¿Qué te gustaría mejorar aquí?",sendFeedback:"Enviar Comentario",edit:"Editar",save:"Guardar",commentDetails:"Detalles del Comentario",annotations:"Comentarios",viewAll:"Ver Todos",exitConfirmTitle:"¿Cerrar ViewGate?",exitConfirmMessage:"¿Estás seguro de que deseas cerrar ViewGate? Puedes volver a activarlo en cualquier momento agregando ?viewgate=true a la URL."}},rt=m.createContext(void 0),nt=()=>{const e=m.useContext(rt);if(!e)throw new Error("useViewGate must be used within a ViewGateProvider");return e},Ge="viewgate_enabled",Jt=()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).has("viewgate")?(sessionStorage.setItem(Ge,"true"),!0):sessionStorage.getItem(Ge)==="true",Zt=({children:e,language:t="es",apiKey:r,baseUrl:n="https://view-gate.vercel.app"})=>{const[a,s]=m.useState(!1),[c,i]=m.useState([]);m.useEffect(()=>{s(Jt())},[]);const u=()=>{if(sessionStorage.removeItem(Ge),s(!1),typeof window<"u"){const h=new URL(window.location.href);h.searchParams.delete("viewgate"),window.history.replaceState({},"",h.toString())}},p=(h,O)=>{const G=Date.now();i(D=>[...D,{id:G,message:h,type:O}]),setTimeout(()=>{i(D=>D.filter(Y=>Y.id!==G))},4e3)},f=Xt[t];return o.jsxs(rt.Provider,{"data-source-path":"/src/components/ViewGateProvider.tsx:252",value:{addToast:p,language:t,t:f,apiKey:r,baseUrl:n,disableViewGate:u,hasActiveToasts:c.length>0},children:[e,a&&o.jsx(Gt,{"data-source-path":"/src/components/ViewGateProvider.tsx:263",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:264",className:"vg-container",children:[o.jsx(Et,{"data-source-path":"/src/components/ViewGateProvider.tsx:265"}),o.jsx("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:266",className:"vg-toasts",style:{zIndex:2147483646},children:c.map(h=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:268",className:`vg-toast vg-animate-slide ${h.type}`,children:[h.type==="success"?o.jsx(ne,{"data-source-path":"/src/components/ViewGateProvider.tsx:270",size:24,color:"#22c55e"}):o.jsx(Dt,{"data-source-path":"/src/components/ViewGateProvider.tsx:272",size:24,color:"#ef4444"}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:274",children:[o.jsx("strong",{"data-source-path":"/src/components/ViewGateProvider.tsx:275",style:{display:"block",fontSize:"13px",color:"#0f172a",textTransform:"uppercase",marginBottom:"2px"},children:h.type==="success"?f.successHeader:f.errorHeader}),o.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:278",style:{fontSize:"14px",color:"#000000"},children:h.message})]})]},h.id))})]})})]})};function Kt(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 Qt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Q(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let ae=null;function at(e={}){return ae||(e.includeStyleProperties?(ae=e.includeStyleProperties,ae):(ae=Q(window.getComputedStyle(document.documentElement)),ae))}function Se(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function qt(e){const t=Se(e,"border-left-width"),r=Se(e,"border-right-width");return e.clientWidth+t+r}function er(e){const t=Se(e,"border-top-width"),r=Se(e,"border-bottom-width");return e.clientHeight+t+r}function st(e,t={}){const r=t.width||qt(e),n=t.height||er(e);return{width:r,height:n}}function tr(){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 I=16384;function rr(e){(e.width>I||e.height>I)&&(e.width>I&&e.height>I?e.width>e.height?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I):e.width>I?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I))}function Ce(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 nr(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function ar(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),nr(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function sr(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function or(e,t){return at(t).map(r=>{const n=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${n}${a?" !important":""};`}).join(" ")}function ir(e,t,r,n){const a=`.${e}:${t}`,s=r.cssText?sr(r):or(r,n);return document.createTextNode(`${a}{${s}}`)}function ot(e,t,r,n){const a=window.getComputedStyle(e,r),s=a.getPropertyValue("content");if(s===""||s==="none")return;const c=Qt();try{t.className=`${t.className} ${c}`}catch{return}const i=document.createElement("style");i.appendChild(ir(c,r,a,n)),t.appendChild(i)}function cr(e,t,r){ot(e,t,":before",r),ot(e,t,":after",r)}const it="application/font-woff",ct="image/jpeg",lr={woff:it,woff2:it,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:ct,jpeg:ct,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function dr(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ne(e){const t=dr(e).toLowerCase();return lr[t]||""}function ur(e){return e.split(/,/)[1]}function Me(e){return e.search(/^(data:)/)!==-1}function pr(e,t){return`data:${t};base64,${e}`}async function lt(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,c)=>{const i=new FileReader;i.onerror=c,i.onloadend=()=>{try{s(r({res:n,result:i.result}))}catch(u){c(u)}},i.readAsDataURL(a)})}const Ie={};function mr(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 Le(e,t,r){const n=mr(e,t,r.includeQueryParams);if(Ie[n]!=null)return Ie[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const s=await lt(e,r.fetchRequestInit,({res:c,result:i})=>(t||(t=c.headers.get("Content-Type")||""),ur(i)));a=pr(s,t)}catch(s){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;s&&(c=typeof s=="string"?s:s.message),c&&console.warn(c)}return Ie[n]=a,a}async function fr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ce(t)}async function hr(e,t){if(e.currentSrc){const s=document.createElement("canvas"),c=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,c?.drawImage(e,0,0,s.width,s.height);const i=s.toDataURL();return Ce(i)}const r=e.poster,n=Ne(r),a=await Le(r,n,t);return Ce(a)}async function gr(e,t){var r;try{if(!((r=e?.contentDocument)===null||r===void 0)&&r.body)return await Ee(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function xr(e,t){return P(e,HTMLCanvasElement)?fr(e):P(e,HTMLVideoElement)?hr(e,t):P(e,HTMLIFrameElement)?gr(e,t):e.cloneNode(dt(e))}const yr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",dt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function wr(e,t,r){var n,a;if(dt(t))return t;let s=[];return yr(e)&&e.assignedNodes?s=Q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?s=Q(e.contentDocument.body.childNodes):s=Q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),s.length===0||P(e,HTMLVideoElement)||await s.reduce((c,i)=>c.then(()=>Ee(i,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function vr(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):at(r).forEach(s=>{let c=a.getPropertyValue(s);s==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&s==="display"&&c==="inline"&&(c="block"),s==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),n.setProperty(s,c,a.getPropertyPriority(s))})}function br(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Sr(e,t){if(P(e,HTMLSelectElement)){const n=Array.from(t.children).find(a=>e.value===a.getAttribute("value"));n&&n.setAttribute("selected","")}}function Cr(e,t,r){return P(t,Element)&&(vr(e,t,r),cr(e,t,r),br(e,t),Sr(e,t)),t}async function Er(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 i=r[s].getAttribute("xlink:href");if(i){const u=e.querySelector(i),p=document.querySelector(i);!u&&p&&!n[i]&&(n[i]=await Ee(p,t,!0))}}const a=Object.values(n);if(a.length){const s="http://www.w3.org/1999/xhtml",c=document.createElementNS(s,"svg");c.setAttribute("xmlns",s),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const i=document.createElementNS(s,"defs");c.appendChild(i);for(let u=0;u<a.length;u++)i.appendChild(a[u]);e.appendChild(c)}return e}async function Ee(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>xr(n,t)).then(n=>wr(e,n,t)).then(n=>Cr(e,n,t)).then(n=>Er(n,t))}const ut=/url\((['"]?)([^'"]+?)\1\)/g,kr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Rr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function jr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function _r(e){const t=[];return e.replace(ut,(r,n,a)=>(t.push(a),r)),t.filter(r=>!Me(r))}async function Or(e,t,r,n,a){try{const s=r?Kt(t,r):t,c=Ne(t);let i;return a||(i=await Le(s,c,n)),e.replace(jr(t),`$1${i}$3`)}catch{}return e}function Vr(e,{preferredFontFormat:t}){return t?e.replace(Rr,r=>{for(;;){const[n,,a]=kr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${n};`}}):e}function pt(e){return e.search(ut)!==-1}async function mt(e,t,r){if(!pt(e))return e;const n=Vr(e,r);return _r(n).reduce((s,c)=>s.then(i=>Or(i,c,t,r)),Promise.resolve(n))}async function se(e,t,r){var n;const a=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(a){const s=await mt(a,null,r);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function Ar(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function Tr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Me(e.src))&&!(P(e,SVGImageElement)&&!Me(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,a=await Le(n,Ne(n),t);await new Promise((s,c)=>{e.onload=s,e.onerror=t.onImageErrorHandler?(...u)=>{try{s(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const i=e;i.decode&&(i.decode=s),i.loading==="lazy"&&(i.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function Pr(e,t){const n=Q(e.childNodes).map(a=>ft(a,t));await Promise.all(n).then(()=>e)}async function ft(e,t){P(e,Element)&&(await Ar(e,t),await Tr(e,t),await Pr(e,t))}function Gr(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 ht={};async function gt(e){let t=ht[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},ht[e]=t,t}async function xt(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,s=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let i=c.replace(n,"$1");return i.startsWith("https://")||(i=new URL(i,e.url).href),lt(i,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(s).then(()=>r)}function yt(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,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",i=new RegExp(c,"gi");for(;;){let u=s.exec(n);if(u===null){if(u=i.exec(n),u===null)break;s.lastIndex=i.lastIndex}else i.lastIndex=s.lastIndex;t.push(u[0])}return t}async function Nr(e,t){const r=[],n=[];return e.forEach(a=>{if("cssRules"in a)try{Q(a.cssRules||[]).forEach((s,c)=>{if(s.type===CSSRule.IMPORT_RULE){let i=c+1;const u=s.href,p=gt(u).then(f=>xt(f,t)).then(f=>yt(f).forEach(h=>{try{a.insertRule(h,h.startsWith("@import")?i+=1:a.cssRules.length)}catch(O){console.error("Error inserting rule from remote css",{rule:h,error:O})}})).catch(f=>{console.error("Error loading remote css",f.toString())});n.push(p)}})}catch(s){const c=e.find(i=>i.href==null)||document.styleSheets[0];a.href!=null&&n.push(gt(a.href).then(i=>xt(i,t)).then(i=>yt(i).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(i=>{console.error("Error loading remote stylesheet",i)})),console.error("Error inlining remote css file",s)}}),Promise.all(n).then(()=>(e.forEach(a=>{if("cssRules"in a)try{Q(a.cssRules||[]).forEach(s=>{r.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${a.href}`,s)}}),r))}function Mr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function Ir(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Q(e.ownerDocument.styleSheets),n=await Nr(r,t);return Mr(n)}function wt(e){return e.trim().replace(/["']/g,"")}function Lr(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(s=>{t.add(wt(s))}),Array.from(n.children).forEach(s=>{s instanceof HTMLElement&&r(s)})}return r(e),t}async function zr(e,t){const r=await Ir(e,t),n=Lr(e);return(await Promise.all(r.filter(s=>n.has(wt(s.style.fontFamily))).map(s=>{const c=s.parentStyleSheet?s.parentStyleSheet.href:null;return mt(s.cssText,c,t)}))).join(`
8
+ `)}async function Dr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await zr(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 Fr(e,t={}){const{width:r,height:n}=st(e,t),a=await Ee(e,t,!0);return await Dr(a,t),await ft(a,t),Gr(a,t),await ar(a,r,n)}async function Wr(e,t={}){const{width:r,height:n}=st(e,t),a=await Fr(e,t),s=await Ce(a),c=document.createElement("canvas"),i=c.getContext("2d"),u=t.pixelRatio||tr(),p=t.canvasWidth||r,f=t.canvasHeight||n;return c.width=p*u,c.height=f*u,t.skipAutoScale||rr(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(i.fillStyle=t.backgroundColor,i.fillRect(0,0,c.width,c.height)),i.drawImage(s,0,0,c.width,c.height),c}async function Hr(e,t={}){return(await Wr(e,t)).toDataURL()}const ke=2147483647,ze=ke,De=2e6,Ur=ke-10,$r=ke-5,Br=ke-15,W="data-vg-pin-id",Yr=()=>{const e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"},vt=(e,t)=>{if(!e)return"";try{const r=new Date(e);return isNaN(r.getTime())?"":new Intl.DateTimeFormat(t==="es"?"es-ES":"en-US",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(r)}catch{return""}},bt=({url:e,className:t,style:r,tooltipStyle:n,onHover:a})=>{const s=m.useRef(null),c=()=>{if(!s.current||!a)return;const i=s.current.getBoundingClientRect(),u=i.top,p=window.innerHeight-i.bottom,f=u<140&&p>u?"bottom":"top";a({url:e,x:i.left+i.width/2,y:f==="top"?i.top:i.bottom,direction:f})};return o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:106",ref:s,className:`vg-url-tag ${t||""}`,style:r,onMouseEnter:c,onMouseMove:c,onMouseLeave:()=>a?.(null),children:[o.jsx(Wt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:114",size:r?.fontSize?parseInt(r.fontSize)+1:10}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:115",style:{maxWidth:r?.maxWidth||"150px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:new URL(e).pathname})]})},me=e=>{const t=[],r=[],n=[];let a=e;for(;a&&a.nodeType===Node.ELEMENT_NODE;){if(a.id&&!a.id.startsWith("vg-")&&!a.id.includes(":")){t.unshift(`#${a.id}`),n.unshift(`${a.localName}#${a.id}`);break}let s=a.localName;const c=Array.from(a.parentNode?.children||[]).indexOf(a),i=`${a.localName}[${c}]`;n.unshift(i);const u=a.getAttribute("data-testid")||a.getAttribute("data-qa");if(u&&r.push(`[data-testid="${u}"]`),a.getAttribute("placeholder"),a.getAttribute("aria-label"),a.getAttribute("role"),a.getAttribute("name"),a.getAttribute("title"),u){s=`[${a.hasAttribute("data-testid")?"data-testid":"data-qa"}="${u}"]`,t.unshift(s);break}const p=Array.from(a.parentNode?.children||[]).filter(f=>f.localName===a?.localName);if(p.length>1){const f=p.indexOf(a)+1;s+=`:nth-of-type(${f})`}t.unshift(s),a=a.parentElement}return{selector:t.join(" > "),fallbacks:r,vgPath:n.join(" > ")}},Xr=e=>{const{vgPath:t}=me(e);return{vgPath:t,classHash:e.className,parentTag:e.parentElement?.tagName.toLowerCase(),neighborCount:e.parentElement?.children.length,ariaLabel:e.getAttribute("aria-label")||void 0,role:e.getAttribute("role")||void 0,name:e.getAttribute("name")||void 0,type:e.getAttribute("type")||void 0,placeholder:e.getAttribute("placeholder")||void 0,textSnippet:(e.innerText||"").slice(0,30).trim()}},Jr=(()=>{let e=null,t=null;return r=>{if(!r||typeof window>"u"||typeof document>"u")return r;if(r.includes("oklch")||r.includes("oklab")||r.includes("lab(")||r.includes("lch(")||r.includes("color("))try{if(e||(e=document.createElement("canvas"),e.width=1,e.height=1),t||(t=e.getContext("2d",{willReadFrequently:!0})),t){t.fillStyle="#000000",t.fillStyle=r;const s=t.fillStyle;if(s&&!s.includes("oklch")&&!s.includes("oklab"))return s}const n=document.createElement("div");n.style.color=r,document.body.appendChild(n);const a=getComputedStyle(n).color;return document.body.removeChild(n),a&&!a.includes("oklch")?a:"rgb(0,0,0)"}catch{return"rgb(0,0,0)"}return r}})(),Zr=(e,t,r,n)=>new Promise(a=>{const s=new Image;s.onload=()=>{const c=document.createElement("canvas"),i=2,u=t.width+r*2,p=t.height+r*2;c.width=u*i,c.height=p*i;const f=c.getContext("2d");if(f){f.imageSmoothingEnabled=!0,f.imageSmoothingQuality="high";const h=(t.left-r)*n,O=(t.top-r)*n,G=u*n,D=p*n;f.drawImage(s,h,O,G,D,0,0,c.width,c.height)}a(c.toDataURL("image/png",.9))},s.onerror=()=>a(""),s.src=e}),Kr=e=>{const t=window.getComputedStyle(e),r={};return["display","position","margin","padding","font-size","color","background-color","width","height","z-index"].forEach(a=>{const s=t.getPropertyValue(a);r[a]=Jr(s)}),r},Qr=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 c=s.displayName||s.name;c&&!c.includes("ViewGate")&&!n.includes(c)&&n.unshift(c)}a=a.return}return n.join(" > ")||"Generic Component"},qr=e=>{if(!e)return!1;const t=window.getComputedStyle(e),r=e.getBoundingClientRect(),n=e.getAttribute("role");if(n&&["listbox","menu","combobox","tooltip","option"].includes(n))return!1;const s=120;return r.width<s&&r.height<s||t.position!=="fixed"&&t.position!=="absolute"?!1:!!(e.closest('[role="dialog"]')||e.closest('[aria-modal="true"]')||e.classList.contains("modal")||e.classList.contains("modal-content"))},ee=e=>{if(!e.isConnected)return!1;const t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden"||t.opacity==="0"||e.offsetWidth===0||e.offsetHeight===0)return!1;let r=e.parentElement;for(;r;){const a=window.getComputedStyle(r);if(a.display==="none"||a.visibility==="hidden"||a.opacity==="0")return!1;r=r.parentElement}const n=e.getBoundingClientRect();return!(n.width===0||n.height===0||n.top===0&&n.left===0&&n.width>window.innerWidth*.9)},St=(e,t=document)=>{const r=t.querySelector(e);if(r)return r;const n=t.querySelectorAll("*");for(const a of Array.from(n)){const s=a.shadowRoot;if(s){const c=St(e,s);if(c)return c}}return null},Ct=(e,t)=>{let r=document.elementFromPoint(e,t);for(;r&&r.shadowRoot;){const n=r.shadowRoot.elementFromPoint(e,t);if(!n||n===r)break;r=n}return r},en=e=>{if(!e.tag)return null;const t=Array.from(document.getElementsByTagName(e.tag));let r=null,n=0;for(const a of t){if(!Re(a,e))continue;let s=0;const c=a.getAttribute("placeholder"),i=e.attributes?.placeholder||e.fingerprint?.placeholder;i&&c===i&&(s+=6);const u=a.getAttribute("type"),p=e.attributes?.type||e.fingerprint?.type;if(p&&u===p&&(s+=2),a.innerText?.trim()===e.text.trim()&&(s+=5),e.fingerprint?.vgPath){const{vgPath:f}=me(a);(f===e.vgPath||e.fingerprint?.vgPath===f)&&(s+=10)}s>n&&s>=7&&(n=s,r=a)}return r},Re=(e,t)=>{if(e.tagName.toLowerCase()!==t.tag.toLowerCase())return!1;const r=e.getAttribute("placeholder"),n=t.attributes?.placeholder||t.fingerprint?.placeholder;if(n&&r&&n!==r)return!1;const a=e.getAttribute("type"),s=t.attributes?.type||t.fingerprint?.type;return!(s&&a&&s!==a)},tn=(e,t)=>{if(t){const c=Array.from(document.querySelectorAll(`[${W}="${t}"]`));if(c.length>0){const i=c.filter(u=>Re(u,e));if(i.length===0)c.forEach(u=>u.removeAttribute(W));else{const u=i.find(f=>{const{vgPath:h}=me(f);return h===e.vgPath||e.fingerprint?.vgPath===h}),p=u&&ee(u)?u:i.find(f=>!(!ee(f)||e.metadata?.isModal&&!f.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')));return p?(c.forEach(f=>{f!==p&&f.removeAttribute(W)}),p):null}}}const n=(e.selector?Array.from(document.querySelectorAll(e.selector)):[]).filter(c=>Re(c,e));let a=n.find(c=>{const{vgPath:i}=me(c);return i===e.vgPath||e.fingerprint?.vgPath===i})||n[0]||null;if(a&&ee(a))if(e.metadata?.isModal&&!a.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))a=null;else return a;if(e.fallbackSelectors)for(const c of e.fallbackSelectors){const i=St(c);if(i&&Re(i,e)&&ee(i)){if(e.metadata?.isModal&&!i.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))continue;return i}}const s=en(e);return s&&ee(s)?e.metadata?.isModal&&!s.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')?null:s:null},Fe=e=>({tag:e.tagName.toLowerCase(),text:(e.innerText||e.getAttribute("placeholder")||"").slice(0,50).trim(),role:e.getAttribute("role")||void 0,type:e.getAttribute("type")||void 0}),rn=e=>{const t=e.parentElement;if(!t)return;const r=Array.from(t.children).filter(c=>c!==e).slice(0,5).map(c=>Fe(c)),n=Array.from(t.children),a=n.indexOf(e);let s="middle";return a===0&&(s="start"),a===n.length-1&&(s="end"),{target:{...Fe(e),location:`${s} of ${t.tagName.toLowerCase()}`},parent:Fe(t),siblings:r}},nn=e=>{let t="unknown:0",r=e;for(;r;){const f=r.getAttribute("data-source-path");if(f){t=f;break}r=r.parentElement}const n=Qr(e),{selector:a,fallbacks:s,vgPath:c}=me(e),i={};["placeholder","aria-label","name","type","alt","title","value","role"].forEach(f=>{const h=e.getAttribute(f);h&&(i[f]=h)});const u=!!e.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'),p=`${e.tagName.toLowerCase()}-${(e.innerText||"").slice(0,20).replace(/\s+/g,"_")}-${a.split(" > ").slice(-1)}`;return{tag:e.tagName.toLowerCase(),id:e.id||"",classes:e.className||"",text:(e.innerText||"").slice(0,100).trim(),selector:a,vgPath:c,outerHtml:e.outerHTML,parentContext:(e.parentElement?.innerText||"").slice(0,150).trim(),componentPath:n,signature:p,source:t,attributes:i,fallbackSelectors:[...new Set(s)].slice(0,5),domPath:[],viewportSize:{width:window.innerWidth,height:window.innerHeight},uiContext:rn(e),fingerprint:Xr(e),metadata:{hint:`Edit ${t.split(":")[0]} at line ${t.split(":")[1]||"?"}`,computedStyles:Kr(e),viewportBreakpoint:Yr(),outerHtml:e.outerHTML.slice(0,1500),scrollPosition:{x:window.scrollX,y:window.scrollY},isModal:u}}},Et=()=>{const{addToast:e,language:t,t:r,apiKey:n,baseUrl:a,disableViewGate:s,hasActiveToasts:c}=nt(),[i,u]=m.useState(!1),[p,f]=m.useState(null),[h,O]=m.useState(null),[G,D]=m.useState(""),[Y,oe]=m.useState(!1),[je,_e]=m.useState(!1),[L,X]=m.useState(!1),[V,Oe]=m.useState([]),[F,H]=m.useState(null),[Ve,kt]=m.useState(!1),[fe,ie]=m.useState(!1),[Ae,Te]=m.useState({}),[z,q]=m.useState(null),[te,he]=m.useState(!1),[U,ge]=m.useState(null),[d,y]=m.useState([]),b=m.useMemo(()=>{const l=Array.isArray(V)?V:[];if(!z)return l;const g=d.find(x=>x.annotations&&Array.isArray(x.annotations)&&x.annotations.some(E=>E._id===z));return g?g.annotations:l.filter(x=>x._id===z)},[z,V,d]),[S,ce]=m.useState(()=>{if(typeof window>"u")return{top:24,right:24};const l=localStorage.getItem("vg-exit-pos");return l?JSON.parse(l):{top:24,right:24}}),[J,k]=m.useState(!1),A=m.useRef(null),[$,He]=m.useState(()=>{if(typeof window>"u")return{bottom:30,right:30};const l=localStorage.getItem("vg-bar-pos");return l?JSON.parse(l):{bottom:30,right:30}}),[xe,Rt]=m.useState(!1),Z=m.useRef(null),on=l=>{l.preventDefault(),l.stopPropagation();const g=l.currentTarget.parentElement?.getBoundingClientRect();g&&(k(!0),A.current={x:l.clientX,y:l.clientY,top:S.top,right:S.right,width:g.width,height:g.height})},cn=l=>{l.preventDefault(),l.stopPropagation();const g=l.currentTarget.parentElement?.getBoundingClientRect();g&&(Rt(!0),Z.current={x:l.clientX,y:l.clientY,bottom:$.bottom,right:$.right,width:g.width,height:g.height})};m.useEffect(()=>{if(!J&&!xe)return;const l=x=>{if(J&&A.current){const E=x.clientX-A.current.x,R=x.clientY-A.current.y;let _=A.current.top+R,v=A.current.right-E;const w=10;_=Math.max(w,Math.min(window.innerHeight-A.current.height-w,_)),v=Math.max(w,Math.min(window.innerWidth-A.current.width-w,v)),ce({top:_,right:v})}if(xe&&Z.current){const E=x.clientX-Z.current.x,R=x.clientY-Z.current.y;let _=Z.current.bottom-R,v=Z.current.right-E;const w=10;_=Math.max(w,Math.min(window.innerHeight-Z.current.height-w,_)),v=Math.max(w,Math.min(window.innerWidth-Z.current.width-w,v)),He({bottom:_,right:v})}},g=()=>{J&&(k(!1),localStorage.setItem("vg-exit-pos",JSON.stringify(S)),A.current=null),xe&&(Rt(!1),localStorage.setItem("vg-bar-pos",JSON.stringify($)),Z.current=null)};return window.addEventListener("mousemove",l),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",g)}},[J,xe,S,$]);const[jt,Ue]=m.useState(null),[_t,Ot]=m.useState(""),[kn,Rn]=m.useState({}),ye=m.useRef(null),we=m.useRef(null),le=m.useCallback(()=>{we.current||(we.current=requestAnimationFrame(()=>{const l=new Map,g=Array.isArray(V)?V:[],x=new Set(g.map(w=>w._id));document.querySelectorAll(`[${W}]`).forEach(w=>{const j=w.getAttribute(W);j&&!x.has(j)&&w.removeAttribute(W)});const R=Array.from(document.querySelectorAll('[role="dialog"], [aria-modal="true"], .modal, .modal-content')).find(w=>qr(w)&&ee(w)),_=!!R;V.forEach(w=>{if(!w.reference)return;const j=tn(w.reference,w._id);if(!j||!ee(j))return;const K=!!w.reference.metadata?.isModal;let B=!1;if(_?B=R.contains(j):B=!K,!B)return;const C=j.getAttribute(W);C!==w._id&&(document.querySelectorAll(`[${W}="${w._id}"]`).forEach(N=>{N.removeAttribute(W)}),C||j.setAttribute(W,w._id)),l.has(j)||l.set(j,[]),l.get(j).push(w)});const v=[];l.forEach((w,j)=>{const K=j.getBoundingClientRect(),B=K.left+K.width/2,C=K.top+K.height/2;if(B>=0&&B<=window.innerWidth&&C>=0&&C<=window.innerHeight){const N=document.elementFromPoint(B,C);if(N&&!j.contains(N)&&!ye.current?.contains(N))return}v.push({id:w[0]._id,element:j,rect:K,annotations:w.sort((N,de)=>new Date(de.timestamp||de.createdAt).getTime()-new Date(N.timestamp||N.createdAt).getTime()),isModal:!!w[0].reference?.metadata?.isModal})}),y(v),we.current=null}))},[V]),re=m.useCallback(async()=>{if(n){ie(!0);try{const l=await fetch(`${a}/api/annotations`,{headers:{"x-api-key":n}});if(l.ok){const g=await l.json(),x=Array.isArray(g)?g:g?.data||[];if(!Array.isArray(x)){console.error("Expected annotations array, got:",typeof x),Oe([]);return}const E=x.reduce((R,_)=>R.find(w=>w._id===_._id)?R:R.concat([_]),[]);Oe(E)}}catch(l){console.error("Failed to fetch annotations",l)}finally{ie(!1)}}},[n,a]);m.useEffect(()=>{L&&V.length===0&&!fe&&X(!1)},[L,V.length,fe]),m.useEffect(()=>{if(V.length===0){le();return}if(!i){le();const l=new MutationObserver(()=>le()),g=new ResizeObserver(()=>le()),x=()=>le();return l.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),g.observe(document.documentElement),window.addEventListener("scroll",x,!0),()=>{l.disconnect(),g.disconnect(),window.removeEventListener("scroll",x,!0),we.current&&cancelAnimationFrame(we.current)}}},[i,V.length,le]),m.useEffect(()=>{re()},[re]),m.useEffect(()=>{ye.current=document.getElementById("viewgate-shadow-host")},[]);const $e=m.useCallback(l=>{if(!i||h)return;const g=Ct(l.clientX,l.clientY);if(!g||ye.current?.contains(g)||g.closest(".vg-no-capture")){f(null);return}const x=g.getBoundingClientRect();f({tag:g.tagName.toLowerCase(),source:g.getAttribute("data-source-path")||"unknown:0",rect:x,element:g,previewText:(g.innerText||"").slice(0,100)||(g.getAttribute("placeholder")||"").slice(0,100)||g.tagName.toLowerCase(),semanticReference:{...nn(g),normalizedOffset:{x:(l.clientX-x.left)/x.width,y:(l.clientY-x.top)/x.height}}})},[i,h]),Be=m.useCallback(async l=>{if(!i||h)return;const g=Ct(l.clientX,l.clientY);if(!(!g||ye.current?.contains(g)||g.closest(".vg-no-capture"))&&p){l.preventDefault(),l.stopPropagation(),_e(!0);try{const R=await Hr(document.body,{pixelRatio:2,cacheBust:!0,width:window.innerWidth,height:window.innerHeight,backgroundColor:"#ffffff",filter:w=>{const j=w;return!(ye.current?.contains(j)||j.id==="viewgate-ui"||j.classList?.contains("vg-no-capture"))}}),_=await Zr(R,p.rect,32,2),v={...p.semanticReference,metadata:{...p.semanticReference.metadata,elementScreenshot:_}};O({...p,visualPreview:_,semanticReference:v})}catch(x){console.error("Failed to capture high-fidelity preview:",x),O(p)}finally{_e(!1),f(null)}}},[i,p,h]);m.useEffect(()=>{const l=g=>{if(g.key==="Escape"){h?O(null):L?X(!1):i&&u(!1);return}const E=(()=>{let v=document.activeElement;for(;v&&v.shadowRoot&&v.shadowRoot.activeElement;)v=v.shadowRoot.activeElement;return v})();if(["input","textarea"].includes((E?.tagName||"").toLowerCase())||E?.isContentEditable)return;const _=g.key.toLowerCase();_==="c"&&!h&&!L&&u(v=>!v),_==="v"&&!h&&(V.length>0||L)&&(X(v=>!v),L||u(!1))};return i&&!h?document.body.classList.add("vg-cursor-pointer"):document.body.classList.remove("vg-cursor-pointer"),window.addEventListener("keydown",l),window.addEventListener("mousemove",$e,!0),window.addEventListener("click",Be,!0),()=>{document.body.classList.remove("vg-cursor-pointer"),window.removeEventListener("keydown",l),window.removeEventListener("mousemove",$e,!0),window.removeEventListener("click",Be,!0)}},[i,h,L,V,$e,Be]);const ln=async()=>{if(!h||!G.trim())return;oe(!0);const{semanticReference:l}=h,[g,x]=(l.source||"").split(":"),E=x||"0";try{if(!(await fetch(`${a}/api/annotations`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({filePath:g,line:parseInt(E),url:window.location.href,message:G,componentName:l.componentPath||h.tag,reference:{...l,viewport:{width:window.innerWidth,height:window.innerHeight},userAgent:navigator.userAgent,timestamp:new Date().toISOString()}})})).ok)throw new Error("Backend failed");e(r.success,"success"),O(null),D(""),u(!1),re()}catch(R){console.error(R),e(r.error,"error")}finally{oe(!1)}};return o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1283",className:"vg-container",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1284",className:"vg-no-capture",children:[!c&&o.jsxs("div",{style:{position:"fixed",top:`${S.top}px`,right:`${S.right}px`,zIndex:ze+10,display:"flex",alignItems:"center",gap:"8px",transition:J?"none":"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:[o.jsx("div",{onMouseDown:on,style:{width:"20px",height:"32px",borderRadius:"6px",backgroundColor:"rgba(255, 255, 255, 0.85)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"#1e293b",opacity:i?0:1,visibility:i?"hidden":"visible",transition:"all 0.2s",border:"1px solid rgba(0,0,0,0.1)",boxShadow:"0 2px 8px rgba(0,0,0,0.05)"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor="white",l.currentTarget.style.color="#000000"},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.85)",l.currentTarget.style.color="#1e293b"},children:o.jsx(et,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1328",size:14})}),o.jsx("button",{onClick:l=>{l.stopPropagation(),H({title:r.exitConfirmTitle||"Close ViewGate?",message:r.exitConfirmMessage||"Are you sure you want to close ViewGate?",type:"danger",onConfirm:()=>s()})},title:"Cerrar ViewGate",style:{width:"40px",height:"40px",borderRadius:"12px",backgroundColor:"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid rgba(0,0,0,0.05)",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",cursor:"pointer",color:"#64748b",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},onMouseEnter:l=>{l.currentTarget.style.transform="scale(1.1) rotate(90deg)",l.currentTarget.style.color="#ef4444",l.currentTarget.style.backgroundColor="white"},onMouseLeave:l=>{l.currentTarget.style.transform="scale(1) rotate(0deg)",l.currentTarget.style.color="#64748b",l.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.9)"},children:o.jsx(Pe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1368",size:20,strokeWidth:2.5})})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1374",style:{position:"fixed",bottom:`${$.bottom}px`,right:`${$.right}px`,zIndex:ze,display:"flex",alignItems:"center",gap:"8px",transition:xe?"none":"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)"},id:"viewgate-ui",children:[o.jsx("div",{onMouseDown:cn,style:{width:"24px",height:"40px",borderRadius:"10px",backgroundColor:"rgba(255, 255, 255, 0.85)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"#1e293b",opacity:i?0:1,visibility:i?"hidden":"visible",transition:"all 0.2s",border:"1px solid rgba(0,0,0,0.1)",boxShadow:"0 2px 8px rgba(0,0,0,0.05)"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor="white",l.currentTarget.style.color="#000000"},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.85)",l.currentTarget.style.color="#1e293b"},className:"vg-animate-slide-up",children:o.jsx(et,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1417",size:16})}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1420",className:"vg-action-bar vg-animate-slide-up",style:{transition:"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)"},children:[o.jsx("button",{onClick:()=>u(!i),className:"vg-button-primary vg-animate-pop",style:{padding:"12px 24px",background:i?"#ef4444":void 0},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1429",style:{display:"flex",alignItems:"center",gap:"10px"},children:[i?o.jsx(Pe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1430",size:20,className:"vg-animate-pop"}):o.jsx(be,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1430",size:20,className:"vg-animate-pop"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1431",children:i?r.exitMode:r.enterMode})]})}),V.length>0&&o.jsxs("button",{onClick:()=>{X(!L),u(!1),O(null)},className:"vg-button-ghost vg-animate-pop",style:{animationDelay:"0.1s"},children:[o.jsx(Ft,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1444",size:20}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1445",children:r.viewComments})]})]})]}),je&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1453",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(255,255,255,0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:ze+1,cursor:"wait"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1459",className:"vg-glassmorphism",style:{padding:"30px 50px",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1460",className:"vg-spinner"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1461",style:{fontWeight:600,fontSize:"14px",color:"#000000"},children:"Capturando..."})]})}),i&&!h&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1468",className:"vg-backdrop-blur",style:{opacity:1,clipPath:p?`polygon(
9
9
  0% 0%, 0% 100%, 100% 100%, 100% 0%, 0% 0%,
10
10
  ${p.rect.left}px ${p.rect.top}px,
11
11
  ${p.rect.right}px ${p.rect.top}px,
12
12
  ${p.rect.right}px ${p.rect.bottom}px,
13
13
  ${p.rect.left}px ${p.rect.bottom}px,
14
14
  ${p.rect.left}px ${p.rect.top}px
15
- )`:"none",zIndex:Ur}}),i&&p&&!g&&!Re&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1479",className:"vg-selection-pulse",style:{top:p.rect.top-4,left:p.rect.left-4,width:p.rect.width+8,height:p.rect.height+8,zIndex:$r},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1489",className:"vg-selection-label",style:{...p.rect.top<60?p.rect.bottom>window.innerHeight-60?{top:"8px",bottom:"auto"}:{top:"100%",marginTop:"8px",bottom:"auto"}:{top:"-40px",bottom:"auto"},...p.rect.left+200>window.innerWidth?{left:"auto",right:"0"}:{left:"0",right:"auto"}},children:[o.jsx(Ut,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1505",size:16}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1506",style:{display:"flex",flexDirection:"column"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1507",style:{fontWeight:700},children:r.selectToComment}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1508",style:{fontSize:"10px",opacity:.8,fontFamily:"monospace"},children:[Math.round(p.rect.width)," × ",Math.round(p.rect.height)]})]})]})}),g&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1518",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(15, 23, 42, 0.4)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Le},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1523",className:"vg-glassmorphism vg-animate-slide",style:{padding:"40px",width:"500px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1527",style:{textAlign:"center",marginBottom:"32px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1528",style:{width:"48px",height:"48px",background:"var(--vg-primary-gradient)",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px",color:"white",boxShadow:"0 8px 16px rgba(99, 102, 241, 0.3)"},children:o.jsx(ve,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1533",size:24})}),o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1535",style:{margin:"0 0 8px 0",fontSize:"24px",fontWeight:800,color:"#0f172a"},children:r.feedbackHeader}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1536",style:{margin:0,color:"#000000",fontSize:"15px"},children:r.feedbackSubheader})]}),g.visualPreview&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1540",style:{marginBottom:"24px",borderRadius:"12px",overflow:"hidden",border:"1px solid #e2e8f0",background:"#f8fafc",width:"fit-content",margin:"0 auto 24px auto"},children:o.jsx("img",{src:g.visualPreview,alt:"Preview",style:{maxWidth:"100%",maxHeight:"200px",objectFit:"contain",display:"block"}})}),o.jsx("textarea",{className:"vg-textarea",value:A,onChange:l=>z(l.target.value),rows:4,placeholder:r.placeholder,autoFocus:!0,style:{fontSize:"15px",padding:"16px",marginBottom:"24px"}}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1567",style:{display:"flex",gap:"12px"},children:[o.jsx("button",{onClick:()=>!$&&_(null),className:"vg-button-ghost",disabled:$,style:{flex:1,padding:"12px"},children:r.cancel}),o.jsx("button",{onClick:ln,className:"vg-button-primary",disabled:$||!A.trim(),style:{flex:2},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1582",style:{display:"flex",alignItems:"center",gap:"8px"},children:[$?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1583",className:"vg-spinner",style:{width:"16px",height:"16px",borderWidth:"2px"}}):o.jsx(Yt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1583",size:18}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1584",children:$?r.submitting:r.sendFeedback||"Send Comment"})]})})]})]})}),I&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1593",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(15, 23, 42, 0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Le},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1598",className:"vg-glassmorphism vg-animate-slide",style:{padding:"32px",width:"650px",maxHeight:"85vh",display:"flex",flexDirection:"column"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1602",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1603",style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1604",style:{margin:0,fontSize:"20px",fontWeight:800,color:"#0f172a"},children:L?r.commentDetails:r.annotations}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1607",className:"vg-badge",style:{background:"#e0e7ff",color:"#6366f1"},children:b.length})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1611",style:{display:"flex",gap:"8px"},children:[L&&o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1613",className:"vg-button-ghost",style:{padding:"6px 14px",fontSize:"12px"},onClick:()=>Q(null),children:r.viewAll||"View All"}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1621",className:"vg-button-ghost",style:{padding:"8px",borderRadius:"50%"},onClick:()=>{B(!1),Q(null)},children:o.jsx(Te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1626",size:20})})]})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1631",style:{maxHeight:"60vh",overflowY:"auto",paddingRight:"10px"},className:"vg-custom-scrollbar",children:me?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1637",style:{display:"flex",justifyContent:"center",padding:"40px"},children:o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1638",className:"vg-spinner"})}):b.map((l,x)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1642",className:"vg-glassmorphism vg-animate-slide",style:{padding:"20px",marginBottom:"16px",border:"1px solid rgba(0,0,0,0.05)",background:"rgba(255,255,255,0.5)",animationDelay:`${x*.05}s`},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1653",style:{display:"flex",justifyContent:"space-between",marginBottom:"16px",alignItems:"center"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1654",style:{display:"flex",gap:"12px",alignItems:"center"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1655",style:{fontSize:"12px",color:"#000000",fontWeight:600},children:vt(l.timestamp||l.createdAt||l.reference?.timestamp,t)}),l.url&&o.jsx(bt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1659",url:l.url,onHover:he,style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"11px",color:"#64748b",background:"#f8fafc",padding:"2px 8px",borderRadius:"6px",border:"1px solid #e2e8f0",maxWidth:"220px"}})]}),l.status==="ready_for_review"?o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1678",className:"vg-badge",style:{backgroundColor:"#f0fdf4",color:"#16a34a",border:"1px solid #dcfce7"},children:[o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1679",size:14})," ",r.readyForReview]}):o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1682",className:"vg-badge",style:{backgroundColor:"#fff7ed",color:"#ea580c",border:"1px solid #ffedd5"},children:[o.jsx(Qe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1683",size:14})," ",r.pending]})]}),jt===l._id?o.jsx("textarea",{className:"vg-textarea",value:_t,onChange:w=>Ot(w.target.value),rows:3,autoFocus:!0,style:{marginBottom:"16px"}}):o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1698",className:"vg-text-wrap",style:{margin:"0 0 20px 0",fontSize:"16px",color:"#1e293b",lineHeight:1.6},children:l.message}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1701",style:{display:"flex",gap:"12px",justifyContent:"flex-end",borderTop:"1px solid #f1f5f9",paddingTop:"16px"},children:jt===l._id?o.jsxs(o.Fragment,{children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1704",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:async()=>{try{(await fetch(`${a}/api/annotations/${l._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({message:_t})})).ok&&(He(null),re(),e(r.updateSuccess,"success"))}catch{e(r.error,"error")}},children:r.save}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1726",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>He(null),children:r.cancel})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1730",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>{He(l._id),Ot(l.message)},children:[o.jsx($t,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1738",size:14})," ",r.edit]}),o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1740",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.05s"},onClick:()=>{l.url&&(window.location.href=l.url)},children:[o.jsx(qe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1747",size:14})," ",r.review]}),l.status==="pending"?o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1750",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{W({title:r.markReadyConfirm,message:r.confirmMarkReady,type:"success",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${l._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({status:"ready_for_review"})})).ok&&(re(),e(r.updateSuccess,"success"))}catch{e(r.error,"error")}finally{W(null)}}})},children:[o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1778",size:14})," ",r.markReady]}):o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1781",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{W({title:r.reopenConfirm,message:r.confirmReopen,type:"success",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${l._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({status:"pending"})})).ok&&(re(),e(r.updateSuccess,"success"))}catch{e(r.error,"error")}finally{W(null)}}})},children:[o.jsx(Bt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1809",size:14})," ",r.reopen]}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1812",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 12px",color:"#ef4444",borderColor:"#fee2e2",animationDelay:"0.15s"},onClick:()=>{W({title:r.deleteConfirm,message:r.confirmDelete,type:"danger",onConfirm:async()=>{try{if((await fetch(`${a}/api/annotations/${l._id}`,{method:"DELETE",headers:{"x-api-key":n}})).ok){if(L===l._id){const E=b.find(R=>R._id!==l._id);E?Q(E._id):(Q(null),B(!1))}re(),e(r.deleteSuccess,"success")}}catch{e(r.error,"error")}finally{W(null)}}})},children:o.jsx(tt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1850",size:16})})]})})]},l._id))},L||"all")]})}),D&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1866",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(11, 15, 25, 0.7)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Le+100},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1871",className:"vg-glassmorphism vg-animate-slide",style:{padding:"40px",width:"420px",textAlign:"center",border:"1px solid rgba(255, 255, 255, 0.1)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1878",style:{width:"64px",height:"64px",background:D.type==="danger"?"rgba(239, 68, 68, 0.1)":"rgba(99, 102, 241, 0.1)",borderRadius:"20px",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px",color:D.type==="danger"?"#ef4444":"#6366f1",transform:"rotate(-5deg)"},children:D.type==="danger"?o.jsx(tt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1887",size:32}):o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1887",size:32})}),o.jsx("h3",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1889",style:{margin:"0 0 12px 0",fontSize:"20px",fontWeight:800,color:"#000000",letterSpacing:"-0.02em"},children:D.title}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1890",style:{margin:"0 0 32px 0",fontSize:"15px",color:"#000000",lineHeight:1.6},children:D.message}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1891",style:{display:"flex",gap:"16px"},children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1892",className:"vg-button-ghost",style:{flex:1,height:"44px"},onClick:()=>!te&&W(null),disabled:te,children:r.no}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1900",className:"vg-button-primary",style:{flex:1,height:"44px",backgroundColor:D.type==="danger"?"#ef4444":void 0,backgroundImage:D.type==="danger"?"none":void 0,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},disabled:te,onClick:async()=>{fe(!0);try{await D.onConfirm()}catch(l){console.error("Confirmation error:",l)}finally{fe(!1)}},children:te?o.jsx(Ht,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1925",size:18,className:"vg-animate-spin"}):r.yes})]})]})}),!i&&!I&&d.map((l,x)=>{const{rect:w,annotations:E,isModal:R}=l,j=E[0],h=E.length,v=E.some(C=>C.status==="ready_for_review"),G=E.some(C=>C.status!=="ready_for_review"),J=v&&G,Z=v&&!G;return o.jsxs("div",{className:"vg-pin-container vg-animate-pop",style:{position:"fixed",top:w.top-20,left:w.left+w.width/2-16,width:"32px",height:"32px",cursor:"pointer",transition:"all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275)",zIndex:Br},onMouseEnter:C=>{window.innerHeight-w.bottom<250?Ve(Be=>({...Be,[l.id]:"vg-top"})):Ve(Be=>({...Be,[l.id]:""}))},onWheel:C=>{const q=C.currentTarget.querySelector(".vg-tooltip-scroll");q&&q.scrollBy({top:C.deltaY,behavior:"smooth"})},onClick:()=>{B(!0),Q(j._id)},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1978",className:`vg-pin-tooltip ${Oe[l.id]||""}`,style:{padding:"16px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1979",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1980",style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx(ve,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1981",size:14,color:"#6366f1"}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1982",style:{fontWeight:800,fontSize:"13px",color:"#0f172a"},children:[h," ",h===1?"Comentario":"Comentarios"]})]}),R&&o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1987",className:"vg-badge",style:{fontSize:"10px",background:"#fef3c7",color:"#92400e",border:"none"},children:"MODAL"})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1990",className:"vg-tooltip-scroll",style:{maxHeight:"180px",overflowY:"auto"},children:E.map((C,q)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1992",style:{padding:"10px 0",borderTop:q===0?"none":"1px solid #f1f5f9",display:"flex",gap:"12px",alignItems:"flex-start"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1999",style:{flex:1,display:"flex",flexDirection:"column",gap:"4px"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2000",style:{fontSize:"10px",fontWeight:600,color:"#64748b"},children:vt(C.timestamp||C.createdAt,t)}),C.url&&o.jsx(bt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:2004",url:C.url,onHover:he,style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"9px",color:"#6366f1",opacity:.8,background:"rgba(99, 102, 241, 0.05)",padding:"2px 6px",borderRadius:"4px",maxWidth:"120px"},tooltipStyle:{fontSize:"9px"}}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2022",className:"vg-line-clamp-2",style:{fontSize:"13px",color:"#1e293b",lineHeight:1.4,fontWeight:500},children:C.message.length>100?C.message.slice(0,97)+"...":C.message})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2026",style:{flexShrink:0,marginTop:"2px"},children:C.status==="ready_for_review"?o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2028",style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"8px",fontWeight:800,color:"#16a34a",background:"#f0fdf4",padding:"2px 6px",borderRadius:"6px",textTransform:"uppercase",border:"1px solid #dcfce7"},children:[o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:2041",size:10}),r.readyForReview]}):o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2045",style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"8px",fontWeight:800,color:"#ea580c",background:"#fff7ed",padding:"2px 6px",borderRadius:"6px",textTransform:"uppercase",border:"1px solid #ffedd5"},children:[o.jsx(Qe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:2058",size:10}),r.pending]})})]},C._id))})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2068",className:`vg-formal-pin ${Z?"ready":J?"mixed":""} ${R?"modal-variant":""}`,style:{position:"relative"},children:[Z?o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:2069",size:18}):R?o.jsx(qe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:2069",size:16}):o.jsx(ve,{"data-source-path":"/src/components/ViewGateOverlay.tsx:2069",size:16}),h>1&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2072",className:"vg-pin-badge vg-animate-pop",children:h})]})]},`group-${l.id}`)}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2081",className:`vg-url-tooltip ${H?"visible":""} ${H?.direction==="bottom"?"vg-bottom":"vg-top"}`,style:{transform:H?`translate(-50%, ${H.direction==="top"?"-110%":"10%"})`:"translate(-50%, 0)",left:H?.x||0,top:H?.y||0},children:H?.url})]})})};function De(e,t,r){if(!t.endsWith(".tsx")&&!t.endsWith(".jsx")||t.includes("node_modules"))return e;const n=i=>i.replace(/\\/g,"/"),a=n(t).replace(n(r),"");return e.split(`
16
- `).map((i,u)=>{const p=u+1;return i.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g,(f,g,_)=>f.includes("data-source-path")||_==="Fragment"||_==="React.Fragment"?f:`${g}<${_} data-source-path="${a}:${p}"`)}).join(`
17
- `)}function an(){return{name:"vite-plugin-viewgate",enforce:"pre",transform(e,t){return{code:De(e,t,process.cwd()),map:null}}}}function sn(e){const t=this.resourcePath;return t?(process.env.NODE_ENV,De(e,t,process.cwd())):e}N.ViewGate=Zt,N.ViewGateOverlay=Et,N.transformSourcePaths=De,N.useViewGate=nt,N.viewgateNextLoader=sn,N.viewgatePlugin=an,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})}));
15
+ )`:"none",zIndex:Ur}}),i&&p&&!h&&!je&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1487",className:"vg-selection-pulse",style:{top:p.rect.top-4,left:p.rect.left-4,width:p.rect.width+8,height:p.rect.height+8,zIndex:$r},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1497",className:"vg-selection-label",style:{...p.rect.top<60?p.rect.bottom>window.innerHeight-60?{top:"8px",bottom:"auto"}:{top:"100%",marginTop:"8px",bottom:"auto"}:{top:"-40px",bottom:"auto"},...p.rect.left+200>window.innerWidth?{left:"auto",right:"0"}:{left:"0",right:"auto"}},children:[o.jsx(Ut,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1513",size:16}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1514",style:{display:"flex",flexDirection:"column"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1515",style:{fontWeight:700},children:r.selectToComment}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1516",style:{fontSize:"10px",opacity:.8,fontFamily:"monospace"},children:[Math.round(p.rect.width)," × ",Math.round(p.rect.height)]})]})]})}),h&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1526",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(15, 23, 42, 0.4)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:De},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1531",className:"vg-glassmorphism vg-animate-slide",style:{padding:"40px",width:"500px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1535",style:{textAlign:"center",marginBottom:"32px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1536",style:{width:"48px",height:"48px",background:"var(--vg-primary-gradient)",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px",color:"white",boxShadow:"0 8px 16px rgba(99, 102, 241, 0.3)"},children:o.jsx(be,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1541",size:24})}),o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1543",style:{margin:"0 0 8px 0",fontSize:"24px",fontWeight:800,color:"#0f172a"},children:r.feedbackHeader}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1544",style:{margin:0,color:"#000000",fontSize:"15px"},children:r.feedbackSubheader})]}),h.visualPreview&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1548",style:{marginBottom:"24px",borderRadius:"12px",overflow:"hidden",border:"1px solid #e2e8f0",background:"#f8fafc",width:"fit-content",margin:"0 auto 24px auto"},children:o.jsx("img",{src:h.visualPreview,alt:"Preview",style:{maxWidth:"100%",maxHeight:"200px",objectFit:"contain",display:"block"}})}),o.jsx("textarea",{className:"vg-textarea",value:G,onChange:l=>D(l.target.value),rows:4,placeholder:r.placeholder,autoFocus:!0,style:{fontSize:"15px",padding:"16px",marginBottom:"24px"}}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1575",style:{display:"flex",gap:"12px"},children:[o.jsx("button",{onClick:()=>!Y&&O(null),className:"vg-button-ghost",disabled:Y,style:{flex:1,padding:"12px"},children:r.cancel}),o.jsx("button",{onClick:ln,className:"vg-button-primary",disabled:Y||!G.trim(),style:{flex:2},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1590",style:{display:"flex",alignItems:"center",gap:"8px"},children:[Y?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1591",className:"vg-spinner",style:{width:"16px",height:"16px",borderWidth:"2px"}}):o.jsx(Yt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1591",size:18}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1592",children:Y?r.submitting:r.sendFeedback||"Send Comment"})]})})]})]})}),L&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1601",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(15, 23, 42, 0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:De},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1606",className:"vg-glassmorphism vg-animate-slide",style:{padding:"32px",width:"650px",maxHeight:"85vh",display:"flex",flexDirection:"column"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1610",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1611",style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1612",style:{margin:0,fontSize:"20px",fontWeight:800,color:"#0f172a"},children:z?r.commentDetails:r.annotations}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1615",className:"vg-badge",style:{background:"#e0e7ff",color:"#6366f1"},children:b.length})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1619",style:{display:"flex",gap:"8px"},children:[z&&o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1621",className:"vg-button-ghost",style:{padding:"6px 14px",fontSize:"12px"},onClick:()=>q(null),children:r.viewAll||"View All"}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1629",className:"vg-button-ghost",style:{padding:"8px",borderRadius:"50%"},onClick:()=>{X(!1),q(null)},children:o.jsx(Pe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1634",size:20})})]})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1639",style:{maxHeight:"60vh",overflowY:"auto",paddingRight:"10px"},className:"vg-custom-scrollbar",children:fe?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1645",style:{display:"flex",justifyContent:"center",padding:"40px"},children:o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1646",className:"vg-spinner"})}):b.map((l,g)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1650",className:"vg-glassmorphism vg-animate-slide",style:{padding:"20px",marginBottom:"16px",border:"1px solid rgba(0,0,0,0.05)",background:"rgba(255,255,255,0.5)",animationDelay:`${g*.05}s`},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1661",style:{display:"flex",justifyContent:"space-between",marginBottom:"16px",alignItems:"center"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1662",style:{display:"flex",gap:"12px",alignItems:"center"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1663",style:{fontSize:"12px",color:"#000000",fontWeight:600},children:vt(l.timestamp||l.createdAt||l.reference?.timestamp,t)}),l.url&&o.jsx(bt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1667",url:l.url,onHover:ge,style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"11px",color:"#64748b",background:"#f8fafc",padding:"2px 8px",borderRadius:"6px",border:"1px solid #e2e8f0",maxWidth:"220px"}})]}),l.status==="ready_for_review"?o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1686",className:"vg-badge",style:{backgroundColor:"#f0fdf4",color:"#16a34a",border:"1px solid #dcfce7"},children:[o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1687",size:14})," ",r.readyForReview]}):o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1690",className:"vg-badge",style:{backgroundColor:"#fff7ed",color:"#ea580c",border:"1px solid #ffedd5"},children:[o.jsx(Qe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1691",size:14})," ",r.pending]})]}),jt===l._id?o.jsx("textarea",{className:"vg-textarea",value:_t,onChange:x=>Ot(x.target.value),rows:3,autoFocus:!0,style:{marginBottom:"16px"}}):o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1706",className:"vg-text-wrap",style:{margin:"0 0 20px 0",fontSize:"16px",color:"#1e293b",lineHeight:1.6},children:l.message}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1709",style:{display:"flex",gap:"12px",justifyContent:"flex-end",borderTop:"1px solid #f1f5f9",paddingTop:"16px"},children:jt===l._id?o.jsxs(o.Fragment,{children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1712",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:async()=>{try{(await fetch(`${a}/api/annotations/${l._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({message:_t})})).ok&&(Ue(null),re(),e(r.updateSuccess,"success"))}catch{e(r.error,"error")}},children:r.save}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1734",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>Ue(null),children:r.cancel})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1738",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>{Ue(l._id),Ot(l.message)},children:[o.jsx($t,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1746",size:14})," ",r.edit]}),o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1748",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.05s"},onClick:()=>{l.url&&(window.location.href=l.url)},children:[o.jsx(qe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1755",size:14})," ",r.review]}),l.status==="pending"?o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1758",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{H({title:r.markReadyConfirm,message:r.confirmMarkReady,type:"success",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${l._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({status:"ready_for_review"})})).ok&&(re(),e(r.updateSuccess,"success"))}catch{e(r.error,"error")}finally{H(null)}}})},children:[o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1786",size:14})," ",r.markReady]}):o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1789",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{H({title:r.reopenConfirm,message:r.confirmReopen,type:"success",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${l._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({status:"pending"})})).ok&&(re(),e(r.updateSuccess,"success"))}catch{e(r.error,"error")}finally{H(null)}}})},children:[o.jsx(Bt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1817",size:14})," ",r.reopen]}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1820",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 12px",color:"#ef4444",borderColor:"#fee2e2",animationDelay:"0.15s"},onClick:()=>{H({title:r.deleteConfirm,message:r.confirmDelete,type:"danger",onConfirm:async()=>{try{if((await fetch(`${a}/api/annotations/${l._id}`,{method:"DELETE",headers:{"x-api-key":n}})).ok){if(z===l._id){const E=b.find(R=>R._id!==l._id);E?q(E._id):(q(null),X(!1))}re(),e(r.deleteSuccess,"success")}}catch{e(r.error,"error")}finally{H(null)}}})},children:o.jsx(tt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1858",size:16})})]})})]},l._id))},z||"all")]})}),F&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1874",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(11, 15, 25, 0.7)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:De+100},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1879",className:"vg-glassmorphism vg-animate-slide",style:{padding:"40px",width:"420px",textAlign:"center",border:"1px solid rgba(255, 255, 255, 0.1)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1886",style:{width:"64px",height:"64px",background:F.type==="danger"?"rgba(239, 68, 68, 0.1)":"rgba(99, 102, 241, 0.1)",borderRadius:"20px",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px",color:F.type==="danger"?"#ef4444":"#6366f1",transform:"rotate(-5deg)"},children:F.type==="danger"?o.jsx(tt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1895",size:32}):o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1895",size:32})}),o.jsx("h3",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1897",style:{margin:"0 0 12px 0",fontSize:"20px",fontWeight:800,color:"#000000",letterSpacing:"-0.02em"},children:F.title}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1898",style:{margin:"0 0 32px 0",fontSize:"15px",color:"#000000",lineHeight:1.6},children:F.message}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1899",style:{display:"flex",gap:"16px"},children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1900",className:"vg-button-ghost",style:{flex:1,height:"44px"},onClick:()=>!te&&H(null),disabled:te,children:r.no}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1908",className:"vg-button-primary",style:{flex:1,height:"44px",backgroundColor:F.type==="danger"?"#ef4444":void 0,backgroundImage:F.type==="danger"?"none":void 0,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},disabled:te,onClick:async()=>{he(!0);try{await F.onConfirm()}catch(l){console.error("Confirmation error:",l)}finally{he(!1)}},children:te?o.jsx(Ht,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1933",size:18,className:"vg-animate-spin"}):r.yes})]})]})}),!i&&!L&&d.map((l,g)=>{const{rect:x,annotations:E,isModal:R}=l,_=E[0],v=E.length,w=E.some(C=>C.status==="ready_for_review"),j=E.some(C=>C.status!=="ready_for_review"),K=w&&j,B=w&&!j;return o.jsxs("div",{className:"vg-pin-container vg-animate-pop",style:{position:"fixed",top:x.top-20,left:x.left+x.width/2-16,width:"32px",height:"32px",cursor:"pointer",transition:"all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275)",zIndex:Br},onMouseEnter:C=>{window.innerHeight-x.bottom<250?Te(de=>({...de,[l.id]:"vg-top"})):Te(de=>({...de,[l.id]:""}))},onWheel:C=>{const N=C.currentTarget.querySelector(".vg-tooltip-scroll");N&&N.scrollBy({top:C.deltaY,behavior:"smooth"})},onClick:()=>{X(!0),q(_._id)},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1986",className:`vg-pin-tooltip ${Ae[l.id]||""}`,style:{padding:"16px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1987",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1988",style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx(be,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1989",size:14,color:"#6366f1"}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1990",style:{fontWeight:800,fontSize:"13px",color:"#0f172a"},children:[v," ",v===1?"Comentario":"Comentarios"]})]}),R&&o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1995",className:"vg-badge",style:{fontSize:"10px",background:"#fef3c7",color:"#92400e",border:"none"},children:"MODAL"})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1998",className:"vg-tooltip-scroll",style:{maxHeight:"180px",overflowY:"auto"},children:E.map((C,N)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2000",style:{padding:"10px 0",borderTop:N===0?"none":"1px solid #f1f5f9",display:"flex",gap:"12px",alignItems:"flex-start"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2007",style:{flex:1,display:"flex",flexDirection:"column",gap:"4px"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2008",style:{fontSize:"10px",fontWeight:600,color:"#64748b"},children:vt(C.timestamp||C.createdAt,t)}),C.url&&o.jsx(bt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:2012",url:C.url,onHover:ge,style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"9px",color:"#6366f1",opacity:.8,background:"rgba(99, 102, 241, 0.05)",padding:"2px 6px",borderRadius:"4px",maxWidth:"120px"},tooltipStyle:{fontSize:"9px"}}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2030",className:"vg-line-clamp-2",style:{fontSize:"13px",color:"#1e293b",lineHeight:1.4,fontWeight:500},children:C.message.length>100?C.message.slice(0,97)+"...":C.message})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2034",style:{flexShrink:0,marginTop:"2px"},children:C.status==="ready_for_review"?o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2036",style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"8px",fontWeight:800,color:"#16a34a",background:"#f0fdf4",padding:"2px 6px",borderRadius:"6px",textTransform:"uppercase",border:"1px solid #dcfce7"},children:[o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:2049",size:10}),r.readyForReview]}):o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2053",style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"8px",fontWeight:800,color:"#ea580c",background:"#fff7ed",padding:"2px 6px",borderRadius:"6px",textTransform:"uppercase",border:"1px solid #ffedd5"},children:[o.jsx(Qe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:2066",size:10}),r.pending]})})]},C._id))})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2076",className:`vg-formal-pin ${B?"ready":K?"mixed":""} ${R?"modal-variant":""}`,style:{position:"relative"},children:[B?o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:2077",size:18}):R?o.jsx(qe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:2077",size:16}):o.jsx(be,{"data-source-path":"/src/components/ViewGateOverlay.tsx:2077",size:16}),v>1&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2080",className:"vg-pin-badge vg-animate-pop",children:v})]})]},`group-${l.id}`)}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:2089",className:`vg-url-tooltip ${U?"visible":""} ${U?.direction==="bottom"?"vg-bottom":"vg-top"}`,style:{transform:U?`translate(-50%, ${U.direction==="top"?"-110%":"10%"})`:"translate(-50%, 0)",left:U?.x||0,top:U?.y||0},children:U?.url})]})})};function We(e,t,r){if(!t.endsWith(".tsx")&&!t.endsWith(".jsx")||t.includes("node_modules"))return e;const n=i=>i.replace(/\\/g,"/"),a=n(t).replace(n(r),"");return e.split(`
16
+ `).map((i,u)=>{const p=u+1;return i.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g,(f,h,O)=>f.includes("data-source-path")||O==="Fragment"||O==="React.Fragment"?f:`${h}<${O} data-source-path="${a}:${p}"`)}).join(`
17
+ `)}function an(){return{name:"vite-plugin-viewgate",enforce:"pre",transform(e,t){return{code:We(e,t,process.cwd()),map:null}}}}function sn(e){const t=this.resourcePath;return t?(process.env.NODE_ENV,We(e,t,process.cwd())):e}M.ViewGate=Zt,M.ViewGateOverlay=Et,M.transformSourcePaths=We,M.useViewGate=nt,M.viewgateNextLoader=sn,M.viewgatePlugin=an,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})}));
@@ -70,9 +70,17 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
70
70
  }
71
71
  const data = await response.json();
72
72
  // Handle both direct array (legacy) and { data: [...] } (paginated) format
73
- const rawAnnotations = Array.isArray(data) ? data : (data.data || []);
73
+ const rawAnnotations = Array.isArray(data) ? data : (data?.data || []);
74
74
  if (!Array.isArray(rawAnnotations)) {
75
- throw new Error('Backend returned invalid annotations format');
75
+ return {
76
+ content: [
77
+ {
78
+ type: "text",
79
+ text: `Error: Backend returned invalid annotations format. Expected array but got: ${typeof rawAnnotations}`,
80
+ },
81
+ ],
82
+ isError: true,
83
+ };
76
84
  }
77
85
  const annotationsWithTips = rawAnnotations.map((ann) => ({
78
86
  ...ann,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewgate-wrapper",
3
- "version": "1.10.21",
3
+ "version": "1.10.22",
4
4
  "type": "module",
5
5
  "main": "./dist/viewgate-wrapper.umd.cjs",
6
6
  "module": "./dist/viewgate-wrapper.js",