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

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,4 +1,4 @@
1
- var DevInspector=(function(e){var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(e&&(t=e(e=0)),t),l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),u=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t&&n(r,Symbol.toStringTag,{value:`Module`}),r},d=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var l=i(t),u=0,d=l.length,f;u<d;u++)f=l[u],!o.call(e,f)&&f!==a&&n(e,f,{get:(e=>t[e]).bind(null,f),enumerable:!(s=r(t,f))||s.enumerable});return e},f=(e,t,r,i)=>{i&&(n(e,Symbol.toStringTag,{value:`Module`}),r&&n(r,Symbol.toStringTag,{value:`Module`})),d(e,t,`default`),r&&d(r,t,`default`)},p=(e,r,i)=>(i=e==null?{}:t(a(e)),d(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),m=e=>o.call(e,`module.exports`)?e[`module.exports`]:d(n({},`__esModule`,{value:!0}),e),h=l((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.memo`),f=Symbol.for(`react.lazy`),p=Symbol.for(`react.activity`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var l=!1;if(e===null)l=!0;else switch(s){case`bigint`:case`string`:case`number`:l=!0;break;case`object`:switch(e.$$typeof){case t:case n:l=!0;break;case f:return l=e._init,P(l(e._payload),r,i,a,o)}}if(l)return o=o(e),l=a===``?`.`+M(e,0):a,C(o)?(i=``,l!=null&&(i=l.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+l)),r.push(o)),1;l=0;var u=a===``?`.`:a+`:`;if(C(e))for(var d=0;d<e.length;d++)a=e[d],s=u+M(a,d),l+=P(a,r,i,s,o);else if(d=h(e),typeof d==`function`)for(e=d.call(e),d=0;!(a=e.next()).done;)a=a.value,s=u+M(a,d++),l+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return l}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},R={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=p,e.Children=R,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=u,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:l,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:d,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=T.T,n={};T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}},e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.2.0`})),g=l(((e,t)=>{t.exports=h()})),_=p(g(),1);function v(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function y(...e){return t=>{let n=!1,r=e.map(e=>{let r=v(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():v(e[t],null)}}}}function b(...e){return _.useCallback(y(...e),e)}
1
+ var DevInspector=(function(e){var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(e&&(t=e(e=0)),t),l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),u=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t&&n(r,Symbol.toStringTag,{value:`Module`}),r},d=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var l=i(t),u=0,d=l.length,f;u<d;u++)f=l[u],!o.call(e,f)&&f!==a&&n(e,f,{get:(e=>t[e]).bind(null,f),enumerable:!(s=r(t,f))||s.enumerable});return e},f=(e,t,n)=>(d(e,t,`default`),n&&d(n,t,`default`)),p=(e,r,i)=>(i=e==null?{}:t(a(e)),d(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),m=e=>o.call(e,`module.exports`)?e[`module.exports`]:d(n({},`__esModule`,{value:!0}),e),h=l((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.memo`),f=Symbol.for(`react.lazy`),p=Symbol.for(`react.activity`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var l=!1;if(e===null)l=!0;else switch(s){case`bigint`:case`string`:case`number`:l=!0;break;case`object`:switch(e.$$typeof){case t:case n:l=!0;break;case f:return l=e._init,P(l(e._payload),r,i,a,o)}}if(l)return o=o(e),l=a===``?`.`+M(e,0):a,C(o)?(i=``,l!=null&&(i=l.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+l)),r.push(o)),1;l=0;var u=a===``?`.`:a+`:`;if(C(e))for(var d=0;d<e.length;d++)a=e[d],s=u+M(a,d),l+=P(a,r,i,s,o);else if(d=h(e),typeof d==`function`)for(e=d.call(e),d=0;!(a=e.next()).done;)a=a.value,s=u+M(a,d++),l+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return l}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},R={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=p,e.Children=R,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=u,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:l,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:d,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=T.T,n={};T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}},e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.2.0`})),g=l(((e,t)=>{t.exports=h()})),_=p(g(),1);function v(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function y(...e){return t=>{let n=!1,r=e.map(e=>{let r=v(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():v(e[t],null)}}}}function b(...e){return _.useCallback(y(...e),e)}
2
2
  /**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -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)});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}];t.registerTools(o);let 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`:``}`)}}})):[]})();s.length>0&&(t.registerTools(s),console.log(`[dev-inspector] Registered ${s.length} custom tool(s):`,s.map(e=>e.name).join(`, `)));let l=new fte(new URL(`/__mcp__/sse?clientId=inspector`,od()));return t.connect(l).then(()=>{e.current=t}).catch(e=>{console.error(`MCP connection error:`,e)}),()=>{a.forEach(({event:e,handler:t})=>{window.removeEventListener(e,t)}),l.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)}),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 */
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 {
@@ -6933,7 +6933,7 @@ ${e.themeCSS}`),e.fontFamily!==void 0&&(n+=`
6933
6933
  `)||(e.endsWith("```\n")||e.endsWith("```"))&&t%2==0)return e;let r=e.match(Ntn);if(r&&!n){let t=r[2];if(!t||z7.test(t))return e;if(Ytn(e)%2==1)return`${e}\``}return e},Ztn=e=>{let t=e.match(Ptn);if(t){let n=t[2];if(!n||z7.test(n))return e;if((e.match(/~~/g)||[]).length%2==1)return`${e}~~`}return e},Qtn=e=>{if((e.match(/\$\$/g)||[]).length%2==0)return e;let t=e.indexOf(`$$`);return t!==-1&&e.indexOf(`
6934
6934
  `,t)!==-1&&!e.endsWith(`
6935
6935
  `)?`${e}
6936
- $$`:`${e}$$`},$tn=e=>{let t=0,n=e.match(/\*+/g)||[];for(let e of n){let n=e.length;n>=3&&(t+=Math.floor(n/3))}return t},enn=e=>{if(V7(e)||ztn.test(e))return e;let t=e.match(Atn);if(t){let n=t[2];if(!n||z7.test(n))return e;if($tn(e)%2==1)return`${e}***`}return e},tnn=e=>{if(!e||typeof e!=`string`)return e;let t=e,n=Btn(t);return n.endsWith(`](streamdown:incomplete-link)`)?n:(t=n,t=enn(t),t=Vtn(t),t=Htn(t),t=Wtn(t),t=qtn(t),t=Xtn(t),t=Ztn(t),t=Qtn(t),t)},nnn={harden:[fhe,{allowedImagePrefixes:[`*`],allowedLinkPrefixes:[`*`],defaultOrigin:void 0,allowDataImages:!0}],raw:XSe,katex:[Ay,{errorColor:`var(--color-muted-foreground)`}]},rnn={gfm:[hEe,{}],math:[DEe,{singleDollarTextMath:!1}],cjkFriendly:[kCe,{}],cjkFriendlyGfmStrikethrough:[jCe,{}]},inn=(0,_.createContext)([`github-light`,`github-dark`]),ann=(0,_.createContext)(void 0),onn=(0,_.createContext)(!0),H7=(0,_.createContext)({isAnimating:!1}),snn=(0,_.memo)(({content:e,shouldParseIncompleteMarkdown:t,...n})=>{let r=(0,_.useMemo)(()=>typeof e==`string`&&t?tnn(e.trim()):e,[e,t]);return(0,S.jsx)(she,{...n,children:r})},(e,t)=>e.content===t.content);snn.displayName=`Block`;var cnn=[`github-light`,`github-dark`],lnn=(0,_.memo)(({children:e,parseIncompleteMarkdown:t=!0,components:n,rehypePlugins:r=Object.values(nnn),remarkPlugins:i=Object.values(rnn),className:a,shikiTheme:o=cnn,mermaidConfig:s,controls:l=!0,isAnimating:u=!1,urlTransform:d=e=>e,BlockComponent:f=snn,parseMarkdownIntoBlocksFn:m=Etn,...h})=>{let g=(0,_.useId)(),v=(0,_.useMemo)(()=>m(typeof e==`string`?e:``),[e,m]);(0,_.useEffect)(()=>{Array.isArray(r)&&r.some(e=>Array.isArray(e)?e[0]===Ay:e===Ay)&&Promise.resolve().then(()=>p(xen(),1))},[r]);let y=(0,_.useMemo)(()=>({isAnimating:u}),[u]);return(0,S.jsx)(inn.Provider,{value:o,children:(0,S.jsx)(ann.Provider,{value:s,children:(0,S.jsx)(onn.Provider,{value:l,children:(0,S.jsx)(H7.Provider,{value:y,children:(0,S.jsx)(`div`,{className:F7(`space-y-4`,a),children:v.map((e,a)=>(0,S.jsx)(f,{components:{...xtn,...n},content:e,index:a,rehypePlugins:r,remarkPlugins:i,shouldParseIncompleteMarkdown:t,urlTransform:d,...h},`${g}-block-${a}`))})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating);lnn.displayName=`Streamdown`;let unn=(0,_.createContext)(null),dnn=()=>{let e=(0,_.useContext)(unn);if(!e)throw Error(`Reasoning components must be used within Reasoning`);return e},fnn=(0,_.memo)(({className:e,isStreaming:t=!1,open:n,defaultOpen:r=!0,onOpenChange:i,duration:a,children:o,...s})=>{let[l,u]=ht({prop:n,defaultProp:r,onChange:i}),[d,f]=ht({prop:a,defaultProp:void 0}),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(null);return(0,_.useEffect)(()=>{t?h===null&&g(Date.now()):h!==null&&(f(Math.ceil((Date.now()-h)/1e3)),g(null))},[t,h,f]),(0,_.useEffect)(()=>{if(r&&!t&&l&&!p){let e=setTimeout(()=>{u(!1),m(!0)},1e3);return()=>clearTimeout(e)}},[t,l,r,u,p]),(0,S.jsx)(unn.Provider,{value:{isStreaming:t,isOpen:l,setIsOpen:u,duration:d},children:(0,S.jsx)(Ui,{className:nt(`not-prose mb-4`,e),onOpenChange:e=>{u(e)},open:l,...s,children:o})})}),pnn=(e,t)=>e||t===0?(0,S.jsx)(Bce,{duration:1,children:`Thinking...`}):t===void 0?(0,S.jsx)(`p`,{children:`Thought for a few seconds`}):(0,S.jsxs)(`p`,{children:[`Thought for `,t,` seconds`]}),mnn=(0,_.memo)(({className:e,children:t,...n})=>{let{isStreaming:r,isOpen:i,duration:a}=dnn();return(0,S.jsx)(Wi,{className:nt(`flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,e),...n,children:t??(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)($r,{className:`size-4`}),pnn(r,a),(0,S.jsx)(ei,{className:nt(`size-4 transition-transform`,i?`rotate-180`:`rotate-0`)})]})})}),hnn=(0,_.memo)(({className:e,children:t,...n})=>(0,S.jsx)(Gi,{className:nt(`mt-4 text-sm`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...n,children:(0,S.jsx)(lnn,{...n,children:t})}));fnn.displayName=`Reasoning`,mnn.displayName=`ReasoningTrigger`,hnn.displayName=`ReasoningContent`,(0,_.createContext)(null);let gnn=(0,_.memo)(({className:e,...t})=>(0,S.jsx)(lnn,{className:nt(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,e),...t}),(e,t)=>e.children===t.children);gnn.displayName=`MessageResponse`;let _nn=(0,_.createContext)({code:``}),vnn={name:`line-numbers`,line(e,t){e.children.unshift({type:`element`,tagName:`span`,properties:{className:[`inline-block`,`min-w-10`,`mr-4`,`text-right`,`select-none`,`text-muted-foreground`]},children:[{type:`text`,value:String(t)}]})}};async function ynn(e,t,n=!1){let r=n?[vnn]:[];return await Promise.all([hXe(e,{lang:t,theme:`one-light`,transformers:r}),hXe(e,{lang:t,theme:`one-dark-pro`,transformers:r})])}let U7=({code:e,language:t,showLineNumbers:n=!1,className:r,children:i,...a})=>{let[o,s]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),d=(0,_.useRef)(!1);return(0,_.useEffect)(()=>(ynn(e,t,n).then(([e,t])=>{d.current||=(s(e),u(t),!0)}),()=>{d.current=!1}),[e,t,n]),(0,S.jsx)(_nn.Provider,{value:{code:e},children:(0,S.jsx)(`div`,{className:nt(`group relative w-full overflow-hidden rounded-md border bg-background text-foreground`,r),...a,children:(0,S.jsxs)(`div`,{className:`relative`,children:[(0,S.jsx)(`div`,{className:`overflow-hidden dark:hidden [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm`,dangerouslySetInnerHTML:{__html:o}}),(0,S.jsx)(`div`,{className:`hidden overflow-hidden dark:block [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm`,dangerouslySetInnerHTML:{__html:l}}),i&&(0,S.jsx)(`div`,{className:`absolute top-2 right-2 flex items-center gap-2`,children:i})]})})})},bnn=({className:e,...t})=>(0,S.jsx)(Ui,{className:nt(`not-prose mb-4 w-full rounded-md border`,e),...t}),xnn=e=>{let t={"input-streaming":`Pending`,"input-available":`Running`,"approval-requested":`Awaiting Approval`,"approval-responded":`Responded`,"output-available":`Completed`,"output-error":`Error`,"output-denied":`Denied`};return(0,S.jsxs)(it,{className:`gap-1.5 rounded-full text-xs`,variant:`secondary`,children:[{"input-streaming":(0,S.jsx)(si,{className:`size-4`}),"input-available":(0,S.jsx)(ci,{className:`size-4 animate-pulse`}),"approval-requested":(0,S.jsx)(ci,{className:`size-4 text-yellow-600`}),"approval-responded":(0,S.jsx)(ii,{className:`size-4 text-blue-600`}),"output-available":(0,S.jsx)(ii,{className:`size-4 text-green-600`}),"output-error":(0,S.jsx)(oi,{className:`size-4 text-red-600`}),"output-denied":(0,S.jsx)(oi,{className:`size-4 text-orange-600`})}[e],t[e]]})},Snn=({className:e,title:t,type:n,state:r,...i})=>(0,S.jsxs)(Wi,{className:nt(`flex w-full items-center justify-between gap-4 p-3`,e),...i,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(bi,{className:`size-4 text-muted-foreground`}),(0,S.jsx)(`span`,{className:`font-medium text-sm`,children:t??n.split(`-`).slice(1).join(`-`)}),xnn(r)]}),(0,S.jsx)(ei,{className:`size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180`})]}),Cnn=({className:e,...t})=>(0,S.jsx)(Gi,{className:nt(`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...t}),wnn=({className:e,input:t,...n})=>(0,S.jsxs)(`div`,{className:nt(`space-y-2 overflow-hidden p-4`,e),...n,children:[(0,S.jsx)(`h4`,{className:`font-medium text-muted-foreground text-xs uppercase tracking-wide`,children:`Parameters`}),(0,S.jsx)(`div`,{className:`rounded-md bg-muted/50`,children:(0,S.jsx)(U7,{code:JSON.stringify(t,null,2),language:`json`})})]}),Tnn=({className:e,output:t,errorText:n,...r})=>{if(!(t||n))return null;let i=(0,S.jsx)(`div`,{children:t});return typeof t==`object`&&!(0,_.isValidElement)(t)?i=(0,S.jsx)(U7,{code:JSON.stringify(t,null,2),language:`json`}):typeof t==`string`&&(i=(0,S.jsx)(U7,{code:t,language:`json`})),(0,S.jsxs)(`div`,{className:nt(`space-y-2 p-4`,e),...r,children:[(0,S.jsx)(`h4`,{className:`font-medium text-muted-foreground text-xs uppercase tracking-wide`,children:n?`Error`:`Result`}),(0,S.jsxs)(`div`,{className:nt(`overflow-x-auto rounded-md text-xs [&_table]:w-full`,n?`bg-destructive/10 text-destructive`:`bg-muted/50 text-foreground`),children:[n&&(0,S.jsx)(`div`,{children:n}),i]})]})};function Enn({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`card`,className:nt(`bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm`,e),...t})}function Dnn({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`card-header`,className:nt(`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,e),...t})}function Onn({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`card-content`,className:nt(`px-6`,e),...t})}let knn=(0,_.createContext)(null),Ann=({className:e,isStreaming:t=!1,children:n,...r})=>(0,S.jsx)(knn.Provider,{value:{isStreaming:t},children:(0,S.jsx)(Ui,{asChild:!0,"data-slot":`plan`,...r,children:(0,S.jsx)(Enn,{className:nt(`shadow-none`,e),children:n})})}),jnn=({className:e,...t})=>(0,S.jsx)(Dnn,{className:nt(`flex items-start justify-between`,e),"data-slot":`plan-header`,...t}),Mnn=e=>(0,S.jsx)(Gi,{asChild:!0,children:(0,S.jsx)(Onn,{"data-slot":`plan-content`,...e})}),Nnn=({className:e,...t})=>(0,S.jsx)(Wi,{asChild:!0,children:(0,S.jsxs)(ki,{className:nt(`size-8`,e),"data-slot":`plan-trigger`,size:`icon`,variant:`ghost`,...t,children:[(0,S.jsx)(ni,{className:`size-4`}),(0,S.jsx)(`span`,{className:`sr-only`,children:`Toggle plan`})]})});function Pnn(e){let t=e;return typeof t.type==`string`&&t.type.startsWith(`tool-`)&&`state`in t}function Fnn(e,t,n,r,i){if(e.type===`text`&&e.text)return(0,S.jsx)(gnn,{className:`whitespace-pre-wrap`,children:e.text},`${t}-${n}`);if(e.type===`reasoning`)return(0,S.jsxs)(fnn,{className:`w-full`,isStreaming:r,children:[(0,S.jsx)(mnn,{}),(0,S.jsx)(hnn,{children:e.text})]},`${t}-${n}`);let a=i?.plan;if(a&&n===0)return(0,S.jsx)(`div`,{className:`w-full`,children:(0,S.jsxs)(Ann,{defaultOpen:!0,isStreaming:r,children:[(0,S.jsx)(jnn,{className:`flex flex-row items-center`,children:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`h1`,{className:`text-base`,children:`Agent Plan`}),(0,S.jsx)(Nnn,{className:`mb-2`})]})}),(0,S.jsx)(Mnn,{children:(0,S.jsx)(`ul`,{className:`space-y-2`,children:a.map((e,t)=>{let n=e.content||JSON.stringify(e),r=e.priority,i=e.status;return(0,S.jsxs)(`li`,{className:`flex items-start justify-between gap-3`,children:[(0,S.jsxs)(`div`,{className:`flex-1`,children:[(0,S.jsx)(`div`,{className:`text-sm ${i===`done`?`line-through text-muted-foreground`:`text-foreground`}`,children:n}),r&&(0,S.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Priority: `,r]})]}),(0,S.jsx)(`div`,{className:`shrink-0 text-xs`,children:(0,S.jsx)(`span`,{className:`px-2 py-1 rounded-full font-medium text-[10px] uppercase tracking-wide ${i===`pending`?`bg-muted text-muted-foreground`:`bg-primary/10 text-primary`}`,children:i??`pending`})})]},`plan-${t}`)})})})]})},`${t}-plan`);if(Pnn(e)){let r=e=>(e=e.replace(`acp-ai-sdk-tools`,``),e),i=e.input,a=r(i.toolName),o=e.state,s=o===`output-available`||o===`output-error`;return(0,S.jsxs)(bnn,{defaultOpen:s,children:[(0,S.jsx)(Snn,{title:r(a.length>20?`${a.slice(0,20)}...`:a),type:a,state:o}),(0,S.jsxs)(Cnn,{children:[e.input!==void 0&&(0,S.jsx)(wnn,{input:i}),s&&(0,S.jsx)(Tnn,{output:e.output?(0,S.jsx)(U7,{code:JSON.stringify(e.output,null,2),language:`json`}):null,errorText:e.errorText})]})]},`${t}-${n}`)}return null}let Inn=({messages:e,status:t,selectedAgent:n})=>{let r=nd.find(e=>e.name===(n||rd))||nd[0],i=t===`submitted`||t===`streaming`,a=e[e.length-1],o=i&&(!a||a.role===`user`);return(0,S.jsxs)(tle,{className:`w-full h-full`,children:[(0,S.jsx)(nle,{className:`p-3 space-y-3`,children:e.length===0&&!i?(0,S.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground`,children:(0,S.jsxs)(`div`,{className:`text-center`,children:[(0,S.jsx)(`p`,{className:`text-sm`,children:`No messages yet`}),(0,S.jsx)(`p`,{className:`text-xs mt-1`,children:`Enter a question below to start`})]})}):(0,S.jsxs)(S.Fragment,{children:[e.map(e=>(0,S.jsxs)(Rle,{className:`items-start`,from:e.role,children:[(0,S.jsx)(zle,{children:e.parts.map((n,r)=>Fnn(n,e.id,r,t===`streaming`,e.metadata))}),e.role===`assistant`&&(0,S.jsx)(Ble,{name:r.name,src:r.meta?.icon??``})]},e.id)),o&&(0,S.jsxs)(Rle,{className:`items-start`,from:`assistant`,children:[(0,S.jsx)(zle,{children:(0,S.jsx)(Hle,{size:16})}),(0,S.jsx)(Ble,{name:r.name,src:r.meta?.icon??``})]})]})}),(0,S.jsx)(rle,{})]})};function Lnn(e,t,n=50){let[r,i]=(0,_.useState)(``),a=(0,_.useRef)(0),o=(0,_.useRef)(``);return(0,_.useEffect)(()=>{if(e.length<r.length||r&&!e.startsWith(r.slice(0,Math.min(r.length,20)))){i(e),o.current=e,a.current=Date.now();return}if(!t){r!==e&&(i(e),o.current=e);return}let s=e.slice(o.current.length);if(!s)return;let l=Date.now();if(l-a.current<n)return;let u=/[.?!。?!](\s|$)|[\n]/.test(s),d=s.length>50,f=s.trim().length<5;(u&&!f||d)&&(i(e),o.current=e,a.current=l)},[e,t,n,r]),r}function Rnn({initialOffset:e={x:0,y:0}}={}){let t=(0,_.useRef)(null),[n,r]=(0,_.useState)(!1),i=(0,_.useRef)(e),a=(0,_.useRef)({x:0,y:0}),o=(0,_.useRef)({x:0,y:0}),s=(0,_.useCallback)(()=>{if(t.current){let{x:e,y:n}=i.current;t.current.style.transform=`translate3d(calc(-50% + ${e}px), ${n}px, 0)`}},[]),l=(0,_.useCallback)(e=>{e.target.closest(`button, input, a, [data-no-drag]`)||(e.preventDefault(),r(!0),a.current={x:e.clientX,y:e.clientY},o.current={...i.current})},[]);return(0,_.useEffect)(()=>{let e=e=>{if(!n)return;let t=e.clientX-a.current.x,r=e.clientY-a.current.y;i.current={x:o.current.x+t,y:o.current.y+r},s()},t=()=>{r(!1)};return n&&(window.addEventListener(`mousemove`,e,{passive:!0}),window.addEventListener(`mouseup`,t)),()=>{window.removeEventListener(`mousemove`,e),window.removeEventListener(`mouseup`,t)}},[n,s]),(0,_.useEffect)(()=>{s()},[s]),{elementRef:t,isDragging:n,handleMouseDown:l}}let znn=`AI_SELECTED_AGENT`,Bnn=e=>{let[t,n]=(0,_.useState)(e);return(0,_.useEffect)(()=>{typeof window<`u`&&cd().then(e=>{if(e&&e!==rd)n(e);else{let e=localStorage.getItem(znn);e&&n(e)}})},[]),{agent:t,setAgent:e=>{n(e),!(typeof window>`u`)&&(e?.trim()?localStorage.setItem(znn,e):localStorage.removeItem(znn))}}},Vnn=({isActive:e,onToggleInspector:t,onSubmitAgent:n,onCancel:r,isAgentWorking:i,messages:a,status:o,inspectionCount:s=0,inspectionItems:l=[],onRemoveInspection:u=()=>{}})=>{let[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(``),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(`none`),[b,x]=(0,_.useState)(!1),[C,w]=(0,_.useState)(!1),[T,E]=(0,_.useState)(!0),{agent:D,setAgent:O}=Bnn(rd),[k,A]=(0,_.useState)(!1),j=nd.find(e=>e.name===D)||nd[0],{elementRef:M,isDragging:N,handleMouseDown:P}=Rnn(),[F,I]=(0,_.useState)(null),[L,R]=(0,_.useState)(``),ee=Lnn(L,i,50),[te,z]=(0,_.useState)(``),B=(0,_.useRef)(``),ne=(0,_.useRef)(``);(0,_.useEffect)(()=>{let e=ee,t=B.current;if(e.length<t.length||!e.startsWith(t)){z(e),B.current=e;return}if(e.length>t.length){let n=e.slice(t.length).trim();n&&z(n),B.current=e}},[ee]);let re=(0,_.useRef)(null),ie=(0,_.useRef)(null),ae=(0,_.useRef)(null),oe=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(a.length===0){R(``),g(null),ae.current=null,oe.current=!1,z(``),B.current=``;return}let e=a[a.length-1];if(e.role!==`assistant`)return;let t=Uce(e),{displayText:n,toolCall:r}=Gce(e,t||ae.current);R(n||``),t&&(ae.current=t),r?(ie.current&&=(clearTimeout(ie.current),null),g(r),oe.current=!0):oe.current=!1},[a]),(0,_.useEffect)(()=>{te!==ne.current&&(oe.current||g(null),ne.current=te)},[te]),(0,_.useEffect)(()=>{d&&re.current&&re.current.focus()},[d]),(0,_.useEffect)(()=>{if(!i&&C){x(!1),w(!1),E(!1);let e=setTimeout(()=>{E(!0)},2e3);return()=>clearTimeout(e)}},[i,C]),(0,_.useEffect)(()=>{function e(e){let{plan:t,inspectionId:n}=e.detail;if(t?.steps){let e=t.steps.find(e=>e.status===`in-progress`),r=t.steps.filter(e=>e.status===`completed`).length;I({id:n,status:`in-progress`,currentStep:e?{title:e.title,index:r+1,total:t.steps.length}:void 0})}}function t(e){let{status:t,result:n,inspectionId:r}=e.detail;I({id:r,status:t,message:n?.message||n})}return window.addEventListener(`plan-progress-reported`,e),window.addEventListener(`inspection-result-received`,t),()=>{window.removeEventListener(`plan-progress-reported`,e),window.removeEventListener(`inspection-result-received`,t)}},[]);let se=e=>{e.preventDefault(),p.trim()&&(ie.current&&=(clearTimeout(ie.current),null),g(null),R(``),z(``),I(null),ae.current=null,B.current=``,x(!0),w(!0),n(p,D),m(``),f(!0),y(`chat`))},ce=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),se(e)),e.key===`Escape`&&(f(!1),re.current?.blur())},le=o===`error`,ue=a.length>0,de=d&&!b,fe=(!d||b)&&(i||ue||F);return(0,S.jsxs)(`div`,{ref:M,className:nt(`fixed bottom-8 left-1/2 z-[999999]`,`transition-all duration-300 ease-[cubic-bezier(0.23,1,0.32,1)]`,d?`w-[450px]`:fe?`w-auto min-w-[200px] max-w-[450px]`:`w-[190px]`,N?`cursor-grabbing`:`cursor-grab`),onMouseDown:P,onMouseEnter:()=>{N||(i||C?(f(!0),y(`chat`)):T&&f(!0))},onMouseLeave:()=>{!p.trim()&&!C&&!N&&(f(!1),y(`none`)),E(!0)},children:[(0,S.jsxs)(`div`,{className:nt(`relative flex items-center backdrop-blur-xl shadow-2xl border border-border`,`transition-[width,height,padding,background-color,border-color] duration-200 ease-out`,d?`h-12 p-2 pl-4`:`h-9 px-2 py-1`,v===`none`?`bg-muted/90 rounded-full`:`bg-muted/95 rounded-b-lg rounded-t-none border-t-0`,le&&!d&&`bg-destructive/10 border-destructive/20`),children:[(0,S.jsxs)(`div`,{className:nt(`flex items-center transition-opacity duration-300 w-full relative`,de?`absolute left-3 opacity-0 pointer-events-none`:`relative opacity-100`),children:[!fe&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`flex items-center justify-center w-6 h-6 rounded-full bg-accent flex-shrink-0`,children:(0,S.jsx)(gi,{className:`w-3.5 h-3.5 text-foreground`})}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground/70 ml-3 whitespace-nowrap`,children:`⌥I or hover to inspect`})]}),fe&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-3 flex-shrink-0`,children:[(0,S.jsx)(`div`,{className:`relative flex items-center justify-center w-6 h-6 rounded-full bg-accent flex-shrink-0`,children:i?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`absolute inset-0 rounded-full border-2 border-current opacity-20 animate-ping text-foreground`}),(0,S.jsx)(gi,{className:`w-3.5 h-3.5 animate-pulse text-foreground`})]}):F?F.status===`in-progress`?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`absolute inset-0 rounded-full border-2 border-current opacity-20 animate-ping text-blue-500`}),(0,S.jsx)(vi,{className:`w-3.5 h-3.5 animate-pulse text-blue-500`})]}):F.status===`completed`?(0,S.jsx)(ai,{className:`w-5 h-5 text-green-500`}):(0,S.jsx)(oi,{className:`w-5 h-5 text-red-500`}):le?(0,S.jsx)(oi,{className:`w-5 h-5 text-red-500`}):(0,S.jsx)(ai,{className:`w-5 h-5 text-green-500`})}),(0,S.jsx)(`div`,{className:`w-px h-4 bg-border flex-shrink-0`})]}),(0,S.jsx)(`div`,{className:`flex-1 flex justify-center min-w-0 pl-2`,children:(0,S.jsx)(`div`,{className:`flex flex-col min-w-0 max-w-full pr-2 max-h-[24px] overflow-hidden`,children:F&&F.status===`in-progress`&&F.currentStep?(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm font-medium text-foreground min-w-0`,children:[(0,S.jsx)(vi,{className:`w-4 h-4 flex-shrink-0`}),(0,S.jsxs)(`span`,{className:`truncate min-w-0`,children:[`Step `,F.currentStep.index,`/`,F.currentStep.total,`: `,F.currentStep.title]})]}):F?.message?(0,S.jsx)(`div`,{className:`text-sm font-medium leading-[1.4] text-foreground truncate min-w-0`,children:F.message}):h?(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm font-medium text-foreground min-w-0`,children:[(0,S.jsx)(vi,{className:`w-4 h-4 flex-shrink-0`}),(0,S.jsx)(`span`,{className:`truncate min-w-0`,children:h})]}):(0,S.jsx)(`div`,{className:`text-sm font-medium leading-[1.4] text-foreground truncate min-w-0`,children:i&&!te?(0,S.jsx)(Bce,{duration:2,spread:2,children:o===`submitted`&&j?.command===`npx`?`Starting ${j.name}... This may take a moment.`:`Thinking...`}):te||`Processing...`})})})]})]}),(0,S.jsxs)(`div`,{className:nt(`flex items-center w-full gap-3 transition-all duration-500 delay-75`,de?`opacity-100 translate-y-0 relative pointer-events-auto`:`opacity-0 translate-y-4 pointer-events-none absolute top-2 left-4 right-2`),onClick:e=>e.stopPropagation(),children:[(0,S.jsx)(`button`,{onClick:t,className:nt(`relative flex items-center justify-center w-7 h-7 rounded-full transition-colors flex-shrink-0`,e?`bg-blue-500 text-white shadow-[0_0_15px_rgba(59,130,246,0.5)]`:`bg-accent text-muted-foreground hover:bg-accent/80 hover:text-foreground`),title:`Toggle Inspector (⌥I)`,children:(0,S.jsx)(li,{className:`w-3.5 h-3.5`})}),(0,S.jsx)(`div`,{className:`w-px h-4 bg-border flex-shrink-0`}),s>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>y(e=>e===`inspections`?`none`:`inspections`),className:nt(`relative flex items-center justify-center w-7 h-7 rounded-full transition-colors flex-shrink-0`,`hover:bg-accent/50`,v===`inspections`&&`bg-accent/50 text-foreground`),title:`View Inspections`,children:[(0,S.jsx)(ui,{className:`w-3.5 h-3.5`}),(0,S.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 flex items-center justify-center min-w-[12px] h-[12px] px-0.5 text-[8px] font-bold text-white bg-red-500 rounded-full border border-background shadow-sm leading-none`,children:s>99?`99+`:s})]}),(0,S.jsx)(`div`,{className:`w-px h-4 bg-border flex-shrink-0`})]}),(0,S.jsxs)(`form`,{onSubmit:se,className:`flex-1 flex items-center gap-2 min-w-0`,onClick:e=>e.stopPropagation(),children:[(0,S.jsxs)(`div`,{className:`relative flex-shrink-0`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>A(!k),className:`flex items-center justify-center w-7 h-7 rounded-full hover:bg-accent/50 transition-colors`,title:`Select Agent`,children:(0,S.jsx)(`img`,{src:nd.find(e=>e.name===D)?.meta?.icon,alt:D,className:`w-3.5 h-3.5`})}),k&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`fixed inset-0 z-[999998]`,onClick:()=>A(!1)}),(0,S.jsx)(`div`,{className:`absolute bottom-full left-0 mb-2 w-48 bg-popover border border-border rounded-lg shadow-lg overflow-hidden z-[999999] animate-in fade-in zoom-in-95 duration-200`,children:nd.map(e=>(0,S.jsxs)(`button`,{onClick:()=>{O(e.name),A(!1)},className:nt(`w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-accent transition-colors`,D===e.name&&`bg-accent/50 font-medium`),children:[e.meta?.icon&&(0,S.jsx)(`img`,{src:e.meta.icon,alt:``,className:`w-4 h-4`}),e.name]},e.name))})]})]}),(0,S.jsx)(`input`,{ref:re,type:`text`,value:p,onChange:e=>m(e.target.value),onKeyDown:ce,placeholder:`Ask ${D}...`,className:`w-full bg-transparent border-none outline-none text-foreground placeholder-muted-foreground text-sm h-7 disabled:opacity-50`,tabIndex:0,disabled:i}),(a.length>0||i||C)&&(0,S.jsx)(`button`,{type:`button`,onClick:()=>y(e=>e===`chat`?`none`:`chat`),className:nt(`flex items-center justify-center w-7 h-7 rounded-full transition-all flex-shrink-0`,v===`chat`?`bg-foreground text-background`:`bg-accent text-muted-foreground hover:bg-accent/80 hover:text-foreground`),title:v===`chat`?`Collapse`:`Expand messages`,children:(0,S.jsx)(ti,{className:nt(`w-3.5 h-3.5 transition-transform duration-300`,v===`chat`&&`rotate-180`)})}),i?(0,S.jsx)(`button`,{type:`button`,onClick:r,className:`flex items-center justify-center w-7 h-7 rounded-full bg-destructive text-destructive-foreground transition-all flex-shrink-0 hover:bg-destructive/90`,title:`Cancel request`,children:(0,S.jsx)(_i,{className:`w-3 h-3`})}):(0,S.jsx)(`button`,{type:`submit`,disabled:!p.trim(),className:nt(`flex items-center justify-center w-7 h-7 rounded-full transition-all flex-shrink-0`,p.trim()?`bg-foreground text-background scale-100`:`bg-accent text-muted-foreground/50 scale-90`),children:(0,S.jsx)(Qr,{className:`w-3.5 h-3.5`})})]})]})]}),v!==`none`&&(0,S.jsx)(`div`,{className:`absolute bottom-full left-0 right-0 pointer-events-auto max-w-[450px] mx-auto animate-panel-in`,children:(0,S.jsxs)(`div`,{className:`bg-muted/95 backdrop-blur-xl rounded-t-xl border border-border border-b-0 shadow-2xl overflow-hidden`,children:[v===`inspections`&&l.length>0&&(0,S.jsx)(`div`,{className:`border-b border-border`,children:(0,S.jsx)(ta,{items:l,onRemove:u})}),v===`chat`&&(0,S.jsx)(`div`,{className:`h-[500px]`,children:(0,S.jsx)(Inn,{messages:a,status:o,selectedAgent:D})})]})})]})};var Hnn=`vercel.ai.error`,Unn=Symbol.for(Hnn),Wnn,Gnn=class e extends Error{constructor({name:e,message:t,cause:n}){super(t),this[Wnn]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,Hnn)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}};Wnn=Unn;var W7=Gnn;function Knn(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.message:JSON.stringify(e)}var qnn=`AI_InvalidArgumentError`,Jnn=`vercel.ai.error.${qnn}`,Ynn=Symbol.for(Jnn),Xnn,Znn=class extends W7{constructor({message:e,cause:t,argument:n}){super({name:qnn,message:e,cause:t}),this[Xnn]=!0,this.argument=n}static isInstance(e){return W7.hasMarker(e,Jnn)}};Xnn=Ynn;var Qnn=`AI_JSONParseError`,$nn=`vercel.ai.error.${Qnn}`,ern=Symbol.for($nn),trn,nrn=class extends W7{constructor({text:e,cause:t}){super({name:Qnn,message:`JSON parsing failed: Text: ${e}.
6936
+ $$`:`${e}$$`},$tn=e=>{let t=0,n=e.match(/\*+/g)||[];for(let e of n){let n=e.length;n>=3&&(t+=Math.floor(n/3))}return t},enn=e=>{if(V7(e)||ztn.test(e))return e;let t=e.match(Atn);if(t){let n=t[2];if(!n||z7.test(n))return e;if($tn(e)%2==1)return`${e}***`}return e},tnn=e=>{if(!e||typeof e!=`string`)return e;let t=e,n=Btn(t);return n.endsWith(`](streamdown:incomplete-link)`)?n:(t=n,t=enn(t),t=Vtn(t),t=Htn(t),t=Wtn(t),t=qtn(t),t=Xtn(t),t=Ztn(t),t=Qtn(t),t)},nnn={harden:[fhe,{allowedImagePrefixes:[`*`],allowedLinkPrefixes:[`*`],defaultOrigin:void 0,allowDataImages:!0}],raw:XSe,katex:[Ay,{errorColor:`var(--color-muted-foreground)`}]},rnn={gfm:[hEe,{}],math:[DEe,{singleDollarTextMath:!1}],cjkFriendly:[kCe,{}],cjkFriendlyGfmStrikethrough:[jCe,{}]},inn=(0,_.createContext)([`github-light`,`github-dark`]),ann=(0,_.createContext)(void 0),onn=(0,_.createContext)(!0),H7=(0,_.createContext)({isAnimating:!1}),snn=(0,_.memo)(({content:e,shouldParseIncompleteMarkdown:t,...n})=>{let r=(0,_.useMemo)(()=>typeof e==`string`&&t?tnn(e.trim()):e,[e,t]);return(0,S.jsx)(she,{...n,children:r})},(e,t)=>e.content===t.content);snn.displayName=`Block`;var cnn=[`github-light`,`github-dark`],lnn=(0,_.memo)(({children:e,parseIncompleteMarkdown:t=!0,components:n,rehypePlugins:r=Object.values(nnn),remarkPlugins:i=Object.values(rnn),className:a,shikiTheme:o=cnn,mermaidConfig:s,controls:l=!0,isAnimating:u=!1,urlTransform:d=e=>e,BlockComponent:f=snn,parseMarkdownIntoBlocksFn:m=Etn,...h})=>{let g=(0,_.useId)(),v=(0,_.useMemo)(()=>m(typeof e==`string`?e:``),[e,m]);(0,_.useEffect)(()=>{Array.isArray(r)&&r.some(e=>Array.isArray(e)?e[0]===Ay:e===Ay)&&Promise.resolve().then(()=>p(xen(),1))},[r]);let y=(0,_.useMemo)(()=>({isAnimating:u}),[u]);return(0,S.jsx)(inn.Provider,{value:o,children:(0,S.jsx)(ann.Provider,{value:s,children:(0,S.jsx)(onn.Provider,{value:l,children:(0,S.jsx)(H7.Provider,{value:y,children:(0,S.jsx)(`div`,{className:F7(`space-y-4`,a),children:v.map((e,a)=>(0,S.jsx)(f,{components:{...xtn,...n},content:e,index:a,rehypePlugins:r,remarkPlugins:i,shouldParseIncompleteMarkdown:t,urlTransform:d,...h},`${g}-block-${a}`))})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating);lnn.displayName=`Streamdown`;let unn=(0,_.createContext)(null),dnn=()=>{let e=(0,_.useContext)(unn);if(!e)throw Error(`Reasoning components must be used within Reasoning`);return e},fnn=(0,_.memo)(({className:e,isStreaming:t=!1,open:n,defaultOpen:r=!0,onOpenChange:i,duration:a,children:o,...s})=>{let[l,u]=ht({prop:n,defaultProp:r,onChange:i}),[d,f]=ht({prop:a,defaultProp:void 0}),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(null);return(0,_.useEffect)(()=>{t?h===null&&g(Date.now()):h!==null&&(f(Math.ceil((Date.now()-h)/1e3)),g(null))},[t,h,f]),(0,_.useEffect)(()=>{if(r&&!t&&l&&!p){let e=setTimeout(()=>{u(!1),m(!0)},1e3);return()=>clearTimeout(e)}},[t,l,r,u,p]),(0,S.jsx)(unn.Provider,{value:{isStreaming:t,isOpen:l,setIsOpen:u,duration:d},children:(0,S.jsx)(Ui,{className:nt(`not-prose mb-4`,e),onOpenChange:e=>{u(e)},open:l,...s,children:o})})}),pnn=(e,t)=>e||t===0?(0,S.jsx)(Bce,{duration:1,children:`Thinking...`}):t===void 0?(0,S.jsx)(`p`,{children:`Thought for a few seconds`}):(0,S.jsxs)(`p`,{children:[`Thought for `,t,` seconds`]}),mnn=(0,_.memo)(({className:e,children:t,...n})=>{let{isStreaming:r,isOpen:i,duration:a}=dnn();return(0,S.jsx)(Wi,{className:nt(`flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,e),...n,children:t??(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)($r,{className:`size-4`}),pnn(r,a),(0,S.jsx)(ei,{className:nt(`size-4 transition-transform`,i?`rotate-180`:`rotate-0`)})]})})}),hnn=(0,_.memo)(({className:e,children:t,...n})=>(0,S.jsx)(Gi,{className:nt(`mt-4 text-sm`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...n,children:(0,S.jsx)(lnn,{...n,children:t})}));fnn.displayName=`Reasoning`,mnn.displayName=`ReasoningTrigger`,hnn.displayName=`ReasoningContent`,(0,_.createContext)(null);let gnn=(0,_.memo)(({className:e,...t})=>(0,S.jsx)(lnn,{className:nt(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,e),...t}),(e,t)=>e.children===t.children);gnn.displayName=`MessageResponse`;let _nn=(0,_.createContext)({code:``}),vnn={name:`line-numbers`,line(e,t){e.children.unshift({type:`element`,tagName:`span`,properties:{className:[`inline-block`,`min-w-10`,`mr-4`,`text-right`,`select-none`,`text-muted-foreground`]},children:[{type:`text`,value:String(t)}]})}};async function ynn(e,t,n=!1){let r=n?[vnn]:[];return await Promise.all([hXe(e,{lang:t,theme:`one-light`,transformers:r}),hXe(e,{lang:t,theme:`one-dark-pro`,transformers:r})])}let U7=({code:e,language:t,showLineNumbers:n=!1,className:r,children:i,...a})=>{let[o,s]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),d=(0,_.useRef)(!1);return(0,_.useEffect)(()=>(ynn(e,t,n).then(([e,t])=>{d.current||=(s(e),u(t),!0)}),()=>{d.current=!1}),[e,t,n]),(0,S.jsx)(_nn.Provider,{value:{code:e},children:(0,S.jsx)(`div`,{className:nt(`group relative w-full overflow-hidden rounded-md border bg-background text-foreground`,r),...a,children:(0,S.jsxs)(`div`,{className:`relative`,children:[(0,S.jsx)(`div`,{className:`overflow-hidden dark:hidden [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm`,dangerouslySetInnerHTML:{__html:o}}),(0,S.jsx)(`div`,{className:`hidden overflow-hidden dark:block [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm`,dangerouslySetInnerHTML:{__html:l}}),i&&(0,S.jsx)(`div`,{className:`absolute top-2 right-2 flex items-center gap-2`,children:i})]})})})},bnn=({className:e,...t})=>(0,S.jsx)(Ui,{className:nt(`not-prose mb-4 w-full rounded-md border`,e),...t}),xnn=e=>{let t={"input-streaming":`Pending`,"input-available":`Running`,"approval-requested":`Awaiting Approval`,"approval-responded":`Responded`,"output-available":`Completed`,"output-error":`Error`,"output-denied":`Denied`};return(0,S.jsxs)(it,{className:`gap-1.5 rounded-full text-xs`,variant:`secondary`,children:[{"input-streaming":(0,S.jsx)(si,{className:`size-4`}),"input-available":(0,S.jsx)(ci,{className:`size-4 animate-pulse`}),"approval-requested":(0,S.jsx)(ci,{className:`size-4 text-yellow-600`}),"approval-responded":(0,S.jsx)(ii,{className:`size-4 text-blue-600`}),"output-available":(0,S.jsx)(ii,{className:`size-4 text-green-600`}),"output-error":(0,S.jsx)(oi,{className:`size-4 text-red-600`}),"output-denied":(0,S.jsx)(oi,{className:`size-4 text-orange-600`})}[e],t[e]]})},Snn=({className:e,title:t,type:n,state:r,...i})=>(0,S.jsxs)(Wi,{className:nt(`flex w-full items-center justify-between gap-4 p-3`,e),...i,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(bi,{className:`size-4 text-muted-foreground`}),(0,S.jsx)(`span`,{className:`font-medium text-sm`,children:t??n.split(`-`).slice(1).join(`-`)}),xnn(r)]}),(0,S.jsx)(ei,{className:`size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180`})]}),Cnn=({className:e,...t})=>(0,S.jsx)(Gi,{className:nt(`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...t}),wnn=({className:e,input:t,...n})=>(0,S.jsxs)(`div`,{className:nt(`space-y-2 overflow-hidden p-4`,e),...n,children:[(0,S.jsx)(`h4`,{className:`font-medium text-muted-foreground text-xs uppercase tracking-wide`,children:`Parameters`}),(0,S.jsx)(`div`,{className:`rounded-md bg-muted/50`,children:(0,S.jsx)(U7,{code:JSON.stringify(t,null,2),language:`json`})})]}),Tnn=({className:e,output:t,errorText:n,...r})=>{if(!(t||n))return null;let i=(0,S.jsx)(`div`,{children:t});return typeof t==`object`&&!(0,_.isValidElement)(t)?i=(0,S.jsx)(U7,{code:JSON.stringify(t,null,2),language:`json`}):typeof t==`string`&&(i=(0,S.jsx)(U7,{code:t,language:`json`})),(0,S.jsxs)(`div`,{className:nt(`space-y-2 p-4`,e),...r,children:[(0,S.jsx)(`h4`,{className:`font-medium text-muted-foreground text-xs uppercase tracking-wide`,children:n?`Error`:`Result`}),(0,S.jsxs)(`div`,{className:nt(`overflow-x-auto rounded-md text-xs [&_table]:w-full`,n?`bg-destructive/10 text-destructive`:`bg-muted/50 text-foreground`),children:[n&&(0,S.jsx)(`div`,{children:n}),i]})]})};function Enn({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`card`,className:nt(`bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm`,e),...t})}function Dnn({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`card-header`,className:nt(`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,e),...t})}function Onn({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`card-content`,className:nt(`px-6`,e),...t})}let knn=(0,_.createContext)(null),Ann=({className:e,isStreaming:t=!1,children:n,...r})=>(0,S.jsx)(knn.Provider,{value:{isStreaming:t},children:(0,S.jsx)(Ui,{asChild:!0,"data-slot":`plan`,...r,children:(0,S.jsx)(Enn,{className:nt(`shadow-none`,e),children:n})})}),jnn=({className:e,...t})=>(0,S.jsx)(Dnn,{className:nt(`flex items-start justify-between`,e),"data-slot":`plan-header`,...t}),Mnn=e=>(0,S.jsx)(Gi,{asChild:!0,children:(0,S.jsx)(Onn,{"data-slot":`plan-content`,...e})}),Nnn=({className:e,...t})=>(0,S.jsx)(Wi,{asChild:!0,children:(0,S.jsxs)(ki,{className:nt(`size-8`,e),"data-slot":`plan-trigger`,size:`icon`,variant:`ghost`,...t,children:[(0,S.jsx)(ni,{className:`size-4`}),(0,S.jsx)(`span`,{className:`sr-only`,children:`Toggle plan`})]})});function Pnn(e){let t=e;return typeof t.type==`string`&&t.type.startsWith(`tool-`)&&`state`in t}function Fnn(e,t,n,r,i){if(e.type===`text`&&e.text)return(0,S.jsx)(gnn,{className:`whitespace-pre-wrap`,children:e.text},`${t}-${n}`);if(e.type===`reasoning`)return(0,S.jsxs)(fnn,{className:`w-full`,isStreaming:r,children:[(0,S.jsx)(mnn,{}),(0,S.jsx)(hnn,{children:e.text})]},`${t}-${n}`);let a=i?.plan;if(a&&n===0)return(0,S.jsx)(`div`,{className:`w-full`,children:(0,S.jsxs)(Ann,{defaultOpen:!0,isStreaming:r,children:[(0,S.jsx)(jnn,{className:`flex flex-row items-center`,children:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`h1`,{className:`text-base`,children:`Agent Plan`}),(0,S.jsx)(Nnn,{className:`mb-2`})]})}),(0,S.jsx)(Mnn,{children:(0,S.jsx)(`ul`,{className:`space-y-2`,children:a.map((e,t)=>{let n=e.content||JSON.stringify(e),r=e.priority,i=e.status;return(0,S.jsxs)(`li`,{className:`flex items-start justify-between gap-3`,children:[(0,S.jsxs)(`div`,{className:`flex-1`,children:[(0,S.jsx)(`div`,{className:`text-sm ${i===`done`?`line-through text-muted-foreground`:`text-foreground`}`,children:n}),r&&(0,S.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Priority: `,r]})]}),(0,S.jsx)(`div`,{className:`shrink-0 text-xs`,children:(0,S.jsx)(`span`,{className:`px-2 py-1 rounded-full font-medium text-[10px] uppercase tracking-wide ${i===`pending`?`bg-muted text-muted-foreground`:`bg-primary/10 text-primary`}`,children:i??`pending`})})]},`plan-${t}`)})})})]})},`${t}-plan`);if(Pnn(e)){let r=e=>(e=e.replace(`acp-ai-sdk-tools`,``),e),i=e.input;if(!i||!i.toolName)return null;let a=r(i.toolName),o=e.state,s=o===`output-available`||o===`output-error`;return(0,S.jsxs)(bnn,{defaultOpen:s,children:[(0,S.jsx)(Snn,{title:r(a.length>20?`${a.slice(0,20)}...`:a),type:a,state:o}),(0,S.jsxs)(Cnn,{children:[e.input!==void 0&&(0,S.jsx)(wnn,{input:i}),s&&(0,S.jsx)(Tnn,{output:e.output?(0,S.jsx)(U7,{code:JSON.stringify(e.output,null,2),language:`json`}):null,errorText:e.errorText})]})]},`${t}-${n}`)}return null}let Inn=({messages:e,status:t,selectedAgent:n})=>{let r=nd.find(e=>e.name===(n||rd))||nd[0],i=t===`submitted`||t===`streaming`,a=e[e.length-1],o=i&&(!a||a.role===`user`);return(0,S.jsxs)(tle,{className:`w-full h-full`,children:[(0,S.jsx)(nle,{className:`p-3 space-y-3`,children:e.length===0&&!i?(0,S.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground`,children:(0,S.jsxs)(`div`,{className:`text-center`,children:[(0,S.jsx)(`p`,{className:`text-sm`,children:`No messages yet`}),(0,S.jsx)(`p`,{className:`text-xs mt-1`,children:`Enter a question below to start`})]})}):(0,S.jsxs)(S.Fragment,{children:[e.map(e=>(0,S.jsxs)(Rle,{className:`items-start`,from:e.role,children:[(0,S.jsx)(zle,{children:e.parts.map((n,r)=>Fnn(n,e.id,r,t===`streaming`,e.metadata))}),e.role===`assistant`&&(0,S.jsx)(Ble,{name:r.name,src:r.meta?.icon??``})]},e.id)),o&&(0,S.jsxs)(Rle,{className:`items-start`,from:`assistant`,children:[(0,S.jsx)(zle,{children:(0,S.jsx)(Hle,{size:16})}),(0,S.jsx)(Ble,{name:r.name,src:r.meta?.icon??``})]})]})}),(0,S.jsx)(rle,{})]})};function Lnn(e,t,n=50){let[r,i]=(0,_.useState)(``),a=(0,_.useRef)(0),o=(0,_.useRef)(``);return(0,_.useEffect)(()=>{if(e.length<r.length||r&&!e.startsWith(r.slice(0,Math.min(r.length,20)))){i(e),o.current=e,a.current=Date.now();return}if(!t){r!==e&&(i(e),o.current=e);return}let s=e.slice(o.current.length);if(!s)return;let l=Date.now();if(l-a.current<n)return;let u=/[.?!。?!](\s|$)|[\n]/.test(s),d=s.length>50,f=s.trim().length<5;(u&&!f||d)&&(i(e),o.current=e,a.current=l)},[e,t,n,r]),r}function Rnn({initialOffset:e={x:0,y:0}}={}){let t=(0,_.useRef)(null),[n,r]=(0,_.useState)(!1),i=(0,_.useRef)(e),a=(0,_.useRef)({x:0,y:0}),o=(0,_.useRef)({x:0,y:0}),s=(0,_.useCallback)(()=>{if(t.current){let{x:e,y:n}=i.current;t.current.style.transform=`translate3d(calc(-50% + ${e}px), ${n}px, 0)`}},[]),l=(0,_.useCallback)(e=>{e.target.closest(`button, input, a, [data-no-drag]`)||(e.preventDefault(),r(!0),a.current={x:e.clientX,y:e.clientY},o.current={...i.current})},[]);return(0,_.useEffect)(()=>{let e=e=>{if(!n)return;let t=e.clientX-a.current.x,r=e.clientY-a.current.y;i.current={x:o.current.x+t,y:o.current.y+r},s()},t=()=>{r(!1)};return n&&(window.addEventListener(`mousemove`,e,{passive:!0}),window.addEventListener(`mouseup`,t)),()=>{window.removeEventListener(`mousemove`,e),window.removeEventListener(`mouseup`,t)}},[n,s]),(0,_.useEffect)(()=>{s()},[s]),{elementRef:t,isDragging:n,handleMouseDown:l}}let znn=`AI_SELECTED_AGENT`,Bnn=e=>{let[t,n]=(0,_.useState)(e);return(0,_.useEffect)(()=>{typeof window<`u`&&cd().then(e=>{if(e&&e!==rd)n(e);else{let e=localStorage.getItem(znn);e&&n(e)}})},[]),{agent:t,setAgent:e=>{n(e),!(typeof window>`u`)&&(e?.trim()?localStorage.setItem(znn,e):localStorage.removeItem(znn))}}},Vnn=({isActive:e,onToggleInspector:t,onSubmitAgent:n,onCancel:r,isAgentWorking:i,messages:a,status:o,inspectionCount:s=0,inspectionItems:l=[],onRemoveInspection:u=()=>{}})=>{let[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(``),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(`none`),[b,x]=(0,_.useState)(!1),[C,w]=(0,_.useState)(!1),[T,E]=(0,_.useState)(!0),{agent:D,setAgent:O}=Bnn(rd),[k,A]=(0,_.useState)(!1),j=nd.find(e=>e.name===D)||nd[0],{elementRef:M,isDragging:N,handleMouseDown:P}=Rnn(),[F,I]=(0,_.useState)(null),[L,R]=(0,_.useState)(``),ee=Lnn(L,i,50),[te,z]=(0,_.useState)(``),B=(0,_.useRef)(``),ne=(0,_.useRef)(``);(0,_.useEffect)(()=>{let e=ee,t=B.current;if(e.length<t.length||!e.startsWith(t)){z(e),B.current=e;return}if(e.length>t.length){let n=e.slice(t.length).trim();n&&z(n),B.current=e}},[ee]);let re=(0,_.useRef)(null),ie=(0,_.useRef)(null),ae=(0,_.useRef)(null),oe=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(a.length===0){R(``),g(null),ae.current=null,oe.current=!1,z(``),B.current=``;return}let e=a[a.length-1];if(e.role!==`assistant`)return;let t=Uce(e),{displayText:n,toolCall:r}=Gce(e,t||ae.current);R(n||``),t&&(ae.current=t),r?(ie.current&&=(clearTimeout(ie.current),null),g(r),oe.current=!0):oe.current=!1},[a]),(0,_.useEffect)(()=>{te!==ne.current&&(oe.current||g(null),ne.current=te)},[te]),(0,_.useEffect)(()=>{d&&re.current&&re.current.focus()},[d]),(0,_.useEffect)(()=>{if(!i&&C){x(!1),w(!1),E(!1);let e=setTimeout(()=>{E(!0)},2e3);return()=>clearTimeout(e)}},[i,C]),(0,_.useEffect)(()=>{function e(e){let{plan:t,inspectionId:n}=e.detail;if(t?.steps){let e=t.steps.find(e=>e.status===`in-progress`),r=t.steps.filter(e=>e.status===`completed`).length;I({id:n,status:`in-progress`,currentStep:e?{title:e.title,index:r+1,total:t.steps.length}:void 0})}}function t(e){let{status:t,result:n,inspectionId:r}=e.detail;I({id:r,status:t,message:n?.message||n})}return window.addEventListener(`plan-progress-reported`,e),window.addEventListener(`inspection-result-received`,t),()=>{window.removeEventListener(`plan-progress-reported`,e),window.removeEventListener(`inspection-result-received`,t)}},[]);let se=e=>{e.preventDefault(),p.trim()&&(ie.current&&=(clearTimeout(ie.current),null),g(null),R(``),z(``),I(null),ae.current=null,B.current=``,x(!0),w(!0),n(p,D),m(``),f(!0),y(`chat`))},ce=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),se(e)),e.key===`Escape`&&(f(!1),re.current?.blur())},le=o===`error`,ue=a.length>0,de=d&&!b,fe=(!d||b)&&(i||ue||F);return(0,S.jsxs)(`div`,{ref:M,className:nt(`fixed bottom-8 left-1/2 z-[999999]`,`transition-all duration-300 ease-[cubic-bezier(0.23,1,0.32,1)]`,d?`w-[450px]`:fe?`w-auto min-w-[200px] max-w-[450px]`:`w-[190px]`,N?`cursor-grabbing`:`cursor-grab`),onMouseDown:P,onMouseEnter:()=>{N||(i||C?(f(!0),y(`chat`)):T&&f(!0))},onMouseLeave:()=>{!p.trim()&&!C&&!N&&(f(!1),y(`none`)),E(!0)},children:[(0,S.jsxs)(`div`,{className:nt(`relative flex items-center backdrop-blur-xl shadow-2xl border border-border`,`transition-[width,height,padding,background-color,border-color] duration-200 ease-out`,d?`h-12 p-2 pl-4`:`h-9 px-2 py-1`,v===`none`?`bg-muted/90 rounded-full`:`bg-muted/95 rounded-b-lg rounded-t-none border-t-0`,le&&!d&&`bg-destructive/10 border-destructive/20`),children:[(0,S.jsxs)(`div`,{className:nt(`flex items-center transition-opacity duration-300 w-full relative`,de?`absolute left-3 opacity-0 pointer-events-none`:`relative opacity-100`),children:[!fe&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`flex items-center justify-center w-6 h-6 rounded-full bg-accent flex-shrink-0`,children:(0,S.jsx)(gi,{className:`w-3.5 h-3.5 text-foreground`})}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground/70 ml-3 whitespace-nowrap`,children:`⌥I or hover to inspect`})]}),fe&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-3 flex-shrink-0`,children:[(0,S.jsx)(`div`,{className:`relative flex items-center justify-center w-6 h-6 rounded-full bg-accent flex-shrink-0`,children:i?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`absolute inset-0 rounded-full border-2 border-current opacity-20 animate-ping text-foreground`}),(0,S.jsx)(gi,{className:`w-3.5 h-3.5 animate-pulse text-foreground`})]}):F?F.status===`in-progress`?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`absolute inset-0 rounded-full border-2 border-current opacity-20 animate-ping text-blue-500`}),(0,S.jsx)(vi,{className:`w-3.5 h-3.5 animate-pulse text-blue-500`})]}):F.status===`completed`?(0,S.jsx)(ai,{className:`w-5 h-5 text-green-500`}):(0,S.jsx)(oi,{className:`w-5 h-5 text-red-500`}):le?(0,S.jsx)(oi,{className:`w-5 h-5 text-red-500`}):(0,S.jsx)(ai,{className:`w-5 h-5 text-green-500`})}),(0,S.jsx)(`div`,{className:`w-px h-4 bg-border flex-shrink-0`})]}),(0,S.jsx)(`div`,{className:`flex-1 flex justify-center min-w-0 pl-2`,children:(0,S.jsx)(`div`,{className:`flex flex-col min-w-0 max-w-full pr-2 max-h-[24px] overflow-hidden`,children:F&&F.status===`in-progress`&&F.currentStep?(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm font-medium text-foreground min-w-0`,children:[(0,S.jsx)(vi,{className:`w-4 h-4 flex-shrink-0`}),(0,S.jsxs)(`span`,{className:`truncate min-w-0`,children:[`Step `,F.currentStep.index,`/`,F.currentStep.total,`: `,F.currentStep.title]})]}):F?.message?(0,S.jsx)(`div`,{className:`text-sm font-medium leading-[1.4] text-foreground truncate min-w-0`,children:F.message}):h?(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm font-medium text-foreground min-w-0`,children:[(0,S.jsx)(vi,{className:`w-4 h-4 flex-shrink-0`}),(0,S.jsx)(`span`,{className:`truncate min-w-0`,children:h})]}):(0,S.jsx)(`div`,{className:`text-sm font-medium leading-[1.4] text-foreground truncate min-w-0`,children:i&&!te?(0,S.jsx)(Bce,{duration:2,spread:2,children:o===`submitted`&&j?.command===`npx`?`Starting ${j.name}... This may take a moment.`:`Thinking...`}):te||`Processing...`})})})]})]}),(0,S.jsxs)(`div`,{className:nt(`flex items-center w-full gap-3 transition-all duration-500 delay-75`,de?`opacity-100 translate-y-0 relative pointer-events-auto`:`opacity-0 translate-y-4 pointer-events-none absolute top-2 left-4 right-2`),onClick:e=>e.stopPropagation(),children:[(0,S.jsx)(`button`,{onClick:t,className:nt(`relative flex items-center justify-center w-7 h-7 rounded-full transition-colors flex-shrink-0`,e?`bg-blue-500 text-white shadow-[0_0_15px_rgba(59,130,246,0.5)]`:`bg-accent text-muted-foreground hover:bg-accent/80 hover:text-foreground`),title:`Toggle Inspector (⌥I)`,children:(0,S.jsx)(li,{className:`w-3.5 h-3.5`})}),(0,S.jsx)(`div`,{className:`w-px h-4 bg-border flex-shrink-0`}),s>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>y(e=>e===`inspections`?`none`:`inspections`),className:nt(`relative flex items-center justify-center w-7 h-7 rounded-full transition-colors flex-shrink-0`,`hover:bg-accent/50`,v===`inspections`&&`bg-accent/50 text-foreground`),title:`View Inspections`,children:[(0,S.jsx)(ui,{className:`w-3.5 h-3.5`}),(0,S.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 flex items-center justify-center min-w-[12px] h-[12px] px-0.5 text-[8px] font-bold text-white bg-red-500 rounded-full border border-background shadow-sm leading-none`,children:s>99?`99+`:s})]}),(0,S.jsx)(`div`,{className:`w-px h-4 bg-border flex-shrink-0`})]}),(0,S.jsxs)(`form`,{onSubmit:se,className:`flex-1 flex items-center gap-2 min-w-0`,onClick:e=>e.stopPropagation(),children:[(0,S.jsxs)(`div`,{className:`relative flex-shrink-0`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>A(!k),className:`flex items-center justify-center w-7 h-7 rounded-full hover:bg-accent/50 transition-colors`,title:`Select Agent`,children:(0,S.jsx)(`img`,{src:nd.find(e=>e.name===D)?.meta?.icon,alt:D,className:`w-3.5 h-3.5`})}),k&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`fixed inset-0 z-[999998]`,onClick:()=>A(!1)}),(0,S.jsx)(`div`,{className:`absolute bottom-full left-0 mb-2 w-48 bg-popover border border-border rounded-lg shadow-lg overflow-hidden z-[999999] animate-in fade-in zoom-in-95 duration-200`,children:nd.map(e=>(0,S.jsxs)(`button`,{onClick:()=>{O(e.name),A(!1)},className:nt(`w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-accent transition-colors`,D===e.name&&`bg-accent/50 font-medium`),children:[e.meta?.icon&&(0,S.jsx)(`img`,{src:e.meta.icon,alt:``,className:`w-4 h-4`}),e.name]},e.name))})]})]}),(0,S.jsx)(`input`,{ref:re,type:`text`,value:p,onChange:e=>m(e.target.value),onKeyDown:ce,placeholder:`Ask ${D}...`,className:`w-full bg-transparent border-none outline-none text-foreground placeholder-muted-foreground text-sm h-7 disabled:opacity-50`,tabIndex:0,disabled:i}),(a.length>0||i||C)&&(0,S.jsx)(`button`,{type:`button`,onClick:()=>y(e=>e===`chat`?`none`:`chat`),className:nt(`flex items-center justify-center w-7 h-7 rounded-full transition-all flex-shrink-0`,v===`chat`?`bg-foreground text-background`:`bg-accent text-muted-foreground hover:bg-accent/80 hover:text-foreground`),title:v===`chat`?`Collapse`:`Expand messages`,children:(0,S.jsx)(ti,{className:nt(`w-3.5 h-3.5 transition-transform duration-300`,v===`chat`&&`rotate-180`)})}),i?(0,S.jsx)(`button`,{type:`button`,onClick:r,className:`flex items-center justify-center w-7 h-7 rounded-full bg-destructive text-destructive-foreground transition-all flex-shrink-0 hover:bg-destructive/90`,title:`Cancel request`,children:(0,S.jsx)(_i,{className:`w-3 h-3`})}):(0,S.jsx)(`button`,{type:`submit`,disabled:!p.trim(),className:nt(`flex items-center justify-center w-7 h-7 rounded-full transition-all flex-shrink-0`,p.trim()?`bg-foreground text-background scale-100`:`bg-accent text-muted-foreground/50 scale-90`),children:(0,S.jsx)(Qr,{className:`w-3.5 h-3.5`})})]})]})]}),v!==`none`&&(0,S.jsx)(`div`,{className:`absolute bottom-full left-0 right-0 pointer-events-auto max-w-[450px] mx-auto animate-panel-in`,children:(0,S.jsxs)(`div`,{className:`bg-muted/95 backdrop-blur-xl rounded-t-xl border border-border border-b-0 shadow-2xl overflow-hidden`,children:[v===`inspections`&&l.length>0&&(0,S.jsx)(`div`,{className:`border-b border-border`,children:(0,S.jsx)(ta,{items:l,onRemove:u})}),v===`chat`&&(0,S.jsx)(`div`,{className:`h-[500px]`,children:(0,S.jsx)(Inn,{messages:a,status:o,selectedAgent:D})})]})})]})};var Hnn=`vercel.ai.error`,Unn=Symbol.for(Hnn),Wnn,Gnn=class e extends Error{constructor({name:e,message:t,cause:n}){super(t),this[Wnn]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,Hnn)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}};Wnn=Unn;var W7=Gnn;function Knn(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.message:JSON.stringify(e)}var qnn=`AI_InvalidArgumentError`,Jnn=`vercel.ai.error.${qnn}`,Ynn=Symbol.for(Jnn),Xnn,Znn=class extends W7{constructor({message:e,cause:t,argument:n}){super({name:qnn,message:e,cause:t}),this[Xnn]=!0,this.argument=n}static isInstance(e){return W7.hasMarker(e,Jnn)}};Xnn=Ynn;var Qnn=`AI_JSONParseError`,$nn=`vercel.ai.error.${Qnn}`,ern=Symbol.for($nn),trn,nrn=class extends W7{constructor({text:e,cause:t}){super({name:Qnn,message:`JSON parsing failed: Text: ${e}.
6937
6937
  Error message: ${Knn(t)}`,cause:t}),this[trn]=!0,this.text=e}static isInstance(e){return W7.hasMarker(e,$nn)}};trn=ern;var rrn=`AI_TypeValidationError`,irn=`vercel.ai.error.${rrn}`,arn=Symbol.for(irn),orn,srn=class e extends W7{constructor({value:e,cause:t}){super({name:rrn,message:`Type validation failed: Value: ${JSON.stringify(e)}.
6938
6938
  Error message: ${Knn(t)}`,cause:t}),this[orn]=!0,this.value=e}static isInstance(e){return W7.hasMarker(e,irn)}static wrap({value:t,cause:n}){return e.isInstance(n)&&n.value===t?n:new e({value:t,cause:n})}};orn=arn;var G7=srn,crn=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n}={}){let r;super({start(i){r=Tl({onEvent:e=>{i.enqueue(e)},onError(t){e===`terminate`?i.error(t):typeof e==`function`&&e(t)},onRetry:t,onComment:n})},transform(e){r.feed(e)}})}};Object.freeze({status:`aborted`});function K7(e,t,n){function r(n,r){var i;for(let a in Object.defineProperty(n,`_zod`,{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r),o.prototype)a in n||Object.defineProperty(n,a,{value:o.prototype[a].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var q7=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};let lrn={};function J7(e){return e&&Object.assign(lrn,e),lrn}function urn(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function drn(e,t){return typeof t==`bigint`?t.toString():t}function frn(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function prn(e){return e==null}function mrn(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function hrn(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}function Y7(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}throw Error(`cached value already set`)},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function X7(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Z7(e){return JSON.stringify(e)}let grn=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Q7(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}let _rn=frn(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function $7(e){if(Q7(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(Q7(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}let vrn=new Set([`string`,`number`,`symbol`]);function e9(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function t9(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function n9(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function yrn(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}let brn={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function xrn(e,t){let n={},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=r.shape[e])}return t9(e,{...e._zod.def,shape:n,checks:[]})}function Srn(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return t9(e,{...e._zod.def,shape:n,checks:[]})}function Crn(e,t){if(!$7(t))throw Error(`Invalid input to extend: expected a plain object`);return t9(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return X7(this,`shape`,n),n},checks:[]})}function wrn(e,t){return t9(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return X7(this,`shape`,n),n},catchall:t._zod.def.catchall,checks:[]})}function Trn(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return t9(t,{...t._zod.def,shape:i,checks:[]})}function Ern(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return t9(t,{...t._zod.def,shape:i,checks:[]})}function r9(e,t=0){for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function i9(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function a9(e){return typeof e==`string`?e:e?.message}function o9(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=a9(e.inst?._zod.def?.error?.(e))??a9(t?.error?.(e))??a9(n.customError?.(e))??a9(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Drn(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function s9(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}let Orn=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),Object.defineProperty(e,`message`,{get(){return JSON.stringify(t,drn,2)},enumerable:!0}),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},krn=K7(`$ZodError`,Orn),Arn=K7(`$ZodError`,Orn,{Parent:Error});function jrn(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Mrn(e,t){let n=t||function(e){return e.message},r={_errors:[]},i=e=>{for(let t of e.issues)if(t.code===`invalid_union`&&t.errors.length)t.errors.map(e=>i({issues:e}));else if(t.code===`invalid_key`)i({issues:t.issues});else if(t.code===`invalid_element`)i({issues:t.issues});else if(t.path.length===0)r._errors.push(n(t));else{let e=r,i=0;for(;i<t.path.length;){let r=t.path[i];i===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],i++}}};return i(e),r}let Nrn=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new q7;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>o9(e,a,J7())));throw grn(t,i?.callee),t}return o.value},Prn=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>o9(e,a,J7())));throw grn(t,i?.callee),t}return o.value},Frn=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new q7;return a.issues.length?{success:!1,error:new(e??krn)(a.issues.map(e=>o9(e,i,J7())))}:{success:!0,data:a.value}},Irn=Frn(Arn),Lrn=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>o9(e,i,J7())))}:{success:!0,data:a.value}},Rrn=Lrn(Arn),zrn=/^[cC][^\s-]{8,}$/,Brn=/^[0-9a-z]+$/,Vrn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Hrn=/^[0-9a-vA-V]{20}$/,Urn=/^[A-Za-z0-9]{27}$/,Wrn=/^[a-zA-Z0-9_-]{21}$/,Grn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Krn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,qrn=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,Jrn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function Yrn(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}let Xrn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Zrn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Qrn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,$rn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ein=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tin=/^[A-Za-z0-9_-]*$/,nin=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,rin=/^\+(?:[0-9]){6,14}[0-9]$/,iin=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,ain=RegExp(`^${iin}$`);function oin(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function sin(e){return RegExp(`^${oin(e)}$`)}function cin(e){let t=oin({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-]\\d{2}:\\d{2})`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${iin}T(?:${r})$`)}let lin=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},uin=/^\d+$/,din=/^-?\d+(?:\.\d+)?/i,fin=/true|false/i,pin=/null/i,min=/^[^A-Z]*$/,hin=/^[^a-z]*$/,c9=K7(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),gin={number:`number`,bigint:`bigint`,object:`date`},_in=K7(`$ZodCheckLessThan`,(e,t)=>{c9.init(e,t);let n=gin[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vin=K7(`$ZodCheckGreaterThan`,(e,t)=>{c9.init(e,t);let n=gin[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),yin=K7(`$ZodCheckMultipleOf`,(e,t)=>{c9.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):hrn(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),bin=K7(`$ZodCheckNumberFormat`,(e,t)=>{c9.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=brn[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=uin)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inst:e})}}),xin=K7(`$ZodCheckMaxLength`,(e,t)=>{var n;c9.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!prn(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Drn(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Sin=K7(`$ZodCheckMinLength`,(e,t)=>{var n;c9.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!prn(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Drn(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Cin=K7(`$ZodCheckLengthEquals`,(e,t)=>{var n;c9.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!prn(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Drn(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),l9=K7(`$ZodCheckStringFormat`,(e,t)=>{var n,r;c9.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),win=K7(`$ZodCheckRegex`,(e,t)=>{l9.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Tin=K7(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=min,l9.init(e,t)}),Ein=K7(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=hin,l9.init(e,t)}),Din=K7(`$ZodCheckIncludes`,(e,t)=>{c9.init(e,t);let n=e9(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Oin=K7(`$ZodCheckStartsWith`,(e,t)=>{c9.init(e,t);let n=RegExp(`^${e9(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),kin=K7(`$ZodCheckEndsWith`,(e,t)=>{c9.init(e,t);let n=RegExp(`.*${e9(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Ain=K7(`$ZodCheckOverwrite`,(e,t)=>{c9.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var jin=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
6939
6939
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
package/dist/cli.cjs CHANGED
@@ -5,9 +5,9 @@ let node_http = require("node:http");
5
5
  node_http = require_chunk.__toESM(node_http);
6
6
  let fs = require("fs");
7
7
  let path = require("path");
8
- let __babel_parser = require("@babel/parser");
9
- let __babel_traverse = require("@babel/traverse");
10
- __babel_traverse = require_chunk.__toESM(__babel_traverse);
8
+ let _babel_parser = require("@babel/parser");
9
+ let _babel_traverse = require("@babel/traverse");
10
+ _babel_traverse = require_chunk.__toESM(_babel_traverse);
11
11
  let magic_string = require("magic-string");
12
12
  magic_string = require_chunk.__toESM(magic_string);
13
13
 
@@ -182,7 +182,7 @@ function detectConfigByPath(configPath) {
182
182
 
183
183
  //#endregion
184
184
  //#region src/utils/codemod-transformer.ts
185
- const traverse = __babel_traverse.default.default || __babel_traverse.default;
185
+ const traverse = _babel_traverse.default.default || _babel_traverse.default;
186
186
  const PLUGIN_IMPORT = "@mcpc-tech/unplugin-dev-inspector-mcp";
187
187
  const PLUGIN_VAR_NAME = "DevInspector";
188
188
  /**
@@ -204,7 +204,7 @@ function transformViteConfig(options) {
204
204
  message: "DevInspector is already configured in this file"
205
205
  };
206
206
  const s = new magic_string.default(code);
207
- const ast = (0, __babel_parser.parse)(code, {
207
+ const ast = (0, _babel_parser.parse)(code, {
208
208
  sourceType: "module",
209
209
  plugins: ["typescript", "jsx"]
210
210
  });
@@ -275,7 +275,7 @@ function transformWebpackConfig(options) {
275
275
  };
276
276
  const s = new magic_string.default(code);
277
277
  const isESM = code.includes("import ") && !code.includes("require(");
278
- const ast = (0, __babel_parser.parse)(code, {
278
+ const ast = (0, _babel_parser.parse)(code, {
279
279
  sourceType: "module",
280
280
  plugins: ["typescript"]
281
281
  });
@@ -338,7 +338,7 @@ function transformNextConfig(options) {
338
338
  message: "DevInspector is already configured in this file"
339
339
  };
340
340
  const s = new magic_string.default(code);
341
- const ast = (0, __babel_parser.parse)(code, {
341
+ const ast = (0, _babel_parser.parse)(code, {
342
342
  sourceType: "module",
343
343
  plugins: ["typescript"]
344
344
  });