codetraxis 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,193 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-vendor-Bo5GWDbL.js","assets/react-vendor-BhKDh-5n.js"])))=>i.map(i=>d[i]);
2
- import{a as c,j as r,b as ht,d as qt}from"./react-vendor-BhKDh-5n.js";import{u as M,s as mt,a as Pe,b as X,c as Te,g as ft,d as gt,e as Vt,f as Gt,h as Jt,i as Kt,j as Xt,k as yt,l as xt,m as Ue,n as _t,o as Yt,P as Zt,p as Qt}from"./redux-vendor-D-3X9xqH.js";import{b as en,J as qe,d as tn}from"./babel-vendor-B4E1Dfn4.js";import{b as Ne}from"./axios-vendor-B_3Om2-t.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&o(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function o(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();/**
3
- * react-router v7.14.0
4
- *
5
- * Copyright (c) Remix Software Inc.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE.md file in the root directory of this source tree.
9
- *
10
- * @license MIT
11
- */var Ve="popstate";function Ge(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function nn(e={}){function t(o,s){var u;let a=(u=s.state)==null?void 0:u.masked,{pathname:i,search:l,hash:d}=a||o.location;return Le("",{pathname:i,search:l,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default",a?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function n(o,s){return typeof s=="string"?s:re(s)}return on(t,n,null,e)}function C(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function F(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function rn(){return Math.random().toString(36).substring(2,10)}function Je(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Le(e,t,n=null,o,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Q(t):t,state:n,key:t&&t.key||o||rn(),unstable_mask:s}}function re({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Q(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let o=e.indexOf("?");o>=0&&(t.search=e.substring(o),e=e.substring(0,o)),e&&(t.pathname=e)}return t}function on(e,t,n,o={}){let{window:s=document.defaultView,v5Compat:a=!1}=o,i=s.history,l="POP",d=null,u=p();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function p(){return(i.state||{idx:null}).idx}function h(){l="POP";let y=p(),g=y==null?null:y-u;u=y,d&&d({action:l,location:f.location,delta:g})}function m(y,g){l="PUSH";let b=Ge(y)?y:Le(f.location,y,g);u=p()+1;let v=Je(b,u),E=f.createHref(b.unstable_mask||b);try{i.pushState(v,"",E)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;s.location.assign(E)}a&&d&&d({action:l,location:f.location,delta:1})}function x(y,g){l="REPLACE";let b=Ge(y)?y:Le(f.location,y,g);u=p();let v=Je(b,u),E=f.createHref(b.unstable_mask||b);i.replaceState(v,"",E),a&&d&&d({action:l,location:f.location,delta:0})}function _(y){return sn(y)}let f={get action(){return l},get location(){return e(s,i)},listen(y){if(d)throw new Error("A history only accepts one active listener");return s.addEventListener(Ve,h),d=y,()=>{s.removeEventListener(Ve,h),d=null}},createHref(y){return t(s,y)},createURL:_,encodeLocation(y){let g=_(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:m,replace:x,go(y){return i.go(y)}};return f}function sn(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),C(n,"No window.location.(origin|href) available to create URL");let o=typeof e=="string"?e:re(e);return o=o.replace(/ $/,"%20"),!t&&o.startsWith("//")&&(o=n+o),new URL(o,n)}function vt(e,t,n="/"){return an(e,t,n,!1)}function an(e,t,n,o){let s=typeof t=="string"?Q(t):t,a=H(s.pathname||"/",n);if(a==null)return null;let i=bt(e);ln(i);let l=null;for(let d=0;l==null&&d<i.length;++d){let u=_n(a);l=yn(i[d],u,o)}return l}function bt(e,t=[],n=[],o="",s=!1){let a=(i,l,d=s,u)=>{let p={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(o)&&d)return;C(p.relativePath.startsWith(o),`Absolute route path "${p.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(o.length)}let h=O([o,p.relativePath]),m=n.concat(p);i.children&&i.children.length>0&&(C(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),bt(i.children,t,m,h,d)),!(i.path==null&&!i.index)&&t.push({path:h,score:fn(h,i.index),routesMeta:m})};return e.forEach((i,l)=>{var d;if(i.path===""||!((d=i.path)!=null&&d.includes("?")))a(i,l);else for(let u of wt(i.path))a(i,l,!0,u)}),t}function wt(e){let t=e.split("/");if(t.length===0)return[];let[n,...o]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(o.length===0)return s?[a,""]:[a];let i=wt(o.join("/")),l=[];return l.push(...i.map(d=>d===""?a:[a,d].join("/"))),s&&l.push(...i),l.map(d=>e.startsWith("/")&&d===""?"/":d)}function ln(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:gn(t.routesMeta.map(o=>o.childrenIndex),n.routesMeta.map(o=>o.childrenIndex)))}var cn=/^:[\w-]+$/,dn=3,un=2,pn=1,hn=10,mn=-2,Ke=e=>e==="*";function fn(e,t){let n=e.split("/"),o=n.length;return n.some(Ke)&&(o+=mn),t&&(o+=un),n.filter(s=>!Ke(s)).reduce((s,a)=>s+(cn.test(a)?dn:a===""?pn:hn),o)}function gn(e,t){return e.length===t.length&&e.slice(0,-1).every((o,s)=>o===t[s])?e[e.length-1]-t[t.length-1]:0}function yn(e,t,n=!1){let{routesMeta:o}=e,s={},a="/",i=[];for(let l=0;l<o.length;++l){let d=o[l],u=l===o.length-1,p=a==="/"?t:t.slice(a.length)||"/",h=xe({path:d.relativePath,caseSensitive:d.caseSensitive,end:u},p),m=d.route;if(!h&&u&&n&&!o[o.length-1].route.index&&(h=xe({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},p)),!h)return null;Object.assign(s,h.params),i.push({params:s,pathname:O([a,h.pathname]),pathnameBase:jn(O([a,h.pathnameBase])),route:m}),h.pathnameBase!=="/"&&(a=O([a,h.pathnameBase]))}return i}function xe(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,o]=xn(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],i=a.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:o.reduce((u,{paramName:p,isOptional:h},m)=>{if(p==="*"){let _=l[m]||"";i=a.slice(0,a.length-_.length).replace(/(.)\/+$/,"$1")}const x=l[m];return h&&!x?u[p]=void 0:u[p]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:i,pattern:e}}function xn(e,t=!1,n=!0){F(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let o=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,d,u,p)=>{if(o.push({paramName:l,isOptional:d!=null}),d){let h=p.charAt(u+i.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(o.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),o]}function _n(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return F(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function H(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,o=e.charAt(n);return o&&o!=="/"?null:e.slice(n)||"/"}var vn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function bn(e,t="/"){let{pathname:n,search:o="",hash:s=""}=typeof e=="string"?Q(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=Xe(n.substring(1),"/"):a=Xe(n,t)):a=t,{pathname:a,search:kn(o),hash:Cn(s)}}function Xe(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function je(e,t,n,o){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function wn(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function jt(e){let t=wn(e);return t.map((n,o)=>o===t.length-1?n.pathname:n.pathnameBase)}function Ae(e,t,n,o=!1){let s;typeof e=="string"?s=Q(e):(s={...e},C(!s.pathname||!s.pathname.includes("?"),je("?","pathname","search",s)),C(!s.pathname||!s.pathname.includes("#"),je("#","pathname","hash",s)),C(!s.search||!s.search.includes("#"),je("#","search","hash",s)));let a=e===""||s.pathname==="",i=a?"/":s.pathname,l;if(i==null)l=n;else{let h=t.length-1;if(!o&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),h-=1;s.pathname=m.join("/")}l=h>=0?t[h]:"/"}let d=bn(s,l),u=i&&i!=="/"&&i.endsWith("/"),p=(a||i===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(u||p)&&(d.pathname+="/"),d}var O=e=>e.join("/").replace(/\/\/+/g,"/"),jn=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),kn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Cn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Sn=class{constructor(e,t,n,o=!1){this.status=e,this.statusText=t||"",this.internal=o,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Rn(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function En(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var kt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ct(e,t){let n=e;if(typeof n!="string"||!vn.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let o=n,s=!1;if(kt)try{let a=new URL(window.location.href),i=n.startsWith("//")?new URL(a.protocol+n):new URL(n),l=H(i.pathname,t);i.origin===a.origin&&l!=null?n=l+i.search+i.hash:s=!0}catch{F(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var St=["POST","PUT","PATCH","DELETE"];new Set(St);var Nn=["GET",...St];new Set(Nn);var ee=c.createContext(null);ee.displayName="DataRouter";var ve=c.createContext(null);ve.displayName="DataRouterState";var Rt=c.createContext(!1);function Ln(){return c.useContext(Rt)}var Et=c.createContext({isTransitioning:!1});Et.displayName="ViewTransition";var Bn=c.createContext(new Map);Bn.displayName="Fetchers";var $n=c.createContext(null);$n.displayName="Await";var D=c.createContext(null);D.displayName="Navigation";var oe=c.createContext(null);oe.displayName="Location";var z=c.createContext({outlet:null,matches:[],isDataRoute:!1});z.displayName="Route";var Ie=c.createContext(null);Ie.displayName="RouteError";var Nt="REACT_ROUTER_ERROR",Pn="REDIRECT",Tn="ROUTE_ERROR_RESPONSE";function An(e){if(e.startsWith(`${Nt}:${Pn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function In(e){if(e.startsWith(`${Nt}:${Tn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Sn(t.status,t.statusText,t.data)}catch{}}function Dn(e,{relative:t}={}){C(se(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:o}=c.useContext(D),{hash:s,pathname:a,search:i}=ae(e,{relative:t}),l=a;return n!=="/"&&(l=a==="/"?n:O([n,a])),o.createHref({pathname:l,search:i,hash:s})}function se(){return c.useContext(oe)!=null}function U(){return C(se(),"useLocation() may be used only in the context of a <Router> component."),c.useContext(oe).location}var Lt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Bt(e){c.useContext(D).static||c.useLayoutEffect(e)}function Mn(){let{isDataRoute:e}=c.useContext(z);return e?Yn():Wn()}function Wn(){C(se(),"useNavigate() may be used only in the context of a <Router> component.");let e=c.useContext(ee),{basename:t,navigator:n}=c.useContext(D),{matches:o}=c.useContext(z),{pathname:s}=U(),a=JSON.stringify(jt(o)),i=c.useRef(!1);return Bt(()=>{i.current=!0}),c.useCallback((d,u={})=>{if(F(i.current,Lt),!i.current)return;if(typeof d=="number"){n.go(d);return}let p=Ae(d,JSON.parse(a),s,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:O([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,a,s,e])}c.createContext(null);function ae(e,{relative:t}={}){let{matches:n}=c.useContext(z),{pathname:o}=U(),s=JSON.stringify(jt(n));return c.useMemo(()=>Ae(e,JSON.parse(s),o,t==="path"),[e,s,o,t])}function On(e,t){return $t(e,t)}function $t(e,t,n){var y;C(se(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=c.useContext(D),{matches:s}=c.useContext(z),a=s[s.length-1],i=a?a.params:{},l=a?a.pathname:"/",d=a?a.pathnameBase:"/",u=a&&a.route;{let g=u&&u.path||"";Tt(l,!u||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${g}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
12
-
13
- Please change the parent <Route path="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let p=U(),h;if(t){let g=typeof t=="string"?Q(t):t;C(d==="/"||((y=g.pathname)==null?void 0:y.startsWith(d)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${g.pathname}" was given in the \`location\` prop.`),h=g}else h=p;let m=h.pathname||"/",x=m;if(d!=="/"){let g=d.replace(/^\//,"").split("/");x="/"+m.replace(/^\//,"").split("/").slice(g.length).join("/")}let _=vt(e,{pathname:x});F(u||_!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),F(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let f=qn(_&&_.map(g=>Object.assign({},g,{params:Object.assign({},i,g.params),pathname:O([d,o.encodeLocation?o.encodeLocation(g.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?d:O([d,o.encodeLocation?o.encodeLocation(g.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),s,n);return t&&f?c.createElement(oe.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...h},navigationType:"POP"}},f):f}function Fn(){let e=Xn(),t=Rn(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:o},a={padding:"2px 4px",backgroundColor:o},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=c.createElement(c.Fragment,null,c.createElement("p",null,"💿 Hey developer 👋"),c.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",c.createElement("code",{style:a},"ErrorBoundary")," or"," ",c.createElement("code",{style:a},"errorElement")," prop on your route.")),c.createElement(c.Fragment,null,c.createElement("h2",null,"Unexpected Application Error!"),c.createElement("h3",{style:{fontStyle:"italic"}},t),n?c.createElement("pre",{style:s},n):null,i)}var Hn=c.createElement(Fn,null),Pt=class extends c.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=In(e.digest);n&&(e=n)}let t=e!==void 0?c.createElement(z.Provider,{value:this.props.routeContext},c.createElement(Ie.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?c.createElement(zn,{error:e},t):t}};Pt.contextType=Rt;var ke=new WeakMap;function zn({children:e,error:t}){let{basename:n}=c.useContext(D);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=An(t.digest);if(o){let s=ke.get(t);if(s)throw s;let a=Ct(o.location,n);if(kt&&!ke.get(t))if(a.isExternal||o.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:o.replace}));throw ke.set(t,i),i}return c.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function Un({routeContext:e,match:t,children:n}){let o=c.useContext(ee);return o&&o.static&&o.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=t.route.id),c.createElement(z.Provider,{value:e},n)}function qn(e,t=[],n){let o=n==null?void 0:n.state;if(e==null){if(!o)return null;if(o.errors)e=o.matches;else if(t.length===0&&!o.initialized&&o.matches.length>0)e=o.matches;else return null}let s=e,a=o==null?void 0:o.errors;if(a!=null){let p=s.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id])!==void 0);C(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),s=s.slice(0,Math.min(s.length,p+1))}let i=!1,l=-1;if(n&&o){i=o.renderFallback;for(let p=0;p<s.length;p++){let h=s[p];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(l=p),h.route.id){let{loaderData:m,errors:x}=o,_=h.route.loader&&!m.hasOwnProperty(h.route.id)&&(!x||x[h.route.id]===void 0);if(h.route.lazy||_){n.isStatic&&(i=!0),l>=0?s=s.slice(0,l+1):s=[s[0]];break}}}}let d=n==null?void 0:n.onError,u=o&&d?(p,h)=>{var m,x;d(p,{location:o.location,params:((x=(m=o.matches)==null?void 0:m[0])==null?void 0:x.params)??{},unstable_pattern:En(o.matches),errorInfo:h})}:void 0;return s.reduceRight((p,h,m)=>{let x,_=!1,f=null,y=null;o&&(x=a&&h.route.id?a[h.route.id]:void 0,f=h.route.errorElement||Hn,i&&(l<0&&m===0?(Tt("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,y=null):l===m&&(_=!0,y=h.route.hydrateFallbackElement||null)));let g=t.concat(s.slice(0,m+1)),b=()=>{let v;return x?v=f:_?v=y:h.route.Component?v=c.createElement(h.route.Component,null):h.route.element?v=h.route.element:v=p,c.createElement(Un,{match:h,routeContext:{outlet:p,matches:g,isDataRoute:o!=null},children:v})};return o&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?c.createElement(Pt,{location:o.location,revalidation:o.revalidation,component:f,error:x,children:b(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:u}):b()},null)}function De(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vn(e){let t=c.useContext(ee);return C(t,De(e)),t}function Gn(e){let t=c.useContext(ve);return C(t,De(e)),t}function Jn(e){let t=c.useContext(z);return C(t,De(e)),t}function Me(e){let t=Jn(e),n=t.matches[t.matches.length-1];return C(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Kn(){return Me("useRouteId")}function Xn(){var o;let e=c.useContext(Ie),t=Gn("useRouteError"),n=Me("useRouteError");return e!==void 0?e:(o=t.errors)==null?void 0:o[n]}function Yn(){let{router:e}=Vn("useNavigate"),t=Me("useNavigate"),n=c.useRef(!1);return Bt(()=>{n.current=!0}),c.useCallback(async(s,a={})=>{F(n.current,Lt),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...a}))},[e,t])}var Ye={};function Tt(e,t,n){!t&&!Ye[e]&&(Ye[e]=!0,F(!1,n))}c.memo(Zn);function Zn({routes:e,future:t,state:n,isStatic:o,onError:s}){return $t(e,void 0,{state:n,isStatic:o,onError:s})}function At(e){C(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Qn({basename:e="/",children:t=null,location:n,navigationType:o="POP",navigator:s,static:a=!1,unstable_useTransitions:i}){C(!se(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),d=c.useMemo(()=>({basename:l,navigator:s,static:a,unstable_useTransitions:i,future:{}}),[l,s,a,i]);typeof n=="string"&&(n=Q(n));let{pathname:u="/",search:p="",hash:h="",state:m=null,key:x="default",unstable_mask:_}=n,f=c.useMemo(()=>{let y=H(u,l);return y==null?null:{location:{pathname:y,search:p,hash:h,state:m,key:x,unstable_mask:_},navigationType:o}},[l,u,p,h,m,x,o,_]);return F(f!=null,`<Router basename="${l}"> is not able to match the URL "${u}${p}${h}" because it does not start with the basename, so the <Router> won't render anything.`),f==null?null:c.createElement(D.Provider,{value:d},c.createElement(oe.Provider,{children:t,value:f}))}function er({children:e,location:t}){return On(Be(e),t)}function Be(e,t=[]){let n=[];return c.Children.forEach(e,(o,s)=>{if(!c.isValidElement(o))return;let a=[...t,s];if(o.type===c.Fragment){n.push.apply(n,Be(o.props.children,a));return}C(o.type===At,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),C(!o.props.index||!o.props.children,"An index route cannot have child routes.");let i={id:o.props.id||a.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(i.children=Be(o.props.children,a)),n.push(i)}),n}var fe="get",ge="application/x-www-form-urlencoded";function be(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function tr(e){return be(e)&&e.tagName.toLowerCase()==="button"}function nr(e){return be(e)&&e.tagName.toLowerCase()==="form"}function rr(e){return be(e)&&e.tagName.toLowerCase()==="input"}function or(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function sr(e,t){return e.button===0&&(!t||t==="_self")&&!or(e)}var de=null;function ar(){if(de===null)try{new FormData(document.createElement("form"),0),de=!1}catch{de=!0}return de}var ir=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ce(e){return e!=null&&!ir.has(e)?(F(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ge}"`),null):e}function lr(e,t){let n,o,s,a,i;if(nr(e)){let l=e.getAttribute("action");o=l?H(l,t):null,n=e.getAttribute("method")||fe,s=Ce(e.getAttribute("enctype"))||ge,a=new FormData(e)}else if(tr(e)||rr(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||l.getAttribute("action");if(o=d?H(d,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||fe,s=Ce(e.getAttribute("formenctype"))||Ce(l.getAttribute("enctype"))||ge,a=new FormData(l,e),!ar()){let{name:u,type:p,value:h}=e;if(p==="image"){let m=u?`${u}.`:"";a.append(`${m}x`,"0"),a.append(`${m}y`,"0")}else u&&a.append(u,h)}}else{if(be(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=fe,o=null,s=ge,i=e}return a&&s==="text/plain"&&(i=a,a=void 0),{action:o,method:n.toLowerCase(),encType:s,formData:a,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function We(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function It(e,t,n,o){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${o}`:s.pathname=`${s.pathname}.${o}`:s.pathname==="/"?s.pathname=`_root.${o}`:t&&H(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${o}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${o}`,s}async function cr(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function dr(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function ur(e,t,n){let o=await Promise.all(e.map(async s=>{let a=t.routes[s.route.id];if(a){let i=await cr(a,n);return i.links?i.links():[]}return[]}));return fr(o.flat(1).filter(dr).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Ze(e,t,n,o,s,a){let i=(d,u)=>n[u]?d.route.id!==n[u].route.id:!0,l=(d,u)=>{var p;return n[u].pathname!==d.pathname||((p=n[u].route.path)==null?void 0:p.endsWith("*"))&&n[u].params["*"]!==d.params["*"]};return a==="assets"?t.filter((d,u)=>i(d,u)||l(d,u)):a==="data"?t.filter((d,u)=>{var h;let p=o.routes[d.route.id];if(!p||!p.hasLoader)return!1;if(i(d,u)||l(d,u))return!0;if(d.route.shouldRevalidate){let m=d.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((h=n[0])==null?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function pr(e,t,{includeHydrateFallback:n}={}){return hr(e.map(o=>{let s=t.routes[o.route.id];if(!s)return[];let a=[s.module];return s.clientActionModule&&(a=a.concat(s.clientActionModule)),s.clientLoaderModule&&(a=a.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(a=a.concat(s.hydrateFallbackModule)),s.imports&&(a=a.concat(s.imports)),a}).flat(1))}function hr(e){return[...new Set(e)]}function mr(e){let t={},n=Object.keys(e).sort();for(let o of n)t[o]=e[o];return t}function fr(e,t){let n=new Set;return new Set(t),e.reduce((o,s)=>{let a=JSON.stringify(mr(s));return n.has(a)||(n.add(a),o.push({key:a,link:s})),o},[])}function Oe(){let e=c.useContext(ee);return We(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function gr(){let e=c.useContext(ve);return We(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Fe=c.createContext(void 0);Fe.displayName="FrameworkContext";function He(){let e=c.useContext(Fe);return We(e,"You must render this element inside a <HydratedRouter> element"),e}function yr(e,t){let n=c.useContext(Fe),[o,s]=c.useState(!1),[a,i]=c.useState(!1),{onFocus:l,onBlur:d,onMouseEnter:u,onMouseLeave:p,onTouchStart:h}=t,m=c.useRef(null);c.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let f=g=>{g.forEach(b=>{i(b.isIntersecting)})},y=new IntersectionObserver(f,{threshold:.5});return m.current&&y.observe(m.current),()=>{y.disconnect()}}},[e]),c.useEffect(()=>{if(o){let f=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(f)}}},[o]);let x=()=>{s(!0)},_=()=>{s(!1),i(!1)};return n?e!=="intent"?[a,m,{}]:[a,m,{onFocus:te(l,x),onBlur:te(d,_),onMouseEnter:te(u,x),onMouseLeave:te(p,_),onTouchStart:te(h,x)}]:[!1,m,{}]}function te(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function xr({page:e,...t}){let n=Ln(),{router:o}=Oe(),s=c.useMemo(()=>vt(o.routes,e,o.basename),[o.routes,e,o.basename]);return s?n?c.createElement(vr,{page:e,matches:s,...t}):c.createElement(br,{page:e,matches:s,...t}):null}function _r(e){let{manifest:t,routeModules:n}=He(),[o,s]=c.useState([]);return c.useEffect(()=>{let a=!1;return ur(e,t,n).then(i=>{a||s(i)}),()=>{a=!0}},[e,t,n]),o}function vr({page:e,matches:t,...n}){let o=U(),{future:s}=He(),{basename:a}=Oe(),i=c.useMemo(()=>{if(e===o.pathname+o.search+o.hash)return[];let l=It(e,a,s.unstable_trailingSlashAwareDataRequests,"rsc"),d=!1,u=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?d=!0:u.push(p.route.id);return d&&u.length>0&&l.searchParams.set("_routes",u.join(",")),[l.pathname+l.search]},[a,s.unstable_trailingSlashAwareDataRequests,e,o,t]);return c.createElement(c.Fragment,null,i.map(l=>c.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...n})))}function br({page:e,matches:t,...n}){let o=U(),{future:s,manifest:a,routeModules:i}=He(),{basename:l}=Oe(),{loaderData:d,matches:u}=gr(),p=c.useMemo(()=>Ze(e,t,u,a,o,"data"),[e,t,u,a,o]),h=c.useMemo(()=>Ze(e,t,u,a,o,"assets"),[e,t,u,a,o]),m=c.useMemo(()=>{if(e===o.pathname+o.search+o.hash)return[];let f=new Set,y=!1;if(t.forEach(b=>{var E;let v=a.routes[b.route.id];!v||!v.hasLoader||(!p.some(R=>R.route.id===b.route.id)&&b.route.id in d&&((E=i[b.route.id])!=null&&E.shouldRevalidate)||v.hasClientLoader?y=!0:f.add(b.route.id))}),f.size===0)return[];let g=It(e,l,s.unstable_trailingSlashAwareDataRequests,"data");return y&&f.size>0&&g.searchParams.set("_routes",t.filter(b=>f.has(b.route.id)).map(b=>b.route.id).join(",")),[g.pathname+g.search]},[l,s.unstable_trailingSlashAwareDataRequests,d,o,a,p,t,e,i]),x=c.useMemo(()=>pr(h,a),[h,a]),_=_r(h);return c.createElement(c.Fragment,null,m.map(f=>c.createElement("link",{key:f,rel:"prefetch",as:"fetch",href:f,...n})),x.map(f=>c.createElement("link",{key:f,rel:"modulepreload",href:f,...n})),_.map(({key:f,link:y})=>c.createElement("link",{key:f,nonce:n.nonce,...y,crossOrigin:y.crossOrigin??n.crossOrigin})))}function wr(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var jr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{jr&&(window.__reactRouterVersion="7.14.0")}catch{}function kr({basename:e,children:t,unstable_useTransitions:n,window:o}){let s=c.useRef();s.current==null&&(s.current=nn({window:o,v5Compat:!0}));let a=s.current,[i,l]=c.useState({action:a.action,location:a.location}),d=c.useCallback(u=>{n===!1?l(u):c.startTransition(()=>l(u))},[n]);return c.useLayoutEffect(()=>a.listen(d),[a,d]),c.createElement(Qn,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:a,unstable_useTransitions:n})}var Dt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Mt=c.forwardRef(function({onClick:t,discover:n="render",prefetch:o="none",relative:s,reloadDocument:a,replace:i,unstable_mask:l,state:d,target:u,to:p,preventScrollReset:h,viewTransition:m,unstable_defaultShouldRevalidate:x,..._},f){let{basename:y,navigator:g,unstable_useTransitions:b}=c.useContext(D),v=typeof p=="string"&&Dt.test(p),E=Ct(p,y);p=E.to;let R=Dn(p,{relative:s}),j=U(),B=null;if(l){let G=Ae(l,[],j.unstable_mask?j.unstable_mask.pathname:"/",!0);y!=="/"&&(G.pathname=G.pathname==="/"?y:O([y,G.pathname])),B=g.createHref(G)}let[q,V,Y]=yr(o,_),ie=Er(p,{replace:i,unstable_mask:l,state:d,target:u,preventScrollReset:h,relative:s,viewTransition:m,unstable_defaultShouldRevalidate:x,unstable_useTransitions:b});function we(G){t&&t(G),G.defaultPrevented||ie(G)}let le=!(E.isExternal||a),ce=c.createElement("a",{..._,...Y,href:(le?B:void 0)||E.absoluteURL||R,onClick:le?we:t,ref:wr(f,V),target:u,"data-discover":!v&&n==="render"?"true":void 0});return q&&!v?c.createElement(c.Fragment,null,ce,c.createElement(xr,{page:R})):ce});Mt.displayName="Link";var Cr=c.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:o="",end:s=!1,style:a,to:i,viewTransition:l,children:d,...u},p){let h=ae(i,{relative:u.relative}),m=U(),x=c.useContext(ve),{navigator:_,basename:f}=c.useContext(D),y=x!=null&&Pr(h)&&l===!0,g=_.encodeLocation?_.encodeLocation(h).pathname:h.pathname,b=m.pathname,v=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(b=b.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&f&&(v=H(v,f)||v);const E=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let R=b===g||!s&&b.startsWith(g)&&b.charAt(E)==="/",j=v!=null&&(v===g||!s&&v.startsWith(g)&&v.charAt(g.length)==="/"),B={isActive:R,isPending:j,isTransitioning:y},q=R?t:void 0,V;typeof o=="function"?V=o(B):V=[o,R?"active":null,j?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let Y=typeof a=="function"?a(B):a;return c.createElement(Mt,{...u,"aria-current":q,className:V,ref:p,style:Y,to:i,viewTransition:l},typeof d=="function"?d(B):d)});Cr.displayName="NavLink";var Sr=c.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:o,replace:s,state:a,method:i=fe,action:l,onSubmit:d,relative:u,preventScrollReset:p,viewTransition:h,unstable_defaultShouldRevalidate:m,...x},_)=>{let{unstable_useTransitions:f}=c.useContext(D),y=Br(),g=$r(l,{relative:u}),b=i.toLowerCase()==="get"?"get":"post",v=typeof l=="string"&&Dt.test(l),E=R=>{if(d&&d(R),R.defaultPrevented)return;R.preventDefault();let j=R.nativeEvent.submitter,B=(j==null?void 0:j.getAttribute("formmethod"))||i,q=()=>y(j||R.currentTarget,{fetcherKey:t,method:B,navigate:n,replace:s,state:a,relative:u,preventScrollReset:p,viewTransition:h,unstable_defaultShouldRevalidate:m});f&&n!==!1?c.startTransition(()=>q()):q()};return c.createElement("form",{ref:_,method:b,action:g,onSubmit:o?d:E,...x,"data-discover":!v&&e==="render"?"true":void 0})});Sr.displayName="Form";function Rr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Wt(e){let t=c.useContext(ee);return C(t,Rr(e)),t}function Er(e,{target:t,replace:n,unstable_mask:o,state:s,preventScrollReset:a,relative:i,viewTransition:l,unstable_defaultShouldRevalidate:d,unstable_useTransitions:u}={}){let p=Mn(),h=U(),m=ae(e,{relative:i});return c.useCallback(x=>{if(sr(x,t)){x.preventDefault();let _=n!==void 0?n:re(h)===re(m),f=()=>p(e,{replace:_,unstable_mask:o,state:s,preventScrollReset:a,relative:i,viewTransition:l,unstable_defaultShouldRevalidate:d});u?c.startTransition(()=>f()):f()}},[h,p,m,n,o,s,t,e,a,i,l,d,u])}var Nr=0,Lr=()=>`__${String(++Nr)}__`;function Br(){let{router:e}=Wt("useSubmit"),{basename:t}=c.useContext(D),n=Kn(),o=e.fetch,s=e.navigate;return c.useCallback(async(a,i={})=>{let{action:l,method:d,encType:u,formData:p,body:h}=lr(a,t);if(i.navigate===!1){let m=i.fetcherKey||Lr();await o(m,n,i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:p,body:h,formMethod:i.method||d,formEncType:i.encType||u,flushSync:i.flushSync})}else await s(i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:p,body:h,formMethod:i.method||d,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[o,s,t,n])}function $r(e,{relative:t}={}){let{basename:n}=c.useContext(D),o=c.useContext(z);C(o,"useFormAction must be used inside a RouteContext");let[s]=o.matches.slice(-1),a={...ae(e||".",{relative:t})},i=U();if(e==null){a.search=i.search;let l=new URLSearchParams(a.search),d=l.getAll("index");if(d.some(p=>p==="")){l.delete("index"),d.filter(h=>h).forEach(h=>l.append("index",h));let p=l.toString();a.search=p?`?${p}`:""}}return(!e||e===".")&&s.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:O([n,a.pathname])),re(a)}function Pr(e,{relative:t}={}){let n=c.useContext(Et);C(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=Wt("useViewTransitionState"),s=ae(e,{relative:t});if(!n.isTransitioning)return!1;let a=H(n.currentLocation.pathname,o)||n.currentLocation.pathname,i=H(n.nextLocation.pathname,o)||n.nextLocation.pathname;return xe(s.pathname,i)!=null||xe(s.pathname,a)!=null}const L={secondaryText:"#9d9d9d",background:"#1f1f1f",boxBackgroundDark:"#181818",boxBackgroundLight:"#2a2a2a",iconActiveColor:"#fff",borderColor:"#2b2b2b"},Tr="_container_ouz5l_7",Ar="_content_ouz5l_15",Qe={container:Tr,content:Ar},Ir="_container_68abd_1",Dr="_title_68abd_12",Mr="_addAgentBtn_68abd_23",Wr="_agentActive_68abd_42",Or="_agentBadge_68abd_50",Fr="_removeAgentBtn_68abd_56",Z={container:Ir,title:Dr,addAgentBtn:Mr,agentActive:Wr,agentBadge:Or,removeAgentBtn:Fr},Hr=({onAddAgent:e,onRemoveAgent:t})=>{const n=M(mt),o=M(Pe);return r.jsxs("div",{style:{backgroundColor:L.boxBackgroundDark,borderBottomColor:L.borderColor},className:Z.container,children:[r.jsx("p",{style:{color:L.secondaryText,backgroundColor:L.boxBackgroundLight},className:Z.title,children:n?n.app.name:"Loading..."}),o!=="installed"&&r.jsx("button",{className:Z.addAgentBtn,onClick:e,title:"Установить Debug Agent в целевой проект",children:o==="installing"?"Установка...":"+ Add Agent"}),o==="installed"&&r.jsxs("div",{className:Z.agentActive,children:[r.jsx("span",{className:Z.agentBadge,children:"🟢 Agent active"}),r.jsx("button",{className:Z.removeAgentBtn,onClick:t,title:"Удалить Debug Agent из проекта",children:"Remove"})]})]})},zr=({color:e="#000000"})=>r.jsx("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",fill:"none",children:r.jsx("path",{d:"M14 6H9C7.89543 6 7 6.89543 7 8V20C7 21.1046 7.89543 22 9 22H18C19.1046 22 20 21.1046 20 20V12M14 6L20 12M14 6V11C14 11.5523 14.4477 12 15 12H20M3 16V4C3 2.89543 3.89543 2 5 2H15",stroke:e,strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})}),Ur=({color:e="#fff",size:t=20})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("ellipse",{cx:"10",cy:"11",rx:"4.5",ry:"5.5",stroke:e,strokeWidth:"1.5"}),r.jsx("path",{d:"M7.5 6.5C7.5 5.12 8.62 4 10 4s2.5 1.12 2.5 2.5",stroke:e,strokeWidth:"1.5",strokeLinecap:"round"}),r.jsx("path",{d:"M8.5 4.5L7 3M11.5 4.5L13 3",stroke:e,strokeWidth:"1.5",strokeLinecap:"round"}),r.jsx("path",{d:"M5.5 9H3M5.5 11H3M5.5 13H3",stroke:e,strokeWidth:"1.5",strokeLinecap:"round"}),r.jsx("path",{d:"M14.5 9H17M14.5 11H17M14.5 13H17",stroke:e,strokeWidth:"1.5",strokeLinecap:"round"}),r.jsx("path",{d:"M10 6.5V16.5",stroke:e,strokeWidth:"1",strokeLinecap:"round",strokeDasharray:"1.5 2"})]}),qr="_container_1qpxp_1",Vr="_iconContainer_1qpxp_11",Se={container:qr,iconContainer:Vr},Gr=({mode:e,onModeChange:t})=>{const n=M(Pe);return r.jsxs("div",{className:Se.container,style:{backgroundColor:L.boxBackgroundDark,borderRightColor:L.borderColor},children:[r.jsx("div",{className:Se.iconContainer,style:{opacity:e==="files"?1:.5},onClick:()=>t("files"),title:"Files",children:r.jsx(zr,{color:L.iconActiveColor})}),n==="installed"&&r.jsx("div",{className:Se.iconContainer,style:{opacity:e==="debug"?1:.5},onClick:()=>t("debug"),title:"Debug",children:r.jsx(Ur,{color:L.iconActiveColor,size:"24px"})})]})},Jr="_item_1s5pl_1",Kr="_row_1s5pl_5",Xr="_rowSelected_1s5pl_21",Yr="_caret_1s5pl_29",Zr="_icon_1s5pl_37",Qr="_name_1s5pl_44",eo="_gitBadge_1s5pl_55",to="_modified_1s5pl_66",no="_untracked_1s5pl_67",ro="_added_1s5pl_68",oo="_deleted_1s5pl_69",so="_renamed_1s5pl_70",ao="_conflicted_1s5pl_71",io="_nameModified_1s5pl_75",lo="_nameUntracked_1s5pl_76",co="_nameAdded_1s5pl_77",uo="_nameDeleted_1s5pl_78",po="_nameRenamed_1s5pl_79",ho="_nameConflicted_1s5pl_80",mo="_children_1s5pl_82",fo="_emptyFolder_1s5pl_86",S={item:Jr,row:Kr,rowSelected:Xr,caret:Yr,icon:Zr,name:Qr,gitBadge:eo,modified:to,untracked:no,added:ro,deleted:oo,renamed:so,conflicted:ao,nameModified:io,nameUntracked:lo,nameAdded:co,nameDeleted:uo,nameRenamed:po,nameConflicted:ho,children:mo,emptyFolder:fo},go={modified:"M",untracked:"U",added:"A",deleted:"D",renamed:"R",conflicted:"!",clean:""},yo={modified:S.nameModified,untracked:S.nameUntracked,added:S.nameAdded,deleted:S.nameDeleted,renamed:S.nameRenamed,conflicted:S.nameConflicted,clean:""},xo={modified:S.modified,untracked:S.untracked,added:S.added,deleted:S.deleted,renamed:S.renamed,conflicted:S.conflicted,clean:""},Ot=({name:e,path:t,type:n,gitStatus:o,children:s,depth:a=0,selectedPath:i,onFileClick:l})=>{const[d,u]=c.useState(!1),p=n==="folder",h=((s==null?void 0:s.length)??0)>0,m=!p&&t===i,x=()=>{if(p){h&&u(v=>!v);return}l==null||l({name:e,path:t,type:n,gitStatus:o,children:s})},_={"--depth":a},f=[S.row,m?S.rowSelected:""].filter(Boolean).join(" "),y=o&&o!=="clean"?`${S.name} ${yo[o]}`:S.name,g=o?go[o]:"",b=o&&o!=="clean"?`${S.gitBadge} ${xo[o]}`:"";return r.jsxs("div",{className:S.item,children:[r.jsxs("div",{className:f,style:_,onClick:x,children:[r.jsx("span",{className:S.caret,children:p?d?"▾":"▸":""}),r.jsx("span",{className:S.icon,children:p?"📂":"📄"}),r.jsx("span",{className:y,children:e}),g&&r.jsx("span",{className:b,children:g})]}),p&&d&&h?r.jsx("div",{className:S.children,children:s.map(v=>r.jsx(Ot,{depth:a+1,selectedPath:i,onFileClick:l,...v},v.path))}):null,p&&d&&!h?r.jsx("div",{className:S.emptyFolder,style:_,children:"Пусто"}):null]})},_o="_container_l154g_1",vo="_empty_l154g_16",bo="_resizer_l154g_22",Re={container:_o,empty:vo,resizer:bo},wo=()=>{const e=X(),t=M(mt),n=M(Te),o=(t==null?void 0:t.tree)??[],[s,a]=c.useState(200),i=c.useRef(!1),l=c.useRef(0),d=c.useRef(200),u=x=>{if(!i.current)return;const _=x.clientX-l.current,f=Math.max(140,Math.min(480,d.current+_));a(f)},p=()=>{i.current=!1,window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",p)},h=x=>{x.preventDefault(),i.current=!0,l.current=x.clientX,d.current=s,window.addEventListener("mousemove",u),window.addEventListener("mouseup",p)},m=c.useMemo(()=>({width:`${s}px`,backgroundColor:L.boxBackgroundDark,borderRightColor:L.borderColor}),[s]);return r.jsxs("div",{className:Re.container,style:m,children:[o.length===0?r.jsx("div",{className:Re.empty,children:"Нет файлов"}):o.map(x=>r.jsx(Ot,{...x,selectedPath:n==null?void 0:n.path,onFileClick:_=>{e(ft(_.path))}},x.path)),r.jsx("div",{className:Re.resizer,onMouseDown:h})]})},jo="ws://localhost:3333/ws",et=3e3,ko=()=>{const e=X(),t=c.useRef(null),n=c.useRef(null),o=M(Te),s=c.useRef(o);s.current=o,c.useEffect(()=>{const a=()=>{const i=new WebSocket(jo);t.current=i,i.onopen=()=>{console.log("🔌 WebSocket connected"),n.current&&(clearTimeout(n.current),n.current=null)},i.onmessage=l=>{var d;try{const u=JSON.parse(l.data);u.type==="connected"&&console.log("✅ Watcher ready"),u.type==="tree_changed"&&(console.log("🌳 Tree changed — refetching..."),e(gt())),u.type==="file_changed"&&(console.log(`📝 File changed: ${u.path}`),((d=s.current)==null?void 0:d.path)===u.path&&(console.log(`🔄 Reloading open file: ${u.path}`),e(ft(u.path))))}catch(u){console.error("WebSocket parse error:",u)}},i.onclose=()=>{console.warn(`⚠️ WebSocket disconnected — reconnecting in ${et}ms...`),n.current=setTimeout(a,et)},i.onerror=l=>{console.error("❌ WebSocket error:",l),i.close()}};return a(),()=>{var i;n.current&&clearTimeout(n.current),(i=t.current)==null||i.close()}},[e])},Co="modulepreload",So=function(e){return"/"+e},tt={},Ro=function(t,n,o){let s=Promise.resolve();if(n&&n.length>0){let i=function(u){return Promise.all(u.map(p=>Promise.resolve(p).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),d=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=i(n.map(u=>{if(u=So(u),u in tt)return;tt[u]=!0;const p=u.endsWith(".css"),h=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${h}`))return;const m=document.createElement("link");if(m.rel=p?"stylesheet":Co,p||(m.as="script"),m.crossOrigin="",m.href=u,d&&m.setAttribute("nonce",d),document.head.appendChild(m),p)return new Promise((x,_)=>{m.addEventListener("load",x),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${u}`)))})}))}function a(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return s.then(i=>{for(const l of i||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})},Eo=c.lazy(()=>Ro(()=>import("./monaco-vendor-Bo5GWDbL.js"),__vite__mapDeps([0,1]))),ye=({fallbackHeight:e="100%",...t})=>r.jsx(c.Suspense,{fallback:r.jsx("div",{style:{height:e,display:"flex",alignItems:"center",justifyContent:"center",color:"#555",fontSize:12,fontFamily:"monospace"},children:"Loading editor…"}),children:r.jsx(Eo,{...t})}),No="_container_10tzd_1",Lo="_loading_10tzd_7",nt={container:No,loading:Lo},rt=({filePath:e,content:t,language:n,compact:o=!1})=>r.jsx("div",{className:nt.container,children:r.jsx(ye,{path:e,language:n,value:t,theme:"vs-dark",fallbackHeight:"100%",loading:r.jsx("div",{className:nt.loading,style:{color:L.secondaryText},children:"Загрузка редактора..."}),options:{readOnly:!0,minimap:{enabled:!o},fontSize:14,wordWrap:"on",automaticLayout:!0,scrollBeyondLastLine:!1,smoothScrolling:!0,renderLineHighlight:"line",padding:{top:12,bottom:12}}})}),Bo=e=>{var n;switch((n=e.split(".").pop())==null?void 0:n.toLowerCase()){case"ts":case"tsx":return"typescript";case"js":case"jsx":return"javascript";case"json":return"json";case"css":return"css";case"scss":return"scss";case"less":return"less";case"html":return"html";case"md":return"markdown";case"yml":case"yaml":return"yaml";case"xml":case"svg":return"xml";case"sh":case"bash":case"zsh":return"shell";case"py":return"python";case"go":return"go";case"rs":return"rust";case"java":return"java";case"c":case"h":return"c";case"cpp":case"hpp":return"cpp";case"toml":return"ini";case"graphql":case"gql":return"graphql";case"prisma":return"prisma";case"sql":return"sql";case"dockerfile":return"dockerfile";default:return"plaintext"}},$o=new Set(["png","jpg","jpeg","gif","webp","bmp","ico","avif"]),ot=new Set(["svg"]),Po=new Set(["mp4","webm","ogg","mov"]),To=new Set(["mp3","wav","ogg","m4a","aac","flac"]),Ao=new Set(["js","jsx","ts","tsx","json"]),Io=e=>{const t=e.trim().replace(/;$/,"").trimEnd();return t.startsWith("<svg")||t.startsWith("<?xml")||t.includes("<svg")&&t.includes("</svg>")},Do=(e,t)=>{var o;const n=(o=e.split(".").pop())==null?void 0:o.toLowerCase();return n?ot.has(n)&&t?"inline-svg":ot.has(n)||$o.has(n)?"image":Po.has(n)?"video":To.has(n)?"audio":n==="pdf"?"pdf":Ao.has(n)?"component":t&&Io(t)?"inline-svg":"none":"none"},Mo=e=>`/api/file/raw?path=${encodeURIComponent(e)}`,Wo=new Set(["js","jsx","ts","tsx"]),st=e=>/export\s+default\s+\w/.test(e)||/export\s+(const|function|class)\s+[A-Z]\w*/.test(e),Oo=e=>/from\s+["']react-native-svg["']/.test(e),Fo=e=>/<svg[\s>]/i.test(e),Ho=e=>{const t=e.trim().replace(/;$/,"").trimEnd();return t.startsWith("<svg")||t.startsWith("<?xml")||t.includes("<svg")&&t.includes("</svg>")},zo=(e,t)=>{var o;const n=((o=e.split(".").pop())==null?void 0:o.toLowerCase())??"";if(n==="json"){try{const s=JSON.parse(t);if(typeof s=="object"&&s!==null&&"v"in s&&"layers"in s)return"lottie"}catch{}return"none"}return Wo.has(n)?Oo(t)&&st(t)?"rn-svg-component":Fo(t)&&st(t)?"dom-svg-component":Ho(t)?"inline-svg":"none":"none"},Uo=e=>{try{const t=en.transform(e,{presets:[["react",{runtime:"classic"}],["typescript",{allExtensions:!0,isTSX:!0}]],plugins:["transform-modules-commonjs"],filename:"component.tsx"});return t!=null&&t.code?{ok:!0,code:t.code}:{ok:!1,error:"Babel вернул пустой результат"}}catch(t){return{ok:!1,error:t instanceof Error?t.message:String(t)}}},at=e=>`<!DOCTYPE html>
14
- <html lang="en">
15
- <head>
16
- <meta charset="UTF-8" />
17
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
18
- <style>
19
- * { box-sizing: border-box; margin: 0; padding: 0; }
20
- html, body, #root {
21
- width: 100%; height: 100%;
22
- display: flex; align-items: center; justify-content: center;
23
- background: #1a1a1a;
24
- }
25
- svg { max-width: 100%; max-height: 100%; }
26
- .error {
27
- color: #f87171; font-family: monospace; font-size: 12px;
28
- padding: 16px; white-space: pre-wrap; word-break: break-word;
29
- }
30
- </style>
31
- </head>
32
- <body>
33
- <div id="root"></div>
34
- ${e.type==="svg-component"?qo(e.transpiledCode,e.filePath):Vo(e.animationData)}
35
- </body>
36
- </html>`,qo=(e,t)=>{const n=JSON.stringify(e),o=JSON.stringify(t);return`
37
- <script type="module">
38
- // ── Debug channel → родительское окно ────────────────────────────────────────
39
- const sendDebug = (payload) =>
40
- window.parent.postMessage({ type: "codetraxis-preview-debug", payload }, "*");
41
-
42
- // ── 1. React runtime ─────────────────────────────────────────────────────────
43
- import ReactModule from "https://esm.sh/react@19?dev";
44
- import { createRoot } from "https://esm.sh/react-dom@19/client?dev";
45
-
46
- // ── 2. react-native-svg shim ─────────────────────────────────────────────────
47
- // __esModule: true обязателен — без него _interopRequireWildcard обернёт
48
- // весь объект, и _reactNativeSvg.default станет объектом вместо функции.
49
- const makeSvgEl = (tag) => ({ children, ...props }) =>
50
- ReactModule.createElement(tag, props, children);
51
-
52
- const RNSvg = {
53
- __esModule: true,
54
- default: makeSvgEl("svg"),
55
- Svg: makeSvgEl("svg"),
56
- Path: makeSvgEl("path"),
57
- Rect: makeSvgEl("rect"),
58
- Circle: makeSvgEl("circle"),
59
- Ellipse: makeSvgEl("ellipse"),
60
- Line: makeSvgEl("line"),
61
- Polyline: makeSvgEl("polyline"),
62
- Polygon: makeSvgEl("polygon"),
63
- G: makeSvgEl("g"),
64
- Defs: makeSvgEl("defs"),
65
- Use: makeSvgEl("use"),
66
- Symbol: makeSvgEl("symbol"),
67
- Text: makeSvgEl("text"),
68
- TSpan: makeSvgEl("tspan"),
69
- Image: makeSvgEl("image"),
70
- ClipPath: makeSvgEl("clipPath"),
71
- Mask: makeSvgEl("mask"),
72
- Stop: makeSvgEl("stop"),
73
- LinearGradient: makeSvgEl("linearGradient"),
74
- RadialGradient: makeSvgEl("radialGradient"),
75
- ForeignObject: makeSvgEl("foreignObject"),
76
- SvgProps: {},
77
- SvgXmlProps: {},
78
- };
79
-
80
- // ── 3. CommonJS shim ─────────────────────────────────────────────────────────
81
- const _require = (mod) => {
82
- if (mod === "react") return ReactModule;
83
- if (mod === "react-native-svg") return RNSvg;
84
- return {};
85
- };
86
- const _module = { exports: {} };
87
-
88
- // ── 4. Выполнение transpiled кода через new Function ─────────────────────────
89
- // new Function изолирует "use strict" и var-объявления Babel от ES-модульного скопа.
90
- // React передаётся явно для Babel classic JSX runtime.
91
- const _code = ${n};
92
- const _filePath = ${o};
93
-
94
- sendDebug({ step: "transpile-start", filePath: _filePath });
95
-
96
- try {
97
- new Function("require", "module", "exports", "React", _code)(
98
- _require, _module, _module.exports, ReactModule
99
- );
100
- } catch (err) {
101
- sendDebug({ step: "eval-error", message: String(err) });
102
- createRoot(document.getElementById("root")).render(
103
- ReactModule.createElement("div", { className: "error" },
104
- "Ошибка выполнения:\\n" + String(err))
105
- );
106
- throw err;
107
- }
108
-
109
- sendDebug({ step: "module-evaluated", exportKeys: Object.keys(_module.exports) });
110
-
111
- // ── 5. Выбор компонента для рендера ──────────────────────────────────────────
112
- // Приоритет: default export → экспорт с именем файла → первый PascalCase export
113
- const mod = _module.exports;
114
-
115
- const baseName = _filePath.split("/").pop()?.replace(/\\.[^.]+$/, "") ?? "";
116
-
117
- const Component =
118
- (mod.__esModule && typeof mod.default === "function" ? mod.default : null) ??
119
- (baseName && typeof mod[baseName] === "function" ? mod[baseName] : null) ??
120
- Object.entries(mod).find(
121
- ([key, v]) => key !== "__esModule" && typeof v === "function" && /^[A-Z]/.test(key)
122
- )?.[1] ??
123
- null;
124
-
125
- sendDebug({
126
- step: "component-picked",
127
- selectedName: typeof Component === "function" ? (Component.name || baseName) : null,
128
- selectedType: typeof Component,
129
- });
130
-
131
- // ── 6. Рендер ────────────────────────────────────────────────────────────────
132
- const root = createRoot(document.getElementById("root"));
133
-
134
- if (typeof Component === "function") {
135
- try {
136
- root.render(ReactModule.createElement(Component));
137
- sendDebug({ step: "render-success" });
138
- } catch (err) {
139
- sendDebug({ step: "render-error", message: String(err) });
140
- root.render(
141
- ReactModule.createElement("div", { className: "error" },
142
- "Ошибка рендера:\\n" + String(err))
143
- );
144
- }
145
- } else {
146
- sendDebug({ step: "render-error", message: "No component found" });
147
- root.render(
148
- ReactModule.createElement("div", { className: "error" },
149
- "Не удалось найти React-компонент для рендера.\\n" +
150
- "Убедись что файл содержит export default или export const ComponentName."
151
- )
152
- );
153
- }
154
- <\/script>`},Vo=e=>`
155
- <script type="module">
156
- import React from "https://esm.sh/react@19?dev";
157
- import { createRoot } from "https://esm.sh/react-dom@19/client?dev";
158
- import Lottie from "https://esm.sh/lottie-react@2?dev";
159
-
160
- const data = ${e};
161
-
162
- const App = () =>
163
- React.createElement(Lottie, {
164
- animationData: data,
165
- loop: true,
166
- autoplay: true,
167
- style: { width: "80%", maxWidth: 480 },
168
- });
169
-
170
- createRoot(document.getElementById("root")).render(React.createElement(App));
171
- <\/script>`,Go="_wrapper_1fygb_1",Jo="_bgBar_1fygb_9",Ko="_bgLabel_1fygb_19",Xo="_bgBtn_1fygb_26",Yo="_bgBtnActive_1fygb_38",Zo="_bgWhite_1fygb_41",Qo="_bgLight_1fygb_42",es="_bgGray_1fygb_43",ts="_bgDark_1fygb_44",ns="_bgChecker_1fygb_45",rs="_center_1fygb_57",os="_image_1fygb_68",A={wrapper:Go,bgBar:Jo,bgLabel:Ko,bgBtn:Xo,bgBtnActive:Yo,bgWhite:Zo,bgLight:Qo,bgGray:es,bgDark:ts,bgChecker:ns,center:rs,image:os},ze=[{key:"white",label:"Белый",cssKey:"bgWhite",iframeColor:"#ffffff"},{key:"light",label:"Светлый",cssKey:"bgLight",iframeColor:"#f0f0f0"},{key:"gray",label:"Серый",cssKey:"bgGray",iframeColor:"#808080"},{key:"dark",label:"Тёмный",cssKey:"bgDark",iframeColor:"#1a1a1a"},{key:"checker",label:"Шахматка",cssKey:"bgChecker",iframeColor:"checker"}],it={white:A.bgWhite,light:A.bgLight,gray:A.bgGray,dark:A.bgDark,checker:A.bgChecker},ss=e=>{let t=e.trim();return t.endsWith(";")&&(t=t.slice(0,-1).trimEnd()),t},Ft=({content:e,alt:t="svg preview",bg:n="checker",onBgChange:o})=>{const[s,a]=c.useState("");return c.useEffect(()=>{const i=ss(e),l=new Blob([i],{type:"image/svg+xml"}),d=URL.createObjectURL(l);return a(d),()=>URL.revokeObjectURL(d)},[e]),s?r.jsxs("div",{className:A.wrapper,children:[o&&r.jsxs("div",{className:A.bgBar,children:[r.jsx("span",{className:A.bgLabel,children:"Фон:"}),ze.map(({key:i,label:l})=>r.jsx("button",{title:l,className:[A.bgBtn,it[i],n===i?A.bgBtnActive:""].join(" "),onClick:()=>o(i)},i))]}),r.jsx("div",{className:[A.center,it[n]].join(" "),children:r.jsx("img",{src:s,alt:t,className:A.image})})]}):null},as="_wrapper_l1qdn_1",is="_bgBar_l1qdn_10",ls="_bgLabel_l1qdn_20",cs="_bgBtn_l1qdn_27",ds="_bgBtnActive_l1qdn_42",us="_bgWhite_l1qdn_46",ps="_bgLight_l1qdn_47",hs="_bgGray_l1qdn_48",ms="_bgDark_l1qdn_49",fs="_bgChecker_l1qdn_50",gs="_frame_l1qdn_62",ys="_unavailable_l1qdn_69",I={wrapper:as,bgBar:is,bgLabel:ls,bgBtn:cs,bgBtnActive:ds,bgWhite:us,bgLight:ps,bgGray:hs,bgDark:ms,bgChecker:fs,frame:gs,unavailable:ys},xs={white:I.bgWhite,light:I.bgLight,gray:I.bgGray,dark:I.bgDark,checker:I.bgChecker},_s=({source:e,filePath:t})=>{const[n,o]=c.useState("checker"),s=zo(t,e),a=c.useMemo(()=>{if(s==="inline-svg"||s==="none")return null;if(s==="lottie")return at({type:"lottie",animationData:e});if(s==="rn-svg-component"||s==="dom-svg-component"){const l=Uo(e);return l.ok?at({type:"svg-component",transpiledCode:l.code,filePath:t}):vs(`Ошибка транспиляции:
172
- ${l.error}`)}return null},[e,s,t]);if(c.useEffect(()=>{const l=d=>{var u;((u=d.data)==null?void 0:u.type)==="codetraxis-preview-debug"&&console.log("[preview-debug]",d.data.payload)};return window.addEventListener("message",l),()=>window.removeEventListener("message",l)},[]),s==="inline-svg")return r.jsx(Ft,{content:e,alt:t,bg:n,onBgChange:o});if(!a)return r.jsx("div",{className:I.unavailable,children:"Preview недоступен для этого типа файла"});const i=ze.find(l=>l.key===n);return r.jsxs("div",{className:I.wrapper,children:[r.jsx(ws,{active:n,onChange:o}),r.jsx("iframe",{srcDoc:bs(a,i.iframeColor),sandbox:"allow-scripts",className:I.frame,title:"Component Preview"})]})},vs=e=>`<!DOCTYPE html>
173
- <html><head>
174
- <style>
175
- body { background:#1a1a1a; margin:0; padding:16px; }
176
- pre { color:#f87171; font-family:monospace; font-size:12px;
177
- white-space:pre-wrap; word-break:break-word; }
178
- </style>
179
- </head><body><pre>${e.replace(/</g,"&lt;")}</pre></body></html>`,bs=(e,t)=>{const n=`
180
- background-color:#ffffff;
181
- background-image:
182
- linear-gradient(45deg,#c8c8c8 25%,transparent 25%),
183
- linear-gradient(-45deg,#c8c8c8 25%,transparent 25%),
184
- linear-gradient(45deg,transparent 75%,#c8c8c8 75%),
185
- linear-gradient(-45deg,transparent 75%,#c8c8c8 75%);
186
- background-size:16px 16px;
187
- background-position:0 0,0 8px,8px -8px,-8px 0;
188
- `.trim(),o=t==="checker"?n:`background:${t};`;return e.replace(/html,\s*body,\s*#root\s*\{([^}]*)\}/,(s,a)=>s.replace(a,a.replace(/background[^;]*;/,o)))},ws=({active:e,onChange:t})=>r.jsxs("div",{className:I.bgBar,children:[r.jsx("span",{className:I.bgLabel,children:"Фон:"}),ze.map(({key:n,label:o})=>r.jsx("button",{title:o,className:[I.bgBtn,xs[n],e===n?I.bgBtnActive:""].join(" "),onClick:()=>t(n)},n))]}),js="_center_v40bj_1",ks="_image_v40bj_13",Cs="_media_v40bj_19",Ss="_audio_v40bj_24",Rs="_frame_v40bj_28",Es="_unavailable_v40bj_35",J={center:js,image:ks,media:Cs,audio:Ss,frame:Rs,unavailable:Es},lt=({filePath:e,source:t=""})=>{const n=Do(e,t),o=Mo(e);return n==="inline-svg"?r.jsx(Ft,{content:t,alt:e}):n==="image"?r.jsx("div",{className:J.center,children:r.jsx("img",{src:o,alt:e,className:J.image})}):n==="video"?r.jsx("div",{className:J.center,children:r.jsx("video",{src:o,controls:!0,className:J.media})}):n==="audio"?r.jsx("div",{className:J.center,children:r.jsx("audio",{src:o,controls:!0,className:J.audio})}):n==="pdf"?r.jsx("iframe",{src:o,title:e,className:J.frame}):n==="component"?r.jsx(_s,{filePath:e,source:t}):r.jsx("div",{className:J.unavailable,children:"Preview недоступен для этого типа файла"})},Ns="_switcher_1pc43_1",Ls="_btn_1pc43_12",Bs="_btnActive_1pc43_32",$s="_label_1pc43_37",ue={switcher:Ns,btn:Ls,btnActive:Bs,label:$s},Ps=()=>r.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("polyline",{points:"16 18 22 12 16 6"}),r.jsx("polyline",{points:"8 6 2 12 8 18"})]}),Ts=()=>r.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),r.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),r.jsx("polyline",{points:"21 15 16 10 5 21"})]}),As=()=>r.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),r.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"})]}),Is=[{value:"code",label:"Code",Icon:Ps},{value:"preview",label:"Preview",Icon:Ts},{value:"split",label:"Split",Icon:As}],Ds=({mode:e,onChange:t})=>r.jsx("div",{className:ue.switcher,children:Is.map(({value:n,label:o,Icon:s})=>r.jsxs("button",{type:"button",title:o,className:`${ue.btn} ${e===n?ue.btnActive:""}`,onClick:()=>t(n),children:[r.jsx(s,{}),r.jsx("span",{className:ue.label,children:o})]},n))}),Ms="_container_60zdm_1",Ws="_header_60zdm_11",Os="_headerLeft_60zdm_23",Fs="_fileName_60zdm_31",Hs="_filePath_60zdm_38",zs="_closeBtn_60zdm_46",Us="_pane_60zdm_69",qs="_splitPane_60zdm_77",Vs="_splitCode_60zdm_85",Gs="_splitPreview_60zdm_92",Js="_loading_60zdm_100",Ks="_empty_60zdm_101",P={container:Ms,header:Ws,headerLeft:Os,fileName:Fs,filePath:Hs,closeBtn:zs,pane:Us,splitPane:qs,splitCode:Vs,splitPreview:Gs,loading:Js,empty:Ks},Xs=()=>{const e=X(),t=M(Te),n=M(Vt),[o,s]=c.useState("code"),a=c.useMemo(()=>t?Bo(t.path):"plaintext",[t]);if(n)return r.jsx("div",{className:P.loading,style:{color:L.secondaryText},children:"Загрузка..."});if(!t)return r.jsx("div",{className:P.empty,style:{color:L.secondaryText},children:"Выберите файл для просмотра"});const i=t.path.split("/").pop()??t.path,l=t.path.split("/").slice(0,-1).join("/");return r.jsxs("div",{className:P.container,children:[r.jsxs("div",{className:P.header,style:{backgroundColor:L.boxBackgroundDark,borderBottomColor:L.borderColor,color:L.secondaryText},children:[r.jsxs("div",{className:P.headerLeft,children:[r.jsx("span",{className:P.fileName,children:i}),l&&r.jsx("span",{className:P.filePath,children:l}),r.jsx("button",{type:"button",className:P.closeBtn,title:"Закрыть файл",onClick:()=>e(Gt()),children:r.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[r.jsx("line",{x1:"1",y1:"1",x2:"11",y2:"11"}),r.jsx("line",{x1:"11",y1:"1",x2:"1",y2:"11"})]})})]}),r.jsx(Ds,{mode:o,onChange:s})]}),o==="code"&&r.jsx("div",{className:P.pane,children:r.jsx(rt,{filePath:t.path,content:t.content,language:a})}),o==="preview"&&r.jsx("div",{className:P.pane,children:r.jsx(lt,{filePath:t.path,source:t.content})}),o==="split"&&r.jsxs("div",{className:P.splitPane,children:[r.jsx("div",{className:P.splitCode,children:r.jsx(rt,{filePath:t.path,content:t.content,language:a,compact:!0})}),r.jsx("div",{className:P.splitPreview,children:r.jsx(lt,{filePath:t.path,source:t.content})})]})]})};function _e(e){if(typeof e=="object"&&e!==null)return e;if(typeof e!="string")return null;try{const t=JSON.parse(e);return typeof t=="object"&&t!==null?t:null}catch{return null}}function Ys(e){if(typeof e!="string")return!1;try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function Zs(e){if(typeof e!="string")return!1;const t=e.trimStart();return/^<!doctype\s+html/i.test(t)||/^<html[\s>]/i.test(t)||/^<\?xml/i.test(t)}const Qs=[{key:"all",label:"All"},{key:"network",label:"Network"},{key:"console",label:"Console"}],ea=[{key:"response",label:"Response"},{key:"responseHeaders",label:"Res Headers"},{key:"request",label:"Request"},{key:"requestHeaders",label:"Req Headers"}];function Ht(e,t){return t==="all"?e:t==="console"?e.filter(n=>n.type==="console"):t==="network"?e.filter(n=>n.type==="network"):e}function ta(e,t){return Ht(e,t).length}function na(e,t){if(t==="response"){if(!e.responseBody)return null;const n=_e(e.responseBody);return n?JSON.stringify(n,null,2):String(e.responseBody)}if(t==="request"){if(!e.requestBody)return null;const n=_e(e.requestBody);return n?JSON.stringify(n,null,2):String(e.requestBody)}if(t==="responseHeaders"){const n=e.responseHeaders;return n?JSON.stringify(n,null,2):null}if(t==="requestHeaders"){const n=e.requestHeaders;return n?JSON.stringify(n,null,2):null}return null}function ra(e){const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0"),a=String(t.getMilliseconds()).padStart(3,"0");return`${n}:${o}:${s}.${a}`}function oa(e){return e===0?"+0ms":e<1e3?`+${e}ms`:`+${(e/1e3).toFixed(2)}s`}function sa(e){try{return new URL(e).pathname}catch{return e}}function aa(e){return e.map(t=>{if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}).join(" ")}function ia(e="",t=!1){return{GET:t?"#f00":"#cf6a4c",POST:t?"#f00":"#8f9d6a",PUT:t?"#f00":"#cda869",PATCH:t?"#f00":"#9b859d",DELETE:t?"#f00":"#cf6a4c"}[e.toUpperCase()]??"#838184"}function la(e){return e?e>=200&&e<300?"#8f9d6a":e>=400?"#f00":"#cda869":"#838184"}function ca(e){return e.type==="console"?e.level==="warn"?"#cda869":e.level==="error"?"#f00":"#7587a6":e.type==="network"?ia(e.method,e.status!=null&&e.status>=400):"#7587a6"}function da(e){if(e.type==="console")return e.level.toUpperCase();if(e.type==="network"){const t=e.status?` (${e.status})`:"";return`${e.method??"NET"}${t}`}return"EVENT"}function ua(e){return e.type==="console"?aa(e.args).slice(0,200):e.type==="network"?sa(e.url):""}function ct(e){return e.replace(/[-_](.)/g,(t,n)=>n.toUpperCase()).replace(/^(.)/,(t,n)=>n.toUpperCase())}function pa(e){return/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(e)}function ha(e){return pa(e)?e:JSON.stringify(e)}function ne(e,t,n,o=0){if(e===null)return"null";if(typeof e=="boolean")return"boolean";if(typeof e=="number")return Number.isInteger(e),"number";if(typeof e=="string")return"string";if(Array.isArray(e)){if(e.length===0)return"unknown[]";const s=e.find(i=>i!==null)??e[0];return`${ne(s,t,n,o)}[]`}if(typeof e=="object"){const s=ct(t)+(o>0?"Item":""),a=[];for(const[l,d]of Object.entries(e)){const u=ct(l),p=ne(d,u,n,o+1);a.push(` ${ha(l)}: ${p};`)}const i=`interface ${s} {
189
- ${a.join(`
190
- `)}
191
- }`;return n.set(s,i),s}return"unknown"}function zt(e,t="Root"){if(typeof e!="object"||e===null)return"// Not a JSON object or array";const n=new Map;if(Array.isArray(e)){const s=e.find(a=>a!==null)??e[0];if(typeof s=="object"&&s!==null&&!Array.isArray(s)){ne(s,t,n,0);const a=n.get(t);a&&n.set(t,a)}else return`type ${t} = ${ne(e,t,n,0)};`}else ne(e,t,n,0);return Array.from(n.values()).reverse().join(`
192
-
193
- `)}const ma="_urlInline_2pclv_1",fa="_urlInlineBtns_2pclv_10",ga="_urlInlineBtn_2pclv_10",ya="_urlInlineBtnActive_2pclv_39",xa="_urlPreviewImg_2pclv_45",_a="_urlPreviewIframe_2pclv_54",K={urlInline:ma,urlInlineBtns:fa,urlInlineBtn:ga,urlInlineBtnActive:ya,urlPreviewImg:xa,urlPreviewIframe:_a},va=({url:e})=>{const t=/\.(png|jpe?g|gif|webp|svg|avif)(\?|$)/i.test(e),[n,o]=c.useState(!1),s=i=>{i.stopPropagation(),window.open(e,"_blank","noopener,noreferrer")},a=i=>{i.stopPropagation(),o(l=>!l)};return r.jsxs("span",{className:K.urlInline,children:[r.jsxs("span",{className:K.urlInlineBtns,children:[r.jsxs("button",{className:K.urlInlineBtn,onClick:s,title:"Open in new tab",children:[r.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),r.jsx("polyline",{points:"15 3 21 3 21 9"}),r.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),"open"]}),r.jsxs("button",{className:`${K.urlInlineBtn} ${n?K.urlInlineBtnActive:""}`,onClick:a,title:n?"Hide preview":"Show preview",children:[n?r.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"}),r.jsx("path",{d:"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"}),r.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):r.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),r.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),n?"hide":"show"]})]}),n&&(t?r.jsx("img",{src:e,alt:"preview",className:K.urlPreviewImg,onClick:i=>i.stopPropagation()}):r.jsx("iframe",{src:e,title:"preview",className:K.urlPreviewIframe,sandbox:"allow-scripts allow-same-origin allow-forms"}))]})},ba="_pre_1m1q3_1",wa={pre:ba},$e=({value:e})=>{const t=_e(e);return t?r.jsx(qe,{value:t,style:{...tn,background:"transparent",fontSize:14,fontFamily:"inherit",lineHeight:1.7,"--w-rjv-color":"#a7a7a7","--w-rjv-key-string":"#7587a6","--w-rjv-type-string-color":"#8f9d6a","--w-rjv-type-int-color":"#cda869","--w-rjv-type-float-color":"#cda869","--w-rjv-type-boolean-color":"#cda869","--w-rjv-type-null-color":"#cf6a4c","--w-rjv-curlybraces-color":"#838184","--w-rjv-brackets-color":"#838184","--w-rjv-colon-color":"#838184","--w-rjv-copied-color":"#8f9d6a","--w-rjv-copied-success-color":"#8f9d6a","--w-rjv-background-color":"transparent"},collapsed:1,displayDataTypes:!1,displayObjectSize:!0,enableClipboard:!0,indentWidth:20,children:r.jsx(qe.String,{render:(n,{type:o,value:s})=>{if(o==="value"&&Ys(s)){const{children:a,...i}=n;return r.jsxs("span",{...i,style:{...i.style,display:"inline-flex",alignItems:"center",gap:4,flexWrap:"wrap"},children:[a,r.jsx(va,{url:s})]})}}})}):r.jsx("pre",{className:wa.pre,children:String(e??"—")})},ja="_headersTable_1c6e1_1",ka="_headerKey_1c6e1_15",Ca="_headerVal_1c6e1_24",Sa="_noData_1c6e1_31",pe={headersTable:ja,headerKey:ka,headerVal:Ca,noData:Sa},dt=({headers:e})=>!e||Object.keys(e).length===0?r.jsx("span",{className:pe.noData,children:"No headers captured"}):r.jsx("table",{className:pe.headersTable,children:r.jsx("tbody",{children:Object.entries(e).map(([t,n])=>r.jsxs("tr",{children:[r.jsx("td",{className:pe.headerKey,children:t}),r.jsx("td",{className:pe.headerVal,children:n})]},t))})}),Ra="_copyBtn_290t0_1",Ea="_copyBtnDone_290t0_23",ut={copyBtn:Ra,copyBtnDone:Ea},Na=({text:e})=>{const[t,n]=c.useState(!1);if(!e)return null;const o=s=>{s.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})};return r.jsx("button",{className:`${ut.copyBtn} ${t?ut.copyBtnDone:""}`,onClick:o,title:"Copy to clipboard",children:t?r.jsxs(r.Fragment,{children:[r.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Copied"]}):r.jsxs(r.Fragment,{children:[r.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),r.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy"]})})},La="_genBtn_i8cke_1",Ba="_genBtnActive_i8cke_23",pt={genBtn:La,genBtnActive:Ba},$a=({disabled:e,active:t,onClick:n})=>e?null:r.jsxs("button",{className:[pt.genBtn,t?pt.genBtnActive:""].filter(Boolean).join(" "),onClick:n,title:"Generate TypeScript types",children:[r.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("polyline",{points:"16 18 22 12 16 6"}),r.jsx("polyline",{points:"8 6 2 12 8 18"})]}),"types"]}),Pa="_overlay_1n3zm_1",Ta="_panel_1n3zm_10",Aa="_resizeHandle_1n3zm_25",Ia="_header_1n3zm_62",Da="_title_1n3zm_73",Ma="_titleBadge_1n3zm_84",Wa="_headerActions_1n3zm_96",Oa="_iconBtn_1n3zm_102",Fa="_iconBtnClose_1n3zm_119",Ha="_copyDone_1n3zm_124",za="_tabs_1n3zm_129",Ua="_tab_1n3zm_129",qa="_tabActive_1n3zm_153",Va="_editorWrap_1n3zm_160",Ga="_customTab_1n3zm_192",Ja="_customSection_1n3zm_201",Ka="_customSectionLabel_1n3zm_213",Xa="_customEditorWrap_1n3zm_224",Ya="_customError_1n3zm_232",Za="_customActions_1n3zm_240",Qa="_genBtn_1n3zm_248",w={overlay:Pa,panel:Ta,resizeHandle:Aa,header:Ia,title:Da,titleBadge:Ma,headerActions:Wa,iconBtn:Oa,iconBtnClose:Fa,copyDone:Ha,tabs:za,tab:Ua,tabActive:qa,editorWrap:Va,customTab:Ga,customSection:Ja,customSectionLabel:Ka,customEditorWrap:Xa,customError:Ya,customActions:Za,genBtn:Qa},Ee={minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,lineHeight:22,fontFamily:'"Fira Code", "SF Mono", "Consolas", monospace',fontLigatures:!0,readOnly:!1,wordWrap:"on",padding:{top:16,bottom:16},lineNumbers:"off",folding:!0,glyphMargin:!1,renderLineHighlight:"none",scrollbar:{verticalScrollbarSize:6,horizontalScrollbarSize:6},overviewRulerLanes:0},Ut=({code:e="",initialTab:t="generated",onClose:n})=>{const[o,s]=c.useState(t),[a,i]=c.useState(!1),l=c.useRef(null),[d,u]=c.useState(480),p=j=>{var ie;j.preventDefault();const B=j.clientX,q=((ie=l.current)==null?void 0:ie.offsetWidth)??d,V=we=>{const le=B-we.clientX,ce=Math.min(Math.max(q+le,280),window.innerWidth*.9);u(ce)},Y=()=>{window.removeEventListener("mousemove",V),window.removeEventListener("mouseup",Y)};window.addEventListener("mousemove",V),window.addEventListener("mouseup",Y)},[h,m]=c.useState(e),[x,_]=c.useState(""),[f,y]=c.useState(null),[g,b]=c.useState(null);c.useEffect(()=>{m(e)},[e]),c.useEffect(()=>{const j=B=>{B.key==="Escape"&&n()};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[n]);const v=o==="generated"?h:g??"",E=()=>{v&&navigator.clipboard.writeText(v).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})},R=()=>{y(null),b(null);let j;try{const B=x.trim().replace(/:\s*True\b/g,": true").replace(/:\s*False\b/g,": false").replace(/:\s*None\b/g,": null").replace(/,\s*True\b/g,", true").replace(/,\s*False\b/g,", false").replace(/,\s*None\b/g,", null").replace(/\[\s*True\b/g,"[ true").replace(/\[\s*False\b/g,"[ false").replace(/\[\s*None\b/g,"[ null");j=JSON.parse(B)}catch{y("Invalid JSON — please check the syntax");return}b(zt(j,"Root"))};return r.jsx("div",{className:w.overlay,children:r.jsxs("div",{className:w.panel,ref:l,style:{width:d},children:[r.jsx("div",{className:w.resizeHandle,onMouseDown:p}),r.jsxs("div",{className:w.header,children:[r.jsxs("span",{className:w.title,children:["TS Types",r.jsx("span",{className:w.titleBadge,children:".ts"})]}),r.jsxs("div",{className:w.headerActions,children:[v&&r.jsx("button",{className:`${w.iconBtn} ${a?w.copyDone:""}`,onClick:E,title:"Copy types",children:a?r.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("polyline",{points:"20 6 9 17 4 12"})}):r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),r.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),r.jsx("button",{className:`${w.iconBtn} ${w.iconBtnClose}`,onClick:n,title:"Close (Esc)",children:r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),r.jsxs("div",{className:w.tabs,children:[t!=="custom"&&r.jsx("button",{className:`${w.tab} ${o==="generated"?w.tabActive:""}`,onClick:()=>s("generated"),children:"Generated"}),r.jsx("button",{className:`${w.tab} ${o==="custom"?w.tabActive:""}`,onClick:()=>s("custom"),children:"Custom JSON"})]}),o==="generated"?r.jsx("div",{className:w.editorWrap,children:r.jsx(ye,{language:"typescript",value:h,theme:"vs-dark",options:Ee,onChange:j=>m(j??"")})}):r.jsxs("div",{className:w.customTab,children:[r.jsxs("div",{className:w.customSection,children:[r.jsx("p",{className:w.customSectionLabel,children:"JSON input"}),r.jsx("div",{className:w.customEditorWrap,children:r.jsx(ye,{language:"json",value:x,theme:"vs-dark",options:Ee,onChange:j=>{_(j??""),y(null)}})}),f&&r.jsx("p",{className:w.customError,children:f}),r.jsx("div",{className:w.customActions,children:r.jsxs("button",{className:w.genBtn,onClick:R,children:[r.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("polyline",{points:"16 18 22 12 16 6"}),r.jsx("polyline",{points:"8 6 2 12 8 18"})]}),"Generate types"]})})]}),g!==null&&r.jsxs("div",{className:w.customSection,children:[r.jsx("p",{className:w.customSectionLabel,children:"Result"}),r.jsx("div",{className:w.customEditorWrap,children:r.jsx(ye,{language:"typescript",value:g,theme:"vs-dark",options:Ee,onChange:j=>b(j??"")})})]})]})]})})},ei="_expanded_1rwyf_1",ti="_expandedUrl_1rwyf_18",ni="_metaRow_1rwyf_26",ri="_metaItem_1rwyf_33",oi="_metaLabel_1rwyf_42",si="_tabBar_1rwyf_50",ai="_tabBarSpacer_1rwyf_58",ii="_tab_1rwyf_50",li="_tabActive_1rwyf_78",ci="_viewToggle_1rwyf_83",di="_viewToggleBtn_1rwyf_92",ui="_viewToggleBtnActive_1rwyf_118",pi="_htmlPreviewIframe_1rwyf_123",hi="_tabContent_1rwyf_132",mi="_noData_1rwyf_138",k={expanded:ei,expandedUrl:ti,metaRow:ni,metaItem:ri,metaLabel:oi,tabBar:si,tabBarSpacer:ai,tab:ii,tabActive:li,viewToggle:ci,viewToggleBtn:di,viewToggleBtnActive:ui,htmlPreviewIframe:pi,tabContent:hi,noData:mi},fi=({event:e})=>{const t="response",[n,o]=c.useState(t),[s,a]=c.useState("code"),[i,l]=c.useState(null),d=na(e,n),u=n==="response"?e.responseBody:n==="request"?e.requestBody:null,p=_e(u),h=p!==null,m=f=>{if(f.stopPropagation(),!p)return;if(i!==null){l(null);return}l(zt(p,n==="response"?"Response":"RequestBody"))},x=n==="response"&&Zs(e.responseBody),_=String(e.responseBody??"");return r.jsxs("div",{className:k.expanded,children:[r.jsx("div",{className:k.expandedUrl,children:e.url}),r.jsxs("div",{className:k.metaRow,children:[e.status!=null&&r.jsxs("span",{className:k.metaItem,children:[r.jsx("span",{className:k.metaLabel,children:"Status"}),r.jsx("span",{style:{color:la(e.status)},children:e.status})]}),e.duration!=null&&r.jsxs("span",{className:k.metaItem,children:[r.jsx("span",{className:k.metaLabel,children:"Duration"}),r.jsxs("span",{children:[e.duration.toFixed(0)," ms"]})]}),r.jsxs("span",{className:k.metaItem,children:[r.jsx("span",{className:k.metaLabel,children:"Transport"}),r.jsx("span",{children:e.transport.toUpperCase()})]})]}),r.jsxs("div",{className:k.tabBar,children:[ea.map(f=>r.jsx("button",{className:`${k.tab} ${n===f.key?k.tabActive:""}`,onClick:y=>{y.stopPropagation(),o(f.key)},children:f.label},f.key)),r.jsx("span",{className:k.tabBarSpacer}),x&&r.jsxs("span",{className:k.viewToggle,children:[r.jsxs("button",{className:`${k.viewToggleBtn} ${s==="code"?k.viewToggleBtnActive:""}`,onClick:f=>{f.stopPropagation(),a("code")},children:[r.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("polyline",{points:"16 18 22 12 16 6"}),r.jsx("polyline",{points:"8 6 2 12 8 18"})]}),"Code"]}),r.jsxs("button",{className:`${k.viewToggleBtn} ${s==="preview"?k.viewToggleBtnActive:""}`,onClick:f=>{f.stopPropagation(),a("preview")},children:[r.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),r.jsx("path",{d:"M3 9h18"})]}),"Preview"]}),r.jsxs("button",{className:k.viewToggleBtn,onClick:f=>{f.stopPropagation(),window.open(e.url,"_blank","noopener,noreferrer")},title:"Open URL in new tab",children:[r.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),r.jsx("polyline",{points:"15 3 21 3 21 9"}),r.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),"Open"]})]}),r.jsx(Na,{text:x&&s==="preview"?null:d}),r.jsx($a,{disabled:!h,active:i!==null,onClick:m})]}),r.jsxs("div",{className:k.tabContent,children:[n==="response"&&x&&s==="preview"?r.jsx("iframe",{srcDoc:_,title:"HTML Preview",className:k.htmlPreviewIframe,sandbox:"allow-scripts allow-same-origin"}):n==="response"?e.responseBody?r.jsx($e,{value:e.responseBody}):r.jsx("span",{className:k.noData,children:"No response body"}):null,n==="request"&&(e.requestBody?r.jsx($e,{value:e.requestBody}):r.jsx("span",{className:k.noData,children:"No request body"})),n==="responseHeaders"&&r.jsx(dt,{headers:e.responseHeaders}),n==="requestHeaders"&&r.jsx(dt,{headers:e.requestHeaders})]}),i!==null&&ht.createPortal(r.jsx(Ut,{code:i,onClose:()=>l(null)}),document.body)]})},gi="_expanded_9p09c_1",yi="_argRow_9p09c_18",xi="_argIdx_9p09c_29",_i="_argVal_9p09c_38",he={expanded:gi,argRow:yi,argIdx:xi,argVal:_i},vi=({event:e})=>r.jsx("div",{className:he.expanded,children:e.args.map((t,n)=>r.jsxs("div",{className:he.argRow,children:[r.jsx("span",{className:he.argIdx,children:n}),r.jsx("div",{className:he.argVal,children:r.jsx($e,{value:t})})]},n))}),bi="_item_129te_1",wi="_itemOpen_129te_8",ji="_itemHeader_129te_12",ki="_timestamp_129te_24",Ci="_delta_129te_34",Si="_titleBadge_129te_46",Ri="_preview_129te_58",Ei="_spacer_129te_69",Ni="_chevron_129te_73",Li="_chevronOpen_129te_79",W={item:bi,itemOpen:wi,itemHeader:ji,timestamp:ki,delta:Ci,titleBadge:Si,preview:Ri,spacer:Ei,chevron:Ni,chevronOpen:Li},Bi=({event:e,prevTs:t,isOpen:n,onToggle:o})=>{const s=da(e),a=ua(e),i=ca(e),l=t!=null?oa(e.timestamp-t):null;return r.jsxs("div",{className:`${W.item} ${n?W.itemOpen:""}`,children:[r.jsxs("div",{className:W.itemHeader,onClick:o,children:[r.jsx("span",{className:W.timestamp,children:ra(e.timestamp)}),r.jsx("span",{className:W.delta,children:l??""}),r.jsx("span",{className:W.titleBadge,style:{color:i},children:s}),!n&&r.jsx("span",{className:W.preview,children:a}),r.jsx("span",{className:W.spacer}),r.jsx("svg",{className:`${W.chevron} ${n?W.chevronOpen:""}`,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),n&&r.jsxs(r.Fragment,{children:[e.type==="network"&&r.jsx(fi,{event:e}),e.type==="console"&&r.jsx(vi,{event:e})]})]})},$i="_emptyState_z2adh_1",Pi="_emptyIcon_z2adh_13",Ti="_emptyTitle_z2adh_18",Ai="_emptySubtitle_z2adh_25",me={emptyState:$i,emptyIcon:Pi,emptyTitle:Ti,emptySubtitle:Ai},Ii=()=>r.jsxs("div",{className:me.emptyState,children:[r.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",className:me.emptyIcon,children:[r.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),r.jsx("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),r.jsx("line",{x1:"9",y1:"21",x2:"9",y2:"9"})]}),r.jsx("p",{className:me.emptyTitle,children:"No Activity"}),r.jsx("p",{className:me.emptySubtitle,children:"Once your app connects and starts sending events, they will appear here."})]}),Di="_container_1gdg7_21",Mi="_header_1gdg7_34",Wi="_headerTitle_1gdg7_45",Oi="_filterBar_1gdg7_56",Fi="_filterBtn_1gdg7_62",Hi="_filterBtnActive_1gdg7_82",zi="_filterCount_1gdg7_87",Ui="_filterCountActive_1gdg7_101",qi="_headerActions_1gdg7_107",Vi="_iconBtn_1gdg7_114",Gi="_typesBtn_1gdg7_132",Ji="_typesBtnActive_1gdg7_136",Ki="_timeline_1gdg7_142",$={container:Di,header:Mi,headerTitle:Wi,filterBar:Oi,filterBtn:Fi,filterBtnActive:Hi,filterCount:zi,filterCountActive:Ui,headerActions:qi,iconBtn:Vi,typesBtn:Gi,typesBtnActive:Ji,timeline:Ki},Xi=()=>{const e=X(),t=M(Jt),n=M(Kt),o=Ht(n,t),[s,a]=c.useState(null),[i,l]=c.useState(!1);return r.jsxs("div",{className:$.container,children:[r.jsxs("div",{className:$.header,children:[r.jsx("span",{className:$.headerTitle,children:"Timeline"}),r.jsx("div",{className:$.filterBar,children:Qs.map(d=>{const u=ta(n,d.key);return r.jsxs("button",{className:`${$.filterBtn} ${t===d.key?$.filterBtnActive:""}`,onClick:()=>{e(Xt(d.key)),a(null)},children:[d.label,u>0&&r.jsx("span",{className:`${$.filterCount} ${t===d.key?$.filterCountActive:""}`,children:u>999?"999+":u})]},d.key)})}),r.jsxs("div",{className:$.headerActions,children:[r.jsx("button",{className:`${$.iconBtn} ${$.typesBtn} ${i?$.typesBtnActive:""}`,title:"Open Types panel",onClick:()=>l(d=>!d),children:r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("polyline",{points:"16 18 22 12 16 6"}),r.jsx("polyline",{points:"8 6 2 12 8 18"})]})}),r.jsx("button",{className:$.iconBtn,title:"Clear",onClick:()=>{e(yt()),a(null)},children:r.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[r.jsx("polyline",{points:"3 6 5 6 21 6"}),r.jsx("path",{d:"M19 6l-1 14H6L5 6"}),r.jsx("path",{d:"M10 11v6M14 11v6"}),r.jsx("path",{d:"M9 6V4h6v2"})]})})]})]}),r.jsx("div",{className:$.timeline,children:o.length===0?r.jsx(Ii,{}):o.map((d,u)=>{var p;return r.jsx(Bi,{event:d,prevTs:(p=o[u+1])==null?void 0:p.timestamp,isOpen:s===d.id,onToggle:()=>a(h=>h===d.id?null:d.id)},d.id)})}),i&&ht.createPortal(r.jsx(Ut,{initialTab:"custom",onClose:()=>l(!1)}),document.body)]})},Yi="_overlay_xpudk_1",Zi="_modal_xpudk_18",Qi="_header_xpudk_35",el="_iconWrap_xpudk_42",tl="_title_xpudk_54",nl="_subtitle_xpudk_61",rl="_body_xpudk_68",ol="_sectionLabel_xpudk_72",sl="_featureList_xpudk_81",al="_featureItem_xpudk_90",il="_dot_xpudk_98",ll="_note_xpudk_106",cl="_noteCode_xpudk_124",dl="_error_xpudk_134",ul="_footer_xpudk_148",pl="_btnCancel_xpudk_156",hl="_btnConfirm_xpudk_177",N={overlay:Yi,modal:Zi,header:Qi,iconWrap:el,title:tl,subtitle:nl,body:rl,sectionLabel:ol,featureList:sl,featureItem:al,dot:il,note:ll,noteCode:cl,error:dl,footer:ul,btnCancel:pl,btnConfirm:hl},ml=[{label:"console.log / info / warn / error",color:"#4a9eff"},{label:"fetch (web & React Native)",color:"#34d399"},{label:"XMLHttpRequest",color:"#34d399"},{label:"axios (via XHR / fetch interception)",color:"#34d399"}],fl=({onClose:e,onInstalled:t})=>{const n=X(),[o,s]=c.useState(!1),[a,i]=c.useState(null),l=async()=>{s(!0),i(null),n(xt("installing"));try{const d=await Ne.install();if(!d.success){i(d.error??"Installation failed"),n(Ue(d.error??"Installation failed"));return}n(_t(d.entryFile??"unknown")),t(),e()}catch(d){const u=d instanceof Error?d.message:"Network error";i(u),n(Ue(u))}finally{s(!1)}};return r.jsx("div",{className:N.overlay,onClick:e,children:r.jsxs("div",{className:N.modal,onClick:d=>d.stopPropagation(),children:[r.jsxs("div",{className:N.header,children:[r.jsx("div",{className:N.iconWrap,children:r.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"#4a9eff",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})})}),r.jsxs("div",{children:[r.jsx("div",{className:N.title,children:"Install Debug Agent"}),r.jsx("div",{className:N.subtitle,children:"Auto-injected into your project entry file"})]})]}),r.jsxs("div",{className:N.body,children:[r.jsx("div",{className:N.sectionLabel,children:"Intercepts"}),r.jsx("ul",{className:N.featureList,children:ml.map(d=>r.jsxs("li",{className:N.featureItem,children:[r.jsx("span",{className:N.dot,style:{background:d.color}}),r.jsx("span",{children:d.label})]},d.label))}),r.jsxs("div",{className:N.note,children:[r.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"#555",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),r.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),r.jsxs("span",{children:["Adds"," ",r.jsx("code",{className:N.noteCode,children:'import "./codetraxisAgent"'})," ","to your entry file. Works with React (web) and React Native / Expo."]})]})]}),a&&r.jsxs("div",{className:N.error,children:[r.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"#f87171",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),r.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),a]}),r.jsxs("div",{className:N.footer,children:[r.jsx("button",{className:N.btnCancel,onClick:e,disabled:o,children:"Cancel"}),r.jsx("button",{className:N.btnConfirm,onClick:l,disabled:o,children:o?"Installing…":"Install Agent"})]})]})})},gl="_overlay_1brot_1",yl="_modal_1brot_18",xl="_header_1brot_35",_l="_iconWrap_1brot_42",vl="_title_1brot_54",bl="_subtitle_1brot_61",wl="_body_1brot_68",jl="_code_1brot_75",kl="_error_1brot_85",Cl="_footer_1brot_99",Sl="_btnCancel_1brot_107",Rl="_btnRemove_1brot_128",T={overlay:gl,modal:yl,header:xl,iconWrap:_l,title:vl,subtitle:bl,body:wl,code:jl,error:kl,footer:Cl,btnCancel:Sl,btnRemove:Rl},El=({onClose:e,onConfirm:t})=>{const[n,o]=c.useState(!1),[s,a]=c.useState(null),i=async()=>{o(!0),a(null);try{await t(),e()}catch(l){a(l instanceof Error?l.message:"Removal failed")}finally{o(!1)}};return r.jsx("div",{className:T.overlay,onClick:e,children:r.jsxs("div",{className:T.modal,onClick:l=>l.stopPropagation(),children:[r.jsxs("div",{className:T.header,children:[r.jsx("div",{className:T.iconWrap,children:r.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"#f87171",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("polyline",{points:"3 6 5 6 21 6"}),r.jsx("path",{d:"M19 6l-1 14H6L5 6"}),r.jsx("path",{d:"M10 11v6M14 11v6"}),r.jsx("path",{d:"M9 6V4h6v2"})]})}),r.jsxs("div",{children:[r.jsx("div",{className:T.title,children:"Remove Debug Agent"}),r.jsx("div",{className:T.subtitle,children:"This action cannot be undone"})]})]}),r.jsxs("div",{className:T.body,children:["The agent import line and the"," ",r.jsx("code",{className:T.code,children:"codetraxisAgent/"})," ","folder will be permanently removed from your project. Debug interception will stop immediately."]}),s&&r.jsxs("div",{className:T.error,children:[r.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"#f87171",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),r.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),s]}),r.jsxs("div",{className:T.footer,children:[r.jsx("button",{className:T.btnCancel,onClick:e,disabled:n,children:"Cancel"}),r.jsx("button",{className:T.btnRemove,onClick:i,disabled:n,children:n?"Removing…":"Remove Agent"})]})]})})},Nl=e=>{const t=X(),n=c.useRef(null),o=c.useRef(null);c.useEffect(()=>{if(!e)return;const s=()=>{const a=`ws://${window.location.hostname}:3333/debug`,i=new WebSocket(a);n.current=i,i.onmessage=l=>{try{const d=JSON.parse(l.data);t(Yt(d))}catch{}},i.onclose=()=>{o.current=setTimeout(s,3e3)}};return s(),()=>{var a;(a=n.current)==null||a.close(),o.current&&clearTimeout(o.current)}},[e,t])},Ll=()=>{const e=X(),t=M(Pe),[n,o]=c.useState(!1),[s,a]=c.useState(!1),[i,l]=c.useState("files");c.useEffect(()=>{e(gt())},[e]),c.useEffect(()=>{Ne.status().then(u=>{u.installed&&e(_t(u.entryFile??"unknown"))}).catch(()=>{})},[e]),ko(),Nl(t==="installed");const d=async()=>{try{const u=await Ne.uninstall();if(u.success)e(xt("not-installed")),e(yt()),l("files");else throw new Error(u.error??"Ошибка при удалении агента")}catch(u){throw u}};return r.jsxs("div",{className:Qe.container,style:{backgroundColor:L.background},children:[r.jsx(Hr,{onAddAgent:()=>o(!0),onRemoveAgent:()=>a(!0)}),r.jsxs("div",{className:Qe.content,children:[r.jsx(Gr,{mode:i,onModeChange:l}),i==="files"?r.jsxs(r.Fragment,{children:[r.jsx(wo,{}),r.jsx(Xs,{})]}):r.jsx(Xi,{})]}),n&&r.jsx(fl,{onClose:()=>o(!1),onInstalled:()=>{o(!1),l("debug")}}),s&&r.jsx(El,{onClose:()=>a(!1),onConfirm:d})]})};function Bl(){return r.jsx(Zt,{store:Qt,children:r.jsx(kr,{children:r.jsx(er,{children:r.jsx(At,{path:"/",element:r.jsx(Ll,{})})})})})}qt.createRoot(document.getElementById("root")).render(r.jsx(c.StrictMode,{children:r.jsx(Bl,{})}));