@kaitranntt/ccs 6.5.0-dev.7 → 6.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION +1 -1
- package/dist/ccs.js +4 -7
- package/dist/ccs.js.map +1 -1
- package/dist/cliproxy/binary-manager.d.ts +2 -16
- package/dist/cliproxy/binary-manager.d.ts.map +1 -1
- package/dist/cliproxy/binary-manager.js +15 -39
- package/dist/cliproxy/binary-manager.js.map +1 -1
- package/dist/cliproxy/cliproxy-executor.d.ts.map +1 -1
- package/dist/cliproxy/cliproxy-executor.js +0 -4
- package/dist/cliproxy/cliproxy-executor.js.map +1 -1
- package/dist/cliproxy/config-generator.d.ts +1 -7
- package/dist/cliproxy/config-generator.d.ts.map +1 -1
- package/dist/cliproxy/config-generator.js +9 -30
- package/dist/cliproxy/config-generator.js.map +1 -1
- package/dist/cliproxy/service-manager.d.ts.map +1 -1
- package/dist/cliproxy/service-manager.js +0 -4
- package/dist/cliproxy/service-manager.js.map +1 -1
- package/dist/cliproxy/stats-fetcher.d.ts +0 -24
- package/dist/cliproxy/stats-fetcher.d.ts.map +1 -1
- package/dist/cliproxy/stats-fetcher.js +1 -56
- package/dist/cliproxy/stats-fetcher.js.map +1 -1
- package/dist/commands/cleanup-command.d.ts +0 -1
- package/dist/commands/cleanup-command.d.ts.map +1 -1
- package/dist/commands/cleanup-command.js +10 -158
- package/dist/commands/cleanup-command.js.map +1 -1
- package/dist/commands/update-command.d.ts +1 -1
- package/dist/commands/update-command.d.ts.map +1 -1
- package/dist/commands/update-command.js +132 -24
- package/dist/commands/update-command.js.map +1 -1
- package/dist/config/unified-config-loader.d.ts +1 -6
- package/dist/config/unified-config-loader.d.ts.map +1 -1
- package/dist/config/unified-config-loader.js +1 -35
- package/dist/config/unified-config-loader.js.map +1 -1
- package/dist/config/unified-config-types.d.ts +0 -18
- package/dist/config/unified-config-types.d.ts.map +1 -1
- package/dist/config/unified-config-types.js +1 -14
- package/dist/config/unified-config-types.js.map +1 -1
- package/dist/copilot/copilot-executor.d.ts.map +1 -1
- package/dist/copilot/copilot-executor.js +1 -6
- package/dist/copilot/copilot-executor.js.map +1 -1
- package/dist/ui/assets/accounts-OHf-47mH.js +1 -0
- package/dist/ui/assets/analytics-C4uOxyuU.js +1 -0
- package/dist/ui/assets/api-B_mbwU9C.js +1 -0
- package/dist/ui/assets/{card-tk5ihPK8.js → card-CR0u1y_L.js} +1 -1
- package/dist/ui/assets/{charts-B9Jh-s-X.js → charts-D_0N6JY8.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-BzhsXWKa.js → cliproxy-control-panel-DIIw97Bs.js} +1 -1
- package/dist/ui/assets/cliproxy-tXwMpEJd.js +1 -0
- package/dist/ui/assets/{code-editor-rSl_-6ob.js → code-editor-CVohe7u9.js} +1 -1
- package/dist/ui/assets/{code-highlight-BoHWVYut.js → code-highlight-C2TXE0-z.js} +1 -1
- package/dist/ui/assets/copilot-C-eWI9Ce.js +4 -0
- package/dist/ui/assets/{form-utils-BuXDJb0w.js → form-utils-BXvNPyud.js} +1 -1
- package/dist/ui/assets/{health-ByL12ZVZ.js → health-Dh8bSHe-.js} +1 -1
- package/dist/ui/assets/icons-WTNLz24z.js +1 -0
- package/dist/ui/assets/index-BXPLu3zJ.js +44 -0
- package/dist/ui/assets/index-D2qNwUdc.css +1 -0
- package/dist/ui/assets/{notifications-B2Pz7lik.js → notifications-cqk-Qeo2.js} +1 -1
- package/dist/ui/assets/{radix-ui-DFHQr9A5.js → radix-ui-VbLlN_Dz.js} +1 -1
- package/dist/ui/assets/react-vendor-DMek_JCF.js +3 -0
- package/dist/ui/assets/settings-Bi8Aw4yN.js +1 -0
- package/dist/ui/assets/{shared-CojMqcSc.js → shared-DQlPCpix.js} +1 -1
- package/dist/ui/assets/{switch-BQbPcCIQ.js → switch-pOvJh4Ez.js} +1 -1
- package/dist/ui/assets/{tanstack-C4gT2P7V.js → tanstack-yybD444-.js} +1 -1
- package/dist/ui/index.html +9 -9
- package/dist/utils/package-manager-detector.d.ts +4 -1
- package/dist/utils/package-manager-detector.d.ts.map +1 -1
- package/dist/utils/package-manager-detector.js +61 -2
- package/dist/utils/package-manager-detector.js.map +1 -1
- package/dist/web-server/routes.d.ts.map +1 -1
- package/dist/web-server/routes.js +2 -141
- package/dist/web-server/routes.js.map +1 -1
- package/package.json +1 -1
- package/scripts/worker.js +38 -18
- package/dist/ui/assets/accounts-C1DiBVWf.js +0 -1
- package/dist/ui/assets/analytics-34-9qi4o.js +0 -1
- package/dist/ui/assets/api-Lcsxd42l.js +0 -1
- package/dist/ui/assets/cliproxy-lpz8UdFt.js +0 -1
- package/dist/ui/assets/copilot-Djc29_O8.js +0 -4
- package/dist/ui/assets/icons-U_6eBV_J.js +0 -1
- package/dist/ui/assets/index-CeV2P3Sp.css +0 -1
- package/dist/ui/assets/index-c9idYjfn.js +0 -48
- package/dist/ui/assets/react-vendor-FspHSO0w.js +0 -3
- package/dist/ui/assets/settings-BzHi9yIP.js +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
function at(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const u=Object.getOwnPropertyDescriptor(n,i);u&&Object.defineProperty(e,i,u.get?u:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Mr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ne(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ce={exports:{}},R={};var Se;function ot(){if(Se)return R;Se=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),s=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),a=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),m=Symbol.iterator;function v(o){return o===null||typeof o!="object"?null:(o=m&&o[m]||o["@@iterator"],typeof o=="function"?o:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,y={};function g(o,p,_){this.props=o,this.context=p,this.refs=y,this.updater=_||w}g.prototype.isReactComponent={},g.prototype.setState=function(o,p){if(typeof o!="object"&&typeof o!="function"&&o!=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,o,p,"setState")},g.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};function E(){}E.prototype=g.prototype;function P(o,p,_){this.props=o,this.context=p,this.refs=y,this.updater=_||w}var $=P.prototype=new E;$.constructor=P,S($,g.prototype),$.isPureReactComponent=!0;var A=Array.isArray;function H(){}var x={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function U(o,p,_){var C=_.ref;return{$$typeof:e,type:o,key:p,ref:C!==void 0?C:null,props:_}}function M(o,p){return U(o.type,p,o.props)}function Y(o){return typeof o=="object"&&o!==null&&o.$$typeof===e}function te(o){var p={"=":"=0",":":"=2"};return"$"+o.replace(/[=:]/g,function(_){return p[_]})}var Ce=/\/+/g;function se(o,p){return typeof o=="object"&&o!==null&&o.key!=null?te(""+o.key):p.toString(36)}function et(o){switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:switch(typeof o.status=="string"?o.then(H,H):(o.status="pending",o.then(function(p){o.status==="pending"&&(o.status="fulfilled",o.value=p)},function(p){o.status==="pending"&&(o.status="rejected",o.reason=p)})),o.status){case"fulfilled":return o.value;case"rejected":throw o.reason}}throw o}function K(o,p,_,C,b){var T=typeof o;(T==="undefined"||T==="boolean")&&(o=null);var L=!1;if(o===null)L=!0;else switch(T){case"bigint":case"string":case"number":L=!0;break;case"object":switch(o.$$typeof){case e:case t:L=!0;break;case d:return L=o._init,K(L(o._payload),p,_,C,b)}}if(L)return b=b(o),L=C===""?"."+se(o,0):C,A(b)?(_="",L!=null&&(_=L.replace(Ce,"$&/")+"/"),K(b,p,_,"",function(nt){return nt})):b!=null&&(Y(b)&&(b=M(b,_+(b.key==null||o&&o.key===b.key?"":(""+b.key).replace(Ce,"$&/")+"/")+L)),p.push(b)),1;L=0;var F=C===""?".":C+":";if(A(o))for(var N=0;N<o.length;N++)C=o[N],T=F+se(C,N),L+=K(C,p,_,T,b);else if(N=v(o),typeof N=="function")for(o=N.call(o),N=0;!(C=o.next()).done;)C=C.value,T=F+se(C,N++),L+=K(C,p,_,T,b);else if(T==="object"){if(typeof o.then=="function")return K(et(o),p,_,C,b);throw p=String(o),Error("Objects are not valid as a React child (found: "+(p==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":p)+"). If you meant to render a collection of children, use an array instead.")}return L}function re(o,p,_){if(o==null)return o;var C=[],b=0;return K(o,C,"","",function(T){return p.call(_,T,b++)}),C}function tt(o){if(o._status===-1){var p=o._result;p=p(),p.then(function(_){(o._status===0||o._status===-1)&&(o._status=1,o._result=_)},function(_){(o._status===0||o._status===-1)&&(o._status=2,o._result=_)}),o._status===-1&&(o._status=0,o._result=p)}if(o._status===1)return o._result.default;throw o._result}var _e=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var p=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(p))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},rt={map:re,forEach:function(o,p,_){re(o,function(){p.apply(this,arguments)},_)},count:function(o){var p=0;return re(o,function(){p++}),p},toArray:function(o){return re(o,function(p){return p})||[]},only:function(o){if(!Y(o))throw Error("React.Children.only expected to receive a single React element child.");return o}};return R.Activity=h,R.Children=rt,R.Component=g,R.Fragment=r,R.Profiler=i,R.PureComponent=P,R.StrictMode=n,R.Suspense=l,R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,R.__COMPILER_RUNTIME={__proto__:null,c:function(o){return x.H.useMemoCache(o)}},R.cache=function(o){return function(){return o.apply(null,arguments)}},R.cacheSignal=function(){return null},R.cloneElement=function(o,p,_){if(o==null)throw Error("The argument must be a React element, but you passed "+o+".");var C=S({},o.props),b=o.key;if(p!=null)for(T in p.key!==void 0&&(b=""+p.key),p)!q.call(p,T)||T==="key"||T==="__self"||T==="__source"||T==="ref"&&p.ref===void 0||(C[T]=p[T]);var T=arguments.length-2;if(T===1)C.children=_;else if(1<T){for(var L=Array(T),F=0;F<T;F++)L[F]=arguments[F+2];C.children=L}return U(o.type,b,C)},R.createContext=function(o){return o={$$typeof:s,_currentValue:o,_currentValue2:o,_threadCount:0,Provider:null,Consumer:null},o.Provider=o,o.Consumer={$$typeof:u,_context:o},o},R.createElement=function(o,p,_){var C,b={},T=null;if(p!=null)for(C in p.key!==void 0&&(T=""+p.key),p)q.call(p,C)&&C!=="key"&&C!=="__self"&&C!=="__source"&&(b[C]=p[C]);var L=arguments.length-2;if(L===1)b.children=_;else if(1<L){for(var F=Array(L),N=0;N<L;N++)F[N]=arguments[N+2];b.children=F}if(o&&o.defaultProps)for(C in L=o.defaultProps,L)b[C]===void 0&&(b[C]=L[C]);return U(o,T,b)},R.createRef=function(){return{current:null}},R.forwardRef=function(o){return{$$typeof:f,render:o}},R.isValidElement=Y,R.lazy=function(o){return{$$typeof:d,_payload:{_status:-1,_result:o},_init:tt}},R.memo=function(o,p){return{$$typeof:a,type:o,compare:p===void 0?null:p}},R.startTransition=function(o){var p=x.T,_={};x.T=_;try{var C=o(),b=x.S;b!==null&&b(_,C),typeof C=="object"&&C!==null&&typeof C.then=="function"&&C.then(H,_e)}catch(T){_e(T)}finally{p!==null&&_.types!==null&&(p.types=_.types),x.T=p}},R.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},R.use=function(o){return x.H.use(o)},R.useActionState=function(o,p,_){return x.H.useActionState(o,p,_)},R.useCallback=function(o,p){return x.H.useCallback(o,p)},R.useContext=function(o){return x.H.useContext(o)},R.useDebugValue=function(){},R.useDeferredValue=function(o,p){return x.H.useDeferredValue(o,p)},R.useEffect=function(o,p){return x.H.useEffect(o,p)},R.useEffectEvent=function(o){return x.H.useEffectEvent(o)},R.useId=function(){return x.H.useId()},R.useImperativeHandle=function(o,p,_){return x.H.useImperativeHandle(o,p,_)},R.useInsertionEffect=function(o,p){return x.H.useInsertionEffect(o,p)},R.useLayoutEffect=function(o,p){return x.H.useLayoutEffect(o,p)},R.useMemo=function(o,p){return x.H.useMemo(o,p)},R.useOptimistic=function(o,p){return x.H.useOptimistic(o,p)},R.useReducer=function(o,p,_){return x.H.useReducer(o,p,_)},R.useRef=function(o){return x.H.useRef(o)},R.useState=function(o){return x.H.useState(o)},R.useSyncExternalStore=function(o,p,_){return x.H.useSyncExternalStore(o,p,_)},R.useTransition=function(){return x.H.useTransition()},R.version="19.2.1",R}var Pe;function De(){return Pe||(Pe=1,ce.exports=ot()),ce.exports}var c=De();const it=Ne(c),Ir=at({__proto__:null,default:it},[c]);var fe={exports:{}},k={};var xe;function ut(){if(xe)return k;xe=1;var e=De();function t(l){var a="https://react.dev/errors/"+l;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+l+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},i=Symbol.for("react.portal");function u(l,a,d){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:h==null?null:""+h,children:l,containerInfo:a,implementation:d}}var s=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(l,a){if(l==="font")return"";if(typeof a=="string")return a==="use-credentials"?a:""}return k.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,k.createPortal=function(l,a){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)throw Error(t(299));return u(l,a,null,d)},k.flushSync=function(l){var a=s.T,d=n.p;try{if(s.T=null,n.p=2,l)return l()}finally{s.T=a,n.p=d,n.d.f()}},k.preconnect=function(l,a){typeof l=="string"&&(a?(a=a.crossOrigin,a=typeof a=="string"?a==="use-credentials"?a:"":void 0):a=null,n.d.C(l,a))},k.prefetchDNS=function(l){typeof l=="string"&&n.d.D(l)},k.preinit=function(l,a){if(typeof l=="string"&&a&&typeof a.as=="string"){var d=a.as,h=f(d,a.crossOrigin),m=typeof a.integrity=="string"?a.integrity:void 0,v=typeof a.fetchPriority=="string"?a.fetchPriority:void 0;d==="style"?n.d.S(l,typeof a.precedence=="string"?a.precedence:void 0,{crossOrigin:h,integrity:m,fetchPriority:v}):d==="script"&&n.d.X(l,{crossOrigin:h,integrity:m,fetchPriority:v,nonce:typeof a.nonce=="string"?a.nonce:void 0})}},k.preinitModule=function(l,a){if(typeof l=="string")if(typeof a=="object"&&a!==null){if(a.as==null||a.as==="script"){var d=f(a.as,a.crossOrigin);n.d.M(l,{crossOrigin:d,integrity:typeof a.integrity=="string"?a.integrity:void 0,nonce:typeof a.nonce=="string"?a.nonce:void 0})}}else a==null&&n.d.M(l)},k.preload=function(l,a){if(typeof l=="string"&&typeof a=="object"&&a!==null&&typeof a.as=="string"){var d=a.as,h=f(d,a.crossOrigin);n.d.L(l,d,{crossOrigin:h,integrity:typeof a.integrity=="string"?a.integrity:void 0,nonce:typeof a.nonce=="string"?a.nonce:void 0,type:typeof a.type=="string"?a.type:void 0,fetchPriority:typeof a.fetchPriority=="string"?a.fetchPriority:void 0,referrerPolicy:typeof a.referrerPolicy=="string"?a.referrerPolicy:void 0,imageSrcSet:typeof a.imageSrcSet=="string"?a.imageSrcSet:void 0,imageSizes:typeof a.imageSizes=="string"?a.imageSizes:void 0,media:typeof a.media=="string"?a.media:void 0})}},k.preloadModule=function(l,a){if(typeof l=="string")if(a){var d=f(a.as,a.crossOrigin);n.d.m(l,{as:typeof a.as=="string"&&a.as!=="script"?a.as:void 0,crossOrigin:d,integrity:typeof a.integrity=="string"?a.integrity:void 0})}else n.d.m(l)},k.requestFormReset=function(l){n.d.r(l)},k.unstable_batchedUpdates=function(l,a){return l(a)},k.useFormState=function(l,a,d){return s.H.useFormState(l,a,d)},k.useFormStatus=function(){return s.H.useHostTransitionStatus()},k.version="19.2.1",k}var be;function lt(){if(be)return fe.exports;be=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),fe.exports=ut(),fe.exports}var Te="popstate";function st(e={}){function t(n,i){let{pathname:u,search:s,hash:f}=n.location;return pe("",{pathname:u,search:s,hash:f},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:X(i)}return ft(t,r,null,e)}function O(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function D(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ct(){return Math.random().toString(36).substring(2,10)}function Le(e,t){return{usr:e.state,key:e.key,idx:t}}function pe(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?V(t):t,state:r,key:t&&t.key||n||ct()}}function X({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function V(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function ft(e,t,r,n={}){let{window:i=document.defaultView,v5Compat:u=!1}=n,s=i.history,f="POP",l=null,a=d();a==null&&(a=0,s.replaceState({...s.state,idx:a},""));function d(){return(s.state||{idx:null}).idx}function h(){f="POP";let y=d(),g=y==null?null:y-a;a=y,l&&l({action:f,location:S.location,delta:g})}function m(y,g){f="PUSH";let E=pe(S.location,y,g);a=d()+1;let P=Le(E,a),$=S.createHref(E);try{s.pushState(P,"",$)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;i.location.assign($)}u&&l&&l({action:f,location:S.location,delta:1})}function v(y,g){f="REPLACE";let E=pe(S.location,y,g);a=d();let P=Le(E,a),$=S.createHref(E);s.replaceState(P,"",$),u&&l&&l({action:f,location:S.location,delta:0})}function w(y){return dt(y)}let S={get action(){return f},get location(){return e(i,s)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Te,h),l=y,()=>{i.removeEventListener(Te,h),l=null}},createHref(y){return t(i,y)},createURL:w,encodeLocation(y){let g=w(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:m,replace:v,go(y){return s.go(y)}};return S}function dt(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),O(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:X(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}function Me(e,t,r="/"){return ht(e,t,r,!1)}function ht(e,t,r,n){let i=typeof t=="string"?V(t):t,u=W(i.pathname||"/",r);if(u==null)return null;let s=Ie(e);pt(s);let f=null;for(let l=0;f==null&&l<s.length;++l){let a=Pt(u);f=_t(s[l],a,n)}return f}function Ie(e,t=[],r=[],n="",i=!1){let u=(s,f,l=i,a)=>{let d={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:f,route:s};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(n)&&l)return;O(d.relativePath.startsWith(n),`Absolute route path "${d.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(n.length)}let h=B([n,d.relativePath]),m=r.concat(d);s.children&&s.children.length>0&&(O(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),Ie(s.children,t,m,h,l)),!(s.path==null&&!s.index)&&t.push({path:h,score:wt(h,s.index),routesMeta:m})};return e.forEach((s,f)=>{if(s.path===""||!s.path?.includes("?"))u(s,f);else for(let l of He(s.path))u(s,f,!0,l)}),t}function He(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),u=r.replace(/\?$/,"");if(n.length===0)return i?[u,""]:[u];let s=He(n.join("/")),f=[];return f.push(...s.map(l=>l===""?u:[u,l].join("/"))),i&&f.push(...s),f.map(l=>e.startsWith("/")&&l===""?"/":l)}function pt(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Ct(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var mt=/^:[\w-]+$/,yt=3,gt=2,vt=1,Et=10,Rt=-2,Oe=e=>e==="*";function wt(e,t){let r=e.split("/"),n=r.length;return r.some(Oe)&&(n+=Rt),t&&(n+=gt),r.filter(i=>!Oe(i)).reduce((i,u)=>i+(mt.test(u)?yt:u===""?vt:Et),n)}function Ct(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function _t(e,t,r=!1){let{routesMeta:n}=e,i={},u="/",s=[];for(let f=0;f<n.length;++f){let l=n[f],a=f===n.length-1,d=u==="/"?t:t.slice(u.length)||"/",h=ie({path:l.relativePath,caseSensitive:l.caseSensitive,end:a},d),m=l.route;if(!h&&a&&r&&!n[n.length-1].route.index&&(h=ie({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!h)return null;Object.assign(i,h.params),s.push({params:i,pathname:B([u,h.pathname]),pathnameBase:Ot(B([u,h.pathnameBase])),route:m}),h.pathnameBase!=="/"&&(u=B([u,h.pathnameBase]))}return s}function ie(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=St(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let u=i[0],s=u.replace(/(.)\/+$/,"$1"),f=i.slice(1);return{params:n.reduce((a,{paramName:d,isOptional:h},m)=>{if(d==="*"){let w=f[m]||"";s=u.slice(0,u.length-w.length).replace(/(.)\/+$/,"$1")}const v=f[m];return h&&!v?a[d]=void 0:a[d]=(v||"").replace(/%2F/g,"/"),a},{}),pathname:u,pathnameBase:s,pattern:e}}function St(e,t=!1,r=!0){D(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,f,l)=>(n.push({paramName:f,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function Pt(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return D(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function W(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}var xt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bt=e=>xt.test(e);function Tt(e,t="/"){let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?V(e):e,u;if(r)if(bt(r))u=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),D(!1,`Pathnames cannot have embedded double slashes - normalizing ${s} -> ${r}`)}r.startsWith("/")?u=$e(r.substring(1),"/"):u=$e(r,t)}else u=t;return{pathname:u,search:$t(n),hash:kt(i)}}function $e(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function de(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Lt(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ue(e){let t=Lt(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function Fe(e,t,r,n=!1){let i;typeof e=="string"?i=V(e):(i={...e},O(!i.pathname||!i.pathname.includes("?"),de("?","pathname","search",i)),O(!i.pathname||!i.pathname.includes("#"),de("#","pathname","hash",i)),O(!i.search||!i.search.includes("#"),de("#","search","hash",i)));let u=e===""||i.pathname==="",s=u?"/":i.pathname,f;if(s==null)f=r;else{let h=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),h-=1;i.pathname=m.join("/")}f=h>=0?t[h]:"/"}let l=Tt(i,f),a=s&&s!=="/"&&s.endsWith("/"),d=(u||s===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(a||d)&&(l.pathname+="/"),l}var B=e=>e.join("/").replace(/\/\/+/g,"/"),Ot=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$t=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,kt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function At(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Nt(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var je=["POST","PUT","PATCH","DELETE"];new Set(je);var Dt=["GET",...je];new Set(Dt);var G=c.createContext(null);G.displayName="DataRouter";var ue=c.createContext(null);ue.displayName="DataRouterState";c.createContext(!1);var Be=c.createContext({isTransitioning:!1});Be.displayName="ViewTransition";var Mt=c.createContext(new Map);Mt.displayName="Fetchers";var It=c.createContext(null);It.displayName="Await";var I=c.createContext(null);I.displayName="Navigation";var Q=c.createContext(null);Q.displayName="Location";var j=c.createContext({outlet:null,matches:[],isDataRoute:!1});j.displayName="Route";var ge=c.createContext(null);ge.displayName="RouteError";function Ht(e,{relative:t}={}){O(Z(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=c.useContext(I),{hash:i,pathname:u,search:s}=ee(e,{relative:t}),f=u;return r!=="/"&&(f=u==="/"?r:B([r,u])),n.createHref({pathname:f,search:s,hash:i})}function Z(){return c.useContext(Q)!=null}function z(){return O(Z(),"useLocation() may be used only in the context of a <Router> component."),c.useContext(Q).location}var We="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ye(e){c.useContext(I).static||c.useLayoutEffect(e)}function ze(){let{isDataRoute:e}=c.useContext(j);return e?Zt():Ut()}function Ut(){O(Z(),"useNavigate() may be used only in the context of a <Router> component.");let e=c.useContext(G),{basename:t,navigator:r}=c.useContext(I),{matches:n}=c.useContext(j),{pathname:i}=z(),u=JSON.stringify(Ue(n)),s=c.useRef(!1);return Ye(()=>{s.current=!0}),c.useCallback((l,a={})=>{if(D(s.current,We),!s.current)return;if(typeof l=="number"){r.go(l);return}let d=Fe(l,JSON.parse(u),i,a.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:B([t,d.pathname])),(a.replace?r.replace:r.push)(d,a.state,a)},[t,r,u,i,e])}var Ft=c.createContext(null);function jt(e){let t=c.useContext(j).outlet;return c.useMemo(()=>t&&c.createElement(Ft.Provider,{value:e},t),[t,e])}function ee(e,{relative:t}={}){let{matches:r}=c.useContext(j),{pathname:n}=z(),i=JSON.stringify(Ue(r));return c.useMemo(()=>Fe(e,JSON.parse(i),n,t==="path"),[e,i,n,t])}function Bt(e,t){return qe(e,t)}function qe(e,t,r,n,i){O(Z(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=c.useContext(I),{matches:s}=c.useContext(j),f=s[s.length-1],l=f?f.params:{},a=f?f.pathname:"/",d=f?f.pathnameBase:"/",h=f&&f.route;{let E=h&&h.path||"";Ke(a,!h||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${a}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
|
-
|
|
3
|
-
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let m=z(),v;if(t){let E=typeof t=="string"?V(t):t;O(d==="/"||E.pathname?.startsWith(d),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${E.pathname}" was given in the \`location\` prop.`),v=E}else v=m;let w=v.pathname||"/",S=w;if(d!=="/"){let E=d.replace(/^\//,"").split("/");S="/"+w.replace(/^\//,"").split("/").slice(E.length).join("/")}let y=Me(e,{pathname:S});D(h||y!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),D(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=Kt(y&&y.map(E=>Object.assign({},E,{params:Object.assign({},l,E.params),pathname:B([d,u.encodeLocation?u.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?d:B([d,u.encodeLocation?u.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),s,r,n,i);return t&&g?c.createElement(Q.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},g):g}function Wt(){let e=Qt(),t=At(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:n},u={padding:"2px 4px",backgroundColor:n},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=c.createElement(c.Fragment,null,c.createElement("p",null,"💿 Hey developer 👋"),c.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",c.createElement("code",{style:u},"ErrorBoundary")," or"," ",c.createElement("code",{style:u},"errorElement")," prop on your route.")),c.createElement(c.Fragment,null,c.createElement("h2",null,"Unexpected Application Error!"),c.createElement("h3",{style:{fontStyle:"italic"}},t),r?c.createElement("pre",{style:i},r):null,s)}var Yt=c.createElement(Wt,null),zt=class extends c.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?c.createElement(j.Provider,{value:this.props.routeContext},c.createElement(ge.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function qt({routeContext:e,match:t,children:r}){let n=c.useContext(G);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),c.createElement(j.Provider,{value:e},r)}function Kt(e,t=[],r=null,n=null,i=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let u=e,s=r?.errors;if(s!=null){let d=u.findIndex(h=>h.route.id&&s?.[h.route.id]!==void 0);O(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),u=u.slice(0,Math.min(u.length,d+1))}let f=!1,l=-1;if(r)for(let d=0;d<u.length;d++){let h=u[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(l=d),h.route.id){let{loaderData:m,errors:v}=r,w=h.route.loader&&!m.hasOwnProperty(h.route.id)&&(!v||v[h.route.id]===void 0);if(h.route.lazy||w){f=!0,l>=0?u=u.slice(0,l+1):u=[u[0]];break}}}let a=r&&n?(d,h)=>{n(d,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:Nt(r.matches),errorInfo:h})}:void 0;return u.reduceRight((d,h,m)=>{let v,w=!1,S=null,y=null;r&&(v=s&&h.route.id?s[h.route.id]:void 0,S=h.route.errorElement||Yt,f&&(l<0&&m===0?(Ke("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,y=null):l===m&&(w=!0,y=h.route.hydrateFallbackElement||null)));let g=t.concat(u.slice(0,m+1)),E=()=>{let P;return v?P=S:w?P=y:h.route.Component?P=c.createElement(h.route.Component,null):h.route.element?P=h.route.element:P=d,c.createElement(qt,{match:h,routeContext:{outlet:d,matches:g,isDataRoute:r!=null},children:P})};return r&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?c.createElement(zt,{location:r.location,revalidation:r.revalidation,component:S,error:v,children:E(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:a}):E()},null)}function ve(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vt(e){let t=c.useContext(G);return O(t,ve(e)),t}function Gt(e){let t=c.useContext(ue);return O(t,ve(e)),t}function Jt(e){let t=c.useContext(j);return O(t,ve(e)),t}function Ee(e){let t=Jt(e),r=t.matches[t.matches.length-1];return O(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Xt(){return Ee("useRouteId")}function Qt(){let e=c.useContext(ge),t=Gt("useRouteError"),r=Ee("useRouteError");return e!==void 0?e:t.errors?.[r]}function Zt(){let{router:e}=Vt("useNavigate"),t=Ee("useNavigate"),r=c.useRef(!1);return Ye(()=>{r.current=!0}),c.useCallback(async(i,u={})=>{D(r.current,We),r.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...u}))},[e,t])}var ke={};function Ke(e,t,r){!t&&!ke[e]&&(ke[e]=!0,D(!1,r))}c.memo(er);function er({routes:e,future:t,state:r,unstable_onError:n}){return qe(e,void 0,r,n,t)}function Hr(e){return jt(e.context)}function tr(e){O(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function rr({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:i,static:u=!1,unstable_useTransitions:s}){O(!Z(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),l=c.useMemo(()=>({basename:f,navigator:i,static:u,unstable_useTransitions:s,future:{}}),[f,i,u,s]);typeof r=="string"&&(r=V(r));let{pathname:a="/",search:d="",hash:h="",state:m=null,key:v="default"}=r,w=c.useMemo(()=>{let S=W(a,f);return S==null?null:{location:{pathname:S,search:d,hash:h,state:m,key:v},navigationType:n}},[f,a,d,h,m,v,n]);return D(w!=null,`<Router basename="${f}"> is not able to match the URL "${a}${d}${h}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:c.createElement(I.Provider,{value:l},c.createElement(Q.Provider,{children:t,value:w}))}function Ur({children:e,location:t}){return Bt(me(e),t)}function me(e,t=[]){let r=[];return c.Children.forEach(e,(n,i)=>{if(!c.isValidElement(n))return;let u=[...t,i];if(n.type===c.Fragment){r.push.apply(r,me(n.props.children,u));return}O(n.type===tr,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),O(!n.props.index||!n.props.children,"An index route cannot have child routes.");let s={id:n.props.id||u.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=me(n.props.children,u)),r.push(s)}),r}var ae="get",oe="application/x-www-form-urlencoded";function le(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function nr(e){return le(e)&&e.tagName.toLowerCase()==="button"}function ar(e){return le(e)&&e.tagName.toLowerCase()==="form"}function or(e){return le(e)&&e.tagName.toLowerCase()==="input"}function ir(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ur(e,t){return e.button===0&&(!t||t==="_self")&&!ir(e)}function ye(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function lr(e,t){let r=ye(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(u=>{r.append(i,u)})}),r}var ne=null;function sr(){if(ne===null)try{new FormData(document.createElement("form"),0),ne=!1}catch{ne=!0}return ne}var cr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function he(e){return e!=null&&!cr.has(e)?(D(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${oe}"`),null):e}function fr(e,t){let r,n,i,u,s;if(ar(e)){let f=e.getAttribute("action");n=f?W(f,t):null,r=e.getAttribute("method")||ae,i=he(e.getAttribute("enctype"))||oe,u=new FormData(e)}else if(nr(e)||or(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||f.getAttribute("action");if(n=l?W(l,t):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||ae,i=he(e.getAttribute("formenctype"))||he(f.getAttribute("enctype"))||oe,u=new FormData(f,e),!sr()){let{name:a,type:d,value:h}=e;if(d==="image"){let m=a?`${a}.`:"";u.append(`${m}x`,"0"),u.append(`${m}y`,"0")}else a&&u.append(a,h)}}else{if(le(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ae,n=null,i=oe,s=e}return u&&i==="text/plain"&&(s=u,u=void 0),{action:n,method:r.toLowerCase(),encType:i,formData:u,body:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Re(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function dr(e,t,r){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname=`_root.${r}`:t&&W(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${r}`,n}async function hr(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function pr(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function mr(e,t,r){let n=await Promise.all(e.map(async i=>{let u=t.routes[i.route.id];if(u){let s=await hr(u,r);return s.links?s.links():[]}return[]}));return Er(n.flat(1).filter(pr).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Ae(e,t,r,n,i,u){let s=(l,a)=>r[a]?l.route.id!==r[a].route.id:!0,f=(l,a)=>r[a].pathname!==l.pathname||r[a].route.path?.endsWith("*")&&r[a].params["*"]!==l.params["*"];return u==="assets"?t.filter((l,a)=>s(l,a)||f(l,a)):u==="data"?t.filter((l,a)=>{let d=n.routes[l.route.id];if(!d||!d.hasLoader)return!1;if(s(l,a)||f(l,a))return!0;if(l.route.shouldRevalidate){let h=l.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function yr(e,t,{includeHydrateFallback:r}={}){return gr(e.map(n=>{let i=t.routes[n.route.id];if(!i)return[];let u=[i.module];return i.clientActionModule&&(u=u.concat(i.clientActionModule)),i.clientLoaderModule&&(u=u.concat(i.clientLoaderModule)),r&&i.hydrateFallbackModule&&(u=u.concat(i.hydrateFallbackModule)),i.imports&&(u=u.concat(i.imports)),u}).flat(1))}function gr(e){return[...new Set(e)]}function vr(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function Er(e,t){let r=new Set;return new Set(t),e.reduce((n,i)=>{let u=JSON.stringify(vr(i));return r.has(u)||(r.add(u),n.push({key:u,link:i})),n},[])}function Ve(){let e=c.useContext(G);return Re(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Rr(){let e=c.useContext(ue);return Re(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var we=c.createContext(void 0);we.displayName="FrameworkContext";function Ge(){let e=c.useContext(we);return Re(e,"You must render this element inside a <HydratedRouter> element"),e}function wr(e,t){let r=c.useContext(we),[n,i]=c.useState(!1),[u,s]=c.useState(!1),{onFocus:f,onBlur:l,onMouseEnter:a,onMouseLeave:d,onTouchStart:h}=t,m=c.useRef(null);c.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let S=g=>{g.forEach(E=>{s(E.isIntersecting)})},y=new IntersectionObserver(S,{threshold:.5});return m.current&&y.observe(m.current),()=>{y.disconnect()}}},[e]),c.useEffect(()=>{if(n){let S=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(S)}}},[n]);let v=()=>{i(!0)},w=()=>{i(!1),s(!1)};return r?e!=="intent"?[u,m,{}]:[u,m,{onFocus:J(f,v),onBlur:J(l,w),onMouseEnter:J(a,v),onMouseLeave:J(d,w),onTouchStart:J(h,v)}]:[!1,m,{}]}function J(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Cr({page:e,...t}){let{router:r}=Ve(),n=c.useMemo(()=>Me(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?c.createElement(Sr,{page:e,matches:n,...t}):null}function _r(e){let{manifest:t,routeModules:r}=Ge(),[n,i]=c.useState([]);return c.useEffect(()=>{let u=!1;return mr(e,t,r).then(s=>{u||i(s)}),()=>{u=!0}},[e,t,r]),n}function Sr({page:e,matches:t,...r}){let n=z(),{manifest:i,routeModules:u}=Ge(),{basename:s}=Ve(),{loaderData:f,matches:l}=Rr(),a=c.useMemo(()=>Ae(e,t,l,i,n,"data"),[e,t,l,i,n]),d=c.useMemo(()=>Ae(e,t,l,i,n,"assets"),[e,t,l,i,n]),h=c.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let w=new Set,S=!1;if(t.forEach(g=>{let E=i.routes[g.route.id];!E||!E.hasLoader||(!a.some(P=>P.route.id===g.route.id)&&g.route.id in f&&u[g.route.id]?.shouldRevalidate||E.hasClientLoader?S=!0:w.add(g.route.id))}),w.size===0)return[];let y=dr(e,s,"data");return S&&w.size>0&&y.searchParams.set("_routes",t.filter(g=>w.has(g.route.id)).map(g=>g.route.id).join(",")),[y.pathname+y.search]},[s,f,n,i,a,t,e,u]),m=c.useMemo(()=>yr(d,i),[d,i]),v=_r(d);return c.createElement(c.Fragment,null,h.map(w=>c.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...r})),m.map(w=>c.createElement("link",{key:w,rel:"modulepreload",href:w,...r})),v.map(({key:w,link:S})=>c.createElement("link",{key:w,nonce:r.nonce,...S})))}function Pr(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Je=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Je&&(window.__reactRouterVersion="7.10.1")}catch{}function Fr({basename:e,children:t,unstable_useTransitions:r,window:n}){let i=c.useRef();i.current==null&&(i.current=st({window:n,v5Compat:!0}));let u=i.current,[s,f]=c.useState({action:u.action,location:u.location}),l=c.useCallback(a=>{r===!1?f(a):c.startTransition(()=>f(a))},[r]);return c.useLayoutEffect(()=>u.listen(l),[u,l]),c.createElement(rr,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:u,unstable_useTransitions:r===!0})}var Xe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qe=c.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:i,reloadDocument:u,replace:s,state:f,target:l,to:a,preventScrollReset:d,viewTransition:h,...m},v){let{basename:w,unstable_useTransitions:S}=c.useContext(I),y=typeof a=="string"&&Xe.test(a),g,E=!1;if(typeof a=="string"&&y&&(g=a,Je))try{let M=new URL(window.location.href),Y=a.startsWith("//")?new URL(M.protocol+a):new URL(a),te=W(Y.pathname,w);Y.origin===M.origin&&te!=null?a=te+Y.search+Y.hash:E=!0}catch{D(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let P=Ht(a,{relative:i}),[$,A,H]=wr(n,m),x=Lr(a,{replace:s,state:f,target:l,preventScrollReset:d,relative:i,viewTransition:h,unstable_useTransitions:S});function q(M){t&&t(M),M.defaultPrevented||x(M)}let U=c.createElement("a",{...m,...H,href:g||P,onClick:E||u?t:q,ref:Pr(v,A),target:l,"data-discover":!y&&r==="render"?"true":void 0});return $&&!y?c.createElement(c.Fragment,null,U,c.createElement(Cr,{page:P})):U});Qe.displayName="Link";var xr=c.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:i=!1,style:u,to:s,viewTransition:f,children:l,...a},d){let h=ee(s,{relative:a.relative}),m=z(),v=c.useContext(ue),{navigator:w,basename:S}=c.useContext(I),y=v!=null&&Nr(h)&&f===!0,g=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,E=m.pathname,P=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(E=E.toLowerCase(),P=P?P.toLowerCase():null,g=g.toLowerCase()),P&&S&&(P=W(P,S)||P);const $=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let A=E===g||!i&&E.startsWith(g)&&E.charAt($)==="/",H=P!=null&&(P===g||!i&&P.startsWith(g)&&P.charAt(g.length)==="/"),x={isActive:A,isPending:H,isTransitioning:y},q=A?t:void 0,U;typeof n=="function"?U=n(x):U=[n,A?"active":null,H?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let M=typeof u=="function"?u(x):u;return c.createElement(Qe,{...a,"aria-current":q,className:U,ref:d,style:M,to:s,viewTransition:f},typeof l=="function"?l(x):l)});xr.displayName="NavLink";var br=c.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:i,state:u,method:s=ae,action:f,onSubmit:l,relative:a,preventScrollReset:d,viewTransition:h,...m},v)=>{let{unstable_useTransitions:w}=c.useContext(I),S=kr(),y=Ar(f,{relative:a}),g=s.toLowerCase()==="get"?"get":"post",E=typeof f=="string"&&Xe.test(f),P=$=>{if(l&&l($),$.defaultPrevented)return;$.preventDefault();let A=$.nativeEvent.submitter,H=A?.getAttribute("formmethod")||s,x=()=>S(A||$.currentTarget,{fetcherKey:t,method:H,navigate:r,replace:i,state:u,relative:a,preventScrollReset:d,viewTransition:h});w&&r!==!1?c.startTransition(()=>x()):x()};return c.createElement("form",{ref:v,method:g,action:y,onSubmit:n?l:P,...m,"data-discover":!E&&e==="render"?"true":void 0})});br.displayName="Form";function Tr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ze(e){let t=c.useContext(G);return O(t,Tr(e)),t}function Lr(e,{target:t,replace:r,state:n,preventScrollReset:i,relative:u,viewTransition:s,unstable_useTransitions:f}={}){let l=ze(),a=z(),d=ee(e,{relative:u});return c.useCallback(h=>{if(ur(h,t)){h.preventDefault();let m=r!==void 0?r:X(a)===X(d),v=()=>l(e,{replace:m,state:n,preventScrollReset:i,relative:u,viewTransition:s});f?c.startTransition(()=>v()):v()}},[a,l,d,r,n,t,e,i,u,s,f])}function jr(e){D(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=c.useRef(ye(e)),r=c.useRef(!1),n=z(),i=c.useMemo(()=>lr(n.search,r.current?null:t.current),[n.search]),u=ze(),s=c.useCallback((f,l)=>{const a=ye(typeof f=="function"?f(new URLSearchParams(i)):f);r.current=!0,u("?"+a,l)},[u,i]);return[i,s]}var Or=0,$r=()=>`__${String(++Or)}__`;function kr(){let{router:e}=Ze("useSubmit"),{basename:t}=c.useContext(I),r=Xt(),n=e.fetch,i=e.navigate;return c.useCallback(async(u,s={})=>{let{action:f,method:l,encType:a,formData:d,body:h}=fr(u,t);if(s.navigate===!1){let m=s.fetcherKey||$r();await n(m,r,s.action||f,{preventScrollReset:s.preventScrollReset,formData:d,body:h,formMethod:s.method||l,formEncType:s.encType||a,flushSync:s.flushSync})}else await i(s.action||f,{preventScrollReset:s.preventScrollReset,formData:d,body:h,formMethod:s.method||l,formEncType:s.encType||a,replace:s.replace,state:s.state,fromRouteId:r,flushSync:s.flushSync,viewTransition:s.viewTransition})},[n,i,t,r])}function Ar(e,{relative:t}={}){let{basename:r}=c.useContext(I),n=c.useContext(j);O(n,"useFormAction must be used inside a RouteContext");let[i]=n.matches.slice(-1),u={...ee(e||".",{relative:t})},s=z();if(e==null){u.search=s.search;let f=new URLSearchParams(u.search),l=f.getAll("index");if(l.some(d=>d==="")){f.delete("index"),l.filter(h=>h).forEach(h=>f.append("index",h));let d=f.toString();u.search=d?`?${d}`:""}}return(!e||e===".")&&i.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(u.pathname=u.pathname==="/"?r:B([r,u.pathname])),X(u)}function Nr(e,{relative:t}={}){let r=c.useContext(Be);O(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Ze("useViewTransitionState"),i=ee(e,{relative:t});if(!r.isTransitioning)return!1;let u=W(r.currentLocation.pathname,n)||r.currentLocation.pathname,s=W(r.nextLocation.pathname,n)||r.nextLocation.pathname;return ie(i.pathname,s)!=null||ie(i.pathname,u)!=null}var Dr=lt();const Br=Ne(Dr);export{Fr as B,Qe as L,Hr as O,Ir as R,Dr as a,Br as b,it as c,Mr as d,De as e,lt as f,Ne as g,ze as h,Ur as i,tr as j,jr as k,c as r,z as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-DFHQr9A5.js";import{k as Me,r as t}from"./react-vendor-FspHSO0w.js";import{a2 as _e,a3 as ie,V as Oe,W as Pe,X as ce,a4 as Ve,B as b,a5 as me,a6 as xe,i as he,I as $}from"./index-c9idYjfn.js";import{S as B}from"./switch-BQbPcCIQ.js";import{CodeEditor as Be}from"./code-editor-rSl_-6ob.js";import{J as y,am as $e,z as De,k as We,an as de,j as Ue,o as He,ac as pe,l as ue,t as Y,x as J,y as K,D as q,N as Ye,V as Je}from"./icons-U_6eBV_J.js";import"./tanstack-C4gT2P7V.js";import"./notifications-B2Pz7lik.js";import"./utils-CzKF5WmX.js";import"./form-utils-BuXDJb0w.js";import"./code-highlight-BoHWVYut.js";function is(){const[r]=Me(),m=r.get("tab")==="globalenv"?"globalenv":"websearch",[o,u]=t.useState(m),[n,d]=t.useState(null),[g,h]=t.useState(!0),[k,C]=t.useState(!1),[f,p]=t.useState(null),[j,S]=t.useState(!1),[l,v]=t.useState(null),[D,L]=t.useState(!0),[N,w]=t.useState(null),[I,z]=t.useState(!1),[W,F]=t.useState(!1),[R,M]=t.useState(""),[E,G]=t.useState(""),[ge,be]=t.useState(!1),[fe,je]=t.useState(!1),[ve,Ne]=t.useState(!1),[x,_]=t.useState(null),[we,X]=t.useState(!0),[ye,Q]=t.useState(!1),[ke,O]=t.useState(null),[Ce,Z]=t.useState(!1),[U,ee]=t.useState(""),[se,ae]=t.useState("");t.useEffect(()=>{te(),ne(),P(),re()},[]),t.useEffect(()=>{n&&(M(n.providers?.gemini?.model??"gemini-2.5-flash"),G(n.providers?.opencode?.model??"opencode/grok-code"))},[n]);const te=async()=>{try{h(!0),p(null);const s=await fetch("/api/websearch");if(!s.ok)throw new Error("Failed to load WebSearch config");const a=await s.json();d(a)}catch(s){p(s.message)}finally{h(!1)}},ne=async()=>{try{L(!0);const s=await fetch("/api/websearch/status");if(!s.ok)throw new Error("Failed to load status");const a=await s.json();v(a)}catch(s){console.error("Failed to fetch WebSearch status:",s)}finally{L(!1)}},P=async()=>{try{z(!0);const s=await fetch("/api/config/raw");if(!s.ok){w(null);return}const a=await s.text();w(a)}catch(s){console.error("Failed to fetch raw config:",s),w(null)}finally{z(!1)}},re=async()=>{try{X(!0),O(null);const s=await fetch("/api/global-env");if(!s.ok)throw new Error("Failed to load Global Env config");const a=await s.json();_(a)}catch(s){O(s.message)}finally{X(!1)}},Se=async()=>{if(N)try{await navigator.clipboard.writeText(N),F(!0),setTimeout(()=>F(!1),2e3)}catch(s){console.error("Failed to copy:",s)}},Ee=()=>{const s=n?.providers||{},a=s.gemini?.enabled??!1,i=s.grok?.enabled??!1,A=s.opencode?.enabled??!1;T({enabled:!a||i||A,providers:{...s,gemini:{...s.gemini,enabled:!a}}})},T=async s=>{if(!n)return;const a={...n,...s};d(a);try{C(!0),p(null);const i=await fetch("/api/websearch",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok){const c=await i.json();throw new Error(c.error||"Failed to save")}const A=await i.json();d(A.websearch),S(!0),setTimeout(()=>S(!1),1500),fetch("/api/config/raw").then(c=>c.ok?c.text():null).then(c=>c&&w(c)).catch(()=>{})}catch(i){d(n),p(i.message)}finally{C(!1)}},H=n?.providers?.gemini?.enabled??!1,le=n?.providers?.grok?.enabled??!1,oe=n?.providers?.opencode?.enabled??!1,Ge=()=>{const s=n?.providers||{},a=s.grok?.enabled??!1;T({enabled:H||!a||oe,providers:{...s,grok:{...s.grok,enabled:!a}}})},Ie=()=>{const s=n?.providers||{},a=s.opencode?.enabled??!1;T({enabled:H||le||!a,providers:{...s,opencode:{...s.opencode,enabled:!a}}})},Re=()=>{const s=n?.providers?.gemini?.model??"gemini-2.5-flash";if(R!==s){const a=n?.providers||{};T({providers:{...a,gemini:{...a.gemini,model:R}}})}},Te=()=>{const s=n?.providers?.opencode?.model??"opencode/grok-code";if(E!==s){const a=n?.providers||{};T({providers:{...a,opencode:{...a.opencode,model:E}}})}},V=async s=>{if(!x)return;const a={...x,...s};_(a);try{Q(!0),O(null);const i=await fetch("/api/global-env",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok){const c=await i.json();throw new Error(c.error||"Failed to save")}const A=await i.json();_(A.config),Z(!0),setTimeout(()=>Z(!1),1500),fetch("/api/config/raw").then(c=>c.ok?c.text():null).then(c=>c&&w(c)).catch(()=>{})}catch(i){_(x),O(i.message)}finally{Q(!1)}},Ae=()=>{V({enabled:!x?.enabled})},Le=()=>{if(!U.trim()||!x)return;const s={...x.env,[U.trim()]:se};V({env:s}),ee(""),ae("")},ze=s=>{if(!x)return;const a={...x.env};delete a[s],V({env:a})},Fe=(s,a)=>{if(!x)return;const i={...x.env,[s]:a};V({env:i})};return g?e.jsx("div",{className:"h-[calc(100vh-100px)] flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(y,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{className:"text-lg",children:"Loading configuration..."})]})}):e.jsx("div",{className:"h-[calc(100vh-100px)]",children:e.jsxs(_e,{direction:"horizontal",className:"h-full",children:[e.jsx(ie,{defaultSize:40,minSize:30,maxSize:55,children:e.jsxs("div",{className:"h-full border-r flex flex-col bg-muted/30 relative",children:[e.jsx("div",{className:"p-5 border-b bg-background",children:e.jsx(Oe,{value:o,onValueChange:s=>u(s),children:e.jsxs(Pe,{className:"w-full",children:[e.jsxs(ce,{value:"websearch",className:"flex-1 gap-2",children:[e.jsx($e,{className:"w-4 h-4"}),"WebSearch"]}),e.jsxs(ce,{value:"globalenv",className:"flex-1 gap-2",children:[e.jsx(De,{className:"w-4 h-4"}),"Global Env"]})]})})}),o==="websearch"?e.jsx(Ke,{config:n,status:l,statusLoading:D,saving:k,error:f,success:j,isGeminiEnabled:H,isGrokEnabled:le,isOpenCodeEnabled:oe,geminiModelInput:R,opencodeModelInput:E,showGeminiHint:ge,showOpencodeHint:fe,showGrokHint:ve,setGeminiModelInput:M,setOpencodeModelInput:G,setShowGeminiHint:be,setShowOpencodeHint:je,setShowGrokHint:Ne,toggleGemini:Ee,toggleGrok:Ge,toggleOpenCode:Ie,saveGeminiModel:Re,saveOpencodeModel:Te,fetchStatus:ne,fetchConfig:te,fetchRawConfig:P,loading:g}):e.jsx(qe,{config:x,loading:we,saving:ye,error:ke,success:Ce,newEnvKey:U,newEnvValue:se,setNewEnvKey:ee,setNewEnvValue:ae,toggleGlobalEnv:Ae,addEnvVar:Le,removeEnvVar:ze,updateEnvValue:Fe,fetchGlobalEnvConfig:re,fetchRawConfig:P})]})}),e.jsx(Ve,{className:"w-2 bg-border hover:bg-primary/20 transition-colors cursor-col-resize flex items-center justify-center group",children:e.jsx(We,{className:"w-3 h-3 text-muted-foreground group-hover:text-primary"})}),e.jsx(ie,{defaultSize:60,minSize:35,children:e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b bg-background flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(de,{className:"w-5 h-5 text-primary"}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-semibold",children:"config.yaml"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"~/.ccs/config.yaml"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:Se,disabled:!N,children:W?e.jsxs(e.Fragment,{children:[e.jsx(Ue,{className:"w-4 h-4 mr-1"}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(He,{className:"w-4 h-4 mr-1"}),"Copy"]})}),e.jsx(b,{variant:"outline",size:"sm",onClick:P,disabled:I,children:e.jsx(y,{className:`w-4 h-4 ${I?"animate-spin":""}`})})]})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:I?e.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[e.jsx(y,{className:"w-5 h-5 animate-spin mr-2"}),"Loading..."]}):N?e.jsx(Be,{value:N,onChange:()=>{},language:"yaml",readonly:!0,minHeight:"auto",className:"min-h-full"}):e.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:e.jsxs("div",{className:"text-center",children:[e.jsx(de,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"Config file not found"}),e.jsx("code",{className:"text-sm bg-muted px-2 py-1 rounded mt-2 inline-block",children:"ccs migrate"})]})})})]})})]})})}function Ke({status:r,statusLoading:m,saving:o,error:u,success:n,isGeminiEnabled:d,isGrokEnabled:g,isOpenCodeEnabled:h,geminiModelInput:k,opencodeModelInput:C,showGeminiHint:f,showOpencodeHint:p,showGrokHint:j,setGeminiModelInput:S,setOpencodeModelInput:l,setShowGeminiHint:v,setShowOpencodeHint:D,setShowGrokHint:L,toggleGemini:N,toggleGrok:w,toggleOpenCode:I,saveGeminiModel:z,saveOpencodeModel:W,fetchStatus:F,fetchConfig:R,fetchRawConfig:M,loading:E}){return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${u||n?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[u&&e.jsxs(me,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(pe,{className:"h-4 w-4"}),e.jsx(xe,{children:u})]}),n&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(ue,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:"Saved"})]})]}),e.jsx(he,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"CLI-based web search for third-party profiles (gemini, codex, agy, etc.)"}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:d?"WebSearch enabled":"WebSearch disabled"}),m?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Checking status..."}):r?.readiness?e.jsx("p",{className:"text-sm text-muted-foreground",children:r.readiness.message}):null]}),e.jsx(b,{variant:"ghost",size:"sm",onClick:F,disabled:m,children:e.jsx(y,{className:`w-4 h-4 ${m?"animate-spin":""}`})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Providers"}),e.jsxs("div",{className:`rounded-lg border transition-colors ${d?"border-primary border-l-4":"border-border"}`,children:[e.jsxs("div",{className:"flex items-center justify-between p-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Y,{className:`w-5 h-5 ${d?"text-primary":"text-muted-foreground"}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-mono font-medium",children:"gemini"}),e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-500/10 text-green-600 font-medium",children:"FREE"}),r?.geminiCli?.installed?e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-500/10 text-green-600 font-medium",children:"installed"}):e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-600 font-medium",children:"not installed"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Google Gemini CLI (1000 req/day free)"})]})]}),e.jsx(B,{checked:d,onCheckedChange:N,disabled:o||!r?.geminiCli?.installed})]}),d&&e.jsx("div",{className:"px-4 pb-4 pt-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"Model:"}),e.jsx($,{value:k,onChange:G=>S(G.target.value),onBlur:z,placeholder:"gemini-2.5-flash",className:"h-8 text-sm font-mono",disabled:o})]})}),!r?.geminiCli?.installed&&!m&&e.jsxs("div",{className:"px-4 pb-4 pt-0 border-t border-border/50",children:[e.jsxs("button",{onClick:()=>v(!f),className:"flex items-center gap-2 text-sm text-amber-600 dark:text-amber-400 hover:underline w-full py-2",children:[f?e.jsx(J,{className:"w-4 h-4"}):e.jsx(K,{className:"w-4 h-4"}),"How to install Gemini CLI"]}),f&&e.jsxs("div",{className:"mt-2 p-3 rounded-md bg-amber-50 dark:bg-amber-900/20 text-sm",children:[e.jsx("p",{className:"text-amber-700 dark:text-amber-300 mb-2",children:"Install globally (FREE tier available):"}),e.jsx("code",{className:"text-sm bg-amber-100 dark:bg-amber-900/40 px-2 py-1 rounded font-mono block mb-2",children:"npm install -g @google/gemini-cli"}),e.jsxs("a",{href:"https://github.com/google-gemini/gemini-cli",target:"_blank",rel:"noopener noreferrer",className:"text-amber-700 dark:text-amber-300 hover:underline inline-flex items-center gap-1",children:[e.jsx(q,{className:"w-3 h-3"}),"View documentation"]})]})]})]}),e.jsxs("div",{className:`rounded-lg border transition-colors ${h?"border-primary border-l-4":"border-border"}`,children:[e.jsxs("div",{className:"flex items-center justify-between p-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Y,{className:`w-5 h-5 ${h?"text-primary":"text-muted-foreground"}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-mono font-medium",children:"opencode"}),e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-500/10 text-green-600 font-medium",children:"FREE"}),r?.opencodeCli?.installed?e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-500/10 text-green-600 font-medium",children:"installed"}):e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-600 font-medium",children:"not installed"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"OpenCode (web search via Zen)"})]})]}),e.jsx(B,{checked:h,onCheckedChange:I,disabled:o||!r?.opencodeCli?.installed})]}),h&&e.jsx("div",{className:"px-4 pb-4 pt-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"Model:"}),e.jsx($,{value:C,onChange:G=>l(G.target.value),onBlur:W,placeholder:"opencode/grok-code",className:"h-8 text-sm font-mono",disabled:o})]})}),!r?.opencodeCli?.installed&&!m&&e.jsxs("div",{className:"px-4 pb-4 pt-0 border-t border-border/50",children:[e.jsxs("button",{onClick:()=>D(!p),className:"flex items-center gap-2 text-sm text-purple-600 dark:text-purple-400 hover:underline w-full py-2",children:[p?e.jsx(J,{className:"w-4 h-4"}):e.jsx(K,{className:"w-4 h-4"}),"How to install OpenCode"]}),p&&e.jsxs("div",{className:"mt-2 p-3 rounded-md bg-purple-50 dark:bg-purple-900/20 text-sm",children:[e.jsx("p",{className:"text-purple-700 dark:text-purple-300 mb-2",children:"Install globally (FREE tier available):"}),e.jsx("code",{className:"text-sm bg-purple-100 dark:bg-purple-900/40 px-2 py-1 rounded font-mono block mb-2",children:"curl -fsSL https://opencode.ai/install | bash"}),e.jsxs("a",{href:"https://github.com/sst/opencode",target:"_blank",rel:"noopener noreferrer",className:"text-purple-700 dark:text-purple-300 hover:underline inline-flex items-center gap-1",children:[e.jsx(q,{className:"w-3 h-3"}),"View documentation"]})]})]})]}),e.jsxs("div",{className:`rounded-lg border transition-colors ${g?"border-primary border-l-4":"border-border"}`,children:[e.jsxs("div",{className:"flex items-center justify-between p-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Y,{className:`w-5 h-5 ${g?"text-primary":"text-muted-foreground"}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-mono font-medium",children:"grok"}),e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-600 font-medium",children:"GROK_API_KEY"}),r?.grokCli?.installed?e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-500/10 text-green-600 font-medium",children:"installed"}):e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-600 font-medium",children:"not installed"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"xAI Grok CLI (web + X search)"})]})]}),e.jsx(B,{checked:g,onCheckedChange:w,disabled:o||!r?.grokCli?.installed})]}),!r?.grokCli?.installed&&!m&&e.jsxs("div",{className:"px-4 pb-4 pt-0 border-t border-border/50",children:[e.jsxs("button",{onClick:()=>L(!j),className:"flex items-center gap-2 text-sm text-blue-600 dark:text-blue-400 hover:underline w-full py-2",children:[j?e.jsx(J,{className:"w-4 h-4"}):e.jsx(K,{className:"w-4 h-4"}),"How to install Grok CLI"]}),j&&e.jsxs("div",{className:"mt-2 p-3 rounded-md bg-blue-50 dark:bg-blue-900/20 text-sm",children:[e.jsx("p",{className:"text-blue-700 dark:text-blue-300 mb-2",children:"Install globally (requires xAI API key):"}),e.jsx("code",{className:"text-sm bg-blue-100 dark:bg-blue-900/40 px-2 py-1 rounded font-mono block mb-2",children:"npm install -g @vibe-kit/grok-cli"}),e.jsxs("a",{href:"https://github.com/superagent-ai/grok-cli",target:"_blank",rel:"noopener noreferrer",className:"text-blue-700 dark:text-blue-300 hover:underline inline-flex items-center gap-1",children:[e.jsx(q,{className:"w-3 h-3"}),"View documentation"]})]})]})]})]})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>{R(),M()},disabled:E||o,className:"w-full",children:[e.jsx(y,{className:`w-4 h-4 mr-2 ${E?"animate-spin":""}`}),"Refresh"]})})]})}function qe({config:r,loading:m,saving:o,error:u,success:n,newEnvKey:d,newEnvValue:g,setNewEnvKey:h,setNewEnvValue:k,toggleGlobalEnv:C,addEnvVar:f,removeEnvVar:p,fetchGlobalEnvConfig:j,fetchRawConfig:S}){return m?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(y,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:"Loading..."})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${u||n?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[u&&e.jsxs(me,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(pe,{className:"h-4 w-4"}),e.jsx(xe,{children:u})]}),n&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(ue,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:"Saved"})]})]}),e.jsx(he,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Environment variables injected into all non-Claude subscription profiles (gemini, codex, agy, copilot, etc.)"}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:r?.enabled?"Global Env enabled":"Global Env disabled"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r?.enabled?"Env vars will be injected into third-party profiles":"Env vars will not be injected"})]}),e.jsx(B,{checked:r?.enabled??!0,onCheckedChange:C})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Environment Variables"}),r?.env&&Object.keys(r.env).length>0?e.jsx("div",{className:"space-y-2",children:Object.entries(r.env).map(([l,v])=>e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg border bg-background",children:[e.jsx("code",{className:"flex-1 font-mono text-sm truncate",children:l}),e.jsx("span",{className:"text-muted-foreground",children:"="}),e.jsx("code",{className:"font-mono text-sm px-2 py-1 bg-muted rounded",children:v}),e.jsx(b,{variant:"ghost",size:"sm",onClick:()=>p(l),disabled:o,className:"h-8 w-8 p-0 text-destructive hover:text-destructive hover:bg-destructive/10",children:e.jsx(Ye,{className:"w-4 h-4"})})]},l))}):e.jsx("div",{className:"p-4 rounded-lg border border-dashed text-center text-muted-foreground",children:e.jsx("p",{children:"No environment variables configured"})}),e.jsxs("div",{className:"p-4 rounded-lg border bg-muted/30",children:[e.jsx("h4",{className:"text-sm font-medium mb-3",children:"Add New Variable"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx($,{value:d,onChange:l=>h(l.target.value.toUpperCase()),placeholder:"KEY_NAME",className:"flex-1 font-mono text-sm h-9",disabled:o}),e.jsx("span",{className:"flex items-center text-muted-foreground",children:"="}),e.jsx($,{value:g,onChange:l=>k(l.target.value),placeholder:"value",className:"flex-1 font-mono text-sm h-9",disabled:o}),e.jsxs(b,{size:"sm",onClick:f,disabled:o||!d.trim(),className:"h-9",children:[e.jsx(Je,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsxs("div",{className:"p-4 rounded-lg border bg-muted/30",children:[e.jsx("h4",{className:"text-sm font-medium mb-3",children:"Quick Add Common Variables"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[[{key:"DISABLE_BUG_COMMAND",value:"1"},{key:"DISABLE_ERROR_REPORTING",value:"1"},{key:"DISABLE_TELEMETRY",value:"1"}].map(({key:l,value:v})=>!r?.env?.[l]&&e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>{h(l),k(v)},className:"text-xs font-mono",children:["+ ",l]},l)),r?.env&&["DISABLE_BUG_COMMAND","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY"].every(l=>r.env[l])&&e.jsx("span",{className:"text-sm text-muted-foreground",children:"All common variables are configured"})]})]})]})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>{j(),S()},disabled:m||o,className:"w-full",children:[e.jsx(y,{className:`w-4 h-4 mr-2 ${m?"animate-spin":""}`}),"Refresh"]})})]})}export{is as SettingsPage};
|