uilint-react 0.2.42 → 0.2.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementInspector.d.ts","sourceRoot":"","sources":["../../../../src/components/ui-lint/inspector/ElementInspector.tsx"],"names":[],"mappings":"AASA,UAAU,qBAAqB;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"ElementInspector.d.ts","sourceRoot":"","sources":["../../../../src/components/ui-lint/inspector/ElementInspector.tsx"],"names":[],"mappings":"AASA,UAAU,qBAAqB;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,EAAE,qBAAqB,2CA4IpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highlights.d.ts","sourceRoot":"","sources":["../../src/consistency/highlights.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAiBzC,UAAU,2BAA2B;IACnC,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,iBAAiB,EAAE,SAAS,GAAG,IAAI,CAAC;IACpC,eAAe,EAAE,SAAS,GAAG,IAAI,CAAC;CACnC;
|
|
1
|
+
{"version":3,"file":"highlights.d.ts","sourceRoot":"","sources":["../../src/consistency/highlights.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAiBzC,UAAU,2BAA2B;IACnC,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,iBAAiB,EAAE,SAAS,GAAG,IAAI,CAAC;IACpC,eAAe,EAAE,SAAS,GAAG,IAAI,CAAC;CACnC;AA4KD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,UAAU,EACV,iBAAiB,EACjB,eAAe,GAChB,EAAE,2BAA2B,4BAoG7B"}
|
package/dist/devtools.js
CHANGED
|
@@ -255,7 +255,7 @@ You might need to use a local HTTP server (instead of file://): https://react.de
|
|
|
255
255
|
)`}}),D.jsxs("div",{"data-ui-lint":!0,style:{position:"fixed",top:p.top-(i?Jv:$v)/2,left:p.left+p.width-(i?Jv:$v)/2,width:i?Jv:$v,height:i?Jv:$v,backgroundColor:i?S:`${S}26`,border:`${i?rw:iw}px solid ${S}`,borderRadius:i?4:3,pointerEvents:"auto",cursor:"pointer",zIndex:99999,transition:"all 150ms ease-out",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:i?`0 2px 8px ${S}66`:`0 0 4px ${S}4D`},onMouseEnter:c,onMouseLeave:u,onClick:J=>{J.stopPropagation(),m()},title:U,children:[D.jsx("div",{style:{position:"absolute",width:i?10:6,height:i?rw:iw,backgroundColor:i?"white":S,borderRadius:1,transition:"all 150ms ease-out"}}),D.jsx("div",{style:{position:"absolute",width:i?rw:iw,height:i?10:6,backgroundColor:i?"white":S,borderRadius:1,transition:"all 150ms ease-out"}})]}),i&&D.jsx("div",{"data-ui-lint":!0,style:{position:"fixed",top:p.top-32,left:p.left+p.width/2,transform:"translateX(-50%)",backgroundColor:hg.bg,border:`1px solid ${hg.border}`,borderRadius:"6px",padding:"4px 8px",fontSize:"11px",fontWeight:600,color:hg.text,whiteSpace:"nowrap",boxShadow:hg.shadow,fontFamily:hg.font,zIndex:99999,pointerEvents:"none"},children:U})]})}const T6=Object.freeze(Object.defineProperty({__proto__:null,HeatmapOverlay:x6},Symbol.toStringTag,{value:"Module"})),A6=2e3;function C6(){const o=Ae(T=>T.duplicatesIndexStatus),i=Ae(T=>T.duplicatesIndexMessage),c=Ae(T=>T.duplicatesIndexProgress),u=Ae(T=>T.duplicatesIndexError),m=Ae(T=>T.duplicatesIndexStats),[p,y]=N.useState(!1),[x,S]=N.useState(!1);if(N.useEffect(()=>{if(o==="ready"&&m){S(!0);const T=setTimeout(()=>{S(!1)},A6);return()=>clearTimeout(T)}},[o,m]),N.useEffect(()=>{y(!0)},[]),!p)return null;const w=o==="indexing"||o==="error"||x;if(!w)return null;const A=D.jsx(JA,{children:w&&D.jsxs(JS.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},"data-ui-lint":!0,className:Ze("fixed bottom-4 left-4 z-[99998]","flex items-center gap-2 px-3 py-2 rounded-lg","bg-backdrop backdrop-blur-xl","border border-border","shadow-md","text-xs text-foreground","font-sans"),style:{fontFamily:'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[o==="indexing"&&D.jsxs(D.Fragment,{children:[D.jsx(it.Loader,{className:"w-3.5 h-3.5 animate-spin text-muted-foreground"}),D.jsx("span",{className:"text-muted-foreground",children:c?`Indexing ${c.current}/${c.total}`:i||"Indexing..."})]}),o==="error"&&D.jsxs(D.Fragment,{children:[D.jsx(it.AlertCircle,{className:"w-3.5 h-3.5 text-destructive"}),D.jsxs("span",{className:"text-destructive",children:["Index error: ",u||"Unknown error"]})]}),x&&o==="ready"&&m&&D.jsxs(D.Fragment,{children:[D.jsx(it.CheckCircle,{className:"w-3.5 h-3.5 text-success"}),D.jsxs("span",{className:"text-muted-foreground",children:["Index ready (",m.totalChunks," chunks)"]})]})]})});return af.createPortal(A,nh())}const R6=Object.freeze(Object.defineProperty({__proto__:null,IndexingIndicator:C6},Symbol.toStringTag,{value:"Module"}));function vR({content:o,className:i}){const c=N.useMemo(()=>D6(o),[o]);return D.jsx("div",{className:Ze("prose prose-sm dark:prose-invert max-w-none","text-foreground","[&_h1]:text-lg [&_h1]:font-bold [&_h1]:mt-4 [&_h1]:mb-2 [&_h1]:text-foreground","[&_h2]:text-base [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mb-2 [&_h2]:text-foreground","[&_h3]:text-sm [&_h3]:font-semibold [&_h3]:mt-2 [&_h3]:mb-1 [&_h3]:text-foreground","[&_p]:text-sm [&_p]:leading-relaxed [&_p]:my-2 [&_p]:text-text-secondary","[&_ul]:my-2 [&_ul]:pl-4 [&_ul]:list-disc [&_ul]:text-sm [&_ul]:text-text-secondary","[&_ol]:my-2 [&_ol]:pl-4 [&_ol]:list-decimal [&_ol]:text-sm [&_ol]:text-text-secondary","[&_li]:my-0.5","[&_code]:px-1.5 [&_code]:py-0.5 [&_code]:rounded [&_code]:bg-muted [&_code]:text-xs [&_code]:font-mono [&_code]:text-accent","[&_pre]:my-2 [&_pre]:p-3 [&_pre]:rounded-md [&_pre]:bg-muted [&_pre]:overflow-x-auto","[&_pre_code]:p-0 [&_pre_code]:bg-transparent","[&_a]:text-accent [&_a]:underline [&_a]:underline-offset-2 hover:[&_a]:text-accent/80","[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:my-2 [&_blockquote]:text-muted-foreground [&_blockquote]:italic","[&_strong]:font-semibold [&_strong]:text-foreground","[&_em]:italic","[&_hr]:my-4 [&_hr]:border-border",i),dangerouslySetInnerHTML:{__html:c},"data-ui-lint":!0})}function D6(o){if(!o)return"";let i=o;return i=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),i=i.replace(/```(\w*)\n?([\s\S]*?)```/g,(u,m,p)=>`<pre><code class="language-${m}">${p.trim()}</code></pre>`),i=i.replace(/`([^`\n]+)`/g,"<code>$1</code>"),i=i.replace(/^### (.+)$/gm,"<h3>$1</h3>"),i=i.replace(/^## (.+)$/gm,"<h2>$1</h2>"),i=i.replace(/^# (.+)$/gm,"<h1>$1</h1>"),i=i.replace(/^---+$/gm,"<hr>"),i=i.replace(/^\*\*\*+$/gm,"<hr>"),i=i.replace(/^> (.+)$/gm,"<blockquote>$1</blockquote>"),i=i.replace(/<\/blockquote>\n<blockquote>/g,`
|
|
256
256
|
`),i=i.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),i=i.replace(/__([^_]+)__/g,"<strong>$1</strong>"),i=i.replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)","g"),"<em>$1</em>"),i=i.replace(new RegExp("(?<!_)_([^_]+)_(?!_)","g"),"<em>$1</em>"),i=i.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),i=i.replace(/^[\-\*] (.+)$/gm,"<li>$1</li>"),i=i.replace(/(<li>.*<\/li>\n?)+/g,u=>`<ul>${u}</ul>`),i=i.replace(/^\d+\. (.+)$/gm,"<li>$1</li>"),i=i.split(/\n\n+/).map(u=>{const m=u.trim();return m?m.startsWith("<h")||m.startsWith("<pre")||m.startsWith("<ul")||m.startsWith("<ol")||m.startsWith("<blockquote")||m.startsWith("<hr")?m:`<p>${m.replace(/\n/g,"<br>")}</p>`:""}).join(`
|
|
257
257
|
`),i}function M6({value:o,onChange:i,disabled:c}){const u=[{value:"error",label:"Error",description:"Show as errors that must be fixed",activeClass:"bg-red-500/20 text-red-600 dark:text-red-400 border-red-500/30"},{value:"warn",label:"Warn",description:"Show as warnings for review",activeClass:"bg-amber-500/20 text-amber-600 dark:text-amber-400 border-amber-500/30"},{value:"off",label:"Off",description:"Disable this rule entirely",activeClass:"bg-zinc-500/20 text-zinc-600 dark:text-muted-foreground border-zinc-500/30"}],m=u.find(p=>p.value===o);return D.jsxs("div",{className:"space-y-2",children:[D.jsx("div",{className:"flex items-center gap-1 p-0.5 bg-white/30 dark:bg-white/10 rounded-md",children:u.map(p=>D.jsx("button",{type:"button",onClick:()=>{p.value!==o&&!c&&i(p.value)},disabled:c,className:Ze("px-3 py-1 rounded text-xs font-medium transition-all border",o===p.value?p.activeClass:"border-transparent text-muted-foreground hover:bg-hover",c&&"opacity-50 cursor-not-allowed"),"data-ui-lint":!0,children:p.label},p.value))}),m&&D.jsx("p",{className:"text-[10px] text-muted-foreground",children:m.description})]})}function _6({field:o,value:i,onChange:c,disabled:u}){const m=Ze("w-full px-3 py-1.5 text-sm rounded-md border","bg-white/50 dark:bg-white/5","border-border","focus:outline-none focus:ring-2 focus:ring-border focus:border-transparent",u&&"opacity-50 cursor-not-allowed");switch(o.type){case"text":return D.jsxs("div",{className:"space-y-1",children:[D.jsx("label",{className:"text-xs font-medium text-text-secondary",children:o.label}),o.description&&D.jsx("p",{className:"text-[10px] text-muted-foreground",children:o.description}),D.jsx("input",{type:"text",value:i??o.defaultValue??"",onChange:y=>c(y.target.value),placeholder:o.placeholder,disabled:u,className:m,"data-ui-lint":!0})]});case"number":return D.jsxs("div",{className:"space-y-1",children:[D.jsx("label",{className:"text-xs font-medium text-text-secondary",children:o.label}),o.description&&D.jsx("p",{className:"text-[10px] text-muted-foreground",children:o.description}),D.jsx("input",{type:"number",value:i??o.defaultValue??0,onChange:y=>c(Number(y.target.value)),disabled:u,className:m,"data-ui-lint":!0})]});case"boolean":return D.jsxs("div",{className:"flex items-center gap-3",children:[D.jsx("button",{type:"button",role:"switch","aria-checked":!!(i??o.defaultValue),onClick:()=>c(!i),disabled:u,className:Ze("relative inline-flex h-5 w-9 flex-shrink-0 items-center rounded-full transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border focus-visible:ring-offset-2",i?"bg-foreground":"bg-white/20 dark:bg-white/10",u&&"opacity-50 cursor-not-allowed"),"data-ui-lint":!0,children:D.jsx("span",{className:Ze("inline-block h-4 w-4 transform rounded-full bg-background shadow-sm transition-transform",i?"translate-x-[18px]":"translate-x-0.5")})}),D.jsxs("div",{children:[D.jsx("label",{className:"text-xs font-medium text-text-secondary",children:o.label}),o.description&&D.jsx("p",{className:"text-[10px] text-muted-foreground",children:o.description})]})]});case"select":return D.jsxs("div",{className:"space-y-1",children:[D.jsx("label",{className:"text-xs font-medium text-text-secondary",children:o.label}),o.description&&D.jsx("p",{className:"text-[10px] text-muted-foreground",children:o.description}),D.jsx("select",{value:i??o.defaultValue??"",onChange:y=>c(y.target.value),disabled:u,className:m,"data-ui-lint":!0,children:o.options?.map(y=>D.jsx("option",{value:y.value,children:y.label},String(y.value)))})]});case"array":const p=Array.isArray(i)?i:[];return D.jsxs("div",{className:"space-y-1",children:[D.jsx("label",{className:"text-xs font-medium text-text-secondary",children:o.label}),o.description&&D.jsx("p",{className:"text-[10px] text-muted-foreground",children:o.description}),D.jsx("input",{type:"text",value:p.join(", "),onChange:y=>{const x=y.target.value.split(",").map(S=>S.trim()).filter(Boolean);c(x)},placeholder:o.placeholder??"item1, item2, item3",disabled:u,className:m,"data-ui-lint":!0}),D.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Comma-separated values"})]});default:return null}}function bR({ruleId:o,onIssueClick:i}){const c=Ae(Q=>Q.availableRules),u=Ae(Q=>Q.ruleConfigs),m=Ae(Q=>Q.ruleConfigUpdating),p=Ae(Q=>Q.setRuleConfig),y=Ae(Q=>Q.eslintIssuesCache),x=Ae(Q=>Q.setInspectorIssue),S=N.useMemo(()=>c.find(Q=>Q.id===o||`uilint/${Q.id}`===o),[c,o]),w=u.get(S?.id??o),A=m.get(S?.id??o)??!1,T=w?.severity??S?.defaultSeverity??"error",C=w?.options??{},k=Q=>{if(!S)return;const ie=S.optionSchema&&Object.keys(C).length>0;p(S.id,Q,ie?C:void 0)},q=(Q,ie)=>{if(!S)return;const re={...C,[Q]:ie};p(S.id,T,re)},U=N.useMemo(()=>{const Q=[],ie=`uilint/${S?.id??o}`;for(const[re,Ce]of y.entries())for(const ae of Ce)ae.ruleId===ie&&Q.push({id:`${re}:${ae.line}:${ae.column}:${ae.ruleId}`,message:ae.message,filePath:re,line:ae.line,column:ae.column});return Q},[y,S?.id,o]),J=S?.optionSchema&&S.optionSchema.fields.length>0;return S?D.jsxs("div",{className:"flex flex-col h-full","data-ui-lint":!0,children:[D.jsxs("div",{className:"flex items-start gap-3 p-4 border-b border-border",children:[D.jsx("div",{className:Ze("w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",S.category==="semantic"?"bg-purple-100 dark:bg-purple-900/40":"bg-blue-100 dark:bg-blue-900/40"),children:D.jsx("span",{className:Ze("text-[10px] font-bold",S.category==="semantic"?"text-purple-700 dark:text-purple-300":"text-blue-700 dark:text-blue-300"),children:S.category==="semantic"?"AI":"STC"})}),D.jsxs("div",{className:"flex-1 min-w-0",children:[D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx("h2",{className:"text-base font-semibold text-foreground",children:S.name}),U.length>0&&D.jsx("span",{className:Ze("inline-flex items-center justify-center","min-w-[20px] h-5 px-1.5","text-[10px] font-semibold","rounded-full",T==="error"?"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300":"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300"),children:U.length})]}),D.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:S.description})]})]}),D.jsxs("div",{className:"flex-1 overflow-auto p-4 space-y-4",children:[D.jsxs("div",{children:[D.jsx("label",{className:"text-xs font-medium text-text-secondary mb-2 block",children:"Severity"}),D.jsx(M6,{value:T,onChange:k,disabled:A})]}),J&&D.jsxs("div",{className:"space-y-3",children:[D.jsx("label",{className:"text-xs font-medium text-text-secondary",children:"Options"}),S.optionSchema.fields.map(Q=>D.jsx(_6,{field:Q,value:C[Q.key],onChange:ie=>q(Q.key,ie),disabled:A},Q.key))]}),S.docs&&D.jsxs("div",{className:"pt-2 border-t border-border",children:[D.jsx("label",{className:"text-xs font-medium text-text-secondary mb-2 block",children:"Documentation"}),D.jsx(vR,{content:S.docs})]}),U.length>0&&D.jsxs("div",{children:[D.jsxs("label",{className:"text-xs font-medium text-text-secondary mb-2 block",children:["Issues (",U.length,")"]}),D.jsx("div",{className:"space-y-1",children:U.map(Q=>{const ie=Q.filePath.split("/").pop()||Q.filePath;return D.jsxs("button",{type:"button",onClick:()=>{const re={message:Q.message,line:Q.line,column:Q.column,ruleId:`uilint/${S.id}`,severity:T==="error"?2:1};x(re,void 0,Q.filePath)},className:Ze("w-full text-left p-2 rounded-md text-xs","bg-muted/50 hover:bg-muted","transition-colors"),"data-ui-lint":!0,children:[D.jsx("p",{className:"text-foreground line-clamp-1",children:Q.message}),D.jsxs("p",{className:"text-muted-foreground font-mono mt-0.5",children:[ie,":",Q.line]})]},Q.id)})})]})]}),D.jsx("div",{className:"px-4 py-2 border-t border-border bg-muted/50",children:D.jsxs("code",{className:"text-[10px] font-mono text-muted-foreground",children:["uilint/",S.id]})})]}):D.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-center",children:[D.jsx(it.AlertTriangle,{className:"w-6 h-6 text-muted-foreground mb-2"}),D.jsx("p",{className:"text-sm text-muted-foreground",children:"Rule not found"}),D.jsx("p",{className:"text-xs text-muted-foreground font-mono mt-1",children:o})]})}const xR=new Map,z6=300*1e3,O6="/api/.uilint/source";async function k6(o){const i=xR.get(o);if(i&&Date.now()-i.fetchedAt<z6)return{content:i.content,relativePath:i.relativePath};try{const c=await fetch(`${O6}?path=${encodeURIComponent(o)}`);if(!c.ok)return console.warn(`[UILint] Failed to fetch source: ${c.statusText}`),null;const u=await c.json();return xR.set(o,{...u,fetchedAt:Date.now()}),u}catch(c){return console.error("[UILint] Error fetching source:",c),null}}function sw({filePath:o,highlightLine:i,highlightColumn:c,className:u}){const[m,p]=N.useState([]),[y,x]=N.useState(!0),[S,w]=N.useState(null),[A,T]=N.useState(""),C=N.useRef(null),k=N.useRef(null);return N.useEffect(()=>{let q=!1;async function U(){x(!0),w(null);try{const J=await k6(o);if(q)return;J?(p(J.content.split(`
|
|
258
|
-
`)),T(J.relativePath)):(w("Unable to load source file"),p([]))}catch{q||(w("Error loading source file"),p([]))}finally{q||x(!1)}}return U(),()=>{q=!0}},[o]),N.useEffect(()=>{!y&&i&&k.current&&setTimeout(()=>{k.current?.scrollIntoView({behavior:"smooth",block:"center"})},100)},[y,i]),y?D.jsx("div",{className:Ze("flex items-center justify-center py-12",u),children:D.jsx(it.Spinner,{className:"w-5 h-5 text-muted-foreground animate-spin"})}):S?D.jsxs("div",{className:Ze("flex flex-col items-center justify-center py-12 text-center",u),children:[D.jsx(it.AlertTriangle,{className:"w-6 h-6 text-muted-foreground mb-2"}),D.jsx("p",{className:"text-sm text-muted-foreground",children:S}),D.jsx("p",{className:"text-xs text-muted-foreground mt-1 font-mono",children:o})]}):D.jsxs("div",{className:Ze("flex flex-col h-full",u),"data-ui-lint":!0,children:[D.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border bg-muted/50",children:[D.jsx(it.File,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),D.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate",children:A||o}),i&&D.jsxs("span",{className:"text-xs text-muted-foreground",children:[":",i]})]}),D.jsx("div",{ref:C,className:"flex-1 overflow-auto",children:D.jsx("pre",{className:"text-[11px] leading-5 font-mono min-w-fit",children:m.map((q,U)=>{const J=U+1,Q=J===i;return D.jsxs("div",{ref:Q?k:void 0,className:Ze("flex",Q?"bg-active":"hover:bg-hover"),children:[D.jsx("span",{className:Ze("w-12 shrink-0 text-right pr-3 select-none sticky left-0 bg-inherit",Q?"text-text-secondary font-medium bg-active":"text-muted-foreground"),children:J}),D.jsx("code",{className:Ze("flex-1 pr-4 whitespace-pre",Q?"text-foreground":"text-text-secondary"),children:q||" "})]},J)})})})]})}function SR({issue:o,elementId:i,filePath:c}){const u=Ae(S=>S.setInspectorRule),m=Ae(S=>S.availableRules),p=o.ruleId?.replace(/^uilint\//,"");N.useMemo(()=>m.find(S=>S.id===p),[m,p]);const y=c&&o.line?`cursor://file/${c}:${o.line}${o.column?`:${o.column}`:""}`:null,x=c?.split("/").pop()||c;return D.jsxs("div",{className:"flex flex-col h-full","data-ui-lint":!0,children:[D.jsxs("div",{className:"flex flex-col gap-3 p-4 border-b border-border",children:[D.jsxs("div",{className:"flex items-start gap-3",children:[D.jsx("div",{className:Ze("w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0","bg-amber-100 dark:bg-amber-900/40"),children:D.jsx(it.AlertTriangle,{className:"w-4 h-4 text-amber-600 dark:text-amber-400"})}),D.jsx("div",{className:"flex-1 min-w-0",children:D.jsx("p",{className:"text-sm font-medium text-foreground leading-snug",children:o.message})})]}),D.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[D.jsx(it.File,{className:"w-3.5 h-3.5 flex-shrink-0"}),D.jsx("span",{className:"truncate font-mono text-[11px]",children:x}),D.jsx("span",{className:"text-text-disabled",children:":"}),D.jsx("span",{className:"font-mono",children:o.line}),o.column&&D.jsxs(D.Fragment,{children:[D.jsx("span",{className:"text-text-disabled",children:":"}),D.jsx("span",{className:"font-mono",children:o.column})]})]}),D.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.ruleId&&D.jsxs("button",{type:"button",onClick:()=>u(p||o.ruleId),className:Ze("text-[11px] font-mono text-muted-foreground px-2 py-1 rounded","bg-muted hover:bg-hover transition-colors","flex items-center gap-1"),"data-ui-lint":!0,children:[D.jsx("span",{children:o.ruleId}),D.jsx(it.ChevronRight,{className:"w-3 h-3"})]}),y&&D.jsxs("a",{href:y,onClick:S=>S.stopPropagation(),className:Ze("inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-md","bg-accent text-accent-foreground","hover:bg-accent/90 transition-colors","text-xs font-medium"),children:[D.jsx(it.ExternalLink,{className:"w-3 h-3"}),"Open in Cursor"]})]})]}),D.jsx("div",{className:"flex-1 min-h-0",children:D.jsx(sw,{filePath:c,highlightLine:o.line,highlightColumn:o.column,className:"h-full"})})]})}function wR({elementId:o}){const i=Ae(
|
|
258
|
+
`)),T(J.relativePath)):(w("Unable to load source file"),p([]))}catch{q||(w("Error loading source file"),p([]))}finally{q||x(!1)}}return U(),()=>{q=!0}},[o]),N.useEffect(()=>{!y&&i&&k.current&&setTimeout(()=>{k.current?.scrollIntoView({behavior:"smooth",block:"center"})},100)},[y,i]),y?D.jsx("div",{className:Ze("flex items-center justify-center py-12",u),children:D.jsx(it.Spinner,{className:"w-5 h-5 text-muted-foreground animate-spin"})}):S?D.jsxs("div",{className:Ze("flex flex-col items-center justify-center py-12 text-center",u),children:[D.jsx(it.AlertTriangle,{className:"w-6 h-6 text-muted-foreground mb-2"}),D.jsx("p",{className:"text-sm text-muted-foreground",children:S}),D.jsx("p",{className:"text-xs text-muted-foreground mt-1 font-mono",children:o})]}):D.jsxs("div",{className:Ze("flex flex-col h-full",u),"data-ui-lint":!0,children:[D.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border bg-muted/50",children:[D.jsx(it.File,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),D.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate",children:A||o}),i&&D.jsxs("span",{className:"text-xs text-muted-foreground",children:[":",i]})]}),D.jsx("div",{ref:C,className:"flex-1 overflow-auto",children:D.jsx("pre",{className:"text-[11px] leading-5 font-mono min-w-fit",children:m.map((q,U)=>{const J=U+1,Q=J===i;return D.jsxs("div",{ref:Q?k:void 0,className:Ze("flex",Q?"bg-active":"hover:bg-hover"),children:[D.jsx("span",{className:Ze("w-12 shrink-0 text-right pr-3 select-none sticky left-0 bg-inherit",Q?"text-text-secondary font-medium bg-active":"text-muted-foreground"),children:J}),D.jsx("code",{className:Ze("flex-1 pr-4 whitespace-pre",Q?"text-foreground":"text-text-secondary"),children:q||" "})]},J)})})})]})}function SR({issue:o,elementId:i,filePath:c}){const u=Ae(S=>S.setInspectorRule),m=Ae(S=>S.availableRules),p=o.ruleId?.replace(/^uilint\//,"");N.useMemo(()=>m.find(S=>S.id===p),[m,p]);const y=c&&o.line?`cursor://file/${c}:${o.line}${o.column?`:${o.column}`:""}`:null,x=c?.split("/").pop()||c;return D.jsxs("div",{className:"flex flex-col h-full","data-ui-lint":!0,children:[D.jsxs("div",{className:"flex flex-col gap-3 p-4 border-b border-border",children:[D.jsxs("div",{className:"flex items-start gap-3",children:[D.jsx("div",{className:Ze("w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0","bg-amber-100 dark:bg-amber-900/40"),children:D.jsx(it.AlertTriangle,{className:"w-4 h-4 text-amber-600 dark:text-amber-400"})}),D.jsx("div",{className:"flex-1 min-w-0",children:D.jsx("p",{className:"text-sm font-medium text-foreground leading-snug",children:o.message})})]}),D.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[D.jsx(it.File,{className:"w-3.5 h-3.5 flex-shrink-0"}),D.jsx("span",{className:"truncate font-mono text-[11px]",children:x}),D.jsx("span",{className:"text-text-disabled",children:":"}),D.jsx("span",{className:"font-mono",children:o.line}),o.column&&D.jsxs(D.Fragment,{children:[D.jsx("span",{className:"text-text-disabled",children:":"}),D.jsx("span",{className:"font-mono",children:o.column})]})]}),D.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.ruleId&&D.jsxs("button",{type:"button",onClick:()=>u(p||o.ruleId),className:Ze("text-[11px] font-mono text-muted-foreground px-2 py-1 rounded","bg-muted hover:bg-hover transition-colors","flex items-center gap-1"),"data-ui-lint":!0,children:[D.jsx("span",{children:o.ruleId}),D.jsx(it.ChevronRight,{className:"w-3 h-3"})]}),y&&D.jsxs("a",{href:y,onClick:S=>S.stopPropagation(),className:Ze("inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-md","bg-accent text-accent-foreground","hover:bg-accent/90 transition-colors","text-xs font-medium"),children:[D.jsx(it.ExternalLink,{className:"w-3 h-3"}),"Open in Cursor"]})]})]}),D.jsx("div",{className:"flex-1 min-h-0",children:D.jsx(sw,{filePath:c,highlightLine:o.line,highlightColumn:o.column,className:"h-full"})})]})}function wR({elementId:o}){const i=Ae(U=>U.elementIssuesCache),c=Ae(U=>U.fileIssuesCache),u=Ae(U=>U.autoScanState),m=Ae(U=>U.setInspectorIssue),p=N.useMemo(()=>u.elements.find(U=>U.id===o),[u.elements,o]),y=p?eo(p.source):null,S=(y?i.get(y):null)?.issues??[],w=p?.source.fileName??"",A=w?(c.get(w)??[]).filter(U=>!U.line&&!U.column):[],T=[...S,...A],C=p?.source.lineNumber,k=p?.source.columnNumber,q=w.split("/").pop()||w;return p?D.jsxs("div",{className:"flex flex-col h-full","data-ui-lint":!0,children:[D.jsxs("div",{className:"flex flex-col gap-3 p-4 border-b border-border",children:[D.jsxs("div",{className:"flex items-start gap-3",children:[D.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0 bg-accent/10",children:D.jsx(it.Code,{className:"w-4 h-4 text-accent"})}),D.jsxs("div",{className:"flex-1 min-w-0",children:[D.jsx("p",{className:"text-sm font-medium text-foreground",children:"Element"}),D.jsx("p",{className:"text-xs text-muted-foreground font-mono truncate",children:p.tagName||"Unknown"})]}),T.length>0&&D.jsx("span",{className:Ze("inline-flex items-center justify-center","min-w-[20px] h-5 px-1.5","text-[10px] font-semibold","rounded-full","bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300"),children:T.length})]}),D.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[D.jsx(it.File,{className:"w-3.5 h-3.5 flex-shrink-0"}),D.jsx("span",{className:"truncate font-mono text-[11px]",children:q}),C&&D.jsxs(D.Fragment,{children:[D.jsx("span",{className:"text-text-disabled",children:":"}),D.jsx("span",{className:"font-mono",children:C})]}),k&&D.jsxs(D.Fragment,{children:[D.jsx("span",{className:"text-text-disabled",children:":"}),D.jsx("span",{className:"font-mono",children:k})]})]})]}),T.length>0&&D.jsxs("div",{className:"p-4 border-b border-border",children:[D.jsxs("label",{className:"text-xs font-medium text-text-secondary mb-2 block",children:["Issues (",T.length,")"]}),D.jsx("div",{className:"space-y-1",children:T.map((U,J)=>D.jsxs("button",{type:"button",onClick:()=>{m(U,o,w)},className:Ze("w-full text-left p-2 rounded-md text-xs","bg-muted/50 hover:bg-muted","transition-colors"),"data-ui-lint":!0,children:[D.jsx("p",{className:"text-foreground line-clamp-2",children:U.message}),D.jsx("p",{className:"text-muted-foreground font-mono mt-0.5",children:U.ruleId})]},`${U.ruleId}-${U.line}-${J}`))})]}),D.jsx("div",{className:"flex-1 min-h-0",children:D.jsx(sw,{filePath:w,highlightLine:C,highlightColumn:k,className:"h-full"})})]}):D.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-center",children:[D.jsx(it.AlertTriangle,{className:"w-6 h-6 text-muted-foreground mb-2"}),D.jsx("p",{className:"text-sm text-muted-foreground",children:"Element not found"}),D.jsx("p",{className:"text-xs text-muted-foreground font-mono mt-1 max-w-[200px] truncate",children:o})]})}function j6(){const[o,i]=N.useState(!1),c=Ae(w=>w.autoScanState),u=Ae(w=>w.elementIssuesCache),m=Ae(w=>w.fileIssuesCache),p=N.useMemo(()=>{const w=th(c.elements),A=new Map;for(const T of w){let C=0;for(const k of T.elements){const q=u.get(k.id);q&&(C+=q.issues.length)}C>0&&A.set(T.path,C)}for(const[T,C]of m){const k=A.get(T)||0;A.set(T,k+C.length)}return Array.from(A.entries()).map(([T,C])=>({path:T,count:C})).sort((T,C)=>C.count-T.count)},[c.elements,u,m]),y=N.useMemo(()=>p.length===0?"":`Please fix all lint warnings and errors in the following files and don't stop until the files are clean:
|
|
259
259
|
|
|
260
260
|
${p.map(A=>`- ${A.path}`).join(`
|
|
261
261
|
`)}`,[p]),x=N.useMemo(()=>p.reduce((w,A)=>w+A.count,0),[p]),S=N.useCallback(async()=>{if(y)try{await navigator.clipboard.writeText(y),i(!0),setTimeout(()=>i(!1),2e3)}catch(w){console.error("Failed to copy to clipboard:",w)}},[y]);return p.length===0?D.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center","data-ui-lint":!0,children:[D.jsx("div",{className:Ze("w-12 h-12 rounded-xl flex items-center justify-center mb-4","bg-green-100 dark:bg-green-900/40"),children:D.jsx(it.CheckCircle,{className:"w-6 h-6 text-green-600 dark:text-green-400"})}),D.jsx("h3",{className:"text-sm font-medium text-foreground mb-1",children:"No issues found"}),D.jsx("p",{className:"text-xs text-muted-foreground",children:"All visible files are clean"})]}):D.jsxs("div",{className:"flex flex-col h-full","data-ui-lint":!0,children:[D.jsxs("div",{className:"flex flex-col gap-3 p-4 border-b border-border",children:[D.jsxs("div",{className:"flex items-start gap-3",children:[D.jsx("div",{className:Ze("w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0","bg-violet-100 dark:bg-violet-900/40"),children:D.jsx(it.Wand,{className:"w-4 h-4 text-violet-600 dark:text-violet-400"})}),D.jsxs("div",{className:"flex-1 min-w-0",children:[D.jsx("p",{className:"text-sm font-medium text-foreground leading-snug",children:"Fix Prompt"}),D.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[p.length," ",p.length===1?"file":"files"," with ",x," ",x===1?"issue":"issues"]})]})]}),D.jsx("button",{type:"button",onClick:S,className:Ze("inline-flex items-center justify-center gap-2 px-3 py-2 rounded-md","bg-accent text-accent-foreground","hover:bg-accent/90 transition-colors","text-sm font-medium w-full"),"data-ui-lint":!0,children:o?D.jsxs(D.Fragment,{children:[D.jsx(it.Check,{className:"w-4 h-4"}),"Copied!"]}):D.jsxs(D.Fragment,{children:[D.jsx(it.Copy,{className:"w-4 h-4"}),"Copy Prompt"]})})]}),D.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-4",children:D.jsx("div",{className:Ze("rounded-lg p-3","bg-muted/50 border border-border","font-mono text-xs text-foreground","whitespace-pre-wrap"),children:y})}),D.jsxs("div",{className:"border-t border-border p-4",children:[D.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Files with issues"}),D.jsx("div",{className:"space-y-1 max-h-32 overflow-auto",children:p.map(w=>D.jsxs("div",{className:"flex items-center justify-between text-xs",children:[D.jsx("span",{className:"truncate font-mono text-foreground",children:w.path.split("/").pop()}),D.jsxs("span",{className:"text-muted-foreground flex-shrink-0 ml-2",children:[w.count," ",w.count===1?"issue":"issues"]})]},w.path))})]})]})}function cw({direction:o,onResize:i,onResizeEnd:c,className:u}){const m=N.useRef(!1),p=N.useRef({x:0,y:0}),y=N.useCallback(S=>{S.preventDefault(),S.stopPropagation(),m.current=!0,p.current={x:S.clientX,y:S.clientY}},[]);N.useEffect(()=>{const S=A=>{if(!m.current)return;const T=A.clientX-p.current.x,C=A.clientY-p.current.y;p.current={x:A.clientX,y:A.clientY},i(T,C)},w=()=>{m.current&&(m.current=!1,c?.())};return document.addEventListener("mousemove",S),document.addEventListener("mouseup",w),()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",w)}},[i,c]);const x=o==="horizontal"?"cursor-col-resize":o==="vertical"?"cursor-row-resize":"cursor-nwse-resize";return D.jsx("div",{"data-ui-lint":!0,onMouseDown:y,className:Ze("absolute z-10",x,o==="horizontal"&&"top-0 left-0 w-1 h-full hover:bg-accent/30",o==="vertical"&&"bottom-0 left-0 w-full h-1 hover:bg-accent/30",o==="corner"&&"bottom-0 right-0 w-3 h-3 hover:bg-accent/30",u)})}const ER=320,TR=800,Kv=450,AR=500;function N6(){const o=Ae(B=>B.inspectorOpen),i=Ae(B=>B.inspectorMode),c=Ae(B=>B.inspectorRuleId),u=Ae(B=>B.inspectorIssue),m=Ae(B=>B.inspectorElementId),p=Ae(B=>B.inspectorDocked),y=Ae(B=>B.inspectorWidth),x=Ae(B=>B.inspectorFloatingPosition),S=Ae(B=>B.inspectorFloatingSize),w=Ae(B=>B.closeInspector),A=Ae(B=>B.toggleInspectorDocked),T=Ae(B=>B.setInspectorWidth),C=Ae(B=>B.setInspectorFloatingPosition),k=Ae(B=>B.setInspectorFloatingSize),[q,U]=N.useState(!1),J=N.useRef(null),Q=N.useRef(null);N.useEffect(()=>{U(!0)},[]),N.useEffect(()=>{if(!q)return;const B=document.documentElement;return o&&p?(B.style.marginRight=`${y}px`,B.style.transition="margin-right 0.2s ease-out"):(B.style.marginRight="",B.style.transition="margin-right 0.2s ease-out"),()=>{B.style.marginRight="",B.style.transition=""}},[q,o,p,y]);const ie=N.useCallback(B=>{const we=Math.min(TR,Math.max(ER,y-B));T(we)},[y,T]),re=N.useCallback((B,we)=>{const he=S??{width:Kv,height:AR},Be=Math.min(TR,Math.max(ER,he.width+B)),Re=Math.max(300,he.height+we);k({width:Be,height:Re})},[S,k]),Ce=N.useCallback(B=>{x&&(B.preventDefault(),Q.current={startX:B.clientX,startY:B.clientY,startPos:x})},[x]);if(N.useEffect(()=>{const B=he=>{if(!Q.current)return;const Be=he.clientX-Q.current.startX,Re=he.clientY-Q.current.startY;C({x:Q.current.startPos.x+Be,y:Q.current.startPos.y+Re})},we=()=>{Q.current=null};return document.addEventListener("mousemove",B),document.addEventListener("mouseup",we),()=>{document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",we)}},[C]),N.useEffect(()=>{!p&&!x&&q&&C({x:window.innerWidth-Kv-20,y:80})},[p,x,C,q]),!q||!o)return null;const ae=nh();if(!ae)return null;const Ee=i==="rule"?"Rule Details":i==="issue"?"Issue Details":i==="element"?"Element Issues":i==="fixes"?"Fix Issues":"Inspector",fe=D.jsxs(D.Fragment,{children:[i==="rule"&&c&&D.jsx(bR,{ruleId:c}),i==="issue"&&u&&D.jsx(SR,{issue:u.issue,elementId:u.elementId,filePath:u.filePath}),i==="element"&&m&&D.jsx(wR,{elementId:m}),i==="fixes"&&D.jsx(j6,{})]});if(!p){const B=x??{x:window.innerWidth-Kv-20,y:80},we=S??{width:Kv,height:AR};return af.createPortal(D.jsxs("div",{ref:J,"data-ui-lint":!0,className:Ze("fixed z-[99999]","flex flex-col","bg-surface border border-border rounded-lg shadow-lg","overflow-hidden"),style:{left:B.x,top:B.y,width:we.width,height:we.height},children:[D.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border bg-muted/50 cursor-move",onMouseDown:Ce,children:[D.jsx("h3",{className:"text-sm font-medium text-foreground",children:Ee}),D.jsxs("div",{className:"flex items-center gap-1",children:[D.jsx("button",{type:"button",onClick:A,className:"p-1 rounded hover:bg-hover transition-colors",title:"Dock to side","data-ui-lint":!0,children:D.jsx(it.PanelRight,{className:"w-4 h-4 text-muted-foreground"})}),D.jsx("button",{type:"button",onClick:w,className:"p-1 rounded hover:bg-hover transition-colors",title:"Close","data-ui-lint":!0,children:D.jsx(it.X,{className:"w-4 h-4 text-muted-foreground"})})]})]}),D.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:fe}),D.jsx(cw,{direction:"corner",onResize:re,className:"absolute bottom-0 right-0 w-4 h-4 cursor-nwse-resize"})]}),ae)}return af.createPortal(D.jsxs("div",{ref:J,"data-ui-lint":!0,className:Ze("fixed top-0 right-0 h-full z-[99999]","flex flex-col","bg-surface border-l border-border shadow-lg"),style:{width:y},children:[D.jsx(cw,{direction:"horizontal",onResize:B=>ie(B)}),D.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border bg-muted/50",children:[D.jsx("h3",{className:"text-sm font-medium text-foreground",children:Ee}),D.jsxs("div",{className:"flex items-center gap-1",children:[D.jsx("button",{type:"button",onClick:A,className:"p-1 rounded hover:bg-hover transition-colors",title:"Undock","data-ui-lint":!0,children:D.jsx(it.Maximize2,{className:"w-4 h-4 text-muted-foreground"})}),D.jsx("button",{type:"button",onClick:w,className:"p-1 rounded hover:bg-hover transition-colors",title:"Close","data-ui-lint":!0,children:D.jsx(it.X,{className:"w-4 h-4 text-muted-foreground"})})]})]}),D.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:fe})]}),ae)}const U6=Object.freeze(Object.defineProperty({__proto__:null,ElementInspector:wR,FullFileViewer:sw,InspectorSidebar:N6,IssueInspector:SR,MarkdownRenderer:vR,ResizeHandle:cw,RuleInspector:bR},Symbol.toStringTag,{value:"Module"}));function L6(o,i){if(o.match(/^[a-z]+:\/\//i))return o;if(o.match(/^\/\//))return window.location.protocol+o;if(o.match(/^[a-z]+:/i))return o;const c=document.implementation.createHTMLDocument(),u=c.createElement("base"),m=c.createElement("a");return c.head.appendChild(u),c.body.appendChild(m),i&&(u.href=i),m.href=o,m.href}const H6=(()=>{let o=0;const i=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(o+=1,`u${i()}${o}`)})();function wc(o){const i=[];for(let c=0,u=o.length;c<u;c++)i.push(o[c]);return i}let bh=null;function CR(o={}){return bh||(o.includeStyleProperties?(bh=o.includeStyleProperties,bh):(bh=wc(window.getComputedStyle(document.documentElement)),bh))}function Pv(o,i){const u=(o.ownerDocument.defaultView||window).getComputedStyle(o).getPropertyValue(i);return u?parseFloat(u.replace("px","")):0}function B6(o){const i=Pv(o,"border-left-width"),c=Pv(o,"border-right-width");return o.clientWidth+i+c}function V6(o){const i=Pv(o,"border-top-width"),c=Pv(o,"border-bottom-width");return o.clientHeight+i+c}function uw(o,i={}){const c=i.width||B6(o),u=i.height||V6(o);return{width:c,height:u}}function Y6(){let o,i;try{i=process}catch{}const c=i&&i.env?i.env.devicePixelRatio:null;return c&&(o=parseInt(c,10),Number.isNaN(o)&&(o=1)),o||window.devicePixelRatio||1}const to=16384;function q6(o){(o.width>to||o.height>to)&&(o.width>to&&o.height>to?o.width>o.height?(o.height*=to/o.width,o.width=to):(o.width*=to/o.height,o.height=to):o.width>to?(o.height*=to/o.width,o.width=to):(o.width*=to/o.height,o.height=to))}function G6(o,i={}){return o.toBlob?new Promise(c=>{o.toBlob(c,i.type?i.type:"image/png",i.quality?i.quality:1)}):new Promise(c=>{const u=window.atob(o.toDataURL(i.type?i.type:void 0,i.quality?i.quality:void 0).split(",")[1]),m=u.length,p=new Uint8Array(m);for(let y=0;y<m;y+=1)p[y]=u.charCodeAt(y);c(new Blob([p],{type:i.type?i.type:"image/png"}))})}function Fv(o){return new Promise((i,c)=>{const u=new Image;u.onload=()=>{u.decode().then(()=>{requestAnimationFrame(()=>i(u))})},u.onerror=c,u.crossOrigin="anonymous",u.decoding="async",u.src=o})}async function X6(o){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(o)).then(encodeURIComponent).then(i=>`data:image/svg+xml;charset=utf-8,${i}`)}async function Q6(o,i,c){const u="http://www.w3.org/2000/svg",m=document.createElementNS(u,"svg"),p=document.createElementNS(u,"foreignObject");return m.setAttribute("width",`${i}`),m.setAttribute("height",`${c}`),m.setAttribute("viewBox",`0 0 ${i} ${c}`),p.setAttribute("width","100%"),p.setAttribute("height","100%"),p.setAttribute("x","0"),p.setAttribute("y","0"),p.setAttribute("externalResourcesRequired","true"),m.appendChild(p),p.appendChild(o),X6(m)}const Nl=(o,i)=>{if(o instanceof i)return!0;const c=Object.getPrototypeOf(o);return c===null?!1:c.constructor.name===i.name||Nl(c,i)};function Z6(o){const i=o.getPropertyValue("content");return`${o.cssText} content: '${i.replace(/'|"/g,"")}';`}function I6(o,i){return CR(i).map(c=>{const u=o.getPropertyValue(c),m=o.getPropertyPriority(c);return`${c}: ${u}${m?" !important":""};`}).join(" ")}function $6(o,i,c,u){const m=`.${o}:${i}`,p=c.cssText?Z6(c):I6(c,u);return document.createTextNode(`${m}{${p}}`)}function RR(o,i,c,u){const m=window.getComputedStyle(o,c),p=m.getPropertyValue("content");if(p===""||p==="none")return;const y=H6();try{i.className=`${i.className} ${y}`}catch{return}const x=document.createElement("style");x.appendChild($6(y,c,m,u)),i.appendChild(x)}function J6(o,i,c){RR(o,i,":before",c),RR(o,i,":after",c)}const DR="application/font-woff",MR="image/jpeg",K6={woff:DR,woff2:DR,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:MR,jpeg:MR,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function P6(o){const i=/\.([^./]*?)$/g.exec(o);return i?i[1]:""}function fw(o){const i=P6(o).toLowerCase();return K6[i]||""}function F6(o){return o.split(/,/)[1]}function dw(o){return o.search(/^(data:)/)!==-1}function W6(o,i){return`data:${i};base64,${o}`}async function _R(o,i,c){const u=await fetch(o,i);if(u.status===404)throw new Error(`Resource "${u.url}" not found`);const m=await u.blob();return new Promise((p,y)=>{const x=new FileReader;x.onerror=y,x.onloadend=()=>{try{p(c({res:u,result:x.result}))}catch(S){y(S)}},x.readAsDataURL(m)})}const hw={};function ej(o,i,c){let u=o.replace(/\?.*/,"");return c&&(u=o),/ttf|otf|eot|woff2?/i.test(u)&&(u=u.replace(/.*\//,"")),i?`[${i}]${u}`:u}async function mw(o,i,c){const u=ej(o,i,c.includeQueryParams);if(hw[u]!=null)return hw[u];c.cacheBust&&(o+=(/\?/.test(o)?"&":"?")+new Date().getTime());let m;try{const p=await _R(o,c.fetchRequestInit,({res:y,result:x})=>(i||(i=y.headers.get("Content-Type")||""),F6(x)));m=W6(p,i)}catch(p){m=c.imagePlaceholder||"";let y=`Failed to fetch resource: ${o}`;p&&(y=typeof p=="string"?p:p.message),y&&console.warn(y)}return hw[u]=m,m}async function tj(o){const i=o.toDataURL();return i==="data:,"?o.cloneNode(!1):Fv(i)}async function nj(o,i){if(o.currentSrc){const p=document.createElement("canvas"),y=p.getContext("2d");p.width=o.clientWidth,p.height=o.clientHeight,y?.drawImage(o,0,0,p.width,p.height);const x=p.toDataURL();return Fv(x)}const c=o.poster,u=fw(c),m=await mw(c,u,i);return Fv(m)}async function aj(o,i){var c;try{if(!((c=o?.contentDocument)===null||c===void 0)&&c.body)return await Wv(o.contentDocument.body,i,!0)}catch{}return o.cloneNode(!1)}async function lj(o,i){return Nl(o,HTMLCanvasElement)?tj(o):Nl(o,HTMLVideoElement)?nj(o,i):Nl(o,HTMLIFrameElement)?aj(o,i):o.cloneNode(zR(o))}const oj=o=>o.tagName!=null&&o.tagName.toUpperCase()==="SLOT",zR=o=>o.tagName!=null&&o.tagName.toUpperCase()==="SVG";async function ij(o,i,c){var u,m;if(zR(i))return i;let p=[];return oj(o)&&o.assignedNodes?p=wc(o.assignedNodes()):Nl(o,HTMLIFrameElement)&&(!((u=o.contentDocument)===null||u===void 0)&&u.body)?p=wc(o.contentDocument.body.childNodes):p=wc(((m=o.shadowRoot)!==null&&m!==void 0?m:o).childNodes),p.length===0||Nl(o,HTMLVideoElement)||await p.reduce((y,x)=>y.then(()=>Wv(x,c)).then(S=>{S&&i.appendChild(S)}),Promise.resolve()),i}function rj(o,i,c){const u=i.style;if(!u)return;const m=window.getComputedStyle(o);m.cssText?(u.cssText=m.cssText,u.transformOrigin=m.transformOrigin):CR(c).forEach(p=>{let y=m.getPropertyValue(p);p==="font-size"&&y.endsWith("px")&&(y=`${Math.floor(parseFloat(y.substring(0,y.length-2)))-.1}px`),Nl(o,HTMLIFrameElement)&&p==="display"&&y==="inline"&&(y="block"),p==="d"&&i.getAttribute("d")&&(y=`path(${i.getAttribute("d")})`),u.setProperty(p,y,m.getPropertyPriority(p))})}function sj(o,i){Nl(o,HTMLTextAreaElement)&&(i.innerHTML=o.value),Nl(o,HTMLInputElement)&&i.setAttribute("value",o.value)}function cj(o,i){if(Nl(o,HTMLSelectElement)){const u=Array.from(i.children).find(m=>o.value===m.getAttribute("value"));u&&u.setAttribute("selected","")}}function uj(o,i,c){return Nl(i,Element)&&(rj(o,i,c),J6(o,i,c),sj(o,i),cj(o,i)),i}async function fj(o,i){const c=o.querySelectorAll?o.querySelectorAll("use"):[];if(c.length===0)return o;const u={};for(let p=0;p<c.length;p++){const x=c[p].getAttribute("xlink:href");if(x){const S=o.querySelector(x),w=document.querySelector(x);!S&&w&&!u[x]&&(u[x]=await Wv(w,i,!0))}}const m=Object.values(u);if(m.length){const p="http://www.w3.org/1999/xhtml",y=document.createElementNS(p,"svg");y.setAttribute("xmlns",p),y.style.position="absolute",y.style.width="0",y.style.height="0",y.style.overflow="hidden",y.style.display="none";const x=document.createElementNS(p,"defs");y.appendChild(x);for(let S=0;S<m.length;S++)x.appendChild(m[S]);o.appendChild(y)}return o}async function Wv(o,i,c){return!c&&i.filter&&!i.filter(o)?null:Promise.resolve(o).then(u=>lj(u,i)).then(u=>ij(o,u,i)).then(u=>uj(o,u,i)).then(u=>fj(u,i))}const OR=/url\((['"]?)([^'"]+?)\1\)/g,dj=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,hj=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function mj(o){const i=o.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${i})(['"]?\\))`,"g")}function pj(o){const i=[];return o.replace(OR,(c,u,m)=>(i.push(m),c)),i.filter(c=>!dw(c))}async function gj(o,i,c,u,m){try{const p=c?L6(i,c):i,y=fw(i);let x;return m||(x=await mw(p,y,u)),o.replace(mj(i),`$1${x}$3`)}catch{}return o}function yj(o,{preferredFontFormat:i}){return i?o.replace(hj,c=>{for(;;){const[u,,m]=dj.exec(c)||[];if(!m)return"";if(m===i)return`src: ${u};`}}):o}function kR(o){return o.search(OR)!==-1}async function jR(o,i,c){if(!kR(o))return o;const u=yj(o,c);return pj(u).reduce((p,y)=>p.then(x=>gj(x,y,i,c)),Promise.resolve(u))}async function xh(o,i,c){var u;const m=(u=i.style)===null||u===void 0?void 0:u.getPropertyValue(o);if(m){const p=await jR(m,null,c);return i.style.setProperty(o,p,i.style.getPropertyPriority(o)),!0}return!1}async function vj(o,i){await xh("background",o,i)||await xh("background-image",o,i),await xh("mask",o,i)||await xh("-webkit-mask",o,i)||await xh("mask-image",o,i)||await xh("-webkit-mask-image",o,i)}async function bj(o,i){const c=Nl(o,HTMLImageElement);if(!(c&&!dw(o.src))&&!(Nl(o,SVGImageElement)&&!dw(o.href.baseVal)))return;const u=c?o.src:o.href.baseVal,m=await mw(u,fw(u),i);await new Promise((p,y)=>{o.onload=p,o.onerror=i.onImageErrorHandler?(...S)=>{try{p(i.onImageErrorHandler(...S))}catch(w){y(w)}}:y;const x=o;x.decode&&(x.decode=p),x.loading==="lazy"&&(x.loading="eager"),c?(o.srcset="",o.src=m):o.href.baseVal=m})}async function xj(o,i){const u=wc(o.childNodes).map(m=>NR(m,i));await Promise.all(u).then(()=>o)}async function NR(o,i){Nl(o,Element)&&(await vj(o,i),await bj(o,i),await xj(o,i))}function Sj(o,i){const{style:c}=o;i.backgroundColor&&(c.backgroundColor=i.backgroundColor),i.width&&(c.width=`${i.width}px`),i.height&&(c.height=`${i.height}px`);const u=i.style;return u!=null&&Object.keys(u).forEach(m=>{c[m]=u[m]}),o}const UR={};async function LR(o){let i=UR[o];if(i!=null)return i;const u=await(await fetch(o)).text();return i={url:o,cssText:u},UR[o]=i,i}async function HR(o,i){let c=o.cssText;const u=/url\(["']?([^"')]+)["']?\)/g,p=(c.match(/url\([^)]+\)/g)||[]).map(async y=>{let x=y.replace(u,"$1");return x.startsWith("https://")||(x=new URL(x,o.url).href),_R(x,i.fetchRequestInit,({result:S})=>(c=c.replace(y,`url(${S})`),[y,S]))});return Promise.all(p).then(()=>c)}function BR(o){if(o==null)return[];const i=[],c=/(\/\*[\s\S]*?\*\/)/gi;let u=o.replace(c,"");const m=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const S=m.exec(u);if(S===null)break;i.push(S[0])}u=u.replace(m,"");const p=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,y="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",x=new RegExp(y,"gi");for(;;){let S=p.exec(u);if(S===null){if(S=x.exec(u),S===null)break;p.lastIndex=x.lastIndex}else x.lastIndex=p.lastIndex;i.push(S[0])}return i}async function wj(o,i){const c=[],u=[];return o.forEach(m=>{if("cssRules"in m)try{wc(m.cssRules||[]).forEach((p,y)=>{if(p.type===CSSRule.IMPORT_RULE){let x=y+1;const S=p.href,w=LR(S).then(A=>HR(A,i)).then(A=>BR(A).forEach(T=>{try{m.insertRule(T,T.startsWith("@import")?x+=1:m.cssRules.length)}catch(C){console.error("Error inserting rule from remote css",{rule:T,error:C})}})).catch(A=>{console.error("Error loading remote css",A.toString())});u.push(w)}})}catch(p){const y=o.find(x=>x.href==null)||document.styleSheets[0];m.href!=null&&u.push(LR(m.href).then(x=>HR(x,i)).then(x=>BR(x).forEach(S=>{y.insertRule(S,y.cssRules.length)})).catch(x=>{console.error("Error loading remote stylesheet",x)})),console.error("Error inlining remote css file",p)}}),Promise.all(u).then(()=>(o.forEach(m=>{if("cssRules"in m)try{wc(m.cssRules||[]).forEach(p=>{c.push(p)})}catch(p){console.error(`Error while reading CSS rules from ${m.href}`,p)}}),c))}function Ej(o){return o.filter(i=>i.type===CSSRule.FONT_FACE_RULE).filter(i=>kR(i.style.getPropertyValue("src")))}async function Tj(o,i){if(o.ownerDocument==null)throw new Error("Provided element is not within a Document");const c=wc(o.ownerDocument.styleSheets),u=await wj(c,i);return Ej(u)}function VR(o){return o.trim().replace(/["']/g,"")}function Aj(o){const i=new Set;function c(u){(u.style.fontFamily||getComputedStyle(u).fontFamily).split(",").forEach(p=>{i.add(VR(p))}),Array.from(u.children).forEach(p=>{p instanceof HTMLElement&&c(p)})}return c(o),i}async function YR(o,i){const c=await Tj(o,i),u=Aj(o);return(await Promise.all(c.filter(p=>u.has(VR(p.style.fontFamily))).map(p=>{const y=p.parentStyleSheet?p.parentStyleSheet.href:null;return jR(p.cssText,y,i)}))).join(`
|