"use strict";var HeroUIErrorTracker=(()=>{var m=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var E=(e,n)=>{for(var s in n)m(e,s,{get:n[s],enumerable:!0})},f=(e,n,s,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of l(n))!p.call(e,t)&&t!==s&&m(e,t,{get:()=>n[t],enumerable:!(o=w(n,t))||o.enumerable});return e};var y=e=>f(m({},"__esModule",{value:!0}),e);var b={};E(b,{init:()=>O});function a(e){return e instanceof Error?{message:e.message,name:e.name,stack:e.stack,type:"Error"}:typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}function O(e={}){let n=e.rootElementId||"root",s=e.debounceTime||300,o=e.targetOrigin||"*",t=[],u=console.error;console.error=function(...r){let c=r.map(a);t.push(c),window.parent.postMessage({message:t.map(d=>d.map(g=>typeof g=="object"?JSON.stringify(g):g)),type:"CONSOLE_ERROR"},o),u.apply(console,r)},window.addEventListener("error",r=>{console.error(a(r.error)),window.parent.postMessage({message:a(r.error),type:"UNHANDLED_ERROR"},o)}),window.addEventListener("unhandledrejection",r=>{console.error(a(r.reason)),window.parent.postMessage({message:a(r.reason),type:"UNHANDLED_REJECTION"},o)});let i=document.getElementById(n);if(i){let r;new MutationObserver(()=>{r&&clearTimeout(r),r=window.setTimeout(()=>{let d=i&&i.children.length>0;window.parent.postMessage({content:i?i.innerHTML:null,isMounted:d,type:"ROOT_MOUNT_STATUS"},o)},s)}).observe(i,{childList:!0,subtree:!0})}window.addEventListener("message",r=>{try{switch(r.data?.type){case"HISTORY_BACK":window.history.length>1&&window.history.back();break;case"HISTORY_FORWARD":window.history.length>1&&window.history.forward();break}}catch(c){console.error("Navigation error:",c)}})}return y(b);})();
