@mcpc-tech/unplugin-dev-inspector-mcp 0.0.30 → 0.0.33

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.
package/README.md CHANGED
@@ -33,7 +33,6 @@ Works with any MCP-compatible AI client. Supports ACP agents: **Claude Code**, *
33
33
 
34
34
  🐦 **Twittter/X Post:** [https://x.com/yaoandyan/status/1995082020431753600](https://x.com/yaoandyan/status/1995082020431753600?s=20)
35
35
 
36
-
37
36
  ![Demo: MCP-powered visual debugging in action](https://media.giphy.com/media/sGCk7b783GiGm5vZGl/giphy.gif)
38
37
 
39
38
  ## Key Features
@@ -393,6 +392,44 @@ Executes JavaScript in browser context. Access to window, document, React/Vue in
393
392
 
394
393
  Agentic tool for Chrome DevTools access. Provides network inspection, console logs, performance metrics, element interaction, and more.
395
394
 
395
+ ## Custom Inspector Tools
396
+
397
+ You can register your own custom tools to be used by the AI agent. These tools run directly in the browser context, giving the AI access to your application's state, logic, or any browser APIs.
398
+
399
+ ### `registerInspectorTool`
400
+
401
+ Use this function to register a tool. It handles the MCP schema definition and implementation in one place.
402
+
403
+ ```typescript
404
+ // main.ts or any entry file
405
+ import { registerInspectorTool } from 'virtual:dev-inspector-mcp';
406
+
407
+ registerInspectorTool({
408
+ name: "get_user_state",
409
+ description: "Get current user session and preferences",
410
+ inputSchema: {
411
+ type: "object",
412
+ properties: {
413
+ includeToken: {
414
+ type: "boolean",
415
+ description: "Whether to include the auth token"
416
+ }
417
+ }
418
+ },
419
+ implementation: (args) => {
420
+ // This runs in the browser!
421
+ const user = window.useUserStore?.getState();
422
+
423
+ if (args.includeToken) {
424
+ return { user, token: localStorage.getItem('token') };
425
+ }
426
+ return { user };
427
+ }
428
+ });
429
+ ```
430
+
431
+ These custom tools are automatically discovered and made available to the connected AI agent along with the built-in inspector tools.
432
+
396
433
  ## MCP Prompts
397
434
 
398
435
  ### `capture_element`
@@ -213,7 +213,7 @@ ${t}
213
213
  3. Update status with 'update_inspection_status':
214
214
  - "in-progress" with progress details while investigating
215
215
  - "completed" with findings when done
216
- - "failed" if unresolvable`)}function bte(e){let{code:t}=e;if(!t||typeof t!=`string`)return gd(`Error: Missing or invalid "code" parameter. Please provide JavaScript code to execute.`);try{let e=Function(t)(),n;if(e===void 0)n=`(undefined)`;else if(e===null)n=`(null)`;else if(typeof e==`object`)try{n=JSON.stringify(e,null,2)}catch{n=`[Object: ${Object.prototype.toString.call(e)}]`}else n=String(e);return gd(`${n}`)}catch(e){let t=e instanceof Error?e.message:String(e),n=e instanceof Error?e.stack:``;return gd(`## Error\n\`\`\`\n${t}\n\`\`\`\n\n${n?`## Stack Trace\n\`\`\`\n${n}\n\`\`\`\n`:``}\n## Suggestions\n- Check syntax errors\n- Verify element selectors exist\n- Ensure code returns a value\n- Check browser console for additional errors`)}}function xte(e){let{inspectionId:t,status:n,progress:r,message:i}=e,a=t||sessionStorage.getItem(ud)||``;if(!a)try{let e=localStorage.getItem(ld),t=(e?JSON.parse(e):[]).find(e=>e.status===`in-progress`);if(t)a=t.id,sessionStorage.setItem(ud,a);else return gd(`Error: No active inspection item found. Please use 'list_inspections' to see the queue, then provide the inspectionId parameter.`)}catch{return gd(`Error: No active inspection item`)}if(n===`deleted`)try{let e=localStorage.getItem(ld),t=(e?JSON.parse(e):[]).filter(e=>e.id!==a);return localStorage.setItem(ld,JSON.stringify(t)),sessionStorage.removeItem(ud),window.dispatchEvent(new CustomEvent(`inspection-deleted`,{detail:{inspectionId:a}})),gd(`Inspection ${a} deleted successfully.`)}catch{return gd(`Error: Failed to delete inspection`)}if(r&&window.dispatchEvent(new CustomEvent(`plan-progress-reported`,{detail:{plan:{steps:r.steps},inspectionId:a,timestamp:new Date().toISOString()}})),n===`completed`||n===`failed`){sessionStorage.removeItem(ud);let e=i||(n===`completed`?`Task completed`:`Task failed`);return window.dispatchEvent(new CustomEvent(`inspection-result-received`,{detail:{status:n,result:{message:e},inspectionId:a}})),gd(`Inspection marked as ${n}.`)}else n===`in-progress`&&i&&!r&&window.dispatchEvent(new CustomEvent(`inspection-status-updated`,{detail:{status:`in-progress`,message:i,inspectionId:a}}));return gd(`Status updated`)}function Ste(){let e=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(e.current)return;let t=hte(new Sl({name:`inspector`,version:`0.1.0`},{capabilities:{tools:{}}}),`inspector`);async function n(){return md(`New inspect request started`),hd(),new Promise((e,t)=>{dd=e,fd=t,setTimeout(()=>{fd===t&&(pd(),t(Error(`Timeout: No element selected`)))},6e5)})}function r(e){if(!dd)return;let{sourceInfo:t,description:n,inspectionId:r}=e.detail;sessionStorage.setItem(ud,r),dd(yte(t,n)),pd()}function i(){sessionStorage.removeItem(ud),md(`Inspector cancelled by user`)}let a=[{event:`element-inspected`,handler:r},{event:`inspector-cancelled`,handler:i}];a.forEach(({event:e,handler:t})=>{window.addEventListener(e,t)}),t.registerTools([{...$u.list_inspections,implementation:vte},{...$u.capture_element_context,implementation:n},{...$u.update_inspection_status,implementation:xte},{...$u.execute_page_script,implementation:bte}]);let o=new fte(new URL(`/__mcp__/sse?clientId=inspector`,od()));return t.connect(o).then(()=>{e.current=t}).catch(e=>{console.error(`MCP connection error:`,e)}),()=>{a.forEach(({event:e,handler:t})=>{window.removeEventListener(e,t)}),o.close?.()}},[]),e.current}let _d=(0,_.createContext)(void 0),vd=()=>{let e=(0,_.useContext)(_d);if(!e)throw Error(`useInspectorTheme must be used within an InspectorThemeProvider`);return e},yd=({children:e})=>{let[t,n]=(0,_.useState)(`system`),[r,i]=(0,_.useState)(()=>typeof window>`u`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`);return(0,_.useEffect)(()=>{if(t===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>{i(e.matches?`dark`:`light`)};return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}else i(t)},[t]),(0,_.useEffect)(()=>{let e=window.document.documentElement;e.classList.remove(`light`,`dark`),e.classList.add(r)},[r]),(0,S.jsx)(_d.Provider,{value:{theme:t,setTheme:n,resolvedTheme:r},children:e})};var bd=p(yt(),1);function xd(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}let Cte=e=>{switch(e){case`success`:return wte;case`info`:return Td;case`warning`:return wd;case`error`:return Ed;default:return null}},Sd=Array(12).fill(0),Cd=({visible:e,className:t})=>_.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},_.createElement(`div`,{className:`sonner-spinner`},Sd.map((e,t)=>_.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),wte=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),wd=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Td=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Ed=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Dd=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},_.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),_.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Tte=()=>{let[e,t]=_.useState(document.hidden);return _.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},Od=1,kd=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:Od++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],_.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Dte(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||Od++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ete=(e,t)=>{let n=t?.id||Od++;return kd.addToast({title:e,...t,id:n}),n},Dte=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Ad=Ete;Object.assign(Ad,{success:kd.success,info:kd.info,warning:kd.warning,error:kd.error,custom:kd.custom,message:kd.message,promise:kd.promise,dismiss:kd.dismiss,loading:kd.loading},{getHistory:()=>kd.toasts,getToasts:()=>kd.getActiveToasts()}),xd(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function jd(e){return e.label!==void 0}let Md=4e3;function Nd(...e){return e.filter(Boolean).join(` `)}function Pd(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}let Ote=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:l,toasts:u,expanded:d,removeToast:f,defaultRichColors:p,closeButton:m,style:h,cancelButtonStyle:g,actionButtonStyle:v,className:y=``,descriptionClassName:b=``,duration:x,position:S,gap:C,expandByDefault:w,classNames:T,icons:E,closeButtonAriaLabel:D=`Close toast`}=e,[O,k]=_.useState(null),[A,j]=_.useState(null),[M,N]=_.useState(!1),[P,F]=_.useState(!1),[I,L]=_.useState(!1),[R,ee]=_.useState(!1),[te,z]=_.useState(!1),[B,ne]=_.useState(0),[re,ie]=_.useState(0),ae=_.useRef(n.duration||x||Md),oe=_.useRef(null),se=_.useRef(null),ce=l===0,le=l+1<=o,ue=n.type,de=n.dismissible!==!1,fe=n.className||``,pe=n.descriptionClassName||``,me=_.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),he=_.useMemo(()=>n.closeButton??m,[n.closeButton,m]),ge=_.useMemo(()=>n.duration||x||Md,[n.duration,x]),_e=_.useRef(0),ve=_.useRef(0),ye=_.useRef(0),be=_.useRef(null),[xe,Se]=S.split(`-`),Ce=_.useMemo(()=>s.reduce((e,t,n)=>n>=me?e:e+t.height,0),[s,me]),we=Tte(),Te=n.invert||t,Ee=ue===`loading`;ve.current=_.useMemo(()=>me*C+Ce,[me,Ce]),_.useEffect(()=>{ae.current=ge},[ge]),_.useEffect(()=>{N(!0)},[]),_.useEffect(()=>{let e=se.current;if(e){let t=e.getBoundingClientRect().height;return ie(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),_.useLayoutEffect(()=>{if(!M)return;let e=se.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ie(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[M,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let De=_.useCallback(()=>{F(!0),ne(ve.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{f(n)},200)},[n,f,a,ve]);_.useEffect(()=>{if(n.promise&&ue===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return d||i||we?(()=>{if(ye.current<_e.current){let e=new Date().getTime()-_e.current;ae.current-=e}ye.current=new Date().getTime()})():ae.current!==1/0&&(_e.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),De()},ae.current)),()=>clearTimeout(e)},[d,i,n,ue,we,De]),_.useEffect(()=>{n.delete&&(De(),n.onDismiss==null||n.onDismiss.call(n,n))},[De,n.delete]);function Oe(){return E?.loading?_.createElement(`div`,{className:Nd(T?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ue===`loading`},E.loading):_.createElement(Cd,{className:Nd(T?.loader,n?.classNames?.loader),visible:ue===`loading`})}let ke=n.icon||E?.[ue]||Cte(ue);return _.createElement(`li`,{tabIndex:0,ref:se,className:Nd(y,fe,T?.toast,n?.classNames?.toast,T?.default,T?.[ue],n?.classNames?.[ue]),"data-sonner-toast":``,"data-rich-colors":n.richColors??p,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":M,"data-promise":!!n.promise,"data-swiped":te,"data-removed":P,"data-visible":le,"data-y-position":xe,"data-x-position":Se,"data-index":l,"data-front":ce,"data-swiping":I,"data-dismissible":de,"data-type":ue,"data-invert":Te,"data-swipe-out":R,"data-swipe-direction":A,"data-expanded":!!(d||w&&M),"data-testid":n.testId,style:{"--index":l,"--toasts-before":l,"--z-index":u.length-l,"--offset":`${P?B:ve.current}px`,"--initial-height":w?`auto`:`${re}px`,...h,...n.style},onDragEnd:()=>{L(!1),k(null),be.current=null},onPointerDown:e=>{e.button!==2&&(Ee||!de||(oe.current=new Date,ne(ve.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(L(!0),be.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(R||!de)return;be.current=null;let e=Number(se.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(se.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-oe.current?.getTime(),i=O===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=45||a>.11){ne(ve.current),n.onDismiss==null||n.onDismiss.call(n,n),j(O===`x`?e>0?`right`:`left`:t>0?`down`:`up`),De(),ee(!0);return}else{var o,s;(o=se.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=se.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}z(!1),L(!1),k(null)},onPointerMove:t=>{var n,r;if(!be.current||!de||window.getSelection()?.toString().length>0)return;let i=t.clientY-be.current.y,a=t.clientX-be.current.x,o=e.swipeDirections??Pd(S);!O&&(Math.abs(a)>1||Math.abs(i)>1)&&k(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},l=e=>1/(1.5+Math.abs(e)/20);if(O===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*l(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(O===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*l(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&z(!0),(n=se.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=se.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},he&&!n.jsx&&ue!==`loading`?_.createElement(`button`,{"aria-label":D,"data-disabled":Ee,"data-close-button":!0,onClick:Ee||!de?()=>{}:()=>{De(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Nd(T?.closeButton,n?.classNames?.closeButton)},E?.close??Dd):null,(ue||n.icon||n.promise)&&n.icon!==null&&(E?.[ue]!==null||n.icon)?_.createElement(`div`,{"data-icon":``,className:Nd(T?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Oe():null,n.type===`loading`?null:ke):null,_.createElement(`div`,{"data-content":``,className:Nd(T?.content,n?.classNames?.content)},_.createElement(`div`,{"data-title":``,className:Nd(T?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?_.createElement(`div`,{"data-description":``,className:Nd(b,pe,T?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),_.isValidElement(n.cancel)?n.cancel:n.cancel&&jd(n.cancel)?_.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||g,onClick:e=>{jd(n.cancel)&&de&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),De())},className:Nd(T?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,_.isValidElement(n.action)?n.action:n.action&&jd(n.action)?_.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||v,onClick:e=>{jd(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&De())},className:Nd(T?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Fd(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function kte(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?`16px`:`24px`;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}let Ate=_.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:l,offset:u,mobileOffset:d,theme:f=`light`,richColors:p,duration:m,style:h,visibleToasts:g=3,toastOptions:v,dir:y=Fd(),gap:b=14,icons:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=_.useState([]),T=_.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=_.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,O]=_.useState([]),[k,A]=_.useState(!1),[j,M]=_.useState(!1),[N,P]=_.useState(f===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:f),F=_.useRef(null),I=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=_.useRef(null),R=_.useRef(!1),ee=_.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||kd.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return _.useEffect(()=>kd.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{bd.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[C]),_.useEffect(()=>{if(f!==`system`){P(f);return}if(f===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[f]),_.useEffect(()=>{C.length<=1&&A(!1)},[C]),_.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;A(!0),(t=F.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===F.current||F.current?.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),_.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,R.current=!1)}},[F.current]),_.createElement(`section`,{ref:t,"aria-label":`${S} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?_.createElement(`ol`,{key:t,dir:y===`auto`?Fd():y,tabIndex:-1,ref:F,className:l,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`356px`,"--gap":`${b}px`,...h,...kte(u,d)},onBlur:e=>{R.current&&!e.currentTarget.contains(e.relatedTarget)&&(R.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||R.current||(R.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>_.createElement(Ote,{key:n.id,icons:x,index:i,toast:n,defaultRichColors:p,duration:v?.duration??m,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:r,visibleToasts:g,closeButton:v?.closeButton??s,interacting:j,position:t,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:ee,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:o,gap:b,expanded:k,swipeDirections:e.swipeDirections}))):null}))}),jte=({...e})=>{let{theme:t=`system`}=vd(),n=Rd();return(0,S.jsx)(Ate,{theme:t,className:`toaster group`,icons:{success:(0,S.jsx)(ai,{className:`size-4`}),info:(0,S.jsx)(di,{className:`size-4`}),warning:(0,S.jsx)(yi,{className:`size-4`}),error:(0,S.jsx)(mi,{className:`size-4`}),loading:(0,S.jsx)(fi,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},container:n,...e})},Id=(0,_.createContext)(null),Ld=()=>(0,_.useContext)(Id),Rd=Ld,zd=`inspector-inspection-items`;function Bd(){let[e,t]=(0,_.useState)(()=>{try{let e=localStorage.getItem(zd);return e?JSON.parse(e):[]}catch{return[]}});return(0,_.useEffect)(()=>{function e(e){let{plan:n,inspectionId:r}=e.detail;t(e=>e.map(e=>e.id===r?{...e,status:`in-progress`,progress:n}:e))}function n(e){let{status:n,result:r,inspectionId:i}=e.detail;t(e=>e.map(e=>e.id===i?{...e,status:n,result:r?.message||r,progress:void 0}:e))}return window.addEventListener(`plan-progress-reported`,e),window.addEventListener(`inspection-result-received`,n),()=>{window.removeEventListener(`plan-progress-reported`,e),window.removeEventListener(`inspection-result-received`,n)}},[]),(0,_.useEffect)(()=>{try{localStorage.setItem(zd,JSON.stringify(e))}catch{console.warn(`Failed to save inspections to localStorage`)}},[e]),{inspections:e,setInspections:t}}var Vd=`/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */
216
+ - "failed" if unresolvable`)}function bte(e){let{code:t}=e;if(!t||typeof t!=`string`)return gd(`Error: Missing or invalid "code" parameter. Please provide JavaScript code to execute.`);try{let e=Function(t)(),n;if(e===void 0)n=`(undefined)`;else if(e===null)n=`(null)`;else if(typeof e==`object`)try{n=JSON.stringify(e,null,2)}catch{n=`[Object: ${Object.prototype.toString.call(e)}]`}else n=String(e);return gd(`${n}`)}catch(e){let t=e instanceof Error?e.message:String(e),n=e instanceof Error?e.stack:``;return gd(`## Error\n\`\`\`\n${t}\n\`\`\`\n\n${n?`## Stack Trace\n\`\`\`\n${n}\n\`\`\`\n`:``}\n## Suggestions\n- Check syntax errors\n- Verify element selectors exist\n- Ensure code returns a value\n- Check browser console for additional errors`)}}function xte(e){let{inspectionId:t,status:n,progress:r,message:i}=e,a=t||sessionStorage.getItem(ud)||``;if(!a)try{let e=localStorage.getItem(ld),t=(e?JSON.parse(e):[]).find(e=>e.status===`in-progress`);if(t)a=t.id,sessionStorage.setItem(ud,a);else return gd(`Error: No active inspection item found. Please use 'list_inspections' to see the queue, then provide the inspectionId parameter.`)}catch{return gd(`Error: No active inspection item`)}if(n===`deleted`)try{let e=localStorage.getItem(ld),t=(e?JSON.parse(e):[]).filter(e=>e.id!==a);return localStorage.setItem(ld,JSON.stringify(t)),sessionStorage.removeItem(ud),window.dispatchEvent(new CustomEvent(`inspection-deleted`,{detail:{inspectionId:a}})),gd(`Inspection ${a} deleted successfully.`)}catch{return gd(`Error: Failed to delete inspection`)}if(r&&window.dispatchEvent(new CustomEvent(`plan-progress-reported`,{detail:{plan:{steps:r.steps},inspectionId:a,timestamp:new Date().toISOString()}})),n===`completed`||n===`failed`){sessionStorage.removeItem(ud);let e=i||(n===`completed`?`Task completed`:`Task failed`);return window.dispatchEvent(new CustomEvent(`inspection-result-received`,{detail:{status:n,result:{message:e},inspectionId:a}})),gd(`Inspection marked as ${n}.`)}else n===`in-progress`&&i&&!r&&window.dispatchEvent(new CustomEvent(`inspection-status-updated`,{detail:{status:`in-progress`,message:i,inspectionId:a}}));return gd(`Status updated`)}function Ste(){let e=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(e.current)return;let t=hte(new Sl({name:`inspector`,version:`0.1.0`},{capabilities:{tools:{}}}),`inspector`);async function n(){return md(`New inspect request started`),hd(),new Promise((e,t)=>{dd=e,fd=t,setTimeout(()=>{fd===t&&(pd(),t(Error(`Timeout: No element selected`)))},6e5)})}function r(e){if(!dd)return;let{sourceInfo:t,description:n,inspectionId:r}=e.detail;sessionStorage.setItem(ud,r),dd(yte(t,n)),pd()}function i(){sessionStorage.removeItem(ud),md(`Inspector cancelled by user`)}let a=[{event:`element-inspected`,handler:r},{event:`inspector-cancelled`,handler:i}];a.forEach(({event:e,handler:t})=>{window.addEventListener(e,t)});let o=[{...$u.list_inspections,implementation:vte},{...$u.capture_element_context,implementation:n},{...$u.update_inspection_status,implementation:xte},{...$u.execute_page_script,implementation:bte}],s=(()=>{let e=window.__getInspectorTools;return e?e().map(e=>({name:e.name,description:e.description,inputSchema:e.inputSchema,implementation:async t=>{try{let n=await e.implementation(t);return n==null?gd(`(no result)`):typeof n==`object`?`content`in n&&Array.isArray(n.content)?n:gd(JSON.stringify(n,null,2)):gd(String(n))}catch(t){let n=t instanceof Error?t.message:String(t),r=t instanceof Error?t.stack:``;return gd(`# Error executing ${e.name}\n\n\`\`\`\n${n}\n\`\`\`\n\n${r?`## Stack Trace\n\`\`\`\n${r}\n\`\`\`\n`:``}`)}}})):[]})(),l=[...o,...s];t.registerTools(l),s.length>0&&console.log(`[dev-inspector] Registered ${s.length} custom tool(s):`,s.map(e=>e.name).join(`, `));let u=new fte(new URL(`/__mcp__/sse?clientId=inspector`,od()));return t.connect(u).then(()=>{e.current=t}).catch(e=>{console.error(`MCP connection error:`,e)}),()=>{a.forEach(({event:e,handler:t})=>{window.removeEventListener(e,t)}),u.close?.()}},[]),e.current}let _d=(0,_.createContext)(void 0),vd=()=>{let e=(0,_.useContext)(_d);if(!e)throw Error(`useInspectorTheme must be used within an InspectorThemeProvider`);return e},yd=({children:e})=>{let[t,n]=(0,_.useState)(`system`),[r,i]=(0,_.useState)(()=>typeof window>`u`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`);return(0,_.useEffect)(()=>{if(t===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>{i(e.matches?`dark`:`light`)};return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}else i(t)},[t]),(0,_.useEffect)(()=>{let e=window.document.documentElement;e.classList.remove(`light`,`dark`),e.classList.add(r)},[r]),(0,S.jsx)(_d.Provider,{value:{theme:t,setTheme:n,resolvedTheme:r},children:e})};var bd=p(yt(),1);function xd(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}let Cte=e=>{switch(e){case`success`:return wte;case`info`:return Td;case`warning`:return wd;case`error`:return Ed;default:return null}},Sd=Array(12).fill(0),Cd=({visible:e,className:t})=>_.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},_.createElement(`div`,{className:`sonner-spinner`},Sd.map((e,t)=>_.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),wte=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),wd=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Td=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Ed=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Dd=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},_.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),_.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Tte=()=>{let[e,t]=_.useState(document.hidden);return _.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},Od=1,kd=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:Od++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],_.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Dte(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||Od++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ete=(e,t)=>{let n=t?.id||Od++;return kd.addToast({title:e,...t,id:n}),n},Dte=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Ad=Ete;Object.assign(Ad,{success:kd.success,info:kd.info,warning:kd.warning,error:kd.error,custom:kd.custom,message:kd.message,promise:kd.promise,dismiss:kd.dismiss,loading:kd.loading},{getHistory:()=>kd.toasts,getToasts:()=>kd.getActiveToasts()}),xd(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function jd(e){return e.label!==void 0}let Md=4e3;function Nd(...e){return e.filter(Boolean).join(` `)}function Pd(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}let Ote=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:l,toasts:u,expanded:d,removeToast:f,defaultRichColors:p,closeButton:m,style:h,cancelButtonStyle:g,actionButtonStyle:v,className:y=``,descriptionClassName:b=``,duration:x,position:S,gap:C,expandByDefault:w,classNames:T,icons:E,closeButtonAriaLabel:D=`Close toast`}=e,[O,k]=_.useState(null),[A,j]=_.useState(null),[M,N]=_.useState(!1),[P,F]=_.useState(!1),[I,L]=_.useState(!1),[R,ee]=_.useState(!1),[te,z]=_.useState(!1),[B,ne]=_.useState(0),[re,ie]=_.useState(0),ae=_.useRef(n.duration||x||Md),oe=_.useRef(null),se=_.useRef(null),ce=l===0,le=l+1<=o,ue=n.type,de=n.dismissible!==!1,fe=n.className||``,pe=n.descriptionClassName||``,me=_.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),he=_.useMemo(()=>n.closeButton??m,[n.closeButton,m]),ge=_.useMemo(()=>n.duration||x||Md,[n.duration,x]),_e=_.useRef(0),ve=_.useRef(0),ye=_.useRef(0),be=_.useRef(null),[xe,Se]=S.split(`-`),Ce=_.useMemo(()=>s.reduce((e,t,n)=>n>=me?e:e+t.height,0),[s,me]),we=Tte(),Te=n.invert||t,Ee=ue===`loading`;ve.current=_.useMemo(()=>me*C+Ce,[me,Ce]),_.useEffect(()=>{ae.current=ge},[ge]),_.useEffect(()=>{N(!0)},[]),_.useEffect(()=>{let e=se.current;if(e){let t=e.getBoundingClientRect().height;return ie(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),_.useLayoutEffect(()=>{if(!M)return;let e=se.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ie(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[M,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let De=_.useCallback(()=>{F(!0),ne(ve.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{f(n)},200)},[n,f,a,ve]);_.useEffect(()=>{if(n.promise&&ue===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return d||i||we?(()=>{if(ye.current<_e.current){let e=new Date().getTime()-_e.current;ae.current-=e}ye.current=new Date().getTime()})():ae.current!==1/0&&(_e.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),De()},ae.current)),()=>clearTimeout(e)},[d,i,n,ue,we,De]),_.useEffect(()=>{n.delete&&(De(),n.onDismiss==null||n.onDismiss.call(n,n))},[De,n.delete]);function Oe(){return E?.loading?_.createElement(`div`,{className:Nd(T?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ue===`loading`},E.loading):_.createElement(Cd,{className:Nd(T?.loader,n?.classNames?.loader),visible:ue===`loading`})}let ke=n.icon||E?.[ue]||Cte(ue);return _.createElement(`li`,{tabIndex:0,ref:se,className:Nd(y,fe,T?.toast,n?.classNames?.toast,T?.default,T?.[ue],n?.classNames?.[ue]),"data-sonner-toast":``,"data-rich-colors":n.richColors??p,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":M,"data-promise":!!n.promise,"data-swiped":te,"data-removed":P,"data-visible":le,"data-y-position":xe,"data-x-position":Se,"data-index":l,"data-front":ce,"data-swiping":I,"data-dismissible":de,"data-type":ue,"data-invert":Te,"data-swipe-out":R,"data-swipe-direction":A,"data-expanded":!!(d||w&&M),"data-testid":n.testId,style:{"--index":l,"--toasts-before":l,"--z-index":u.length-l,"--offset":`${P?B:ve.current}px`,"--initial-height":w?`auto`:`${re}px`,...h,...n.style},onDragEnd:()=>{L(!1),k(null),be.current=null},onPointerDown:e=>{e.button!==2&&(Ee||!de||(oe.current=new Date,ne(ve.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(L(!0),be.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(R||!de)return;be.current=null;let e=Number(se.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(se.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-oe.current?.getTime(),i=O===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=45||a>.11){ne(ve.current),n.onDismiss==null||n.onDismiss.call(n,n),j(O===`x`?e>0?`right`:`left`:t>0?`down`:`up`),De(),ee(!0);return}else{var o,s;(o=se.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=se.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}z(!1),L(!1),k(null)},onPointerMove:t=>{var n,r;if(!be.current||!de||window.getSelection()?.toString().length>0)return;let i=t.clientY-be.current.y,a=t.clientX-be.current.x,o=e.swipeDirections??Pd(S);!O&&(Math.abs(a)>1||Math.abs(i)>1)&&k(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},l=e=>1/(1.5+Math.abs(e)/20);if(O===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*l(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(O===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*l(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&z(!0),(n=se.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=se.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},he&&!n.jsx&&ue!==`loading`?_.createElement(`button`,{"aria-label":D,"data-disabled":Ee,"data-close-button":!0,onClick:Ee||!de?()=>{}:()=>{De(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Nd(T?.closeButton,n?.classNames?.closeButton)},E?.close??Dd):null,(ue||n.icon||n.promise)&&n.icon!==null&&(E?.[ue]!==null||n.icon)?_.createElement(`div`,{"data-icon":``,className:Nd(T?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Oe():null,n.type===`loading`?null:ke):null,_.createElement(`div`,{"data-content":``,className:Nd(T?.content,n?.classNames?.content)},_.createElement(`div`,{"data-title":``,className:Nd(T?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?_.createElement(`div`,{"data-description":``,className:Nd(b,pe,T?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),_.isValidElement(n.cancel)?n.cancel:n.cancel&&jd(n.cancel)?_.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||g,onClick:e=>{jd(n.cancel)&&de&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),De())},className:Nd(T?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,_.isValidElement(n.action)?n.action:n.action&&jd(n.action)?_.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||v,onClick:e=>{jd(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&De())},className:Nd(T?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Fd(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function kte(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?`16px`:`24px`;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}let Ate=_.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:l,offset:u,mobileOffset:d,theme:f=`light`,richColors:p,duration:m,style:h,visibleToasts:g=3,toastOptions:v,dir:y=Fd(),gap:b=14,icons:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=_.useState([]),T=_.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=_.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,O]=_.useState([]),[k,A]=_.useState(!1),[j,M]=_.useState(!1),[N,P]=_.useState(f===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:f),F=_.useRef(null),I=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=_.useRef(null),R=_.useRef(!1),ee=_.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||kd.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return _.useEffect(()=>kd.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{bd.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[C]),_.useEffect(()=>{if(f!==`system`){P(f);return}if(f===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[f]),_.useEffect(()=>{C.length<=1&&A(!1)},[C]),_.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;A(!0),(t=F.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===F.current||F.current?.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),_.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,R.current=!1)}},[F.current]),_.createElement(`section`,{ref:t,"aria-label":`${S} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?_.createElement(`ol`,{key:t,dir:y===`auto`?Fd():y,tabIndex:-1,ref:F,className:l,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`356px`,"--gap":`${b}px`,...h,...kte(u,d)},onBlur:e=>{R.current&&!e.currentTarget.contains(e.relatedTarget)&&(R.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||R.current||(R.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>_.createElement(Ote,{key:n.id,icons:x,index:i,toast:n,defaultRichColors:p,duration:v?.duration??m,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:r,visibleToasts:g,closeButton:v?.closeButton??s,interacting:j,position:t,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:ee,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:o,gap:b,expanded:k,swipeDirections:e.swipeDirections}))):null}))}),jte=({...e})=>{let{theme:t=`system`}=vd(),n=Rd();return(0,S.jsx)(Ate,{theme:t,className:`toaster group`,icons:{success:(0,S.jsx)(ai,{className:`size-4`}),info:(0,S.jsx)(di,{className:`size-4`}),warning:(0,S.jsx)(yi,{className:`size-4`}),error:(0,S.jsx)(mi,{className:`size-4`}),loading:(0,S.jsx)(fi,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},container:n,...e})},Id=(0,_.createContext)(null),Ld=()=>(0,_.useContext)(Id),Rd=Ld,zd=`inspector-inspection-items`;function Bd(){let[e,t]=(0,_.useState)(()=>{try{let e=localStorage.getItem(zd);return e?JSON.parse(e):[]}catch{return[]}});return(0,_.useEffect)(()=>{function e(e){let{plan:n,inspectionId:r}=e.detail;t(e=>e.map(e=>e.id===r?{...e,status:`in-progress`,progress:n}:e))}function n(e){let{status:n,result:r,inspectionId:i}=e.detail;t(e=>e.map(e=>e.id===i?{...e,status:n,result:r?.message||r,progress:void 0}:e))}return window.addEventListener(`plan-progress-reported`,e),window.addEventListener(`inspection-result-received`,n),()=>{window.removeEventListener(`plan-progress-reported`,e),window.removeEventListener(`inspection-result-received`,n)}},[]),(0,_.useEffect)(()=>{try{localStorage.setItem(zd,JSON.stringify(e))}catch{console.warn(`Failed to save inspections to localStorage`)}},[e]),{inspections:e,setInspections:t}}var Vd=`/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */
217
217
  @layer properties {
218
218
  @supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
219
219
  *, :before, :after, ::backdrop {
package/client.d.ts CHANGED
@@ -3,19 +3,65 @@
3
3
 
4
4
  declare module "virtual:dev-inspector-mcp" {
5
5
  /**
6
- * Development-only inspector initialization module.
7
- * This module is automatically tree-shaken in production builds.
8
- *
9
- * Import this in your entry point for non-HTML projects (miniapps, library bundles):
6
+ * JSON Schema for tool input parameters
7
+ */
8
+ export interface ToolInputSchema {
9
+ type: "object";
10
+ properties: Record<
11
+ string,
12
+ {
13
+ type: string;
14
+ description?: string;
15
+ enum?: string[];
16
+ default?: unknown;
17
+ }
18
+ >;
19
+ required?: string[];
20
+ }
21
+
22
+ /**
23
+ * Custom inspector tool definition
24
+ */
25
+ export interface InspectorTool {
26
+ /** Unique tool name */
27
+ name: string;
28
+ /** Tool description for AI agents */
29
+ description: string;
30
+ /** JSON Schema defining input parameters */
31
+ inputSchema: ToolInputSchema;
32
+ /** Implementation function that executes when the tool is called */
33
+ implementation: (args: Record<string, unknown>) => unknown | Promise<unknown>;
34
+ }
35
+
36
+ /**
37
+ * Register a custom tool that can be called by AI agents through MCP.
10
38
  *
11
39
  * @example
12
40
  * ```typescript
13
- * // main.ts
14
- * import 'virtual:dev-inspector-mcp';
15
- * ```
41
+ * import { registerInspectorTool } from 'virtual:dev-inspector-mcp';
16
42
  *
17
- * When building for production, bundlers will statically replace `import.meta.env.DEV`
18
- * with `false`, causing the entire module code to be removed via dead code elimination.
43
+ * registerInspectorTool({
44
+ * name: "custom_alert",
45
+ * description: "Show a custom alert in the browser",
46
+ * inputSchema: {
47
+ * type: "object",
48
+ * properties: {
49
+ * message: { type: "string", description: "Message to display" }
50
+ * },
51
+ * required: ["message"]
52
+ * },
53
+ * implementation: (args) => {
54
+ * alert(args.message as string);
55
+ * return { success: true };
56
+ * }
57
+ * });
58
+ * ```
59
+ */
60
+ export function registerInspectorTool(tool: InspectorTool): void;
61
+
62
+ /**
63
+ * Development-only inspector initialization module.
64
+ * This module is automatically tree-shaken in production builds.
19
65
  */
20
66
  const _default: void;
21
67
  export default _default;
@@ -87226,7 +87226,7 @@ function setupInspectorMiddleware(middlewares, config) {
87226
87226
  }
87227
87227
 
87228
87228
  //#endregion
87229
- //#region ../../node_modules/.pnpm/@mcpc-tech+acp-ai-provider@0.1.36/node_modules/@mcpc-tech/acp-ai-provider/index.mjs
87229
+ //#region ../../node_modules/.pnpm/@mcpc-tech+acp-ai-provider@0.1.38/node_modules/@mcpc-tech/acp-ai-provider/index.mjs
87230
87230
  (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
87231
87231
  function formatToolError(toolResult) {
87232
87232
  if (!toolResult || toolResult.length === 0) return "Unknown tool error";
@@ -87673,7 +87673,7 @@ var ACPLanguageModel = class {
87673
87673
  return {
87674
87674
  toolCallId: update$1.toolCallId,
87675
87675
  toolName: update$1.title || update$1.toolCallId,
87676
- toolResult: update$1.rawOutput ?? null,
87676
+ toolResult: update$1.rawOutput ?? update$1.content ?? null,
87677
87677
  isError: update$1.status === "failed",
87678
87678
  status: update$1.status
87679
87679
  };
@@ -87261,7 +87261,7 @@ function setupInspectorMiddleware(middlewares, config) {
87261
87261
  }
87262
87262
 
87263
87263
  //#endregion
87264
- //#region ../../node_modules/.pnpm/@mcpc-tech+acp-ai-provider@0.1.36/node_modules/@mcpc-tech/acp-ai-provider/index.mjs
87264
+ //#region ../../node_modules/.pnpm/@mcpc-tech+acp-ai-provider@0.1.38/node_modules/@mcpc-tech/acp-ai-provider/index.mjs
87265
87265
  createRequire(import.meta.url);
87266
87266
  function formatToolError(toolResult) {
87267
87267
  if (!toolResult || toolResult.length === 0) return "Unknown tool error";
@@ -87708,7 +87708,7 @@ var ACPLanguageModel = class {
87708
87708
  return {
87709
87709
  toolCallId: update$1.toolCallId,
87710
87710
  toolName: update$1.title || update$1.toolCallId,
87711
- toolResult: update$1.rawOutput ?? null,
87711
+ toolResult: update$1.rawOutput ?? update$1.content ?? null,
87712
87712
  isError: update$1.status === "failed",
87713
87713
  status: update$1.status
87714
87714
  };
package/dist/index.cjs CHANGED
@@ -71,6 +71,25 @@ const createDevInspectorPlugin = (name, transformFactory) => {
71
71
  load(id) {
72
72
  if (id === "\0" + virtualModuleName) return `
73
73
  // Development-only code - removed in production builds
74
+
75
+ // Global tools registry
76
+ if (typeof window !== 'undefined') {
77
+ if (!window.__INSPECTOR_TOOLS__) {
78
+ window.__INSPECTOR_TOOLS__ = [];
79
+ }
80
+ // Exposed for the inspector client to retrieve tools
81
+ window.__getInspectorTools = () => window.__INSPECTOR_TOOLS__;
82
+ }
83
+
84
+ /**
85
+ * Register a custom tool for the inspector
86
+ */
87
+ export function registerInspectorTool(tool) {
88
+ if (typeof window === 'undefined') return;
89
+ window.__INSPECTOR_TOOLS__ = window.__INSPECTOR_TOOLS__ || [];
90
+ window.__INSPECTOR_TOOLS__.push(tool);
91
+ }
92
+
74
93
  if (typeof window !== 'undefined' && typeof document !== 'undefined') {
75
94
  // Create inspector element
76
95
  const inspector = document.createElement('dev-inspector-mcp');
package/dist/index.js CHANGED
@@ -67,6 +67,25 @@ const createDevInspectorPlugin = (name, transformFactory) => {
67
67
  load(id) {
68
68
  if (id === "\0" + virtualModuleName) return `
69
69
  // Development-only code - removed in production builds
70
+
71
+ // Global tools registry
72
+ if (typeof window !== 'undefined') {
73
+ if (!window.__INSPECTOR_TOOLS__) {
74
+ window.__INSPECTOR_TOOLS__ = [];
75
+ }
76
+ // Exposed for the inspector client to retrieve tools
77
+ window.__getInspectorTools = () => window.__INSPECTOR_TOOLS__;
78
+ }
79
+
80
+ /**
81
+ * Register a custom tool for the inspector
82
+ */
83
+ export function registerInspectorTool(tool) {
84
+ if (typeof window === 'undefined') return;
85
+ window.__INSPECTOR_TOOLS__ = window.__INSPECTOR_TOOLS__ || [];
86
+ window.__INSPECTOR_TOOLS__.push(tool);
87
+ }
88
+
70
89
  if (typeof window !== 'undefined' && typeof document !== 'undefined') {
71
90
  // Create inspector element
72
91
  const inspector = document.createElement('dev-inspector-mcp');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpc-tech/unplugin-dev-inspector-mcp",
3
- "version": "0.0.30",
3
+ "version": "0.0.33",
4
4
  "description": "Universal dev inspector plugin for React/Vue - inspect component sources and API calls in any bundler",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -113,7 +113,7 @@
113
113
  "@babel/parser": "^7.28.5",
114
114
  "@babel/traverse": "^7.28.5",
115
115
  "@code-inspector/core": "^1.3.0",
116
- "@mcpc-tech/acp-ai-provider": "^0.1.36",
116
+ "@mcpc-tech/acp-ai-provider": "^0.1.38",
117
117
  "@mcpc-tech/cmcp": "^0.0.15",
118
118
  "@mcpc-tech/core": "^0.3.8",
119
119
  "@modelcontextprotocol/sdk": "^1.20.1",