mates-devtools 0.1.0-beta.5 → 0.1.0-beta.6
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,114 +1,114 @@
|
|
|
1
|
-
(function(s,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("mates")):typeof define=="function"&&define.amd?define(["exports","mates"],o):(s=typeof globalThis<"u"?globalThis:s||self,o(s.MatesDevTools={},s.Mates))})(this,(function(s,o){"use strict";const Gt="selected",on="selected",cn=o.keyframes("mates-dt-flash",{"0%":{background:"var(--dt-flash-bg)",color:"#fff"},"100%":{background:"transparent",color:"var(--dt-text-muted)"}}),ot={"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"var(--dt-scrollbar)",borderRadius:"3px"},"&::-webkit-scrollbar-thumb:hover":{background:"var(--dt-scrollbar-hover)"}},r=o.globalCSS({fab:{position:"fixed",bottom:"50px",right:"50px",width:"44px",height:"44px",borderRadius:"50%",background:"var(--dt-bg)",border:"2px solid var(--dt-border)",color:"var(--dt-text-bright)",fontSize:"20px",lineHeight:"1",display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",zIndex:"100000",boxShadow:"0 2px 10px rgba(0,0,0,0.4)",userSelect:"none",transition:"box-shadow 0.15s ease, border-color 0.15s ease, transform 0.1s ease","-webkit-tap-highlight-color":"transparent","&:hover":{borderColor:"var(--dt-accent)",boxShadow:"0 4px 16px rgba(0,119,230,0.3)"},"&:active":{cursor:"grabbing",transform:"scale(0.95)"}},fabDragging:{cursor:"grabbing",transform:"scale(0.95)"},panel:{position:"fixed",bottom:"0",left:"0",right:"0",width:"100%",height:"320px",background:"var(--dt-bg)",borderTop:"1px solid var(--dt-border)",boxShadow:"0 -2px 12px rgba(0,0,0,0.4)",zIndex:"99999",display:"flex",flexDirection:"column",fontFamily:"'SF Mono', 'Fira Code', 'Consolas', monospace",fontSize:"13px",color:"var(--dt-text)",opacity:"0",transform:"translateY(12px)",transition:"opacity 0.2s ease, transform 0.2s ease",pointerEvents:"none"},panelVisible:{opacity:"1",transform:"translateY(0)",pointerEvents:"all"},minimized:{display:"none"},resizeHandle:{position:"absolute",top:"0",left:"0",right:"0",height:"4px",cursor:"ns-resize",zIndex:"1","&:hover":{background:"rgba(0,119,230,0.4)"}},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 10px",height:"38px",borderBottom:"1px solid var(--dt-border-2)",flexShrink:"0",gap:"16px"},headerLeft:{display:"flex",alignItems:"center",gap:"16px",minWidth:"0"},title:{fontWeight:"700",fontSize:"12px",color:"var(--dt-text-bright)",letterSpacing:"0.06em",textTransform:"uppercase",whiteSpace:"nowrap",flexShrink:"0"},controls:{display:"flex",alignItems:"center",gap:"4px",flexShrink:"0"},button:{background:"none",border:"none",color:"var(--dt-text-muted)",cursor:"pointer",padding:"4px 6px",borderRadius:"4px",fontSize:"13px",lineHeight:"1",display:"flex",alignItems:"center",justifyContent:"center",transition:"background 0.1s, color 0.1s","&:hover":{background:"var(--dt-bg-3)",color:"var(--dt-text-bright)"}},tabBar:{display:"flex",alignItems:"center",gap:"4px"},tabBtn:{background:"none",border:"none",color:"var(--dt-text-muted)",cursor:"pointer",padding:"4px 12px",borderRadius:"4px",fontSize:"12px",fontFamily:"inherit",fontWeight:"500",letterSpacing:"0.03em",transition:"background 0.1s, color 0.1s",position:"relative","&:hover":{background:"var(--dt-bg-3)",color:"var(--dt-text)"},"&.active":{color:"var(--dt-text-selected)",background:"var(--dt-bg-selected)"}},tabBadge:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:"var(--dt-accent)",color:"#fff",borderRadius:"8px",fontSize:"10px",fontWeight:"700",minWidth:"16px",height:"16px",padding:"0 4px",marginLeft:"5px",lineHeight:"1"},body:{display:"flex",flex:"1",minHeight:"0",overflow:"hidden"},leftColumn:{width:"260px",minWidth:"160px",borderRight:"1px solid var(--dt-border-2)",display:"flex",flexDirection:"column",flexShrink:"0"},leftTabs:{display:"flex",gap:"4px",padding:"5px 8px",borderBottom:"1px solid var(--dt-border-2)",flexShrink:"0"},leftTabBtn:{background:"none",border:"none",color:"var(--dt-text-dim)",cursor:"pointer",padding:"3px 6px",borderRadius:"3px",display:"flex",alignItems:"center",justifyContent:"center",transition:"background 0.1s, color 0.1s","&:hover":{background:"var(--dt-bg-3)",color:"var(--dt-text)"},"&.active":{background:"var(--dt-bg-selected)",color:"var(--dt-text-selected)"}},content:{flex:"1",overflowY:"auto",...ot},componentSearch:{width:"100%",boxSizing:"border-box",background:"var(--dt-bg-input)",border:"none",borderBottom:"1px solid var(--dt-border-2)",color:"var(--dt-text)",fontFamily:"inherit",fontSize:"12px",padding:"6px 10px",outline:"none",flexShrink:"0","&::placeholder":{color:"var(--dt-text-dimmer)"},"&:focus":{borderBottomColor:"var(--dt-accent)"}},componentList:{listStyle:"none",margin:"0",padding:"4px 0"},componentItem:{display:"flex",alignItems:"center",gap:"6px",justifyContent:"space-between",padding:"5px 8px",cursor:"pointer",borderRadius:"3px",margin:"1px 4px",transition:"background 0.1s","&:hover":{background:"var(--dt-bg-hover)"},"&.selected":{background:"var(--dt-bg-selected)",color:"var(--dt-text-selected)"}},componentName:{flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"12px",color:"var(--dt-text)"},componentBadge:{display:"flex",alignItems:"center",gap:"6px",flexShrink:"0"},componentBadgeSelected:{display:"flex",alignItems:"center",gap:"6px",flexShrink:"0",color:"var(--dt-accent)"},componentCount:{fontSize:"11px",color:"var(--dt-text-dim)",background:"var(--dt-bg-3)",borderRadius:"8px",padding:"1px 6px",minWidth:"18px",textAlign:"center"},componentCountSelected:{fontSize:"11px",color:"var(--dt-accent)",background:"var(--dt-bg-3)",borderRadius:"8px",padding:"1px 6px",minWidth:"18px",textAlign:"center"},componentHighlightBtn:{background:"none",border:"none",color:"var(--dt-text-dim)",cursor:"pointer",padding:"2px 4px",borderRadius:"3px",fontSize:"11px",lineHeight:"1",display:"flex",alignItems:"center",opacity:"1",transition:"color 0.1s","&:hover":{color:"var(--dt-accent)"}},componentHighlightBtnSelected:{background:"none",border:"none",color:"var(--dt-accent)",cursor:"pointer",padding:"2px 4px",borderRadius:"3px",fontSize:"11px",lineHeight:"1",display:"flex",alignItems:"center",opacity:"1",transition:"color 0.1s","&:hover":{color:"var(--dt-accent)"}},empty:{padding:"16px 12px",color:"var(--dt-text-dimmer)",fontSize:"12px",textAlign:"center"},treeToggle:{background:"none",border:"none",color:"var(--dt-text-dim)",cursor:"pointer",padding:"0 3px",fontSize:"11px",lineHeight:"1",flexShrink:"0",width:"16px",textAlign:"center","&:hover":{color:"var(--dt-text)"}},treeLeaf:{display:"inline-block",width:"16px",flexShrink:"0",textAlign:"center",color:"var(--dt-text-dim)"},inspector:{flex:"1",minWidth:"0",overflowY:"auto",padding:"10px",...ot},inspectorBreadcrumb:{display:"flex",alignItems:"center",gap:"4px",marginBottom:"10px",flexWrap:"wrap"},breadcrumbSegment:{color:"var(--dt-text-dim)",cursor:"pointer",fontSize:"11px","&:hover":{color:"var(--dt-text-selected)"}},breadcrumbSeparator:{color:"var(--dt-border)",fontSize:"11px"},breadcrumbCurrent:{color:"var(--dt-text-selected)",fontSize:"11px"},inspectorTitle:{fontWeight:"600",fontSize:"13px",color:"var(--dt-text-bright)",marginBottom:"8px"},instanceCount:{fontSize:"11px",color:"var(--dt-text-dim)",marginBottom:"8px"},instanceList:{listStyle:"none",margin:"0 0 8px 0",padding:"0",display:"flex",flexDirection:"column",gap:"4px"},instanceGroup:{border:"1px solid var(--dt-border-2)",borderRadius:"4px",overflow:"hidden"},instanceItem:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"6px",padding:"5px 10px",cursor:"pointer",transition:"background 0.1s","&:hover":{background:"var(--dt-bg-hover)"},"&.selected":{background:"var(--dt-bg-selected)"}},instanceToggle:{background:"none",border:"none",color:"var(--dt-text-dim)",cursor:"pointer",padding:"0 3px",fontSize:"11px",flexShrink:"0","&:hover":{color:"var(--dt-text)"}},instanceToggleSelected:{background:"none",border:"none",color:"var(--dt-accent)",cursor:"pointer",padding:"0 3px",fontSize:"11px",flexShrink:"0","&:hover":{color:"var(--dt-accent)"}},instanceId:{fontSize:"11px",color:"var(--dt-text-dim)",flexShrink:"0",marginRight:"2px"},instanceDetails:{margin:"0 0 6px 0",padding:"8px 12px",borderLeft:"2px solid var(--dt-instance-border)",background:"var(--dt-instance-bg)",borderRadius:"0 4px 4px 0"},highlightBtn:{background:"none",border:"1px solid var(--dt-border)",color:"var(--dt-text-muted)",cursor:"pointer",padding:"2px 7px",borderRadius:"3px",fontSize:"11px",fontFamily:"inherit",transition:"border-color 0.1s, color 0.1s","&:hover":{borderColor:"var(--dt-accent)",color:"var(--dt-accent)"}},domHighlight:{position:"absolute",zIndex:"100001",pointerEvents:"none",border:"2px solid #e53e3e",background:"rgba(229,62,62,0.18)",borderRadius:"3px",transition:"opacity 0.6s ease"},hooksSummary:{display:"flex",flexWrap:"wrap",gap:"5px",marginBottom:"10px"},hookPill:{display:"inline-flex",alignItems:"center",gap:"4px",background:"var(--dt-bg-2)",border:"1px solid var(--dt-border)",borderRadius:"10px",padding:"2px 8px",fontSize:"11px"},hookPillLabel:{color:"var(--dt-text-muted)"},hookPillCount:{color:"var(--dt-hook-count)",fontWeight:"600"},sectionHeader:{fontSize:"10px",fontWeight:"700",textTransform:"uppercase",letterSpacing:"0.08em",color:"var(--dt-text-dim)",marginBottom:"4px",marginTop:"12px","&:first-child":{marginTop:"0"}},propItem:{display:"flex",alignItems:"baseline",gap:"8px",padding:"3px 0",fontSize:"12px",borderBottom:"1px solid var(--dt-border-3)"},propKey:{color:"var(--dt-prop-key)",flexShrink:"0",minWidth:"80px"},propValue:{color:"var(--dt-prop-val)",wordBreak:"break-all"},scopeItem:{padding:"3px 0",fontSize:"12px",borderBottom:"1px solid var(--dt-border-3)"},scopeName:{color:"var(--dt-scope-name)"},atomItem:{display:"flex",alignItems:"baseline",gap:"8px",padding:"3px 0",fontSize:"12px",borderBottom:"1px solid var(--dt-border-3)"},atomName:{color:"var(--dt-prop-key)",flexShrink:"0",minWidth:"80px"},atomValue:{color:"var(--dt-prop-val)",wordBreak:"break-all"},highlight:{display:"inline-block",padding:"1px 5px",borderRadius:"8px",fontSize:"11px",color:"var(--dt-text-muted)",background:"transparent",transition:"background 0.1s, color 0.1s"},highlightFlash:{animation:`${cn} 0.6s ease forwards`},logsPanel:{flex:"1",display:"flex",flexDirection:"column",minHeight:"0",overflow:"hidden"},logsToolbar:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"5px 10px",borderBottom:"1px solid var(--dt-border-2)",flexShrink:"0",gap:"10px"},logsFilterRow:{display:"flex",gap:"4px"},logsFilterBtn:{background:"none",border:"1px solid var(--dt-border)",color:"var(--dt-text-muted)",cursor:"pointer",padding:"2px 9px",borderRadius:"3px",fontSize:"11px",fontFamily:"inherit",transition:"border-color 0.1s, color 0.1s, background 0.1s","&:hover":{borderColor:"var(--dt-text-dim)",color:"var(--dt-text)"},"&.active":{borderColor:"var(--dt-border-selected)",color:"var(--dt-text-selected)",background:"var(--dt-bg-active)"}},logsActions:{display:"flex",gap:"6px",alignItems:"center"},logsCount:{fontSize:"11px",color:"var(--dt-text-dimmer)"},logsContainer:{flex:"1",overflowY:"auto",padding:"4px 0",...ot},logEntry:{display:"flex",alignItems:"baseline",gap:"8px",padding:"3px 10px",fontSize:"12px",borderBottom:"1px solid var(--dt-border-3)","&:hover":{background:"var(--dt-bg-hover)"}},logTs:{color:"var(--dt-text-dimmer)",flexShrink:"0",fontSize:"11px",minWidth:"56px"},logBadge:{flexShrink:"0",padding:"1px 5px",borderRadius:"3px",fontSize:"10px",fontWeight:"700",textTransform:"uppercase",letterSpacing:"0.05em"},logLabel:{color:"var(--dt-text)",flexShrink:"0"},logDetail:{color:"var(--dt-text-muted)",wordBreak:"break-all",flex:"1",minWidth:"0"},perfPanel:{flex:"1",display:"flex",flexDirection:"column",minHeight:"0",overflow:"hidden"},perfToolbar:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"5px 10px",borderBottom:"1px solid var(--dt-border-2)",flexShrink:"0",gap:"10px"},perfTabs:{display:"flex",gap:"4px"},perfTabBtn:{background:"none",border:"1px solid var(--dt-border)",color:"var(--dt-text-muted)",cursor:"pointer",padding:"2px 9px",borderRadius:"3px",fontSize:"11px",fontFamily:"inherit",transition:"border-color 0.1s, color 0.1s, background 0.1s","&:hover":{borderColor:"var(--dt-text-dim)",color:"var(--dt-text)"},"&.active":{borderColor:"var(--dt-border-selected)",color:"var(--dt-text-selected)",background:"var(--dt-bg-active)"}},perfActions:{display:"flex",gap:"6px",alignItems:"center"},perfContent:{flex:"1",overflowY:"auto",...ot},perfTable:{width:"100%",borderCollapse:"collapse",fontSize:"12px"},perfTh:{padding:"5px 10px",textAlign:"left",color:"var(--dt-text-dim)",fontWeight:"600",fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.06em",borderBottom:"1px solid var(--dt-border-2)",position:"sticky",top:"0",background:"var(--dt-bg)"},perfThRight:{textAlign:"right"},perfRow:{borderBottom:"1px solid var(--dt-border-3)","&:hover":{background:"var(--dt-bg-hover)"}},perfRowClickable:{cursor:"pointer"},perfCell:{padding:"4px 10px",verticalAlign:"middle"},perfName:{color:"var(--dt-text)",fontWeight:"500"},perfNum:{textAlign:"right",color:"var(--dt-text-muted)",fontVariantNumeric:"tabular-nums"},perfBarWrap:{width:"80px",height:"6px",background:"var(--dt-bg-3)",borderRadius:"3px",overflow:"hidden",display:"inline-block",verticalAlign:"middle"},perfBar:{height:"100%",background:"var(--dt-accent)",borderRadius:"3px",transition:"width 0.2s ease"},perfBarLabel:{fontSize:"11px",color:"var(--dt-text-dim)",marginLeft:"5px"}}),wt=new Set,it=new WeakMap,ct=new WeakMap,N=o.event("devtools");function Ut(t,e){try{wt.add(t);let n=it.get(e);n||(n=new Set,it.set(e,n)),n.add(t),ct.set(t,1),N.trigger({type:"mount",component:t})}catch{}}function Yt(t,e){try{if(wt.delete(t),e){const n=it.get(e);n&&n.delete(t)}N.trigger({type:"unmount",component:t})}catch{}}function Xt(t){try{const e=ct.get(t)??0;ct.set(t,e+1),N.trigger({type:"render",component:t})}catch{}}function j(t){try{return ct.get(t)??0}catch{}return 0}function A(t){try{return t._depth??0}catch{}return 0}function St(t){try{return t._parentComponent??null}catch{}return null}function kt(){try{return Array.from(wt).filter(t=>{const e=t._view||t.oldView;return!e?.__devtools__&&!e?.skipDevToolsRender})}catch{}return[]}function ln(t){try{const e=it.get(t);return e?Array.from(e):[]}catch{}return[]}function E(t){try{return(t._view||t.oldView)?.name||"Anonymous"}catch{}return""}function an(t){try{return t._view||t.oldView||null}catch{}return null}function qt(){try{const t=kt(),e=new Map;for(const i of t){const c=an(i);if(!c)continue;let l=e.get(c);l||(l=[],e.set(c,l)),l.push(i)}const n=[];for(const[i,c]of e)n.push({viewFn:i,name:i.name||"Anonymous",instances:c});try{n.sort((i,c)=>{const l=a=>a.instances.reduce((u,d)=>Math.min(u,A(d)),1/0);return l(i)-l(c)})}catch{}return n}catch{}return[]}const h={row:"display:flex;align-items:baseline;gap:4px;font-size:13px;line-height:20px;font-family:'SF Mono',Monaco,Consolas,monospace;",toggle:"cursor:pointer;background:none;border:none;color:#888;font-size:10px;padding:0 2px;width:14px;text-align:center;flex-shrink:0;",key:"color:#9cdcfe;white-space:nowrap;",colon:"color:#777;",string:"color:#ce9178;",number:"color:#b5cea8;",boolean:"color:#569cd6;",null:"color:#569cd6;font-style:italic;",undefined:"color:#777;font-style:italic;",function:"color:#dcdcaa;font-style:italic;",symbol:"color:#c586c0;",preview:"color:#888;font-style:italic;",children:"margin-left:14px;padding-left:6px;border-left:1px solid #333;",badge:"color:#777;font-size:11px;margin-left:4px;background:#2a2a2a;padding:0 4px;border-radius:3px;"},Jt=new WeakMap;let Kt=null;function Ct(t){try{Kt=t}catch{}}function Qt(t){try{let e=Jt.get(t);return e||(e=new Set,Jt.set(t,e)),e}catch{return new Set}}function sn(t,e){try{return Qt(t).has(e)}catch{return!1}}function dn(t,e){try{const n=Qt(t);n.has(e)?n.delete(e):n.add(e);try{Kt?.()}catch{}}catch{}}function un(t){try{return t==null?!1:typeof t=="object"}catch{return!1}}function lt(t){try{return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":t instanceof Date?"date":t instanceof RegExp?"regexp":t instanceof Map?"map":t instanceof Set?"set":typeof t}catch{return""}}function Zt(t,e=60){try{const n=lt(t);if(n==="array"){const i=t;if(i.length===0)return"[]";const c=i.slice(0,5).map(a=>te(a)).join(", "),l=i.length>5?", …":"";return`[${c}${l}] (${i.length})`}if(n==="map")return`Map(${t.size})`;if(n==="set")return`Set(${t.size})`;if(n==="date")return`Date(${t.toISOString()})`;if(n==="regexp")return String(t);if(n==="object"){const i=t,c=Object.keys(i);if(c.length===0)return"{}";const l=c.slice(0,4).map(d=>`${d}: ${te(i[d])}`).join(", "),a=c.length>4?", …":"",u=`{${l}${a}}`;return u.length>e?u.slice(0,e-1)+"…}":u}return String(t)}catch{return""}}function te(t){try{switch(lt(t)){case"string":{const n=t;return n.length>30?`"${n.slice(0,27)}…"`:`"${n}"`}case"number":case"boolean":return String(t);case"null":return"null";case"undefined":return"undefined";case"function":return"ƒ()";case"symbol":return String(t);case"array":return`Array(${t.length})`;case"object":return"{…}";case"date":return"Date";case"map":return`Map(${t.size})`;case"set":return`Set(${t.size})`;default:return String(t)}}catch{return""}}function pn(t){try{switch(lt(t)){case"string":return o.html`<span style="${h.string}">"${String(t)}"</span>`;case"number":return o.html`<span style="${h.number}">${String(t)}</span>`;case"boolean":return o.html`<span style="${h.boolean}">${String(t)}</span>`;case"null":return o.html`<span style="${h.null}">null</span>`;case"undefined":return o.html`<span style="${h.undefined}">undefined</span>`;case"function":return o.html`<span style="${h.function}"
|
|
1
|
+
(function(s,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("mates")):typeof define=="function"&&define.amd?define(["exports","mates"],i):(s=typeof globalThis<"u"?globalThis:s||self,i(s.MatesDevTools={},s.Mates))})(this,(function(s,i){"use strict";const Wt="selected",rn="selected",on=i.keyframes("mates-dt-flash",{"0%":{background:"var(--dt-flash-bg)",color:"#fff"},"100%":{background:"transparent",color:"var(--dt-text-muted)"}}),ot={"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"var(--dt-scrollbar)",borderRadius:"3px"},"&::-webkit-scrollbar-thumb:hover":{background:"var(--dt-scrollbar-hover)"}},r=i.globalCSS({fab:{position:"fixed",bottom:"50px",right:"50px",width:"44px",height:"44px",borderRadius:"50%",background:"var(--dt-bg)",border:"2px solid var(--dt-border)",color:"var(--dt-text-bright)",fontSize:"20px",lineHeight:"1",display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",zIndex:"100000",boxShadow:"0 2px 10px rgba(0,0,0,0.4)",userSelect:"none",transition:"box-shadow 0.15s ease, border-color 0.15s ease, transform 0.1s ease","-webkit-tap-highlight-color":"transparent","&:hover":{borderColor:"var(--dt-accent)",boxShadow:"0 4px 16px rgba(0,119,230,0.3)"},"&:active":{cursor:"grabbing",transform:"scale(0.95)"}},fabDragging:{cursor:"grabbing",transform:"scale(0.95)"},panel:{position:"fixed",bottom:"0",left:"0",right:"0",width:"100%",height:"320px",background:"var(--dt-bg)",borderTop:"1px solid var(--dt-border)",boxShadow:"0 -2px 12px rgba(0,0,0,0.4)",zIndex:"99999",display:"flex",flexDirection:"column",fontFamily:"'SF Mono', 'Fira Code', 'Consolas', monospace",fontSize:"13px",color:"var(--dt-text)",opacity:"0",transform:"translateY(12px)",transition:"opacity 0.2s ease, transform 0.2s ease",pointerEvents:"none"},panelVisible:{opacity:"1",transform:"translateY(0)",pointerEvents:"all"},minimized:{display:"none"},resizeHandle:{position:"absolute",top:"0",left:"0",right:"0",height:"4px",cursor:"ns-resize",zIndex:"1","&:hover":{background:"rgba(0,119,230,0.4)"}},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 10px",height:"38px",borderBottom:"1px solid var(--dt-border-2)",flexShrink:"0",gap:"16px"},headerLeft:{display:"flex",alignItems:"center",gap:"16px",minWidth:"0"},title:{fontWeight:"700",fontSize:"12px",color:"var(--dt-text-bright)",letterSpacing:"0.06em",textTransform:"uppercase",whiteSpace:"nowrap",flexShrink:"0"},controls:{display:"flex",alignItems:"center",gap:"4px",flexShrink:"0"},button:{background:"none",border:"none",color:"var(--dt-text-muted)",cursor:"pointer",padding:"4px 6px",borderRadius:"4px",fontSize:"13px",lineHeight:"1",display:"flex",alignItems:"center",justifyContent:"center",transition:"background 0.1s, color 0.1s","&:hover":{background:"var(--dt-bg-3)",color:"var(--dt-text-bright)"}},tabBar:{display:"flex",alignItems:"center",gap:"4px"},tabBtn:{background:"none",border:"none",color:"var(--dt-text-muted)",cursor:"pointer",padding:"4px 12px",borderRadius:"4px",fontSize:"12px",fontFamily:"inherit",fontWeight:"500",letterSpacing:"0.03em",transition:"background 0.1s, color 0.1s",position:"relative","&:hover":{background:"var(--dt-bg-3)",color:"var(--dt-text)"},"&.active":{color:"var(--dt-text-selected)",background:"var(--dt-bg-selected)"}},tabBadge:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:"var(--dt-accent)",color:"#fff",borderRadius:"8px",fontSize:"10px",fontWeight:"700",minWidth:"16px",height:"16px",padding:"0 4px",marginLeft:"5px",lineHeight:"1"},body:{display:"flex",flex:"1",minHeight:"0",overflow:"hidden"},leftColumn:{width:"260px",minWidth:"160px",borderRight:"1px solid var(--dt-border-2)",display:"flex",flexDirection:"column",flexShrink:"0"},leftTabs:{display:"flex",gap:"4px",padding:"5px 8px",borderBottom:"1px solid var(--dt-border-2)",flexShrink:"0"},leftTabBtn:{background:"none",border:"none",color:"var(--dt-text-dim)",cursor:"pointer",padding:"3px 6px",borderRadius:"3px",display:"flex",alignItems:"center",justifyContent:"center",transition:"background 0.1s, color 0.1s","&:hover":{background:"var(--dt-bg-3)",color:"var(--dt-text)"},"&.active":{background:"var(--dt-bg-selected)",color:"var(--dt-text-selected)"}},content:{flex:"1",overflowY:"auto",...ot},componentSearch:{width:"100%",boxSizing:"border-box",background:"var(--dt-bg-input)",border:"none",borderBottom:"1px solid var(--dt-border-2)",color:"var(--dt-text)",fontFamily:"inherit",fontSize:"12px",padding:"6px 10px",outline:"none",flexShrink:"0","&::placeholder":{color:"var(--dt-text-dimmer)"},"&:focus":{borderBottomColor:"var(--dt-accent)"}},componentList:{listStyle:"none",margin:"0",padding:"4px 0"},componentItem:{display:"flex",alignItems:"center",gap:"6px",justifyContent:"space-between",padding:"5px 8px",cursor:"pointer",borderRadius:"3px",margin:"1px 4px",transition:"background 0.1s","&:hover":{background:"var(--dt-bg-hover)"},"&.selected":{background:"var(--dt-bg-selected)",color:"var(--dt-text-selected)"}},componentName:{flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"12px",color:"var(--dt-text)"},componentBadge:{display:"flex",alignItems:"center",gap:"6px",flexShrink:"0"},componentBadgeSelected:{display:"flex",alignItems:"center",gap:"6px",flexShrink:"0",color:"var(--dt-accent)"},componentCount:{fontSize:"11px",color:"var(--dt-text-dim)",background:"var(--dt-bg-3)",borderRadius:"8px",padding:"1px 6px",minWidth:"18px",textAlign:"center"},componentCountSelected:{fontSize:"11px",color:"var(--dt-accent)",background:"var(--dt-bg-3)",borderRadius:"8px",padding:"1px 6px",minWidth:"18px",textAlign:"center"},componentHighlightBtn:{background:"none",border:"none",color:"var(--dt-text-dim)",cursor:"pointer",padding:"2px 4px",borderRadius:"3px",fontSize:"11px",lineHeight:"1",display:"flex",alignItems:"center",opacity:"1",transition:"color 0.1s","&:hover":{color:"var(--dt-accent)"}},componentHighlightBtnSelected:{background:"none",border:"none",color:"var(--dt-accent)",cursor:"pointer",padding:"2px 4px",borderRadius:"3px",fontSize:"11px",lineHeight:"1",display:"flex",alignItems:"center",opacity:"1",transition:"color 0.1s","&:hover":{color:"var(--dt-accent)"}},empty:{padding:"16px 12px",color:"var(--dt-text-dimmer)",fontSize:"12px",textAlign:"center"},treeToggle:{background:"none",border:"none",color:"var(--dt-text-dim)",cursor:"pointer",padding:"0 3px",fontSize:"11px",lineHeight:"1",flexShrink:"0",width:"16px",textAlign:"center","&:hover":{color:"var(--dt-text)"}},treeLeaf:{display:"inline-block",width:"16px",flexShrink:"0",textAlign:"center",color:"var(--dt-text-dim)"},inspector:{flex:"1",minWidth:"0",overflowY:"auto",padding:"10px",...ot},inspectorBreadcrumb:{display:"flex",alignItems:"center",gap:"4px",marginBottom:"10px",flexWrap:"wrap"},breadcrumbSegment:{color:"var(--dt-text-dim)",cursor:"pointer",fontSize:"11px","&:hover":{color:"var(--dt-text-selected)"}},breadcrumbSeparator:{color:"var(--dt-border)",fontSize:"11px"},breadcrumbCurrent:{color:"var(--dt-text-selected)",fontSize:"11px"},inspectorTitle:{fontWeight:"600",fontSize:"13px",color:"var(--dt-text-bright)",marginBottom:"8px"},instanceCount:{fontSize:"11px",color:"var(--dt-text-dim)",marginBottom:"8px"},instanceList:{listStyle:"none",margin:"0 0 8px 0",padding:"0",display:"flex",flexDirection:"column",gap:"4px"},instanceGroup:{border:"1px solid var(--dt-border-2)",borderRadius:"4px",overflow:"hidden"},instanceItem:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"6px",padding:"5px 10px",cursor:"pointer",transition:"background 0.1s","&:hover":{background:"var(--dt-bg-hover)"},"&.selected":{background:"var(--dt-bg-selected)"}},instanceToggle:{background:"none",border:"none",color:"var(--dt-text-dim)",cursor:"pointer",padding:"0 3px",fontSize:"11px",flexShrink:"0","&:hover":{color:"var(--dt-text)"}},instanceToggleSelected:{background:"none",border:"none",color:"var(--dt-accent)",cursor:"pointer",padding:"0 3px",fontSize:"11px",flexShrink:"0","&:hover":{color:"var(--dt-accent)"}},instanceId:{fontSize:"11px",color:"var(--dt-text-dim)",flexShrink:"0",marginRight:"2px"},instanceDetails:{margin:"0 0 6px 0",padding:"8px 12px",borderLeft:"2px solid var(--dt-instance-border)",background:"var(--dt-instance-bg)",borderRadius:"0 4px 4px 0"},highlightBtn:{background:"none",border:"1px solid var(--dt-border)",color:"var(--dt-text-muted)",cursor:"pointer",padding:"2px 7px",borderRadius:"3px",fontSize:"11px",fontFamily:"inherit",transition:"border-color 0.1s, color 0.1s","&:hover":{borderColor:"var(--dt-accent)",color:"var(--dt-accent)"}},domHighlight:{position:"absolute",zIndex:"100001",pointerEvents:"none",border:"2px solid #e53e3e",background:"rgba(229,62,62,0.18)",borderRadius:"3px",transition:"opacity 0.6s ease"},hooksSummary:{display:"flex",flexWrap:"wrap",gap:"5px",marginBottom:"10px"},hookPill:{display:"inline-flex",alignItems:"center",gap:"4px",background:"var(--dt-bg-2)",border:"1px solid var(--dt-border)",borderRadius:"10px",padding:"2px 8px",fontSize:"11px"},hookPillLabel:{color:"var(--dt-text-muted)"},hookPillCount:{color:"var(--dt-hook-count)",fontWeight:"600"},sectionHeader:{fontSize:"10px",fontWeight:"700",textTransform:"uppercase",letterSpacing:"0.08em",color:"var(--dt-text-dim)",marginBottom:"4px",marginTop:"12px","&:first-child":{marginTop:"0"}},propItem:{display:"flex",alignItems:"baseline",gap:"8px",padding:"3px 0",fontSize:"12px",borderBottom:"1px solid var(--dt-border-3)"},propKey:{color:"var(--dt-prop-key)",flexShrink:"0",minWidth:"80px"},propValue:{color:"var(--dt-prop-val)",wordBreak:"break-all"},scopeItem:{padding:"3px 0",fontSize:"12px",borderBottom:"1px solid var(--dt-border-3)"},scopeName:{color:"var(--dt-scope-name)"},atomItem:{display:"flex",alignItems:"baseline",gap:"8px",padding:"3px 0",fontSize:"12px",borderBottom:"1px solid var(--dt-border-3)"},atomName:{color:"var(--dt-prop-key)",flexShrink:"0",minWidth:"80px"},atomValue:{color:"var(--dt-prop-val)",wordBreak:"break-all"},highlight:{display:"inline-block",padding:"1px 5px",borderRadius:"8px",fontSize:"11px",color:"var(--dt-text-muted)",background:"transparent",transition:"background 0.1s, color 0.1s"},highlightFlash:{animation:`${on} 0.6s ease forwards`},logsPanel:{flex:"1",display:"flex",flexDirection:"column",minHeight:"0",overflow:"hidden"},logsToolbar:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"5px 10px",borderBottom:"1px solid var(--dt-border-2)",flexShrink:"0",gap:"10px"},logsFilterRow:{display:"flex",gap:"4px"},logsFilterBtn:{background:"none",border:"1px solid var(--dt-border)",color:"var(--dt-text-muted)",cursor:"pointer",padding:"2px 9px",borderRadius:"3px",fontSize:"11px",fontFamily:"inherit",transition:"border-color 0.1s, color 0.1s, background 0.1s","&:hover":{borderColor:"var(--dt-text-dim)",color:"var(--dt-text)"},"&.active":{borderColor:"var(--dt-border-selected)",color:"var(--dt-text-selected)",background:"var(--dt-bg-active)"}},logsActions:{display:"flex",gap:"6px",alignItems:"center"},logsCount:{fontSize:"11px",color:"var(--dt-text-dimmer)"},logsContainer:{flex:"1",overflowY:"auto",padding:"4px 0",...ot},logEntry:{display:"flex",alignItems:"baseline",gap:"8px",padding:"3px 10px",fontSize:"12px",borderBottom:"1px solid var(--dt-border-3)","&:hover":{background:"var(--dt-bg-hover)"}},logTs:{color:"var(--dt-text-dimmer)",flexShrink:"0",fontSize:"11px",minWidth:"56px"},logBadge:{flexShrink:"0",padding:"1px 5px",borderRadius:"3px",fontSize:"10px",fontWeight:"700",textTransform:"uppercase",letterSpacing:"0.05em"},logLabel:{color:"var(--dt-text)",flexShrink:"0"},logDetail:{color:"var(--dt-text-muted)",wordBreak:"break-all",flex:"1",minWidth:"0"},perfPanel:{flex:"1",display:"flex",flexDirection:"column",minHeight:"0",overflow:"hidden"},perfToolbar:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"5px 10px",borderBottom:"1px solid var(--dt-border-2)",flexShrink:"0",gap:"10px"},perfTabs:{display:"flex",gap:"4px"},perfTabBtn:{background:"none",border:"1px solid var(--dt-border)",color:"var(--dt-text-muted)",cursor:"pointer",padding:"2px 9px",borderRadius:"3px",fontSize:"11px",fontFamily:"inherit",transition:"border-color 0.1s, color 0.1s, background 0.1s","&:hover":{borderColor:"var(--dt-text-dim)",color:"var(--dt-text)"},"&.active":{borderColor:"var(--dt-border-selected)",color:"var(--dt-text-selected)",background:"var(--dt-bg-active)"}},perfActions:{display:"flex",gap:"6px",alignItems:"center"},perfContent:{flex:"1",overflowY:"auto",...ot},perfTable:{width:"100%",borderCollapse:"collapse",fontSize:"12px"},perfTh:{padding:"5px 10px",textAlign:"left",color:"var(--dt-text-dim)",fontWeight:"600",fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.06em",borderBottom:"1px solid var(--dt-border-2)",position:"sticky",top:"0",background:"var(--dt-bg)"},perfThRight:{textAlign:"right"},perfRow:{borderBottom:"1px solid var(--dt-border-3)","&:hover":{background:"var(--dt-bg-hover)"}},perfRowClickable:{cursor:"pointer"},perfCell:{padding:"4px 10px",verticalAlign:"middle"},perfName:{color:"var(--dt-text)",fontWeight:"500"},perfNum:{textAlign:"right",color:"var(--dt-text-muted)",fontVariantNumeric:"tabular-nums"},perfBarWrap:{width:"80px",height:"6px",background:"var(--dt-bg-3)",borderRadius:"3px",overflow:"hidden",display:"inline-block",verticalAlign:"middle"},perfBar:{height:"100%",background:"var(--dt-accent)",borderRadius:"3px",transition:"width 0.2s ease"},perfBarLabel:{fontSize:"11px",color:"var(--dt-text-dim)",marginLeft:"5px"}}),_t=new Set,it=new WeakMap,ct=new WeakMap,N=i.event("devtools");function Gt(t,e){try{_t.add(t);let n=it.get(e);n||(n=new Set,it.set(e,n)),n.add(t),ct.set(t,1),N.trigger({type:"mount",component:t})}catch{}}function Ut(t,e){try{if(_t.delete(t),e){const n=it.get(e);n&&n.delete(t)}N.trigger({type:"unmount",component:t})}catch{}}function Yt(t){try{const e=ct.get(t)??0;ct.set(t,e+1),N.trigger({type:"render",component:t})}catch{}}function j(t){try{return ct.get(t)??0}catch{}return 0}function E(t){try{return t._depth??0}catch{}return 0}function wt(t){try{return t._parentComponent??null}catch{}return null}function St(){try{return Array.from(_t).filter(t=>{const e=t._view||t.oldView;return!e?.__devtools__&&!e?.skipDevToolsRender})}catch{}return[]}function cn(t){try{const e=it.get(t);return e?Array.from(e):[]}catch{}return[]}function A(t){try{return(t._view||t.oldView)?.name||"Anonymous"}catch{}return""}function ln(t){try{return t._view||t.oldView||null}catch{}return null}function Xt(){try{const t=St(),e=new Map;for(const o of t){const c=ln(o);if(!c)continue;let l=e.get(c);l||(l=[],e.set(c,l)),l.push(o)}const n=[];for(const[o,c]of e)n.push({viewFn:o,name:o.name||"Anonymous",instances:c});try{n.sort((o,c)=>{const l=a=>a.instances.reduce((u,d)=>Math.min(u,E(d)),1/0);return l(o)-l(c)})}catch{}return n}catch{}return[]}const h={row:"display:flex;align-items:baseline;gap:4px;font-size:13px;line-height:20px;font-family:'SF Mono',Monaco,Consolas,monospace;",toggle:"cursor:pointer;background:none;border:none;color:#888;font-size:10px;padding:0 2px;width:14px;text-align:center;flex-shrink:0;",key:"color:#9cdcfe;white-space:nowrap;",colon:"color:#777;",string:"color:#ce9178;",number:"color:#b5cea8;",boolean:"color:#569cd6;",null:"color:#569cd6;font-style:italic;",undefined:"color:#777;font-style:italic;",function:"color:#dcdcaa;font-style:italic;",symbol:"color:#c586c0;",preview:"color:#888;font-style:italic;",children:"margin-left:14px;padding-left:6px;border-left:1px solid #333;",badge:"color:#777;font-size:11px;margin-left:4px;background:#2a2a2a;padding:0 4px;border-radius:3px;"},qt=new WeakMap;let Jt=null;function kt(t){try{Jt=t}catch{}}function Kt(t){try{let e=qt.get(t);return e||(e=new Set,qt.set(t,e)),e}catch{return new Set}}function an(t,e){try{return Kt(t).has(e)}catch{return!1}}function sn(t,e){try{const n=Kt(t);n.has(e)?n.delete(e):n.add(e);try{Jt?.()}catch{}}catch{}}function dn(t){try{return t==null?!1:typeof t=="object"}catch{return!1}}function lt(t){try{return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":t instanceof Date?"date":t instanceof RegExp?"regexp":t instanceof Map?"map":t instanceof Set?"set":typeof t}catch{return""}}function Qt(t,e=60){try{const n=lt(t);if(n==="array"){const o=t;if(o.length===0)return"[]";const c=o.slice(0,5).map(a=>Zt(a)).join(", "),l=o.length>5?", …":"";return`[${c}${l}] (${o.length})`}if(n==="map")return`Map(${t.size})`;if(n==="set")return`Set(${t.size})`;if(n==="date")return`Date(${t.toISOString()})`;if(n==="regexp")return String(t);if(n==="object"){const o=t,c=Object.keys(o);if(c.length===0)return"{}";const l=c.slice(0,4).map(d=>`${d}: ${Zt(o[d])}`).join(", "),a=c.length>4?", …":"",u=`{${l}${a}}`;return u.length>e?u.slice(0,e-1)+"…}":u}return String(t)}catch{return""}}function Zt(t){try{switch(lt(t)){case"string":{const n=t;return n.length>30?`"${n.slice(0,27)}…"`:`"${n}"`}case"number":case"boolean":return String(t);case"null":return"null";case"undefined":return"undefined";case"function":return"ƒ()";case"symbol":return String(t);case"array":return`Array(${t.length})`;case"object":return"{…}";case"date":return"Date";case"map":return`Map(${t.size})`;case"set":return`Set(${t.size})`;default:return String(t)}}catch{return""}}function un(t){try{switch(lt(t)){case"string":return i.html`<span style="${h.string}">"${String(t)}"</span>`;case"number":return i.html`<span style="${h.number}">${String(t)}</span>`;case"boolean":return i.html`<span style="${h.boolean}">${String(t)}</span>`;case"null":return i.html`<span style="${h.null}">null</span>`;case"undefined":return i.html`<span style="${h.undefined}">undefined</span>`;case"function":return i.html`<span style="${h.function}"
|
|
2
2
|
>ƒ ${t.name||"anonymous"}()</span
|
|
3
|
-
>`;case"symbol":return
|
|
3
|
+
>`;case"symbol":return i.html`<span style="${h.symbol}">${String(t)}</span>`;case"date":return i.html`<span style="${h.string}"
|
|
4
4
|
>${t.toISOString()}</span
|
|
5
|
-
>`;case"regexp":return
|
|
5
|
+
>`;case"regexp":return i.html`<span style="${h.string}">${String(t)}</span>`;default:return i.html`<span style="${h.preview}">${String(t)}</span>`}}catch{return i.html``}}function pn(t){try{if(t instanceof Map)return Array.from(t.entries()).map(([e,n])=>({key:String(e),value:n}));if(t instanceof Set)return Array.from(t).map((e,n)=>({key:String(n),value:e}));if(Array.isArray(t))return t.map((e,n)=>({key:String(n),value:e}));if(typeof t=="object"&&t!==null){const e=[],n=new Set;for(const c of Object.keys(t)){n.add(c);try{e.push({key:c,value:t[c]})}catch{e.push({key:c,value:"[error reading]"})}}let o=Object.getPrototypeOf(t);for(;o&&o!==Object.prototype;){for(const c of Object.getOwnPropertyNames(o)){if(n.has(c)||c==="constructor")continue;if(Object.getOwnPropertyDescriptor(o,c)?.get){n.add(c);try{e.push({key:c,value:t[c]})}catch{e.push({key:c,value:"[error reading]"})}}}o=Object.getPrototypeOf(o)}return e}return[]}catch{return[]}}function T(t,e,n,o="root",c=0){try{if(c>15)return i.html`
|
|
6
6
|
<div style="${h.row}">
|
|
7
|
-
${e!=null?
|
|
8
|
-
><span style="${h.colon}">:</span>`:
|
|
7
|
+
${e!=null?i.html`<span style="${h.key}">${e}</span
|
|
8
|
+
><span style="${h.colon}">:</span>`:i.nothing}
|
|
9
9
|
<span style="${h.preview}">[max depth]</span>
|
|
10
10
|
</div>
|
|
11
|
-
`;const l=
|
|
11
|
+
`;const l=dn(n),a=l&&an(t,o);if(!l)return i.html`
|
|
12
12
|
<div style="${h.row}">
|
|
13
13
|
<span style="${h.toggle}"></span>
|
|
14
|
-
${e!=null?
|
|
15
|
-
><span style="${h.colon}">:</span>`:
|
|
16
|
-
${
|
|
14
|
+
${e!=null?i.html`<span style="${h.key}">${e}</span
|
|
15
|
+
><span style="${h.colon}">:</span>`:i.nothing}
|
|
16
|
+
${un(n)}
|
|
17
17
|
</div>
|
|
18
|
-
`;const u=a?
|
|
18
|
+
`;const u=a?pn(n):[],d=lt(n);return i.html`
|
|
19
19
|
<div>
|
|
20
20
|
<div
|
|
21
21
|
style="${h.row}cursor:pointer;user-select:none;"
|
|
22
|
-
@click=${p=>{try{p.stopPropagation(),
|
|
22
|
+
@click=${p=>{try{p.stopPropagation(),sn(t,o)}catch{}}}
|
|
23
23
|
>
|
|
24
24
|
<span style="${h.toggle}">${a?"▼":"▶"}</span>
|
|
25
|
-
${e!=null?
|
|
26
|
-
><span style="${h.colon}">:</span>`:
|
|
27
|
-
${a?
|
|
28
|
-
>${d==="array"?`Array(${n.length})`:d==="object"?"{":
|
|
29
|
-
>`:
|
|
25
|
+
${e!=null?i.html`<span style="${h.key}">${e}</span
|
|
26
|
+
><span style="${h.colon}">:</span>`:i.nothing}
|
|
27
|
+
${a?i.html`<span style="${h.preview}"
|
|
28
|
+
>${d==="array"?`Array(${n.length})`:d==="object"?"{":Qt(n)}</span
|
|
29
|
+
>`:i.html`<span style="${h.preview}">${Qt(n)}</span>`}
|
|
30
30
|
</div>
|
|
31
|
-
${a?
|
|
31
|
+
${a?i.html`
|
|
32
32
|
<div style="${h.children}">
|
|
33
|
-
${u.map(p=>T(t,p.key,p.value,`${
|
|
34
|
-
${u.length===0?
|
|
33
|
+
${u.map(p=>T(t,p.key,p.value,`${o}.${p.key}`,c+1))}
|
|
34
|
+
${u.length===0?i.html`<div style="${h.row}">
|
|
35
35
|
<span style="${h.preview}">(empty)</span>
|
|
36
|
-
</div>`:
|
|
36
|
+
</div>`:i.nothing}
|
|
37
37
|
</div>
|
|
38
|
-
${d==="object"&&a?
|
|
38
|
+
${d==="object"&&a?i.html`<div style="${h.row};margin-left:14px;">
|
|
39
39
|
<span style="${h.preview}">}</span>
|
|
40
|
-
</div>`:
|
|
41
|
-
`:
|
|
40
|
+
</div>`:i.nothing}
|
|
41
|
+
`:i.nothing}
|
|
42
42
|
</div>
|
|
43
|
-
`}catch{return
|
|
43
|
+
`}catch{return i.html``}}function fn(t,e,n="root"){try{const o=Object.keys(e);return o.length===0?i.html`<div style="color:#777;font-size:13px;padding:2px 0;">
|
|
44
44
|
No data
|
|
45
|
-
</div>`:
|
|
46
|
-
${
|
|
47
|
-
`}catch{return
|
|
48
|
-
${
|
|
49
|
-
`}catch{return
|
|
50
|
-
${[...t?.entries()||[]].map(([e,n])=>{try{const
|
|
45
|
+
</div>`:i.html`
|
|
46
|
+
${o.map(c=>T(t,c,e[c],`${n}.${c}`,0))}
|
|
47
|
+
`}catch{return i.html``}}function te(t){try{const e=Object.keys(t);return e.length===0?i.html`<div style="color: #777; font-size: 13px;">No props</div>`:i.html`
|
|
48
|
+
${i.repeat(e,n=>n,n=>T(t,n,t[n],`props.${n}`,0))}
|
|
49
|
+
`}catch{return i.html``}}function ee(t){try{return!t||t.size===0?i.html`<div style="color: #777; font-size: 13px;">No scopes</div>`:i.html`
|
|
50
|
+
${[...t?.entries()||[]].map(([e,n])=>{try{const o=e.name||"AnonymousScope",c={},l=new Set;for(const d of Object.keys(n))if(!(d==="__isScope___"||d==="reset")){l.add(d);try{const p=n[d];p&&typeof p=="function"&&p.__isAtom___?c[`${d} (atom)`]=p.get():c[d]=p}catch{c[d]="[error reading]"}}let a=Object.getPrototypeOf(n);for(;a&&a!==Object.prototype;){for(const d of Object.getOwnPropertyNames(a)){if(l.has(d)||d==="constructor"||d==="__isScope___"||d==="reset")continue;if(Object.getOwnPropertyDescriptor(a,d)?.get){l.add(d);try{c[`${d} (get)`]=n[d]}catch{c[`${d} (get)`]="[error reading]"}}}a=Object.getPrototypeOf(a)}const u=n;return i.html`
|
|
51
51
|
<div style="margin-bottom:6px;">
|
|
52
52
|
<div
|
|
53
53
|
style="color:#4ec9b0;font-weight:500;font-size:13px;margin-bottom:2px;font-family:'SF Mono',Monaco,Consolas,monospace;"
|
|
54
54
|
>
|
|
55
|
-
${
|
|
55
|
+
${o}
|
|
56
56
|
</div>
|
|
57
57
|
<div style="margin-left:4px;">
|
|
58
|
-
${Object.keys(c).length===0?
|
|
58
|
+
${Object.keys(c).length===0?i.html`<div style="color:#666;font-size:13px;">
|
|
59
59
|
(empty scope)
|
|
60
|
-
</div>`:
|
|
61
|
-
${Object.keys(c).map(d=>T(u,d,c[d],`scope_${
|
|
60
|
+
</div>`:i.html`
|
|
61
|
+
${Object.keys(c).map(d=>T(u,d,c[d],`scope_${o}.${d}`,0))}
|
|
62
62
|
`}
|
|
63
63
|
</div>
|
|
64
64
|
</div>
|
|
65
|
-
`}catch{return
|
|
66
|
-
`}catch{return
|
|
67
|
-
${
|
|
68
|
-
`}catch{return
|
|
69
|
-
${t.map((e,n)=>{const
|
|
70
|
-
`}catch{return
|
|
65
|
+
`}catch{return i.html``}})}
|
|
66
|
+
`}catch{return i.html``}}function hn(t){try{if(!t)return[];const e=[];for(const n of t.keys())if(n&&typeof n=="function"&&n.__isAtom___)try{e.push({id:n.__id__??"?",value:n.get(),key:n})}catch{}return e}catch{return[]}}function ne(t){try{const e=hn(t);return e.length===0?i.html`<div style="color: #777; font-size: 13px;">No atoms</div>`:i.html`
|
|
67
|
+
${i.repeat(e,n=>n.id,(n,o)=>{const c=e.length===1?"atom":`atom#${o+1}`,l=typeof n.value=="object"&&n.value!==null?n.value:n.key;return T(l,c,n.value,`atom_${n.id}`,0)})}
|
|
68
|
+
`}catch{return i.html``}}function re(t){try{return!t||t.length===0?i.html`<div style="color: #777; font-size: 13px;">No state</div>`:i.html`
|
|
69
|
+
${t.map((e,n)=>{const o=t.length===1?"state":`state#${n+1}`;let c;try{c=e.atom.get()}catch{c=e.state}return T(c,o,c,`useState_${n}`,0)})}
|
|
70
|
+
`}catch{return i.html``}}function gn(t){try{const e={onMount:0,onCleanup:0,onPaint:0,onAllMount:0,effects:0,on:0,setters:0,useState:0,atoms:0,events:0,channels:0},n=t._useStates;n&&(e.useState=n.length);const o=t.cleanups;if(!o)return e;for(const c of o.keys())if(c!=null){if(c.__isAtom___){e.atoms++;continue}if(c.__isSetter___){e.setters++;continue}if(c.__isCleanupEvent___){e.events++;continue}if(c.__isEvent___){e.events++;continue}if(c.__isChannel___){e.channels++;continue}if(c.__isOnMount__){e.onMount++;continue}if(c.__isOnCleanup__){e.onCleanup++;continue}if(c.__isOnPaint__){e.onPaint++;continue}if(c.__isOnAllMount__){e.onAllMount++;continue}if(c.__isEffect__){e.effects++;continue}if(c.__isOn__){e.on++;continue}}return e}catch{return{onMount:0,onCleanup:0,onPaint:0,onAllMount:0,effects:0,on:0,setters:0,useState:0,atoms:0,events:0,channels:0}}}function mn(t,e){try{return i.html`
|
|
71
71
|
<span class="${r.hookPill}">
|
|
72
72
|
<span class="${r.hookPillLabel}">${t}</span>
|
|
73
73
|
<span class="${r.hookPillCount}">${e}</span>
|
|
74
74
|
</span>
|
|
75
|
-
`}catch{return
|
|
75
|
+
`}catch{return i.html``}}function Ct(t){try{const e=gn(t),n=[];return e.onMount>0&&n.push({label:"onMount",count:e.onMount}),e.onCleanup>0&&n.push({label:"onCleanup",count:e.onCleanup}),e.onPaint>0&&n.push({label:"onPaint",count:e.onPaint}),e.onAllMount>0&&n.push({label:"onAllMount",count:e.onAllMount}),e.effects>0&&n.push({label:"effect",count:e.effects}),e.on>0&&n.push({label:"on",count:e.on}),e.setters>0&&n.push({label:"setter",count:e.setters}),e.useState>0&&n.push({label:"useState",count:e.useState}),e.atoms>0&&n.push({label:"atom",count:e.atoms}),e.events>0&&n.push({label:"event",count:e.events}),e.channels>0&&n.push({label:"channel",count:e.channels}),n.length===0?i.nothing:i.html`
|
|
76
76
|
<div class="${r.hooksSummary}">
|
|
77
|
-
${n.map(
|
|
77
|
+
${n.map(o=>mn(o.label,o.count))}
|
|
78
78
|
</div>
|
|
79
|
-
`}catch{return
|
|
79
|
+
`}catch{return i.html``}}function yn(t,e){try{t.stopPropagation(),mt(e)}catch{}}function bn(t){try{const e=[];let n=wt(t);for(;n;)e.push(A(n)),n=wt(n);return e.reverse(),e}catch{return[]}}function oe(t){try{const e=bn(t),n=A(t);if(e.length===0)return i.html`
|
|
80
80
|
<div class="${r.inspectorBreadcrumb}">
|
|
81
81
|
<span class="${r.breadcrumbSegment} ${r.breadcrumbCurrent}"
|
|
82
82
|
>${n}</span
|
|
83
83
|
>
|
|
84
84
|
</div>
|
|
85
|
-
`;const
|
|
85
|
+
`;const o=[];for(let c=0;c<e.length;c++)c>0&&o.push(i.html`<span class="${r.breadcrumbSeparator}">›</span>`),o.push(i.html`<span class="${r.breadcrumbSegment}">${e[c]}</span>`);return o.push(i.html`<span class="${r.breadcrumbSeparator}">›</span>`),o.push(i.html`<span class="${r.breadcrumbSegment} ${r.breadcrumbCurrent}"
|
|
86
86
|
>${n}</span
|
|
87
|
-
>`),
|
|
87
|
+
>`),i.html` <div class="${r.inspectorBreadcrumb}">${o}</div> `}catch{return i.html``}}function ie(t){try{return i.html`
|
|
88
88
|
<div class="${r.instanceDetails}">
|
|
89
89
|
<div class="${r.sectionHeader}">Props</div>
|
|
90
|
-
${
|
|
90
|
+
${te(t._props||{})}
|
|
91
91
|
|
|
92
92
|
<div class="${r.sectionHeader}">State</div>
|
|
93
|
-
${
|
|
93
|
+
${re(t._useStates)}
|
|
94
94
|
|
|
95
95
|
<div class="${r.sectionHeader}">Atoms</div>
|
|
96
|
-
${
|
|
96
|
+
${ne(t.cleanups)}
|
|
97
97
|
|
|
98
98
|
<div class="${r.sectionHeader}">Scopes</div>
|
|
99
|
-
${
|
|
99
|
+
${ee(t.scopes)}
|
|
100
100
|
</div>
|
|
101
|
-
`}catch{return
|
|
101
|
+
`}catch{return i.html``}}function ce(){try{return i.html`
|
|
102
102
|
<div class="${r.inspector}">
|
|
103
103
|
<div class="${r.empty}">Select a component to inspect</div>
|
|
104
104
|
</div>
|
|
105
|
-
`}catch{return
|
|
105
|
+
`}catch{return i.html``}}function le(t){try{const e=A(t),n=t.componentId,o=E(t),c=j(t);return i.html`
|
|
106
106
|
<div class="${r.inspector}">
|
|
107
|
-
${
|
|
107
|
+
${oe(t)}
|
|
108
108
|
<div class="${r.inspectorTitle}">
|
|
109
109
|
<span>${e}</span>
|
|
110
110
|
<span class="${r.instanceCount}">
|
|
111
|
-
#${n.toString().slice(2,6)} · depth ${
|
|
111
|
+
#${n.toString().slice(2,6)} · depth ${o} · renders ${c}
|
|
112
112
|
</span>
|
|
113
113
|
<button
|
|
114
114
|
class="${r.highlightBtn}"
|
|
@@ -133,9 +133,9 @@
|
|
|
133
133
|
</button>
|
|
134
134
|
</div>
|
|
135
135
|
|
|
136
|
-
${
|
|
136
|
+
${Ct(t)} ${ie(t)}
|
|
137
137
|
</div>
|
|
138
|
-
`}catch{return
|
|
138
|
+
`}catch{return i.html``}}function vn(t,e,n,o){try{const{name:c,instances:l}=t;return i.html`
|
|
139
139
|
<div class="${r.inspector}">
|
|
140
140
|
<div class="${r.inspectorTitle}">
|
|
141
141
|
<span>${c}</span>
|
|
@@ -145,15 +145,15 @@
|
|
|
145
145
|
</div>
|
|
146
146
|
|
|
147
147
|
<ul class="${r.instanceList}">
|
|
148
|
-
${
|
|
148
|
+
${i.repeat(l,a=>a.componentId,a=>{const u=a.componentId,d=E(a),p=j(a),b=e===u;return i.html`
|
|
149
149
|
<li class="${r.instanceGroup}">
|
|
150
150
|
<div
|
|
151
|
-
class="${r.instanceItem} ${
|
|
151
|
+
class="${r.instanceItem} ${b?rn:""}"
|
|
152
152
|
@click=${()=>{try{n(u)}catch{}}}
|
|
153
153
|
>
|
|
154
154
|
<span
|
|
155
|
-
class="${r.instanceToggle} ${
|
|
156
|
-
>${
|
|
155
|
+
class="${r.instanceToggle} ${b?r.instanceToggleSelected:""}"
|
|
156
|
+
>${b?"▼":"▶"}</span
|
|
157
157
|
>
|
|
158
158
|
<span class="${r.instanceId}"
|
|
159
159
|
>#${u.toString().slice(2,6)}</span
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
>
|
|
165
165
|
<button
|
|
166
166
|
class="${r.componentHighlightBtn}"
|
|
167
|
-
@click=${m=>{try{m.stopPropagation(),
|
|
167
|
+
@click=${m=>{try{m.stopPropagation(),o(a)}catch{}}}
|
|
168
168
|
title="Highlight in page"
|
|
169
169
|
>
|
|
170
170
|
<svg
|
|
@@ -183,49 +183,49 @@
|
|
|
183
183
|
</svg>
|
|
184
184
|
</button>
|
|
185
185
|
</div>
|
|
186
|
-
${
|
|
187
|
-
${
|
|
188
|
-
${
|
|
189
|
-
`:
|
|
186
|
+
${b?i.html`
|
|
187
|
+
${oe(a)} ${Ct(a)}
|
|
188
|
+
${ie(a)}
|
|
189
|
+
`:i.nothing}
|
|
190
190
|
</li>
|
|
191
191
|
`})}
|
|
192
192
|
</ul>
|
|
193
193
|
</div>
|
|
194
|
-
`}catch{return
|
|
194
|
+
`}catch{return i.html``}}function Tt(t){try{if("selectedComponent"in t&&t.selectedComponent!==void 0)return t.selectedComponent?le(t.selectedComponent):ce();const{selectedGroup:e,selectedInstanceId:n,onSelectInstance:o,onHighlight:c}=t;return e?e.instances.length===1?le(e.instances[0]):vn(e,n,o,c):ce()}catch{return i.html``}}const M=new Set;let W=null,G=null,U=null,Y=null,at=!1,st=!1;const dt=i.atom(0);dt.skipDevToolsLog=!0;function R(){try{dt.set(M.size)}catch{}}function X(t){st=!0;try{return t()}finally{st=!1}}function xn(){try{if(at)return;at=!0,W=window.setTimeout,G=window.setInterval,U=window.clearTimeout,Y=window.clearInterval;const t=W,e=G,n=U,o=Y;window.setTimeout=function(l,a,...u){let d;try{if(typeof l!="function")return d=t(l,a,...u),d;const p=l;d=t(function(...m){try{return M.delete(d)&&R(),p.apply(this,m.length?m:u)}catch{}},a,...u),st||(M.add(d),R())}catch{d=t(l,a,...u)}return d},window.setInterval=function(l,a,...u){let d;try{if(typeof l!="function")return d=e(l,a,...u),d;const p=l;d=e(function(...m){try{return p.apply(this,m.length?m:u)}catch{}},a,...u),st||(M.add(d),R())}catch{d=e(l,a,...u)}return d},window.clearTimeout=function(l){try{l!==void 0&&M.delete(l)&&R()}catch{}n(l)},window.clearInterval=function(l){try{l!==void 0&&M.delete(l)&&R()}catch{}o(l)}}catch{}}function $n(){try{if(!at)return;at=!1,W&&(window.setTimeout=W),G&&(window.setInterval=G),U&&(window.clearTimeout=U),Y&&(window.clearInterval=Y),W=null,G=null,U=null,Y=null,M.clear(),R()}catch{}}const Mt=new WeakMap;let _n=0;function wn(t){return Mt.has(t)||Mt.set(t,`mdt-hl-${++_n}`),Mt.get(t)}function ae(t,e,n){try{const o=n.get(e),c=o!==void 0&&o!==t;n.set(e,t);const l=wn(e);return c&&X(()=>setTimeout(()=>{try{const a=document.getElementById(l);if(!a)return;a.classList.remove("mdt-highlight-flash"),a.offsetWidth,a.classList.add("mdt-highlight-flash"),setTimeout(()=>{try{a.classList.remove("mdt-highlight-flash")}catch{}},600)}catch{}},0)),i.html`<span id="${l}" class="mdt-highlight">${t}</span>`}catch{return i.html``}}const Sn=new WeakMap;let It="";function kn(t){try{let e=0;for(const n of t.instances){const o=j(n);o>e&&(e=o)}return e}catch{return 0}}function Bt(t){try{let e=1/0;for(const n of t.instances){const o=E(n);o<e&&(e=o)}return e===1/0?0:e}catch{return 0}}function se({groups:t,selectedViewFn:e,onSelectGroup:n,onHighlight:o,renderCallback:c}){try{const l=It.trim().toLowerCase(),u=[...l?t.filter(p=>p.name.toLowerCase().includes(l)):t].sort((p,b)=>{const m=Bt(p),v=Bt(b);return m-v||p.name.localeCompare(b.name)}),d=p=>{try{It=p.target.value,c()}catch{}};return i.html`
|
|
195
195
|
<div class="${r.content}">
|
|
196
196
|
<div style="padding: 0 0 6px 0; flex-shrink: 0;">
|
|
197
197
|
<input
|
|
198
198
|
class="${r.componentSearch}"
|
|
199
199
|
type="text"
|
|
200
200
|
placeholder="Search components…"
|
|
201
|
-
.value=${
|
|
201
|
+
.value=${It}
|
|
202
202
|
@input=${d}
|
|
203
203
|
/>
|
|
204
204
|
</div>
|
|
205
|
-
${u.length===0?
|
|
205
|
+
${u.length===0?i.html`<div class="${r.empty}">
|
|
206
206
|
${l?"No matching components":"No components mounted"}
|
|
207
|
-
</div>`:
|
|
207
|
+
</div>`:i.html`
|
|
208
208
|
<ul class="${r.componentList}">
|
|
209
|
-
${
|
|
209
|
+
${i.repeat(u,p=>p.viewFn,p=>{const b=kn(p),m=e===p.viewFn,v=Bt(p),$t=p.instances.length,en=p.instances[0];return i.html`
|
|
210
210
|
<li
|
|
211
|
-
class="${r.componentItem} ${m?
|
|
211
|
+
class="${r.componentItem} ${m?Wt:""}"
|
|
212
212
|
@click=${()=>{try{n(p.viewFn)}catch{}}}
|
|
213
213
|
>
|
|
214
|
-
${
|
|
214
|
+
${ae(b,en,Sn)}
|
|
215
215
|
<span class="${r.componentName}"
|
|
216
216
|
>${p.name}</span
|
|
217
217
|
>
|
|
218
|
-
${
|
|
218
|
+
${$t>1?i.html`<span
|
|
219
219
|
class="${r.componentCount} ${m?r.componentCountSelected:""}"
|
|
220
|
-
>×${
|
|
220
|
+
>×${$t}</span
|
|
221
221
|
>`:""}
|
|
222
222
|
<span
|
|
223
223
|
class="${r.componentBadge} ${m?r.componentBadgeSelected:""}"
|
|
224
|
-
>depth ${
|
|
224
|
+
>depth ${v}</span
|
|
225
225
|
>
|
|
226
226
|
<button
|
|
227
227
|
class="${r.componentHighlightBtn} ${m?r.componentHighlightBtnSelected:""}"
|
|
228
|
-
@click=${
|
|
228
|
+
@click=${nn=>{try{nn.stopPropagation(),o(en)}catch{}}}
|
|
229
229
|
title="Highlight in page"
|
|
230
230
|
>
|
|
231
231
|
<svg
|
|
@@ -250,23 +250,23 @@
|
|
|
250
250
|
</ul>
|
|
251
251
|
`}
|
|
252
252
|
</div>
|
|
253
|
-
`}catch{return
|
|
253
|
+
`}catch{return i.html``}}const Cn=new WeakMap,Lt=new WeakSet;function Tn(t){try{const e=new Set(t),n=new Map;for(const l of t)n.set(l,{component:l,name:A(l),depth:E(l),id:l.componentId,children:[]});const o=[];for(const l of t){const a=n.get(l),u=wt(l);if(u&&e.has(u)){const d=n.get(u);if(d){d.children.push(a);continue}}o.push(a)}const c=l=>{try{l.sort((a,u)=>a.depth-u.depth||a.name.localeCompare(u.name));for(const a of l)c(a.children)}catch{}};return c(o),o}catch{return[]}}function de(t,e,n,o,c){try{const l=t.children.length>0,a=Lt.has(t.component),u=j(t.component),d=e===t.id,p=t.depth*16,b=v=>{try{v.stopPropagation(),a?Lt.delete(t.component):Lt.add(t.component),c()}catch{}},m=()=>{try{n(t.id)}catch{}};return i.html`
|
|
254
254
|
<li
|
|
255
|
-
class="${r.componentItem} ${d?
|
|
255
|
+
class="${r.componentItem} ${d?Wt:""}"
|
|
256
256
|
style="margin-left: ${p}px;"
|
|
257
257
|
@click=${m}
|
|
258
258
|
>
|
|
259
|
-
${l?
|
|
259
|
+
${l?i.html`<span class="${r.treeToggle}" @click=${b}
|
|
260
260
|
>${a?"▶":"▼"}</span
|
|
261
|
-
>`:
|
|
262
|
-
${
|
|
261
|
+
>`:i.html`<span class="${r.treeLeaf}">·</span>`}
|
|
262
|
+
${ae(u,t.component,Cn)}
|
|
263
263
|
<span class="${r.componentName}">${t.name}</span>
|
|
264
264
|
<span class="${r.componentBadge}"
|
|
265
265
|
>#${t.id.toString().slice(2,6)}</span
|
|
266
266
|
>
|
|
267
267
|
<button
|
|
268
268
|
class="${r.componentHighlightBtn}"
|
|
269
|
-
@click=${
|
|
269
|
+
@click=${v=>{try{v.stopPropagation(),o(t.component)}catch{}}}
|
|
270
270
|
title="Highlight in page"
|
|
271
271
|
>
|
|
272
272
|
<svg
|
|
@@ -287,16 +287,16 @@
|
|
|
287
287
|
</svg>
|
|
288
288
|
</button>
|
|
289
289
|
</li>
|
|
290
|
-
${l&&!a?
|
|
291
|
-
`}catch{return
|
|
290
|
+
${l&&!a?i.repeat(t.children,v=>v.component,v=>de(v,e,n,o,c)):i.nothing}
|
|
291
|
+
`}catch{return i.html``}}function ue({selectedComponentId:t,onSelectComponent:e,onHighlight:n,renderCallback:o}){try{const c=St(),l=Tn(c);return i.html`
|
|
292
292
|
<div class="${r.content}">
|
|
293
|
-
${l.length===0?
|
|
293
|
+
${l.length===0?i.html`<div class="${r.empty}">No components mounted</div>`:i.html`
|
|
294
294
|
<ul class="${r.componentList}">
|
|
295
|
-
${
|
|
295
|
+
${i.repeat(l,a=>a.component,a=>de(a,t,e,n,o))}
|
|
296
296
|
</ul>
|
|
297
297
|
`}
|
|
298
298
|
</div>
|
|
299
|
-
`}catch{return
|
|
299
|
+
`}catch{return i.html``}}const pe=()=>(i.effect(()=>{try{console.log(dt())}catch{}}),()=>{try{return i.html`Active Timers (${dt()})`}catch{return i.html``}});pe.skipDevToolsRender=!0;function fe({activeTab:t,onTabChange:e,onMinimise:n,onClose:o,unreadLogCount:c}){try{return i.html`
|
|
300
300
|
<div class="${r.header}">
|
|
301
301
|
<div class="${r.headerLeft}">
|
|
302
302
|
<div class="${r.title}">🔧 Mates DevTools</div>
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
@click=${()=>{try{e("logs")}catch{}}}
|
|
313
313
|
>
|
|
314
314
|
Logs
|
|
315
|
-
${c>0?
|
|
315
|
+
${c>0?i.html`<span class="${r.tabBadge}"
|
|
316
316
|
>${c>99?"99+":c}</span
|
|
317
317
|
>`:""}
|
|
318
318
|
</button>
|
|
@@ -325,7 +325,7 @@
|
|
|
325
325
|
</nav>
|
|
326
326
|
</div>
|
|
327
327
|
<div>
|
|
328
|
-
<button style="margin-left: 10px">${
|
|
328
|
+
<button style="margin-left: 10px">${i.x(pe)}</button>
|
|
329
329
|
</div>
|
|
330
330
|
<div class="${r.controls}">
|
|
331
331
|
<button
|
|
@@ -337,41 +337,41 @@
|
|
|
337
337
|
</button>
|
|
338
338
|
<button
|
|
339
339
|
class="${r.button}"
|
|
340
|
-
@click=${()=>{try{
|
|
340
|
+
@click=${()=>{try{o()}catch{}}}
|
|
341
341
|
title="Close"
|
|
342
342
|
>
|
|
343
343
|
×
|
|
344
344
|
</button>
|
|
345
345
|
</div>
|
|
346
346
|
</div>
|
|
347
|
-
`}catch{return
|
|
347
|
+
`}catch{return i.html``}}let ut=null;function he(t){try{return ut=t,()=>{ut===t&&(ut=null)}}catch{}return()=>{}}let x=!1;function ge(){x=!0}function me(){x=!1}function Mn(){return x}const In=100,P=[];let ye=1,pt=0;const be=new Set(["devtools","DOMReady","Paint"]);function k(t,e,n){try{P.length>=In&&P.shift(),P.push({id:ye++,ts:performance.now(),category:t,label:e,detail:n}),pt++;try{ut?.()}catch{}}catch{}}function Et(t){try{if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="function")return"ƒ()";try{const e=JSON.stringify(t);return e.length>120?e.slice(0,117)+"...":e}catch{return String(t)}}catch{}return""}function ve(){return P}function Bn(){return P.length}function xe(){return pt}function $e(){try{pt=0}catch{}}function _e(){try{P.length=0,pt=0,ye=1}catch{}}function we(t){try{if(!x)return;k("mount",t,"mounted")}catch{}}function Se(t,e){try{if(!x)return;k("update",t,`updated (${e.toFixed(2)}ms)`)}catch{}}function ke(t){try{if(!x)return;k("cleanup",t,"cleaned up")}catch{}}function Ce(t,e){try{if(!x)return;k("setter",t,Et(e))}catch{}}function Te(t){try{if(!x)return;k("action",t)}catch{}}function Me(t,e){try{if(!x||be.has(t))return;k("event",t,e!==void 0?Et(e):void 0)}catch{}}const At=80,Ie=120;function z(t,e){try{return t.length>e?t.slice(0,e-1)+"…":t}catch{}return""}function Ln(t,e,n){try{if(!x)return;const o=n?`pending · ${z(n,50)}`:"pending";k("fetch",z(`${t} ${e}`,At),o)}catch{}}function Be(t,e,n,o){try{if(!x)return;k("fetch",z(`${t} ${e}`,At),z(`${n} · ${o.toFixed(0)}ms`,Ie))}catch{}}function Le(t,e,n,o){try{if(!x)return;k("fetch",z(`${t} ${e}`,At),z(`error · ${o.toFixed(0)}ms · ${n}`,Ie))}catch{}}function Ee(t,e){try{if(!x||be.has(t))return;k("event",`${t} (cleanup)`,e!==void 0?Et(e):void 0)}catch{}}const H={mount:"#66bb6a",update:"#42a5f5",cleanup:"#ef5350",setter:"#4fc3f7",action:"#81c784",event:"#ffb74d",fetch:"#ce93d8"},En={mount:"MNT",update:"UPD",cleanup:"CLN",setter:"SET",action:"ACT",event:"EVT",fetch:"NET"};let _="all";const An={all:null,lifecycle:["mount","update","cleanup"],logs:["setter","action","event"],network:["fetch"]};function Rn(t){try{const e=t/1e3|0,n=t%1e3,o=e/60|0,c=e%60;return`${String(o).padStart(2,"0")}:${String(c).padStart(2,"0")}.${String(n|0).padStart(3,"0")}`}catch{return""}}function Pn(){try{const t=ve(),e=An[_];if(!e)return t;const n=new Set(e);return t.filter(o=>n.has(o.category))}catch{return[]}}function Ae({onClear:t,renderCallback:e}){try{$e();const n=Pn();return i.html`
|
|
348
348
|
<div class="${r.logsPanel}">
|
|
349
349
|
<div class="${r.logsToolbar}">
|
|
350
350
|
<div class="${r.logsFilterRow}">
|
|
351
351
|
<button
|
|
352
|
-
class="${r.logsFilterBtn} ${
|
|
353
|
-
@click=${()=>{try{
|
|
352
|
+
class="${r.logsFilterBtn} ${_==="all"?"active":""}"
|
|
353
|
+
@click=${()=>{try{_="all",e()}catch{}}}
|
|
354
354
|
>
|
|
355
355
|
All
|
|
356
356
|
</button>
|
|
357
357
|
<button
|
|
358
|
-
class="${r.logsFilterBtn} ${
|
|
358
|
+
class="${r.logsFilterBtn} ${_==="lifecycle"?"active":""}"
|
|
359
359
|
style="--mdt-filter-color: ${H.mount}"
|
|
360
|
-
@click=${()=>{try{
|
|
360
|
+
@click=${()=>{try{_=_==="lifecycle"?"all":"lifecycle",e()}catch{}}}
|
|
361
361
|
>
|
|
362
362
|
Mounts / Updates
|
|
363
363
|
</button>
|
|
364
364
|
<button
|
|
365
|
-
class="${r.logsFilterBtn} ${
|
|
365
|
+
class="${r.logsFilterBtn} ${_==="logs"?"active":""}"
|
|
366
366
|
style="--mdt-filter-color: ${H.setter}"
|
|
367
|
-
@click=${()=>{try{
|
|
367
|
+
@click=${()=>{try{_=_==="logs"?"all":"logs",e()}catch{}}}
|
|
368
368
|
>
|
|
369
369
|
Logs
|
|
370
370
|
</button>
|
|
371
371
|
<button
|
|
372
|
-
class="${r.logsFilterBtn} ${
|
|
372
|
+
class="${r.logsFilterBtn} ${_==="network"?"active":""}"
|
|
373
373
|
style="--mdt-filter-color: ${H.fetch}"
|
|
374
|
-
@click=${()=>{try{
|
|
374
|
+
@click=${()=>{try{_=_==="network"?"all":"network",e()}catch{}}}
|
|
375
375
|
>
|
|
376
376
|
Network
|
|
377
377
|
</button>
|
|
@@ -380,7 +380,7 @@
|
|
|
380
380
|
<span class="${r.logsCount}">${n.length} entries</span>
|
|
381
381
|
<button
|
|
382
382
|
class="${r.button}"
|
|
383
|
-
@click=${()=>{try{
|
|
383
|
+
@click=${()=>{try{_e(),t()}catch{}}}
|
|
384
384
|
title="Clear logs"
|
|
385
385
|
>
|
|
386
386
|
🗑
|
|
@@ -389,27 +389,27 @@
|
|
|
389
389
|
</div>
|
|
390
390
|
|
|
391
391
|
<div class="${r.logsContainer}">
|
|
392
|
-
${n.length===0?
|
|
392
|
+
${n.length===0?i.html`<div class="${r.empty}">
|
|
393
393
|
No logs yet. Interact with the app to see activity.
|
|
394
|
-
</div>`:
|
|
394
|
+
</div>`:i.repeat(n,o=>o.id,o=>i.html`
|
|
395
395
|
<div class="${r.logEntry}">
|
|
396
|
-
<span class="${r.logTs}">${
|
|
396
|
+
<span class="${r.logTs}">${Rn(o.ts)}</span>
|
|
397
397
|
<span
|
|
398
398
|
class="${r.logBadge}"
|
|
399
|
-
style="background: ${H[
|
|
400
|
-
>${En[
|
|
399
|
+
style="background: ${H[o.category]}22; color: ${H[o.category]}; border-color: ${H[o.category]}44;"
|
|
400
|
+
>${En[o.category]}</span
|
|
401
401
|
>
|
|
402
|
-
<span class="${r.logLabel}">${
|
|
403
|
-
${
|
|
404
|
-
>${
|
|
405
|
-
>`:
|
|
402
|
+
<span class="${r.logLabel}">${o.label}</span>
|
|
403
|
+
${o.detail?i.html`<span class="${r.logDetail}"
|
|
404
|
+
>${o.detail}</span
|
|
405
|
+
>`:i.nothing}
|
|
406
406
|
</div>
|
|
407
407
|
`)}
|
|
408
408
|
</div>
|
|
409
409
|
</div>
|
|
410
|
-
`}catch{return
|
|
410
|
+
`}catch{return i.html``}}let q=!1;function Re(){try{q=!0}catch{}}function Pe(){try{q=!1}catch{}}function zn(){return q}const Hn=100,J=new Map;let ze=1,ft=null;function He(t){try{return ft=t,()=>{try{ft===t&&(ft=null)}catch{}}}catch{}return()=>{}}function Rt(t,e,n){try{if(!q)return;const o={id:ze++,ts:performance.now(),durationMs:n,componentName:t,instanceId:e};let c=J.get(t);c||(c=[],J.set(t,c)),c.length>=Hn&&c.shift(),c.push(o);try{ft?.()}catch{}}catch{}}function Fn(t,e){try{if(!q)return Fe;const n=performance.now();return()=>Rt(t,e,performance.now()-n)}catch{}return Fe}function Fe(){}function De(){try{const t=[];for(const[e,n]of J){if(n.length===0)continue;let o=0,c=0,l=1/0;for(const a of n)o+=a.durationMs,a.durationMs>c&&(c=a.durationMs),a.durationMs<l&&(l=a.durationMs);t.push({name:e,renderCount:n.length,avgMs:o/n.length,maxMs:c,minMs:l,lastMs:n[n.length-1].durationMs,totalMs:o,timings:n})}return t.sort((e,n)=>n.totalMs-e.totalMs),t}catch{}return[]}function Oe(){try{const t=[];for(const e of J.values())for(let n=0;n<e.length;n++)t.push(e[n]);return t}catch{}return[]}function Dn(t=50){try{const e=Oe();return e.sort((n,o)=>o.ts-n.ts),e.length>t?e.slice(0,t):e}catch{}return[]}function Ve(t=20){try{const e=Oe();return e.sort((n,o)=>o.durationMs-n.durationMs),e.length>t?e.slice(0,t):e}catch{}return[]}function Ne(){try{J.clear(),ze=1}catch{}}i.atom(0);function K(t){try{return t<.01?"<0.01ms":t<1?`${t.toFixed(2)}ms`:t<10?`${t.toFixed(1)}ms`:`${t.toFixed(0)}ms`}catch{return""}}function je(t,e){try{return e<=0?0:Math.max(2,Math.min(100,t/e*100))}catch{return 0}}function We(t){try{return t<16?"#66bb6a":t<=20?"#ffb74d":"#ef5350"}catch{return""}}let Q="summary";function On(t){try{if(t.length===0)return i.html`<div class="${r.empty}">
|
|
411
411
|
No render data yet. Interact with the app to see component performance.
|
|
412
|
-
</div>`;const e=Math.max(...t.map(n=>n.totalMs));return
|
|
412
|
+
</div>`;const e=Math.max(...t.map(n=>n.totalMs));return i.html`
|
|
413
413
|
<table class="${r.perfTable}">
|
|
414
414
|
<thead>
|
|
415
415
|
<tr>
|
|
@@ -422,7 +422,7 @@
|
|
|
422
422
|
</tr>
|
|
423
423
|
</thead>
|
|
424
424
|
<tbody>
|
|
425
|
-
${
|
|
425
|
+
${i.repeat(t,n=>n.name,n=>{const o=We(n.lastMs);return i.html`
|
|
426
426
|
<tr class="${r.perfRow}">
|
|
427
427
|
<td class="${r.perfCell} ${r.perfName}">
|
|
428
428
|
${n.name}
|
|
@@ -443,7 +443,7 @@
|
|
|
443
443
|
<div class="${r.perfBarWrap}">
|
|
444
444
|
<div
|
|
445
445
|
class="${r.perfBar}"
|
|
446
|
-
style="width: ${
|
|
446
|
+
style="width: ${je(n.totalMs,e)}%; background: ${o};"
|
|
447
447
|
></div>
|
|
448
448
|
<span class="${r.perfBarLabel}"
|
|
449
449
|
>${K(n.totalMs)}</span
|
|
@@ -454,9 +454,9 @@
|
|
|
454
454
|
`})}
|
|
455
455
|
</tbody>
|
|
456
456
|
</table>
|
|
457
|
-
`}catch{return
|
|
457
|
+
`}catch{return i.html``}}function Vn(t,e){try{if(t.length===0)return i.html`<div class="${r.empty}">
|
|
458
458
|
No render data yet. Interact with the app to see slow renders.
|
|
459
|
-
</div>`;const n=Math.max(...t.map(c=>c.durationMs)),
|
|
459
|
+
</div>`;const n=Math.max(...t.map(c=>c.durationMs)),o=!!e;return i.html`
|
|
460
460
|
<table class="${r.perfTable}">
|
|
461
461
|
<thead>
|
|
462
462
|
<tr>
|
|
@@ -466,11 +466,11 @@
|
|
|
466
466
|
</tr>
|
|
467
467
|
</thead>
|
|
468
468
|
<tbody>
|
|
469
|
-
${
|
|
469
|
+
${i.repeat(t,c=>c.id,c=>{const l=We(c.durationMs),a=o?()=>{try{e(c.instanceId)}catch{}}:void 0;return i.html`
|
|
470
470
|
<tr
|
|
471
|
-
class="${r.perfRow} ${
|
|
471
|
+
class="${r.perfRow} ${o?r.perfRowClickable:""}"
|
|
472
472
|
@click=${a}
|
|
473
|
-
title=${
|
|
473
|
+
title=${o?`Go to ${c.componentName} in Components tab`:""}
|
|
474
474
|
>
|
|
475
475
|
<td class="${r.perfCell} ${r.perfName}">
|
|
476
476
|
${c.componentName}
|
|
@@ -482,7 +482,7 @@
|
|
|
482
482
|
<div class="${r.perfBarWrap}">
|
|
483
483
|
<div
|
|
484
484
|
class="${r.perfBar}"
|
|
485
|
-
style="width: ${
|
|
485
|
+
style="width: ${je(c.durationMs,n)}%; background: ${l};"
|
|
486
486
|
></div>
|
|
487
487
|
</div>
|
|
488
488
|
</td>
|
|
@@ -490,7 +490,7 @@
|
|
|
490
490
|
`})}
|
|
491
491
|
</tbody>
|
|
492
492
|
</table>
|
|
493
|
-
`}catch{return
|
|
493
|
+
`}catch{return i.html``}}function Ge({onClear:t,renderCallback:e,onNavigateToComponent:n}){try{const o=De(),c=Ve(30);return i.html`
|
|
494
494
|
<div class="${r.perfPanel}">
|
|
495
495
|
<div class="${r.perfToolbar}">
|
|
496
496
|
<div class="${r.perfTabs}">
|
|
@@ -510,7 +510,7 @@
|
|
|
510
510
|
<div class="${r.perfActions}">
|
|
511
511
|
<button
|
|
512
512
|
class="${r.button}"
|
|
513
|
-
@click=${()=>{try{
|
|
513
|
+
@click=${()=>{try{Ne(),t()}catch{}}}
|
|
514
514
|
title="Clear performance data"
|
|
515
515
|
>
|
|
516
516
|
🗑
|
|
@@ -519,10 +519,10 @@
|
|
|
519
519
|
</div>
|
|
520
520
|
|
|
521
521
|
<div class="${r.perfContent}">
|
|
522
|
-
${Q==="summary"?
|
|
522
|
+
${Q==="summary"?On(o):Vn(c,n??null)}
|
|
523
523
|
</div>
|
|
524
524
|
</div>
|
|
525
|
-
`}catch{return
|
|
525
|
+
`}catch{return i.html``}}let I=!1,C=!1,Z="components",B="list",$=null,w=null,y=null,F=[],f=null,S=null,D=0;const Nn=150,jn=.8,Wn=.5;let L=null;function Pt(){try{const t=document.documentElement;L===null&&(L=parseFloat(getComputedStyle(t).paddingBottom)||0),t.style.paddingBottom=`${L+D}px`}catch{}}function zt(){try{if(L===null)return;document.documentElement.style.paddingBottom=L===0?"":`${L}px`,L=null}catch{}}let Ht=!1,Ue=0,Ye=0,ht=!1,tt=null,et=null,nt=null,O=null,V=null;function Gn(){try{V!==null&&(clearTimeout(V),V=null)}catch{}}function gt(){try{Gn(),O&&(O.remove(),O=null)}catch{}}function mt(t){try{let e=function(){try{const l=document.createElement("div");l.className=r.domHighlight,document.body.appendChild(l),O=l;const a=n.getBoundingClientRect();c?(l.style.position="fixed",l.style.top=`${a.top}px`,l.style.left=`${a.left}px`):(l.style.top=`${a.top+window.scrollY}px`,l.style.left=`${a.left+window.scrollX}px`),l.style.width=`${a.width}px`,l.style.height=`${a.height}px`,V=X(()=>setTimeout(()=>{try{O===l&&(l.classList.add("fade-out"),V=X(()=>setTimeout(()=>{try{O===l&>()}catch{}},600)))}catch{}},1500))}catch{}};gt();const n=t.firstElementChild??t,o=getComputedStyle(n).position,c=o==="fixed"||o==="sticky";if(c)e();else{const l=n.getBoundingClientRect(),a=l.top>=0&&l.bottom<=(window.innerHeight||document.documentElement.clientHeight);a||n.scrollIntoView({behavior:"smooth",block:"center"}),V=X(()=>setTimeout(e,a?0:400))}}catch{}}function Xe(){try{if($===null)return null;for(const t of F)for(const e of t.instances)if(e.componentId===$)return e;return null}catch{}return null}function Ft(){try{return w===null?null:F.find(t=>t.viewFn===w)??null}catch{}return null}function Un(){try{if(y===null)return null;const t=Ft();return t?t.instances.find(e=>e.componentId===y)??null:null}catch{}return null}function yt(){try{F=Xt(),$!==null&&!Xe()&&($=null),w!==null&&!Ft()?(w=null,y=null):y!==null&&!Un()&&(y=null)}catch{}}function bt(){try{return I&&!C}catch{}return!1}function rt(){try{return S?.querySelector(`.${r.panel}`)??null}catch{}return null}function Yn(t){try{$=$===t?null:t,g()}catch{}}function Xn(t){try{w===t?(w=null,y=null):(w=t,y=null),g()}catch{}}function qn(t){try{y=y===t?null:t,g()}catch{}}function Jn(t){try{$=t,Z="components",yt(),w=null,y=null;for(const e of F){for(const n of e.instances)if(n.componentId===t){w=e.viewFn,y=t;break}if(w)break}g()}catch{}}function Kn(t){try{Z=t,g()}catch{}}function Qn(){try{if(!I||C)return;C=!0,rt()?.classList.remove(r.panelVisible),f&&(f.style.display=""),zt()}catch{}}function Zn(){try{if(!C)return;C=!1,f&&(f.style.display="none"),yt(),g(),Pt(),requestAnimationFrame(()=>{try{requestAnimationFrame(()=>{try{rt()?.classList.add(r.panelVisible)}catch{}})}catch{}})}catch{}}function tr(){try{I=!1,C=!1,$=null,qe(),gt(),zt();const t=rt();if(t){t.classList.remove(r.panelVisible);let e=!1;const n=()=>{try{if(e)return;e=!0,t.removeEventListener("transitionend",n),Ot()}catch{}};t.addEventListener("transitionend",n,{once:!0}),X(()=>setTimeout(n,350))}else Ot();f&&(f.style.display="")}catch{}}function er(){try{if(I)return;I=!0,C=!1,f&&(f.style.display="none"),D=Math.round(window.innerHeight*Wn),nr(),ir(),yt(),g(),Pt(),requestAnimationFrame(()=>{try{requestAnimationFrame(()=>{try{rt()?.classList.add(r.panelVisible)}catch{}})}catch{}})}catch{}}function nr(){try{Re(),tt||(tt=he(()=>{try{bt()&&g()}catch{}})),et||(et=He(()=>{try{bt()&&g()}catch{}}))}catch{}}function qe(){try{Pe(),tt&&(tt(),tt=null),et&&(et(),et=null)}catch{}}const Dt="mates-devtools-vars";function rr(){try{if(document.getElementById(Dt))return;const t=document.createElement("style");t.id=Dt,t.textContent=`
|
|
526
526
|
#mates-devtools {
|
|
527
527
|
--dt-bg: #1a1a1a;
|
|
528
528
|
--dt-bg-2: #222222;
|
|
@@ -554,42 +554,8 @@
|
|
|
554
554
|
--dt-flash-bg: rgba(0,180,100,0.45);
|
|
555
555
|
}
|
|
556
556
|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
#mates-devtools-fab {
|
|
560
|
-
--dt-bg: #f5f5f5;
|
|
561
|
-
--dt-bg-2: #ebebeb;
|
|
562
|
-
--dt-bg-3: #e0e0e0;
|
|
563
|
-
--dt-bg-input: #ffffff;
|
|
564
|
-
--dt-bg-hover: #e8e8e8;
|
|
565
|
-
--dt-bg-selected: #dbeafe;
|
|
566
|
-
--dt-bg-active: rgba(59,130,246,0.12);
|
|
567
|
-
--dt-border: #cccccc;
|
|
568
|
-
--dt-border-2: #d4d4d4;
|
|
569
|
-
--dt-border-3: #e4e4e4;
|
|
570
|
-
--dt-border-selected: #3b82f6;
|
|
571
|
-
--dt-text: #333333;
|
|
572
|
-
--dt-text-bright: #111111;
|
|
573
|
-
--dt-text-muted: #666666;
|
|
574
|
-
--dt-text-dim: #888888;
|
|
575
|
-
--dt-text-dimmer: #999999;
|
|
576
|
-
--dt-text-selected: #1d4ed8;
|
|
577
|
-
--dt-accent: #0077e6;
|
|
578
|
-
--dt-accent-2: #3b82f6;
|
|
579
|
-
--dt-scrollbar: #bbbbbb;
|
|
580
|
-
--dt-scrollbar-hover: #999999;
|
|
581
|
-
--dt-prop-key: #0070c1;
|
|
582
|
-
--dt-prop-val: #a31515;
|
|
583
|
-
--dt-scope-name: #007f6a;
|
|
584
|
-
--dt-hook-count: #0070c1;
|
|
585
|
-
--dt-instance-border: #3b82f6;
|
|
586
|
-
--dt-instance-bg: #f0f4ff;
|
|
587
|
-
--dt-flash-bg: rgba(0,160,90,0.3);
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
#mates-devtools[data-theme="light"],
|
|
592
|
-
#mates-devtools-fab[data-theme="light"] {
|
|
557
|
+
:root[data-theme="light"] #mates-devtools,
|
|
558
|
+
:root[data-theme="light"] #mates-devtools-fab {
|
|
593
559
|
--dt-bg: #f5f5f5;
|
|
594
560
|
--dt-bg-2: #ebebeb;
|
|
595
561
|
--dt-bg-3: #e0e0e0;
|
|
@@ -619,7 +585,7 @@
|
|
|
619
585
|
--dt-instance-bg: #f0f4ff;
|
|
620
586
|
--dt-flash-bg: rgba(0,160,90,0.3);
|
|
621
587
|
}
|
|
622
|
-
`,document.head.appendChild(t)}catch{}}function
|
|
588
|
+
`,document.head.appendChild(t)}catch{}}function or(){try{document.getElementById(Dt)?.remove()}catch{}}function ir(){try{if(S)return;rr(),S=document.createElement("div"),S.id="mates-devtools",document.body.appendChild(S)}catch{}}function Ot(){try{if(!S)return;i.render(i.html``,S),S.remove(),S=null,or()}catch{}}function g(){try{if(!S||!I)return;const t=(()=>{try{switch(Z){case"components":return i.html`
|
|
623
589
|
<div class="${r.body}">
|
|
624
590
|
<div class="${r.leftColumn}">
|
|
625
591
|
<div class="${r.leftTabs}">
|
|
@@ -670,14 +636,14 @@
|
|
|
670
636
|
</svg>
|
|
671
637
|
</button>
|
|
672
638
|
</div>
|
|
673
|
-
${B==="list"?
|
|
639
|
+
${B==="list"?se({groups:F,selectedViewFn:w,onSelectGroup:Xn,onHighlight:e=>mt(e),renderCallback:g}):ue({selectedComponentId:$,onSelectComponent:Yn,onHighlight:e=>mt(e),renderCallback:g})}
|
|
674
640
|
</div>
|
|
675
|
-
${
|
|
641
|
+
${Tt(B==="list"?{selectedGroup:Ft(),selectedInstanceId:y,onSelectInstance:qn,onHighlight:e=>mt(e)}:{selectedComponent:Xe()})}
|
|
676
642
|
</div>
|
|
677
|
-
`;case"logs":return
|
|
643
|
+
`;case"logs":return Ae({onClear:g,renderCallback:g});case"performance":return Ge({onClear:g,renderCallback:g,onNavigateToComponent:Jn});default:return i.html``}}catch{}return i.html``})();i.render(i.html`
|
|
678
644
|
<div class="${r.panel}" style="height: ${D}px;">
|
|
679
|
-
<div class="${r.resizeHandle}" @mousedown=${
|
|
680
|
-
${
|
|
645
|
+
<div class="${r.resizeHandle}" @mousedown=${cr}></div>
|
|
646
|
+
${fe({activeTab:Z,onTabChange:Kn,onMinimise:Qn,onClose:tr,unreadLogCount:Z==="logs"?0:xe()})}
|
|
681
647
|
${t}
|
|
682
648
|
</div>
|
|
683
|
-
`,
|
|
649
|
+
`,S)}catch{}}function cr(t){try{t.preventDefault();const e=t.clientY,n=D,o=l=>{try{const a=window.innerHeight*jn;D=Math.max(Nn,Math.min(a,n+(e-l.clientY)));const u=rt();u&&(u.style.height=`${D}px`),Pt()}catch{}},c=()=>{try{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",c)}catch{}};document.addEventListener("mousemove",o),document.addEventListener("mouseup",c)}catch{}}function lr(){try{if(f)return;f=document.createElement("div"),f.id="mates-devtools-fab",f.className=r.fab,f.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>',f.style.bottom="50px",f.style.right="50px",f.addEventListener("mousedown",Ke),f.addEventListener("click",Je),document.body.appendChild(f)}catch{}}function ar(){try{if(!f)return;f.removeEventListener("mousedown",Ke),f.removeEventListener("click",Je),f.remove(),f=null}catch{}}function Je(){try{if(ht){ht=!1;return}C?Zn():er()}catch{}}function Ke(t){try{t.preventDefault(),Ht=!0,ht=!1;const e=f.getBoundingClientRect();Ue=t.clientX-e.left,Ye=t.clientY-e.top,f.classList.add(r.fabDragging),document.addEventListener("mousemove",Qe),document.addEventListener("mouseup",Ze)}catch{}}function Qe(t){try{if(!Ht||!f)return;ht=!0,f.style.bottom="auto",f.style.right="auto",f.style.left=`${Math.max(0,Math.min(window.innerWidth-48,t.clientX-Ue))}px`,f.style.top=`${Math.max(0,Math.min(window.innerHeight-48,t.clientY-Ye))}px`}catch{}}function Ze(){try{Ht=!1,f?.classList.remove(r.fabDragging),document.removeEventListener("mousemove",Qe),document.removeEventListener("mouseup",Ze)}catch{}}function sr(){try{xn(),lr(),nt||(nt=N.__subscribe(t=>{try{t?.type==="unmount"&&($!==null&&t.component.componentId===$&&($=null),y!==null&&t.component.componentId===y&&(y=null)),yt(),bt()&&g()}catch{}})),kt(()=>{try{bt()&&g()}catch{}})}catch{}}function tn(){try{$n(),kt(null),gt(),qe(),me(),zt(),nt&&(nt(),nt=null),I=!1,C=!1,B="list",$=null,w=null,y=null,F=[],Ot(),ar()}catch{}}const vt=[];let Vt=null,Nt=null,jt=null;function dr(){try{Vt=i.interceptBefore((t,e)=>{try{const n=(e.method??"GET").toUpperCase();vt.push({method:n,url:t,startTs:performance.now()})}catch{}return{url:t,options:e}}),Nt=i.interceptAfter(t=>{try{const e=vt.shift(),n=e?.method??"",o=e?.url??t.url??"",c=e?performance.now()-e.startTs:0;Be(n,o,t.status,c)}catch{}return t}),jt=i.interceptError(t=>{try{const e=vt.shift(),n=e?performance.now()-e.startTs:0;Le(e?.method??"",e?.url??"",t.message,n)}catch{}})}catch{}}function ur(){try{Vt?.(),Nt?.(),jt?.(),Vt=null,Nt=null,jt=null,vt.length=0}catch{}}function pr(){try{if(i.isDevToolsInstalled())return;i.installDevToolsHooks({registerComponent:Gt,unregisterComponent:Ut,notifyRender:Yt,getComponentName:A,logComponentMount:we,logComponentRender:Se,logComponentUnmount:ke,logAtomSet:Ce,logAtomUpdate:Te,logEventTrigger:Me,logCleanupEventTrigger:Ee,logFetchRequest:Ln,logFetchResponse:Be,logFetchError:Le,recordRender:Rt}),ge(),dr()}catch{}}let xt=!1;function fr(){try{if(xt)return;xt=!0,pr(),sr()}catch{}}function hr(){try{if(!xt)return;xt=!1,ur(),tn()}catch{}}s.clearLogs=_e,s.clearPerfData=Ne,s.connectLogStore=ge,s.connectPerfStore=Re,s.destroyDevTools=tn,s.destroyMatesDevTools=hr,s.devToolsEvent=N,s.disconnectLogStore=me,s.disconnectPerfStore=Pe,s.getAllComponents=St,s.getComponentDepth=E,s.getComponentGroups=Xt,s.getComponentName=A,s.getComponentsByView=cn,s.getLogCount=Bn,s.getLogs=ve,s.getPerfSummaries=De,s.getRecentTimings=Dn,s.getRenderVersion=j,s.getSlowestRenders=Ve,s.getUnreadLogCount=xe,s.isLogStoreConnected=Mn,s.isPerfStoreConnected=zn,s.logAtomSet=Ce,s.logAtomUpdate=Te,s.logCleanupEventTrigger=Ee,s.logComponentMount=we,s.logComponentRender=Se,s.logComponentUnmount=ke,s.logEventTrigger=Me,s.markLogsRead=$e,s.notifyRender=Yt,s.onLogEntry=he,s.onPerfEntry=He,s.recordRender=Rt,s.registerComponent=Gt,s.renderAtomsViewer=ne,s.renderComponentInspector=Tt,s.renderComponentList=se,s.renderComponentTree=ue,s.renderHeader=fe,s.renderHooksViewer=Ct,s.renderLogsViewer=Ae,s.renderMatesDevTools=fr,s.renderPerfViewer=Ge,s.renderPropsViewer=te,s.renderScopesViewer=ee,s.renderUseStateViewer=re,s.renderValueTree=T,s.renderValueTreeEntries=fn,s.setValueTreeRenderCallback=kt,s.startRenderTiming=Fn,s.styles=r,s.unregisterComponent=Ut,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})}));
|