@seaveyon/harness-switch 0.20.0 → 0.20.1

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.
@@ -59,4 +59,4 @@
59
59
 
60
60
  `)}t.write("payload.value = newResult;"),t.write("return payload;");let l=t.compile();return(t,n)=>l(e,t,n)})(t.shape)),u=n(u,c),s)?tz([],d,u,c,r,e):u:a(u,c):(u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u)}});function tR(e,t,n,r){for(let n of e)if(0===n.issues.length)return t.value=n.value,t;let a=e.filter(e=>!eT(e));return 1===a.length?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>eL(e,r,H())))}),t)}let tL=D("$ZodUnion",(e,t)=>{e8.init(e,t),eb(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),eb(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eb(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),eb(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ey(e.source)).join("|")})$`)}});let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,a)=>{if(n)return n(r,a);let o=!1,i=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},a);if(t instanceof Promise)i.push(t),o=!0;else{if(0===t.issues.length)return t;i.push(t)}}return o?Promise.all(i).then(t=>tR(t,r,e,a)):tR(i,r,e,a)}}),tI=D("$ZodIntersection",(e,t)=>{e8.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,a=t.left._zod.run({value:r,issues:[]},n),o=t.right._zod.run({value:r,issues:[]},n);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([t,n])=>tM(e,t,n)):tM(e,a,o)}});function tM(e,t,n){let r,a=new Map;for(let n of t.issues)if("unrecognized_keys"===n.code)for(let e of(r??(r=n),n.keys))a.has(e)||a.set(e,{}),a.get(e).l=!0;else e.issues.push(n);for(let t of n.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)a.has(e)||a.set(e,{}),a.get(e).r=!0;else e.issues.push(t);let o=[...a].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length&&r&&e.issues.push({...r,keys:o}),eT(e))return e;let i=function e(t,n){if(t===n||t instanceof Date&&n instanceof Date&&+t==+n)return{valid:!0,data:t};if(eC(t)&&eC(n)){let r=Object.keys(n),a=Object.keys(t).filter(e=>-1!==r.indexOf(e)),o={...t,...n};for(let r of a){let a=e(t[r],n[r]);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};o[r]=a.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let a=0;a<t.length;a++){let o=e(t[a],n[a]);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}(t.value,n.value);if(!i.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}let tD=D("$ZodRecord",(e,t)=>{e8.init(e,t),e._zod.parse=(n,r)=>{let a=n.value;if(!eC(a))return n.issues.push({expected:"record",code:"invalid_type",input:a,inst:e}),n;let o=[],i=t.keyType._zod.values;if(i){let l;n.value={};let s=new Set;for(let l of i)if("string"==typeof l||"number"==typeof l||"symbol"==typeof l){s.add("number"==typeof l?l.toString():l);let i=t.keyType._zod.run({value:l,issues:[]},r);if(i instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(i.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:i.issues.map(e=>eL(e,r,H())),input:l,path:[l],inst:e});continue}let u=i.value,c=t.valueType._zod.run({value:a[l],issues:[]},r);c instanceof Promise?o.push(c.then(e=>{e.issues.length&&n.issues.push(...eA(l,e.issues)),n.value[u]=e.value})):(c.issues.length&&n.issues.push(...eA(l,c.issues)),n.value[u]=c.value)}for(let e in a)s.has(e)||(l=l??[]).push(e);l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:l})}else for(let i of(n.value={},Reflect.ownKeys(a))){if("__proto__"===i||!Object.prototype.propertyIsEnumerable.call(a,i))continue;let l=t.keyType._zod.run({value:i,issues:[]},r);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof i&&ec.test(i)&&l.issues.length){let e=t.keyType._zod.run({value:Number(i),issues:[]},r);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(l=e)}if(l.issues.length){"loose"===t.mode?n.value[i]=a[i]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(e=>eL(e,r,H())),input:i,path:[i],inst:e});continue}let s=t.valueType._zod.run({value:a[i],issues:[]},r);s instanceof Promise?o.push(s.then(e=>{e.issues.length&&n.issues.push(...eA(i,e.issues)),n.value[l.value]=e.value})):(s.issues.length&&n.issues.push(...eA(i,s.issues)),n.value[l.value]=s.value)}return o.length?Promise.all(o).then(()=>n):n}}),tF=D("$ZodEnum",(e,t)=>{e8.init(e,t);let n=eh(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>eP.has(typeof e)).map(e=>"string"==typeof e?eE(e):e.toString()).join("|")})$`),e._zod.parse=(t,a)=>{let o=t.value;return r.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}}),t$=D("$ZodLiteral",(e,t)=>{if(e8.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?eE(e):e?eE(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,a)=>{let o=r.value;return n.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),tU=D("$ZodTransform",(e,t)=>{e8.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new $(e.constructor.name);let a=t.transform(n.value,n);if(r.async)return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(n.value=e,n.fallback=!0,n));if(a instanceof Promise)throw new F;return n.value=a,n.fallback=!0,n}});function tH(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let tB=D("$ZodOptional",(e,t)=>{e8.init(e,t),e._zod.optin="optional",e._zod.optout="optional",eb(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),eb(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ey(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){let r=e.value,a=t.innerType._zod.run(e,n);return a instanceof Promise?a.then(e=>tH(e,r)):tH(a,r)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),tK=D("$ZodExactOptional",(e,t)=>{tB.init(e,t),eb(e._zod,"values",()=>t.innerType._zod.values),eb(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),tV=D("$ZodNullable",(e,t)=>{e8.init(e,t),eb(e._zod,"optin",()=>t.innerType._zod.optin),eb(e._zod,"optout",()=>t.innerType._zod.optout),eb(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ey(e.source)}|null)$`):void 0}),eb(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),tW=D("$ZodDefault",(e,t)=>{e8.init(e,t),e._zod.optin="optional",eb(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>tq(e,t)):tq(r,t)}});function tq(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let tZ=D("$ZodPrefault",(e,t)=>{e8.init(e,t),e._zod.optin="optional",eb(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),tJ=D("$ZodNonOptional",(e,t)=>{e8.init(e,t),eb(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{let a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(t=>tG(t,e)):tG(a,e)}});function tG(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let tQ=D("$ZodCatch",(e,t)=>{e8.init(e,t),e._zod.optin="optional",eb(e._zod,"optout",()=>t.innerType._zod.optout),eb(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>eL(e,n,H()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>eL(e,n,H()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),tY=D("$ZodPipe",(e,t)=>{e8.init(e,t),eb(e._zod,"values",()=>t.in._zod.values),eb(e._zod,"optin",()=>t.in._zod.optin),eb(e._zod,"optout",()=>t.out._zod.optout),eb(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>tX(e,t.in,n)):tX(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>tX(e,t.out,n)):tX(r,t.out,n)}});function tX(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}let t0=D("$ZodReadonly",(e,t)=>{e8.init(e,t),eb(e._zod,"propValues",()=>t.innerType._zod.propValues),eb(e._zod,"values",()=>t.innerType._zod.values),eb(e._zod,"optin",()=>t.innerType?._zod?.optin),eb(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t1):t1(r)}});function t1(e){return e.value=Object.freeze(e.value),e}let t2=D("$ZodCustom",(e,t)=>{eD.init(e,t),e8.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,a=t.fn(r);if(a instanceof Promise)return a.then(t=>t4(t,n,r,e));t4(a,n,r,e)}});function t4(e,t,n,r){if(!e){let e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(eM(e))}}Symbol("ZodOutput"),Symbol("ZodInput");(p=globalThis).__zod_globalRegistry??(p.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let t3=globalThis.__zod_globalRegistry;function t5(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ez(t)})}function t6(e,t){return new eF({check:"max_length",...ez(t),maximum:e})}function t8(e,t){return new e$({check:"min_length",...ez(t),minimum:e})}function t9(e,t){return new eU({check:"length_equals",...ez(t),length:e})}function t7(e){return new eJ({check:"overwrite",tx:e})}function ne(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??t3,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function nt(e,t,n={path:[],schemaPath:[]}){var r;let a=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);let l=e._zod.toJSONSchema?.();if(l)i.schema=l;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,r);else{let n=i.schema,o=t.processors[a.type];if(!o)throw Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);o(e,t,n,r)}let o=e._zod.parent;o&&(i.ref||(i.ref=o),nt(o,t,r),t.seen.get(o).isParent=!0)}let s=t.metadataRegistry.get(e);return s&&Object.assign(i.schema,s),"input"===t.io&&function e(t,n){let r=n??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let a=t._zod.def;if("transform"===a.type)return!0;if("array"===a.type)return e(a.element,r);if("set"===a.type)return e(a.valueType,r);if("lazy"===a.type)return e(a.getter(),r);if("promise"===a.type||"optional"===a.type||"nonoptional"===a.type||"nullable"===a.type||"readonly"===a.type||"default"===a.type||"prefault"===a.type)return e(a.innerType,r);if("intersection"===a.type)return e(a.left,r)||e(a.right,r);if("record"===a.type||"map"===a.type)return e(a.keyType,r)||e(a.valueType,r);if("pipe"===a.type)return!!t._zod.traits.has("$ZodCodec")||e(a.in,r)||e(a.out,r);if("object"===a.type){for(let t in a.shape)if(e(a.shape[t],r))return!0;return!1}if("union"===a.type){for(let t of a.options)if(e(t,r))return!0;return!1}if("tuple"===a.type){for(let t of a.items)if(e(t,r))return!0;if(a.rest&&e(a.rest,r))return!0}return!1}(e)&&(delete i.schema.examples,delete i.schema.default),"input"===t.io&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function nn(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let a=t=>{if(t[1].schema.$ref)return;let r=t[1],{ref:a,defId:o}=(t=>{let r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let n=e.external.registry.get(t[0])?.id,a=e.external.uri??(e=>e);if(n)return{ref:a(n)};let o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${a("__shared")}#/${r}/${o}`}}if(t[1]===n)return{ref:"#"};let a=`#/${r}/`,o=t[1].schema.id??`__schema${e.counter++}`;return{defId:o,ref:a+o}})(t);r.def={...r.schema},o&&(r.defId=o);let i=r.schema;for(let e in i)delete i[e];i.$ref=a};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
61
61
 
62
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&"ref"===e.reused){a(n);continue}}}function nr(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=t=>{let n=e.seen.get(t);if(null===n.ref)return;let a=n.def??n.schema,o={...a},i=n.ref;if(n.ref=null,i){r(i);let n=e.seen.get(i),l=n.schema;if(l.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(a.allOf=a.allOf??[],a.allOf.push(l)):Object.assign(a,l),Object.assign(a,o),t._zod.parent===i)for(let e in a)"$ref"!==e&&"allOf"!==e&&(e in o||delete a[e]);if(l.$ref&&n.def)for(let e in a)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(a[e])===JSON.stringify(n.def[e])&&delete a[e]}let l=t._zod.parent;if(l&&l!==i){r(l);let t=e.seen.get(l);if(t?.schema.$ref&&(a.$ref=t.schema.$ref,t.def))for(let e in a)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(a[e])===JSON.stringify(t.def[e])&&delete a[e]}e.override({zodSchema:t,jsonSchema:a,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let a={};if("draft-2020-12"===e.target?a.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?a.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");a.$id=e.external.uri(n)}Object.assign(a,n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;void 0!==o&&a.id===o&&delete a.id;let i=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?a.$defs=i:a.definitions=i);try{let n=JSON.parse(JSON.stringify(a));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:na(t,"input",e.processors),output:na(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw Error("Error converting schema to JSON.")}}let na=(e,t,n={})=>r=>{let{libraryOptions:a,target:o}=r??{},i=ne({...a??{},target:o,io:t,processors:n});return nt(e,i),nn(i,e),nr(i,e)},no={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ni=(e,t,n,r)=>{let a=e._zod.def;nt(a.innerType,t,r),t.seen.get(e).ref=a.innerType},nl=D("ZodISODateTime",(e,t)=>{td.init(e,t),n_.init(e,t)}),ns=D("ZodISODate",(e,t)=>{tf.init(e,t),n_.init(e,t)}),nu=D("ZodISOTime",(e,t)=>{tp.init(e,t),n_.init(e,t)}),nc=D("ZodISODuration",(e,t)=>{th.init(e,t),n_.init(e,t)}),nd=D("ZodError",(e,t)=>{eY.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let n={_errors:[]},r=(e,a=[])=>{for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e},[...a,...o.path]));else if("invalid_key"===o.code)r({issues:o.issues},[...a,...o.path]);else if("invalid_element"===o.code)r({issues:o.issues},[...a,...o.path]);else{let e=[...a,...o.path];if(0===e.length)n._errors.push(t(o));else{let r=n,a=0;for(;a<e.length;){let n=e[a];a===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(o))):r[n]=r[n]||{_errors:[]},r=r[n],a++}}}};return r(e),n})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let n={},r=[];for(let a of e.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,em,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,em,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),nf=e0(nd),np=e1(nd),nh=e2(nd),nm=e3(nd),ng=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return e0(nd)(e,t,r)},ny=(e,t,n)=>e0(nd)(e,t,n),nv=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return e1(nd)(e,t,r)},nb=async(e,t,n)=>e1(nd)(e,t,n),nx=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return e2(nd)(e,t,r)},nw=(e,t,n)=>e2(nd)(e,t,n),nk=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return e3(nd)(e,t,r)},nj=async(e,t,n)=>e3(nd)(e,t,n),nS=new WeakMap;function nO(e,t,n){let r=Object.getPrototypeOf(e),a=nS.get(r);if(a||(a=new Set,nS.set(r,a)),!a.has(t))for(let e in a.add(t),n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let nC=D("ZodType",(e,t)=>(e8.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:na(e,"input"),output:na(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{let r=ne({...n,processors:t});return nt(e,r),nn(r,e),nr(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>nf(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>nh(e,t,n),e.parseAsync=async(t,n)=>np(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>nm(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ng(e,t,n),e.decode=(t,n)=>ny(e,t,n),e.encodeAsync=async(t,n)=>nv(e,t,n),e.decodeAsync=async(t,n)=>nb(e,t,n),e.safeEncode=(t,n)=>nx(e,t,n),e.safeDecode=(t,n)=>nw(e,t,n),e.safeEncodeAsync=async(t,n)=>nk(e,t,n),e.safeDecodeAsync=async(t,n)=>nj(e,t,n),nO(e,"ZodType",{check(...e){let t=this.def;return this.clone(ew(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return e_(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new rg({type:"custom",check:"custom",fn:e,...ez(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var n;let r,a;return n=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(eM(e,t.value,r._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),t.issues.push(eM(e)))},e(t.value,t)),(a=new eD({check:"custom",...ez(t)}))._zod.check=n,r=a}(e,t))},overwrite(e){return this.check(t7(e))},optional(){return ro(this)},exactOptional(){var e;return e=this,new ri({type:"optional",innerType:e})},nullable(){return rs(this)},nullish(){return ro(rs(this))},nonoptional(e){var t;return t=this,new rd({type:"nonoptional",innerType:t,...ez(e)})},array(){return n2(this)},or(e){return new n5({type:"union",options:[this,e],...ez(void 0)})},and(e){var t;return t=this,new n6({type:"intersection",left:t,right:e})},transform(e){return rh(this,new rr({type:"transform",transform:e}))},default(e){var t,n;return t=this,n=e,new ru({type:"default",innerType:t,get defaultValue(){return"function"==typeof n?n():eN(n)}})},prefault(e){var t,n;return t=this,n=e,new rc({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof n?n():eN(n)}})},catch(e){var t,n;return t=this,new rf({type:"catch",innerType:t,catchValue:"function"==typeof(n=e)?n:()=>n})},pipe(e){return rh(this,e)},readonly(){var e;return e=this,new rm({type:"readonly",innerType:e})},describe(e){let t=this.clone();return t3.add(t,{description:e}),t},meta(...e){if(0===e.length)return t3.get(this);let t=this.clone();return t3.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>t3.get(e)?.description,configurable:!0}),e)),nN=D("_ZodString",(e,t)=>{e9.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{n.type="string";let{minimum:a,maximum:o,format:i,patterns:l,contentEncoding:s}=e._zod.bag;if("number"==typeof a&&(n.minLength=a),"number"==typeof o&&(n.maxLength=o),i&&(n.format=no[i]??i,""===n.format&&delete n.format,"time"===i&&delete n.format),s&&(n.contentEncoding=s),l&&l.size>0){let e=[...l];1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n,0);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,nO(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new eB({check:"string_format",format:"regex",...ez(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new eW({check:"string_format",format:"includes",...ez(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new eq({check:"string_format",format:"starts_with",...ez(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new eZ({check:"string_format",format:"ends_with",...ez(t),suffix:e})}(...e))},min(...e){return this.check(t8(...e))},max(...e){return this.check(t6(...e))},length(...e){return this.check(t9(...e))},nonempty(...e){return this.check(t8(1,...e))},lowercase(e){return this.check(new eK({check:"string_format",format:"lowercase",...ez(e)}))},uppercase(e){return this.check(new eV({check:"string_format",format:"uppercase",...ez(e)}))},trim(){return this.check(t7(e=>e.trim()))},normalize(...e){return this.check(function(e){return t7(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(t7(e=>e.toLowerCase()))},toUpperCase(){return this.check(t7(e=>e.toUpperCase()))},slugify(){return this.check(t7(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}})}),nP=D("ZodString",(e,t)=>{e9.init(e,t),nN.init(e,t),e.email=t=>e.check(new nz({type:"string",format:"email",check:"string_format",abort:!1,...ez(t)})),e.url=t=>e.check(new nR({type:"string",format:"url",check:"string_format",abort:!1,...ez(t)})),e.jwt=t=>e.check(new nJ({type:"string",format:"jwt",check:"string_format",abort:!1,...ez(t)})),e.emoji=t=>e.check(new nL({type:"string",format:"emoji",check:"string_format",abort:!1,...ez(t)})),e.guid=t=>e.check(t5(nT,t)),e.uuid=t=>e.check(new nA({type:"string",format:"uuid",check:"string_format",abort:!1,...ez(t)})),e.uuidv4=t=>e.check(new nA({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ez(t)})),e.uuidv6=t=>e.check(new nA({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ez(t)})),e.uuidv7=t=>e.check(new nA({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ez(t)})),e.nanoid=t=>e.check(new nI({type:"string",format:"nanoid",check:"string_format",abort:!1,...ez(t)})),e.guid=t=>e.check(t5(nT,t)),e.cuid=t=>e.check(new nM({type:"string",format:"cuid",check:"string_format",abort:!1,...ez(t)})),e.cuid2=t=>e.check(new nD({type:"string",format:"cuid2",check:"string_format",abort:!1,...ez(t)})),e.ulid=t=>e.check(new nF({type:"string",format:"ulid",check:"string_format",abort:!1,...ez(t)})),e.base64=t=>e.check(new nW({type:"string",format:"base64",check:"string_format",abort:!1,...ez(t)})),e.base64url=t=>e.check(new nq({type:"string",format:"base64url",check:"string_format",abort:!1,...ez(t)})),e.xid=t=>e.check(new n$({type:"string",format:"xid",check:"string_format",abort:!1,...ez(t)})),e.ksuid=t=>e.check(new nU({type:"string",format:"ksuid",check:"string_format",abort:!1,...ez(t)})),e.ipv4=t=>e.check(new nH({type:"string",format:"ipv4",check:"string_format",abort:!1,...ez(t)})),e.ipv6=t=>e.check(new nB({type:"string",format:"ipv6",check:"string_format",abort:!1,...ez(t)})),e.cidrv4=t=>e.check(new nK({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ez(t)})),e.cidrv6=t=>e.check(new nV({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ez(t)})),e.e164=t=>e.check(new nZ({type:"string",format:"e164",check:"string_format",abort:!1,...ez(t)})),e.datetime=t=>e.check(new nl({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ez(t)})),e.date=t=>e.check(new ns({type:"string",format:"date",check:"string_format",...ez(t)})),e.time=t=>e.check(new nu({type:"string",format:"time",check:"string_format",precision:null,...ez(t)})),e.duration=t=>e.check(new nc({type:"string",format:"duration",check:"string_format",...ez(t)}))});function nE(e){return new nP({type:"string",...ez(e)})}let n_=D("ZodStringFormat",(e,t)=>{e7.init(e,t),nN.init(e,t)}),nz=D("ZodEmail",(e,t)=>{tn.init(e,t),n_.init(e,t)}),nT=D("ZodGUID",(e,t)=>{te.init(e,t),n_.init(e,t)}),nA=D("ZodUUID",(e,t)=>{tt.init(e,t),n_.init(e,t)}),nR=D("ZodURL",(e,t)=>{tr.init(e,t),n_.init(e,t)}),nL=D("ZodEmoji",(e,t)=>{ta.init(e,t),n_.init(e,t)}),nI=D("ZodNanoID",(e,t)=>{to.init(e,t),n_.init(e,t)}),nM=D("ZodCUID",(e,t)=>{ti.init(e,t),n_.init(e,t)}),nD=D("ZodCUID2",(e,t)=>{tl.init(e,t),n_.init(e,t)}),nF=D("ZodULID",(e,t)=>{ts.init(e,t),n_.init(e,t)}),n$=D("ZodXID",(e,t)=>{tu.init(e,t),n_.init(e,t)}),nU=D("ZodKSUID",(e,t)=>{tc.init(e,t),n_.init(e,t)}),nH=D("ZodIPv4",(e,t)=>{tm.init(e,t),n_.init(e,t)}),nB=D("ZodIPv6",(e,t)=>{tg.init(e,t),n_.init(e,t)}),nK=D("ZodCIDRv4",(e,t)=>{ty.init(e,t),n_.init(e,t)}),nV=D("ZodCIDRv6",(e,t)=>{tv.init(e,t),n_.init(e,t)}),nW=D("ZodBase64",(e,t)=>{tx.init(e,t),n_.init(e,t)}),nq=D("ZodBase64URL",(e,t)=>{tw.init(e,t),n_.init(e,t)}),nZ=D("ZodE164",(e,t)=>{tk.init(e,t),n_.init(e,t)}),nJ=D("ZodJWT",(e,t)=>{tj.init(e,t),n_.init(e,t)}),nG=D("ZodBoolean",(e,t)=>{tS.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"}});function nQ(e){return new nG({type:"boolean",...ez(e)})}let nY=D("ZodUnknown",(e,t)=>{tO.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function nX(){return new nY({type:"unknown"})}let n0=D("ZodNever",(e,t)=>{tC.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.not={}}}),n1=D("ZodArray",(e,t)=>{tP.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let a=e._zod.def,{minimum:o,maximum:i}=e._zod.bag;"number"==typeof o&&(n.minItems=o),"number"==typeof i&&(n.maxItems=i),n.type="array",n.items=nt(a.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,nO(e,"ZodArray",{min(e,t){return this.check(t8(e,t))},nonempty(e){return this.check(t8(1,e))},max(e,t){return this.check(t6(e,t))},length(e,t){return this.check(t9(e,t))},unwrap(){return this.element}})});function n2(e,t){return new n1({type:"array",element:e,...ez(t)})}let n4=D("ZodObject",(e,t)=>{tA.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let a=e._zod.def;n.type="object",n.properties={};let o=a.shape;for(let e in o)n.properties[e]=nt(o[e],t,{...r,path:[...r.path,"properties",e]});let i=new Set([...new Set(Object.keys(o))].filter(e=>{let n=a.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));i.size>0&&(n.required=Array.from(i)),a.catchall?._zod.def.type==="never"?n.additionalProperties=!1:a.catchall?a.catchall&&(n.additionalProperties=nt(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(n.additionalProperties=!1)})(e,t,n,r),eb(e,"shape",()=>t.shape),nO(e,"ZodObject",{keyof(){return re(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:nX()})},loose(){return this.clone({...this._zod.def,catchall:nX()})},strict(){return this.clone({...this._zod.def,catchall:new n0({type:"never",...ez(void 0)})})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!eC(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=ew(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ex(this,"shape",n),n}});return e_(e,r)}(this,e)},safeExtend(e){var t=this;if(!eC(e))throw Error("Invalid input to safeExtend: expected a plain object");let n=ew(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return ex(this,"shape",n),n}});return e_(t,n)},merge(e){var t=this;if(t._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=ew(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return ex(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return e_(t,n)},pick(e){return function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let a=ew(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return ex(this,"shape",e),e},checks:[]});return e_(e,a)}(this,e)},omit(e){return function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let a=ew(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return ex(this,"shape",r),r},checks:[]});return e_(e,a)}(this,e)},partial(...e){return function(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let a=ew(t._zod.def,{get shape(){let r=t._zod.def.shape,a={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(a[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(let t in r)a[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return ex(this,"shape",a),a},checks:[]});return e_(t,a)}(ra,this,e[0])},required(...e){var t,n;let r;return t=this,n=e[0],r=ew(t._zod.def,{get shape(){let e=t._zod.def.shape,r={...e};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=new rd({type:"nonoptional",innerType:e[t]}))}else for(let t in e)r[t]=new rd({type:"nonoptional",innerType:e[t]});return ex(this,"shape",r),r}}),e_(t,r)}})});function n3(e,t){return new n4({type:"object",shape:e??{},...ez(t)})}let n5=D("ZodUnion",(e,t)=>{tL.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a,o,i;return o=!1===(a=e._zod.def).inclusive,i=a.options.map((e,n)=>nt(e,t,{...r,path:[...r.path,o?"oneOf":"anyOf",n]})),void(o?n.oneOf=i:n.anyOf=i)},e.options=t.options}),n6=D("ZodIntersection",(e,t)=>{tI.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a,o,i,l;return o=nt((a=e._zod.def).left,t,{...r,path:[...r.path,"allOf",0]}),i=nt(a.right,t,{...r,path:[...r.path,"allOf",1]}),void(n.allOf=[...(l=e=>"allOf"in e&&1===Object.keys(e).length)(o)?o.allOf:[o],...l(i)?i.allOf:[i]])}}),n8=D("ZodRecord",(e,t)=>{tD.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let a=e._zod.def;n.type="object";let o=a.keyType,i=o._zod.bag,l=i?.patterns;if("loose"===a.mode&&l&&l.size>0){let e=nt(a.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});for(let t of(n.patternProperties={},l))n.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(n.propertyNames=nt(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=nt(a.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let s=o._zod.values;if(s){let e=[...s].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(n.required=e)}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function n9(e,t,n){return new n8(t&&t._zod?{type:"record",keyType:e,valueType:t,...ez(n)}:{type:"record",keyType:nE(),valueType:e,...ez(t)})}let n7=D("ZodEnum",(e,t)=>{tF.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a;(a=eh(e._zod.def.entries)).every(e=>"number"==typeof e)&&(n.type="number"),a.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=a},e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let a={};for(let r of e)if(n.has(r))a[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new n7({...t,checks:[],...ez(r),entries:a})},e.exclude=(e,r)=>{let a={...t.entries};for(let t of e)if(n.has(t))delete a[t];else throw Error(`Key ${t} not found in enum`);return new n7({...t,checks:[],...ez(r),entries:a})}});function re(e,t){return new n7({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...ez(t)})}let rt=D("ZodLiteral",(e,t)=>{t$.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let a=e._zod.def,o=[];for(let e of a.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e)if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else o.push(Number(e));else o.push(e);if(0===o.length);else if(1===o.length){let e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every(e=>"number"==typeof e)&&(n.type="number"),o.every(e=>"string"==typeof e)&&(n.type="string"),o.every(e=>"boolean"==typeof e)&&(n.type="boolean"),o.every(e=>null===e)&&(n.type="null"),n.enum=o})(e,t,n,0),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function rn(e,t){return new rt({type:"literal",values:Array.isArray(e)?e:[e],...ez(t)})}let rr=D("ZodTransform",(e,t)=>{tU.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")})(0,e,0,0),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new $(e.constructor.name);n.addIssue=r=>{"string"==typeof r?n.issues.push(eM(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(eM(r)))};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=a,n.fallback=!0,n)}}),ra=D("ZodOptional",(e,t)=>{tB.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ro(e){return new ra({type:"optional",innerType:e})}let ri=D("ZodExactOptional",(e,t)=>{tK.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),rl=D("ZodNullable",(e,t)=>{tV.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a,o,i;return o=nt((a=e._zod.def).innerType,t,r),i=t.seen.get(e),void("openapi-3.0"===t.target?(i.ref=a.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function rs(e){return new rl({type:"nullable",innerType:e})}let ru=D("ZodDefault",(e,t)=>{tW.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a;nt((a=e._zod.def).innerType,t,r),t.seen.get(e).ref=a.innerType,n.default=JSON.parse(JSON.stringify(a.defaultValue))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),rc=D("ZodPrefault",(e,t)=>{tZ.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a;nt((a=e._zod.def).innerType,t,r),t.seen.get(e).ref=a.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(a.defaultValue)))},e.unwrap=()=>e._zod.def.innerType}),rd=D("ZodNonOptional",(e,t)=>{tJ.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a;nt((a=e._zod.def).innerType,t,r),t.seen.get(e).ref=a.innerType},e.unwrap=()=>e._zod.def.innerType}),rf=D("ZodCatch",(e,t)=>{tQ.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let a,o=e._zod.def;nt(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{a=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}n.default=a})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),rp=D("ZodPipe",(e,t)=>{tY.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a,o,i;return o=(a=e._zod.def).in._zod.traits.has("$ZodTransform"),void(nt(i="input"===t.io?o?a.out:a.in:a.out,t,r),t.seen.get(e).ref=i)},e.in=t.in,e.out=t.out});function rh(e,t){return new rp({type:"pipe",in:e,out:t})}let rm=D("ZodReadonly",(e,t)=>{t0.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a;nt((a=e._zod.def).innerType,t,r),t.seen.get(e).ref=a.innerType,n.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),rg=D("ZodCustom",(e,t)=>{t2.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")})(0,e,0,0)});var ry=nE().trim().min(1,"名称不能为空").max(120,"名称不能超过 ".concat(120," 个字符")).refine(function(e){return!e.includes("/")&&!e.includes("\\")},"名称不能包含斜杠"),rv=function(e){return nE().max(e)},rb=nE().min(1).max(120),rx=re(I),rw=n9(rb,rv(4096)),rk=n9(rb,rv(1048576)),rj=re(["skip","overwrite"]);n3({password:rv(4096)}),n3({name:ry,baseUrl:rv(2048).optional(),apiKey:rv(4096).optional(),model:rv(120).optional(),notes:rv(4096).optional(),extras:rw.optional(),overrides:rk.optional(),providerId:rv(120).optional(),providerEndpoint:rv(120).optional()}).partial();var rS=n2(n3({key:nE().trim().min(1,"endpoint key 不能为空").max(60,"endpoint key 过长").refine(function(e){return!e.includes("/")&&!e.includes("\\")},"endpoint key 不能包含斜杠"),label:rv(120).optional(),baseUrl:nE().trim().min(1,"endpoint 需要 baseUrl").max(2048)})).max(50).refine(function(e){return new Set(e.map(function(e){return e.key})).size===e.length},"endpoint key 不能重复");n3({name:ry,apiKey:nE().min(1,"apiKey 不能为空").max(4096),endpoints:rS.optional(),notes:rv(4096).optional()}),n3({name:ry.optional(),apiKey:rv(4096).optional(),endpoints:rS.optional(),notes:rv(4096).optional()}),n3({sourceUser:nE().trim().min(1,"来源用户不能为空").max(120),conflictPolicy:rj.optional(),overwriteHarnesses:n2(rx).optional(),migrateCodexLoginCache:nQ().optional()});var rO=n3({format:rn("harness-switch-encrypted-export"),version:rn(1),kdf:n3({name:rn("scrypt"),salt:nE().min(1)}),cipher:n3({name:rn("aes-256-gcm"),iv:nE().min(1),tag:nE().min(1),data:nE().min(1)})});n3({passphrase:rv(4096),includeCodexLoginCache:nQ().optional()}),n3({envelope:rO,passphrase:rv(4096),conflictPolicy:rj.optional(),restoreActive:nQ().optional(),migrateCodexLoginCache:nQ().optional()});var rC=n3({id:nE().min(1).max(240),name:ry,target:re(["profile","vault"]),apiKey:rv(4096).optional(),providerId:rv(120).optional(),providerName:ry.optional(),overwrite:nQ().optional()});n3({selections:n2(rC).min(1,"请至少选择一条配置").max(200)}),n3({baseUrl:nE().trim().min(1,"baseUrl 不能为空").max(2048),apiKey:rv(4096).optional(),providerId:rv(120).optional()}),n3({endpoint:rv(120).optional()}),n3({});let rN=O("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);function rP(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=function e(t){var n,r,a="";if("string"==typeof t||"number"==typeof t)a+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(n=0;n<o;n++)t[n]&&(r=e(t[n]))&&(a&&(a+=" "),a+=r)}else for(r in t)t[r]&&(a&&(a+=" "),a+=r);return a}(e))&&(r&&(r+=" "),r+=t);return r}let rE=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,r_=(e,t)=>n=>{var r;if((null==t?void 0:t.variants)==null)return rP(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:a,defaultVariants:o}=t,i=Object.keys(a).map(e=>{let t=null==n?void 0:n[e],r=null==o?void 0:o[e];if(null===t)return null;let i=rE(t)||rE(r);return a[e][i]}),l=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{});return rP(e,i,null==t||null==(r=t.compoundVariants)?void 0:r.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...o,...l}[t]):({...o,...l})[t]===n})?[...e,n,r]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)},rz=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),rT=[],rA=(e,t,n)=>{if(0==e.length-t)return n.classGroupId;let r=e[t],a=n.nextPart.get(r);if(a){let n=rA(e,t+1,a);if(n)return n}let o=n.validators;if(null===o)return;let i=0===t?e.join("-"):e.slice(t).join("-"),l=o.length;for(let e=0;e<l;e++){let t=o[e];if(t.validator(i))return t.classGroupId}},rR=(e,t)=>{let n=rz();for(let r in e)rL(e[r],n,r,t);return n},rL=(e,t,n,r)=>{let a=e.length;for(let o=0;o<a;o++)rI(e[o],t,n,r)},rI=(e,t,n,r)=>{"string"==typeof e?rM(e,t,n):"function"==typeof e?rD(e,t,n,r):rF(e,t,n,r)},rM=(e,t,n)=>{(""===e?t:r$(t,e)).classGroupId=n},rD=(e,t,n,r)=>{rU(e)?rL(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:n,validator:e}))},rF=(e,t,n,r)=>{let a=Object.entries(e),o=a.length;for(let e=0;e<o;e++){let[o,i]=a[e];rL(i,r$(t,o),n,r)}},r$=(e,t)=>{let n=e,r=t.split("-"),a=r.length;for(let e=0;e<a;e++){let t=r[e],a=n.nextPart.get(t);a||(a=rz(),n.nextPart.set(t,a)),n=a}return n},rU=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,rH=[],rB=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),rK=/\s+/,rV=e=>{let t;if("string"==typeof e)return e;let n="";for(let r=0;r<e.length;r++)e[r]&&(t=rV(e[r]))&&(n&&(n+=" "),n+=t);return n},rW=[],rq=e=>{let t=t=>t[e]||rW;return t.isThemeGetter=!0,t},rZ=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,rJ=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rG=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,rQ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rY=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,rX=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,r0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,r1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,r2=e=>rG.test(e),r4=e=>!!e&&!Number.isNaN(Number(e)),r3=e=>!!e&&Number.isInteger(Number(e)),r5=e=>e.endsWith("%")&&r4(e.slice(0,-1)),r6=e=>rQ.test(e),r8=()=>!0,r9=e=>rY.test(e)&&!rX.test(e),r7=()=>!1,ae=e=>r0.test(e),at=e=>r1.test(e),an=e=>!ao(e)&&!ap(e),ar=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),aa=e=>aw(e,aO,r7),ao=e=>rZ.test(e),ai=e=>aw(e,aC,r9),al=e=>aw(e,aN,r4),as=e=>aw(e,aE,r8),au=e=>aw(e,aP,r7),ac=e=>aw(e,aj,r7),ad=e=>aw(e,aS,at),af=e=>aw(e,a_,ae),ap=e=>rJ.test(e),ah=e=>ak(e,aC),am=e=>ak(e,aP),ag=e=>ak(e,aj),ay=e=>ak(e,aO),av=e=>ak(e,aS),ab=e=>ak(e,a_,!0),ax=e=>ak(e,aE,!0),aw=(e,t,n)=>{let r=rZ.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},ak=(e,t,n=!1)=>{let r=rJ.exec(e);return!!r&&(r[1]?t(r[1]):n)},aj=e=>"position"===e||"percentage"===e,aS=e=>"image"===e||"url"===e,aO=e=>"length"===e||"size"===e||"bg-size"===e,aC=e=>"length"===e,aN=e=>"number"===e,aP=e=>"family-name"===e,aE=e=>"number"===e||"weight"===e,a_=e=>"shadow"===e,az=((e,...t)=>{let n,r,a,o,i=e=>{let t=r(e);if(t)return t;let o=((e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o,postfixLookupClassGroupIds:i}=t,l=[],s=e.trim().split(rK),u="";for(let e=s.length-1;e>=0;e-=1){let t,c=s[e],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:m}=n(c);if(d){u=c+(u.length>0?" "+u:u);continue}let g=!!m;if(g){let e=(t=r(h.substring(0,m)))&&i[t]?r(h):void 0;e&&e!==t&&(t=e,g=!1)}else t=r(h);if(!t){if(!g||!(t=r(h))){u=c+(u.length>0?" "+u:u);continue}g=!1}let y=0===f.length?"":1===f.length?f[0]:o(f).join(":"),v=p?y+"!":y,b=v+t;if(l.indexOf(b)>-1)continue;l.push(b);let x=a(t,g);for(let e=0;e<x.length;++e){let t=x[e];l.push(v+t)}u=c+(u.length>0?" "+u:u)}return u})(e,n);return a(e,o),o};return o=l=>{var s;let u;return r=(n={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),a=(a,o)=>{n[a]=o,++t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(a(e,t),t):void 0},set(e,t){e in n?n[e]=t:a(e,t)}}})((s=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t,n=[],r=0,a=0,o=0,i=e.length;for(let l=0;l<i;l++){let i=e[l];if(0===r&&0===a){if(":"===i){n.push(e.slice(o,l)),o=l+1;continue}if("/"===i){t=l;continue}}"["===i?r++:"]"===i?r--:"("===i?a++:")"===i&&a--}let l=0===n.length?e:e.slice(o),s=l,u=!1;return l.endsWith("!")?(s=l.slice(0,-1),u=!0):l.startsWith("!")&&(s=l.slice(1),u=!0),rB(n,u,s,t&&t>o?t-o:void 0)};if(t){let e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):rB(rH,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r})(s),sortModifiers:(u=new Map,s.orderSensitiveModifiers.forEach((e,t)=>{u.set(e,1e6+t)}),e=>{let t=[],n=[];for(let r=0;r<e.length;r++){let a=e[r],o="["===a[0],i=u.has(a);o||i?(n.length>0&&(n.sort(),t.push(...n),n=[]),t.push(a)):n.push(a)}return n.length>0&&(n.sort(),t.push(...n)),t}),postfixLookupClassGroupIds:(e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t})(s),...(e=>{let t=(e=>{let{theme:t,classGroups:n}=e;return rR(n,t)})(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var n;let t,r,a;return -1===(n=e).slice(1,-1).indexOf(":")?void 0:(r=(t=n.slice(1,-1)).indexOf(":"),(a=t.slice(0,r))?"arbitrary.."+a:void 0)}let r=e.split("-"),a=+(""===r[0]&&r.length>1);return rA(r,a,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],a=n[e];if(t){if(a){let e=Array(a.length+t.length);for(let t=0;t<a.length;t++)e[t]=a[t];for(let n=0;n<t.length;n++)e[a.length+n]=t[n];return e}return t}return a||rT}return n[e]||rT}}})(s)}).cache.get,a=n.cache.set,o=i,i(l)},(...e)=>o(((...e)=>{let t,n,r=0,a="";for(;r<e.length;)(t=e[r++])&&(n=rV(t))&&(a&&(a+=" "),a+=n);return a})(...e))})(()=>{let e=rq("color"),t=rq("font"),n=rq("text"),r=rq("font-weight"),a=rq("tracking"),o=rq("leading"),i=rq("breakpoint"),l=rq("container"),s=rq("spacing"),u=rq("radius"),c=rq("shadow"),d=rq("inset-shadow"),f=rq("text-shadow"),p=rq("drop-shadow"),h=rq("blur"),m=rq("perspective"),g=rq("aspect"),y=rq("ease"),v=rq("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...x(),ap,ao],k=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],S=()=>[ap,ao,s],O=()=>[r2,"full","auto",...S()],C=()=>[r3,"none","subgrid",ap,ao],N=()=>["auto",{span:["full",r3,ap,ao]},r3,ap,ao],P=()=>[r3,"auto",ap,ao],E=()=>["auto","min","max","fr",ap,ao],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],T=()=>["auto",...S()],A=()=>[r2,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],R=()=>[r2,"screen","full","dvw","lvw","svw","min","max","fit",...S()],L=()=>[r2,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],I=()=>[e,ap,ao],M=()=>[...x(),ag,ac,{position:[ap,ao]}],D=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",ay,aa,{size:[ap,ao]}],$=()=>[r5,ah,ai],U=()=>["","none","full",u,ap,ao],H=()=>["",r4,ah,ai],B=()=>["solid","dashed","dotted","double"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>[r4,r5,ag,ac],W=()=>["","none",h,ap,ao],q=()=>["none",r4,ap,ao],Z=()=>["none",r4,ap,ao],J=()=>[r4,ap,ao],G=()=>[r2,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[r6],breakpoint:[r6],color:[r8],container:[r6],"drop-shadow":[r6],ease:["in","out","in-out"],font:[an],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[r6],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[r6],shadow:[r6],spacing:["px",r4],text:[r6],"text-shadow":[r6],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",r2,ao,ap,g]}],container:["container"],"container-type":[{"@container":["","normal","size",ap,ao]}],"container-named":[ar],columns:[{columns:[r4,ao,ap,l]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[r3,"auto",ap,ao]}],basis:[{basis:[r2,"full","auto",l,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[r4,r2,"auto","initial","none",ao]}],grow:[{grow:["",r4,ap,ao]}],shrink:[{shrink:["",r4,ap,ao]}],order:[{order:[r3,"first","last","none",ap,ao]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mbs:[{mbs:T()}],mbe:[{mbe:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],"inline-size":[{inline:["auto",...R()]}],"min-inline-size":[{"min-inline":["auto",...R()]}],"max-inline-size":[{"max-inline":["none",...R()]}],"block-size":[{block:["auto",...L()]}],"min-block-size":[{"min-block":["auto",...L()]}],"max-block-size":[{"max-block":["none",...L()]}],w:[{w:[l,"screen",...A()]}],"min-w":[{"min-w":[l,"screen","none",...A()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh",...A()]}],"font-size":[{text:["base",n,ah,ai]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ax,as]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",r5,ao]}],"font-family":[{font:[am,au,t]}],"font-features":[{"font-features":[ao]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ap,ao]}],"line-clamp":[{"line-clamp":[r4,"none",ap,al]}],leading:[{leading:[o,...S()]}],"list-image":[{"list-image":["none",ap,ao]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ap,ao]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:[r4,"from-font","auto",ap,ai]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[r4,"auto",ap,ao]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"tab-size":[{tab:[r3,ap,ao]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ap,ao]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ap,ao]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:D()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},r3,ap,ao],radial:["",ap,ao],conic:[r3,ap,ao]},av,ad]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-bs":[{"border-bs":H()}],"border-w-be":[{"border-be":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":H()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...B(),"hidden","none"]}],"divide-style":[{divide:[...B(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...B(),"none","hidden"]}],"outline-offset":[{"outline-offset":[r4,ap,ao]}],"outline-w":[{outline:["",r4,ah,ai]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",c,ab,af]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",d,ab,af]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[r4,ai]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",f,ab,af]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[r4,ap,ao]}],"mix-blend":[{"mix-blend":[...K(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":K()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[r4]}],"mask-image-linear-from-pos":[{"mask-linear-from":V()}],"mask-image-linear-to-pos":[{"mask-linear-to":V()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":V()}],"mask-image-t-to-pos":[{"mask-t-to":V()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":V()}],"mask-image-r-to-pos":[{"mask-r-to":V()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":V()}],"mask-image-b-to-pos":[{"mask-b-to":V()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":V()}],"mask-image-l-to-pos":[{"mask-l-to":V()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":V()}],"mask-image-x-to-pos":[{"mask-x-to":V()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":V()}],"mask-image-y-to-pos":[{"mask-y-to":V()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[ap,ao]}],"mask-image-radial-from-pos":[{"mask-radial-from":V()}],"mask-image-radial-to-pos":[{"mask-radial-to":V()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[r4]}],"mask-image-conic-from-pos":[{"mask-conic-from":V()}],"mask-image-conic-to-pos":[{"mask-conic-to":V()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:D()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ap,ao]}],filter:[{filter:["","none",ap,ao]}],blur:[{blur:W()}],brightness:[{brightness:[r4,ap,ao]}],contrast:[{contrast:[r4,ap,ao]}],"drop-shadow":[{"drop-shadow":["","none",p,ab,af]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",r4,ap,ao]}],"hue-rotate":[{"hue-rotate":[r4,ap,ao]}],invert:[{invert:["",r4,ap,ao]}],saturate:[{saturate:[r4,ap,ao]}],sepia:[{sepia:["",r4,ap,ao]}],"backdrop-filter":[{"backdrop-filter":["","none",ap,ao]}],"backdrop-blur":[{"backdrop-blur":W()}],"backdrop-brightness":[{"backdrop-brightness":[r4,ap,ao]}],"backdrop-contrast":[{"backdrop-contrast":[r4,ap,ao]}],"backdrop-grayscale":[{"backdrop-grayscale":["",r4,ap,ao]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[r4,ap,ao]}],"backdrop-invert":[{"backdrop-invert":["",r4,ap,ao]}],"backdrop-opacity":[{"backdrop-opacity":[r4,ap,ao]}],"backdrop-saturate":[{"backdrop-saturate":[r4,ap,ao]}],"backdrop-sepia":[{"backdrop-sepia":["",r4,ap,ao]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ap,ao]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[r4,"initial",ap,ao]}],ease:[{ease:["linear","initial",y,ap,ao]}],delay:[{delay:[r4,ap,ao]}],animate:[{animate:["none",v,ap,ao]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ap,ao]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:q()}],"rotate-x":[{"rotate-x":q()}],"rotate-y":[{"rotate-y":q()}],"rotate-z":[{"rotate-z":q()}],scale:[{scale:Z()}],"scale-x":[{"scale-x":Z()}],"scale-y":[{"scale-y":Z()}],"scale-z":[{"scale-z":Z()}],"scale-3d":["scale-3d"],skew:[{skew:J()}],"skew-x":[{"skew-x":J()}],"skew-y":[{"skew-y":J()}],transform:[{transform:[ap,ao,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:G()}],"translate-x":[{"translate-x":G()}],"translate-y":[{"translate-y":G()}],"translate-z":[{"translate-z":G()}],"translate-none":["translate-none"],zoom:[{zoom:[r3,ap,ao]}],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ap,ao]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ap,ao]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[r4,ah,ai,al]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function aT(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return az(rP(t))}var aA=r_("inline-flex items-center rounded-full border px-2.5 py-1 text-[11px] font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function aR(e){var t=e.className,n=e.variant,r=function(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,["className","variant"]);return(0,g.jsx)("div",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"badge",className:aT(aA({variant:n}),t)},r))}function aL(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function aI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function aM(e){return(aM=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function aD(e,t){return(aD=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function aF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(aF=function(){return!!e})()}var a$=(0,y.lazy)(function(){var e;return(e=function(){return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:return[4,Promise.all([d.e("6150"),d.e("4952")]).then(d.bind(d,1419))];case 1:return[2,{default:e.sent().PierreFileDiff}]}})},function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){aL(o,r,a,i,l,"next",e)}function l(e){aL(o,r,a,i,l,"throw",e)}i(void 0)})})()});function aU(e){return null===e.content&&null===e.currentContent?"same":null===e.content?"delete":null===e.currentContent?"create":e.content===e.currentContent?"same":"replace"}function aH(e){var t=e.files;return(0,g.jsx)("div",{className:"space-y-3",children:t.map(function(e){return(0,g.jsx)(aB,{file:e},e.path)})})}function aB(e){var t=e.file,n=(0,x.Bd)().t,r=aU(t);return(0,g.jsxs)("div",{className:"overflow-hidden rounded-xl border",children:[(0,g.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b bg-muted/40 px-3 py-2",children:[(0,g.jsx)("p",{className:"min-w-0 truncate font-mono text-xs",title:t.path,children:t.path}),(0,g.jsx)(aR,{variant:"secondary",children:n("diff.".concat(r))})]}),(0,g.jsx)(aV,{fallback:(0,g.jsx)(aK,{file:t}),children:(0,g.jsx)(y.Suspense,{fallback:(0,g.jsx)("p",{className:"px-3 py-4 text-sm text-muted-foreground",children:n("diff.rendering")}),children:(0,g.jsx)(a$,{file:t})})})]})}function aK(e){var t,n,r=e.file,a=(0,x.Bd)().t;return(0,g.jsxs)("div",{className:"grid gap-2 p-3 font-mono text-xs",children:[(0,g.jsx)("pre",{className:"whitespace-pre-wrap text-red-400/90",children:null!=(t=r.currentContent)?t:a("diff.absent")}),(0,g.jsx)("p",{className:"font-sans text-muted-foreground",children:a("diff.afterRestore")}),(0,g.jsx)("pre",{className:"whitespace-pre-wrap text-emerald-400/90",children:null!=(n=r.content)?n:a("diff.deletedAfterRestore")})]})}var aV=function(e){var t,n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t,n,a,o;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return t=r,n=arguments,t=aM(t),e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,aF()?Reflect.construct(t,n||[],aM(this).constructor):t.apply(this,n)),o={failed:!1},(a="state")in e?Object.defineProperty(e,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[a]=o,e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&aD(r,e),n=[{key:"getDerivedStateFromError",value:function(){return{failed:!0}}}],t=[{key:"render",value:function(){return this.state.failed?this.props.fallback:this.props.children}}],aI(r.prototype,t),n&&aI(r,n),r}(y.Component),aW=Object.defineProperty,aq=(e,t)=>aW(e,"name",{value:t,configurable:!0});function aZ(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function aJ(...e){return t=>{let n=!1,r=e.map(e=>{let r=aZ(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():aZ(e[t],null)}}}}function aG(...e){return y.useCallback(aJ(...e),e)}aq(aZ,"setRef"),aq(aJ,"composeRefs"),aq(aG,"useComposedRefs");var aQ=Object.defineProperty,aY=(e,t)=>aQ(e,"name",{value:t,configurable:!0});function aX(e){let t=y.forwardRef((t,n)=>{let{children:r,...a}=t,o=null,i=!1,l=[];a8(r)&&"function"==typeof ot&&(r=ot(r._payload)),y.Children.forEach(r,e=>{if(a5(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;a8(t)&&"function"==typeof ot&&(t=ot(t._payload)),o=a2(e,t),l.push(o?.props?.children)}else l.push(e)}),o?o=y.cloneElement(o,void 0,l):!i&&1===y.Children.count(r)&&y.isValidElement(r)&&(o=r);let s=o?a3(o):void 0,u=aG(n,s);if(!o){if(r||0===r)throw Error(i?oe(e):a7(e));return r}let c=a4(a,o.props??{});return o.type!==y.Fragment&&(c.ref=n?u:s),y.cloneElement(o,c)});return t.displayName=`${e}.Slot`,t}aY(aX,"createSlot");var a0=aX("Slot"),a1=Symbol.for("radix.slottable");aY(function(e){let t=aY(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=a1,t},"createSlottable");var a2=aY((e,t)=>{if("child"in e.props){let t=e.props.child;return y.isValidElement(t)?y.cloneElement(t,void 0,e.props.children(t.props.children)):null}return y.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function a4(e,t){let n={...t};for(let r in t){let a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...e)=>{let t=o(...e);return a(...e),t}:a&&(n[r]=a):"style"===r?n[r]={...a,...o}:"className"===r&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function a3(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function a5(e){return y.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===a1}aY(a4,"mergeProps"),aY(a3,"getElementRef"),aY(a5,"isSlottable");var a6=Symbol.for("react.lazy");function a8(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===a6&&"_payload"in e&&a9(e._payload)}function a9(e){return"object"==typeof e&&null!==e&&"then"in e}aY(a8,"isLazyComponent"),aY(a9,"isPromiseLike");var a7=aY(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),oe=aY(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ot=v[" use ".trim().toString()],on=r_("inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-[10px] text-sm font-medium transition-[color,background-color,border-color,box-shadow,transform] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-background active:translate-y-px disabled:pointer-events-none disabled:opacity-50 disabled:active:translate-y-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-[0_8px_20px_-10px_color-mix(in_srgb,var(--primary)_65%,transparent)] hover:bg-primary/90 hover:shadow-[0_10px_24px_-10px_color-mix(in_srgb,var(--primary)_80%,transparent)]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/88",outline:"border border-input bg-card shadow-[0_1px_2px_rgb(20_24_40/0.04)] hover:border-ring/35 hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent/75 hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3 text-xs",lg:"h-11 px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}});function or(e){var t=e.className,n=e.variant,r=e.size,a=e.asChild,o=function(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,["className","variant","size","asChild"]);return(0,g.jsx)(void 0!==a&&a?a0:"button",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"button",className:aT(on({variant:n,size:r,className:t}))},o))}var oa=Object.defineProperty,oo=(e,t)=>oa(e,"name",{value:t,configurable:!0}),oi=!!("u">typeof window&&window.document&&window.document.createElement);function ol(e,t,{checkForDefaultPrevented:n=!0}={}){return oo(function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}function os(e){if(!oi)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function ou(e){return"IFRAME"===e.tagName}oo(ol,"composeEventHandlers"),oo(function(e){if(!oi)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window},"getOwnerWindow"),oo(os,"getOwnerDocument"),oo(function e(t,n=!1){let{activeElement:r}=os(t);if(!r?.nodeName)return null;if(ou(r)&&r.contentDocument)return e(r.contentDocument.body,n);if(n){let e=r.getAttribute("aria-activedescendant");if(e){let t=os(r).getElementById(e);if(t)return t}}return r},"getActiveElement"),oo(ou,"isFrame");var oc=Object.defineProperty,od=(e,t)=>oc(e,"name",{value:t,configurable:!0});function of(e,t=[]){let n=[];function r(t,r){let a=y.createContext(r);a.displayName=t+"Context";let o=n.length;n=[...n,r];let i=od(t=>{let{scope:n,children:r,...i}=t,l=n?.[e]?.[o]||a,s=y.useMemo(()=>i,Object.values(i));return(0,g.jsx)(l.Provider,{value:s,children:r})},"Provider");function l(n,i,s={}){let{optional:u=!1}=s,c=i?.[e]?.[o]||a,d=y.useContext(c);if(d)return d;if(void 0!==r)return r;if(!u)throw Error(`\`${n}\` must be used within \`${t}\``)}return i.displayName=t+"Provider",od(l,"useContext"),[i,l]}od(r,"createContext");let a=od(()=>{let t=n.map(e=>y.createContext(e));return od(function(n){let r=n?.[e]||t;return y.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},"useScope")},"createScope");return a.scopeName=e,[r,op(a,...t)]}function op(...e){let t=e[0];if(1===e.length)return t;let n=od(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return od(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let a=n(e)[`__scope${r}`];return{...t,...a}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}od(function(e,t){let n=y.createContext(t);n.displayName=e+"Context";let r=od(e=>{let{children:t,...r}=e,a=y.useMemo(()=>r,Object.values(r));return(0,g.jsx)(n.Provider,{value:a,children:t})},"Provider");function a(r,o={}){let{optional:i=!1}=o,l=y.useContext(n);if(l)return l;if(void 0!==t)return t;if(!i)throw Error(`\`${r}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",od(a,"useContext"),[r,a]},"createContext"),od(of,"createContextScope"),od(op,"composeContextScopes");var oh=globalThis?.document?y.useLayoutEffect:()=>{},om=Object.defineProperty,og=v[" useId ".trim().toString()]||(()=>void 0),oy=0;function ov(e){let[t,n]=y.useState(og());return oh(()=>{e||n(e=>e??String(oy++))},[e]),e||(t?`radix-${t}`:"")}om(ov,"name",{value:"useId",configurable:!0});var ob=Object.defineProperty,ox=v[" useEffectEvent ".trim().toString()],ow=v[" useInsertionEffect ".trim().toString()];function ok(e){if("function"==typeof ox)return ox(e);let t=y.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof ow?ow(()=>{t.current=e}):oh(()=>{t.current=e}),y.useMemo(()=>(...e)=>t.current?.(...e),[])}ob(ok,"name",{value:"useEffectEvent",configurable:!0});var oj=Object.defineProperty,oS=(e,t)=>oj(e,"name",{value:t,configurable:!0}),oO=v[" useInsertionEffect ".trim().toString()]||oh;function oC({prop:e,defaultProp:t,onChange:n=oS(()=>{},"onChange"),caller:r}){let[a,o,i]=oN({defaultProp:t,onChange:n}),l=void 0!==e,s=l?e:a;return[s,y.useCallback(t=>{if(l){let n=oP(t)?t(e):t;n!==e&&i.current?.(n)}else o(t)},[l,e,o,i])]}function oN({defaultProp:e,onChange:t}){let[n,r]=y.useState(e),a=y.useRef(n),o=y.useRef(t);return oO(()=>{o.current=t},[t]),y.useEffect(()=>{a.current!==n&&(o.current?.(n),a.current=n)},[n,a]),[n,r,o]}function oP(e){return"function"==typeof e}oS(oC,"useControllableState"),oS(oN,"useUncontrolledState"),oS(oP,"isFunction");var oE=Symbol("RADIX:SYNC_STATE");oS(function(e,t,n,r){let{prop:a,defaultProp:o,onChange:i,caller:l}=t,s=void 0!==a,u=ok(i),c=[{...n,state:o}];r&&c.push(r);let[d,f]=y.useReducer((t,n)=>{if(n.type===oE)return{...t,state:n.state};let r=e(t,n);return s&&!Object.is(r.state,t.state)&&u(r.state),r},...c),p=d.state,h=y.useRef(p);y.useEffect(()=>{h.current!==p&&(h.current=p,s||u(p))},[p,h,s]);let m=y.useMemo(()=>void 0!==a?{...d,state:a}:d,[d,a]);return y.useEffect(()=>{s&&!Object.is(a,d.state)&&f({type:oE,state:a})},[a,d.state,s]),[m,f]},"useControllableStateReducer");var o_=d(3144),oz=Object.defineProperty,oT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=aX(`Primitive.${t}`),r=y.forwardRef((e,r)=>{let{asChild:a,...o}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(a?n:t,{...o,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function oA(e,t){e&&o_.flushSync(()=>e.dispatchEvent(t))}function oR(e){let t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...e)=>t.current?.(...e),[])}oz(oA,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),(0,Object.defineProperty)(oR,"name",{value:"useCallbackRef",configurable:!0});var oL=Object.defineProperty,oI=(e,t)=>oL(e,"name",{value:t,configurable:!0}),oM="dismissableLayer.update",oD=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),oF=y.forwardRef(oI(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...u}=e,c=y.useContext(oD),[d,f]=y.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=y.useState({}),v=aG(t,f),b=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=x?b.indexOf(x):-1,k=d?b.indexOf(d):-1,j=c.layersWithOutsidePointerEventsDisabled.size>0,S=k>=w,O=y.useRef(!1),C=oH(e=>{o?.(e),l?.(e),e.defaultPrevented||s?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:c.dismissableSurfaces,shouldHandlePointerDownOutside:y.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...c.branches].some(t=>t.contains(e));return S&&!t},[c.branches,S])}),N=oB(e=>{if(r&&O.current)return;let t=e.target;![...c.branches].some(e=>e.contains(t))&&(i?.(e),l?.(e),e.defaultPrevented||s?.())},p),P=!!d&&k===b.length-1,E=oR(e=>{"Escape"===e.key&&(a?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))});return y.useEffect(()=>{if(P)return p.addEventListener("keydown",E,{capture:!0}),()=>p.removeEventListener("keydown",E,{capture:!0})},[p,P,E]),y.useEffect(()=>{if(d)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(h=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),oK(),()=>{n&&(c.layersWithOutsidePointerEventsDisabled.delete(d),0===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=h))}},[d,p,n,c]),y.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),oK())},[d,c]),y.useEffect(()=>{let e=oI(()=>m({}),"handleUpdate");return document.addEventListener(oM,e),()=>document.removeEventListener(oM,e)},[]),(0,g.jsx)(oT.div,{...u,ref:v,style:{pointerEvents:j?S?"auto":"none":void 0,...e.style},onFocusCapture:ol(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ol(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ol(e.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function o$(){let e=y.useContext(oD),[t,n]=y.useState(null);return y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}oI(o$,"useDismissableLayerSurface");var oU=oI(()=>!0,"IS_TRUE");function oH(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:o,shouldHandlePointerDownOutside:i=oU}=t,l=oR(e),s=y.useRef(!1),u=y.useRef(!1),c=y.useRef(new Map),d=y.useRef(()=>{});return y.useEffect(()=>{function e(){u.current=!1,a.current=!1,c.current.clear()}function t(){return Array.from(c.current.values()).some(Boolean)}function f(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...o].some(e=>e.contains(t))||c.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{u.current&&d.current()},0)}function p(e){u.current&&c.current.set(e.type,!1)}oI(e,"resetOutsideInteraction"),oI(t,"isOutsideInteractionIntercepted"),oI(f,"handleInteractionCapture"),oI(p,"handleInteractionBubble");let h=oI(o=>{if(o.target&&!s.current){let f=function(){n.removeEventListener("click",d.current);let r=t();e(),r||oV("dismissableLayer.pointerDownOutside",l,p,{discrete:!0})};if(oI(f,"handleAndDispatchPointerDownOutsideEvent"),!i(o.target)){n.removeEventListener("click",d.current),e(),s.current=!1;return}let p={originalEvent:o};u.current=!0,a.current=r&&0===o.button,c.current.clear(),r&&0===o.button?(n.removeEventListener("click",d.current),d.current=f,n.addEventListener("click",d.current,{once:!0})):f()}else n.removeEventListener("click",d.current),e();s.current=!1},"handlePointerDown"),m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of m)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener("pointerdown",h)},0);return()=>{for(let e of(window.clearTimeout(g),n.removeEventListener("pointerdown",h),n.removeEventListener("click",d.current),m))n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,l,r,a,o,i]),{onPointerDownCapture:oI(()=>s.current=!0,"onPointerDownCapture")}}function oB(e,t=globalThis?.document){let n=oR(e),r=y.useRef(!1);return y.useEffect(()=>{let e=oI(e=>{e.target&&!r.current&&oV("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:oI(()=>r.current=!0,"onFocusCapture"),onBlurCapture:oI(()=>r.current=!1,"onBlurCapture")}}function oK(){let e=new CustomEvent(oM);document.dispatchEvent(e)}function oV(e,t,n,{discrete:r}){let a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?oA(a,o):a.dispatchEvent(o)}oI(oH,"usePointerDownOutside"),oI(oB,"useFocusOutside"),oI(oK,"dispatchUpdate"),oI(oV,"handleAndDispatchCustomEvent");var oW=Object.defineProperty,oq=(e,t)=>oW(e,"name",{value:t,configurable:!0}),oZ="focusScope.autoFocusOnMount",oJ="focusScope.autoFocusOnUnmount",oG={bubbles:!1,cancelable:!0},oQ=y.forwardRef(oq(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...i}=e,[l,s]=y.useState(null),u=oR(a),c=oR(o),d=y.useRef(null),f=aG(t,s),p=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let e=function(e){if(p.paused||!l)return;let t=e.target;l.contains(t)?d.current=t:o3(d.current,{select:!0})},t=function(e){if(p.paused||!l)return;let t=e.relatedTarget;null!==t&&(l.contains(t)||o3(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&o3(l)};oq(e,"handleFocusIn"),oq(t,"handleFocusOut"),oq(n,"handleMutations"),document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[r,l,p.paused]),y.useEffect(()=>{if(l){o5.add(p);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(oZ,oG);l.addEventListener(oZ,u),l.dispatchEvent(t),t.defaultPrevented||(oY(o9(o0(l)),{select:!0}),document.activeElement===e&&o3(l))}return()=>{l.removeEventListener(oZ,u),setTimeout(()=>{let t=new CustomEvent(oJ,oG);l.addEventListener(oJ,c),l.dispatchEvent(t),t.defaultPrevented||o3(e??document.body,{select:!0}),l.removeEventListener(oJ,c),o5.remove(p)},0)}}},[l,u,c,p]);let h=y.useCallback(e=>{if(!n&&!r||p.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){let t=e.currentTarget,[r,o]=oX(t);r&&o?e.shiftKey||a!==o?e.shiftKey&&a===r&&(e.preventDefault(),n&&o3(o,{select:!0})):(e.preventDefault(),n&&o3(r,{select:!0})):a===t&&e.preventDefault()}},[n,r,p.paused]);return(0,g.jsx)(oT.div,{tabIndex:-1,...i,ref:f,onKeyDown:h})},"FocusScope"));function oY(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(o3(r,{select:t}),document.activeElement!==n)return}function oX(e){let t=o0(e);return[o1(t,e),o1(t.reverse(),e)]}function o0(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:oq(e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}function o1(e,t){let n="function"==typeof t.checkVisibility&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):o2(r,{upTo:t})))return r}function o2(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function o4(e){return e instanceof HTMLInputElement&&"select"in e}function o3(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&o4(e)&&t&&e.select()}}oq(oY,"focusFirst"),oq(oX,"getTabbableEdges"),oq(o0,"getTabbableCandidates"),oq(o1,"findVisible"),oq(o2,"isHidden"),oq(o4,"isSelectableInput"),oq(o3,"focus");var o5=o6();function o6(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),(e=o8(e,t)).unshift(t)},remove(t){e=o8(e,t),e[0]?.resume()}}}function o8(e,t){let n=[...e],r=n.indexOf(t);return -1!==r&&n.splice(r,1),n}function o9(e){return e.filter(e=>"A"!==e.tagName)}oq(o6,"createFocusScopesStack"),oq(o8,"arrayRemove"),oq(o9,"removeLinks");var o7=Object.defineProperty,ie=y.forwardRef(o7(function(e,t){let{container:n,...r}=e,[a,o]=y.useState(!1);oh(()=>o(!0),[]);let i=n||a&&globalThis?.document?.body;return i?o_.createPortal((0,g.jsx)(oT.div,{...r,ref:t}),i):null},"name",{value:"Portal",configurable:!0})),it=Object.defineProperty,ir=(e,t)=>it(e,"name",{value:t,configurable:!0});function ia(e,t){return y.useReducer((e,n)=>t[e][n]??e,e)}ir(ia,"useStateMachine");var io=ir(e=>{let{present:t,children:n}=e,r=ii(t),a="function"==typeof n?n({present:r.isPresent}):y.Children.only(n),o=is(r.ref,ic(a));return"function"==typeof n||r.isPresent?y.cloneElement(a,{ref:o}):null},"Presence");function ii(e){let[t,n]=y.useState(),r=y.useRef(null),a=y.useRef(e),o=y.useRef("none"),i=y.useRef(void 0),[l,s]=ia(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{"mounted"===l?(o.current=i.current??iu(r.current),i.current=void 0):o.current="none"},[l]),oh(()=>{let t=r.current,n=a.current;if(n!==e){let r=o.current,l=iu(t);e?(i.current=l,s("MOUNT")):"none"===l||t?.display==="none"?s("UNMOUNT"):n&&r!==l?s("ANIMATION_OUT"):s("UNMOUNT"),a.current=e}},[e,s]),oh(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,i=ir(o=>{let i=iu(r.current).includes(CSS.escape(o.animationName));if(o.target===t&&i&&(s("ANIMATION_END"),!a.current)){let r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},"handleAnimationEnd"),l=ir(e=>{e.target===t&&(o.current=iu(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,i.current=iu(t)}else r.current=null;n(e)},[])}}function il(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function is(...e){let t=y.useRef(e);return t.current=e,y.useCallback(e=>{let n=t.current,r=!1,a=n.map(t=>{let n=il(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<a.length;e++){let t=a[e];"function"==typeof t?t():il(n[e],null)}}},[])}function iu(e){return e?.animationName||"none"}function ic(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}ir(ii,"usePresence"),ir(il,"setRef"),ir(is,"useStableComposedRefs"),ir(iu,"getAnimationName"),ir(ic,"getElementRef");var id=Object.defineProperty,ip=(e,t)=>id(e,"name",{value:t,configurable:!0}),ih=0,im=null;function ig(){y.useEffect(()=>{im||(im={start:iy(),end:iy()});let{start:e,end:t}=im;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),ih++,()=>{1===ih&&(im?.start.remove(),im?.end.remove(),im=null),ih=Math.max(0,ih-1)}},[])}function iy(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}ip(function(e){return ig(),e.children},"FocusGuards"),ip(ig,"useFocusGuards"),ip(iy,"createFocusGuard");var iv=function(){return(iv=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function ib(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)0>t.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}var ix="right-scroll-bar-position",iw="width-before-scroll-bar";function ik(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var ij="u">typeof window?y.useLayoutEffect:y.useEffect,iS=new WeakMap,iO=(void 0===a&&(a={}),(void 0===o&&(o=function(e){return e}),i=[],l=!1,s={read:function(){if(l)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:null},useMedium:function(e){var t=o(e,l);return i.push(t),function(){i=i.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(l=!0;i.length;){var t=i;i=[],t.forEach(e)}i={push:function(t){return e(t)},filter:function(){return i}}},assignMedium:function(e){l=!0;var t=[];if(i.length){var n=i;i=[],n.forEach(e),t=i}var r=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(r)};a(),i={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),i}}}}).options=iv({async:!0,ssr:!1},a),s),iC=function(){},iN=y.forwardRef(function(e,t){var n,r,a,o,i=y.useRef(null),l=y.useState({onScrollCapture:iC,onWheelCapture:iC,onTouchMoveCapture:iC}),s=l[0],u=l[1],c=e.forwardProps,d=e.children,f=e.className,p=e.removeScrollBar,h=e.enabled,m=e.shards,g=e.sideCar,v=e.noRelative,b=e.noIsolation,x=e.inert,w=e.allowPinchZoom,k=e.as,j=e.gapMode,S=ib(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=(n=[i,t],r=function(e){return n.forEach(function(t){return ik(t,e)})},(a=(0,y.useState)(function(){return{value:null,callback:r,facade:{get current(){return a.value},set current(value){var e=a.value;e!==value&&(a.value=value,a.callback(value,e))}}}})[0]).callback=r,o=a.facade,ij(function(){var e=iS.get(o);if(e){var t=new Set(e),r=new Set(n),a=o.current;t.forEach(function(e){r.has(e)||ik(e,null)}),r.forEach(function(e){t.has(e)||ik(e,a)})}iS.set(o,n)},[n]),o),C=iv(iv({},S),s);return y.createElement(y.Fragment,null,h&&y.createElement(g,{sideCar:iO,removeScrollBar:p,shards:m,noRelative:v,noIsolation:b,inert:x,setCallbacks:u,allowPinchZoom:!!w,lockRef:i,gapMode:j}),c?y.cloneElement(y.Children.only(d),iv(iv({},C),{ref:O})):y.createElement(void 0===k?"div":k,iv({},C,{className:f,ref:O}),d))});iN.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},iN.classNames={fullWidth:iw,zeroRight:ix};var iP=function(e){var t=e.sideCar,n=ib(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return y.createElement(r,iv({},n))};iP.isSideCarExport=!0;var iE=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=m||d.nc;return t&&e.setAttribute("nonce",t),e}())){var r,a;(r=t).styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),a=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(a)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},i_=function(){var e=iE();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},iz=function(){var e=i_();return function(t){return e(t.styles,t.dynamic),null}},iT={left:0,top:0,right:0,gap:0},iA=function(e){return parseInt(e||"",10)||0},iR=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[iA(n),iA(r),iA(a)]},iL=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return iT;var t=iR(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},iI=iz(),iM="data-scroll-locked",iD=function(e,t,n,r){var a=e.left,o=e.top,i=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(l,"px ").concat(r,";\n }\n body[").concat(iM,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(ix," {\n right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(iw," {\n margin-right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(ix," .").concat(ix," {\n right: 0 ").concat(r,";\n }\n \n .").concat(iw," .").concat(iw," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(iM,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},iF=function(){var e=parseInt(document.body.getAttribute(iM)||"0",10);return isFinite(e)?e:0},i$=function(){y.useEffect(function(){return document.body.setAttribute(iM,(iF()+1).toString()),function(){var e=iF()-1;e<=0?document.body.removeAttribute(iM):document.body.setAttribute(iM,e.toString())}},[])},iU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=void 0===r?"margin":r;i$();var o=y.useMemo(function(){return iL(a)},[a]);return y.createElement(iI,{styles:iD(o,!t,a,n?"":"!important")})},iH=!1;if("u">typeof window)try{var iB=Object.defineProperty({},"passive",{get:function(){return iH=!0,!0}});window.addEventListener("test",iB,iB),window.removeEventListener("test",iB,iB)}catch(e){iH=!1}var iK=!!iH&&{passive:!1},iV=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&(n.overflowY!==n.overflowX||"TEXTAREA"===e.tagName||"visible"!==n[t])},iW=function(e,t){var n=t.ownerDocument,r=t;do{if("u">typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),iq(e,r)){var a=iZ(e,r);if(a[1]>a[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},iq=function(e,t){return"v"===e?iV(t,"overflowY"):iV(t,"overflowX")},iZ=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},iJ=function(e,t,n,r,a){var o,i=(o=window.getComputedStyle(t).direction,"h"===e&&"rtl"===o?-1:1),l=i*r,s=n.target,u=t.contains(s),c=!1,d=l>0,f=0,p=0;do{if(!s)break;var h=iZ(e,s),m=h[0],g=h[1]-h[2]-i*m;(m||g)&&iq(e,s)&&(f+=g,p+=m);var y=s.parentNode;s=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return d&&(a&&1>Math.abs(f)||!a&&l>f)?c=!0:!d&&(a&&1>Math.abs(p)||!a&&-l>p)&&(c=!0),c},iG=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},iQ=function(e){return[e.deltaX,e.deltaY]},iY=function(e){return e&&"current"in e?e.current:e},iX=0,i0=[];let i1=(u=function(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),a=y.useState(iX++)[0],o=y.useState(iz)[0],i=y.useRef(e);y.useEffect(function(){i.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=(function(e,t,n){if(n||2==arguments.length)for(var r,a=0,o=t.length;a<o;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(iY),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=y.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var a,o=iG(e),l=n.current,s="deltaX"in e?e.deltaX:l[0]-o[0],u="deltaY"in e?e.deltaY:l[1]-o[1],c=e.target,d=Math.abs(s)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===c||p.contains(c)))return!1;var h=iW(d,c);if(!h)return!0;if(h?a=d:(a="v"===d?"h":"v",h=iW(d,c)),!h)return!1;if(!r.current&&"changedTouches"in e&&(s||u)&&(r.current=a),!a)return!0;var m=r.current||a;return iJ(m,t,e,"h"===m?s:u,!0)},[]),s=y.useCallback(function(e){if(i0.length&&i0[i0.length-1]===o){var n="deltaY"in e?iQ(e):iG(e),r=t.current.filter(function(t){var r;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(r=t.delta,r[0]===n[0]&&r[1]===n[1])})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}if(!r){var a=(i.current.shards||[]).map(iY).filter(Boolean).filter(function(t){return t.contains(e.target)});(a.length>0?l(e,a[0]):!i.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),u=y.useCallback(function(e,n,r,a){var o={name:e,delta:n,target:r,should:a,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(r)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),c=y.useCallback(function(e){n.current=iG(e),r.current=void 0},[]),d=y.useCallback(function(t){u(t.type,iQ(t),t.target,l(t,e.lockRef.current))},[]),f=y.useCallback(function(t){u(t.type,iG(t),t.target,l(t,e.lockRef.current))},[]);y.useEffect(function(){return i0.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",s,iK),document.addEventListener("touchmove",s,iK),document.addEventListener("touchstart",c,iK),function(){i0=i0.filter(function(e){return e!==o}),document.removeEventListener("wheel",s,iK),document.removeEventListener("touchmove",s,iK),document.removeEventListener("touchstart",c,iK)}},[]);var p=e.removeScrollBar,h=e.inert;return y.createElement(y.Fragment,null,h?y.createElement(o,{styles:"\n .block-interactivity-".concat(a," {pointer-events: none;}\n .allow-interactivity-").concat(a," {pointer-events: all;}\n")}):null,p?y.createElement(iU,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},iO.useMedium(u),iP);var i2=y.forwardRef(function(e,t){return y.createElement(iN,iv({},e,{ref:t,sideCar:i1}))});i2.classNames=iN.classNames;var i4=new WeakMap,i3=new WeakMap,i5={},i6=0,i8=function(e){return e&&(e.host||i8(e.parentNode))},i9=function(e,t,n,r){var a=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var n=i8(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});i5[n]||(i5[n]=new WeakMap);var o=i5[n],i=[],l=new Set,s=new Set(a),u=function(e){!e||l.has(e)||(l.add(e),u(e.parentNode))};a.forEach(u);var c=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(l.has(e))c(e);else try{var t=e.getAttribute(r),a=null!==t&&"false"!==t,s=(i4.get(e)||0)+1,u=(o.get(e)||0)+1;i4.set(e,s),o.set(e,u),i.push(e),1===s&&a&&i3.set(e,!0),1===u&&e.setAttribute(n,"true"),a||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return c(t),l.clear(),i6++,function(){i.forEach(function(e){var t=i4.get(e)-1,a=o.get(e)-1;i4.set(e,t),o.set(e,a),t||(i3.has(e)||e.removeAttribute(r),i3.delete(e)),a||e.removeAttribute(n)}),--i6||(i4=new WeakMap,i4=new WeakMap,i3=new WeakMap,i5={})}},i7=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),i9(r,a,n,"aria-hidden")):function(){return null}},le=Object.defineProperty,lt=(e,t)=>le(e,"name",{value:t,configurable:!0}),ln="Dialog",[lr,la]=of(ln),[lo,li]=lr(ln),ll=lt(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:i=!0}=e,l=y.useRef(null),s=y.useRef(null),[u,c]=oC({prop:r,defaultProp:a??!1,onChange:o,caller:ln}),[d,f]=y.useState(0),[p,h]=y.useState(0);return(0,g.jsx)(lo,{scope:t,triggerRef:l,contentRef:s,contentId:ov(),titleId:ov(),descriptionId:ov(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:h,open:u,onOpenChange:c,onOpenToggle:y.useCallback(()=>c(e=>!e),[c]),modal:i,children:n})},"Dialog"),ls=y.forwardRef(lt(function(e,t){let{__scopeDialog:n,...r}=e,a=li("DialogTrigger",n),o=aG(t,a.triggerRef);return(0,g.jsx)(oT.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":lO(a.open),...r,ref:o,onClick:ol(e.onClick,a.onOpenToggle)})},"DialogTrigger")),lu="DialogPortal",[lc,ld]=lr(lu,{forceMount:void 0}),lf=lt(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=li(lu,t);return(0,g.jsx)(lc,{scope:t,forceMount:n,children:y.Children.map(r,e=>(0,g.jsx)(io,{present:n||o.open,children:(0,g.jsx)(ie,{asChild:!0,container:a,children:e})}))})},"DialogPortal"),lp="DialogOverlay",lh=y.forwardRef(lt(function(e,t){let n=ld(lp,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=li(lp,e.__scopeDialog);return o.modal?(0,g.jsx)(io,{present:r||o.open,children:(0,g.jsx)(lg,{...a,ref:t})}):null},"DialogOverlay")),lm=aX("DialogOverlay.RemoveScroll"),lg=y.forwardRef(lt(function(e,t){let{__scopeDialog:n,...r}=e,a=li(lp,n),o=aG(t,o$());return(0,g.jsx)(i2,{as:lm,allowPinchZoom:!0,shards:[a.contentRef],children:(0,g.jsx)(oT.div,{"data-state":lO(a.open),...r,ref:o,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),ly="DialogContent",lv=y.forwardRef(lt(function(e,t){let n=ld(ly,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=li(ly,e.__scopeDialog);return(0,g.jsx)(io,{present:r||o.open,children:o.modal?(0,g.jsx)(lb,{...a,ref:t}):(0,g.jsx)(lx,{...a,ref:t})})},"DialogContent")),lb=y.forwardRef(lt(function(e,t){let n=li(ly,e.__scopeDialog),r=y.useRef(null),a=aG(t,n.contentRef,r);return y.useEffect(()=>{let e=r.current;if(e)return i7(e)},[]),(0,g.jsx)(lw,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:ol(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ol(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:ol(e.onFocusOutside,e=>e.preventDefault())})},"DialogContentModal")),lx=y.forwardRef(lt(function(e,t){let n=li(ly,e.__scopeDialog),r=y.useRef(!1),a=y.useRef(!1);return(0,g.jsx)(lw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let o=t.target;n.triggerRef.current?.contains(o)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})},"DialogContentNonModal")),lw=y.forwardRef(lt(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...i}=e,l=li(ly,n);return ig(),(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(oQ,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,g.jsx)(oF,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":lO(l.open),...i,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl")),lk=y.forwardRef(lt(function(e,t){let{__scopeDialog:n,...r}=e,a=li("DialogTitle",n),{setTitleCount:o}=a;return oh(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),(0,g.jsx)(oT.h2,{id:a.titleId,...r,ref:t})},"DialogTitle")),lj=y.forwardRef(lt(function(e,t){let{__scopeDialog:n,...r}=e,a=li("DialogDescription",n),{setDescriptionCount:o}=a;return oh(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),(0,g.jsx)(oT.p,{id:a.descriptionId,...r,ref:t})},"DialogDescription")),lS=y.forwardRef(lt(function(e,t){let{__scopeDialog:n,...r}=e,a=li("DialogClose",n);return(0,g.jsx)(oT.button,{type:"button",...r,ref:t,onClick:ol(e.onClick,()=>a.onOpenChange(!1))})},"DialogClose"));function lO(e){return e?"open":"closed"}lt(lO,"getState");let lC=O("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function lN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function lP(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}function lE(e){var t=e.className,n=lP(e,["className"]);return(0,g.jsx)(lh,lN({"data-slot":"dialog-overlay",className:aT("fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t)},n))}function l_(e){var t,n,r=e.className,a=e.children,o=lP(e,["className","children"]);return(0,g.jsxs)(lf,{children:[(0,g.jsx)(lE,{}),(0,g.jsxs)(lv,(t=lN({"data-slot":"dialog-content",className:aT("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-card p-6 shadow-2xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-2xl",r)},o),n=n={children:[a,(0,g.jsxs)(lS,{className:"absolute right-4 top-4 cursor-pointer rounded-sm opacity-70 ring-offset-background transition-[opacity,background-color] hover:bg-accent hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 active:bg-accent/80 disabled:pointer-events-none",children:[(0,g.jsx)(lC,{className:"size-4"}),(0,g.jsx)("span",{className:"sr-only",children:"Close"})]})]},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))]})}function lz(e){var t=e.className,n=lP(e,["className"]);return(0,g.jsx)("div",lN({"data-slot":"dialog-header",className:aT("flex flex-col space-y-1.5 text-center sm:text-left",t)},n))}function lT(e){var t=e.className,n=lP(e,["className"]);return(0,g.jsx)("div",lN({"data-slot":"dialog-footer",className:aT("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},n))}function lA(e){var t=e.className,n=lP(e,["className"]);return(0,g.jsx)(lk,lN({"data-slot":"dialog-title",className:aT("text-lg font-semibold leading-none tracking-tight",t)},n))}function lR(e){var t=e.className,n=lP(e,["className"]);return(0,g.jsx)(lj,lN({"data-slot":"dialog-description",className:aT("text-sm text-muted-foreground",t)},n))}function lL(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function lI(e,t,n){return(lI=lU()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&lF(a,n.prototype),a}).apply(null,arguments)}function lM(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lD(e){return(lD=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function lF(e,t){return(lF=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l$(e){var t="function"==typeof Map?new Map:void 0;return(l$=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return lI(e,arguments,lD(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),lF(n,e)})(e)}function lU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(lU=function(){return!!e})()}var lH=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(e,n){var r,a,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return r=t,a=[n],r=lD(r),lM(o=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,lU()?Reflect.construct(r,a||[],lD(this).constructor):r.apply(this,a)),"status",void 0),lM(o,"code",void 0),lM(o,"params",void 0),o.status=e,o.name="ApiError",o.code=i.code,o.params=i.params,o}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&lF(t,e),t}(l$(Error));function lB(e){return"/api/harnesses/".concat(e,"/profiles")}function lK(e,t){return"".concat(lB(e),"/").concat(encodeURIComponent(t))}function lV(e){return e?"/api/backups/".concat(encodeURIComponent(e)):"/api/backups"}function lW(){return"/api/providers"}function lq(e){return"".concat(lW(),"/").concat(encodeURIComponent(e))}function lZ(e){return e?"/api/drift/".concat(encodeURIComponent(e)):"/api/drift"}function lJ(){return"/api/scan"}function lG(e){return e?"/api/operations?harness=".concat(encodeURIComponent(e)):"/api/operations"}function lQ(e){var t;return(t=function(e){var t,n,r,a,o,i=arguments;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(l){switch(l.label){case 0:var s,u;return n=new Headers((t=i.length>1&&void 0!==i[1]?i[1]:{}).headers),t.body&&!n.has("Content-Type")&&n.set("Content-Type","application/json"),[4,fetch(e,(s=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){lM(e,t,n[t])})}return e}({credentials:"include"},t),u=u={headers:n},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(u)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(u)).forEach(function(e){Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(u,e))}),s))];case 1:return[4,(r=l.sent()).json().catch(function(){return{}})];case 2:if(a=l.sent(),!r.ok)throw new lH(r.status,null!=(o=a.error)?o:"",{code:a.code,params:a.params});return[2,a]}})},function(){var e=this,n=arguments;return new Promise(function(r,a){var o=t.apply(e,n);function i(e){lL(o,r,a,i,l,"next",e)}function l(e){lL(o,r,a,i,l,"throw",e)}i(void 0)})}).apply(this,arguments)}function lY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lX(e,t){return null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function l0(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function l1(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function l2(e){var t;return e.code?{key:(t=e.code).startsWith("warning.")||t.startsWith("error.")?t:"error.".concat(t),params:e.params,scope:e.scope,fallback:e.message}:{key:"error.unknown",fallback:e.message,scope:e.scope}}function l4(e){return lX(e,lH)?l2({message:e.message,code:e.code,params:e.params}):{key:"error.unknown",fallback:lX(e,Error)?e.message:String(e)}}function l3(e,t){var n=l4(e);return"error.unknown"===n.key?l1(l0({},n),{key:t}):n}var l5=new Set(["drift.adoptFailed","drift.reapplyFailed","vault.deleteFailed","vault.saveFailed","vault.revealFailed","operations.undoFailed","import.failed","activate.loadFailed","backup.loadFailed","backup.diffFailed"]);function l6(e,t){if(t.fallback&&("error.unknown"===t.key||l5.has(t.key))){var n,r,a,o=null!=(a=t.fallback)?a:t.key;return t.scope?"".concat(t.scope,": ").concat(o):o}var i=Object.fromEntries(Object.entries(null!=(n=t.paramKeys)?n:{}).map(function(t){var n=function(e){if(Array.isArray(e))return e}(t)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(a.push(t.value),2!==a.length);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw n}}return a}}(t)||function(e){if(e){if("string"==typeof e)return lY(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return lY(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return[n[0],e(n[1])]})),l=e(t.key,l1(l0({},t.params,i),{defaultValue:null!=(r=t.fallback)?r:t.key}));return t.scope?"".concat(t.scope,": ").concat(l):l}let l8=e=>{let t,n=new Set,r=(e,r)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=r?r:"object"!=typeof a||null===a)?a:Object.assign({},t,a),n.forEach(n=>n(t,e))}},a=()=>t,o={setState:r,getState:a,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e))},i=t=e(r,a,o);return o};function l9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l7(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function se(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){l7(o,r,a,i,l,"next",e)}function l(e){l7(o,r,a,i,l,"throw",e)}i(void 0)})}}function st(e,t){return null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function sn(e){return function(e){if(Array.isArray(e))return l9(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return l9(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return l9(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sr(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function sa(e,t,n){var r,a;return t?{key:e,params:(r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},n),a=a={user:t},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(a)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(a,e))}),r)}:{key:e,params:n,paramKeys:{user:"notice.currentUser"}}}var so=(t=(r=function(e,t){return{sessionChecked:!1,authenticated:!1,currentUser:"",users:[],usersLoading:!1,loading:!1,error:null,envFile:"",harnesses:[],backups:[],notice:null,providers:null,providersLoading:!1,providersError:null,doctor:null,doctorUpdatedAvailable:!1,doctorLoading:!1,doctorError:null,drift:null,driftLoading:!1,driftError:null,scan:null,scanLoading:!1,scanError:null,operations:null,operationsLoading:!1,operationsError:null,loadSession:function(){return se(function(){var n;return sr(this,function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),[4,lQ("/api/auth/session")];case 1:return e({authenticated:!0,sessionChecked:!0,currentUser:r.sent().currentUser,error:null}),[4,t().loadUsers()];case 2:return r.sent(),[4,Promise.all([t().loadHarnesses(),t().loadBackups()])];case 3:return r.sent(),[4,t().loadDrift()];case 4:return r.sent(),[3,6];case 5:return e({authenticated:!1,sessionChecked:!0,error:st(n=r.sent(),lH)&&401===n.status?null:l4(n)}),[3,6];case 6:return[2]}})})()},login:function(n){return se(function(){var r;return sr(this,function(a){switch(a.label){case 0:e({loading:!0,error:null}),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,lQ("/api/auth/login",{method:"POST",body:JSON.stringify({password:n})})];case 2:return e({authenticated:!0,loading:!1,currentUser:a.sent().currentUser}),[4,t().loadUsers()];case 3:return a.sent(),[4,t().loadHarnesses()];case 4:return a.sent(),[3,6];case 5:throw e({loading:!1,error:l4(r=a.sent())}),r;case 6:return[2]}})})()},logout:function(){return se(function(){return sr(this,function(t){switch(t.label){case 0:return[4,lQ("/api/auth/logout",{method:"POST"})];case 1:return t.sent(),e({authenticated:!1,currentUser:"",users:[],harnesses:[],backups:[],envFile:"",providers:null,doctor:null,doctorUpdatedAvailable:!1,drift:null}),[2]}})})()},loadUsers:function(){return se(function(){var t;return sr(this,function(n){switch(n.label){case 0:e({usersLoading:!0}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,lQ("/api/users")];case 2:return e({users:(t=n.sent()).items,currentUser:t.currentUser,usersLoading:!1}),[3,4];case 3:return e({usersLoading:!1,error:l4(n.sent())}),[3,4];case 4:return[2]}})})()},switchUser:function(n){return se(function(){var r;return sr(this,function(a){switch(a.label){case 0:if(!n||n===t().currentUser)return[2];e({usersLoading:!0,loading:!0,error:null}),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,lQ("/api/users/".concat(encodeURIComponent(n),"/select"),{method:"POST"})];case 2:return a.sent(),e({currentUser:n,harnesses:[],backups:[],envFile:"",providers:null,doctor:null,doctorUpdatedAvailable:!1,drift:null}),[4,t().loadUsers()];case 3:return a.sent(),[4,Promise.all([t().loadHarnesses(),t().loadBackups()])];case 4:return a.sent(),e({usersLoading:!1,loading:!1}),[3,6];case 5:throw e({usersLoading:!1,loading:!1,error:l4(r=a.sent())}),r;case 6:return[2]}})})()},loadHarnesses:function(){return se(function(){var n,r;return sr(this,function(a){switch(a.label){case 0:e({loading:!0,error:null}),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,lQ("/api/harnesses")];case 2:return e({harnesses:(n=a.sent()).items,envFile:n.envFile,loading:!1}),[4,t().loadDrift()];case 3:return a.sent(),[3,5];case 4:if(st(r=a.sent(),lH)&&401===r.status)return e({authenticated:!1,loading:!1,harnesses:[]}),[2];return e({loading:!1,error:l4(r)}),[3,5];case 5:return[2]}})})()},createProfile:function(e,n){return se(function(){return sr(this,function(r){switch(r.label){case 0:return[4,lQ(lB(e),{method:"POST",body:JSON.stringify(n)})];case 1:return r.sent(),[4,t().loadHarnesses()];case 2:return r.sent(),[2]}})})()},updateProfile:function(e,n,r){return se(function(){return sr(this,function(a){switch(a.label){case 0:return[4,lQ(lK(e,n),{method:"PATCH",body:JSON.stringify(r)})];case 1:return a.sent(),[4,t().loadHarnesses()];case 2:return a.sent(),[2]}})})()},deleteProfile:function(e,n){return se(function(){return sr(this,function(r){switch(r.label){case 0:return[4,lQ(lK(e,n),{method:"DELETE"})];case 1:return r.sent(),[4,t().loadHarnesses()];case 2:return r.sent(),[2]}})})()},activateProfile:function(n,r){return se(function(){var a,o,i,l;return sr(this,function(s){switch(s.label){case 0:return[4,lQ("".concat(lK(n,r),"/activate"),{method:"POST"})];case 1:return i=s.sent(),l=null!=(a=null==(o=t().harnesses.find(function(e){return e.id===n}))?void 0:o.label)?a:n,e({notice:[sa("notice.activated",t().currentUser,{harness:l,profile:r}),{key:"notice.activatedHint"}].concat(sn(i.warnings.map(l2)))}),[4,t().loadHarnesses()];case 2:return s.sent(),[2]}})})()},activateOfficial:function(n){return se(function(){var r,a,o,i;return sr(this,function(l){switch(l.label){case 0:return[4,lQ("/api/harnesses/".concat(n,"/official/activate"),{method:"POST"})];case 1:return o=l.sent(),i=null!=(r=null==(a=t().harnesses.find(function(e){return e.id===n}))?void 0:a.label)?r:n,e({notice:[sa("notice.officialRestored",t().currentUser,{harness:i}),{key:"notice.officialHint"}].concat(sn(o.warnings.map(l2)))}),[4,t().loadHarnesses()];case 2:return l.sent(),[2]}})})()},previewProfile:function(e,t){return se(function(){return sr(this,function(n){switch(n.label){case 0:return[4,lQ("".concat(lK(e,t),"/preview"))];case 1:return[2,n.sent().targets]}})})()},loadBackups:function(){return se(function(){var t;return sr(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,lQ(lV())];case 1:return e({backups:n.sent().items}),[3,3];case 2:return st(t=n.sent(),lH)&&401===t.status||e({error:l4(t)}),[3,3];case 3:return[2]}})})()},loadBackupDetail:function(e){return se(function(){return sr(this,function(t){return[2,lQ(lV(e))]})})()},restoreBackup:function(n){return se(function(){return sr(this,function(r){switch(r.label){case 0:return[4,lQ("".concat(lV(n),"/restore"),{method:"POST"})];case 1:return r.sent(),e({notice:[{key:"backup.written"}]}),[4,Promise.all([t().loadHarnesses(),t().loadBackups()])];case 2:return r.sent(),[2]}})})()},loadProviders:function(){return se(function(){var t;return sr(this,function(n){switch(n.label){case 0:e({providersLoading:!0,providersError:null}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,lQ(lW())];case 2:return e({providers:n.sent().items,providersLoading:!1}),[3,4];case 3:if(st(t=n.sent(),lH)&&401===t.status)return e({authenticated:!1,providersLoading:!1,providers:[]}),[2];return e({providersLoading:!1,providersError:l4(t)}),[3,4];case 4:return[2]}})})()},createProvider:function(e){return se(function(){return sr(this,function(n){switch(n.label){case 0:return[4,lQ(lW(),{method:"POST",body:JSON.stringify(e)})];case 1:return n.sent(),[4,t().loadProviders()];case 2:return n.sent(),[2]}})})()},updateProvider:function(e,n){return se(function(){var r;return sr(this,function(a){switch(a.label){case 0:return[4,lQ(lq(e),{method:"PATCH",body:JSON.stringify(n)})];case 1:return r=a.sent(),[4,t().loadProviders()];case 2:return a.sent(),[4,t().loadHarnesses()];case 3:return a.sent(),[4,t().loadDrift()];case 4:return a.sent(),[2,r]}})})()},deleteProvider:function(e){return se(function(){return sr(this,function(n){switch(n.label){case 0:return[4,lQ(lq(e),{method:"DELETE"})];case 1:return n.sent(),[4,t().loadProviders()];case 2:return n.sent(),[2]}})})()},revealProvider:function(e){return se(function(){return sr(this,function(t){return[2,lQ("".concat(lq(e),"/reveal"))]})})()},probeDraft:function(e){return se(function(){return sr(this,function(t){switch(t.label){case 0:return[4,lQ("/api/probe",{method:"POST",body:JSON.stringify(e)})];case 1:return[2,t.sent().result]}})})()},probeProfile:function(e,t){return se(function(){return sr(this,function(n){switch(n.label){case 0:return[4,lQ("".concat(lK(e,t),"/probe"),{method:"POST",body:JSON.stringify({})})];case 1:return[2,n.sent().result]}})})()},probeVaultEntry:function(e,t){return se(function(){return sr(this,function(n){switch(n.label){case 0:return[4,lQ("".concat(lq(e),"/probe"),{method:"POST",body:JSON.stringify(t?{endpoint:t}:{})})];case 1:return[2,n.sent().result]}})})()},loadDoctor:function(n){return se(function(){var r,a,o;return sr(this,function(i){switch(i.label){case 0:e({doctorLoading:!0,doctorError:null}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,lQ(n?"/api/doctor?harness=".concat(encodeURIComponent(n)):"/api/doctor")];case 2:return a=i.sent(),e({doctor:sn((null!=(r=t().doctor)?r:[]).filter(function(e){return e.harness!==n})).concat(sn(a.items.filter(function(e){return e.harness===n}))),doctorUpdatedAvailable:a.updatedAvailable,doctorLoading:!1}),[3,4];case 3:if(st(o=i.sent(),lH)&&401===o.status)return e({authenticated:!1,doctorLoading:!1,doctor:[]}),[2];return e({doctorLoading:!1,doctorError:l4(o)}),[3,4];case 4:return[2]}})})()},loadDrift:function(){return se(function(){var t,n;return sr(this,function(r){switch(r.label){case 0:e({driftLoading:!0,driftError:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,lQ(lZ())];case 2:return e({drift:null!=(t=r.sent().items)?t:[],driftLoading:!1}),[3,4];case 3:if(st(n=r.sent(),lH)&&401===n.status)return e({authenticated:!1,driftLoading:!1,drift:[]}),[2];return e({driftLoading:!1,driftError:l4(n)}),[3,4];case 4:return[2]}})})()},reapplyDrift:function(n){return se(function(){var r,a,o;return sr(this,function(i){switch(i.label){case 0:return[4,lQ("".concat(lZ(n),"/reapply"),{method:"POST"})];case 1:return o=i.sent(),e({notice:[{key:"drift.reapplied",params:{harness:null!=(r=null==(a=t().harnesses.find(function(e){return e.id===n}))?void 0:a.label)?r:n}}]}),[4,t().loadDrift()];case 2:return i.sent(),[2,o.files]}})})()},adoptDrift:function(n){return se(function(){var r,a,o;return sr(this,function(i){switch(i.label){case 0:return[4,lQ("".concat(lZ(n),"/adopt"),{method:"POST"})];case 1:return o=i.sent(),e({notice:[{key:"drift.adopted",params:{harness:null!=(r=null==(a=t().harnesses.find(function(e){return e.id===n}))?void 0:a.label)?r:n}}]}),[4,t().loadHarnesses()];case 2:return i.sent(),[2,o]}})})()},loadScan:function(){return se(function(){var t;return sr(this,function(n){switch(n.label){case 0:e({scanLoading:!0,scanError:null}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,lQ(lJ())];case 2:return e({scan:n.sent().items,scanLoading:!1}),[3,4];case 3:if(st(t=n.sent(),lH)&&401===t.status)return e({authenticated:!1,scanLoading:!1,scan:[]}),[2];return e({scanLoading:!1,scanError:l4(t)}),[3,4];case 4:return[2]}})})()},importScan:function(e){return se(function(){var n;return sr(this,function(r){switch(r.label){case 0:return[4,lQ("".concat(lJ(),"/import"),{method:"POST",body:JSON.stringify({selections:e})})];case 1:return n=r.sent(),[4,Promise.all([t().loadHarnesses(),t().loadProviders(),t().loadScan()])];case 2:return r.sent(),[2,n]}})})()},loadOperations:function(n){return se(function(){var r,a,o;return sr(this,function(i){switch(i.label){case 0:e({operationsLoading:!0,operationsError:null}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,lQ(lG(n))];case 2:return a=i.sent(),e({operations:sn((null!=(r=t().operations)?r:[]).filter(function(e){return e.harness!==n})).concat(sn(a.items.filter(function(e){return e.harness===n}))),operationsLoading:!1}),[3,4];case 3:if(st(o=i.sent(),lH)&&401===o.status)return e({authenticated:!1,operationsLoading:!1,operations:[]}),[2];return e({operationsLoading:!1,operationsError:l4(o)}),[3,4];case 4:return[2]}})})()},undoOperation:function(n){return se(function(){var r,a,o;return sr(this,function(i){switch(i.label){case 0:return[4,lQ("".concat(lG(),"/").concat(encodeURIComponent(n),"/undo"),{method:"POST"})];case 1:return o=i.sent().receipt,e({notice:[{key:"operations.undone",params:{harness:null!=(r=null==(a=t().harnesses.find(function(e){return e.id===o.harness}))?void 0:a.label)?r:o.harness}}]}),[4,Promise.all([t().loadHarnesses(),t().loadBackups(),t().loadOperations(o.harness)])];case 2:return i.sent(),[2]}})})()},setNotice:function(t){return e({notice:t})},clearNotice:function(){return e({notice:null})}}},l8(r)),Object.assign(n=e=>(function(e,t=e=>e){let n=y.useSyncExternalStore(e.subscribe,y.useCallback(()=>t(e.getState()),[e,t]),y.useCallback(()=>t(e.getInitialState()),[e,t]));return y.useDebugValue(n),n})(t,e),t),n);function si(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return si(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return si(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ss(e){var t,n=e.harnessId,r=(0,x.s9)().locale,a=(0,x.Bd)().t,o=so(function(e){return e.backups}),i=so(function(e){return e.loadBackups}),l=so(function(e){return e.loadBackupDetail}),s=so(function(e){return e.restoreBackup}),u=sl((0,y.useState)(!1),2),c=u[0],d=u[1],f=sl((0,y.useState)(null),2),p=f[0],h=f[1],m=sl((0,y.useState)(null),2),v=m[0],b=m[1],w=sl((0,y.useState)(null),2),k=w[0],j=w[1],S=sl((0,y.useState)(!1),2),O=S[0],C=S[1],N=o.filter(function(e){return e.harness===n}),P=null!=(t=o.find(function(e){return e.id===p}))?t:null,E=M[n];return(0,y.useEffect)(function(){i()},[i]),(0,y.useEffect)(function(){d(!1),h(null)},[n]),(0,y.useEffect)(function(){if(!p){b(null),j(null),C(!1);return}var e=!1;return b(null),j(null),C(!0),l(p).then(function(t){e||b(t)}).catch(function(t){e||j(l3(t,"backup.diffFailed"))}).finally(function(){e||C(!1)}),function(){e=!0}},[p,l]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(or,{className:"w-full justify-between",size:"sm",variant:"outline",onClick:function(){return d(!0)},children:[(0,g.jsx)(rN,{}),a("backup.history"),N.length>0?(0,g.jsx)(aR,{variant:"secondary",children:N.length}):null]}),(0,g.jsx)(ll,{open:c,onOpenChange:d,children:(0,g.jsxs)(l_,{className:"max-w-xl",children:[(0,g.jsxs)(lz,{children:[(0,g.jsx)(lA,{children:a("backup.historyTitle",{harness:E})}),(0,g.jsx)(lR,{children:a("backup.historyIntro")})]}),0===N.length?(0,g.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:a("backup.empty")}):(0,g.jsx)("ul",{className:"max-h-80 divide-y overflow-y-auto rounded-xl border",children:N.map(function(e){var t,n,o;return(0,g.jsxs)("li",{className:"flex items-center gap-3 px-3 py-2.5 hover:bg-muted/30",children:[(0,g.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,g.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,g.jsx)("p",{className:"truncate text-sm font-medium",children:e.profile}),e.current?(0,g.jsx)(aR,{children:a("backup.currentBadge")}):null]}),(0,g.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[(t=e.createdAt,n=r,Number.isNaN((o=new Date(t)).getTime())?t:o.toLocaleString(n))," \xb7"," ",a("backup.fileCount",{count:e.files.length}),e.files.some(function(e){return!e.existed})?" \xb7 ".concat(a("backup.withDeletions")):""]})]}),e.current?null:(0,g.jsx)(or,{size:"sm",variant:"outline",className:"shrink-0",onClick:function(){return h(e.id)},children:a("backup.restore")})]},e.id)})})]})}),(0,g.jsx)(ll,{open:null!==P,onOpenChange:function(e){return!e&&h(null)},children:(0,g.jsxs)(l_,{className:"flex max-h-[85vh] w-[min(64rem,calc(100vw-2rem))] max-w-5xl flex-col overflow-hidden",children:[(0,g.jsxs)(lz,{children:[(0,g.jsx)(lA,{children:a("backup.restoreHistoryTitle")}),(0,g.jsx)(lR,{children:a("backup.restoreHistoryBody")})]}),(0,g.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[O?(0,g.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:a("backup.comparing")}):null,k?(0,g.jsx)("p",{className:"py-8 text-center text-sm text-destructive",children:l6(a,k)}):null,v?(0,g.jsx)(aH,{files:v.files}):null]}),(0,g.jsxs)(lT,{children:[(0,g.jsx)(or,{variant:"outline",onClick:function(){return h(null)},children:a("common.cancel")}),(0,g.jsx)(or,{disabled:O||null!==k||null===v,onClick:function(){p&&s(p).then(function(){h(null),d(!1)})},children:a("backup.confirmRestore")})]})]})})]})}let su=O("stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]),sc=O("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]),sd=O("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);var sf={ok:"bg-emerald-500",warn:"bg-amber-500",error:"bg-red-500",unknown:"bg-slate-400"};function sp(e){var t,n=e.harnessId,r=e.open,a=e.onOpenChange,o=(0,x.Bd)().t,i=so(function(e){return e.doctor}),l=so(function(e){return e.doctorLoading}),s=so(function(e){return e.doctorError}),u=so(function(e){return e.doctorUpdatedAvailable}),c=so(function(e){return e.loadDoctor}),d=null!=(t=null==i?void 0:i.find(function(e){return e.harness===n}))?t:null;(0,y.useEffect)(function(){r&&null===d&&c(n)},[r,d,n,c]);var f=function(e){var t={ok:0,warn:0,error:0,unknown:0};if(!e)return t;var n=!0,r=!1,a=void 0;try{for(var o,i=e.checks[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var l=o.value;t[l.status]++}}catch(e){r=!0,a=e}finally{try{n||null==i.return||i.return()}finally{if(r)throw a}}return t}(d),p=M[n];return(0,g.jsx)(ll,{open:r,onOpenChange:a,children:(0,g.jsxs)(l_,{className:"flex max-h-[88vh] flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl",children:[(0,g.jsxs)(lz,{className:"shrink-0 space-y-1.5 px-6 pb-4 pt-6 pr-12",children:[(0,g.jsx)(lA,{children:o("doctor.titleFor",{harness:p})}),(0,g.jsx)(lR,{children:o("doctor.intro")})]}),(0,g.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-contain px-6",children:[l&&null===d?(0,g.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:o("doctor.checking")}):null,s?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(o,s)}):null,d?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[f.ok>0?(0,g.jsx)(aR,{variant:"secondary",children:o("doctor.countOk",{count:f.ok})}):null,f.warn>0?(0,g.jsx)(aR,{variant:"outline",className:"border-amber-500/30 text-amber-700 dark:text-amber-300",children:o("doctor.countWarn",{count:f.warn})}):null,f.error>0?(0,g.jsx)(aR,{variant:"destructive",children:o("doctor.countError",{count:f.error})}):null,f.unknown>0?(0,g.jsx)(aR,{variant:"outline",children:o("doctor.countUnknown",{count:f.unknown})}):null,u?(0,g.jsxs)("span",{className:"ml-auto flex items-center gap-1 text-xs text-emerald-600 dark:text-emerald-400",children:[(0,g.jsx)(sd,{className:"size-3.5"}),o("doctor.updateAvailable")]}):null]}),(0,g.jsx)(sh,{checks:d.checks})]}):null,null!==d||l||s?null:(0,g.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:o("doctor.notRun")})]}),(0,g.jsxs)(lT,{className:"shrink-0 px-6 py-4",children:[(0,g.jsxs)(or,{variant:"outline",disabled:l,onClick:function(){c(n)},children:[(0,g.jsx)(sc,{className:l?"animate-spin":void 0}),o("doctor.rerun")]}),(0,g.jsx)(or,{onClick:function(){return a(!1)},children:o("doctor.close")})]})]})})}function sh(e){var t=e.checks,n=(0,x.Bd)().t;return 0===t.length?(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:n("doctor.noChecks")}):(0,g.jsx)("ul",{className:"divide-y rounded-xl border",children:t.map(function(e){var t;return(0,g.jsxs)("li",{className:"flex items-start gap-3 px-3 py-2.5",children:[(0,g.jsx)("span",{className:aT("mt-1.5 size-2 shrink-0 rounded-full",sf[e.status]),"aria-hidden":!0}),(0,g.jsx)("div",{className:"min-w-0 flex-1",children:(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[(0,g.jsx)("p",{className:"text-sm leading-relaxed",children:l6(n,{key:null!=(t=e.code)?t:"doctor.unknownCheck",params:e.params,fallback:e.label})}),(0,g.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:n("doctor.status.".concat(e.status))})]})})]},e.id)})})}var sm=Object.defineProperty,sg=(e,t)=>sm(e,"name",{value:t,configurable:!0}),[sy,sv]=of("AlertDialog",[la]),sb=la(),sx=sg(e=>{let{__scopeAlertDialog:t,...n}=e,r=sb(t);return(0,g.jsx)(ll,{...r,...n,modal:!0})},"AlertDialog");y.forwardRef(sg(function(e,t){let{__scopeAlertDialog:n,...r}=e,a=sb(n);return(0,g.jsx)(ls,{...a,...r,ref:t})},"AlertDialogTrigger"));var sw=sg(e=>{let{__scopeAlertDialog:t,...n}=e,r=sb(t);return(0,g.jsx)(lf,{...r,...n})},"AlertDialogPortal"),sk=y.forwardRef(sg(function(e,t){let{__scopeAlertDialog:n,...r}=e,a=sb(n);return(0,g.jsx)(lh,{...a,...r,ref:t})},"AlertDialogOverlay")),[sj,sS]=sy("AlertDialogContent"),sO=y.forwardRef(sg(function(e,t){let{__scopeAlertDialog:n,children:r,...a}=e,o=sb(n),i=aG(t,y.useRef(null)),l=y.useRef(null);return(0,g.jsx)(sj,{scope:n,cancelRef:l,children:(0,g.jsx)(lv,{role:"alertdialog",...o,...a,ref:i,onOpenAutoFocus:ol(a.onOpenAutoFocus,e=>{e.preventDefault(),l.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},"AlertDialogContent")),sC=y.forwardRef(sg(function(e,t){let{__scopeAlertDialog:n,...r}=e,a=sb(n);return(0,g.jsx)(lk,{...a,...r,ref:t})},"AlertDialogTitle")),sN=y.forwardRef(sg(function(e,t){let{__scopeAlertDialog:n,...r}=e,a=sb(n);return(0,g.jsx)(lj,{...a,...r,ref:t})},"AlertDialogDescription")),sP=y.forwardRef(sg(function(e,t){let{__scopeAlertDialog:n,...r}=e,a=sb(n);return(0,g.jsx)(lS,{...a,...r,ref:t})},"AlertDialogAction")),sE=y.forwardRef(sg(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=sS("AlertDialogCancel",n),o=sb(n),i=aG(t,a);return(0,g.jsx)(lS,{...o,...r,ref:i})},"AlertDialogCancel"));function s_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function sz(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}function sT(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsx)(sk,s_({"data-slot":"alert-dialog-overlay",className:aT("fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t)},n))}function sA(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsxs)(sw,{children:[(0,g.jsx)(sT,{}),(0,g.jsx)(sO,s_({"data-slot":"alert-dialog-content",className:aT("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-card p-6 shadow-2xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-2xl",t)},n))]})}function sR(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsx)("div",s_({className:aT("flex flex-col space-y-2 text-center sm:text-left",t)},n))}function sL(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsx)("div",s_({className:aT("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},n))}function sI(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsx)(sC,s_({className:aT("text-lg font-semibold",t)},n))}function sM(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsx)(sN,s_({className:aT("text-sm text-muted-foreground",t)},n))}function sD(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsx)(sP,s_({className:aT(on(),t)},n))}function sF(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsx)(sE,s_({className:aT(on({variant:"outline"}),"mt-2 sm:mt-0",t)},n))}function s$(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sU(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s$(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s$(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sH(e){switch(e){case"in-sync":return"border-transparent bg-emerald-500/15 text-emerald-600 dark:text-emerald-400";case"drifted":return"border-amber-500/30 text-amber-700 dark:text-amber-300";case"missing":case"invalid":return"border-transparent bg-destructive/15 text-destructive";default:return""}}function sB(e){var t,n=e.harness,r=e.open,a=e.onOpenChange,o=(0,x.Bd)().t,i=so(function(e){return e.drift}),l=so(function(e){return e.driftLoading}),s=so(function(e){return e.reapplyDrift}),u=so(function(e){return e.adoptDrift}),c=sU((0,y.useState)(null),2),d=c[0],f=c[1],p=sU((0,y.useState)(null),2),h=p[0],m=p[1],v=(0,y.useMemo)(function(){var e;return null!=(e=null==i?void 0:i.find(function(e){return e.harness===n.id}))?e:null},[i,n.id]),b=null!=(t=null==v?void 0:v.files.filter(function(e){return"in-sync"!==e.status}))?t:[],w=(null==v?void 0:v.active)===!0;return(0,g.jsxs)(ll,{open:r,onOpenChange:a,children:[(0,g.jsxs)(l_,{className:"flex max-h-[85vh] w-[min(64rem,calc(100vw-2rem))] max-w-5xl flex-col overflow-hidden",children:[(0,g.jsxs)(lz,{children:[(0,g.jsx)(lA,{children:o("drift.dialogTitle",{harness:n.label})}),(0,g.jsx)(lR,{children:o(w?"drift.legend":"drift.noActiveProfile")})]}),(0,g.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[l&&null===v?(0,g.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:o("drift.checking")}):null,null!==v||l?null:(0,g.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:o("drift.noData")}),v&&!w?(0,g.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:o("drift.nothingToCompare")}):null,v&&w?(0,g.jsx)("div",{className:"space-y-3",children:0===b.length?(0,g.jsx)("p",{className:"py-4 text-center text-sm text-muted-foreground",children:o("drift.allInSync")}):b.map(function(e){return(0,g.jsx)(sK,{file:e},e.key)})}):null]}),h?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(o,h)}):null,(0,g.jsxs)(lT,{children:[(0,g.jsx)(or,{variant:"outline",disabled:null===v||!w,onClick:function(){return f("adopt")},children:o("drift.adopt")}),(0,g.jsx)(or,{disabled:null===v||!w,onClick:function(){return f("reapply")},children:o("drift.reapply")})]})]}),(0,g.jsx)(sx,{open:"reapply"===d,onOpenChange:function(e){return!e&&f(null)},children:(0,g.jsxs)(sA,{children:[(0,g.jsxs)(sR,{children:[(0,g.jsx)(sI,{children:o("drift.reapplyTitle")}),(0,g.jsx)(sM,{children:o("drift.reapplyBody",{harness:n.label})})]}),(0,g.jsxs)(sL,{children:[(0,g.jsx)(sF,{children:o("common.cancel")}),(0,g.jsx)(sD,{onClick:function(){f(null),m(null),s(n.id).then(function(){return a(!1)}).catch(function(e){m(l3(e,"drift.reapplyFailed"))})},children:o("drift.confirmReapply")})]})]})}),(0,g.jsx)(sx,{open:"adopt"===d,onOpenChange:function(e){return!e&&f(null)},children:(0,g.jsxs)(sA,{children:[(0,g.jsxs)(sR,{children:[(0,g.jsx)(sI,{children:o("drift.adoptTitle")}),(0,g.jsx)(sM,{children:o("drift.adoptBody")})]}),(0,g.jsxs)(sL,{children:[(0,g.jsx)(sF,{children:o("common.cancel")}),(0,g.jsx)(sD,{onClick:function(){f(null),m(null),u(n.id).then(function(){return a(!1)}).catch(function(e){m(l3(e,"drift.adoptFailed"))})},children:o("drift.confirmAdopt")})]})]})})]})}function sK(e){var t=e.file,n=(0,x.Bd)().t;return(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,g.jsx)(aR,{className:sH(t.status),children:n("drift.status.".concat(t.status))}),(0,g.jsx)("p",{className:"min-w-0 truncate font-mono text-xs text-muted-foreground",title:t.path,children:t.path})]}),(0,g.jsx)(aH,{files:[{path:t.path,existed:null!==t.currentContent,content:t.expectedContent,currentContent:t.currentContent}]})]})}function sV(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sW(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return sV(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sV(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sq(e){var t,n,r,a=e.harness,o=(0,x.Bd)().t,i=so(function(e){return e.doctor}),l=so(function(e){return e.doctorLoading}),s=so(function(e){return e.doctorError}),u=so(function(e){return e.loadDoctor}),c=so(function(e){return e.drift}),d=so(function(e){return e.driftLoading}),f=so(function(e){return e.driftError}),p=so(function(e){return e.loadDrift}),h=sW((0,y.useState)(!1),2),m=h[0],v=h[1],b=sW((0,y.useState)(!1),2),w=b[0],k=b[1],j=null!=(t=null==i?void 0:i.find(function(e){return e.harness===a.id}))?t:null,S=null!=(n=null==c?void 0:c.find(function(e){return e.harness===a.id}))?n:null,O=null!=(r=null==S?void 0:S.files.filter(function(e){return"in-sync"!==e.status}))?r:[],C=null!==S&&S.active&&O.length>0&&"in-sync"!==S.status;return(0,y.useEffect)(function(){u(a.id)},[a.id,u]),(0,y.useEffect)(function(){null===c&&p()},[c,p]),(0,g.jsxs)("section",{className:"rounded-2xl border bg-card p-5 shadow-[0_12px_34px_-28px_rgb(36_39_70/0.38)]",children:[(0,g.jsxs)("div",{className:"flex items-center gap-2",children:[(0,g.jsx)(su,{className:"size-4 text-primary"}),(0,g.jsx)("h3",{className:"font-semibold",children:o("doctor.title")}),(0,g.jsx)("span",{className:"ml-auto",children:(0,g.jsx)(or,{size:"icon",variant:"ghost","aria-label":o("doctor.rerun"),onClick:function(){u(a.id),p()},children:(0,g.jsx)(sc,{className:l||d?"animate-spin":void 0})})})]}),(0,g.jsxs)("div",{className:"mt-4 space-y-3",children:[s?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(o,s)}):null===j?(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:o("doctor.checking")}):(0,g.jsx)(sZ,{report:j}),f?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(o,f)}):null===S?(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:o("drift.checking")}):(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(sJ,{report:S}),O.length>0?(0,g.jsxs)("ul",{className:"space-y-1",children:[O.slice(0,3).map(function(e){return(0,g.jsxs)("li",{className:"flex items-center gap-2 text-xs",children:[(0,g.jsx)("span",{className:"size-1.5 shrink-0 rounded-full bg-destructive/70"}),(0,g.jsx)("span",{className:"truncate font-mono text-muted-foreground",children:e.path.split("/").pop()}),(0,g.jsx)("span",{className:"ml-auto shrink-0 font-mono text-[11px] text-muted-foreground",children:o("drift.status.".concat(e.status))})]},e.key)}),O.length>3?(0,g.jsx)("li",{className:"pl-3.5 text-xs text-muted-foreground",children:o("drift.moreFiles",{count:O.length-3})}):null]}):null]})]}),(0,g.jsxs)("div",{className:"mt-4 grid gap-2 ".concat(C?"grid-cols-2":"grid-cols-1"),children:[(0,g.jsx)(or,{size:"sm",variant:"outline",disabled:null===j,onClick:function(){return v(!0)},children:o("doctor.viewDetails")}),C?(0,g.jsx)(or,{size:"sm",variant:"outline",onClick:function(){return k(!0)},children:o("drift.viewDiff")}):null]}),(0,g.jsx)(sp,{harnessId:a.id,open:m,onOpenChange:v}),(0,g.jsx)(sB,{harness:a,open:w,onOpenChange:k})]})}function sZ(e){var t=e.report,n=(0,x.Bd)().t,r=function(e){var t={ok:0,warn:0,error:0,unknown:0},n=!0,r=!1,a=void 0;try{for(var o,i=e.checks[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var l=o.value;t[l.status]++}}catch(e){r=!0,a=e}finally{try{n||null==i.return||i.return()}finally{if(r)throw a}}return t}(t),a=["error","warn","ok","unknown"].filter(function(e){return r[e]>0});return 0===a.length?(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:n("doctor.noChecks")}):(0,g.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(function(e){var t,a;return(0,g.jsx)(aR,{variant:"error"===(t=e)?"destructive":"ok"===t?"secondary":"outline",className:"warn"===e?"border-amber-500/30 text-amber-700 dark:text-amber-300":void 0,children:n("doctor.count".concat((a=e,"".concat(a[0].toUpperCase()).concat(a.slice(1)))),{count:r[e]})},e)})})}function sJ(e){var t=e.report,n=(0,x.Bd)().t;if(!t.active)return(0,g.jsx)(aR,{variant:"secondary",children:n("harness.inactive")});if("in-sync"===t.status)return(0,g.jsx)(aR,{variant:"secondary",children:n("drift.none")});if("drifted"===t.status){var r=t.files.filter(function(e){return"in-sync"!==e.status}).length;return(0,g.jsx)(aR,{variant:"outline",className:"border-amber-500/30 text-amber-700 dark:text-amber-300",children:n("drift.mismatch",{count:r})})}return(0,g.jsx)(aR,{className:sH(t.status),children:n("drift.status.".concat(t.status))})}let sG=O("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),sQ=O("circle-user-round",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),sY=O("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),sX=O("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),s0=O("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);function s1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s2(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s1(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s4(e){var t,n=e.harness,r=e.profile,a=e.open,o=e.onOpenChange,i=(0,x.Bd)().t,l=so(function(e){return e.previewProfile}),s=so(function(e){return e.activateProfile}),u=so(function(e){return e.currentUser}),c=s2((0,y.useState)(null),2),d=c[0],f=c[1],p=s2((0,y.useState)(null),2),h=p[0],m=p[1];(0,y.useEffect)(function(){if(a){var e=!1;return f(null),m(null),l(n.id,r.name).then(function(t){e||f(t)}).catch(function(t){e||m(l4(t))}),function(){e=!0}}},[a,n.id,r.name,l]);var v=null!=(t=null==d?void 0:d.map(function(e){return{path:e.path,existed:null!==e.currentContent,content:e.content,currentContent:e.currentContent}}))?t:[],b=v.filter(function(e){return"same"!==aU(e)}).length;return(0,g.jsx)(sx,{open:a,onOpenChange:o,children:(0,g.jsxs)(sA,{className:"max-h-[85dvh] overflow-y-auto sm:max-w-2xl",children:[(0,g.jsxs)(sR,{children:[(0,g.jsx)(sI,{children:i("activate.title")}),(0,g.jsx)(sM,{children:i("activate.body",{harness:n.label,profile:r.name,changed:b>0?i("activate.changedFiles",{count:b}):"",user:u||i("notice.currentUser")})})]}),h?(0,g.jsx)("p",{className:"text-sm text-destructive",children:i("activate.loadFailed",{reason:l6(i,h)})}):null===d?(0,g.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:i("activate.loading")}):(0,g.jsx)("div",{className:"max-h-[52dvh] overflow-y-auto rounded-xl border p-3",children:(0,g.jsx)(aH,{files:v})}),(0,g.jsxs)(sL,{children:[(0,g.jsx)(sF,{children:i("common.cancel")}),(0,g.jsx)(sD,{onClick:function(){s(n.id,r.name),o(!1)},children:i("activate.confirm")})]})]})})}function s3(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function s5(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}function s6(e){var t=e.className,n=s5(e,["className"]);return(0,g.jsx)("div",s3({"data-slot":"card",className:aT("rounded-2xl border bg-card text-card-foreground shadow-[0_12px_34px_-26px_rgb(36_39_70/0.38)]",t)},n))}function s8(e){var t=e.className,n=s5(e,["className"]);return(0,g.jsx)("div",s3({"data-slot":"card-title",className:aT("font-semibold leading-none tracking-tight",t)},n))}function s9(e){var t=e.className,n=s5(e,["className"]);return(0,g.jsx)("div",s3({"data-slot":"card-description",className:aT("text-sm text-muted-foreground",t)},n))}function s7(e){var t=e.className,n=s5(e,["className"]);return(0,g.jsx)("div",s3({"data-slot":"card-content",className:aT("p-5 pt-0",t)},n))}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ut(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ue(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function un(e){var t,n,r,a,o,i,l,s,u,c=e.harness,d=e.onAdd,f=e.onEdit,p=e.extraActions,h=(0,x.Bd)().t,m=so(function(e){return e.activateOfficial}),v=so(function(e){return e.deleteProfile}),b=ut((0,y.useState)(null),2),w=b[0],k=b[1],j=ut((0,y.useState)(null),2),S=j[0],O=j[1],C=(null==(r=c.active)?void 0:r.official)?h("harness.official"):null!=(t=null==(a=c.active)?void 0:a.name)?t:null;return(0,g.jsxs)("div",{className:"space-y-6",children:[(0,g.jsx)(s6,{className:"overflow-hidden border-primary/10",children:(0,g.jsxs)(s7,{className:"p-5 sm:p-6",children:[(0,g.jsxs)("div",{className:"grid gap-5 sm:grid-cols-[minmax(0,1fr)_minmax(15rem,0.85fr)] sm:divide-x",children:[(0,g.jsxs)("div",{className:"min-w-0 sm:pr-5",children:[(0,g.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,g.jsx)("span",{className:"size-2 rounded-full bg-primary shadow-[0_0_0_4px_rgb(99_91_255/0.1)]"}),h("harness.activeConfig")]}),(0,g.jsx)(s8,{className:"mt-3 truncate text-xl",children:null===C?h("harness.inactive"):h("harness.activeNamed",{name:C})}),(0,g.jsx)(s9,{className:"mt-1",children:null===C?h("harness.currentInactive"):h("harness.current",{name:C})})]}),(0,g.jsxs)("div",{className:"min-w-0 sm:pl-5",children:[(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:h("harness.writeTargets")}),(0,g.jsx)("p",{className:"mt-3 truncate font-mono text-sm",children:null!=(n=null==(o=c.targets[0])?void 0:o.path)?n:h("harness.noTargetFile")}),c.targets.length>1?(0,g.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:h("harness.moreFiles",{count:c.targets.length-1})}):null]})]}),(0,g.jsxs)("div",{className:"mt-5 flex items-start gap-3 border-t pt-4 text-sm text-muted-foreground",children:[(0,g.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/[0.08] text-primary",children:(0,g.jsx)(sG,{className:"size-4"})}),(0,g.jsx)("p",{className:"pt-1 leading-relaxed",children:h("harness.overwriteWarning")})]})]})}),(0,g.jsxs)("section",{children:[(0,g.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("h3",{className:"text-sm font-semibold",children:h("harness.profiles")}),(0,g.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:h("harness.profileCount",{count:c.profiles.length})})]}),p]}),(0,g.jsxs)("div",{className:"space-y-3",children:[c.supportsOfficialAuth?(0,g.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-xl border bg-card px-4 py-4 shadow-[0_10px_28px_-26px_rgb(36_39_70/0.38)]",children:[(0,g.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,g.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-muted text-muted-foreground",children:(0,g.jsx)(sQ,{className:"size-4"})}),(0,g.jsxs)("div",{className:"min-w-0",children:[(0,g.jsxs)("div",{className:"flex items-center gap-2",children:[(0,g.jsx)("p",{className:"font-medium",children:h("harness.official")}),(null==(i=c.active)?void 0:i.official)?(0,g.jsx)(aR,{variant:"secondary",children:h("harness.active")}):null]}),(0,g.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"claude"===c.id?h("harness.officialHintClaude"):h("harness.officialHintCodex")})]})]}),(0,g.jsx)(or,{size:"sm",variant:(null==(l=c.active)?void 0:l.official)?"secondary":"outline",disabled:null==(s=c.active)?void 0:s.official,onClick:function(){m(c.id)},children:(null==(u=c.active)?void 0:u.official)?h("harness.officialActive"):h("harness.officialSwitch")})]}):null,0===c.profiles.length?(0,g.jsxs)("div",{className:"rounded-xl border border-dashed bg-card/60 px-5 py-8 text-center",children:[(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:h("harness.noProfiles")}),(0,g.jsxs)(or,{className:"mt-4",size:"sm",onClick:d,children:[(0,g.jsx)(z,{}),h("harness.newProfile")]})]}):c.profiles.map(function(e){var t,n,r=(null==(t=c.active)?void 0:t.official)!==!0&&(null==(n=c.active)?void 0:n.name)===e.name;return(0,g.jsxs)("div",{className:aT("flex flex-col gap-4 rounded-xl border bg-card px-4 py-4 shadow-[0_10px_28px_-26px_rgb(36_39_70/0.38)] transition-[border-color,background-color,box-shadow] sm:flex-row sm:items-center sm:justify-between",r?"border-primary/20 bg-primary/[0.035] shadow-[0_12px_30px_-24px_rgb(99_91_255/0.35)]":"hover:border-primary/15 hover:bg-card/85"),children:[(0,g.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,g.jsx)("span",{className:aT("mt-2 size-2 shrink-0 rounded-full",r?"bg-primary":"bg-muted-foreground/30")}),(0,g.jsxs)("div",{className:"min-w-0",children:[(0,g.jsxs)("div",{className:"flex items-center gap-2",children:[(0,g.jsx)("p",{className:"font-medium",children:e.name}),r?(0,g.jsx)(aR,{children:h("harness.active")}):null,e.overriddenTargets.length>0?(0,g.jsx)(aR,{variant:"outline",children:h("harness.manualOverride")}):null]}),(0,g.jsx)("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",children:e.baseUrl}),e.model?(0,g.jsx)("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground",children:e.model}):null]})]}),(0,g.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5 self-end sm:self-auto",children:[(0,g.jsxs)(or,{size:"sm",variant:r?"secondary":"outline",onClick:function(){return O(e)},children:[r?null:(0,g.jsx)(sY,{}),r?h("harness.active"):h("harness.activate")]}),(0,g.jsx)(or,{size:"icon",variant:"ghost","aria-label":h("harness.edit",{name:e.name}),onClick:function(){return f(e)},children:(0,g.jsx)(sX,{})}),(0,g.jsx)(or,{size:"icon",variant:"ghost","aria-label":h("harness.delete",{name:e.name}),disabled:r,title:r?h("harness.deleteBlocked"):void 0,onClick:function(){return k(e.name)},children:(0,g.jsx)(s0,{className:r?void 0:"text-destructive"})})]})]},e.name)})]})]}),S?(0,g.jsx)(s4,{harness:c,profile:S,open:!0,onOpenChange:function(e){return!e&&O(null)}}):null,(0,g.jsx)(sx,{open:null!==w,onOpenChange:function(e){return!e&&k(null)},children:(0,g.jsxs)(sA,{children:[(0,g.jsxs)(sR,{children:[(0,g.jsx)(sI,{children:h("harness.deleteTitle")}),(0,g.jsx)(sM,{children:h("harness.deleteBody",{harness:c.label,profile:null!=w?w:"",extra:"additive"===c.mode?h("harness.deleteAdditiveExtra"):""})})]}),(0,g.jsxs)(sL,{children:[(0,g.jsx)(sF,{children:h("common.cancel")}),(0,g.jsx)(sD,{onClick:function(){w&&v(c.id,w)},children:h("common.delete")})]})]})})]})}function ur(e){return(ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var ua=["size","style"];function uo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ui(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uo(Object(n),!0).forEach(function(t){var r,a,o;r=e,a=t,o=n[t],(a=function(e){var t=function(e,t){if("object"!=ur(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ur(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ur(t)?t:String(t)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ul=(0,y.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,a=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,ua);return(0,g.jsxs)("svg",ui(ui({height:n,style:ui({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},a),{},{children:[(0,g.jsx)("title",{children:"Claude Code"}),(0,g.jsx)("path",{clipRule:"evenodd",d:"M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z",fill:"#D97757",fillRule:"evenodd"})]}))});let us=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;var uu=function(e){var t=(0,y.useId)(),n="lobe-icons-".concat(Array.from(e.match(us)??[]).map(e=>e.toLowerCase()).join("-"),"-").concat(t);return(0,y.useMemo)(function(){return{fill:"url(#".concat(n,")"),id:n}},[e])},uc="Codex";function ud(e){return(ud="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var uf=["size","style"];function up(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?up(Object(n),!0).forEach(function(t){var r,a,o;r=e,a=t,o=n[t],(a=function(e){var t=function(e,t){if("object"!=ud(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ud(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ud(t)?t:String(t)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):up(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var um=(0,y.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,a=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,uf),o=uu(uc),i=o.id,l=o.fill;return(0,g.jsxs)("svg",uh(uh({height:n,style:uh({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},a),{},{children:[(0,g.jsx)("title",{children:uc}),(0,g.jsx)("path",{d:"M19.503 0H4.496A4.496 4.496 0 000 4.496v15.007A4.496 4.496 0 004.496 24h15.007A4.496 4.496 0 0024 19.503V4.496A4.496 4.496 0 0019.503 0z",fill:"#fff"}),(0,g.jsx)("path",{d:"M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388zm3.482 10.565a.637.637 0 000 1.272h3.636a.637.637 0 100-1.272h-3.636zM8.462 9.23a.637.637 0 00-1.106.631l1.272 2.224-1.266 2.136a.636.636 0 101.095.649l1.454-2.455a.636.636 0 00.005-.64L8.462 9.23z",fill:l}),(0,g.jsx)("defs",{children:(0,g.jsxs)("linearGradient",{gradientUnits:"userSpaceOnUse",id:i,x1:"12",x2:"12",y1:"3",y2:"21",children:[(0,g.jsx)("stop",{stopColor:"#B1A7FF"}),(0,g.jsx)("stop",{offset:".5",stopColor:"#7A9DFF"}),(0,g.jsx)("stop",{offset:"1",stopColor:"#3941FF"})]})})]}))});function ug(e){return(ug="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var uy=["size","style"];function uv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ub(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uv(Object(n),!0).forEach(function(t){var r,a,o;r=e,a=t,o=n[t],(a=function(e){var t=function(e,t){if("object"!=ug(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ug(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ug(t)?t:String(t)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ux=(0,y.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,a=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,uy);return(0,g.jsxs)("svg",ub(ub({height:n,style:ub({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},a),{},{children:[(0,g.jsx)("title",{children:"DeepSeek"}),(0,g.jsx)("path",{d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z",fill:"#4D6BFE"})]}))});function uw(e){return(uw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var uk=["size","style"];function uj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uj(Object(n),!0).forEach(function(t){var r,a,o;r=e,a=t,o=n[t],(a=function(e){var t=function(e,t){if("object"!=uw(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=uw(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==uw(t)?t:String(t)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var uO=(0,y.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,a=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,uk);return(0,g.jsxs)("svg",uS(uS({fill:"currentColor",fillRule:"evenodd",height:n,style:uS({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},a),{},{children:[(0,g.jsx)("title",{children:"Kimi"}),(0,g.jsx)("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),(0,g.jsx)("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]}))});function uC(e){return(uC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var uN=["size","style"];function uP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uP(Object(n),!0).forEach(function(t){var r,a,o;r=e,a=t,o=n[t],(a=function(e){var t=function(e,t){if("object"!=uC(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=uC(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==uC(t)?t:String(t)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var u_={claude:ul,codex:um,kimi:uO,pi:(0,y.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,a=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,uN);return(0,g.jsxs)("svg",uE(uE({fill:"currentColor",fillRule:"evenodd",height:n,style:uE({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},a),{},{children:[(0,g.jsx)("title",{children:"Pi"}),(0,g.jsx)("path",{clipRule:"evenodd",d:"M1 1h16.5v11H12v5.5H6.5V23H1V1zm5.5 5.5V12H12V6.5H6.5z"}),(0,g.jsx)("path",{d:"M17.5 12H23v11h-5.5V12z"})]}))}),dsh:ux};function uz(e){var t=e.id,n=e.className,r=u_[t];return(0,g.jsx)(r,{"aria-hidden":!0,className:aT("size-5",n)})}let uT=O("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),uA=O("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);function uR(e){let[t,n]=y.useState(void 0);return oh(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,a;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(0,Object.defineProperty)(uR,"name",{value:"useSize",configurable:!0});var uL=Object.defineProperty,uI=(e,t)=>uL(e,"name",{value:t,configurable:!0}),uM="Checkbox",[uD,uF]=of(uM),[u$,uU]=uD(uM);function uH(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:o,form:i,name:l,onCheckedChange:s,required:u,value:c="on",internal_do_not_use_render:d}=e,[f,p]=oC({prop:n,defaultProp:a??!1,onChange:s,caller:uM}),[h,m]=y.useState(null),[v,b]=y.useState(null),x=y.useRef(!1),[w,k]=y.useReducer(e=>e+1,0),j=!h||!!i||!!h.closest("form"),S={checked:f,disabled:o,setChecked:p,control:h,setControl:m,name:l,form:i,value:c,hasConsumerStoppedPropagationRef:x,userInteractionCount:w,onUserInteraction:k,required:u,defaultChecked:!uZ(a)&&a,isFormControl:j,bubbleInput:v,setBubbleInput:b};return(0,g.jsx)(u$,{scope:t,...S,children:uq(d)?d(S):r})}uI(uH,"CheckboxProvider");var uB=y.forwardRef(uI(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a){let{control:o,value:i,disabled:l,checked:s,required:u,setControl:c,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:m}=uU("CheckboxTrigger",e),v=aG(a,c),b=y.useRef(s);return y.useEffect(()=>{let e=o?.form;if(e){let t=uI(()=>d(b.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[o,d]),(0,g.jsx)(oT.button,{type:"button",role:"checkbox","aria-checked":uZ(s)?"mixed":s,"aria-required":u,"data-state":uJ(s),"data-disabled":l?"":void 0,disabled:l,value:i,...r,ref:v,onKeyDown:ol(t,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:ol(n,e=>{p(),d(e=>!!uZ(e)||!e),m&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},"CheckboxTrigger")),uK=y.forwardRef(uI(function(e,t){let{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:i,disabled:l,value:s,onCheckedChange:u,form:c,...d}=e;return(0,g.jsx)(uH,{__scopeCheckbox:n,checked:a,defaultChecked:o,disabled:l,required:i,onCheckedChange:u,name:r,form:c,value:s,internal_do_not_use_render:({isFormControl:e})=>(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(uB,{...d,ref:t,__scopeCheckbox:n}),e&&(0,g.jsx)(uW,{__scopeCheckbox:n})]})})},"Checkbox")),uV=y.forwardRef(uI(function(e,t){let{__scopeCheckbox:n,forceMount:r,...a}=e,o=uU("CheckboxIndicator",n);return(0,g.jsx)(io,{present:r||uZ(o.checked)||!0===o.checked,children:(0,g.jsx)(oT.span,{"data-state":uJ(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),uW=y.forwardRef(uI(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:a,hasConsumerStoppedPropagationRef:o,userInteractionCount:i,checked:l,defaultChecked:s,required:u,disabled:c,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:m}=uU("CheckboxBubbleInput",e),v=aG(r,m),b=uR(a),x=y.useRef(!1),w=y.useRef(l),k=y.useRef(i);y.useEffect(()=>{if(!h)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=i!==k.current;k.current=i;let n=w.current!==l;w.current=l;let r=!(t&&o.current);if(n&&e){x.current=!t;let n=new Event("click",{bubbles:r});h.indeterminate=uZ(l),e.call(h,!uZ(l)&&l),h.dispatchEvent(n),x.current=!1}},[h,l,o,i]);let j=y.useRef(!uZ(l)&&l);return(0,g.jsx)(oT.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??j.current,required:u,disabled:c,name:d,value:f,form:p,...n,tabIndex:-1,ref:v,onClick:ol(t,e=>{x.current&&e.stopPropagation()}),style:{...n.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function uq(e){return"function"==typeof e}function uZ(e){return"indeterminate"===e}function uJ(e){return uZ(e)?"indeterminate":e?"checked":"unchecked"}uI(uq,"isFunction"),uI(uZ,"isIndeterminate"),uI(uJ,"getState");let uG=O("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);function uQ(e){var t,n,r=e.className,a=function(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,["className"]);return(0,g.jsx)(uK,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"checkbox",className:aT("peer size-4 shrink-0 cursor-pointer rounded-[5px] border border-input bg-card shadow-[0_1px_2px_rgb(20_24_40/0.04)] outline-none transition-[border-color,box-shadow,background-color] hover:border-ring/35 focus-visible:border-ring/50 focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",r)},a),n=n={children:(0,g.jsx)(uV,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current",children:(0,g.jsx)(uG,{className:"size-3",strokeWidth:3.5})})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}function uY(e){var t=e.className,n=e.type,r=function(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,["className","type"]);return(0,g.jsx)("input",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({type:n,"data-slot":"input",className:aT("flex h-10 w-full rounded-[10px] border border-input bg-card px-3 py-1 text-base shadow-[0_1px_2px_rgb(20_24_40/0.04)] transition-[border-color,box-shadow] file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t)},r))}var uX=Object.defineProperty,u0=y.forwardRef(uX(function(e,t){return(0,g.jsx)(oT.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}));function u1(e){var t=e.className,n=function(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,["className"]);return(0,g.jsx)(u0,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"label",className:aT("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t)},n))}function u2(e,[t,n]){return Math.min(n,Math.max(t,e))}(0,Object.defineProperty)(u2,"name",{value:"clamp",configurable:!0});var u4=Object.defineProperty,u3=(e,t)=>u4(e,"name",{value:t,configurable:!0});function u5(e){let t=e+"CollectionProvider",[n,r]=of(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=u3(e=>{let{scope:t,children:n}=e,r=y.useRef(null),o=y.useRef(new Map).current;return(0,g.jsx)(a,{scope:t,itemMap:o,collectionRef:r,children:n})},"CollectionProvider");i.displayName=t;let l=e+"CollectionSlot",s=aX(l),u=y.forwardRef((e,t)=>{let{scope:n,children:r}=e,a=aG(t,o(l,n).collectionRef);return(0,g.jsx)(s,{ref:a,children:r})});u.displayName=l;let c=e+"CollectionItemSlot",d="data-radix-collection-item",f=aX(c),p=y.forwardRef((e,t)=>{let{scope:n,children:r,...a}=e,i=y.useRef(null),l=aG(t,i),s=o(c,n);return y.useEffect(()=>(s.itemMap.set(i,{ref:i,...a}),()=>void s.itemMap.delete(i))),(0,g.jsx)(f,{...{[d]:""},ref:l,children:r})});function h(t){let n=o(e+"CollectionConsumer",t);return y.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return p.displayName=c,u3(h,"useCollection"),[{Provider:i,Slot:u,ItemSlot:p},h,r]}u3(u5,"createCollection");var u6=new WeakMap,u8=class e extends Map{static{u3(this,"OrderedDict")}#e;constructor(e){super(e),this.#e=[...super.keys()],u6.set(this,!0)}set(e,t){return u6.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r,a=this.has(t),o=this.#e.length,i=ce(e),l=i>=0?i:o+i,s=l<0||l>=o?-1:l;if(s===this.size||a&&s===this.size-1||-1===s)return this.set(t,n),this;let u=this.size+ +!a;i<0&&l++;let c=[...this.#e],d=!1;for(let e=l;e<u;e++)if(l===e){let o=c[e];c[e]===t&&(o=c[e+1]),a&&this.delete(t),r=this.get(o),this.set(t,n)}else{d||c[e-1]!==t||(d=!0);let n=c[d?e:e-1],a=r;r=this.get(n),this.delete(n),this.set(n,a)}return this}with(t,n,r){let a=new e(this);return a.insert(t,n,r),a}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=u9(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=u9(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return u9(this.#e,e)}from(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return -1}filter(t,n){let r=[],a=0;for(let e of this)Reflect.apply(t,n,[e,a,this])&&r.push(e),a++;return new e(r)}map(t,n){let r=[],a=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,a,this])]),a++;return new e(r)}reduce(...e){let[t,n]=e,r=0,a=n??this.at(0);for(let n of this)a=0===r&&1===e.length?n:Reflect.apply(t,this,[a,n,r,this]),r++;return a}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let a=this.at(n);r=n===this.size-1&&1===e.length?a:Reflect.apply(t,this,[r,a,n,this])}return r}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,a=this.size-1;if(void 0===t)return r;t<0&&(t+=this.size),void 0!==n&&n>0&&(a=n-1);for(let e=t;e<=a;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function u9(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=u7(e,t);return -1===n?void 0:e[n]}function u7(e,t){let n=e.length,r=ce(t),a=r>=0?r:n+r;return a<0||a>=n?-1:a}function ce(e){return e!=e||0===e?0:Math.trunc(e)}function ct(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}function cn(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function cr(e,t){return e[1].element&&t[1].element?cn(e[1].element,t[1].element)?-1:1:0}function ca(e){return new MutationObserver(t=>{for(let n of t)if("childList"===n.type)return void e()})}u3(u9,"at"),u3(u7,"toSafeIndex"),u3(ce,"toSafeInteger"),u3(function(e){let t=e+"CollectionProvider",[n,r]=of(t),[a,o]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new u8,setItemMap:u3(()=>void 0,"setItemMap")}),i=u3(({state:e,...t})=>e?(0,g.jsx)(s,{...t,state:e}):(0,g.jsx)(l,{...t}),"CollectionProvider");i.displayName=t;let l=u3(e=>{let t=m();return(0,g.jsx)(s,{...e,state:t})},"CollectionInit");l.displayName=t+"Init";let s=u3(e=>{let{scope:t,children:n,state:r}=e,o=y.useRef(null),[i,l]=y.useState(null),s=aG(o,l),[u,c]=r;return y.useEffect(()=>{if(!i)return;let e=ca(()=>{});return e.observe(i,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[i]),(0,g.jsx)(a,{scope:t,itemMap:u,setItemMap:c,collectionRef:s,collectionRefObject:o,collectionElement:i,children:n})},"CollectionProviderImpl");s.displayName=t+"Impl";let u=e+"CollectionSlot",c=aX(u),d=y.forwardRef((e,t)=>{let{scope:n,children:r}=e,a=aG(t,o(u,n).collectionRef);return(0,g.jsx)(c,{ref:a,children:r})});d.displayName=u;let f=e+"CollectionItemSlot",p=aX(f),h=y.forwardRef((e,t)=>{let{scope:n,children:r,...a}=e,i=y.useRef(null),[l,s]=y.useState(null),u=aG(t,i,s),{setItemMap:c}=o(f,n),d=y.useRef(a);ct(d.current,a)||(d.current=a);let h=d.current;return y.useEffect(()=>(c(e=>l?e.has(l)?e.set(l,{...h,element:l}).toSorted(cr):(e.set(l,{...h,element:l}),e.toSorted(cr)):e),()=>{c(e=>l&&e.has(l)?(e.delete(l),new u8(e)):e)}),[l,h,c]),(0,g.jsx)(p,{"data-radix-collection-item":"",ref:u,children:r})});function m(){return y.useState(new u8)}function v(t){let{itemMap:n}=o(e+"CollectionConsumer",t);return n}return h.displayName=f,u3(m,"useInitCollection"),u3(v,"useCollection"),[{Provider:i,Slot:d,ItemSlot:h},{createCollectionScope:r,useCollection:v,useInitCollection:m}]},"createCollection"),u3(ct,"shallowEqual"),u3(cn,"isElementPreceding"),u3(cr,"sortByDocumentPosition"),u3(ca,"getChildListObserver");var co=Object.defineProperty,ci=y.createContext(void 0);function cl(e){let t=y.useContext(ci);return e||t||"ltr"}co(cl,"name",{value:"useDirection",configurable:!0});let cs=["top","right","bottom","left"],cu=Math.min,cc=Math.max,cd=Math.round,cf=Math.floor,cp=e=>({x:e,y:e}),ch={left:"right",right:"left",bottom:"top",top:"bottom"};function cm(e,t){return"function"==typeof e?e(t):e}function cg(e){return e.split("-")[0]}function cy(e){return e.split("-")[1]}function cv(e){return"x"===e?"y":"x"}function cb(e){return"y"===e?"height":"width"}function cx(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function cw(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let ck=["left","right"],cj=["right","left"],cS=["top","bottom"],cO=["bottom","top"];function cC(e){let t=cg(e);return ch[t]+e.slice(t.length)}function cN(e){var t,n,r,a;return"number"!=typeof e?{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(r=e.bottom)?r:0,left:null!=(a=e.left)?a:0}:{top:e,right:e,bottom:e,left:e}}function cP(e){let{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function cE(e,t,n){let r,{reference:a,floating:o}=e,i=cx(t),l=cv(cx(t)),s=cb(l),u=cg(t),c=a.x+a.width/2-o.width/2,d=a.y+a.height/2-o.height/2,f=a[s]/2-o[s]/2;switch(u){case"top":r={x:c,y:a.y-o.height};break;case"bottom":r={x:c,y:a.y+a.height};break;case"right":r={x:a.x+a.width,y:d};break;case"left":r={x:a.x-o.width,y:d};break;default:r={x:a.x,y:a.y}}let p=cy(t);return p&&(r[l]+=f*("end"===p?1:-1)*(n&&"y"===i?-1:1)),r}async function c_(e,t){var n;void 0===t&&(t={});let{x:r,y:a,platform:o,rects:i,elements:l,strategy:s}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=cm(t,e),h=cN(p),m=l[f?"floating"===d?"reference":"floating":d],g=cP(await o.getClippingRect({element:null==(n=await (null==o.isElement?void 0:o.isElement(m)))||n?m:m.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:u,rootBoundary:c,strategy:s})),y="floating"===d?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,v=await (null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),b=await (null==o.isElement?void 0:o.isElement(v))&&await (null==o.getScale?void 0:o.getScale(v))||{x:1,y:1},x=cP(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:s}):y);return{top:(g.top-x.top+h.top)/b.y,bottom:(x.bottom-g.bottom+h.bottom)/b.y,left:(g.left-x.left+h.left)/b.x,right:(x.right-g.right+h.right)/b.x}}let cz=async(e,t,n)=>{let{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:c_},s=await (null==i.isRTL?void 0:i.isRTL(t)),u=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:c,y:d}=cE(u,r,s),f=r,p=0,h={};for(let n=0;n<o.length;n++){let m=o[n];if(!m)continue;let{name:g,fn:y}=m,{x:v,y:b,data:x,reset:w}=await y({x:c,y:d,initialPlacement:r,placement:f,strategy:a,middlewareData:h,rects:u,platform:l,elements:{reference:e,floating:t}});c=null!=v?v:c,d=null!=b?b:d,h[g]={...h[g],...x},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(u=!0===w.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):w.rects),{x:c,y:d}=cE(u,f,s)),n=-1)}return{x:c,y:d,placement:f,strategy:a,middlewareData:h}};function cT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cA(e){return cs.some(t=>e[t]>=0)}let cR=new Set(["left","top"]);async function cL(e,t){let{placement:n,platform:r,elements:a}=e,o=await (null==r.isRTL?void 0:r.isRTL(a.floating)),i=cg(n),l=cy(n),s="y"===cx(n),u=cR.has(i)?-1:1,c=o&&s?-1:1,d=cm(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&"number"==typeof h&&(p="end"===l?-1*h:h),s?{x:p*c,y:f*u}:{x:f*u,y:p*c}}function cI(){return"u">typeof window}function cM(e){return c$(e)?(e.nodeName||"").toLowerCase():"#document"}function cD(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function cF(e){var t;return null==(t=(c$(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function c$(e){return!!cI()&&(e instanceof Node||e instanceof cD(e).Node)}function cU(e){return!!cI()&&(e instanceof Element||e instanceof cD(e).Element)}function cH(e){return!!cI()&&(e instanceof HTMLElement||e instanceof cD(e).HTMLElement)}function cB(e){return!(!cI()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof cD(e).ShadowRoot)}function cK(e){let{overflow:t,overflowX:n,overflowY:r,display:a}=cY(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==a&&"contents"!==a}function cV(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let cW=/transform|translate|scale|rotate|perspective|filter/,cq=/paint|layout|strict|content/,cZ=e=>!!e&&"none"!==e;function cJ(e){let t=cU(e)?cY(e):e;return cZ(t.transform)||cZ(t.translate)||cZ(t.scale)||cZ(t.rotate)||cZ(t.perspective)||!cG()&&(cZ(t.backdropFilter)||cZ(t.filter))||cW.test(t.willChange||"")||cq.test(t.contain||"")}function cG(){return null==e&&(e="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),e}function cQ(e){return/^(html|body|#document)$/.test(cM(e))}function cY(e){return cD(e).getComputedStyle(e)}function cX(e){return cU(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function c0(e){if("html"===cM(e))return e;let t=e.assignedSlot||e.parentNode||cB(e)&&e.host||cF(e);return cB(t)?t.host:t}function c1(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let a=function e(t){let n=c0(t);return cQ(n)?(t.ownerDocument||t).body:cH(n)&&cK(n)?n:e(n)}(e),o=a===(null==(r=e.ownerDocument)?void 0:r.body),i=cD(a);if(!o)return t.concat(a,c1(a,[],n));{let e=c2(i);return t.concat(i,i.visualViewport||[],cK(a)?a:[],e&&n?c1(e):[])}}function c2(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function c4(e){let t=cY(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,a=cH(e),o=a?e.offsetWidth:n,i=a?e.offsetHeight:r,l=cd(n)!==o||cd(r)!==i;return l&&(n=o,r=i),{width:n,height:r,$:l}}function c3(e){return cU(e)?e:e.contextElement}function c5(e){let t=c3(e);if(!cH(t))return cp(1);let n=t.getBoundingClientRect(),{width:r,height:a,$:o}=c4(t),i=(o?cd(n.width):n.width)/r,l=(o?cd(n.height):n.height)/a;return i&&Number.isFinite(i)||(i=1),l&&Number.isFinite(l)||(l=1),{x:i,y:l}}let c6=cp(0);function c8(e){let t=cD(e);return cG()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:c6}function c9(e,t,n,r){var a;void 0===t&&(t=!1),void 0===n&&(n=!1);let o=e.getBoundingClientRect(),i=c3(e),l=cp(1);t&&(r?cU(r)&&(l=c5(r)):l=c5(e));let s=(void 0===(a=n)&&(a=!1),r&&a&&r===cD(i))?c8(i):cp(0),u=(o.left+s.x)/l.x,c=(o.top+s.y)/l.y,d=o.width/l.x,f=o.height/l.y;if(i&&r){let e=cD(i),t=cU(r)?cD(r):r,n=e,a=c2(n);for(;a&&t!==n;){let e=c5(a),t=a.getBoundingClientRect(),r=cY(a),o=t.left+(a.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(a.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,c*=e.y,d*=e.x,f*=e.y,u+=o,c+=i,a=c2(n=cD(a))}}return cP({width:d,height:f,x:u,y:c})}function c7(e,t){let n=cX(e).scrollLeft;return t?t.left+n:c9(cF(e)).left+n}function de(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-c7(e,n),y:n.top+t.scrollTop}}function dt(e,t,n){var r;let a;if("viewport"===t||"layoutViewport"===t)a=function(e,t,n){void 0===n&&(n="viewport");let r="layoutViewport"===n,a=cD(e),o=cF(e),i=a.visualViewport,l=o.clientWidth,s=o.clientHeight,u=0,c=0;if(i){let e=!cG()||"fixed"===t;r?e||(u=-i.offsetLeft,c=-i.offsetTop):(l=i.width,s=i.height,e&&(u=i.offsetLeft,c=i.offsetTop))}if(0>=c7(o)){let e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(o.clientWidth-t.clientWidth-r),i="stable both-edges"===getComputedStyle(o).scrollbarGutter?a/2:a;i<=25&&(l-=i)}return{width:l,height:s,x:u,y:c}}(e,n,t);else if("document"===t){let t,n,o,i,l,s;t=cX(r=cF(e)),n=r.ownerDocument.body,o=cc(r.scrollWidth,r.clientWidth,n.scrollWidth,n.clientWidth),i=cc(r.scrollHeight,r.clientHeight,n.scrollHeight,n.clientHeight),l=-t.scrollLeft+c7(r),s=-t.scrollTop,"rtl"===cY(n).direction&&(l+=cc(r.clientWidth,n.clientWidth)-o),a={width:o,height:i,x:l,y:s}}else if(cU(t)){let e,r,o,i,l,s;r=(e=c9(t,!0,"fixed"===n)).top+t.clientTop,o=e.left+t.clientLeft,i=c5(t),l=t.clientWidth*i.x,s=t.clientHeight*i.y,a={width:l,height:s,x:o*i.x,y:r*i.y}}else{let n=c8(e);a={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return cP(a)}function dn(e){return"static"===cY(e).position}function dr(e,t){if(!cH(e)||"fixed"===cY(e).position)return null;if(t)return t(e);let n=e.offsetParent;return cF(e)===n&&(n=n.ownerDocument.body),n}function da(e,t){var n;let r=cD(e);if(cV(e))return r;if(!cH(e)){let t=c0(e);for(;t&&!cQ(t);){if(cU(t)&&!dn(t))return t;t=c0(t)}return r}let a=dr(e,t);for(;a&&(n=a,/^(table|td|th)$/.test(cM(n)))&&dn(a);)a=dr(a,t);return a&&cQ(a)&&dn(a)&&!cJ(a)?r:a||function(e){let t=c0(e);for(;cH(t)&&!cQ(t);){if(cJ(t))return t;if(cV(t))break;t=c0(t)}return null}(e)||r}let di=async function(e){let t=this.getOffsetParent||da,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=cH(t),a=cF(t),o="fixed"===n,i=c9(e,!0,o,t),l={scrollLeft:0,scrollTop:0},s=cp(0);if((r||!o)&&(("body"!==cM(t)||cK(a))&&(l=cX(t)),r)){let e=c9(t,!0,o,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}!r&&a&&(s.x=c7(a));let u=!a||r||o?cp(0):de(a,l);return{x:i.left+l.scrollLeft-s.x-u.x,y:i.top+l.scrollTop-s.y-u.y,width:i.width,height:i.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},dl={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e,o="fixed"===a,i=cF(r),l=!!t&&cV(t.floating);if(r===i||l&&o)return n;let s={scrollLeft:0,scrollTop:0},u=cp(1),c=cp(0),d=cH(r);if((d||!o)&&(("body"!==cM(r)||cK(i))&&(s=cX(r)),d)){let e=c9(r);u=c5(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}let f=!i||d||o?cp(0):de(i,s);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-s.scrollTop*u.y+c.y+f.y}},getDocumentElement:cF,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e,o=[..."clippingAncestors"===n?cV(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=c1(e,[],!1).filter(e=>cU(e)&&"body"!==cM(e)),a=null,o="fixed"===cY(e).position,i=o?c0(e):e;for(;cU(i)&&!cQ(i);){let e=cY(i),t=cJ(i),n=a?a.position:o?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?a=e:r=r.filter(e=>e!==i),i=c0(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=dt(t,o[0],a),l=i.top,s=i.right,u=i.bottom,c=i.left;for(let e=1;e<o.length;e++){let n=dt(t,o[e],a);l=cc(n.top,l),s=cu(n.right,s),u=cu(n.bottom,u),c=cc(n.left,c)}return{width:s-c,height:u-l,x:c,y:l}},getOffsetParent:da,getElementRects:di,getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){let{width:t,height:n}=c4(e);return{width:t,height:n}},getScale:c5,isElement:cU,isRTL:function(e){return"rtl"===cY(e).direction}};function ds(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let du=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:a,rects:o,platform:i,elements:l,middlewareData:s}=t,{element:u,padding:c=0}=cm(e,t)||{};if(null==u)return{};let d=cN(c),f={x:n,y:r},p=cv(cx(a)),h=cb(p),m=await i.getDimensions(u),g="y"===p,y=g?"clientHeight":"clientWidth",v=o.reference[h]+o.reference[p]-f[p]-o.floating[h],b=f[p]-o.reference[p],x=await (null==i.getOffsetParent?void 0:i.getOffsetParent(u)),w=x?x[y]:0;w&&await (null==i.isElement?void 0:i.isElement(x))||(w=l.floating[y]||o.floating[h]);let k=w/2-m[h]/2-1,j=cu(d[g?"top":"left"],k),S=cu(d[g?"bottom":"right"],k),O=w-m[h]-S,C=w/2-m[h]/2+(v/2-b/2),N=cc(j,cu(C,O)),P=!s.arrow&&null!=cy(a)&&C!==N&&o.reference[h]/2-(C<j?j:S)-m[h]/2<0,E=P?C<j?C-j:C-O:0;return{[p]:f[p]+E,data:{[p]:N,centerOffset:C-N-E,...P&&{alignmentOffset:E}},reset:P}}});var dc="u">typeof document?y.useLayoutEffect:function(){};function dd(e,t){let n,r,a;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!dd(e[r],t[r]))return!1;return!0}if((n=(a=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,a[r]))return!1;for(r=n;0!=r--;){let n=a[r];if(("_owner"!==n||!e.$$typeof)&&!dd(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function df(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dp(e,t){let n=df(e);return Math.round(t*n)/n}function dh(e){let t=y.useRef(e);return dc(()=>{t.current=e}),t}var dm=Object.defineProperty,dg=(e,t)=>dm(e,"name",{value:t,configurable:!0}),dy="Popper",[dv,db]=of(dy),[dx,dw]=dv(dy),dk=dg(e=>{let{__scopePopper:t,children:n}=e,[r,a]=y.useState(null),[o,i]=y.useState(void 0);return(0,g.jsx)(dx,{scope:t,anchor:r,onAnchorChange:a,placementState:o,setPlacementState:i,children:n})},"Popper"),dj=y.forwardRef(dg(function(e,t){let{__scopePopper:n,virtualRef:r,...a}=e,o=dw("PopperAnchor",n),i=y.useRef(null),l=o.onAnchorChange,s=aG(t,y.useCallback(e=>{i.current=e,e&&l(e)},[l])),u=y.useRef(null);y.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&l(u.current)});let c=o.placementState&&d_(o.placementState),d=c?.[0],f=c?.[1];return r?null:(0,g.jsx)(oT.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...a,ref:s})},"PopperAnchor")),dS="PopperContent",[dO,dC]=dv(dS),dN=y.forwardRef(dg(function(e,t){var n,r,a,o,i,l,s,u,c,d,f,p,h,m,v,b,x,w,k,j,S;let O,C,N,P,E,_,{__scopePopper:z,side:T="bottom",sideOffset:A=0,align:R="center",alignOffset:L=0,arrowPadding:I=0,avoidCollisions:M=!0,collisionBoundary:D=[],collisionPadding:F=0,sticky:$="partial",hideWhenDetached:U=!1,updatePositionStrategy:H="optimized",onPlaced:B,...K}=e,V=dw(dS,z),[W,q]=y.useState(null),Z=aG(t,q),[J,G]=y.useState(null),Q=uR(J),Y=Q?.width??0,X=Q?.height??0,ee="number"==typeof F?F:{top:0,right:0,bottom:0,left:0,...F},et=Array.isArray(D)?D:[D],en=et.length>0,er={padding:ee,boundary:et.filter(dP),altBoundary:en},{refs:ea,floatingStyles:eo,placement:ei,isPositioned:el,middlewareData:es}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:i}={},transform:l=!0,whileElementsMounted:s,open:u}=e,[c,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=y.useState(r);dd(f,r)||p(r);let[h,m]=y.useState(null),[g,v]=y.useState(null),b=y.useCallback(e=>{e!==j.current&&(j.current=e,m(e))},[]),x=y.useCallback(e=>{e!==S.current&&(S.current=e,v(e))},[]),w=o||h,k=i||g,j=y.useRef(null),S=y.useRef(null),O=y.useRef(c),C=null!=s,N=dh(s),P=dh(a),E=dh(u),_=y.useCallback(()=>{var e,r;let a,o,i;if(!j.current||!S.current)return;let l={placement:t,strategy:n,middleware:f};P.current&&(l.platform=P.current),(e=j.current,r=S.current,a=new Map,o=null!=l?l:{},i={...dl,...o.platform,_c:a},cz(e,r,{...o,platform:i})).then(e=>{let t={...e,isPositioned:!1!==E.current};z.current&&!dd(O.current,t)&&(O.current=t,o_.flushSync(()=>{d(t)}))})},[f,t,n,P,E]);dc(()=>{!1===u&&O.current.isPositioned&&(O.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[u]);let z=y.useRef(!1);dc(()=>(z.current=!0,()=>{z.current=!1}),[]),dc(()=>{if(w&&(j.current=w),k&&(S.current=k),w&&k){if(N.current)return N.current(w,k,_);_()}},[w,k,_,N,C]);let T=y.useMemo(()=>({reference:j,floating:S,setReference:b,setFloating:x}),[b,x]),A=y.useMemo(()=>({reference:w,floating:k}),[w,k]),R=y.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=dp(A.floating,c.x),r=dp(A.floating,c.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...df(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,A.floating,c.x,c.y]);return y.useMemo(()=>({...c,update:_,refs:T,elements:A,floatingStyles:R}),[c,_,T,A,R])}({strategy:"fixed",placement:T+("center"!==R?"-"+R:""),whileElementsMounted:dg((...e)=>(function(e,t,n,r){let a;void 0===r&&(r={});let{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:u=!1}=r,c=c3(e),d=o||i?[...c?c1(c):[],...t?c1(t):[]]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n),i&&e.addEventListener("resize",n)});let f=c&&s?function(e,t,n){let r,a=null,o=cF(e);function i(){var e;clearTimeout(r),null==(e=a)||e.disconnect(),a=null}function l(n,s){void 0===n&&(n=!1),void 0===s&&(s=1),i();let u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:p}=u;if(n||t(),!f||!p)return;let h={rootMargin:-cf(d)+"px "+-cf(o.clientWidth-(c+f))+"px "+-cf(o.clientHeight-(d+p))+"px "+-cf(c)+"px",threshold:cc(0,cu(1,s))||1},m=!0;function g(t){let n=t[0].intersectionRatio;if(!ds(u,e.getBoundingClientRect()))return l();if(n!==s){if(!m)return l();n?l(!1,n):r=setTimeout(()=>{l(!1,1e-7)},1e3)}m=!1}try{a=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){a=new IntersectionObserver(g,h)}a.observe(e)}let s=cD(e),u=()=>l(n);return s.addEventListener("resize",u),l(!0),()=>{s.removeEventListener("resize",u),i()}}(c,n,i):null,p=-1,h=null;l&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!u&&h.observe(c),t&&h.observe(t));let m=u?c9(e):null;return u&&function t(){let r=c9(e);m&&!ds(m,r)&&n(),m=r,a=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=h)||e.disconnect(),h=null,u&&cancelAnimationFrame(a)}})(...e,{animationFrame:"always"===H}),"whileElementsMounted"),elements:{reference:V.anchor},middleware:[{name:(O={name:"offset",options:a=n={mainAxis:A+X,alignmentAxis:L},async fn(e){var t,n;let{x:r,y:o,placement:i,middlewareData:l}=e,s=await cL(e,a);return i===(null==(t=l.offset)?void 0:t.placement)&&null!=(n=l.arrow)&&n.alignmentOffset?{}:{x:r+s.x,y:o+s.y,data:{...s,placement:i}}}}).name,fn:O.fn,options:[n,r]},M&&{name:(C={name:"shift",options:c=s={mainAxis:!0,crossAxis:!1,limiter:"partial"===$?{fn:(void 0===(l=o)&&(l={}),{options:l,fn(e){var t,n,r,a;let{x:o,y:i,placement:s,rects:u,middlewareData:c}=e,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=cm(l,e),h={x:o,y:i},m=cx(s),g=cv(m),y=h[g],v=h[m],b=cm(d,e),x="number"==typeof b?{mainAxis:b,crossAxis:0}:{mainAxis:null!=(t=b.mainAxis)?t:0,crossAxis:null!=(n=b.crossAxis)?n:0};if(f){let e="y"===g?"height":"width",t=u.reference[g]-u.floating[e]+x.mainAxis,n=u.reference[g]+u.reference[e]-x.mainAxis;y<t?y=t:y>n&&(y=n)}if(p){let e="y"===g?"width":"height",t=cR.has(cg(s)),n=u.reference[m]-u.floating[e]+(t&&(null==(r=c.offset)?void 0:r[m])||0)+(t?0:x.crossAxis),o=u.reference[m]+u.reference[e]+(t?0:(null==(a=c.offset)?void 0:a[m])||0)-(t?x.crossAxis:0);v<n?v=n:v>o&&(v=o)}return{[g]:y,[m]:v}}}).fn,options:[o,i]}:void 0,...er},async fn(e){let{x:t,y:n,placement:r,platform:a}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=cm(c,e),u={x:t,y:n},d=await a.detectOverflow(e,s),f=cx(r),p=cv(f),h=u[p],m=u[f],g=(e,t)=>cc(t+d["y"===e?"top":"left"],cu(t,t-d["y"===e?"bottom":"right"]));o&&(h=g(p,h)),i&&(m=g(f,m));let y=l.fn({...e,[p]:h,[f]:m});return{...y,data:{x:y.x-t,y:y.y-n,enabled:{[p]:o,[f]:i}}}}}).name,fn:C.fn,options:[s,u]},M&&{name:(N={name:"flip",options:p=d={...er},async fn(e){var t,n,r,a,o,i,l,s;let u,c,d,{placement:f,middlewareData:h,rects:m,initialPlacement:g,platform:y,elements:v}=e,{mainAxis:b=!0,crossAxis:x=!0,fallbackPlacements:w,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:S=!0,...O}=cm(p,e);if(null!=(t=h.arrow)&&t.alignmentOffset)return{};let C=cg(f),N=cx(g),P=cg(g)===g,E=await (null==y.isRTL?void 0:y.isRTL(v.floating)),_=w||(P||!S?[cC(g)]:(u=cC(g),[cw(g),u,cw(u)])),z="none"!==j;!w&&z&&_.push(...(c=cy(g),d=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?cj:ck;return t?ck:cj;case"left":case"right":return t?cS:cO;default:return[]}}(cg(g),"start"===j,E),c&&(d=d.map(e=>e+"-"+c),S&&(d=d.concat(d.map(cw)))),d));let T=[g,..._],A=await y.detectOverflow(e,O),R=[],L=(null==(n=h.flip)?void 0:n.overflows)||[];if(b&&R.push(A[C]),x){let e,t,n,r,a=(i=f,l=m,void 0===(s=E)&&(s=!1),e=cy(i),n=cb(t=cv(cx(i))),r="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",l.reference[n]>l.floating[n]&&(r=cC(r)),[r,cC(r)]);R.push(A[a[0]],A[a[1]])}if(L=[...L,{placement:f,overflows:R}],!R.every(e=>e<=0)){let e=((null==(r=h.flip)?void 0:r.index)||0)+1,t=T[e];if(t&&("alignment"!==x||N===cx(t)||L.every(e=>cx(e.placement)!==N||e.overflows[0]>0)))return{data:{index:e,overflows:L},reset:{placement:t}};let n=null==(a=L.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:a.placement;if(!n)switch(k){case"bestFit":{let e=null==(o=L.filter(e=>{if(z){let t=cx(e.placement);return t===N||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(n=e);break}case"initialPlacement":n=g}if(f!==n)return{reset:{placement:n}}}return{}}}).name,fn:N.fn,options:[d,f]},{name:(P={name:"size",options:v=h={...er,apply:dg(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:a,height:o}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${o}px`)},"apply")},async fn(e){let t,n,{placement:r,rects:a,platform:o,elements:i}=e,{apply:l=()=>{},...s}=cm(v,e),u=await o.detectOverflow(e,s),c=cg(r),d=cy(r),f="y"===cx(r),{width:p,height:h}=a.floating;"top"===c||"bottom"===c?(t=c,n=d===(await (null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(n=c,t="end"===d?"top":"bottom");let m=h-u.top-u.bottom,g=p-u.left-u.right,y=cu(h-u[t],m),b=cu(p-u[n],g),x=e.middlewareData.shift,w=!x,k=y,j=b;null!=x&&x.enabled.x&&(j=g),null!=x&&x.enabled.y&&(k=m),w&&!d&&(f?j=p-2*cc(u.left,u.right):k=h-2*cc(u.top,u.bottom)),await l({...e,availableWidth:j,availableHeight:k});let S=await o.getDimensions(i.floating);return p!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}).name,fn:P.fn,options:[h,m]},J&&{name:(E={name:"arrow",options:w=b={element:J,padding:I},fn(e){let{element:t,padding:n}="function"==typeof w?w(e):w;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?du({element:t.current,padding:n}).fn(e):{}:t?du({element:t,padding:n}).fn(e):{}}}).name,fn:E.fn,options:[b,x]},dE({arrowWidth:Y,arrowHeight:X}),U&&{name:(_={name:"hide",options:S=k={strategy:"referenceHidden",...er,boundary:en?er.boundary:void 0},async fn(e){let{rects:t,platform:n}=e,{strategy:r="referenceHidden",...a}=cm(S,e);switch(r){case"referenceHidden":{let r=cT(await n.detectOverflow(e,{...a,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:cA(r)}}}case"escaped":{let r=cT(await n.detectOverflow(e,{...a,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:cA(r)}}}default:return{}}}}).name,fn:_.fn,options:[k,j]}]}),eu=V.setPlacementState;oh(()=>(eu(ei),()=>{eu(void 0)}),[ei,eu]);let[ec,ed]=d_(ei),ef=oR(B);oh(()=>{el&&ef?.()},[el,ef]);let ep=es.arrow?.x,eh=es.arrow?.y,em=es.arrow?.centerOffset!==0,[eg,ey]=y.useState();return oh(()=>{W&&ey(window.getComputedStyle(W).zIndex)},[W]),(0,g.jsx)("div",{ref:ea.setFloating,"data-radix-popper-content-wrapper":"",style:{...eo,transform:el?eo.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eg,"--radix-popper-transform-origin":[es.transformOrigin?.x,es.transformOrigin?.y].join(" "),...es.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,g.jsx)(dO,{scope:z,placedSide:ec,placedAlign:ed,onArrowChange:G,arrowX:ep,arrowY:eh,shouldHideArrow:em,children:(0,g.jsx)(oT.div,{"data-side":ec,"data-align":ed,...K,ref:Z,style:{...K.style,animation:el?K.style?.animation:"none"}})})})},"PopperContent"));function dP(e){return null!==e}dg(dP,"isNotNull");var dE=dg(e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:a}=t,o=a.arrow?.centerOffset!==0,i=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[s,u]=d_(n),c={start:"0%",center:"50%",end:"100%"}[u],d=(a.arrow?.x??0)+i/2,f=(a.arrow?.y??0)+l/2,p="",h="";return"bottom"===s?(p=o?c:`${d}px`,h=`${-l}px`):"top"===s?(p=o?c:`${d}px`,h=`${r.floating.height+l}px`):"right"===s?(p=`${-l}px`,h=o?c:`${f}px`):"left"===s&&(p=`${r.floating.width+l}px`,h=o?c:`${f}px`),{data:{x:p,y:h}}}}),"transformOrigin");function d_(e){let[t,n="center"]=e.split("-");return[t,n]}function dz(e){let t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}dg(d_,"getSideAndAlignFromPlacement"),(0,Object.defineProperty)(dz,"name",{value:"usePrevious",configurable:!0});var dT=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dA=Object.defineProperty,dR=(e,t)=>dA(e,"name",{value:t,configurable:!0}),dL=[" ","Enter","ArrowUp","ArrowDown"],dI=[" ","Enter"],dM="Select",[dD,dF,d$]=u5(dM),[dU,dH]=of(dM,[d$,db]),dB=db(),[dK,dV]=dU(dM),[dW,dq]=dU(dM);function dZ(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:i,defaultValue:l,onValueChange:s,dir:u,name:c,autoComplete:d,disabled:f,required:p,form:h,internal_do_not_use_render:m}=e,v=dB(t),[b,x]=y.useState(null),[w,k]=y.useState(null),[j,S]=y.useState(!1),O=cl(u),[C,N]=oC({prop:r,defaultProp:a??!1,onChange:o,caller:dM}),[P,E]=oC({prop:i,defaultProp:l,onChange:s,caller:dM}),_=y.useRef(null),z=y.useRef(P);y.useEffect(()=>{let e=h?b?.ownerDocument.getElementById(h):b?.form;if(e instanceof HTMLFormElement){let t=dR(()=>E(z.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[h,b,E]);let T=!b||!!h||!!b.closest("form"),[A,R]=y.useState(new Set),L=ov(),I=Array.from(A).map(e=>e.props.value).join(";"),M=y.useCallback(e=>{R(t=>new Set(t).add(e))},[]),D=y.useCallback(e=>{R(t=>{let n=new Set(t);return n.delete(e),n})},[]),F={required:p,trigger:b,onTriggerChange:x,valueNode:w,onValueNodeChange:k,valueNodeHasChildren:j,onValueNodeHasChildrenChange:S,contentId:L,value:P,onValueChange:E,open:C,onOpenChange:N,dir:O,triggerPointerDownPosRef:_,disabled:f,name:c,autoComplete:d,form:h,nativeOptions:A,nativeSelectKey:I,isFormControl:T};return(0,g.jsx)(dk,{...v,children:(0,g.jsx)(dK,{scope:t,...F,children:(0,g.jsx)(dD.Provider,{scope:t,children:(0,g.jsx)(dW,{scope:t,onNativeOptionAdd:M,onNativeOptionRemove:D,children:fk(m)?m(F):n})})})})}dR(dZ,"SelectProvider");var dJ=dR(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,g.jsx)(dZ,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,g.jsxs)(g.Fragment,{children:[n,e?(0,g.jsx)(fw,{__scopeSelect:t}):null]})})},"Select"),dG=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,disabled:r=!1,...a}=e,o=dB(n),i=dV("SelectTrigger",n),l=i.disabled||r,s=aG(t,i.onTriggerChange),u=dF(n),c=y.useRef("touch"),[d,f,p]=fS(e=>{let t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===i.value),r=fO(t,e,n);void 0!==r&&i.onValueChange(r.value)}),h=dR(e=>{l||(i.onOpenChange(!0),p()),e&&(i.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},"handleOpen");return(0,g.jsx)(dj,{asChild:!0,...o,children:(0,g.jsx)(oT.button,{type:"button",role:"combobox","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":fj(i.value)?"":void 0,...a,ref:s,onClick:ol(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==c.current&&h(e)}),onPointerDown:ol(a.onPointerDown,e=>{c.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(h(e),e.preventDefault())}),onKeyDown:ol(a.onKeyDown,e=>{let t=""!==d.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||f(e.key),(!t||" "!==e.key)&&dL.includes(e.key)&&(h(),e.preventDefault())})})})},"SelectTrigger")),dQ=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,className:r,style:a,children:o,placeholder:i="",...l}=e,s=dV("SelectValue",n),{onValueNodeHasChildrenChange:u}=s,c=void 0!==o,d=aG(t,s.onValueNodeChange);oh(()=>{u(c)},[u,c]);let f=fj(s.value);return(0,g.jsx)(oT.span,{...l,asChild:!f&&l.asChild,ref:d,style:{pointerEvents:"none"},children:(0,g.jsx)(y.Fragment,{children:f?i:o},f?"placeholder":"value")})},"SelectValue")),dY=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,children:r,...a}=e;return(0,g.jsx)(oT.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})},"SelectIcon")),[dX,d0]=dU("SelectPortal",{forceMount:void 0}),d1=dR(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,g.jsx)(dX,{scope:e.__scopeSelect,forceMount:n,children:(0,g.jsx)(ie,{asChild:!0,...r})})},"SelectPortal"),d2="SelectContent",d4=y.forwardRef(dR(function(e,t){let n=d0(d2,e.__scopeSelect),{forceMount:r=n.forceMount,...a}=e,o=dV(d2,e.__scopeSelect),[i,l]=y.useState();return oh(()=>{l(new DocumentFragment)},[]),(0,g.jsx)(io,{present:r||o.open,children:({present:e})=>e?(0,g.jsx)(d9,{...a,ref:t}):(0,g.jsx)(d3,{...a,fragment:i})})},"SelectContent")),d3=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,children:r,fragment:a}=e;return a?o_.createPortal((0,g.jsx)(d5,{scope:n,children:(0,g.jsx)(dD.Slot,{scope:n,children:(0,g.jsx)("div",{ref:t,children:r})})}),a):null},"SelectContentFragment")),[d5,d6]=dU(d2),d8=aX("SelectContent.RemoveScroll"),d9=y.forwardRef(dR(function(e,t){let{__scopeSelect:n}=e,{position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:i,side:l,sideOffset:s,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:v,...b}=e,x=dV(d2,n),[w,k]=y.useState(null),[j,S]=y.useState(null),O=aG(t,k),[C,N]=y.useState(null),[P,E]=y.useState(null),_=dF(n),[z,T]=y.useState(!1),A=y.useRef(!1);y.useEffect(()=>{if(w)return i7(w)},[w]),ig();let R=y.useCallback(e=>{let[t,...n]=_().map(e=>e.ref.current),[r]=n.slice(-1),a=document.activeElement;for(let n of e)if(n===a||(n?.scrollIntoView({block:"nearest"}),n===t&&j&&(j.scrollTop=0),n===r&&j&&(j.scrollTop=j.scrollHeight),n?.focus(),document.activeElement!==a))return},[_,j]),L=y.useCallback(()=>R([C,w]),[R,C,w]);y.useEffect(()=>{z&&L()},[z,L]);let{onOpenChange:I,triggerPointerDownPosRef:M}=x;y.useEffect(()=>{if(w){let e={x:0,y:0},t=dR(t=>{e={x:Math.abs(Math.round(t.pageX)-(M.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(M.current?.y??0))}},"handlePointerMove"),n=dR(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(w)||I(!1),document.removeEventListener("pointermove",t),M.current=null},"handlePointerUp");return null!==M.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[w,I,M]),y.useEffect(()=>{let e=dR(()=>I(!1),"close");return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[I]);let[D,F]=fS(e=>{let t=_().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=fO(t,e,n);r&&setTimeout(()=>r.ref.current?.focus())}),$=y.useCallback((e,t,n)=>{let r=!A.current&&!n;(void 0!==x.value&&x.value===t||r)&&(N(e),r&&(A.current=!0))},[x.value]),U=y.useCallback(()=>w?.focus(),[w]),H=y.useCallback((e,t,n)=>{let r=!A.current&&!n;(void 0!==x.value&&x.value===t||r)&&E(e)},[x.value]),B="popper"===r?fe:d7;return(0,g.jsx)(d5,{scope:n,content:w,viewport:j,onViewportChange:S,itemRefCallback:$,selectedItem:C,onItemLeave:U,itemTextRefCallback:H,focusSelectedItem:L,selectedItemText:P,position:r,isPositioned:z,searchRef:D,children:(0,g.jsx)(i2,{as:d8,allowPinchZoom:!0,children:(0,g.jsx)(oQ,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ol(a,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,g.jsx)(oF,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:(0,g.jsx)(B,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...B===fe?{side:l,sideOffset:s,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:v}:{},onPlaced:()=>T(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:ol(b.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||F(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=_().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>R(t)),e.preventDefault()}})})})})})})},"SelectContentImpl")),d7=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,onPlaced:r,...a}=e,o=dV(d2,n),i=d6(d2,n),[l,s]=y.useState(null),[u,c]=y.useState(null),d=aG(t,c),f=dF(n),p=y.useRef(!1),h=y.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:b,focusSelectedItem:x}=i,w=y.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&u&&m&&v&&b){let e=o.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),a=b.getBoundingClientRect();if("rtl"!==o.dir){let r=a.left-t.left,o=n.left-r,i=e.left-o,s=e.width+i,u=Math.max(s,t.width),c=u2(o,[10,Math.max(10,window.innerWidth-10-u)]);l.style.minWidth=s+"px",l.style.left=c+"px"}else{let r=t.right-a.right,o=window.innerWidth-n.right-r,i=window.innerWidth-e.right-o,s=e.width+i,u=Math.max(s,t.width),c=u2(o,[10,Math.max(10,window.innerWidth-10-u)]);l.style.minWidth=s+"px",l.style.right=c+"px"}let i=f(),s=window.innerHeight-20,c=m.scrollHeight,d=window.getComputedStyle(u),h=parseInt(d.borderTopWidth,10),g=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),x=h+g+c+parseInt(d.paddingBottom,10)+y,w=Math.min(5*v.offsetHeight,x),k=window.getComputedStyle(m),j=parseInt(k.paddingTop,10),S=parseInt(k.paddingBottom,10),O=e.top+e.height/2-10,C=v.offsetHeight/2,N=h+g+(v.offsetTop+C);if(N<=O){let e=i.length>0&&v===i[i.length-1].ref.current;l.style.bottom="0px";let t=Math.max(s-O,C+(e?S:0)+(u.clientHeight-m.offsetTop-m.offsetHeight)+y);l.style.height=N+t+"px"}else{let e=i.length>0&&v===i[0].ref.current;l.style.top="0px";let t=Math.max(O,h+m.offsetTop+(e?j:0)+C);l.style.height=t+(x-N)+"px",m.scrollTop=N-O+m.offsetTop}l.style.margin="10px 0",l.style.minHeight=w+"px",l.style.maxHeight=s+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,o.trigger,o.valueNode,l,u,m,v,b,o.dir,r]);oh(()=>w(),[w]);let[k,j]=y.useState();oh(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);let S=y.useCallback(e=>{e&&!0===h.current&&(w(),x?.(),h.current=!1)},[w,x]);return(0,g.jsx)(ft,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:S,children:(0,g.jsx)("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:(0,g.jsx)(oT.div,{...a,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})},"SelectItemAlignedPosition")),fe=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,align:r="start",collisionPadding:a=10,...o}=e,i=dB(n);return(0,g.jsx)(dN,{...i,...o,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[ft,fn]=dU(d2,{}),fr="SelectViewport",fa=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,nonce:r,...a}=e,o=d6(fr,n),i=fn(fr,n),l=aG(t,o.onViewportChange),s=y.useRef(0);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),(0,g.jsx)(dD.Slot,{scope:n,children:(0,g.jsx)(oT.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:ol(a.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=i;if(r?.current&&n){let e=Math.abs(s.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,a=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(a<r){let o=a+e,i=Math.min(r,o),l=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=l>0?l:0,n.style.justifyContent="flex-end")}}}s.current=t.scrollTop})})})]})},"SelectViewport")),[fo,fi]=dU("SelectGroup"),fl=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,...r}=e,a=fi("SelectLabel",n);return(0,g.jsx)(oT.div,{id:a.id,...r,ref:t})},"SelectLabel")),fs="SelectItem",[fu,fc]=dU(fs),fd=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...i}=e,l=dV(fs,n),s=d6(fs,n),u=l.value===r,[c,d]=y.useState(o??""),[f,p]=y.useState(!1),h=aG(t,oR(e=>s.itemRefCallback?.(e,r,a))),m=ov(),v=y.useRef("touch"),b=dR(()=>{a||(l.onValueChange(r),l.onOpenChange(!1))},"handleSelect");return(0,g.jsx)(fu,{scope:n,value:r,disabled:a,textId:m,isSelected:u,onItemTextChange:y.useCallback(e=>{d(t=>t||(e?.textContent??"").trim())},[]),children:(0,g.jsx)(dD.ItemSlot,{scope:n,value:r,disabled:a,textValue:c,children:(0,g.jsx)(oT.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...i,ref:h,onFocus:ol(i.onFocus,()=>p(!0)),onBlur:ol(i.onBlur,()=>p(!1)),onClick:ol(i.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:ol(i.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:ol(i.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:ol(i.onPointerMove,e=>{v.current=e.pointerType,a?s.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ol(i.onPointerLeave,e=>{e.currentTarget===document.activeElement&&s.onItemLeave?.()}),onKeyDown:ol(i.onKeyDown,e=>{a||e.target!==e.currentTarget||(s.searchRef?.current===""||" "!==e.key)&&(dI.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})},"SelectItem")),ff="SelectItemText",fp=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,className:r,style:a,...o}=e,i=dV(ff,n),l=d6(ff,n),s=fc(ff,n),u=dq(ff,n),[c,d]=y.useState(null),f=oR(e=>l.itemTextRefCallback?.(e,s.value,s.disabled)),p=aG(t,d,s.onItemTextChange,f),h=c?.textContent,m=y.useMemo(()=>(0,g.jsx)("option",{value:s.value,disabled:s.disabled,children:h},s.value),[s.disabled,s.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=u;return oh(()=>(v(m),()=>b(m)),[v,b,m]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(oT.span,{id:s.textId,...o,ref:p}),s.isSelected&&i.valueNode&&!i.valueNodeHasChildren&&!fj(i.value)?o_.createPortal(o.children,i.valueNode):null]})},"SelectItemText")),fh=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,...r}=e;return fc("SelectItemIndicator",n).isSelected?(0,g.jsx)(oT.span,{"aria-hidden":!0,...r,ref:t}):null},"SelectItemIndicator")),fm="SelectScrollUpButton",fg=y.forwardRef(dR(function(e,t){let n=d6(fm,e.__scopeSelect),r=fn(fm,e.__scopeSelect),[a,o]=y.useState(!1),i=aG(t,r.onScrollButtonChange);return oh(()=>{if(n.viewport&&n.isPositioned){let e=function(){o(t.scrollTop>0)};dR(e,"handleScroll");let t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),a?(0,g.jsx)(fb,{...e,ref:i,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null},"SelectScrollUpButton")),fy="SelectScrollDownButton",fv=y.forwardRef(dR(function(e,t){let n=d6(fy,e.__scopeSelect),r=fn(fy,e.__scopeSelect),[a,o]=y.useState(!1),i=aG(t,r.onScrollButtonChange);return oh(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;o(Math.ceil(t.scrollTop)<e)};dR(e,"handleScroll");let t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),a?(0,g.jsx)(fb,{...e,ref:i,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null},"SelectScrollDownButton")),fb=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...a}=e,o=d6("SelectScrollButton",n),i=y.useRef(null),l=dF(n),s=y.useCallback(()=>{null!==i.current&&(window.clearInterval(i.current),i.current=null)},[]);return y.useEffect(()=>()=>s(),[s]),oh(()=>{let e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),(0,g.jsx)(oT.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:ol(a.onPointerDown,()=>{null===i.current&&(i.current=window.setInterval(r,50))}),onPointerMove:ol(a.onPointerMove,()=>{o.onItemLeave?.(),null===i.current&&(i.current=window.setInterval(r,50))}),onPointerLeave:ol(a.onPointerLeave,()=>{s()})})},"SelectScrollButtonImpl")),fx=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,...r}=e;return(0,g.jsx)(oT.div,{"aria-hidden":!0,...r,ref:t})},"SelectSeparator")),fw=y.forwardRef(dR(function({__scopeSelect:e,...t},n){let r=dV("SelectBubbleInput",e),{value:a,onValueChange:o,required:i,disabled:l,name:s,autoComplete:u,form:c}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=y.useRef(null),h=aG(n,p),m=a??"",v=dz(m),b=Array.from(d).some(e=>(e.props.value??"")==="");return y.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(v!==m&&t){let n=new Event("change",{bubbles:!0});t.call(e,m),e.dispatchEvent(n)}},[v,m]),(0,g.jsxs)(oT.select,{"aria-hidden":!0,required:i,tabIndex:-1,name:s,autoComplete:u,disabled:l,form:c,onChange:e=>o(e.target.value),...t,style:{...dT,...t.style},ref:h,defaultValue:m,children:[fj(a)&&!b?(0,g.jsx)("option",{value:""}):null,Array.from(d)]},f)},"SelectBubbleInput"));function fk(e){return"function"==typeof e}function fj(e){return""===e||void 0===e}function fS(e){let t=oR(e),n=y.useRef(""),r=y.useRef(0),a=y.useCallback(e=>{t(n.current+e)},[t]),o=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,o]}function fO(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=n?e.indexOf(n):-1,o=fC(e,Math.max(a,0));1===r.length&&(o=o.filter(e=>e!==n));let i=o.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return i!==n?i:void 0}function fC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}dR(fk,"isFunction"),dR(fj,"shouldShowPlaceholder"),dR(fS,"useTypeaheadSearch"),dR(fO,"findNextItem"),dR(fC,"wrapArray");let fN=O("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);function fP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fE(e){if(Array.isArray(e))return e}function f_(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fz(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function fT(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function fA(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}function fR(e,t){return fE(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||fI(e,t)||f_()}function fL(e){return fE(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||fI(e)||f_()}function fI(e,t){if(e){if("string"==typeof e)return fP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fP(e,t)}}var fM=y.forwardRef(function(e,t){var n=fL([e,t]),r=n[0],a=n.slice(1),o=r.className,i=r.children,l=fA(r,["className","children"]),s=fR(a,1)[0];return(0,g.jsxs)(dG,fT(fz({ref:s,"data-slot":"select-trigger",className:aT("flex h-10 w-full cursor-pointer items-center justify-between gap-2 rounded-[10px] border border-input bg-card px-3 py-2 text-sm text-foreground shadow-[0_1px_2px_rgb(20_24_40/0.04)] outline-none transition-[border-color,box-shadow,background-color] hover:border-ring/35 focus-visible:border-ring/50 focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:pointer-events-none disabled:opacity-50 data-[placeholder]:text-muted-foreground [&>span]:truncate",o)},l),{children:[i,(0,g.jsx)(dY,{asChild:!0,children:(0,g.jsx)(T,{className:"size-4 shrink-0 text-muted-foreground"})})]}))});fM.displayName=dG.displayName;var fD=y.forwardRef(function(e,t){var n=fL([e,t]),r=n[0],a=n.slice(1),o=r.className,i=fA(r,["className"]),l=fR(a,1)[0];return(0,g.jsx)(fg,fT(fz({ref:l,className:aT("flex cursor-default items-center justify-center py-1",o)},i),{children:(0,g.jsx)(fN,{className:"size-4"})}))});fD.displayName=fg.displayName;var fF=y.forwardRef(function(e,t){var n=fL([e,t]),r=n[0],a=n.slice(1),o=r.className,i=fA(r,["className"]),l=fR(a,1)[0];return(0,g.jsx)(fv,fT(fz({ref:l,className:aT("flex cursor-default items-center justify-center py-1",o)},i),{children:(0,g.jsx)(T,{className:"size-4"})}))});fF.displayName=fv.displayName;var f$=y.forwardRef(function(e,t){var n=fL([e,t]),r=n[0],a=n.slice(1),o=r.className,i=r.children,l=r.position,s=void 0===l?"popper":l,u=r.sideOffset,c=fA(r,["className","children","position","sideOffset"]),d=fR(a,1)[0];return(0,g.jsx)(d1,{children:(0,g.jsxs)(d4,fT(fz({ref:d,"data-slot":"select-content",position:s,sideOffset:void 0===u?6:u,className:aT("relative z-50 max-h-[min(20rem,var(--radix-select-content-available-height))] min-w-[8rem] overflow-hidden rounded-xl border border-border/80 bg-popover text-popover-foreground shadow-[0_18px_50px_rgb(22_27_45/0.14)] data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","popper"===s&&"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o)},c),{children:[(0,g.jsx)(fD,{}),(0,g.jsx)(fa,{className:aT("p-1.5","popper"===s&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:i}),(0,g.jsx)(fF,{})]}))})});f$.displayName=d4.displayName,y.forwardRef(function(e,t){var n=fL([e,t]),r=n[0],a=n.slice(1),o=r.className,i=fA(r,["className"]),l=fR(a,1)[0];return(0,g.jsx)(fl,fz({ref:l,className:aT("px-2 py-1.5 text-xs font-semibold text-muted-foreground",o)},i))}).displayName=fl.displayName;var fU=y.forwardRef(function(e,t){var n=fL([e,t]),r=n[0],a=n.slice(1),o=r.className,i=r.children,l=fA(r,["className","children"]),s=fR(a,1)[0];return(0,g.jsxs)(fd,fT(fz({ref:s,"data-slot":"select-item",className:aT("relative flex w-full cursor-pointer select-none items-center rounded-lg py-2 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o)},l),{children:[(0,g.jsx)(fp,{children:i}),(0,g.jsx)("span",{className:"absolute right-2 flex size-4 items-center justify-center text-primary",children:(0,g.jsx)(fh,{children:(0,g.jsx)(uG,{className:"size-4",strokeWidth:2.5})})})]}))});function fH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fB(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function fK(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){fK(e,t,n[t])})}return e}function fW(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return fH(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fH(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fq(e){var t=e.open,n=e.onOpenChange,r=(0,x.Bd)().t,a=so(function(e){return e.scan}),o=so(function(e){return e.scanLoading}),i=so(function(e){return e.scanError}),l=so(function(e){return e.loadScan}),s=so(function(e){return e.importScan}),u=so(function(e){return e.providers}),c=so(function(e){return e.loadProviders}),d=fW((0,y.useState)({}),2),f=d[0],p=d[1],h=fW((0,y.useState)(!1),2),m=h[0],v=h[1],b=fW((0,y.useState)(null),2),w=b[0],k=b[1],j=fW((0,y.useState)(null),2),S=j[0],O=j[1];(0,y.useEffect)(function(){t&&(O(null),k(null),l(),c())},[t,l,c]),(0,y.useEffect)(function(){a&&p(function(e){var t={},n=!0,r=!1,o=void 0;try{for(var i,l=a[Symbol.iterator]();!(n=(i=l.next()).done);n=!0){var s=i.value,u=!0,c=!1,d=void 0;try{for(var f,p=s.candidates[Symbol.iterator]();!(u=(f=p.next()).done);u=!0){var h,m,g=f.value;t[g.id]=null!=(h=e[g.id])?h:{selected:!1,name:g.suggestedName,target:g.matchesProvider?"vault":"profile",providerId:null!=(m=g.matchesProvider)?m:"",apiKey:"",overwrite:!1}}}catch(e){c=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(c)throw d}}}}catch(e){r=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw o}}return t})},[a]);var C=(null!=a?a:[]).flatMap(function(e){return e.candidates}).filter(function(e){var t;return null==(t=f[e.id])?void 0:t.selected}),N=C.filter(function(e){var t=f[e.id],n=!e.apiKeyPresent&&!t.apiKey.trim(),r="vault"===t.target&&""!==t.providerId;return!t.name.trim()||n&&!r});return(0,g.jsx)(ll,{open:t,onOpenChange:n,children:(0,g.jsxs)(l_,{className:"flex max-h-[85vh] w-[min(56rem,calc(100vw-2rem))] max-w-3xl flex-col overflow-hidden",children:[(0,g.jsxs)(lz,{children:[(0,g.jsx)(lA,{children:r("import.title")}),(0,g.jsx)(lR,{children:r("import.intro")})]}),(0,g.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto pr-1",children:[o?(0,g.jsxs)("p",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted-foreground",children:[(0,g.jsx)(uT,{className:"size-4 animate-spin"}),r("import.scanning")]}):null,i?(0,g.jsx)("p",{className:"py-6 text-sm text-destructive",children:l6(r,i)}):null,S?(0,g.jsxs)("div",{className:"rounded-xl border border-emerald-500/40 bg-emerald-500/5 px-4 py-3 text-sm",children:[(0,g.jsxs)("p",{className:"flex items-center gap-2 font-medium",children:[(0,g.jsx)(uA,{className:"size-4 text-emerald-600"}),r("import.summary",{imported:S.imported,skipped:S.skipped,providersCreated:S.providersCreated})]}),S.warnings.map(function(e){return(0,g.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:l6(r,e)},e.key+e.scope)})]}):null,(null!=a?a:[]).map(function(e){var t,n,a;return(0,g.jsxs)("section",{className:"rounded-2xl border bg-card px-4 py-3",children:[(0,g.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,g.jsx)("h3",{className:"text-sm font-semibold",children:e.label}),e.candidates.length>0?(0,g.jsx)(aR,{variant:"secondary",children:r("import.providerCount",{count:e.candidates.length})}):null]}),(0,g.jsx)("ul",{className:"mt-2 space-y-0.5",children:e.sources.map(function(e){return(0,g.jsxs)("li",{className:"truncate font-mono text-[11px] text-muted-foreground",children:[e.path," \xb7"," ",e.exists?e.parsable?r("import.sourceRead"):r("import.sourceUnparsable"):r("import.sourceMissing")]},e.key)})}),0===e.candidates.length?(0,g.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:(t=r,(n=e).note||n.noteCode?l6(t,{key:null!=(a=n.noteCode)?a:"scan.note.unknown",fallback:n.note}):"")}):(0,g.jsx)("ul",{className:"mt-3 space-y-3",children:e.candidates.map(function(e){return(0,g.jsx)(fZ,{candidate:e,choice:f[e.id],providers:null!=u?u:[],onChange:function(t){var n;return n=e.id,void p(function(e){var r,a;return r=fV({},e),a=null!=(a=fK({},n,fV({},e[n],t)))?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(a)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(a,e))}),r})}},e.id)})})]},e.harness)})]}),w?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(r,w)}):null,(0,g.jsxs)(lT,{className:"items-center",children:[(0,g.jsx)("span",{className:"mr-auto text-xs text-muted-foreground",children:C.length>0?r("import.selected",{count:C.length}):r("import.selectPrompt")}),(0,g.jsxs)(or,{variant:"outline",onClick:function(){l()},disabled:o,children:[(0,g.jsx)(P,{}),r("import.rescan")]}),(0,g.jsxs)(or,{disabled:0===C.length||N.length>0||m,onClick:function(){var e;(e=function(){var e;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:v(!0),k(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,s(C.map(function(e){var t=f[e.id];return fV({id:e.id,name:t.name.trim(),target:t.target},"vault"===t.target&&t.providerId?{providerId:t.providerId}:{},t.apiKey.trim()?{apiKey:t.apiKey.trim()}:{},t.overwrite?{overwrite:!0}:{})}))];case 2:return O({imported:(e=t.sent()).imported,skipped:e.skipped,providersCreated:e.providersCreated,warnings:e.warnings.map(l2)}),p({}),[3,5];case 3:return k(l3(t.sent(),"import.failed")),[3,5];case 4:return v(!1),[7];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){fB(o,r,a,i,l,"next",e)}function l(e){fB(o,r,a,i,l,"throw",e)}i(void 0)})})()},children:[m?(0,g.jsx)(uT,{className:"animate-spin"}):null,r("import.importSelected")]})]})]})})}function fZ(e){var t=e.candidate,n=e.choice,r=e.providers,a=e.onChange,o=(0,x.Bd)().t;if(!n)return null;var i="vault"===n.target&&""!==n.providerId,l=!t.apiKeyPresent&&!i;return(0,g.jsx)("li",{className:"rounded-xl border bg-background px-3 py-3",children:(0,g.jsxs)("div",{className:"flex items-start gap-3",children:[(0,g.jsx)(uQ,{className:"mt-1",checked:n.selected,onCheckedChange:function(e){return a({selected:!0===e})},"aria-label":o("import.select",{name:t.sourceKey})}),(0,g.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,g.jsx)("span",{className:"truncate font-mono text-sm",children:t.sourceKey}),t.active?(0,g.jsx)(aR,{children:o("import.inUse")}):null,t.conflictsWith?(0,g.jsx)(aR,{variant:"secondary",children:o("import.nameTaken")}):null,t.matchesProvider?(0,g.jsx)(aR,{variant:"secondary",children:o("import.matchesProvider",{name:t.matchesProvider})}):null]}),(0,g.jsxs)("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[t.baseUrl||o("import.noBaseUrl"),t.model?" \xb7 ".concat(t.model):"",t.apiKeyPresent?" \xb7 ".concat(t.apiKeyPreview):" \xb7 ".concat(o("import.keyOutsideConfig"))]}),n.selected?(0,g.jsxs)("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)(u1,{htmlFor:"name-".concat(t.id),children:o("import.profileName")}),(0,g.jsx)(uY,{id:"name-".concat(t.id),value:n.name,onChange:function(e){return a({name:e.target.value})}})]}),(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)(u1,{htmlFor:"target-".concat(t.id),children:o("import.credentialTarget")}),(0,g.jsxs)(dJ,{value:"vault"===n.target?n.providerId||"new-vault":"profile",onValueChange:function(e){return a("profile"===e?{target:"profile",providerId:""}:"new-vault"===e?{target:"vault",providerId:""}:{target:"vault",providerId:e})},children:[(0,g.jsx)(fM,{id:"target-".concat(t.id),children:(0,g.jsx)(dQ,{})}),(0,g.jsxs)(f$,{children:[(0,g.jsx)(fU,{value:"profile",children:o("import.targetProfile")}),(0,g.jsx)(fU,{value:"new-vault",children:o("import.targetNewVault")}),r.map(function(e){return(0,g.jsx)(fU,{value:e.id,children:o("import.targetExisting",{name:e.name})},e.id)})]})]})]}),l?(0,g.jsxs)("div",{className:"space-y-1.5 sm:col-span-2",children:[(0,g.jsx)(u1,{htmlFor:"key-".concat(t.id),children:"API key"}),(0,g.jsx)(uY,{id:"key-".concat(t.id),type:"password",value:n.apiKey,placeholder:o("import.apiKeyFromEnv"),onChange:function(e){return a({apiKey:e.target.value})}})]}):null,t.conflictsWith?(0,g.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground sm:col-span-2",children:[(0,g.jsx)(uQ,{checked:n.overwrite,onCheckedChange:function(e){return a({overwrite:!0===e})}}),o("import.overwriteExisting")]}):null]}):null]})]})})}fU.displayName=fd.displayName,y.forwardRef(function(e,t){var n=fL([e,t]),r=n[0],a=n.slice(1),o=r.className,i=fA(r,["className"]),l=fR(a,1)[0];return(0,g.jsx)(fx,fz({ref:l,className:aT("-mx-1 my-1 h-px bg-border",o)},i))}).displayName=fx.displayName;let fJ=O("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);function fG(){var e=(0,x.Bd)().t,t=(0,x.s9)(),n=t.language,r=t.setLanguage,a="en"===n,o=e(a?"language.toChinese":"language.toEnglish");return(0,g.jsxs)(or,{type:"button",size:"sm",variant:"outline","aria-label":o,title:o,onClick:function(){return r(a?"zh-CN":"en")},children:[(0,g.jsx)(fJ,{}),(0,g.jsx)("span",{className:"hidden sm:inline",children:e("language.short")})]})}function fQ(){var e=(0,x.Bd)().t,t=so(function(e){return e.notice}),n=so(function(e){return e.clearNotice});return((0,y.useEffect)(function(){if(t){var e=window.setTimeout(function(){return n()},8e3);return function(){return window.clearTimeout(e)}}},[t,n]),t)?(0,g.jsxs)("div",{role:"status",className:"fixed bottom-4 right-4 z-50 w-[min(28rem,calc(100vw-2rem))] rounded-2xl border bg-card p-4 shadow-[0_18px_50px_-24px_rgb(36_39_70/0.45)]",children:[(0,g.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,g.jsx)("p",{className:"text-sm font-medium",children:e("notice.title")}),(0,g.jsx)(or,{size:"sm",variant:"ghost",onClick:n,children:e("notice.close")})]}),t.map(function(t){var n;return(0,g.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:l6(e,t)},"".concat(t.key,"-").concat(null!=(n=t.scope)?n:""))})]}):null}let fY=O("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);function fX(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f0(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function f1(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return fX(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fX(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f2(e){var t,n,r=e.harnessId,a=e.open,o=e.onOpenChange,i=(0,x.s9)().locale,l=(0,x.Bd)().t,s=so(function(e){return e.operations}),u=so(function(e){return e.operationsLoading}),c=so(function(e){return e.operationsError}),d=so(function(e){return e.loadOperations}),f=so(function(e){return e.undoOperation}),p=f1((0,y.useState)(null),2),h=p[0],m=p[1],v=f1((0,y.useState)(!1),2),b=v[0],w=v[1],k=f1((0,y.useState)(null),2),j=k[0],S=k[1],O=null!=(t=null==s?void 0:s.filter(function(e){return e.harness===r}))?t:[],C=M[r];return(0,y.useEffect)(function(){a&&(S(null),d(r))},[a,r,d]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(ll,{open:a,onOpenChange:o,children:(0,g.jsxs)(l_,{className:"flex max-h-[85vh] w-[min(52rem,calc(100vw-2rem))] max-w-2xl flex-col gap-0 overflow-hidden p-0",children:[(0,g.jsxs)(lz,{className:"shrink-0 space-y-1.5 px-6 pb-4 pt-6 pr-12",children:[(0,g.jsx)(lA,{children:l("operations.titleFor",{harness:C})}),(0,g.jsx)(lR,{children:l("operations.intro")})]}),(0,g.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-6",children:[u&&0===O.length?(0,g.jsxs)("p",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted-foreground",children:[(0,g.jsx)(uT,{className:"size-4 animate-spin"}),l("operations.loading")]}):null,c?(0,g.jsx)("p",{className:"py-6 text-sm text-destructive",children:l6(l,c)}):null,u||0!==O.length?null:(0,g.jsx)("p",{className:"py-10 text-center text-sm text-muted-foreground",children:l("operations.empty")}),O.length>0?(0,g.jsx)("ul",{className:"divide-y rounded-xl border",children:O.map(function(e){var t,n,r,a,o;return(0,g.jsxs)("li",{className:"flex items-center gap-3 px-3 py-2.5",children:[(0,g.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,g.jsxs)("span",{className:"truncate text-sm font-medium",children:[l("operations.kind.".concat(e.kind))," \xb7 ",e.profile]}),(0,g.jsx)(aR,{variant:"degraded"===(n=e.state)?"destructive":"committed"===n?"default":"secondary",children:l("operations.state.".concat(e.state))})]}),(0,g.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[(r=null!=(t=e.finishedAt)?t:e.startedAt,a=i,Number.isNaN((o=new Date(r)).getTime())?r:o.toLocaleString(a))," \xb7"," ",l("operations.user",{user:e.user})," \xb7"," ",l("operations.fileCount",{count:e.files.length})]}),e.note?(0,g.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:e.note}):null]}),(0,g.jsxs)(or,{size:"sm",variant:"outline",className:"shrink-0",disabled:!e.undoable,onClick:function(){return m(e)},children:[(0,g.jsx)(fY,{}),l("operations.undo")]})]},e.id)})}):null]}),(0,g.jsx)(lT,{className:"shrink-0 px-6 py-4",children:(0,g.jsx)(or,{onClick:function(){return o(!1)},children:l("operations.close")})})]})}),(0,g.jsx)(ll,{open:null!==h,onOpenChange:function(e){return!e&&m(null)},children:(0,g.jsxs)(l_,{className:"max-w-lg",children:[(0,g.jsxs)(lz,{children:[(0,g.jsx)(lA,{children:l("operations.undoTitle")}),(0,g.jsx)(lR,{children:h?l("operations.undoBody",{harness:null!=(n=M[h.harness])?n:h.harness,count:h.files.length}):""})]}),j?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(l,j)}):null,(0,g.jsxs)(lT,{children:[(0,g.jsx)(or,{variant:"outline",onClick:function(){return m(null)},children:l("common.cancel")}),(0,g.jsxs)(or,{disabled:b,onClick:function(){var e;(e=function(){return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:if(!h)return[2];w(!0),S(null),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,f(h.id)];case 2:return e.sent(),m(null),[3,5];case 3:return S(l3(e.sent(),"operations.undoFailed")),[3,5];case 4:return w(!1),[7];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){f0(o,r,a,i,l,"next",e)}function l(e){f0(o,r,a,i,l,"throw",e)}i(void 0)})})()},children:[b?(0,g.jsx)(uT,{className:"animate-spin"}):null,l("operations.confirmUndo")]})]})]})})]})}function f4(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f3(e){var t,n,r=e.harness,a=(0,x.Bd)().t,o=so(function(e){return e.operations}),i=so(function(e){return e.operationsLoading}),l=so(function(e){return e.operationsError}),s=so(function(e){return e.loadOperations}),u=function(e){if(Array.isArray(e))return e}(t=(0,y.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(a.push(t.value),2!==a.length);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw n}}return a}}(t)||function(e){if(e){if("string"==typeof e)return f4(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return f4(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=u[0],d=u[1],f=null!=(n=null==o?void 0:o.filter(function(e){return e.harness===r.id}))?n:[];return(0,y.useEffect)(function(){s(r.id)},[r.id,s]),(0,g.jsxs)("section",{className:"rounded-2xl border bg-card p-5 shadow-[0_12px_34px_-28px_rgb(36_39_70/0.38)]",children:[(0,g.jsxs)("div",{className:"flex items-center gap-2",children:[(0,g.jsx)(rN,{className:"size-4 text-primary"}),(0,g.jsx)("h3",{className:"font-semibold",children:a("operations.title")}),(0,g.jsx)("span",{className:"ml-auto",children:(0,g.jsx)(or,{size:"icon",variant:"ghost","aria-label":a("operations.refresh"),onClick:function(){s(r.id)},children:(0,g.jsx)(sc,{className:i?"animate-spin":void 0})})})]}),(0,g.jsx)("div",{className:"mt-4",children:l?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(a,l)}):null===o||i?(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:a("operations.loading")}):0===f.length?(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:a("operations.empty")}):(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:a("operations.count",{count:f.length})})}),(0,g.jsx)(or,{className:"mt-4 w-full",size:"sm",variant:"outline",disabled:null===o,onClick:function(){return d(!0)},children:a("operations.viewDetails")}),(0,g.jsx)(f2,{harnessId:r.id,open:c,onOpenChange:d})]})}let f5=O("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),f6=O("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),f8=O("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);function f9(e){var t=e.result,n=(0,x.Bd)().t;if(t.ok){var r,a,o,i,l=null!=(a=null==(i=t.models)?void 0:i.length)?a:0;return(0,g.jsxs)("span",{className:"flex items-center gap-1.5 text-sm text-emerald-600 dark:text-emerald-400",children:[(0,g.jsx)(uA,{className:"size-4 shrink-0","aria-hidden":!0}),n(l>0?"probe.ok":"probe.okNoCatalog",{latencyMs:null!=(o=t.latencyMs)?o:"?",count:l})]})}return(0,g.jsxs)("span",{className:"flex items-center gap-1.5 text-sm text-destructive",children:[(0,g.jsx)(f8,{className:"size-4 shrink-0","aria-hidden":!0}),l6(n,l2({code:t.code,params:t.params,message:null!=(r=t.message)?r:""}))]})}function f7(e){var t=e.className,n=function(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,["className"]);return(0,g.jsx)("textarea",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"textarea",className:aT("flex min-h-[60px] w-full rounded-[10px] border border-input bg-card px-3 py-2 text-base shadow-[0_1px_2px_rgb(20_24_40/0.04)] transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:border-ring/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t)},n))}function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function pn(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function pr(e){return function(e){if(Array.isArray(e))return pe(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return pe(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return pe(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var pa=[{id:"openrouter",baseUrl:"https://openrouter.ai/api/v1"},{id:"zai",baseUrl:"https://api.z.ai/api/paas/v4",model:"glm-4.6"},{id:"moonshot",baseUrl:"https://api.moonshot.cn/v1"},{id:"deepseek",baseUrl:"https://api.deepseek.com/v1"}],po={id:"cliproxyResponses",baseUrl:"https://api.seavey.ai/cliproxy/v1",model:"gpt-5.6-sol"},pi={claude:[{id:"zaiAnthropic",baseUrl:"https://api.z.ai/api/anthropic",model:"glm-4.6"},{id:"moonshotAnthropic",baseUrl:"https://api.moonshot.cn/anthropic"},{id:"deepseekAnthropic",baseUrl:"https://api.deepseek.com/anthropic"}],codex:pa,kimi:pa,pi:[pn(pt({},po),{extras:{api:"openai-responses",reasoning:"true"}})].concat(pr(pa)),dsh:[pn(pt({},po),{extras:{api:"openai-responses",reasoningEfforts:"low,medium,high,xhigh,max"}})].concat(pr(pa))};function pl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ps(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function pu(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){ps(o,r,a,i,l,"next",e)}function l(e){ps(o,r,a,i,l,"throw",e)}i(void 0)})}}function pc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){pc(e,t,n[t])})}return e}function pf(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function pp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||ph(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ph(e,t){if(e){if("string"==typeof e)return pl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pl(e,t)}}function pm(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var pg=[{role:"Sonnet",modelKey:"sonnetModel",nameKey:"sonnetModelName",oneMKey:"sonnetModel1m"},{role:"Opus",modelKey:"opusModel",nameKey:"opusModelName",oneMKey:"opusModel1m"},{role:"Fable",modelKey:"fableModel",nameKey:"fableModelName",oneMKey:"fableModel1m"},{role:"Haiku",modelKey:"haikuModel",nameKey:"haikuModelName",oneMKey:null}],py="subagentModel",pv="subagentModel1m",pb=new Set(((function(e){if(Array.isArray(e))return pl(e)})(c=pg.flatMap(function(e){var t=e.modelKey,n=e.nameKey,r=e.oneMKey;return r?[t,n,r]:[t,n]}))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(c)||ph(c)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([py,pv]));function px(e){var t,n,r,a,o,i,l,s,u,c=e.harness,d=e.profile,f=e.onOpenChange,p=(0,x.Bd)().t,h=so(function(e){return e.createProfile}),m=so(function(e){return e.updateProfile}),v=so(function(e){return e.previewProfile}),b=so(function(e){return e.providers}),w=so(function(e){return e.loadProviders}),k=so(function(e){return e.probeDraft}),j=so(function(e){return e.probeProfile}),S=null!==d,O=pp((0,y.useState)(null!=(t=null==d?void 0:d.name)?t:""),2),C=O[0],N=O[1],P=pp((0,y.useState)(null!=(n=null==d?void 0:d.baseUrl)?n:""),2),E=P[0],_=P[1],z=pp((0,y.useState)(""),2),A=z[0],R=z[1],L=pp((0,y.useState)(null!=(r=null==d?void 0:d.model)?r:""),2),I=L[0],M=L[1],D=pp((0,y.useState)(null!=(a=null==d?void 0:d.notes)?a:""),2),F=D[0],$=D[1],U=pp((0,y.useState)(function(){return function(e,t){var n={},r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var s,u,c=i.value;n[c.key]=null!=(s=null!=(u=null==t?void 0:t.extras[c.key])?u:c.defaultValue)?s:""}}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(c.fields,d)}),2),H=U[0],B=U[1],K=pp((0,y.useState)({}),2),V=K[0],W=K[1],q=pp((0,y.useState)(null!=(o=null==d?void 0:d.providerId)?o:""),2),Z=q[0],J=q[1],G=pp((0,y.useState)(null!=(i=null==d?void 0:d.providerEndpoint)?i:""),2),Q=G[0],Y=G[1],X=pp((0,y.useState)(!1),2),ee=X[0],et=X[1],en=pp((0,y.useState)(null),2),er=en[0],ea=en[1],eo=pp((0,y.useState)(null),2),ei=eo[0],el=eo[1],es=pp((0,y.useState)(!1),2),eu=es[0],ec=es[1],ed=pp((0,y.useState)({}),2),ef=ed[0],ep=ed[1],eh=pp((0,y.useState)(!1),2),em=eh[0],eg=eh[1],ey=pp((0,y.useState)(null),2),ev=ey[0],eb=ey[1],ex=null!=b?b:[],ew=null!=(l=ex.find(function(e){return e.id===Z}))?l:null,ek=null==ew?void 0:ew.endpoints.find(function(e){return e.key===Q}),ej=(null==ev?void 0:ev.ok)&&null!=(s=ev.models)?s:[];(0,y.useEffect)(function(){eb(null)},[E,A,Z,Q]);var eS=null!==b&&""!==Z&&null===ew,eO=null!==ew&&""!==Q&&void 0===ek,eC="claude"===c.id?c.fields.filter(function(e){return!pb.has(e.key)}):c.fields,eN="claude"===c.id?eC.filter(function(e){return"authVar"===e.key}):eC,eP="claude"===c.id?eC.filter(function(e){return"authVar"!==e.key}):[];function eE(){return pu(function(){var e;return pm(this,function(t){switch(t.label){case 0:if(!d)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,v(c.id,d.name)];case 2:return ea(e=t.sent()),W(Object.fromEntries(e.filter(function(e){return e.overridden}).map(function(e){return[e.key,e.content]}))),[3,4];case 3:return el(l4(t.sent())),[3,4];case 4:return[2]}})})()}function e_(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];ep(function(e){if(!t.some(function(t){return e[t]}))return e;var n=pd({},e),r=!0,a=!1,o=void 0;try{for(var i,l=t[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var s=i.value;delete n[s]}}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n})}function ez(){var e;return ew&&Q&&null!=(e=null==ek?void 0:ek.baseUrl)?e:E}return(0,y.useEffect)(function(){null===b&&w()},[b,w]),(0,g.jsx)(ll,{open:!0,onOpenChange:f,children:(0,g.jsx)(l_,{className:"max-h-[92vh] w-[calc(100vw-2rem)] overflow-hidden p-0 sm:max-w-[1120px]",children:(0,g.jsxs)("form",{onSubmit:function(e){return pu(function(){var t,n;return pm(this,function(r){switch(r.label){case 0:if(e.preventDefault(),!function(){var e={},t=C.trim();t?t.includes("/")||t.includes("\\")?e.name={key:"profile.error.nameSlash"}:t.length>120&&(e.name={key:"profile.error.nameTooLong",params:{max:120}}):e.name={key:"profile.error.nameRequired"},ez().trim()||(e.baseUrl={key:"profile.error.baseUrlRequired"}),S||null!==ew||A.trim()||(e.apiKey={key:"profile.error.apiKeyRequired"}),c.modelRequired&&!I.trim()&&(e.model={key:"profile.error.modelRequired"}),eS&&(e.providerId={key:"profile.error.providerGone"}),eO&&(e.providerEndpoint={key:"profile.error.endpointGone"});var n=!0,r=!1,a=void 0;try{for(var o,i=c.fields[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var l,s=o.value;!s.required||(null==(l=H[s.key])?void 0:l.trim())||(e["extra:".concat(s.key)]={key:"profile.error.fieldRequired",params:{label:s.label}})}}catch(e){r=!0,a=e}finally{try{n||null==i.return||i.return()}finally{if(r)throw a}}return ep(e),!(Object.keys(e).length>0)||(el({key:"profile.error.checkFields"}),!1)}())return[2];ec(!0),el(null),r.label=1;case 1:if(r.trys.push([1,6,7,8]),n=pd({name:C,baseUrl:ew&&Q&&null!=(t=null==ek?void 0:ek.baseUrl)?t:E,model:I,notes:F,extras:H},Z?pd({providerId:Z},Q?{providerEndpoint:Q}:{}):S?{providerId:""}:{},ew?{}:{apiKey:A||void 0}),!S)return[3,3];return[4,m(c.id,d.name,pf(pd({},n),{overrides:V}))];case 2:return r.sent(),[3,5];case 3:return[4,h(c.id,n)];case 4:r.sent(),r.label=5;case 5:return f(!1),[3,8];case 6:return el(l4(r.sent())),[3,8];case 7:return ec(!1),[7];case 8:return[2]}})})()},noValidate:!0,className:"flex max-h-[92vh] min-h-0 flex-col",children:[(0,g.jsxs)(lz,{className:"shrink-0 border-b bg-card px-6 py-5 pr-12",children:[(0,g.jsx)(lA,{children:S?p("profile.editTitle",{harness:c.label,profile:d.name}):p("profile.createTitle",{harness:c.label})}),(0,g.jsxs)(lR,{children:[p("profile.intro",{targets:c.targets.map(function(e){return e.label}).join(p("common.listSeparator"))}),"additive"===c.mode?p("profile.additiveNote"):""]})]}),(0,g.jsxs)("div",{"data-slot":"profile-dialog-scroll",className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 py-5",children:[(0,g.jsxs)("div",{"data-slot":"provider-reference-fields",className:"space-y-3 rounded-xl border p-3",children:[(0,g.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,g.jsx)(u1,{htmlFor:"provider-select",className:"font-medium",children:p("profile.useSharedProvider")}),ew?(0,g.jsx)(aR,{variant:"secondary",children:p("profile.keyFromVault")}):null]}),(0,g.jsxs)(dJ,{value:Z,onValueChange:function(e){J(e);var t,n,r=ex.find(function(t){return t.id===e});Y(null!=(t=null==r||null==(n=r.endpoints[0])?void 0:n.key)?t:""),e_("providerId","providerEndpoint","baseUrl","apiKey")},children:[(0,g.jsx)(fM,{id:"provider-select","aria-label":p("profile.useSharedProviderLabel"),"aria-invalid":!!ef.providerId||void 0,"aria-describedby":ef.providerId?"provider-select-error":void 0,children:(0,g.jsx)(dQ,{placeholder:p("profile.providerNone")})}),(0,g.jsxs)(f$,{children:[(0,g.jsx)(fU,{value:"",children:p("profile.providerNone")}),ex.map(function(e){return(0,g.jsx)(fU,{value:e.id,children:e.name},e.id)})]})]}),ef.providerId?(0,g.jsx)("p",{id:"provider-select-error",className:"text-xs text-destructive",children:l6(p,ef.providerId)}):null,0===ex.length?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:p("profile.vaultEmpty")}):null,ew?(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"provider-endpoint",children:p("profile.namedEndpoint")}),(0,g.jsxs)(dJ,{value:Q,onValueChange:function(e){Y(e),e_("providerEndpoint","baseUrl")},children:[(0,g.jsx)(fM,{id:"provider-endpoint","aria-label":p("profile.namedEndpointLabel"),"aria-invalid":!!ef.providerEndpoint||void 0,"aria-describedby":ef.providerEndpoint?"provider-endpoint-error":void 0,children:(0,g.jsx)(dQ,{placeholder:p("profile.endpointNone")})}),(0,g.jsxs)(f$,{children:[(0,g.jsx)(fU,{value:"",children:p("profile.endpointNone")}),ew.endpoints.map(function(e){return(0,g.jsx)(fU,{value:e.key,children:e.label?p("profile.endpointOption",{label:e.label,key:e.key}):e.key},e.key)})]})]}),ef.providerEndpoint?(0,g.jsx)("p",{id:"provider-endpoint-error",className:"text-xs text-destructive",children:l6(p,ef.providerEndpoint)}):null,0===ew.endpoints.length?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:p("profile.noEndpoints")}):null]}):null]}),(0,g.jsx)(pk,{harnessId:c.id,onPick:function(e){_(e.baseUrl),e_("baseUrl"),e.model&&(M(e.model),e_("model")),e.extras&&B(function(t){return pd({},t,e.extras)})}}),(0,g.jsxs)("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[(0,g.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,g.jsx)(u1,{htmlFor:"name",children:p("profile.name")}),(0,g.jsx)(uY,{id:"name",value:C,onChange:function(e){N(e.target.value),e_("name")},placeholder:p("profile.namePlaceholder"),"aria-invalid":!!ef.name||void 0,"aria-describedby":ef.name?"profile-name-error":void 0}),ef.name?(0,g.jsx)("p",{id:"profile-name-error",className:"text-xs text-destructive",children:l6(p,ef.name)}):null,S?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:p("profile.renameHint")}):null]}),(0,g.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,g.jsx)(u1,{htmlFor:"baseUrl",children:p("profile.baseUrl")}),(0,g.jsx)(uY,{id:"baseUrl",value:ew&&Q&&null!=(u=null==ek?void 0:ek.baseUrl)?u:E,onChange:function(e){_(e.target.value),e_("baseUrl")},placeholder:p("profile.baseUrlPlaceholder"),disabled:null!==ew&&""!==Q,"aria-invalid":!!ef.baseUrl||void 0,"aria-describedby":ef.baseUrl?"profile-base-url-error":void 0}),ef.baseUrl?(0,g.jsx)("p",{id:"profile-base-url-error",className:"text-xs text-destructive",children:l6(p,ef.baseUrl)}):null,ew&&Q?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:p("profile.baseUrlFromVault",{endpoint:Q})}):null]}),(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"apiKey",children:p("profile.apiKey")}),(0,g.jsx)(uY,{id:"apiKey",type:"password",value:A,onChange:function(e){R(e.target.value),e_("apiKey")},placeholder:ew?p("profile.keyFromVault"):S?p("profile.apiKeyKeep"):p("profile.apiKeyRequiredPlaceholder"),disabled:null!==ew,"aria-invalid":!!ef.apiKey||void 0,"aria-describedby":ef.apiKey?"profile-api-key-error":void 0}),ef.apiKey?(0,g.jsx)("p",{id:"profile-api-key-error",className:"text-xs text-destructive",children:l6(p,ef.apiKey)}):null,ew?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:p("profile.apiKeySharedHint")}):null]}),(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"model",children:"claude"===c.id?p("profile.fallbackModel"):p("profile.model")}),(0,g.jsx)(uY,{id:"model",value:I,list:ej.length>0?"profile-model-options":void 0,onChange:function(e){M(e.target.value),e_("model")},placeholder:"claude"===c.id?p("profile.fallbackModelPlaceholder"):p("profile.modelPlaceholder"),"aria-invalid":!!ef.model||void 0,"aria-describedby":ef.model?"profile-model-error":void 0}),ej.length>0?(0,g.jsx)("datalist",{id:"profile-model-options",children:ej.map(function(e){return(0,g.jsx)("option",{value:e},e)})}):null,ef.model?(0,g.jsx)("p",{id:"profile-model-error",className:"text-xs text-destructive",children:l6(p,ef.model)}):null,"claude"===c.id?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:p("profile.claudeModelHint")}):null]}),(0,g.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,g.jsxs)(or,{type:"button",variant:"outline",size:"sm",onClick:function(){return pu(function(){var e,t;return pm(this,function(n){switch(n.label){case 0:if(!(e=ez().trim()))return ep(function(e){return pf(pd({},e),{baseUrl:{key:"profile.error.baseUrlRequired"}})}),[2];eg(!0),el(null),eb(null),n.label=1;case 1:if(n.trys.push([1,7,8,9]),!(ew||A.trim()))return[3,3];return[4,k(pd({baseUrl:e},ew?{providerId:Z}:{apiKey:A}))];case 2:case 4:return t=n.sent(),[3,6];case 3:if(!(S&&d))return[3,5];return[4,j(c.id,d.name)];case 5:return ep(function(e){return pf(pd({},e),{apiKey:{key:"profile.error.apiKeyRequired"}})}),[2];case 6:return eb(t),[3,9];case 7:return el(l4(n.sent())),[3,9];case 8:return eg(!1),[7];case 9:return[2]}})})()},disabled:em,children:[em?(0,g.jsx)(uT,{className:"animate-spin"}):null,em?p("probe.probing"):p("probe.action")]}),ev?(0,g.jsx)(f9,{result:ev}):null]}),(null==ev?void 0:ev.ok)&&ej.length>0?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:p("probe.catalogHint")}):null]}),eN.map(function(e){var t;return(0,g.jsx)(pj,{field:e,value:null!=(t=H[e.key])?t:"",error:ef["extra:".concat(e.key)],onChange:function(t){B(function(n){return pf(pd({},n),pc({},e.key,t))}),e_("extra:".concat(e.key))}},e.key)}),"claude"===c.id?(0,g.jsx)(pC,{fields:c.fields,values:H,errors:ef,onChange:function(e,t){B(function(n){return pf(pd({},n),pc({},e,t))}),e_("extra:".concat(e))}}):null,eP.map(function(e){var t;return(0,g.jsx)(pj,{field:e,value:null!=(t=H[e.key])?t:"",error:ef["extra:".concat(e.key)],onChange:function(t){B(function(n){return pf(pd({},n),pc({},e.key,t))}),e_("extra:".concat(e.key))}},e.key)}),(0,g.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,g.jsx)(u1,{htmlFor:"notes",children:p("profile.notes")}),(0,g.jsx)(f7,{id:"notes",rows:2,value:F,onChange:function(e){return $(e.target.value)}})]})]}),(0,g.jsxs)("div",{className:"rounded-xl border",children:[(0,g.jsxs)("button",{type:"button",onClick:function(){var e=!ee;et(e),e&&null===er&&eE()},className:"flex w-full cursor-pointer items-center gap-2 px-3 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground active:bg-accent/80 ".concat(ee?"rounded-t-xl":"rounded-xl"),children:[ee?(0,g.jsx)(T,{className:"size-4"}):(0,g.jsx)(f5,{className:"size-4"}),p("profile.advanced"),d&&d.overriddenTargets.length>0?(0,g.jsx)(aR,{variant:"secondary",children:p("profile.overridden")}):null]}),ee?(0,g.jsx)("div",{className:"space-y-4 border-t px-3 py-3",children:S?(0,g.jsx)(pw,{targets:er,overrides:V,onEdit:function(e,t){return W(function(n){return pf(pd({},n),pc({},e,t))})},onReset:function(e){W(function(t){var n=pd({},t);return delete n[e],n}),eE()}}):(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:p("profile.saveFirst")})}):null]}),ei?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(p,ei)}):null]}),(0,g.jsxs)(lT,{className:"shrink-0 border-t bg-card px-6 py-4",children:[(0,g.jsx)(or,{type:"button",variant:"outline",onClick:function(){return f(!1)},children:p("common.cancel")}),(0,g.jsx)(or,{type:"submit",disabled:eu,children:eu?p("profile.saving"):p("profile.save")})]})]})})})}function pw(e){var t=e.targets,n=e.overrides,r=e.onEdit,a=e.onReset,o=(0,x.Bd)().t;return null===t?(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:o("profile.rawLoading")}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:o("profile.rawIntro")}),t.map(function(e){var t,i=void 0!==n[e.key];return(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,g.jsx)(u1,{htmlFor:"raw-".concat(e.key),className:"font-mono text-xs",children:e.path}),i?(0,g.jsxs)(or,{type:"button",size:"sm",variant:"ghost",onClick:function(){return a(e.key)},children:[(0,g.jsx)(f6,{}),o("profile.resetToGenerated")]}):null]}),(0,g.jsx)(f7,{id:"raw-".concat(e.key),rows:10,spellCheck:!1,className:"font-mono text-xs",value:null!=(t=n[e.key])?t:e.content,onChange:function(t){return r(e.key,t.target.value)}})]},e.key)})]})}function pk(e){var t,n=e.harnessId,r=e.onPick,a=(0,x.Bd)().t,o=null!=(t=pi[n])?t:[];return 0===o.length?null:(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,g.jsx)("span",{className:"text-xs text-muted-foreground",children:a("profile.quickFill")}),o.map(function(e){return(0,g.jsx)(or,{type:"button",size:"sm",variant:"outline",onClick:function(){return r(e)},children:a("preset.".concat(e.id))},e.id)})]})}function pj(e){var t,n,r=e.field,a=e.value,o=e.error,i=e.onChange,l=(0,x.Bd)().t,s="extra-".concat(r.key);return(0,g.jsxs)("div",{className:"textarea"===r.kind||r.fullWidth?"space-y-2 sm:col-span-2":"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:s,children:r.label}),"select"===r.kind?(0,g.jsxs)(dJ,{value:a,onValueChange:i,children:[(0,g.jsx)(fM,{id:s,"aria-label":r.label,"aria-invalid":!!o||void 0,"aria-describedby":o?"".concat(s,"-error"):void 0,children:(0,g.jsx)(dQ,{placeholder:null!=(t=r.placeholder)?t:l("profile.selectPlaceholder")})}),(0,g.jsx)(f$,{children:null==(n=r.options)?void 0:n.map(function(e){return(0,g.jsx)(fU,{value:e.value,children:e.label},e.value)})})]}):"textarea"===r.kind?(0,g.jsx)(f7,{id:s,rows:3,value:a,placeholder:r.placeholder,className:"font-mono text-xs","aria-invalid":!!o||void 0,"aria-describedby":o?"".concat(s,"-error"):void 0,onChange:function(e){return i(e.target.value)}}):(0,g.jsx)(uY,{id:s,type:"password"===r.kind?"password":"text",value:a,placeholder:r.placeholder,"aria-invalid":!!o||void 0,"aria-describedby":o?"".concat(s,"-error"):void 0,onChange:function(e){return i(e.target.value)}}),o?(0,g.jsx)("p",{id:"".concat(s,"-error"),className:"text-xs text-destructive",children:l6(l,o)}):null,r.help?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:r.help}):null]})}var pS="md:grid-cols-[6.5rem_minmax(0,1fr)_minmax(0,1fr)_8.5rem]",pO="grid gap-2 rounded-lg border bg-card/70 p-3 ".concat(pS," md:items-start md:gap-3 md:border-0 md:bg-transparent md:p-0");function pC(e){var t,n=e.fields,r=e.values,a=e.errors,o=e.onChange,i=(0,x.Bd)().t,l=new Map(n.map(function(e){return[e.key,e]})),s=l.get(py);return(0,g.jsxs)("section",{"data-slot":"claude-model-mapping",className:"space-y-4 rounded-xl border bg-muted/15 p-4 sm:col-span-2 sm:p-5",children:[(0,g.jsxs)("div",{className:"space-y-1",children:[(0,g.jsx)("h3",{className:"text-base font-semibold",children:i("profile.mapping.title")}),(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:i("profile.mapping.intro")})]}),(0,g.jsxs)("div",{className:"hidden gap-3 px-1 text-xs font-medium text-muted-foreground md:grid ".concat(pS),children:[(0,g.jsx)("span",{children:i("profile.mapping.role")}),(0,g.jsx)("span",{children:i("profile.mapping.displayName")}),(0,g.jsx)("span",{children:i("profile.mapping.actualModel")}),(0,g.jsx)("span",{children:i("profile.mapping.oneM")})]}),(0,g.jsxs)("div",{className:"space-y-3",children:[pg.map(function(e){var t,n,s,u=e.role,c=e.modelKey,d=e.nameKey,f=e.oneMKey,p=l.get(c),h=l.get(d);if(!p||!h)return null;var m=a["extra:".concat(c)],y=a["extra:".concat(d)];return(0,g.jsxs)("div",{className:pO,children:[(0,g.jsxs)("div",{className:"flex h-10 items-center rounded-lg border bg-muted/45 px-3 text-sm font-medium",children:[u,p.required?(0,g.jsx)("span",{className:"ml-1 text-destructive",children:"*"}):null]}),(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)(u1,{htmlFor:"extra-".concat(d),className:"text-xs md:sr-only",children:h.label}),(0,g.jsx)(uY,{id:"extra-".concat(d),value:null!=(t=r[d])?t:"",placeholder:(null==(s=r[c])?void 0:s.trim())?i("profile.mapping.defaultTo",{model:r[c].trim()}):h.placeholder,"aria-invalid":!!y||void 0,"aria-describedby":y?"extra-".concat(d,"-error"):void 0,onChange:function(e){return o(d,e.target.value)}}),y?(0,g.jsx)("p",{id:"extra-".concat(d,"-error"),className:"text-xs text-destructive",children:l6(i,y)}):null]}),(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)(u1,{htmlFor:"extra-".concat(c),className:"text-xs md:sr-only",children:p.label}),(0,g.jsx)(uY,{id:"extra-".concat(c),value:null!=(n=r[c])?n:"",placeholder:p.placeholder,"aria-invalid":!!m||void 0,"aria-describedby":m?"extra-".concat(c,"-error"):void 0,onChange:function(e){return o(c,e.target.value)}}),m?(0,g.jsx)("p",{id:"extra-".concat(c,"-error"),className:"text-xs text-destructive",children:l6(i,m)}):null]}),(0,g.jsx)(pN,{role:u,field:f?l.get(f):void 0,value:f?r[f]:void 0,error:f?a["extra:".concat(f)]:void 0,onChange:o})]},u)}),s?(0,g.jsxs)("div",{className:pO,children:[(0,g.jsx)("div",{className:"flex h-10 items-center rounded-lg border bg-muted/45 px-3 text-sm font-medium",children:"Subagent"}),(0,g.jsx)("div",{className:"flex h-10 items-center rounded-lg border bg-muted/30 px-3 text-sm text-muted-foreground",children:i("profile.mapping.notInMenu")}),(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)(u1,{htmlFor:"extra-subagentModel",className:"text-xs md:sr-only",children:s.label}),(0,g.jsx)(uY,{id:"extra-subagentModel",value:null!=(t=r.subagentModel)?t:"",placeholder:s.placeholder,"aria-invalid":!!a["extra:subagentModel"]||void 0,"aria-describedby":a["extra:subagentModel"]?"extra-subagentModel-error":void 0,onChange:function(e){return o("subagentModel",e.target.value)}}),a["extra:subagentModel"]?(0,g.jsx)("p",{id:"extra-subagentModel-error",className:"text-xs text-destructive",children:l6(i,a["extra:subagentModel"])}):null]}),(0,g.jsx)(pN,{role:"Subagent",field:l.get(pv),value:r[pv],error:a["extra:".concat(pv)],onChange:o})]}):null]})]})}function pN(e){var t=e.role,n=e.field,r=e.value,a=e.error,o=e.onChange,i=(0,x.Bd)().t;if(!n)return(0,g.jsx)("div",{"data-slot":"one-m-unsupported",className:"flex h-10 items-center rounded-lg border border-dashed bg-muted/20 px-3 text-sm text-muted-foreground",children:i("profile.mapping.oneMUnsupported",{role:t})});var l="extra-".concat(n.key);return(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)("div",{className:"flex h-10 items-center",children:(0,g.jsxs)("label",{htmlFor:l,className:"flex cursor-pointer items-center gap-2 text-sm text-muted-foreground",children:[(0,g.jsx)(uQ,{id:l,checked:"true"===r,"aria-label":n.label,"aria-invalid":!!a||void 0,"aria-describedby":a?"".concat(l,"-error"):void 0,onCheckedChange:function(e){return o(n.key,!0===e?"true":"false")}}),(0,g.jsx)("span",{className:"md:hidden",children:n.label}),(0,g.jsx)("span",{className:"hidden md:inline",children:i("profile.mapping.enable")})]})}),a?(0,g.jsx)("p",{id:"".concat(l,"-error"),className:"text-xs text-destructive",children:l6(i,a)}):null]})}let pP=O("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),pE=O("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function p_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pz(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function pT(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){pz(o,r,a,i,l,"next",e)}function l(e){pz(o,r,a,i,l,"throw",e)}i(void 0)})}}function pA(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){pA(e,t,n[t])})}return e}function pL(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function pI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||pD(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pM(e){return function(e){if(Array.isArray(e))return p_(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||pD(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pD(e,t){if(e){if("string"==typeof e)return p_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p_(e,t)}}function pF(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function p$(e){var t,n=e.open,r=e.onOpenChange,a=(0,x.s9)().locale,o=(0,x.Bd)().t,i=so(function(e){return e.providers}),l=so(function(e){return e.providersLoading}),s=so(function(e){return e.providersError}),u=so(function(e){return e.loadProviders}),c=so(function(e){return e.deleteProvider}),d=pI((0,y.useState)({kind:"list"}),2),f=d[0],p=d[1],h=pI((0,y.useState)(null),2),m=h[0],v=h[1],b=pI((0,y.useState)(null),2),w=b[0],k=b[1],j=pI((0,y.useState)(null),2),S=j[0],O=j[1],C=pI((0,y.useState)(null),2),N=C[0],P=C[1],E=pI((0,y.useState)({}),2),_=E[0],T=E[1],A=so(function(e){return e.revealProvider});(0,y.useEffect)(function(){n&&(p({kind:"list"}),v(null),k(null),P(null),null===i&&u())},[n,i,u]);var R=null!=i?i:[];return(0,g.jsxs)(ll,{open:n,onOpenChange:r,children:[(0,g.jsxs)(l_,{className:"max-h-[88vh] overflow-y-auto sm:max-w-2xl",children:[(0,g.jsxs)(lz,{children:[(0,g.jsx)(lA,{children:"create"===f.kind?o("vault.createTitle"):"edit"===f.kind?o("vault.editTitle",{name:f.entry.name}):o("vault.title")}),(0,g.jsx)(lR,{children:"list"===f.kind?o("vault.intro"):o("vault.formIntro")})]}),l&&0===R.length?(0,g.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:o("vault.loading")}):null,s?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(o,s)}):null,"create"===f.kind||"edit"===f.kind?(0,g.jsx)(pU,{entry:"edit"===f.kind?f.entry:null,onCancel:function(){p({kind:"list"}),k(null)},onSaved:function(e){p({kind:"list"}),v(e),k(null)}}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:o("vault.entryCount",{count:R.length})}),(0,g.jsxs)(or,{size:"sm",onClick:function(){return p({kind:"create"})},children:[(0,g.jsx)(z,{}),o("vault.add")]})]}),m?(0,g.jsx)("div",{className:"rounded-xl bg-emerald-500/10 px-3 py-2 text-sm text-emerald-600 dark:text-emerald-400",children:m.map(function(e){return(0,g.jsx)("p",{children:l6(o,e)},e.key+e.scope)})}):null,w?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(o,w)}):null,0===R.length?(0,g.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:o("vault.empty")}):(0,g.jsx)("ul",{className:"max-h-80 divide-y overflow-y-auto rounded-xl border",children:R.map(function(e){var t,n,r;return(0,g.jsxs)("li",{className:"px-4 py-3",children:[(0,g.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,g.jsxs)("div",{className:"min-w-0",children:[(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,g.jsx)("p",{className:"font-medium",children:e.name}),e.apiKeyConfigured?(0,g.jsx)(aR,{variant:"secondary",children:o("vault.keyConfigured")}):(0,g.jsx)(aR,{variant:"outline",children:o("vault.keyMissing")}),(0,g.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:(t=e.updatedAt,n=a,Number.isNaN((r=new Date(t)).getTime())?t:r.toLocaleString(n))})]}),e.notes?(0,g.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e.notes}):null,e.endpoints.length>0?(0,g.jsx)("ul",{className:"mt-2 space-y-1",children:e.endpoints.map(function(e){return(0,g.jsxs)("li",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[(0,g.jsx)("code",{className:"font-mono text-xs",children:e.key}),(0,g.jsx)("span",{className:"break-all font-mono text-[11px] text-muted-foreground",children:e.baseUrl})]},e.key)})}):(0,g.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:o("vault.noEndpoints")})]}),(0,g.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,g.jsx)(or,{size:"icon",variant:"ghost","aria-label":void 0!==_[e.id]?o("vault.hide",{name:e.name}):o("vault.reveal",{name:e.name}),onClick:function(){pT(function(){var t;return pF(this,function(n){switch(n.label){case 0:if(void 0!==_[e.id])return T(function(t){var n=pR({},t);return delete n[e.id],n}),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,A(e.id)];case 2:return t=n.sent().apiKey,T(function(n){return pL(pR({},n),pA({},e.id,t))}),[3,4];case 3:return k(l3(n.sent(),"vault.revealFailed")),[3,4];case 4:return[2]}})})()},children:void 0!==_[e.id]?(0,g.jsx)(pP,{}):(0,g.jsx)(pE,{})}),(0,g.jsx)(or,{size:"icon",variant:"ghost","aria-label":o("vault.edit",{name:e.name}),onClick:function(){p({kind:"edit",entry:e}),k(null)},children:(0,g.jsx)(sX,{})}),(0,g.jsx)(or,{size:"icon",variant:"ghost","aria-label":o("vault.delete",{name:e.name}),onClick:function(){P(null),O(e)},children:(0,g.jsx)(s0,{className:"text-destructive"})})]})]}),void 0!==_[e.id]?(0,g.jsx)("p",{className:"mt-2 break-all rounded-lg bg-muted/60 px-3 py-2 font-mono text-xs",children:_[e.id]}):null]},e.id)})})]}),"list"===f.kind?(0,g.jsx)(lT,{children:(0,g.jsx)(or,{variant:"outline",onClick:function(){return r(!1)},children:o("vault.close")})}):null]}),(0,g.jsx)(sx,{open:null!==S,onOpenChange:function(e){return!e&&O(null)},children:(0,g.jsxs)(sA,{children:[(0,g.jsxs)(sR,{children:[(0,g.jsx)(sI,{children:o("vault.deleteTitle")}),(0,g.jsx)(sM,{children:o("vault.deleteBody",{name:null!=(t=null==S?void 0:S.name)?t:""})})]}),N?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(o,N)}):null,(0,g.jsxs)(sL,{children:[(0,g.jsx)(sF,{children:o("common.cancel")}),(0,g.jsx)(sD,{onClick:function(e){e.preventDefault(),S&&pT(function(){return pF(this,function(e){switch(e.label){case 0:P(null),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c(S.id)];case 2:return e.sent(),O(null),v([{key:"vault.deleted"}]),[3,4];case 3:return P(l3(e.sent(),"vault.deleteFailed")),[3,4];case 4:return[2]}})})()},children:o("common.delete")})]})]})})]})}function pU(e){var t,n,r=e.entry,a=e.onCancel,o=e.onSaved,i=(0,x.Bd)().t,l=so(function(e){return e.createProvider}),s=so(function(e){return e.updateProvider}),u=so(function(e){return e.probeDraft}),c=null!==r,d=pI((0,y.useState)(null!=(t=null==r?void 0:r.name)?t:""),2),f=d[0],p=d[1],h=pI((0,y.useState)(""),2),m=h[0],v=h[1],b=pI((0,y.useState)(null!=(n=null==r?void 0:r.notes)?n:""),2),w=b[0],k=b[1],j=pI((0,y.useState)(function(){var e;return(null!=(e=null==r?void 0:r.endpoints)?e:[]).map(function(e){return{key:e.key,baseUrl:e.baseUrl,label:e.label}})}),2),S=j[0],O=j[1],C=pI((0,y.useState)(!1),2),N=C[0],P=C[1],E=pI((0,y.useState)(null),2),_=E[0],T=E[1],A=pI((0,y.useState)({}),2),R=A[0],L=A[1],I=pI((0,y.useState)({}),2),M=I[0],D=I[1],F=pI((0,y.useState)(!1),2),$=F[0],U=F[1],H=pI((0,y.useState)(null),2),B=H[0],K=H[1],V=pI((0,y.useState)(null),2),W=V[0],q=V[1],Z=pI((0,y.useState)(0),2),J=Z[0],G=Z[1],Q=JSON.stringify(S);function Y(e,t){O(function(n){return n.map(function(n,r){return r===e?pR({},n,t):n})}),D(function(n){if(!n[e])return n;var r=pR({},n),a=pR({},r[e]);return void 0!==t.key&&delete a.key,void 0!==t.baseUrl&&delete a.baseUrl,0===Object.keys(a).length?delete r[e]:r[e]=a,r})}return(0,y.useEffect)(function(){K(null),q(null)},[m,Q]),(0,g.jsxs)("form",{onSubmit:function(e){return pT(function(){var t,n,a,i,u,d,p,h,g,y,v,b;return pF(this,function(x){switch(x.label){case 0:e.preventDefault(),t=S.map(function(e){return{key:e.key.trim(),label:e.label.trim(),baseUrl:e.baseUrl.trim()}}),n=pR({},f.trim()?{}:{name:{key:"vault.error.nameRequired"}},c||m.trim()?{}:{apiKey:{key:"vault.error.apiKeyRequired"}}),a=new Map,i=!0,u=!1,d=void 0;try{for(p=t[Symbol.iterator]();!(i=(h=p.next()).done);i=!0)(g=h.value).key&&a.set(g.key,(null!=(y=a.get(g.key))?y:0)+1)}catch(e){u=!0,d=e}finally{try{i||null==p.return||p.return()}finally{if(u)throw d}}if(v=Object.fromEntries(t.flatMap(function(e,t){var n,r={};return e.key?e.key.includes("/")||e.key.includes("\\")||e.key.length>60?r.key={key:"vault.error.endpointKeyInvalid",params:{max:60}}:(null!=(n=a.get(e.key))?n:0)>1&&(r.key={key:"vault.error.endpointKeyDuplicate"}):r.key={key:"vault.error.endpointKeyRequired"},e.baseUrl||(r.baseUrl={key:"vault.error.endpointUrlRequired"}),Object.keys(r).length>0?[[t,r]]:[]})),L(n),D(v),Object.keys(n).length>0||Object.keys(v).length>0)return T({key:"vault.error.checkFields"}),[2];b={name:f.trim(),notes:w.trim()||void 0,endpoints:t},P(!0),T(null),x.label=1;case 1:if(x.trys.push([1,6,7,8]),!(c&&r))return[3,3];return[4,s(r.id,pR({},b,m.trim()?{apiKey:m.trim()}:{}))];case 2:return o([{key:"vault.updated"}].concat(pM(x.sent().warnings.map(l2)))),[3,5];case 3:return[4,l(pL(pR({},b),{apiKey:m.trim()}))];case 4:x.sent(),o([{key:"vault.created"}]),x.label=5;case 5:return[3,8];case 6:return T(l3(x.sent(),"vault.saveFailed")),[3,8];case 7:return P(!1),[7];case 8:return[2]}})})()},noValidate:!0,className:"space-y-4",children:[(0,g.jsxs)("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[(0,g.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,g.jsx)(u1,{htmlFor:"provider-name",children:i("vault.name")}),(0,g.jsx)(uY,{id:"provider-name",value:f,onChange:function(e){p(e.target.value),L(function(e){return pL(pR({},e),{name:void 0})})},placeholder:i("vault.namePlaceholder"),"aria-invalid":!!R.name||void 0,"aria-describedby":R.name?"provider-name-error":void 0}),R.name?(0,g.jsx)("p",{id:"provider-name-error",className:"text-xs text-destructive",children:l6(i,R.name)}):null]}),(0,g.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,g.jsx)(u1,{htmlFor:"provider-api-key",children:i("vault.apiKey")}),(0,g.jsx)(uY,{id:"provider-api-key",type:"password",value:m,onChange:function(e){v(e.target.value),L(function(e){return pL(pR({},e),{apiKey:void 0})})},placeholder:c?i("vault.apiKeyKeep"):i("vault.apiKeyRequiredPlaceholder"),"aria-invalid":!!R.apiKey||void 0,"aria-describedby":R.apiKey?"provider-api-key-error":void 0}),R.apiKey?(0,g.jsx)("p",{id:"provider-api-key-error",className:"text-xs text-destructive",children:l6(i,R.apiKey)}):null]}),(0,g.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,g.jsx)(u1,{htmlFor:"provider-notes",children:i("vault.notes")}),(0,g.jsx)(f7,{id:"provider-notes",rows:2,value:w,onChange:function(e){return k(e.target.value)}})]})]}),(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{children:i("vault.endpoints")}),(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:i("vault.endpointsHint")}),0===S.length?(0,g.jsx)("p",{className:"rounded-xl border border-dashed px-3 py-3 text-center text-xs text-muted-foreground",children:i("vault.noEndpointDrafts")}):(0,g.jsx)("div",{className:"space-y-2",children:S.map(function(e,t){var n,r,a,o,l,s;return(0,g.jsxs)("div",{className:"grid items-start gap-2 sm:grid-cols-[10rem_minmax(0,1fr)_minmax(0,1fr)_auto]",children:[(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)(uY,{"aria-label":i("vault.endpointKeyLabel",{index:t+1}),value:e.key,onChange:function(e){return Y(t,{key:e.target.value})},placeholder:i("vault.endpointKeyPlaceholder"),"aria-invalid":null!=(n=M[t])&&!!n.key||void 0,"aria-describedby":(null==(r=M[t])?void 0:r.key)?"endpoint-".concat(t,"-key-error"):void 0}),(null==(a=M[t])?void 0:a.key)?(0,g.jsx)("p",{id:"endpoint-".concat(t,"-key-error"),className:"text-xs text-destructive",children:l6(i,M[t].key)}):null]}),(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)(uY,{"aria-label":i("vault.endpointUrlLabel",{index:t+1}),value:e.baseUrl,onChange:function(e){return Y(t,{baseUrl:e.target.value})},placeholder:i("vault.endpointUrlPlaceholder"),"aria-invalid":null!=(o=M[t])&&!!o.baseUrl||void 0,"aria-describedby":(null==(l=M[t])?void 0:l.baseUrl)?"endpoint-".concat(t,"-url-error"):void 0}),(null==(s=M[t])?void 0:s.baseUrl)?(0,g.jsx)("p",{id:"endpoint-".concat(t,"-url-error"),className:"text-xs text-destructive",children:l6(i,M[t].baseUrl)}):null]}),(0,g.jsx)(uY,{"aria-label":i("vault.endpointLabelLabel",{index:t+1}),value:e.label,onChange:function(e){return Y(t,{label:e.target.value})},placeholder:i("vault.endpointLabelPlaceholder")}),(0,g.jsx)(or,{type:"button",size:"icon",variant:"ghost","aria-label":i("vault.removeEndpoint",{index:t+1}),onClick:function(){O(function(e){return e.filter(function(e,n){return n!==t})}),D({})},children:(0,g.jsx)(s0,{})})]},t)})}),(0,g.jsxs)(or,{type:"button",size:"sm",variant:"outline",onClick:function(){return O(function(e){return pM(e).concat([{key:"",baseUrl:"",label:""}])})},children:[(0,g.jsx)(z,{}),i("vault.addEndpoint")]}),(0,g.jsx)(pH,{options:S.map(function(e,t){return{index:t,key:e.key,baseUrl:e.baseUrl}}).filter(function(e){return e.baseUrl.trim()}),targetIndex:J,onTargetChange:G,hasStoredKey:c,hasTypedKey:m.trim().length>0,onMissingKey:function(){return L(function(e){return pL(pR({},e),{apiKey:{key:"vault.error.apiKeyRequired"}})})},probing:$,result:B,probeError:W,onProbe:function(){return pT(function(){var e,t,n,a;return pF(this,function(o){switch(o.label){case 0:if(!(n=null!=(e=(t=S.map(function(e,t){return{endpoint:e,index:t}}).filter(function(e){return""!==e.endpoint.baseUrl.trim()})).find(function(e){return e.index===J}))?e:t[0]))return K(null),q({key:"probe.missingBaseUrl"}),[2];if(!c&&!m.trim())return K(null),q(null),L(function(e){return pL(pR({},e),{apiKey:{key:"vault.error.apiKeyRequired"}})}),[2];U(!0),q(null),K(null),o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,u(pR({baseUrl:n.endpoint.baseUrl},m.trim()?{apiKey:m}:{providerId:null!=(a=null==r?void 0:r.id)?a:""}))];case 2:return K(o.sent()),[3,5];case 3:return q(l3(o.sent(),"vault.probeFailed")),[3,5];case 4:return U(!1),[7];case 5:return[2]}})})()}})]}),_?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(i,_)}):null,(0,g.jsxs)(lT,{className:"flex-row justify-end gap-2 space-x-0",children:[(0,g.jsx)(or,{type:"button",variant:"outline",className:"min-w-24",onClick:a,children:i("common.cancel")}),(0,g.jsx)(or,{type:"submit",className:"min-w-24",disabled:N,children:N?i("vault.saving"):c?i("vault.saveChanges"):i("vault.add")})]})]})}function pH(e){var t,n,r=e.options,a=e.targetIndex,o=e.onTargetChange,i=e.hasStoredKey,l=e.hasTypedKey,s=e.onMissingKey,u=e.probing,c=e.result,d=e.probeError,f=e.onProbe,p=(0,x.Bd)().t;if(0===r.length&&!i)return null;var h=null!=(t=r.find(function(e){return e.index===a}))?t:r[0];return(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t pt-3",children:[(0,g.jsxs)(or,{type:"button",variant:"outline",size:"sm",disabled:u||0===r.length&&!l,onClick:function(){l||i?f():s()},children:[u?(0,g.jsx)(uT,{className:"animate-spin"}):null,p(u?"probe.probing":"probe.action")]}),r.length>1?(0,g.jsxs)(dJ,{value:String(null!=(n=null==h?void 0:h.index)?n:""),onValueChange:function(e){return o(Number(e))},children:[(0,g.jsx)(fM,{className:"h-9 w-56","aria-label":p("vault.probeEndpointLabel"),children:(0,g.jsx)(dQ,{})}),(0,g.jsx)(f$,{children:r.map(function(e){return(0,g.jsx)(fU,{value:String(e.index),children:e.key||e.baseUrl},e.index)})})]}):null,d?(0,g.jsxs)("span",{className:"flex items-center gap-1.5 text-sm text-destructive",children:[(0,g.jsx)(f8,{className:"size-4 shrink-0","aria-hidden":!0}),l6(p,d)]}):c?(0,g.jsx)(f9,{result:c}):null]})}let pB=O("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),pK=O("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);var pV="hs-theme";function pW(e){document.documentElement.classList.toggle("dark","dark"===e),document.documentElement.style.colorScheme=e;try{localStorage.setItem(pV,e)}catch(e){}}function pq(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pZ(){var e,t=(0,x.Bd)().t,n=function(e){if(Array.isArray(e))return e}(e=(0,y.useState)("light"))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(a.push(t.value),2!==a.length);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw n}}return a}}(e)||function(e){if(e){if("string"==typeof e)return pq(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return pq(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],a=n[1];return(0,y.useEffect)(function(){var e,t=(e=function(){try{var e=localStorage.getItem(pV);return"light"===e||"dark"===e?e:null}catch(e){return null}}())?e:"u">typeof window&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a(t),pW(t)},[]),(0,g.jsx)(or,{type:"button",size:"icon",variant:"outline","aria-label":t("dark"===r?"theme.toLight":"theme.toDark"),onClick:function(){return a(function(e){var t;return pW(t="dark"===e?"light":"dark"),t})},children:"dark"===r?(0,g.jsx)(pB,{}):(0,g.jsx)(pK,{})})}let pJ=O("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),pG=O("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),pQ=O("file-lock-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v1",key:"jmtmu2"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"5",x:"2",y:"13",rx:"1",key:"10y5wo"}],["path",{d:"M8 13v-2a2 2 0 1 0-4 0v2",key:"1pdxzg"}]]);function pY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pX(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function p0(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){pX(o,r,a,i,l,"next",e)}function l(e){pX(o,r,a,i,l,"throw",e)}i(void 0)})}}function p1(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||p2(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p2(e,t){if(e){if("string"==typeof e)return pY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pY(e,t)}}function p4(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function p3(e){var t,n,r,a=e.open,o=e.onOpenChange,i=(0,x.Bd)().t,l=so(function(e){return e.loadHarnesses}),s=so(function(e){return e.setNotice}),u=(0,y.useRef)(null),c=p1((0,y.useState)(""),2),d=c[0],f=c[1],p=p1((0,y.useState)(""),2),h=p[0],m=p[1],v=p1((0,y.useState)(null),2),b=v[0],w=v[1],k=p1((0,y.useState)(!1),2),j=k[0],S=k[1],O=p1((0,y.useState)(null),2),C=O[0],N=O[1],P=p1((0,y.useState)(""),2),E=P[0],_=P[1],z=p1((0,y.useState)(""),2),T=z[0],A=z[1],R=p1((0,y.useState)(null),2),L=R[0],I=R[1],D=p1((0,y.useState)(!1),2),F=D[0],$=D[1],U=p1((0,y.useState)(!1),2),H=U[0],B=U[1],K=p1((0,y.useState)("skip"),2),V=K[0],W=K[1],q=p1((0,y.useState)(!0),2),Z=q[0],J=q[1],G=p1((0,y.useState)(!1),2),Q=G[0],Y=G[1],X=p1((0,y.useState)(null),2),ee=X[0],et=X[1],en=p1((0,y.useState)(null),2),er=en[0],ea=en[1],eo=p1((0,y.useState)(null),2),ei=eo[0],el=eo[1];(0,y.useEffect)(function(){if(!a){S(!1),B(!1),$(!1),Y(!1);return}var e=!1;return S(!1),lQ("/api/transfer/export/preview").then(function(t){e||w(t)}).catch(function(){e||w(null)}),function(){e=!0}},[a]);var es=d.length>=8&&d===h&&null===ee,eu=null!==C&&T.length>=8&&null===ee,ec=(null==L?void 0:L.conflictPolicy)===V&&(null==L?void 0:L.restoreActive)===Z,ed=null!==L&&ec&&!F&&null===ee,ef=L&&ec&&!F?function(e,t){switch(t){case"openai-api-key":return e("transfer.authEffect.openai-api-key");case"auth-override":return e("transfer.authEffect.auth-override");case"official-cleanup":return e("transfer.authEffect.official-cleanup");case"none":return null}}(i,L.codexActivationAuthEffect):null;return(0,g.jsx)(ll,{open:a,onOpenChange:o,children:(0,g.jsxs)(l_,{className:"max-h-[90vh] overflow-y-auto sm:max-w-2xl",children:[(0,g.jsxs)(lz,{children:[(0,g.jsx)(lA,{children:i("transfer.title")}),(0,g.jsx)(lR,{children:i("transfer.intro")})]}),(0,g.jsxs)("section",{className:"space-y-4 rounded-2xl border bg-muted/25 p-4",children:[(0,g.jsxs)("div",{className:"flex items-start gap-3",children:[(0,g.jsx)("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary",children:(0,g.jsx)(pJ,{className:"size-4"})}),(0,g.jsxs)("div",{children:[(0,g.jsx)("h3",{className:"font-semibold",children:i("transfer.exportTitle")}),(0,g.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:i("transfer.exportIntro")})]})]}),(0,g.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"export-passphrase",children:i("transfer.passphrase")}),(0,g.jsx)(uY,{id:"export-passphrase",type:"password",autoComplete:"new-password",value:d,onChange:function(e){return f(e.target.value)},placeholder:i("transfer.passphrasePlaceholder",{min:8})})]}),(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"export-passphrase-confirm",children:i("transfer.passphraseConfirm")}),(0,g.jsx)(uY,{id:"export-passphrase-confirm",type:"password",autoComplete:"new-password",value:h,onChange:function(e){return m(e.target.value)},placeholder:i("transfer.passphraseConfirmPlaceholder")})]})]}),h&&d!==h?(0,g.jsx)("p",{className:"text-xs text-destructive",children:i("transfer.passphraseMismatch")}):null,(null==b?void 0:b.codexLoginCacheAvailable)?(0,g.jsx)("label",{className:"space-y-2 rounded-xl border border-amber-500/30 bg-amber-500/5 p-3 text-sm",children:(0,g.jsxs)("span",{className:"flex cursor-pointer items-start gap-3",children:[(0,g.jsx)(uQ,{checked:j,onCheckedChange:function(e){return S(!0===e)},className:"mt-0.5"}),(0,g.jsxs)("span",{children:[(0,g.jsx)("span",{className:"block font-medium",children:i("transfer.includeCache")}),(0,g.jsx)("span",{className:"mt-1 block text-xs leading-relaxed text-muted-foreground",children:i("transfer.includeCacheHint")})]})]})}):b?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:i("transfer.noCacheToExport")}):null,(0,g.jsxs)(or,{type:"button",onClick:function(){p0(function(){return p4(this,function(e){switch(e.label){case 0:et("export"),el(null),ea(null),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,lQ("/api/transfer/export",{method:"POST",body:JSON.stringify({passphrase:d,includeCodexLoginCache:j})})];case 2:var t,n,r,a,o;return t=e.sent(),n=new Date().toISOString().slice(0,10),r=new Blob(["".concat(JSON.stringify(t,null,2),"\n")],{type:"application/json"}),a=URL.createObjectURL(r),(o=document.createElement("a")).href=a,o.download="harness-switch-".concat(n,".hsw-backup"),o.click(),URL.revokeObjectURL(a),ea(j?i("transfer.exportedWithCache"):i("transfer.exportedWithoutCache")),[3,5];case 3:return el(l4(e.sent())),[3,5];case 4:return et(null),[7];case 5:return[2]}})})()},disabled:!es,children:[(0,g.jsx)(pJ,{}),"export"===ee?i("transfer.encrypting"):i("transfer.download")]})]}),(0,g.jsxs)("section",{className:"space-y-4 rounded-2xl border p-4",children:[(0,g.jsxs)("div",{className:"flex items-start gap-3",children:[(0,g.jsx)("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary",children:(0,g.jsx)(pG,{className:"size-4"})}),(0,g.jsxs)("div",{children:[(0,g.jsx)("h3",{className:"font-semibold",children:i("transfer.importTitle")}),(0,g.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:i("transfer.importIntro")})]})]}),(0,g.jsx)("input",{ref:u,type:"file",accept:".hsw-backup,application/json",className:"sr-only",onChange:function(e){var t,n;n=null==(t=e.target.files)?void 0:t[0],p0(function(){var e,t,r;return p4(this,function(a){switch(a.label){case 0:if(I(null),$(!1),Y(!1),B(!1),ea(null),el(null),!n)return N(null),_(""),[2];a.label=1;case 1:return a.trys.push([1,3,,4]),t=JSON.parse,[4,n.text()];case 2:if("harness-switch-encrypted-export"!==(e=t.apply(JSON,[a.sent()])).format||1!==e.version)return el({key:"transfer.notAnExport"}),N(null),_(""),[2];return N(e),_(n.name),[3,4];case 3:return r=a.sent(),N(null),_(""),el(l4(r)),[3,4];case 4:return[2]}})})()}}),(0,g.jsxs)("button",{type:"button",className:"flex w-full cursor-pointer items-center gap-3 rounded-xl border border-dashed bg-muted/20 px-4 py-4 text-left transition-colors hover:border-primary/40 hover:bg-primary/5",onClick:function(){var e;return null==(e=u.current)?void 0:e.click()},children:[(0,g.jsx)(pQ,{className:"size-5 text-primary"}),(0,g.jsxs)("span",{className:"min-w-0",children:[(0,g.jsx)("span",{className:"block truncate text-sm font-medium",children:E||i("transfer.pickFile")}),(0,g.jsx)("span",{className:"mt-0.5 block text-xs text-muted-foreground",children:i("transfer.pickFileHint")})]})]}),(0,g.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end",children:[(0,g.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"import-passphrase",children:i("transfer.passphrase")}),(0,g.jsx)(uY,{id:"import-passphrase",type:"password",value:T,onChange:function(e){A(e.target.value),I(null),$(!1),Y(!1),B(!1)},placeholder:i("transfer.importPassphrasePlaceholder")})]}),(0,g.jsx)(or,{type:"button",variant:"outline",disabled:!eu,onClick:function(){p0(function(){var e;return p4(this,function(t){switch(t.label){case 0:if(!C)return[2];et("preview"),el(null),ea(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,lQ("/api/transfer/preview",{method:"POST",body:JSON.stringify({envelope:C,passphrase:T,conflictPolicy:V,restoreActive:Z})})];case 2:return I(t.sent()),$(!1),Y(!1),B(!1),[3,5];case 3:return e=t.sent(),I(null),el(l4(e)),[3,5];case 4:return et(null),[7];case 5:return[2]}})})()},children:"preview"===ee?i("transfer.inspecting"):i("transfer.inspect")})]}),L?(0,g.jsxs)("div",{className:"space-y-4 rounded-xl border bg-card p-4",children:[(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,g.jsx)(aR,{children:i("transfer.profileCount",{count:L.profileCount})}),(0,g.jsx)(aR,{variant:"secondary",children:i("transfer.providerCount",{count:L.providerCount})}),(0,g.jsx)(aR,{variant:L.conflicts.length>0?"outline":"secondary",children:i("transfer.conflictCount",{count:L.conflicts.length})}),(0,g.jsx)(aR,{variant:"secondary",children:i("transfer.activeCount",{count:L.activeCount})})]}),(0,g.jsx)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground",children:L.harnesses.map(function(e){return(0,g.jsx)("span",{children:i("transfer.harnessProfiles",{harness:M[e.harness],count:e.profiles})},e.harness)})}),L.conflicts.length>0?(0,g.jsx)("div",{className:"rounded-xl bg-amber-500/10 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-300",children:i("transfer.conflictList",{items:L.conflicts.map(function(e){return"".concat(M[e.harness]," / ").concat(e.name)}).join(i("common.listSeparator"))})}):null,(null==(t=L.codexLoginCache)?void 0:t.available)&&L.codexLoginCache.migrationNeeded?(0,g.jsxs)("label",{className:"space-y-2 rounded-xl border border-amber-500/30 bg-amber-500/5 p-3 text-sm",children:[(0,g.jsxs)("span",{className:"flex cursor-pointer items-start gap-3",children:[(0,g.jsx)(uQ,{checked:H,onCheckedChange:function(e){return B(!0===e)},className:"mt-0.5"}),(0,g.jsxs)("span",{children:[(0,g.jsx)("span",{className:"block font-medium",children:i("transfer.migrateCache")}),(0,g.jsx)("span",{className:"mt-1 block text-xs leading-relaxed text-muted-foreground",children:i("transfer.migrateCacheHint")})]})]}),(null==(n=L.codexLoginCache)?void 0:n.targetExists)?(0,g.jsx)("span",{className:"block text-xs leading-relaxed text-amber-700 dark:text-amber-300",children:i("transfer.migrateCacheOverwrite")}):null]}):null,ef?(0,g.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-300",children:ef}):null,F?(0,g.jsx)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:i("transfer.previewStale")}):null,(0,g.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"conflict-policy",children:i("transfer.conflictPolicy")}),(0,g.jsxs)(dJ,{value:V,onValueChange:function(e){W(e),$(!0),Y(!1)},children:[(0,g.jsx)(fM,{id:"conflict-policy",children:(0,g.jsx)(dQ,{})}),(0,g.jsxs)(f$,{children:[(0,g.jsx)(fU,{value:"skip",children:i("transfer.policySkip")}),(0,g.jsx)(fU,{value:"overwrite",children:i("transfer.policyOverwrite")})]})]})]}),(0,g.jsxs)("label",{className:"flex cursor-pointer items-center gap-3 rounded-xl border px-3 py-2 text-sm",children:[(0,g.jsx)(uQ,{checked:Z,onCheckedChange:function(e){J(!0===e),$(!0),Y(!1)}}),i("transfer.restoreActive")]})]}),(0,g.jsxs)(or,{type:"button",disabled:!ed,onClick:function(){return Y(!0)},children:[(0,g.jsx)(pG,{}),F?i("transfer.recheckNeeded"):i("transfer.confirmImport")]}),(0,g.jsx)(sx,{open:Q,onOpenChange:Y,children:(0,g.jsxs)(sA,{children:[(0,g.jsxs)(sR,{children:[(0,g.jsx)(sI,{children:ef?i("transfer.confirmAuthTitle"):i("transfer.confirmTitle")}),(0,g.jsxs)(sM,{children:[i("transfer.confirmBody",{count:L.profileCount}),"overwrite"===V&&L.conflicts.length>0?i("transfer.confirmOverwrite",{count:L.conflicts.length}):i("transfer.confirmKeep"),H?(null==(r=L.codexLoginCache)?void 0:r.targetExists)?i("transfer.confirmCacheOverwrite"):i("transfer.confirmCacheWrite"):i("transfer.confirmCacheSkip"),ef?" ".concat(ef):null]})]}),(0,g.jsxs)(sL,{children:[(0,g.jsx)(sF,{children:i("common.cancel")}),(0,g.jsx)(sD,{onClick:function(){p0(function(){var e;return p4(this,function(t){switch(t.label){case 0:if(!C||!L||F)return[2];Y(!1),et("import"),el(null),t.label=1;case 1:return t.trys.push([1,4,5,6]),[4,lQ("/api/transfer/import",{method:"POST",body:JSON.stringify({envelope:C,passphrase:T,conflictPolicy:V,restoreActive:Z,migrateCodexLoginCache:H})})];case 2:return e=t.sent(),[4,l()];case 3:var n,r,a,u;return t.sent(),s((u=[(n=i)("transfer.importedCount",{count:(r=e).imported})],r.overwritten>0&&u.push(n("transfer.overwrittenCount",{count:r.overwritten})),r.providersCopied>0&&u.push(n("transfer.providersCopiedCount",{count:r.providersCopied})),r.skipped>0&&u.push(n("transfer.skippedCount",{count:r.skipped})),r.activeRestored>0&&u.push(n("transfer.activeRestoredCount",{count:r.activeRestored})),u.push(n(r.codexLoginCacheMigrated?"transfer.cacheMigrated":"transfer.cacheNotMigrated")),[{key:"transfer.importedSummary",params:{parts:u.join(n("common.listSeparator"))}}].concat(function(e){if(Array.isArray(e))return pY(e)}(a=r.warnings.map(function(e){return l2(e)}))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||p2(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))),I(null),$(!1),B(!1),o(!1),[3,6];case 4:return el(l4(t.sent())),[3,6];case 5:return et(null),[7];case 6:return[2]}})})()},children:ef?i("transfer.proceedAware"):"overwrite"===V?i("transfer.proceedOverwrite"):i("transfer.proceedSafe")})]})]})})]}):null]}),er?(0,g.jsx)("p",{className:"text-sm text-emerald-600 dark:text-emerald-400",children:er}):null,ei?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(i,ei)}):null]})})}function p5(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p6(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function p8(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p5(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p9(){var e=(0,x.Bd)().t,t=p8((0,y.useState)(null),2),n=t[0],r=t[1],a=p8((0,y.useState)(null),2),o=a[0],i=a[1],l=p8((0,y.useState)("idle"),2),s=l[0],u=l[1];return((0,y.useEffect)(function(){var e=!1;return lQ("/api/update/check").then(function(t){!e&&(r(t.current),t.updateAvailable&&t.latest&&i(t.latest))}).catch(function(){}),function(){e=!0}},[]),"updating"===s)?(0,g.jsxs)("span",{className:"flex h-6 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md bg-muted/70 px-2 font-mono text-[11px] text-muted-foreground",children:[(0,g.jsx)(uT,{className:"size-3 shrink-0 animate-spin"}),e("update.updating")]}):"failed"===s?(0,g.jsx)("span",{title:e("update.failedHint"),className:"flex h-6 shrink-0 items-center whitespace-nowrap rounded-md bg-destructive/10 px-2 font-mono text-[11px] text-destructive",children:e("update.failed")}):o?(0,g.jsxs)(or,{variant:"outline",size:"sm","aria-label":e("update.toVersion",{version:o}),className:"h-6 shrink-0 gap-1 whitespace-nowrap px-2 font-mono text-[11px]",onClick:function(){var e;(e=function(){var e;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:u("updating"),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,lQ("/api/update",{method:"POST"})];case 2:case 3:return t.sent(),[3,4];case 4:e=Date.now()+18e4,t.label=5;case 5:if(!(Date.now()<e))return[3,11];return[4,new Promise(function(e){return setTimeout(e,2500)})];case 6:t.sent(),t.label=7;case 7:return t.trys.push([7,9,,10]),[4,lQ("/api/version")];case 8:if(t.sent().version!==n)return window.location.reload(),[2];return[3,10];case 9:return t.sent(),[3,10];case 10:return[3,5];case 11:return u("failed"),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){p6(o,r,a,i,l,"next",e)}function l(e){p6(o,r,a,i,l,"throw",e)}i(void 0)})})()},children:[(0,g.jsx)(sd,{className:"size-3 shrink-0"}),(0,g.jsx)("span",{className:"sm:hidden",children:e("update.short")}),(0,g.jsx)("span",{className:"hidden sm:inline",children:e("update.toVersion",{version:o})})]}):null}let p7=O("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),he=O("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);function ht(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hn(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function hr(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){hn(o,r,a,i,l,"next",e)}function l(e){hn(o,r,a,i,l,"throw",e)}i(void 0)})}}function ha(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||hi(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ho(e){return function(e){if(Array.isArray(e))return ht(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||hi(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hi(e,t){if(e){if("string"==typeof e)return ht(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ht(e,t)}}function hl(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function hs(e){var t=e.open,n=e.onOpenChange,r=(0,x.Bd)().t,a=so(function(e){return e.users}),o=so(function(e){return e.currentUser}),i=so(function(e){return e.loadHarnesses}),l=so(function(e){return e.loadProviders}),s=so(function(e){return e.setNotice}),u=(0,y.useMemo)(function(){return a.filter(function(e){return e.username!==o})},[a,o]),c=ha((0,y.useState)(""),2),d=c[0],f=c[1],p=ha((0,y.useState)(null),2),h=p[0],m=p[1],v=ha((0,y.useState)([]),2),b=v[0],w=v[1],k=ha((0,y.useState)(!1),2),j=k[0],S=k[1],O=ha((0,y.useState)(!1),2),C=O[0],N=O[1],P=ha((0,y.useState)(!1),2),E=P[0],_=P[1],z=ha((0,y.useState)(null),2),T=z[0],A=z[1],R=(0,y.useMemo)(function(){return I.flatMap(function(e){var t,n=null!=(t=null==h?void 0:h.conflicts.filter(function(t){return t.harness===e}).length)?t:0;return n>0?[{harness:e,count:n}]:[]})},[h]),L=o||r("notice.currentUser");function D(){return hr(function(){var e;return hl(this,function(t){switch(t.label){case 0:if(!d||!h)return[2];_(!0),A(null),t.label=1;case 1:return t.trys.push([1,4,5,6]),[4,lQ("/api/users/sync",{method:"POST",body:JSON.stringify({sourceUser:d,conflictPolicy:"skip",overwriteHarnesses:b,migrateCodexLoginCache:j})})];case 2:return e=t.sent(),[4,Promise.all([i(),l()])];case 3:return t.sent(),s([{key:"sync.done",params:{imported:e.imported,overwritten:e.overwritten,skipped:e.skipped,providersCopied:e.providersCopied}},{key:e.codexLoginCacheMigrated?"sync.cacheMigrated":"sync.cacheNotMigrated"}].concat(ho(e.warnings.map(function(e){return l2(e)})))),n(!1),[3,6];case 4:return A(l4(t.sent())),[3,6];case 5:return _(!1),[7];case 6:return[2]}})})()}return(0,y.useEffect)(function(){t&&(f(function(e){var t,n;return u.some(function(t){return t.username===e})?e:null!=(t=null==(n=u[0])?void 0:n.username)?t:""}),m(null),w([]),S(!1),N(!1),A(null))},[t,u]),(0,g.jsx)(ll,{open:t,onOpenChange:n,children:(0,g.jsxs)(l_,{className:"flex max-h-[calc(100dvh-1rem)] w-[calc(100vw-1rem)] max-w-xl flex-col gap-0 overflow-hidden p-0 sm:max-h-[90dvh] sm:w-full",children:[(0,g.jsxs)(lz,{className:"shrink-0 border-b px-5 py-4 pr-12 text-left sm:px-6",children:[(0,g.jsx)(lA,{children:r("sync.title")}),(0,g.jsx)(lR,{children:r("sync.intro",{user:L})})]}),(0,g.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-4 sm:px-6",children:[u.length>0?(0,g.jsxs)("div",{className:"space-y-5",children:[(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"sync-source-user",children:r("sync.sourceUser")}),(0,g.jsxs)(dJ,{value:d,onValueChange:function(e){f(e),m(null),w([]),S(!1)},children:[(0,g.jsx)(fM,{id:"sync-source-user",children:(0,g.jsx)(dQ,{placeholder:r("sync.selectUser")})}),(0,g.jsx)(f$,{children:u.map(function(e){return(0,g.jsxs)(fU,{value:e.username,children:[e.username," \xb7 ",e.homeDir]},e.username)})})]})]}),h?(0,g.jsxs)("div",{className:"space-y-4 rounded-2xl border bg-muted/25 p-4",children:[(0,g.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,g.jsx)(aR,{variant:"secondary",children:r("sync.profileCount",{count:h.profileCount})}),(0,g.jsx)(aR,{variant:"secondary",children:r("sync.providerCount",{count:h.providerCount})}),(0,g.jsx)(aR,{variant:h.conflicts.length>0?"destructive":"outline",children:r("sync.conflictCount",{count:h.conflicts.length})})]}),h.conflicts.length>0?(0,g.jsxs)("div",{className:"space-y-3",children:[(0,g.jsxs)("div",{className:"space-y-1",children:[(0,g.jsx)(u1,{children:r("sync.overwriteByHarness")}),(0,g.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:r("sync.overwriteHint")})]}),(0,g.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:R.map(function(e){var t=e.harness,n=e.count;return(0,g.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 rounded-xl border bg-background/70 p-3 text-sm",children:[(0,g.jsx)(uQ,{checked:b.includes(t),onCheckedChange:function(e){return w(function(n){return!0===e?ho(n).concat([t]):n.filter(function(e){return e!==t})})},className:"mt-0.5"}),(0,g.jsxs)("span",{children:[(0,g.jsx)("span",{className:"block font-medium",children:r("sync.overwriteHarness",{harness:M[t]})}),(0,g.jsx)("span",{className:"mt-1 block text-xs text-muted-foreground",children:r("sync.conflictsInHarness",{count:n})})]})]},t)})})]}):null,h.codexLoginCache.available&&h.codexLoginCache.migrationNeeded?(0,g.jsxs)("label",{className:"block space-y-3 rounded-xl border bg-background/70 p-3 text-sm",children:[(0,g.jsxs)("span",{className:"flex cursor-pointer items-start gap-3",children:[(0,g.jsx)(uQ,{checked:j,onCheckedChange:function(e){return S(!0===e)},className:"mt-0.5"}),(0,g.jsxs)("span",{children:[(0,g.jsx)("span",{className:"block font-medium",children:r("sync.migrateCache")}),(0,g.jsx)("span",{className:"mt-1 block text-xs leading-relaxed text-muted-foreground",children:r("sync.migrateCacheHint")})]})]}),h.codexLoginCache.targetExists?(0,g.jsx)("span",{className:"block rounded-lg bg-amber-500/10 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-300",children:r("sync.migrateCacheOverwrite")}):null]}):null,(0,g.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:r("sync.storeOnlyHint")})]}):null]}):(0,g.jsxs)("div",{className:"flex items-start gap-3 rounded-2xl border bg-muted/25 p-4",children:[(0,g.jsx)(p7,{className:"mt-0.5 size-5 text-muted-foreground"}),(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:r("sync.noOtherUsers")})]}),T?(0,g.jsx)("p",{className:"mt-4 text-sm text-destructive",children:l6(r,T)}):null]}),(0,g.jsx)(lT,{className:"shrink-0 border-t bg-card px-4 py-3 pb-[max(.75rem,env(safe-area-inset-bottom))] sm:px-6 sm:py-4",children:h?j?(0,g.jsxs)(sx,{open:C,onOpenChange:N,children:[(0,g.jsxs)(or,{className:"w-full sm:w-auto",disabled:E,onClick:function(){return N(!0)},children:[(0,g.jsx)(he,{}),E?r("sync.syncing"):r("sync.syncTo",{user:L})]}),(0,g.jsxs)(sA,{children:[(0,g.jsxs)(sR,{children:[(0,g.jsx)(sI,{children:r("sync.confirmCacheTitle")}),(0,g.jsx)(sM,{children:r("sync.confirmCacheBody",{source:d,target:L,extra:h.codexLoginCache.targetExists?r("sync.confirmCacheOverwrite"):r("sync.confirmCacheFresh")})})]}),(0,g.jsxs)(sL,{children:[(0,g.jsx)(sF,{children:r("common.cancel")}),(0,g.jsx)(sD,{onClick:function(){D()},children:r("sync.confirmCacheAction")})]})]})]}):(0,g.jsxs)(or,{className:"w-full sm:w-auto",disabled:E,onClick:function(){D()},children:[(0,g.jsx)(he,{}),E?r("sync.syncing"):r("sync.syncTo",{user:L})]}):(0,g.jsxs)(or,{className:"w-full sm:w-auto",disabled:!d||E,onClick:function(){hr(function(){var e;return hl(this,function(t){switch(t.label){case 0:if(!d)return[2];_(!0),A(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,lQ("/api/users/sync/preview",{method:"POST",body:JSON.stringify({sourceUser:d})})];case 2:return m(t.sent()),w([]),S(!1),N(!1),[3,5];case 3:return e=t.sent(),m(null),w([]),A(l4(e)),[3,5];case 4:return _(!1),[7];case 5:return[2]}})})()},children:[(0,g.jsx)(he,{}),E?r("sync.inspecting"):r("sync.inspect")]})})]})})}function hu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hc(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,y.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(a.push(t.value),2!==a.length);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw n}}return a}}(e)||function(e){if(e){if("string"==typeof e)return hu(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return hu(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=t[0],r=t[1];return((0,y.useEffect)(function(){var e=!1;return lQ("/api/version").then(function(t){e||r(t.version)}).catch(function(){}),function(){e=!0}},[]),n)?(0,g.jsxs)("span",{className:"shrink-0 whitespace-nowrap rounded-md bg-muted/70 px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:["v",n]}):null}function hd(){return(0,x.Bd)().t,null}function hf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hp(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function hh(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){hp(o,r,a,i,l,"next",e)}function l(e){hp(o,r,a,i,l,"throw",e)}i(void 0)})}}function hm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return hf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hf(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hg(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function hy(){var e,t,n,r=(0,x.s9)().locale,a=(0,x.Bd)().t,o=so(function(e){return e.harnesses}),i=so(function(e){return e.envFile}),l=so(function(e){return e.backups}),s=hm((0,y.useState)(null),2),u=s[0],c=s[1],d=hm((0,y.useState)(!1),2),f=d[0],p=d[1],h=hm((0,y.useState)(!1),2),m=h[0],v=h[1],b=hm((0,y.useState)(!1),2),w=b[0],k=b[1],j=hm((0,y.useState)(!1),2),S=j[0],O=j[1],A=hm((0,y.useState)("claude"),2),R=A[0],L=A[1],I=o.find(function(e){return e.id===(null==u?void 0:u.harnessId)}),M=null!=(e=o.find(function(e){return e.id===R}))?e:o[0];return(0,g.jsxs)("div",{className:"min-h-[100dvh] bg-background",children:[(0,g.jsx)("header",{className:"sticky top-0 z-20 border-b bg-card/90 backdrop-blur-xl",children:(0,g.jsxs)("div",{className:"flex min-h-20 flex-wrap items-center justify-between gap-x-4 gap-y-2 px-4 py-2 sm:px-6",children:[(0,g.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,g.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-primary text-primary-foreground shadow-[0_10px_24px_-12px_rgb(99_91_255/0.8)]",children:(0,g.jsx)(C,{className:"size-5"})}),(0,g.jsxs)("div",{className:"min-w-0",children:[(0,g.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,g.jsx)("h1",{className:"min-w-0 flex-1 truncate text-base font-semibold tracking-tight",children:"harness-switch"}),(0,g.jsx)(hc,{}),(0,g.jsx)(hd,{}),(0,g.jsx)(p9,{})]}),(0,g.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:a("app.tagline")})]})]}),(0,g.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[(0,g.jsxs)(or,{variant:"outline",size:"sm",onClick:function(){return k(!0)},children:[(0,g.jsx)(N,{}),(0,g.jsx)("span",{className:"hidden lg:inline",children:a("nav.syncUserConfig")})]}),(0,g.jsxs)(or,{variant:"outline",size:"sm",onClick:function(){return O(!0)},children:[(0,g.jsx)(P,{}),(0,g.jsx)("span",{className:"hidden lg:inline",children:a("nav.importExisting")})]}),(0,g.jsxs)(or,{variant:"outline",size:"sm",onClick:function(){return p(!0)},children:[(0,g.jsx)(E,{}),(0,g.jsx)("span",{className:"hidden sm:inline",children:a("nav.transfer")})]}),(0,g.jsxs)(or,{variant:"outline",size:"sm",onClick:function(){return v(!0)},children:[(0,g.jsx)(_,{}),(0,g.jsx)("span",{className:"hidden sm:inline",children:a("nav.vault")})]}),(0,g.jsx)(fG,{}),(0,g.jsx)(pZ,{}),(0,g.jsx)(hv,{})]})]})}),(0,g.jsxs)("div",{className:"grid xl:grid-cols-[17rem_minmax(0,1fr)_18rem]",children:[(0,g.jsx)(hb,{harnesses:o,value:null==M?void 0:M.id,onChange:L}),M?(0,g.jsxs)("main",{role:"tabpanel",id:"harness-panel-".concat(M.id),"aria-labelledby":"harness-tab-".concat(M.id),className:"min-w-0 space-y-6 p-4 sm:p-6 xl:p-8",children:[(0,g.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("h2",{className:"text-2xl font-semibold tracking-tight",children:M.label}),(0,g.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:a("harness.subtitle")})]}),(0,g.jsxs)(or,{className:"self-start sm:self-auto",onClick:function(){return c({harnessId:M.id,profile:null})},children:[(0,g.jsx)(z,{}),a("harness.newProfile")]})]}),(0,g.jsx)(un,{harness:M,onAdd:function(){return c({harnessId:M.id,profile:null})},onEdit:function(e){return c({harnessId:M.id,profile:e})}}),(0,g.jsxs)("details",{className:"group rounded-2xl border bg-card px-5 py-4 text-sm shadow-[0_12px_34px_-28px_rgb(36_39_70/0.35)]",children:[(0,g.jsxs)("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 font-medium",children:[(0,g.jsx)("span",{className:"font-mono text-[13px]",children:a("env.title")}),(0,g.jsx)(T,{className:"size-4 text-muted-foreground transition-transform group-open:rotate-180"})]}),(0,g.jsx)("p",{className:"mt-4 leading-relaxed text-muted-foreground",children:a("env.intro")}),(0,g.jsxs)("code",{className:"mt-3 block rounded-xl bg-muted/70 px-4 py-3 font-mono text-[13px]",children:["source ",i||"~/.harness-switch/env.sh"]}),(0,g.jsx)("p",{className:"mt-3 leading-relaxed text-muted-foreground",children:a("env.note")})]})]}):null,M?(0,g.jsx)(hx,{harness:M,latestBackup:l.find(function(e){return e.harness===M.id}),locale:r}):null]}),u&&I?(0,g.jsx)(px,{harness:I,profile:u.profile,onOpenChange:function(e){return!e&&c(null)}},"".concat(u.harnessId,"-").concat(null!=(t=null==(n=u.profile)?void 0:n.name)?t:"new")):null,(0,g.jsx)(p3,{open:f,onOpenChange:p}),(0,g.jsx)(p$,{open:m,onOpenChange:v}),(0,g.jsx)(hs,{open:w,onOpenChange:k}),(0,g.jsx)(fq,{open:S,onOpenChange:O}),(0,g.jsx)(fQ,{})]})}function hv(){var e=(0,x.Bd)().t,t=so(function(e){return e.logout}),n=so(function(e){return e.users}),r=so(function(e){return e.currentUser}),a=so(function(e){return e.usersLoading}),o=so(function(e){return e.switchUser}),i=hm((0,y.useState)(!1),2),l=i[0],s=i[1],u=(0,y.useRef)(null);return(0,y.useEffect)(function(){var e=function(e){var t;(null==(t=u.current)?void 0:t.contains(e.target))||s(!1)};if(l)return window.addEventListener("pointerdown",e),function(){return window.removeEventListener("pointerdown",e)}},[l]),(0,g.jsxs)("div",{ref:u,className:"relative",children:[(0,g.jsxs)(or,{variant:"outline",size:"sm","aria-label":e("nav.currentLocalUser"),"aria-expanded":l,"aria-haspopup":"menu",disabled:a,onClick:function(){return s(function(e){return!e})},children:[(0,g.jsx)(A,{}),(0,g.jsx)("span",{className:"max-w-28 truncate",children:r||e("nav.localUser")}),(0,g.jsx)(T,{className:aT("transition-transform",l&&"rotate-180")})]}),l?(0,g.jsxs)("div",{role:"menu","aria-label":e("nav.currentLocalUser"),className:"absolute right-0 top-full z-30 mt-2 w-52 rounded-xl border bg-popover p-1 text-popover-foreground shadow-lg",children:[(0,g.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:e("nav.currentLocalUser")}),n.map(function(e){return(0,g.jsx)("button",{type:"button",role:"menuitemradio","aria-checked":e.username===r,disabled:a||e.username===r,onClick:function(){var t;t=e.username,hh(function(){return hg(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,o(t)];case 1:return e.sent(),s(!1),[3,3];case 2:return e.sent(),[3,3];case 3:return[2]}})})()},className:"flex w-full cursor-pointer items-center rounded-lg px-3 py-2 text-left text-sm hover:bg-accent disabled:cursor-default disabled:opacity-60",children:e.username},e.username)}),(0,g.jsx)("div",{className:"my-1 border-t"}),(0,g.jsxs)("button",{type:"button",role:"menuitem",disabled:a,onClick:function(){hh(function(){return hg(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,t()];case 1:return e.sent(),s(!1),[3,3];case 2:return e.sent(),[3,3];case 3:return[2]}})})()},className:"flex w-full cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-left text-sm text-destructive hover:bg-destructive/10 disabled:cursor-default disabled:opacity-60",children:[(0,g.jsx)(R,{className:"size-4"}),e("nav.signOut")]})]}):null]})}function hb(e){var t=e.harnesses,n=e.value,r=e.onChange,a=(0,x.Bd)().t;return(0,g.jsx)("div",{role:"tablist","aria-label":a("nav.switchHarness"),"aria-orientation":"vertical",className:"flex gap-2 overflow-x-auto border-b bg-card/45 p-3 xl:min-h-[calc(100dvh-80px)] xl:flex-col xl:overflow-x-visible xl:border-b-0 xl:border-r xl:p-4",children:t.map(function(e,o){var i,l,s,u=e.id===n,c=(null==(l=e.active)?void 0:l.official)?a("harness.official"):null!=(i=null==(s=e.active)?void 0:s.name)?i:null;return(0,g.jsxs)("button",{type:"button",role:"tab",id:"harness-tab-".concat(e.id),"aria-controls":"harness-panel-".concat(e.id),"aria-selected":u,tabIndex:u?0:-1,onClick:function(){return r(e.id)},onKeyDown:function(e){return function(e,n){var a="ArrowLeft"===e.key||"ArrowUp"===e.key,o="ArrowRight"===e.key||"ArrowDown"===e.key;if(a||o||"Home"===e.key||"End"===e.key){e.preventDefault();var i=n;i="Home"===e.key?0:"End"===e.key?t.length-1:(n+(o?1:-1)+t.length)%t.length;var l=t[i];if(l){r(l.id);var s,u,c=null==(s=e.currentTarget.parentElement)?void 0:s.querySelectorAll('[role="tab"]');null==c||null==(u=c[i])||u.focus()}}}(e,o)},className:aT("flex min-w-[12rem] shrink-0 cursor-pointer items-center gap-3 rounded-xl px-3 py-3 text-left transition-[color,background-color,box-shadow,transform] duration-150 active:translate-y-px xl:min-w-0 xl:w-full",u?"bg-primary/[0.09] text-primary shadow-[inset_0_0_0_1px_rgb(99_91_255/0.13)]":"text-muted-foreground hover:bg-card hover:text-foreground"),children:[(0,g.jsx)("span",{className:aT("flex size-10 shrink-0 items-center justify-center rounded-xl border bg-card shadow-[0_4px_12px_-8px_rgb(36_39_70/0.28)]",u?"border-primary/20":"border-border"),children:(0,g.jsx)(uz,{id:e.id})}),(0,g.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,g.jsx)("span",{className:"block truncate text-sm font-medium text-current",children:e.label}),(0,g.jsx)("span",{className:"mt-0.5 block truncate font-mono text-[11px] text-muted-foreground",children:null===c?a("harness.currentInactive"):a("harness.current",{name:c})})]}),(0,g.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:e.profiles.length})]},e.id)})})}function hx(e){var t=e.harness,n=e.latestBackup,r=e.locale,a=(0,x.Bd)().t;return(0,g.jsx)("aside",{className:"border-t bg-card/35 p-4 sm:p-6 xl:min-h-[calc(100dvh-80px)] xl:border-l xl:border-t-0 xl:p-5",children:(0,g.jsxs)("div",{className:"space-y-4 xl:sticky xl:top-[100px]",children:[(0,g.jsxs)("section",{className:"rounded-2xl border bg-card p-5 shadow-[0_12px_34px_-28px_rgb(36_39_70/0.38)]",children:[(0,g.jsxs)("div",{className:"flex items-center gap-2",children:[(0,g.jsx)(L,{className:"size-4 text-primary"}),(0,g.jsx)("h3",{className:"font-semibold",children:a("harness.writeTargets")})]}),(0,g.jsxs)("div",{className:"mt-5 space-y-4",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:a("harness.application")}),(0,g.jsx)("p",{className:"mt-1 text-sm font-medium",children:t.label})]}),t.targets.map(function(e){return(0,g.jsxs)("div",{children:[(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:e.label}),(0,g.jsx)("p",{className:"mt-1 break-all font-mono text-xs leading-relaxed",children:e.path})]},e.key)}),(0,g.jsxs)("div",{children:[(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:a("harness.writeMode")}),(0,g.jsx)("p",{className:"mt-1 text-sm",children:a("replace"===t.mode?"harness.modeReplace":"harness.modeAdditive")})]})]})]}),(0,g.jsx)(sq,{harness:t}),(0,g.jsx)(f3,{harness:t}),(0,g.jsxs)("section",{className:"rounded-2xl border bg-card p-5 shadow-[0_12px_34px_-28px_rgb(36_39_70/0.38)]",children:[(0,g.jsx)("h3",{className:"font-semibold",children:a("backup.latest")}),n?(0,g.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:a("backup.profile")}),(0,g.jsx)("p",{className:"mt-1 truncate text-sm font-medium",children:n.profile})]}),(0,g.jsxs)("p",{className:"font-mono text-[11px] leading-relaxed text-muted-foreground",children:[new Date(n.createdAt).toLocaleString(r)," \xb7"," ",a("backup.fileCount",{count:n.files.length})]})]}):(0,g.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:a("backup.empty")}),(0,g.jsx)("div",{className:"mt-4 border-t pt-4",children:(0,g.jsx)(ss,{harnessId:t.id})})]})]})})}function hw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hk(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function hj(){var e,t=(0,x.Bd)().t,n=so(function(e){return e.login}),r=so(function(e){return e.loading}),a=function(e){if(Array.isArray(e))return e}(e=(0,y.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(a.push(t.value),2!==a.length);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw n}}return a}}(e)||function(e){if(e){if("string"==typeof e)return hw(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return hw(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=a[0],i=a[1];return(0,g.jsxs)("main",{className:"grid min-h-[100dvh] lg:grid-cols-2",children:[(0,g.jsxs)("section",{className:"hidden flex-col justify-between border-r bg-card p-10 lg:flex",children:[(0,g.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:t("app.brandMark")}),(0,g.jsxs)("div",{className:"max-w-sm space-y-3",children:[(0,g.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:t("login.title")}),(0,g.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:t("login.intro")})]}),(0,g.jsxs)("div",{className:"flex gap-2",children:[(0,g.jsx)(fG,{}),(0,g.jsx)(pZ,{})]})]}),(0,g.jsx)("section",{className:"flex items-center justify-center px-4 py-10",children:(0,g.jsxs)("form",{className:"w-full max-w-sm space-y-5",onSubmit:function(e){var t;return(t=function(){var t,r;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(a){switch(a.label){case 0:e.preventDefault(),t=new FormData(e.currentTarget),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,n(String(null!=(r=t.get("password"))?r:""))];case 2:return a.sent(),[3,4];case 3:return i(l4(a.sent())),[3,4];case 4:return[2]}})},function(){var e=this,n=arguments;return new Promise(function(r,a){var o=t.apply(e,n);function i(e){hk(o,r,a,i,l,"next",e)}function l(e){hk(o,r,a,i,l,"throw",e)}i(void 0)})})()},children:[(0,g.jsxs)("div",{className:"flex items-start justify-between gap-3 lg:hidden",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:t("app.brandMark")}),(0,g.jsx)("h1",{className:"mt-2 text-2xl font-semibold tracking-tight",children:t("login.title")})]}),(0,g.jsxs)("div",{className:"flex gap-2",children:[(0,g.jsx)(fG,{}),(0,g.jsx)(pZ,{})]})]}),(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:t("login.hint")}),(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"password",children:t("login.password")}),(0,g.jsx)(uY,{id:"password",name:"password",type:"password",autoFocus:!0,required:!0})]}),o?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(t,o)}):null,(0,g.jsx)(or,{className:"w-full",type:"submit",disabled:r,children:t(r?"login.submitting":"login.submit")})]})})]})}(0,b.createRoot)(document.getElementById("root")).render((0,g.jsx)(y.StrictMode,{children:(0,g.jsx)(x.CY,{children:(0,g.jsx)(function(){var e=(0,x.Bd)().t,t=so(function(e){return e.sessionChecked}),n=so(function(e){return e.authenticated}),r=so(function(e){return e.loadSession});return((0,y.useEffect)(function(){r()},[r]),t)?n?(0,g.jsx)(hy,{}):(0,g.jsx)(hj,{}):(0,g.jsx)("div",{className:"flex min-h-[100dvh] items-center justify-center text-sm text-muted-foreground",children:e("app.checkingSession")})},{})})}))})()})();
62
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&"ref"===e.reused){a(n);continue}}}function nr(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=t=>{let n=e.seen.get(t);if(null===n.ref)return;let a=n.def??n.schema,o={...a},i=n.ref;if(n.ref=null,i){r(i);let n=e.seen.get(i),l=n.schema;if(l.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(a.allOf=a.allOf??[],a.allOf.push(l)):Object.assign(a,l),Object.assign(a,o),t._zod.parent===i)for(let e in a)"$ref"!==e&&"allOf"!==e&&(e in o||delete a[e]);if(l.$ref&&n.def)for(let e in a)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(a[e])===JSON.stringify(n.def[e])&&delete a[e]}let l=t._zod.parent;if(l&&l!==i){r(l);let t=e.seen.get(l);if(t?.schema.$ref&&(a.$ref=t.schema.$ref,t.def))for(let e in a)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(a[e])===JSON.stringify(t.def[e])&&delete a[e]}e.override({zodSchema:t,jsonSchema:a,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let a={};if("draft-2020-12"===e.target?a.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?a.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");a.$id=e.external.uri(n)}Object.assign(a,n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;void 0!==o&&a.id===o&&delete a.id;let i=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?a.$defs=i:a.definitions=i);try{let n=JSON.parse(JSON.stringify(a));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:na(t,"input",e.processors),output:na(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw Error("Error converting schema to JSON.")}}let na=(e,t,n={})=>r=>{let{libraryOptions:a,target:o}=r??{},i=ne({...a??{},target:o,io:t,processors:n});return nt(e,i),nn(i,e),nr(i,e)},no={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ni=(e,t,n,r)=>{let a=e._zod.def;nt(a.innerType,t,r),t.seen.get(e).ref=a.innerType},nl=D("ZodISODateTime",(e,t)=>{td.init(e,t),n_.init(e,t)}),ns=D("ZodISODate",(e,t)=>{tf.init(e,t),n_.init(e,t)}),nu=D("ZodISOTime",(e,t)=>{tp.init(e,t),n_.init(e,t)}),nc=D("ZodISODuration",(e,t)=>{th.init(e,t),n_.init(e,t)}),nd=D("ZodError",(e,t)=>{eY.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let n={_errors:[]},r=(e,a=[])=>{for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e},[...a,...o.path]));else if("invalid_key"===o.code)r({issues:o.issues},[...a,...o.path]);else if("invalid_element"===o.code)r({issues:o.issues},[...a,...o.path]);else{let e=[...a,...o.path];if(0===e.length)n._errors.push(t(o));else{let r=n,a=0;for(;a<e.length;){let n=e[a];a===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(o))):r[n]=r[n]||{_errors:[]},r=r[n],a++}}}};return r(e),n})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let n={},r=[];for(let a of e.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,em,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,em,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),nf=e0(nd),np=e1(nd),nh=e2(nd),nm=e3(nd),ng=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return e0(nd)(e,t,r)},ny=(e,t,n)=>e0(nd)(e,t,n),nv=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return e1(nd)(e,t,r)},nb=async(e,t,n)=>e1(nd)(e,t,n),nx=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return e2(nd)(e,t,r)},nw=(e,t,n)=>e2(nd)(e,t,n),nk=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return e3(nd)(e,t,r)},nj=async(e,t,n)=>e3(nd)(e,t,n),nS=new WeakMap;function nO(e,t,n){let r=Object.getPrototypeOf(e),a=nS.get(r);if(a||(a=new Set,nS.set(r,a)),!a.has(t))for(let e in a.add(t),n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let nC=D("ZodType",(e,t)=>(e8.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:na(e,"input"),output:na(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{let r=ne({...n,processors:t});return nt(e,r),nn(r,e),nr(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>nf(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>nh(e,t,n),e.parseAsync=async(t,n)=>np(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>nm(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ng(e,t,n),e.decode=(t,n)=>ny(e,t,n),e.encodeAsync=async(t,n)=>nv(e,t,n),e.decodeAsync=async(t,n)=>nb(e,t,n),e.safeEncode=(t,n)=>nx(e,t,n),e.safeDecode=(t,n)=>nw(e,t,n),e.safeEncodeAsync=async(t,n)=>nk(e,t,n),e.safeDecodeAsync=async(t,n)=>nj(e,t,n),nO(e,"ZodType",{check(...e){let t=this.def;return this.clone(ew(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return e_(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new rg({type:"custom",check:"custom",fn:e,...ez(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var n;let r,a;return n=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(eM(e,t.value,r._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),t.issues.push(eM(e)))},e(t.value,t)),(a=new eD({check:"custom",...ez(t)}))._zod.check=n,r=a}(e,t))},overwrite(e){return this.check(t7(e))},optional(){return ro(this)},exactOptional(){var e;return e=this,new ri({type:"optional",innerType:e})},nullable(){return rs(this)},nullish(){return ro(rs(this))},nonoptional(e){var t;return t=this,new rd({type:"nonoptional",innerType:t,...ez(e)})},array(){return n2(this)},or(e){return new n5({type:"union",options:[this,e],...ez(void 0)})},and(e){var t;return t=this,new n6({type:"intersection",left:t,right:e})},transform(e){return rh(this,new rr({type:"transform",transform:e}))},default(e){var t,n;return t=this,n=e,new ru({type:"default",innerType:t,get defaultValue(){return"function"==typeof n?n():eN(n)}})},prefault(e){var t,n;return t=this,n=e,new rc({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof n?n():eN(n)}})},catch(e){var t,n;return t=this,new rf({type:"catch",innerType:t,catchValue:"function"==typeof(n=e)?n:()=>n})},pipe(e){return rh(this,e)},readonly(){var e;return e=this,new rm({type:"readonly",innerType:e})},describe(e){let t=this.clone();return t3.add(t,{description:e}),t},meta(...e){if(0===e.length)return t3.get(this);let t=this.clone();return t3.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>t3.get(e)?.description,configurable:!0}),e)),nN=D("_ZodString",(e,t)=>{e9.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{n.type="string";let{minimum:a,maximum:o,format:i,patterns:l,contentEncoding:s}=e._zod.bag;if("number"==typeof a&&(n.minLength=a),"number"==typeof o&&(n.maxLength=o),i&&(n.format=no[i]??i,""===n.format&&delete n.format,"time"===i&&delete n.format),s&&(n.contentEncoding=s),l&&l.size>0){let e=[...l];1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n,0);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,nO(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new eB({check:"string_format",format:"regex",...ez(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new eW({check:"string_format",format:"includes",...ez(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new eq({check:"string_format",format:"starts_with",...ez(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new eZ({check:"string_format",format:"ends_with",...ez(t),suffix:e})}(...e))},min(...e){return this.check(t8(...e))},max(...e){return this.check(t6(...e))},length(...e){return this.check(t9(...e))},nonempty(...e){return this.check(t8(1,...e))},lowercase(e){return this.check(new eK({check:"string_format",format:"lowercase",...ez(e)}))},uppercase(e){return this.check(new eV({check:"string_format",format:"uppercase",...ez(e)}))},trim(){return this.check(t7(e=>e.trim()))},normalize(...e){return this.check(function(e){return t7(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(t7(e=>e.toLowerCase()))},toUpperCase(){return this.check(t7(e=>e.toUpperCase()))},slugify(){return this.check(t7(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}})}),nP=D("ZodString",(e,t)=>{e9.init(e,t),nN.init(e,t),e.email=t=>e.check(new nz({type:"string",format:"email",check:"string_format",abort:!1,...ez(t)})),e.url=t=>e.check(new nR({type:"string",format:"url",check:"string_format",abort:!1,...ez(t)})),e.jwt=t=>e.check(new nJ({type:"string",format:"jwt",check:"string_format",abort:!1,...ez(t)})),e.emoji=t=>e.check(new nL({type:"string",format:"emoji",check:"string_format",abort:!1,...ez(t)})),e.guid=t=>e.check(t5(nT,t)),e.uuid=t=>e.check(new nA({type:"string",format:"uuid",check:"string_format",abort:!1,...ez(t)})),e.uuidv4=t=>e.check(new nA({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ez(t)})),e.uuidv6=t=>e.check(new nA({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ez(t)})),e.uuidv7=t=>e.check(new nA({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ez(t)})),e.nanoid=t=>e.check(new nI({type:"string",format:"nanoid",check:"string_format",abort:!1,...ez(t)})),e.guid=t=>e.check(t5(nT,t)),e.cuid=t=>e.check(new nM({type:"string",format:"cuid",check:"string_format",abort:!1,...ez(t)})),e.cuid2=t=>e.check(new nD({type:"string",format:"cuid2",check:"string_format",abort:!1,...ez(t)})),e.ulid=t=>e.check(new nF({type:"string",format:"ulid",check:"string_format",abort:!1,...ez(t)})),e.base64=t=>e.check(new nW({type:"string",format:"base64",check:"string_format",abort:!1,...ez(t)})),e.base64url=t=>e.check(new nq({type:"string",format:"base64url",check:"string_format",abort:!1,...ez(t)})),e.xid=t=>e.check(new n$({type:"string",format:"xid",check:"string_format",abort:!1,...ez(t)})),e.ksuid=t=>e.check(new nU({type:"string",format:"ksuid",check:"string_format",abort:!1,...ez(t)})),e.ipv4=t=>e.check(new nH({type:"string",format:"ipv4",check:"string_format",abort:!1,...ez(t)})),e.ipv6=t=>e.check(new nB({type:"string",format:"ipv6",check:"string_format",abort:!1,...ez(t)})),e.cidrv4=t=>e.check(new nK({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ez(t)})),e.cidrv6=t=>e.check(new nV({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ez(t)})),e.e164=t=>e.check(new nZ({type:"string",format:"e164",check:"string_format",abort:!1,...ez(t)})),e.datetime=t=>e.check(new nl({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ez(t)})),e.date=t=>e.check(new ns({type:"string",format:"date",check:"string_format",...ez(t)})),e.time=t=>e.check(new nu({type:"string",format:"time",check:"string_format",precision:null,...ez(t)})),e.duration=t=>e.check(new nc({type:"string",format:"duration",check:"string_format",...ez(t)}))});function nE(e){return new nP({type:"string",...ez(e)})}let n_=D("ZodStringFormat",(e,t)=>{e7.init(e,t),nN.init(e,t)}),nz=D("ZodEmail",(e,t)=>{tn.init(e,t),n_.init(e,t)}),nT=D("ZodGUID",(e,t)=>{te.init(e,t),n_.init(e,t)}),nA=D("ZodUUID",(e,t)=>{tt.init(e,t),n_.init(e,t)}),nR=D("ZodURL",(e,t)=>{tr.init(e,t),n_.init(e,t)}),nL=D("ZodEmoji",(e,t)=>{ta.init(e,t),n_.init(e,t)}),nI=D("ZodNanoID",(e,t)=>{to.init(e,t),n_.init(e,t)}),nM=D("ZodCUID",(e,t)=>{ti.init(e,t),n_.init(e,t)}),nD=D("ZodCUID2",(e,t)=>{tl.init(e,t),n_.init(e,t)}),nF=D("ZodULID",(e,t)=>{ts.init(e,t),n_.init(e,t)}),n$=D("ZodXID",(e,t)=>{tu.init(e,t),n_.init(e,t)}),nU=D("ZodKSUID",(e,t)=>{tc.init(e,t),n_.init(e,t)}),nH=D("ZodIPv4",(e,t)=>{tm.init(e,t),n_.init(e,t)}),nB=D("ZodIPv6",(e,t)=>{tg.init(e,t),n_.init(e,t)}),nK=D("ZodCIDRv4",(e,t)=>{ty.init(e,t),n_.init(e,t)}),nV=D("ZodCIDRv6",(e,t)=>{tv.init(e,t),n_.init(e,t)}),nW=D("ZodBase64",(e,t)=>{tx.init(e,t),n_.init(e,t)}),nq=D("ZodBase64URL",(e,t)=>{tw.init(e,t),n_.init(e,t)}),nZ=D("ZodE164",(e,t)=>{tk.init(e,t),n_.init(e,t)}),nJ=D("ZodJWT",(e,t)=>{tj.init(e,t),n_.init(e,t)}),nG=D("ZodBoolean",(e,t)=>{tS.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"}});function nQ(e){return new nG({type:"boolean",...ez(e)})}let nY=D("ZodUnknown",(e,t)=>{tO.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function nX(){return new nY({type:"unknown"})}let n0=D("ZodNever",(e,t)=>{tC.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.not={}}}),n1=D("ZodArray",(e,t)=>{tP.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let a=e._zod.def,{minimum:o,maximum:i}=e._zod.bag;"number"==typeof o&&(n.minItems=o),"number"==typeof i&&(n.maxItems=i),n.type="array",n.items=nt(a.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,nO(e,"ZodArray",{min(e,t){return this.check(t8(e,t))},nonempty(e){return this.check(t8(1,e))},max(e,t){return this.check(t6(e,t))},length(e,t){return this.check(t9(e,t))},unwrap(){return this.element}})});function n2(e,t){return new n1({type:"array",element:e,...ez(t)})}let n4=D("ZodObject",(e,t)=>{tA.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let a=e._zod.def;n.type="object",n.properties={};let o=a.shape;for(let e in o)n.properties[e]=nt(o[e],t,{...r,path:[...r.path,"properties",e]});let i=new Set([...new Set(Object.keys(o))].filter(e=>{let n=a.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));i.size>0&&(n.required=Array.from(i)),a.catchall?._zod.def.type==="never"?n.additionalProperties=!1:a.catchall?a.catchall&&(n.additionalProperties=nt(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(n.additionalProperties=!1)})(e,t,n,r),eb(e,"shape",()=>t.shape),nO(e,"ZodObject",{keyof(){return re(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:nX()})},loose(){return this.clone({...this._zod.def,catchall:nX()})},strict(){return this.clone({...this._zod.def,catchall:new n0({type:"never",...ez(void 0)})})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!eC(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=ew(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ex(this,"shape",n),n}});return e_(e,r)}(this,e)},safeExtend(e){var t=this;if(!eC(e))throw Error("Invalid input to safeExtend: expected a plain object");let n=ew(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return ex(this,"shape",n),n}});return e_(t,n)},merge(e){var t=this;if(t._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=ew(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return ex(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return e_(t,n)},pick(e){return function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let a=ew(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return ex(this,"shape",e),e},checks:[]});return e_(e,a)}(this,e)},omit(e){return function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let a=ew(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return ex(this,"shape",r),r},checks:[]});return e_(e,a)}(this,e)},partial(...e){return function(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let a=ew(t._zod.def,{get shape(){let r=t._zod.def.shape,a={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(a[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(let t in r)a[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return ex(this,"shape",a),a},checks:[]});return e_(t,a)}(ra,this,e[0])},required(...e){var t,n;let r;return t=this,n=e[0],r=ew(t._zod.def,{get shape(){let e=t._zod.def.shape,r={...e};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=new rd({type:"nonoptional",innerType:e[t]}))}else for(let t in e)r[t]=new rd({type:"nonoptional",innerType:e[t]});return ex(this,"shape",r),r}}),e_(t,r)}})});function n3(e,t){return new n4({type:"object",shape:e??{},...ez(t)})}let n5=D("ZodUnion",(e,t)=>{tL.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a,o,i;return o=!1===(a=e._zod.def).inclusive,i=a.options.map((e,n)=>nt(e,t,{...r,path:[...r.path,o?"oneOf":"anyOf",n]})),void(o?n.oneOf=i:n.anyOf=i)},e.options=t.options}),n6=D("ZodIntersection",(e,t)=>{tI.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a,o,i,l;return o=nt((a=e._zod.def).left,t,{...r,path:[...r.path,"allOf",0]}),i=nt(a.right,t,{...r,path:[...r.path,"allOf",1]}),void(n.allOf=[...(l=e=>"allOf"in e&&1===Object.keys(e).length)(o)?o.allOf:[o],...l(i)?i.allOf:[i]])}}),n8=D("ZodRecord",(e,t)=>{tD.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let a=e._zod.def;n.type="object";let o=a.keyType,i=o._zod.bag,l=i?.patterns;if("loose"===a.mode&&l&&l.size>0){let e=nt(a.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});for(let t of(n.patternProperties={},l))n.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(n.propertyNames=nt(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=nt(a.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let s=o._zod.values;if(s){let e=[...s].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(n.required=e)}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function n9(e,t,n){return new n8(t&&t._zod?{type:"record",keyType:e,valueType:t,...ez(n)}:{type:"record",keyType:nE(),valueType:e,...ez(t)})}let n7=D("ZodEnum",(e,t)=>{tF.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a;(a=eh(e._zod.def.entries)).every(e=>"number"==typeof e)&&(n.type="number"),a.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=a},e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let a={};for(let r of e)if(n.has(r))a[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new n7({...t,checks:[],...ez(r),entries:a})},e.exclude=(e,r)=>{let a={...t.entries};for(let t of e)if(n.has(t))delete a[t];else throw Error(`Key ${t} not found in enum`);return new n7({...t,checks:[],...ez(r),entries:a})}});function re(e,t){return new n7({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...ez(t)})}let rt=D("ZodLiteral",(e,t)=>{t$.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let a=e._zod.def,o=[];for(let e of a.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e)if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else o.push(Number(e));else o.push(e);if(0===o.length);else if(1===o.length){let e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every(e=>"number"==typeof e)&&(n.type="number"),o.every(e=>"string"==typeof e)&&(n.type="string"),o.every(e=>"boolean"==typeof e)&&(n.type="boolean"),o.every(e=>null===e)&&(n.type="null"),n.enum=o})(e,t,n,0),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function rn(e,t){return new rt({type:"literal",values:Array.isArray(e)?e:[e],...ez(t)})}let rr=D("ZodTransform",(e,t)=>{tU.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")})(0,e,0,0),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new $(e.constructor.name);n.addIssue=r=>{"string"==typeof r?n.issues.push(eM(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(eM(r)))};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=a,n.fallback=!0,n)}}),ra=D("ZodOptional",(e,t)=>{tB.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ro(e){return new ra({type:"optional",innerType:e})}let ri=D("ZodExactOptional",(e,t)=>{tK.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),rl=D("ZodNullable",(e,t)=>{tV.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a,o,i;return o=nt((a=e._zod.def).innerType,t,r),i=t.seen.get(e),void("openapi-3.0"===t.target?(i.ref=a.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function rs(e){return new rl({type:"nullable",innerType:e})}let ru=D("ZodDefault",(e,t)=>{tW.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a;nt((a=e._zod.def).innerType,t,r),t.seen.get(e).ref=a.innerType,n.default=JSON.parse(JSON.stringify(a.defaultValue))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),rc=D("ZodPrefault",(e,t)=>{tZ.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a;nt((a=e._zod.def).innerType,t,r),t.seen.get(e).ref=a.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(a.defaultValue)))},e.unwrap=()=>e._zod.def.innerType}),rd=D("ZodNonOptional",(e,t)=>{tJ.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a;nt((a=e._zod.def).innerType,t,r),t.seen.get(e).ref=a.innerType},e.unwrap=()=>e._zod.def.innerType}),rf=D("ZodCatch",(e,t)=>{tQ.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let a,o=e._zod.def;nt(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{a=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}n.default=a})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),rp=D("ZodPipe",(e,t)=>{tY.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a,o,i;return o=(a=e._zod.def).in._zod.traits.has("$ZodTransform"),void(nt(i="input"===t.io?o?a.out:a.in:a.out,t,r),t.seen.get(e).ref=i)},e.in=t.in,e.out=t.out});function rh(e,t){return new rp({type:"pipe",in:e,out:t})}let rm=D("ZodReadonly",(e,t)=>{t0.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let a;nt((a=e._zod.def).innerType,t,r),t.seen.get(e).ref=a.innerType,n.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),rg=D("ZodCustom",(e,t)=>{t2.init(e,t),nC.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")})(0,e,0,0)});var ry=nE().trim().min(1,"名称不能为空").max(120,"名称不能超过 ".concat(120," 个字符")).refine(function(e){return!e.includes("/")&&!e.includes("\\")},"名称不能包含斜杠"),rv=function(e){return nE().max(e)},rb=nE().min(1).max(120),rx=re(I),rw=n9(rb,rv(4096)),rk=n9(rb,rv(1048576)),rj=re(["skip","overwrite"]);n3({password:rv(4096)}),n3({name:ry,baseUrl:rv(2048).optional(),apiKey:rv(4096).optional(),model:rv(120).optional(),notes:rv(4096).optional(),extras:rw.optional(),overrides:rk.optional(),providerId:rv(120).optional(),providerEndpoint:rv(120).optional()}).partial();var rS=n2(n3({key:nE().trim().min(1,"endpoint key 不能为空").max(60,"endpoint key 过长").refine(function(e){return!e.includes("/")&&!e.includes("\\")},"endpoint key 不能包含斜杠"),label:rv(120).optional(),baseUrl:nE().trim().min(1,"endpoint 需要 baseUrl").max(2048)})).max(50).refine(function(e){return new Set(e.map(function(e){return e.key})).size===e.length},"endpoint key 不能重复");n3({name:ry,apiKey:nE().min(1,"apiKey 不能为空").max(4096),endpoints:rS.optional(),notes:rv(4096).optional()}),n3({name:ry.optional(),apiKey:rv(4096).optional(),endpoints:rS.optional(),notes:rv(4096).optional()}),n3({sourceUser:nE().trim().min(1,"来源用户不能为空").max(120),conflictPolicy:rj.optional(),overwriteHarnesses:n2(rx).optional(),migrateCodexLoginCache:nQ().optional()});var rO=n3({format:rn("harness-switch-encrypted-export"),version:rn(1),kdf:n3({name:rn("scrypt"),salt:nE().min(1)}),cipher:n3({name:rn("aes-256-gcm"),iv:nE().min(1),tag:nE().min(1),data:nE().min(1)})});n3({passphrase:rv(4096),includeCodexLoginCache:nQ().optional()}),n3({envelope:rO,passphrase:rv(4096),conflictPolicy:rj.optional(),restoreActive:nQ().optional(),migrateCodexLoginCache:nQ().optional()});var rC=n3({id:nE().min(1).max(240),name:ry,target:re(["profile","vault"]),apiKey:rv(4096).optional(),providerId:rv(120).optional(),providerName:ry.optional(),overwrite:nQ().optional()});n3({selections:n2(rC).min(1,"请至少选择一条配置").max(200)}),n3({baseUrl:nE().trim().min(1,"baseUrl 不能为空").max(2048),apiKey:rv(4096).optional(),providerId:rv(120).optional()}),n3({endpoint:rv(120).optional()}),n3({});let rN=O("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);function rP(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=function e(t){var n,r,a="";if("string"==typeof t||"number"==typeof t)a+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(n=0;n<o;n++)t[n]&&(r=e(t[n]))&&(a&&(a+=" "),a+=r)}else for(r in t)t[r]&&(a&&(a+=" "),a+=r);return a}(e))&&(r&&(r+=" "),r+=t);return r}let rE=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,r_=(e,t)=>n=>{var r;if((null==t?void 0:t.variants)==null)return rP(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:a,defaultVariants:o}=t,i=Object.keys(a).map(e=>{let t=null==n?void 0:n[e],r=null==o?void 0:o[e];if(null===t)return null;let i=rE(t)||rE(r);return a[e][i]}),l=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{});return rP(e,i,null==t||null==(r=t.compoundVariants)?void 0:r.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...o,...l}[t]):({...o,...l})[t]===n})?[...e,n,r]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)},rz=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),rT=[],rA=(e,t,n)=>{if(0==e.length-t)return n.classGroupId;let r=e[t],a=n.nextPart.get(r);if(a){let n=rA(e,t+1,a);if(n)return n}let o=n.validators;if(null===o)return;let i=0===t?e.join("-"):e.slice(t).join("-"),l=o.length;for(let e=0;e<l;e++){let t=o[e];if(t.validator(i))return t.classGroupId}},rR=(e,t)=>{let n=rz();for(let r in e)rL(e[r],n,r,t);return n},rL=(e,t,n,r)=>{let a=e.length;for(let o=0;o<a;o++)rI(e[o],t,n,r)},rI=(e,t,n,r)=>{"string"==typeof e?rM(e,t,n):"function"==typeof e?rD(e,t,n,r):rF(e,t,n,r)},rM=(e,t,n)=>{(""===e?t:r$(t,e)).classGroupId=n},rD=(e,t,n,r)=>{rU(e)?rL(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:n,validator:e}))},rF=(e,t,n,r)=>{let a=Object.entries(e),o=a.length;for(let e=0;e<o;e++){let[o,i]=a[e];rL(i,r$(t,o),n,r)}},r$=(e,t)=>{let n=e,r=t.split("-"),a=r.length;for(let e=0;e<a;e++){let t=r[e],a=n.nextPart.get(t);a||(a=rz(),n.nextPart.set(t,a)),n=a}return n},rU=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,rH=[],rB=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),rK=/\s+/,rV=e=>{let t;if("string"==typeof e)return e;let n="";for(let r=0;r<e.length;r++)e[r]&&(t=rV(e[r]))&&(n&&(n+=" "),n+=t);return n},rW=[],rq=e=>{let t=t=>t[e]||rW;return t.isThemeGetter=!0,t},rZ=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,rJ=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rG=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,rQ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rY=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,rX=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,r0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,r1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,r2=e=>rG.test(e),r4=e=>!!e&&!Number.isNaN(Number(e)),r3=e=>!!e&&Number.isInteger(Number(e)),r5=e=>e.endsWith("%")&&r4(e.slice(0,-1)),r6=e=>rQ.test(e),r8=()=>!0,r9=e=>rY.test(e)&&!rX.test(e),r7=()=>!1,ae=e=>r0.test(e),at=e=>r1.test(e),an=e=>!ao(e)&&!ap(e),ar=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),aa=e=>aw(e,aO,r7),ao=e=>rZ.test(e),ai=e=>aw(e,aC,r9),al=e=>aw(e,aN,r4),as=e=>aw(e,aE,r8),au=e=>aw(e,aP,r7),ac=e=>aw(e,aj,r7),ad=e=>aw(e,aS,at),af=e=>aw(e,a_,ae),ap=e=>rJ.test(e),ah=e=>ak(e,aC),am=e=>ak(e,aP),ag=e=>ak(e,aj),ay=e=>ak(e,aO),av=e=>ak(e,aS),ab=e=>ak(e,a_,!0),ax=e=>ak(e,aE,!0),aw=(e,t,n)=>{let r=rZ.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},ak=(e,t,n=!1)=>{let r=rJ.exec(e);return!!r&&(r[1]?t(r[1]):n)},aj=e=>"position"===e||"percentage"===e,aS=e=>"image"===e||"url"===e,aO=e=>"length"===e||"size"===e||"bg-size"===e,aC=e=>"length"===e,aN=e=>"number"===e,aP=e=>"family-name"===e,aE=e=>"number"===e||"weight"===e,a_=e=>"shadow"===e,az=((e,...t)=>{let n,r,a,o,i=e=>{let t=r(e);if(t)return t;let o=((e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o,postfixLookupClassGroupIds:i}=t,l=[],s=e.trim().split(rK),u="";for(let e=s.length-1;e>=0;e-=1){let t,c=s[e],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:m}=n(c);if(d){u=c+(u.length>0?" "+u:u);continue}let g=!!m;if(g){let e=(t=r(h.substring(0,m)))&&i[t]?r(h):void 0;e&&e!==t&&(t=e,g=!1)}else t=r(h);if(!t){if(!g||!(t=r(h))){u=c+(u.length>0?" "+u:u);continue}g=!1}let y=0===f.length?"":1===f.length?f[0]:o(f).join(":"),v=p?y+"!":y,b=v+t;if(l.indexOf(b)>-1)continue;l.push(b);let x=a(t,g);for(let e=0;e<x.length;++e){let t=x[e];l.push(v+t)}u=c+(u.length>0?" "+u:u)}return u})(e,n);return a(e,o),o};return o=l=>{var s;let u;return r=(n={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),a=(a,o)=>{n[a]=o,++t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(a(e,t),t):void 0},set(e,t){e in n?n[e]=t:a(e,t)}}})((s=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t,n=[],r=0,a=0,o=0,i=e.length;for(let l=0;l<i;l++){let i=e[l];if(0===r&&0===a){if(":"===i){n.push(e.slice(o,l)),o=l+1;continue}if("/"===i){t=l;continue}}"["===i?r++:"]"===i?r--:"("===i?a++:")"===i&&a--}let l=0===n.length?e:e.slice(o),s=l,u=!1;return l.endsWith("!")?(s=l.slice(0,-1),u=!0):l.startsWith("!")&&(s=l.slice(1),u=!0),rB(n,u,s,t&&t>o?t-o:void 0)};if(t){let e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):rB(rH,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r})(s),sortModifiers:(u=new Map,s.orderSensitiveModifiers.forEach((e,t)=>{u.set(e,1e6+t)}),e=>{let t=[],n=[];for(let r=0;r<e.length;r++){let a=e[r],o="["===a[0],i=u.has(a);o||i?(n.length>0&&(n.sort(),t.push(...n),n=[]),t.push(a)):n.push(a)}return n.length>0&&(n.sort(),t.push(...n)),t}),postfixLookupClassGroupIds:(e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t})(s),...(e=>{let t=(e=>{let{theme:t,classGroups:n}=e;return rR(n,t)})(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var n;let t,r,a;return -1===(n=e).slice(1,-1).indexOf(":")?void 0:(r=(t=n.slice(1,-1)).indexOf(":"),(a=t.slice(0,r))?"arbitrary.."+a:void 0)}let r=e.split("-"),a=+(""===r[0]&&r.length>1);return rA(r,a,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],a=n[e];if(t){if(a){let e=Array(a.length+t.length);for(let t=0;t<a.length;t++)e[t]=a[t];for(let n=0;n<t.length;n++)e[a.length+n]=t[n];return e}return t}return a||rT}return n[e]||rT}}})(s)}).cache.get,a=n.cache.set,o=i,i(l)},(...e)=>o(((...e)=>{let t,n,r=0,a="";for(;r<e.length;)(t=e[r++])&&(n=rV(t))&&(a&&(a+=" "),a+=n);return a})(...e))})(()=>{let e=rq("color"),t=rq("font"),n=rq("text"),r=rq("font-weight"),a=rq("tracking"),o=rq("leading"),i=rq("breakpoint"),l=rq("container"),s=rq("spacing"),u=rq("radius"),c=rq("shadow"),d=rq("inset-shadow"),f=rq("text-shadow"),p=rq("drop-shadow"),h=rq("blur"),m=rq("perspective"),g=rq("aspect"),y=rq("ease"),v=rq("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...x(),ap,ao],k=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],S=()=>[ap,ao,s],O=()=>[r2,"full","auto",...S()],C=()=>[r3,"none","subgrid",ap,ao],N=()=>["auto",{span:["full",r3,ap,ao]},r3,ap,ao],P=()=>[r3,"auto",ap,ao],E=()=>["auto","min","max","fr",ap,ao],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],T=()=>["auto",...S()],A=()=>[r2,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],R=()=>[r2,"screen","full","dvw","lvw","svw","min","max","fit",...S()],L=()=>[r2,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],I=()=>[e,ap,ao],M=()=>[...x(),ag,ac,{position:[ap,ao]}],D=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",ay,aa,{size:[ap,ao]}],$=()=>[r5,ah,ai],U=()=>["","none","full",u,ap,ao],H=()=>["",r4,ah,ai],B=()=>["solid","dashed","dotted","double"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>[r4,r5,ag,ac],W=()=>["","none",h,ap,ao],q=()=>["none",r4,ap,ao],Z=()=>["none",r4,ap,ao],J=()=>[r4,ap,ao],G=()=>[r2,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[r6],breakpoint:[r6],color:[r8],container:[r6],"drop-shadow":[r6],ease:["in","out","in-out"],font:[an],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[r6],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[r6],shadow:[r6],spacing:["px",r4],text:[r6],"text-shadow":[r6],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",r2,ao,ap,g]}],container:["container"],"container-type":[{"@container":["","normal","size",ap,ao]}],"container-named":[ar],columns:[{columns:[r4,ao,ap,l]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[r3,"auto",ap,ao]}],basis:[{basis:[r2,"full","auto",l,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[r4,r2,"auto","initial","none",ao]}],grow:[{grow:["",r4,ap,ao]}],shrink:[{shrink:["",r4,ap,ao]}],order:[{order:[r3,"first","last","none",ap,ao]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mbs:[{mbs:T()}],mbe:[{mbe:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],"inline-size":[{inline:["auto",...R()]}],"min-inline-size":[{"min-inline":["auto",...R()]}],"max-inline-size":[{"max-inline":["none",...R()]}],"block-size":[{block:["auto",...L()]}],"min-block-size":[{"min-block":["auto",...L()]}],"max-block-size":[{"max-block":["none",...L()]}],w:[{w:[l,"screen",...A()]}],"min-w":[{"min-w":[l,"screen","none",...A()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh",...A()]}],"font-size":[{text:["base",n,ah,ai]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ax,as]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",r5,ao]}],"font-family":[{font:[am,au,t]}],"font-features":[{"font-features":[ao]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ap,ao]}],"line-clamp":[{"line-clamp":[r4,"none",ap,al]}],leading:[{leading:[o,...S()]}],"list-image":[{"list-image":["none",ap,ao]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ap,ao]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:[r4,"from-font","auto",ap,ai]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[r4,"auto",ap,ao]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"tab-size":[{tab:[r3,ap,ao]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ap,ao]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ap,ao]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:D()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},r3,ap,ao],radial:["",ap,ao],conic:[r3,ap,ao]},av,ad]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-bs":[{"border-bs":H()}],"border-w-be":[{"border-be":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":H()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...B(),"hidden","none"]}],"divide-style":[{divide:[...B(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...B(),"none","hidden"]}],"outline-offset":[{"outline-offset":[r4,ap,ao]}],"outline-w":[{outline:["",r4,ah,ai]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",c,ab,af]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",d,ab,af]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[r4,ai]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",f,ab,af]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[r4,ap,ao]}],"mix-blend":[{"mix-blend":[...K(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":K()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[r4]}],"mask-image-linear-from-pos":[{"mask-linear-from":V()}],"mask-image-linear-to-pos":[{"mask-linear-to":V()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":V()}],"mask-image-t-to-pos":[{"mask-t-to":V()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":V()}],"mask-image-r-to-pos":[{"mask-r-to":V()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":V()}],"mask-image-b-to-pos":[{"mask-b-to":V()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":V()}],"mask-image-l-to-pos":[{"mask-l-to":V()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":V()}],"mask-image-x-to-pos":[{"mask-x-to":V()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":V()}],"mask-image-y-to-pos":[{"mask-y-to":V()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[ap,ao]}],"mask-image-radial-from-pos":[{"mask-radial-from":V()}],"mask-image-radial-to-pos":[{"mask-radial-to":V()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[r4]}],"mask-image-conic-from-pos":[{"mask-conic-from":V()}],"mask-image-conic-to-pos":[{"mask-conic-to":V()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:D()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ap,ao]}],filter:[{filter:["","none",ap,ao]}],blur:[{blur:W()}],brightness:[{brightness:[r4,ap,ao]}],contrast:[{contrast:[r4,ap,ao]}],"drop-shadow":[{"drop-shadow":["","none",p,ab,af]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",r4,ap,ao]}],"hue-rotate":[{"hue-rotate":[r4,ap,ao]}],invert:[{invert:["",r4,ap,ao]}],saturate:[{saturate:[r4,ap,ao]}],sepia:[{sepia:["",r4,ap,ao]}],"backdrop-filter":[{"backdrop-filter":["","none",ap,ao]}],"backdrop-blur":[{"backdrop-blur":W()}],"backdrop-brightness":[{"backdrop-brightness":[r4,ap,ao]}],"backdrop-contrast":[{"backdrop-contrast":[r4,ap,ao]}],"backdrop-grayscale":[{"backdrop-grayscale":["",r4,ap,ao]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[r4,ap,ao]}],"backdrop-invert":[{"backdrop-invert":["",r4,ap,ao]}],"backdrop-opacity":[{"backdrop-opacity":[r4,ap,ao]}],"backdrop-saturate":[{"backdrop-saturate":[r4,ap,ao]}],"backdrop-sepia":[{"backdrop-sepia":["",r4,ap,ao]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ap,ao]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[r4,"initial",ap,ao]}],ease:[{ease:["linear","initial",y,ap,ao]}],delay:[{delay:[r4,ap,ao]}],animate:[{animate:["none",v,ap,ao]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ap,ao]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:q()}],"rotate-x":[{"rotate-x":q()}],"rotate-y":[{"rotate-y":q()}],"rotate-z":[{"rotate-z":q()}],scale:[{scale:Z()}],"scale-x":[{"scale-x":Z()}],"scale-y":[{"scale-y":Z()}],"scale-z":[{"scale-z":Z()}],"scale-3d":["scale-3d"],skew:[{skew:J()}],"skew-x":[{"skew-x":J()}],"skew-y":[{"skew-y":J()}],transform:[{transform:[ap,ao,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:G()}],"translate-x":[{"translate-x":G()}],"translate-y":[{"translate-y":G()}],"translate-z":[{"translate-z":G()}],"translate-none":["translate-none"],zoom:[{zoom:[r3,ap,ao]}],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ap,ao]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ap,ao]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[r4,ah,ai,al]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function aT(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return az(rP(t))}var aA=r_("inline-flex items-center rounded-full border px-2.5 py-1 text-[11px] font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function aR(e){var t=e.className,n=e.variant,r=function(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,["className","variant"]);return(0,g.jsx)("div",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"badge",className:aT(aA({variant:n}),t)},r))}function aL(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function aI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function aM(e){return(aM=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function aD(e,t){return(aD=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function aF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(aF=function(){return!!e})()}var a$=(0,y.lazy)(function(){var e;return(e=function(){return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:return[4,Promise.all([d.e("6150"),d.e("4952")]).then(d.bind(d,1419))];case 1:return[2,{default:e.sent().PierreFileDiff}]}})},function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){aL(o,r,a,i,l,"next",e)}function l(e){aL(o,r,a,i,l,"throw",e)}i(void 0)})})()});function aU(e){return null===e.content&&null===e.currentContent?"same":null===e.content?"delete":null===e.currentContent?"create":e.content===e.currentContent?"same":"replace"}function aH(e){var t=e.files;return(0,g.jsx)("div",{className:"space-y-3",children:t.map(function(e){return(0,g.jsx)(aB,{file:e},e.path)})})}function aB(e){var t=e.file,n=(0,x.Bd)().t,r=aU(t);return(0,g.jsxs)("div",{className:"overflow-hidden rounded-xl border",children:[(0,g.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b bg-muted/40 px-3 py-2",children:[(0,g.jsx)("p",{className:"min-w-0 truncate font-mono text-xs",title:t.path,children:t.path}),(0,g.jsx)(aR,{variant:"secondary",children:n("diff.".concat(r))})]}),(0,g.jsx)(aV,{fallback:(0,g.jsx)(aK,{file:t}),children:(0,g.jsx)(y.Suspense,{fallback:(0,g.jsx)("p",{className:"px-3 py-4 text-sm text-muted-foreground",children:n("diff.rendering")}),children:(0,g.jsx)(a$,{file:t})})})]})}function aK(e){var t,n,r=e.file,a=(0,x.Bd)().t;return(0,g.jsxs)("div",{className:"grid gap-2 p-3 font-mono text-xs",children:[(0,g.jsx)("pre",{className:"whitespace-pre-wrap text-red-400/90",children:null!=(t=r.currentContent)?t:a("diff.absent")}),(0,g.jsx)("p",{className:"font-sans text-muted-foreground",children:a("diff.afterRestore")}),(0,g.jsx)("pre",{className:"whitespace-pre-wrap text-emerald-400/90",children:null!=(n=r.content)?n:a("diff.deletedAfterRestore")})]})}var aV=function(e){var t,n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t,n,a,o;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return t=r,n=arguments,t=aM(t),e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,aF()?Reflect.construct(t,n||[],aM(this).constructor):t.apply(this,n)),o={failed:!1},(a="state")in e?Object.defineProperty(e,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[a]=o,e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&aD(r,e),n=[{key:"getDerivedStateFromError",value:function(){return{failed:!0}}}],t=[{key:"render",value:function(){return this.state.failed?this.props.fallback:this.props.children}}],aI(r.prototype,t),n&&aI(r,n),r}(y.Component),aW=Object.defineProperty,aq=(e,t)=>aW(e,"name",{value:t,configurable:!0});function aZ(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function aJ(...e){return t=>{let n=!1,r=e.map(e=>{let r=aZ(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():aZ(e[t],null)}}}}function aG(...e){return y.useCallback(aJ(...e),e)}aq(aZ,"setRef"),aq(aJ,"composeRefs"),aq(aG,"useComposedRefs");var aQ=Object.defineProperty,aY=(e,t)=>aQ(e,"name",{value:t,configurable:!0});function aX(e){let t=y.forwardRef((t,n)=>{let{children:r,...a}=t,o=null,i=!1,l=[];a8(r)&&"function"==typeof ot&&(r=ot(r._payload)),y.Children.forEach(r,e=>{if(a5(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;a8(t)&&"function"==typeof ot&&(t=ot(t._payload)),o=a2(e,t),l.push(o?.props?.children)}else l.push(e)}),o?o=y.cloneElement(o,void 0,l):!i&&1===y.Children.count(r)&&y.isValidElement(r)&&(o=r);let s=o?a3(o):void 0,u=aG(n,s);if(!o){if(r||0===r)throw Error(i?oe(e):a7(e));return r}let c=a4(a,o.props??{});return o.type!==y.Fragment&&(c.ref=n?u:s),y.cloneElement(o,c)});return t.displayName=`${e}.Slot`,t}aY(aX,"createSlot");var a0=aX("Slot"),a1=Symbol.for("radix.slottable");aY(function(e){let t=aY(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=a1,t},"createSlottable");var a2=aY((e,t)=>{if("child"in e.props){let t=e.props.child;return y.isValidElement(t)?y.cloneElement(t,void 0,e.props.children(t.props.children)):null}return y.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function a4(e,t){let n={...t};for(let r in t){let a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...e)=>{let t=o(...e);return a(...e),t}:a&&(n[r]=a):"style"===r?n[r]={...a,...o}:"className"===r&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function a3(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function a5(e){return y.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===a1}aY(a4,"mergeProps"),aY(a3,"getElementRef"),aY(a5,"isSlottable");var a6=Symbol.for("react.lazy");function a8(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===a6&&"_payload"in e&&a9(e._payload)}function a9(e){return"object"==typeof e&&null!==e&&"then"in e}aY(a8,"isLazyComponent"),aY(a9,"isPromiseLike");var a7=aY(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),oe=aY(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ot=v[" use ".trim().toString()],on=r_("inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-[10px] text-sm font-medium transition-[color,background-color,border-color,box-shadow,transform] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-background active:translate-y-px disabled:pointer-events-none disabled:opacity-50 disabled:active:translate-y-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-[0_8px_20px_-10px_color-mix(in_srgb,var(--primary)_65%,transparent)] hover:bg-primary/90 hover:shadow-[0_10px_24px_-10px_color-mix(in_srgb,var(--primary)_80%,transparent)]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/88",outline:"border border-input bg-card shadow-[0_1px_2px_rgb(20_24_40/0.04)] hover:border-ring/35 hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent/75 hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3 text-xs",lg:"h-11 px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}});function or(e){var t=e.className,n=e.variant,r=e.size,a=e.asChild,o=function(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,["className","variant","size","asChild"]);return(0,g.jsx)(void 0!==a&&a?a0:"button",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"button",className:aT(on({variant:n,size:r,className:t}))},o))}var oa=Object.defineProperty,oo=(e,t)=>oa(e,"name",{value:t,configurable:!0}),oi=!!("u">typeof window&&window.document&&window.document.createElement);function ol(e,t,{checkForDefaultPrevented:n=!0}={}){return oo(function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}function os(e){if(!oi)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function ou(e){return"IFRAME"===e.tagName}oo(ol,"composeEventHandlers"),oo(function(e){if(!oi)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window},"getOwnerWindow"),oo(os,"getOwnerDocument"),oo(function e(t,n=!1){let{activeElement:r}=os(t);if(!r?.nodeName)return null;if(ou(r)&&r.contentDocument)return e(r.contentDocument.body,n);if(n){let e=r.getAttribute("aria-activedescendant");if(e){let t=os(r).getElementById(e);if(t)return t}}return r},"getActiveElement"),oo(ou,"isFrame");var oc=Object.defineProperty,od=(e,t)=>oc(e,"name",{value:t,configurable:!0});function of(e,t=[]){let n=[];function r(t,r){let a=y.createContext(r);a.displayName=t+"Context";let o=n.length;n=[...n,r];let i=od(t=>{let{scope:n,children:r,...i}=t,l=n?.[e]?.[o]||a,s=y.useMemo(()=>i,Object.values(i));return(0,g.jsx)(l.Provider,{value:s,children:r})},"Provider");function l(n,i,s={}){let{optional:u=!1}=s,c=i?.[e]?.[o]||a,d=y.useContext(c);if(d)return d;if(void 0!==r)return r;if(!u)throw Error(`\`${n}\` must be used within \`${t}\``)}return i.displayName=t+"Provider",od(l,"useContext"),[i,l]}od(r,"createContext");let a=od(()=>{let t=n.map(e=>y.createContext(e));return od(function(n){let r=n?.[e]||t;return y.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},"useScope")},"createScope");return a.scopeName=e,[r,op(a,...t)]}function op(...e){let t=e[0];if(1===e.length)return t;let n=od(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return od(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let a=n(e)[`__scope${r}`];return{...t,...a}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}od(function(e,t){let n=y.createContext(t);n.displayName=e+"Context";let r=od(e=>{let{children:t,...r}=e,a=y.useMemo(()=>r,Object.values(r));return(0,g.jsx)(n.Provider,{value:a,children:t})},"Provider");function a(r,o={}){let{optional:i=!1}=o,l=y.useContext(n);if(l)return l;if(void 0!==t)return t;if(!i)throw Error(`\`${r}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",od(a,"useContext"),[r,a]},"createContext"),od(of,"createContextScope"),od(op,"composeContextScopes");var oh=globalThis?.document?y.useLayoutEffect:()=>{},om=Object.defineProperty,og=v[" useId ".trim().toString()]||(()=>void 0),oy=0;function ov(e){let[t,n]=y.useState(og());return oh(()=>{e||n(e=>e??String(oy++))},[e]),e||(t?`radix-${t}`:"")}om(ov,"name",{value:"useId",configurable:!0});var ob=Object.defineProperty,ox=v[" useEffectEvent ".trim().toString()],ow=v[" useInsertionEffect ".trim().toString()];function ok(e){if("function"==typeof ox)return ox(e);let t=y.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof ow?ow(()=>{t.current=e}):oh(()=>{t.current=e}),y.useMemo(()=>(...e)=>t.current?.(...e),[])}ob(ok,"name",{value:"useEffectEvent",configurable:!0});var oj=Object.defineProperty,oS=(e,t)=>oj(e,"name",{value:t,configurable:!0}),oO=v[" useInsertionEffect ".trim().toString()]||oh;function oC({prop:e,defaultProp:t,onChange:n=oS(()=>{},"onChange"),caller:r}){let[a,o,i]=oN({defaultProp:t,onChange:n}),l=void 0!==e,s=l?e:a;return[s,y.useCallback(t=>{if(l){let n=oP(t)?t(e):t;n!==e&&i.current?.(n)}else o(t)},[l,e,o,i])]}function oN({defaultProp:e,onChange:t}){let[n,r]=y.useState(e),a=y.useRef(n),o=y.useRef(t);return oO(()=>{o.current=t},[t]),y.useEffect(()=>{a.current!==n&&(o.current?.(n),a.current=n)},[n,a]),[n,r,o]}function oP(e){return"function"==typeof e}oS(oC,"useControllableState"),oS(oN,"useUncontrolledState"),oS(oP,"isFunction");var oE=Symbol("RADIX:SYNC_STATE");oS(function(e,t,n,r){let{prop:a,defaultProp:o,onChange:i,caller:l}=t,s=void 0!==a,u=ok(i),c=[{...n,state:o}];r&&c.push(r);let[d,f]=y.useReducer((t,n)=>{if(n.type===oE)return{...t,state:n.state};let r=e(t,n);return s&&!Object.is(r.state,t.state)&&u(r.state),r},...c),p=d.state,h=y.useRef(p);y.useEffect(()=>{h.current!==p&&(h.current=p,s||u(p))},[p,h,s]);let m=y.useMemo(()=>void 0!==a?{...d,state:a}:d,[d,a]);return y.useEffect(()=>{s&&!Object.is(a,d.state)&&f({type:oE,state:a})},[a,d.state,s]),[m,f]},"useControllableStateReducer");var o_=d(3144),oz=Object.defineProperty,oT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=aX(`Primitive.${t}`),r=y.forwardRef((e,r)=>{let{asChild:a,...o}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(a?n:t,{...o,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function oA(e,t){e&&o_.flushSync(()=>e.dispatchEvent(t))}function oR(e){let t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...e)=>t.current?.(...e),[])}oz(oA,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),(0,Object.defineProperty)(oR,"name",{value:"useCallbackRef",configurable:!0});var oL=Object.defineProperty,oI=(e,t)=>oL(e,"name",{value:t,configurable:!0}),oM="dismissableLayer.update",oD=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),oF=y.forwardRef(oI(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...u}=e,c=y.useContext(oD),[d,f]=y.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=y.useState({}),v=aG(t,f),b=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=x?b.indexOf(x):-1,k=d?b.indexOf(d):-1,j=c.layersWithOutsidePointerEventsDisabled.size>0,S=k>=w,O=y.useRef(!1),C=oH(e=>{o?.(e),l?.(e),e.defaultPrevented||s?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:c.dismissableSurfaces,shouldHandlePointerDownOutside:y.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...c.branches].some(t=>t.contains(e));return S&&!t},[c.branches,S])}),N=oB(e=>{if(r&&O.current)return;let t=e.target;![...c.branches].some(e=>e.contains(t))&&(i?.(e),l?.(e),e.defaultPrevented||s?.())},p),P=!!d&&k===b.length-1,E=oR(e=>{"Escape"===e.key&&(a?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))});return y.useEffect(()=>{if(P)return p.addEventListener("keydown",E,{capture:!0}),()=>p.removeEventListener("keydown",E,{capture:!0})},[p,P,E]),y.useEffect(()=>{if(d)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(h=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),oK(),()=>{n&&(c.layersWithOutsidePointerEventsDisabled.delete(d),0===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=h))}},[d,p,n,c]),y.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),oK())},[d,c]),y.useEffect(()=>{let e=oI(()=>m({}),"handleUpdate");return document.addEventListener(oM,e),()=>document.removeEventListener(oM,e)},[]),(0,g.jsx)(oT.div,{...u,ref:v,style:{pointerEvents:j?S?"auto":"none":void 0,...e.style},onFocusCapture:ol(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ol(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ol(e.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function o$(){let e=y.useContext(oD),[t,n]=y.useState(null);return y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}oI(o$,"useDismissableLayerSurface");var oU=oI(()=>!0,"IS_TRUE");function oH(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:o,shouldHandlePointerDownOutside:i=oU}=t,l=oR(e),s=y.useRef(!1),u=y.useRef(!1),c=y.useRef(new Map),d=y.useRef(()=>{});return y.useEffect(()=>{function e(){u.current=!1,a.current=!1,c.current.clear()}function t(){return Array.from(c.current.values()).some(Boolean)}function f(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...o].some(e=>e.contains(t))||c.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{u.current&&d.current()},0)}function p(e){u.current&&c.current.set(e.type,!1)}oI(e,"resetOutsideInteraction"),oI(t,"isOutsideInteractionIntercepted"),oI(f,"handleInteractionCapture"),oI(p,"handleInteractionBubble");let h=oI(o=>{if(o.target&&!s.current){let f=function(){n.removeEventListener("click",d.current);let r=t();e(),r||oV("dismissableLayer.pointerDownOutside",l,p,{discrete:!0})};if(oI(f,"handleAndDispatchPointerDownOutsideEvent"),!i(o.target)){n.removeEventListener("click",d.current),e(),s.current=!1;return}let p={originalEvent:o};u.current=!0,a.current=r&&0===o.button,c.current.clear(),r&&0===o.button?(n.removeEventListener("click",d.current),d.current=f,n.addEventListener("click",d.current,{once:!0})):f()}else n.removeEventListener("click",d.current),e();s.current=!1},"handlePointerDown"),m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of m)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener("pointerdown",h)},0);return()=>{for(let e of(window.clearTimeout(g),n.removeEventListener("pointerdown",h),n.removeEventListener("click",d.current),m))n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,l,r,a,o,i]),{onPointerDownCapture:oI(()=>s.current=!0,"onPointerDownCapture")}}function oB(e,t=globalThis?.document){let n=oR(e),r=y.useRef(!1);return y.useEffect(()=>{let e=oI(e=>{e.target&&!r.current&&oV("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:oI(()=>r.current=!0,"onFocusCapture"),onBlurCapture:oI(()=>r.current=!1,"onBlurCapture")}}function oK(){let e=new CustomEvent(oM);document.dispatchEvent(e)}function oV(e,t,n,{discrete:r}){let a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?oA(a,o):a.dispatchEvent(o)}oI(oH,"usePointerDownOutside"),oI(oB,"useFocusOutside"),oI(oK,"dispatchUpdate"),oI(oV,"handleAndDispatchCustomEvent");var oW=Object.defineProperty,oq=(e,t)=>oW(e,"name",{value:t,configurable:!0}),oZ="focusScope.autoFocusOnMount",oJ="focusScope.autoFocusOnUnmount",oG={bubbles:!1,cancelable:!0},oQ=y.forwardRef(oq(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...i}=e,[l,s]=y.useState(null),u=oR(a),c=oR(o),d=y.useRef(null),f=aG(t,s),p=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let e=function(e){if(p.paused||!l)return;let t=e.target;l.contains(t)?d.current=t:o3(d.current,{select:!0})},t=function(e){if(p.paused||!l)return;let t=e.relatedTarget;null!==t&&(l.contains(t)||o3(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&o3(l)};oq(e,"handleFocusIn"),oq(t,"handleFocusOut"),oq(n,"handleMutations"),document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[r,l,p.paused]),y.useEffect(()=>{if(l){o5.add(p);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(oZ,oG);l.addEventListener(oZ,u),l.dispatchEvent(t),t.defaultPrevented||(oY(o9(o0(l)),{select:!0}),document.activeElement===e&&o3(l))}return()=>{l.removeEventListener(oZ,u),setTimeout(()=>{let t=new CustomEvent(oJ,oG);l.addEventListener(oJ,c),l.dispatchEvent(t),t.defaultPrevented||o3(e??document.body,{select:!0}),l.removeEventListener(oJ,c),o5.remove(p)},0)}}},[l,u,c,p]);let h=y.useCallback(e=>{if(!n&&!r||p.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){let t=e.currentTarget,[r,o]=oX(t);r&&o?e.shiftKey||a!==o?e.shiftKey&&a===r&&(e.preventDefault(),n&&o3(o,{select:!0})):(e.preventDefault(),n&&o3(r,{select:!0})):a===t&&e.preventDefault()}},[n,r,p.paused]);return(0,g.jsx)(oT.div,{tabIndex:-1,...i,ref:f,onKeyDown:h})},"FocusScope"));function oY(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(o3(r,{select:t}),document.activeElement!==n)return}function oX(e){let t=o0(e);return[o1(t,e),o1(t.reverse(),e)]}function o0(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:oq(e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}function o1(e,t){let n="function"==typeof t.checkVisibility&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):o2(r,{upTo:t})))return r}function o2(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function o4(e){return e instanceof HTMLInputElement&&"select"in e}function o3(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&o4(e)&&t&&e.select()}}oq(oY,"focusFirst"),oq(oX,"getTabbableEdges"),oq(o0,"getTabbableCandidates"),oq(o1,"findVisible"),oq(o2,"isHidden"),oq(o4,"isSelectableInput"),oq(o3,"focus");var o5=o6();function o6(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),(e=o8(e,t)).unshift(t)},remove(t){e=o8(e,t),e[0]?.resume()}}}function o8(e,t){let n=[...e],r=n.indexOf(t);return -1!==r&&n.splice(r,1),n}function o9(e){return e.filter(e=>"A"!==e.tagName)}oq(o6,"createFocusScopesStack"),oq(o8,"arrayRemove"),oq(o9,"removeLinks");var o7=Object.defineProperty,ie=y.forwardRef(o7(function(e,t){let{container:n,...r}=e,[a,o]=y.useState(!1);oh(()=>o(!0),[]);let i=n||a&&globalThis?.document?.body;return i?o_.createPortal((0,g.jsx)(oT.div,{...r,ref:t}),i):null},"name",{value:"Portal",configurable:!0})),it=Object.defineProperty,ir=(e,t)=>it(e,"name",{value:t,configurable:!0});function ia(e,t){return y.useReducer((e,n)=>t[e][n]??e,e)}ir(ia,"useStateMachine");var io=ir(e=>{let{present:t,children:n}=e,r=ii(t),a="function"==typeof n?n({present:r.isPresent}):y.Children.only(n),o=is(r.ref,ic(a));return"function"==typeof n||r.isPresent?y.cloneElement(a,{ref:o}):null},"Presence");function ii(e){let[t,n]=y.useState(),r=y.useRef(null),a=y.useRef(e),o=y.useRef("none"),i=y.useRef(void 0),[l,s]=ia(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{"mounted"===l?(o.current=i.current??iu(r.current),i.current=void 0):o.current="none"},[l]),oh(()=>{let t=r.current,n=a.current;if(n!==e){let r=o.current,l=iu(t);e?(i.current=l,s("MOUNT")):"none"===l||t?.display==="none"?s("UNMOUNT"):n&&r!==l?s("ANIMATION_OUT"):s("UNMOUNT"),a.current=e}},[e,s]),oh(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,i=ir(o=>{let i=iu(r.current).includes(CSS.escape(o.animationName));if(o.target===t&&i&&(s("ANIMATION_END"),!a.current)){let r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},"handleAnimationEnd"),l=ir(e=>{e.target===t&&(o.current=iu(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,i.current=iu(t)}else r.current=null;n(e)},[])}}function il(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function is(...e){let t=y.useRef(e);return t.current=e,y.useCallback(e=>{let n=t.current,r=!1,a=n.map(t=>{let n=il(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<a.length;e++){let t=a[e];"function"==typeof t?t():il(n[e],null)}}},[])}function iu(e){return e?.animationName||"none"}function ic(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}ir(ii,"usePresence"),ir(il,"setRef"),ir(is,"useStableComposedRefs"),ir(iu,"getAnimationName"),ir(ic,"getElementRef");var id=Object.defineProperty,ip=(e,t)=>id(e,"name",{value:t,configurable:!0}),ih=0,im=null;function ig(){y.useEffect(()=>{im||(im={start:iy(),end:iy()});let{start:e,end:t}=im;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),ih++,()=>{1===ih&&(im?.start.remove(),im?.end.remove(),im=null),ih=Math.max(0,ih-1)}},[])}function iy(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}ip(function(e){return ig(),e.children},"FocusGuards"),ip(ig,"useFocusGuards"),ip(iy,"createFocusGuard");var iv=function(){return(iv=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function ib(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)0>t.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}var ix="right-scroll-bar-position",iw="width-before-scroll-bar";function ik(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var ij="u">typeof window?y.useLayoutEffect:y.useEffect,iS=new WeakMap,iO=(void 0===a&&(a={}),(void 0===o&&(o=function(e){return e}),i=[],l=!1,s={read:function(){if(l)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:null},useMedium:function(e){var t=o(e,l);return i.push(t),function(){i=i.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(l=!0;i.length;){var t=i;i=[],t.forEach(e)}i={push:function(t){return e(t)},filter:function(){return i}}},assignMedium:function(e){l=!0;var t=[];if(i.length){var n=i;i=[],n.forEach(e),t=i}var r=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(r)};a(),i={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),i}}}}).options=iv({async:!0,ssr:!1},a),s),iC=function(){},iN=y.forwardRef(function(e,t){var n,r,a,o,i=y.useRef(null),l=y.useState({onScrollCapture:iC,onWheelCapture:iC,onTouchMoveCapture:iC}),s=l[0],u=l[1],c=e.forwardProps,d=e.children,f=e.className,p=e.removeScrollBar,h=e.enabled,m=e.shards,g=e.sideCar,v=e.noRelative,b=e.noIsolation,x=e.inert,w=e.allowPinchZoom,k=e.as,j=e.gapMode,S=ib(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=(n=[i,t],r=function(e){return n.forEach(function(t){return ik(t,e)})},(a=(0,y.useState)(function(){return{value:null,callback:r,facade:{get current(){return a.value},set current(value){var e=a.value;e!==value&&(a.value=value,a.callback(value,e))}}}})[0]).callback=r,o=a.facade,ij(function(){var e=iS.get(o);if(e){var t=new Set(e),r=new Set(n),a=o.current;t.forEach(function(e){r.has(e)||ik(e,null)}),r.forEach(function(e){t.has(e)||ik(e,a)})}iS.set(o,n)},[n]),o),C=iv(iv({},S),s);return y.createElement(y.Fragment,null,h&&y.createElement(g,{sideCar:iO,removeScrollBar:p,shards:m,noRelative:v,noIsolation:b,inert:x,setCallbacks:u,allowPinchZoom:!!w,lockRef:i,gapMode:j}),c?y.cloneElement(y.Children.only(d),iv(iv({},C),{ref:O})):y.createElement(void 0===k?"div":k,iv({},C,{className:f,ref:O}),d))});iN.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},iN.classNames={fullWidth:iw,zeroRight:ix};var iP=function(e){var t=e.sideCar,n=ib(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return y.createElement(r,iv({},n))};iP.isSideCarExport=!0;var iE=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=m||d.nc;return t&&e.setAttribute("nonce",t),e}())){var r,a;(r=t).styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),a=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(a)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},i_=function(){var e=iE();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},iz=function(){var e=i_();return function(t){return e(t.styles,t.dynamic),null}},iT={left:0,top:0,right:0,gap:0},iA=function(e){return parseInt(e||"",10)||0},iR=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[iA(n),iA(r),iA(a)]},iL=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return iT;var t=iR(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},iI=iz(),iM="data-scroll-locked",iD=function(e,t,n,r){var a=e.left,o=e.top,i=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(l,"px ").concat(r,";\n }\n body[").concat(iM,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(ix," {\n right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(iw," {\n margin-right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(ix," .").concat(ix," {\n right: 0 ").concat(r,";\n }\n \n .").concat(iw," .").concat(iw," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(iM,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},iF=function(){var e=parseInt(document.body.getAttribute(iM)||"0",10);return isFinite(e)?e:0},i$=function(){y.useEffect(function(){return document.body.setAttribute(iM,(iF()+1).toString()),function(){var e=iF()-1;e<=0?document.body.removeAttribute(iM):document.body.setAttribute(iM,e.toString())}},[])},iU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=void 0===r?"margin":r;i$();var o=y.useMemo(function(){return iL(a)},[a]);return y.createElement(iI,{styles:iD(o,!t,a,n?"":"!important")})},iH=!1;if("u">typeof window)try{var iB=Object.defineProperty({},"passive",{get:function(){return iH=!0,!0}});window.addEventListener("test",iB,iB),window.removeEventListener("test",iB,iB)}catch(e){iH=!1}var iK=!!iH&&{passive:!1},iV=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&(n.overflowY!==n.overflowX||"TEXTAREA"===e.tagName||"visible"!==n[t])},iW=function(e,t){var n=t.ownerDocument,r=t;do{if("u">typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),iq(e,r)){var a=iZ(e,r);if(a[1]>a[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},iq=function(e,t){return"v"===e?iV(t,"overflowY"):iV(t,"overflowX")},iZ=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},iJ=function(e,t,n,r,a){var o,i=(o=window.getComputedStyle(t).direction,"h"===e&&"rtl"===o?-1:1),l=i*r,s=n.target,u=t.contains(s),c=!1,d=l>0,f=0,p=0;do{if(!s)break;var h=iZ(e,s),m=h[0],g=h[1]-h[2]-i*m;(m||g)&&iq(e,s)&&(f+=g,p+=m);var y=s.parentNode;s=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return d&&(a&&1>Math.abs(f)||!a&&l>f)?c=!0:!d&&(a&&1>Math.abs(p)||!a&&-l>p)&&(c=!0),c},iG=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},iQ=function(e){return[e.deltaX,e.deltaY]},iY=function(e){return e&&"current"in e?e.current:e},iX=0,i0=[];let i1=(u=function(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),a=y.useState(iX++)[0],o=y.useState(iz)[0],i=y.useRef(e);y.useEffect(function(){i.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=(function(e,t,n){if(n||2==arguments.length)for(var r,a=0,o=t.length;a<o;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(iY),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=y.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var a,o=iG(e),l=n.current,s="deltaX"in e?e.deltaX:l[0]-o[0],u="deltaY"in e?e.deltaY:l[1]-o[1],c=e.target,d=Math.abs(s)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===c||p.contains(c)))return!1;var h=iW(d,c);if(!h)return!0;if(h?a=d:(a="v"===d?"h":"v",h=iW(d,c)),!h)return!1;if(!r.current&&"changedTouches"in e&&(s||u)&&(r.current=a),!a)return!0;var m=r.current||a;return iJ(m,t,e,"h"===m?s:u,!0)},[]),s=y.useCallback(function(e){if(i0.length&&i0[i0.length-1]===o){var n="deltaY"in e?iQ(e):iG(e),r=t.current.filter(function(t){var r;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(r=t.delta,r[0]===n[0]&&r[1]===n[1])})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}if(!r){var a=(i.current.shards||[]).map(iY).filter(Boolean).filter(function(t){return t.contains(e.target)});(a.length>0?l(e,a[0]):!i.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),u=y.useCallback(function(e,n,r,a){var o={name:e,delta:n,target:r,should:a,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(r)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),c=y.useCallback(function(e){n.current=iG(e),r.current=void 0},[]),d=y.useCallback(function(t){u(t.type,iQ(t),t.target,l(t,e.lockRef.current))},[]),f=y.useCallback(function(t){u(t.type,iG(t),t.target,l(t,e.lockRef.current))},[]);y.useEffect(function(){return i0.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",s,iK),document.addEventListener("touchmove",s,iK),document.addEventListener("touchstart",c,iK),function(){i0=i0.filter(function(e){return e!==o}),document.removeEventListener("wheel",s,iK),document.removeEventListener("touchmove",s,iK),document.removeEventListener("touchstart",c,iK)}},[]);var p=e.removeScrollBar,h=e.inert;return y.createElement(y.Fragment,null,h?y.createElement(o,{styles:"\n .block-interactivity-".concat(a," {pointer-events: none;}\n .allow-interactivity-").concat(a," {pointer-events: all;}\n")}):null,p?y.createElement(iU,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},iO.useMedium(u),iP);var i2=y.forwardRef(function(e,t){return y.createElement(iN,iv({},e,{ref:t,sideCar:i1}))});i2.classNames=iN.classNames;var i4=new WeakMap,i3=new WeakMap,i5={},i6=0,i8=function(e){return e&&(e.host||i8(e.parentNode))},i9=function(e,t,n,r){var a=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var n=i8(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});i5[n]||(i5[n]=new WeakMap);var o=i5[n],i=[],l=new Set,s=new Set(a),u=function(e){!e||l.has(e)||(l.add(e),u(e.parentNode))};a.forEach(u);var c=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(l.has(e))c(e);else try{var t=e.getAttribute(r),a=null!==t&&"false"!==t,s=(i4.get(e)||0)+1,u=(o.get(e)||0)+1;i4.set(e,s),o.set(e,u),i.push(e),1===s&&a&&i3.set(e,!0),1===u&&e.setAttribute(n,"true"),a||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return c(t),l.clear(),i6++,function(){i.forEach(function(e){var t=i4.get(e)-1,a=o.get(e)-1;i4.set(e,t),o.set(e,a),t||(i3.has(e)||e.removeAttribute(r),i3.delete(e)),a||e.removeAttribute(n)}),--i6||(i4=new WeakMap,i4=new WeakMap,i3=new WeakMap,i5={})}},i7=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),i9(r,a,n,"aria-hidden")):function(){return null}},le=Object.defineProperty,lt=(e,t)=>le(e,"name",{value:t,configurable:!0}),ln="Dialog",[lr,la]=of(ln),[lo,li]=lr(ln),ll=lt(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:i=!0}=e,l=y.useRef(null),s=y.useRef(null),[u,c]=oC({prop:r,defaultProp:a??!1,onChange:o,caller:ln}),[d,f]=y.useState(0),[p,h]=y.useState(0);return(0,g.jsx)(lo,{scope:t,triggerRef:l,contentRef:s,contentId:ov(),titleId:ov(),descriptionId:ov(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:h,open:u,onOpenChange:c,onOpenToggle:y.useCallback(()=>c(e=>!e),[c]),modal:i,children:n})},"Dialog"),ls=y.forwardRef(lt(function(e,t){let{__scopeDialog:n,...r}=e,a=li("DialogTrigger",n),o=aG(t,a.triggerRef);return(0,g.jsx)(oT.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":lO(a.open),...r,ref:o,onClick:ol(e.onClick,a.onOpenToggle)})},"DialogTrigger")),lu="DialogPortal",[lc,ld]=lr(lu,{forceMount:void 0}),lf=lt(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=li(lu,t);return(0,g.jsx)(lc,{scope:t,forceMount:n,children:y.Children.map(r,e=>(0,g.jsx)(io,{present:n||o.open,children:(0,g.jsx)(ie,{asChild:!0,container:a,children:e})}))})},"DialogPortal"),lp="DialogOverlay",lh=y.forwardRef(lt(function(e,t){let n=ld(lp,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=li(lp,e.__scopeDialog);return o.modal?(0,g.jsx)(io,{present:r||o.open,children:(0,g.jsx)(lg,{...a,ref:t})}):null},"DialogOverlay")),lm=aX("DialogOverlay.RemoveScroll"),lg=y.forwardRef(lt(function(e,t){let{__scopeDialog:n,...r}=e,a=li(lp,n),o=aG(t,o$());return(0,g.jsx)(i2,{as:lm,allowPinchZoom:!0,shards:[a.contentRef],children:(0,g.jsx)(oT.div,{"data-state":lO(a.open),...r,ref:o,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),ly="DialogContent",lv=y.forwardRef(lt(function(e,t){let n=ld(ly,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=li(ly,e.__scopeDialog);return(0,g.jsx)(io,{present:r||o.open,children:o.modal?(0,g.jsx)(lb,{...a,ref:t}):(0,g.jsx)(lx,{...a,ref:t})})},"DialogContent")),lb=y.forwardRef(lt(function(e,t){let n=li(ly,e.__scopeDialog),r=y.useRef(null),a=aG(t,n.contentRef,r);return y.useEffect(()=>{let e=r.current;if(e)return i7(e)},[]),(0,g.jsx)(lw,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:ol(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ol(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:ol(e.onFocusOutside,e=>e.preventDefault())})},"DialogContentModal")),lx=y.forwardRef(lt(function(e,t){let n=li(ly,e.__scopeDialog),r=y.useRef(!1),a=y.useRef(!1);return(0,g.jsx)(lw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let o=t.target;n.triggerRef.current?.contains(o)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})},"DialogContentNonModal")),lw=y.forwardRef(lt(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...i}=e,l=li(ly,n);return ig(),(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(oQ,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,g.jsx)(oF,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":lO(l.open),...i,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl")),lk=y.forwardRef(lt(function(e,t){let{__scopeDialog:n,...r}=e,a=li("DialogTitle",n),{setTitleCount:o}=a;return oh(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),(0,g.jsx)(oT.h2,{id:a.titleId,...r,ref:t})},"DialogTitle")),lj=y.forwardRef(lt(function(e,t){let{__scopeDialog:n,...r}=e,a=li("DialogDescription",n),{setDescriptionCount:o}=a;return oh(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),(0,g.jsx)(oT.p,{id:a.descriptionId,...r,ref:t})},"DialogDescription")),lS=y.forwardRef(lt(function(e,t){let{__scopeDialog:n,...r}=e,a=li("DialogClose",n);return(0,g.jsx)(oT.button,{type:"button",...r,ref:t,onClick:ol(e.onClick,()=>a.onOpenChange(!1))})},"DialogClose"));function lO(e){return e?"open":"closed"}lt(lO,"getState");let lC=O("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function lN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function lP(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}function lE(e){var t=e.className,n=lP(e,["className"]);return(0,g.jsx)(lh,lN({"data-slot":"dialog-overlay",className:aT("fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t)},n))}function l_(e){var t,n,r=e.className,a=e.children,o=lP(e,["className","children"]);return(0,g.jsxs)(lf,{children:[(0,g.jsx)(lE,{}),(0,g.jsxs)(lv,(t=lN({"data-slot":"dialog-content",className:aT("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-card p-6 shadow-2xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-2xl",r)},o),n=n={children:[a,(0,g.jsxs)(lS,{className:"absolute right-4 top-4 cursor-pointer rounded-sm opacity-70 ring-offset-background transition-[opacity,background-color] hover:bg-accent hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 active:bg-accent/80 disabled:pointer-events-none",children:[(0,g.jsx)(lC,{className:"size-4"}),(0,g.jsx)("span",{className:"sr-only",children:"Close"})]})]},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))]})}function lz(e){var t=e.className,n=lP(e,["className"]);return(0,g.jsx)("div",lN({"data-slot":"dialog-header",className:aT("flex flex-col space-y-1.5 text-center sm:text-left",t)},n))}function lT(e){var t=e.className,n=lP(e,["className"]);return(0,g.jsx)("div",lN({"data-slot":"dialog-footer",className:aT("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},n))}function lA(e){var t=e.className,n=lP(e,["className"]);return(0,g.jsx)(lk,lN({"data-slot":"dialog-title",className:aT("text-lg font-semibold leading-none tracking-tight",t)},n))}function lR(e){var t=e.className,n=lP(e,["className"]);return(0,g.jsx)(lj,lN({"data-slot":"dialog-description",className:aT("text-sm text-muted-foreground",t)},n))}function lL(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function lI(e,t,n){return(lI=lU()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&lF(a,n.prototype),a}).apply(null,arguments)}function lM(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lD(e){return(lD=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function lF(e,t){return(lF=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l$(e){var t="function"==typeof Map?new Map:void 0;return(l$=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return lI(e,arguments,lD(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),lF(n,e)})(e)}function lU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(lU=function(){return!!e})()}var lH=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(e,n){var r,a,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return r=t,a=[n],r=lD(r),lM(o=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,lU()?Reflect.construct(r,a||[],lD(this).constructor):r.apply(this,a)),"status",void 0),lM(o,"code",void 0),lM(o,"params",void 0),o.status=e,o.name="ApiError",o.code=i.code,o.params=i.params,o}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&lF(t,e),t}(l$(Error));function lB(e){return"/api/harnesses/".concat(e,"/profiles")}function lK(e,t){return"".concat(lB(e),"/").concat(encodeURIComponent(t))}function lV(e){return e?"/api/backups/".concat(encodeURIComponent(e)):"/api/backups"}function lW(){return"/api/providers"}function lq(e){return"".concat(lW(),"/").concat(encodeURIComponent(e))}function lZ(e){return e?"/api/drift/".concat(encodeURIComponent(e)):"/api/drift"}function lJ(){return"/api/scan"}function lG(e){return e?"/api/operations?harness=".concat(encodeURIComponent(e)):"/api/operations"}function lQ(e){var t;return(t=function(e){var t,n,r,a,o,i=arguments;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(l){switch(l.label){case 0:var s,u;return n=new Headers((t=i.length>1&&void 0!==i[1]?i[1]:{}).headers),t.body&&!n.has("Content-Type")&&n.set("Content-Type","application/json"),[4,fetch(e,(s=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){lM(e,t,n[t])})}return e}({credentials:"include"},t),u=u={headers:n},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(u)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(u)).forEach(function(e){Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(u,e))}),s))];case 1:return[4,(r=l.sent()).json().catch(function(){return{}})];case 2:if(a=l.sent(),!r.ok)throw new lH(r.status,null!=(o=a.error)?o:"",{code:a.code,params:a.params});return[2,a]}})},function(){var e=this,n=arguments;return new Promise(function(r,a){var o=t.apply(e,n);function i(e){lL(o,r,a,i,l,"next",e)}function l(e){lL(o,r,a,i,l,"throw",e)}i(void 0)})}).apply(this,arguments)}function lY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lX(e,t){return null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function l0(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function l1(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function l2(e){var t;return e.code?{key:(t=e.code).startsWith("warning.")||t.startsWith("error.")?t:"error.".concat(t),params:e.params,scope:e.scope,fallback:e.message}:{key:"error.unknown",fallback:e.message,scope:e.scope}}function l4(e){return lX(e,lH)?l2({message:e.message,code:e.code,params:e.params}):{key:"error.unknown",fallback:lX(e,Error)?e.message:String(e)}}function l3(e,t){var n=l4(e);return"error.unknown"===n.key?l1(l0({},n),{key:t}):n}var l5=new Set(["drift.adoptFailed","drift.reapplyFailed","vault.deleteFailed","vault.saveFailed","vault.revealFailed","operations.undoFailed","import.failed","activate.loadFailed","backup.loadFailed","backup.diffFailed"]);function l6(e,t){if(t.fallback&&("error.unknown"===t.key||l5.has(t.key))){var n,r,a,o=null!=(a=t.fallback)?a:t.key;return t.scope?"".concat(t.scope,": ").concat(o):o}var i=Object.fromEntries(Object.entries(null!=(n=t.paramKeys)?n:{}).map(function(t){var n=function(e){if(Array.isArray(e))return e}(t)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(a.push(t.value),2!==a.length);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw n}}return a}}(t)||function(e){if(e){if("string"==typeof e)return lY(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return lY(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return[n[0],e(n[1])]})),l=e(t.key,l1(l0({},t.params,i),{defaultValue:null!=(r=t.fallback)?r:t.key}));return t.scope?"".concat(t.scope,": ").concat(l):l}let l8=e=>{let t,n=new Set,r=(e,r)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=r?r:"object"!=typeof a||null===a)?a:Object.assign({},t,a),n.forEach(n=>n(t,e))}},a=()=>t,o={setState:r,getState:a,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e))},i=t=e(r,a,o);return o};function l9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l7(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function se(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){l7(o,r,a,i,l,"next",e)}function l(e){l7(o,r,a,i,l,"throw",e)}i(void 0)})}}function st(e,t){return null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function sn(e){return function(e){if(Array.isArray(e))return l9(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return l9(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return l9(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sr(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function sa(e,t,n){var r,a;return t?{key:e,params:(r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},n),a=a={user:t},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(a)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(a,e))}),r)}:{key:e,params:n,paramKeys:{user:"notice.currentUser"}}}var so=(t=(r=function(e,t){return{sessionChecked:!1,authenticated:!1,currentUser:"",users:[],usersLoading:!1,loading:!1,error:null,envFile:"",harnesses:[],backups:[],notice:null,providers:null,providersLoading:!1,providersError:null,doctor:null,doctorUpdatedAvailable:!1,doctorLoading:!1,doctorError:null,drift:null,driftLoading:!1,driftError:null,scan:null,scanLoading:!1,scanError:null,operations:null,operationsLoading:!1,operationsError:null,loadSession:function(){return se(function(){var n;return sr(this,function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),[4,lQ("/api/auth/session")];case 1:return e({authenticated:!0,sessionChecked:!0,currentUser:r.sent().currentUser,error:null}),[4,t().loadUsers()];case 2:return r.sent(),[4,Promise.all([t().loadHarnesses(),t().loadBackups()])];case 3:return r.sent(),[4,t().loadDrift()];case 4:return r.sent(),[3,6];case 5:return e({authenticated:!1,sessionChecked:!0,error:st(n=r.sent(),lH)&&401===n.status?null:l4(n)}),[3,6];case 6:return[2]}})})()},login:function(n){return se(function(){var r;return sr(this,function(a){switch(a.label){case 0:e({loading:!0,error:null}),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,lQ("/api/auth/login",{method:"POST",body:JSON.stringify({password:n})})];case 2:return e({authenticated:!0,loading:!1,currentUser:a.sent().currentUser}),[4,t().loadUsers()];case 3:return a.sent(),[4,t().loadHarnesses()];case 4:return a.sent(),[3,6];case 5:throw e({loading:!1,error:l4(r=a.sent())}),r;case 6:return[2]}})})()},logout:function(){return se(function(){return sr(this,function(t){switch(t.label){case 0:return[4,lQ("/api/auth/logout",{method:"POST"})];case 1:return t.sent(),e({authenticated:!1,currentUser:"",users:[],harnesses:[],backups:[],envFile:"",providers:null,doctor:null,doctorUpdatedAvailable:!1,drift:null}),[2]}})})()},loadUsers:function(){return se(function(){var t;return sr(this,function(n){switch(n.label){case 0:e({usersLoading:!0}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,lQ("/api/users")];case 2:return e({users:(t=n.sent()).items,currentUser:t.currentUser,usersLoading:!1}),[3,4];case 3:return e({usersLoading:!1,error:l4(n.sent())}),[3,4];case 4:return[2]}})})()},switchUser:function(n){return se(function(){var r;return sr(this,function(a){switch(a.label){case 0:if(!n||n===t().currentUser)return[2];e({usersLoading:!0,loading:!0,error:null}),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,lQ("/api/users/".concat(encodeURIComponent(n),"/select"),{method:"POST"})];case 2:return a.sent(),e({currentUser:n,harnesses:[],backups:[],envFile:"",providers:null,doctor:null,doctorUpdatedAvailable:!1,drift:null}),[4,t().loadUsers()];case 3:return a.sent(),[4,Promise.all([t().loadHarnesses(),t().loadBackups()])];case 4:return a.sent(),e({usersLoading:!1,loading:!1}),[3,6];case 5:throw e({usersLoading:!1,loading:!1,error:l4(r=a.sent())}),r;case 6:return[2]}})})()},loadHarnesses:function(){return se(function(){var n,r;return sr(this,function(a){switch(a.label){case 0:e({loading:!0,error:null}),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,lQ("/api/harnesses")];case 2:return e({harnesses:(n=a.sent()).items,envFile:n.envFile,loading:!1}),[4,t().loadDrift()];case 3:return a.sent(),[3,5];case 4:if(st(r=a.sent(),lH)&&401===r.status)return e({authenticated:!1,loading:!1,harnesses:[]}),[2];return e({loading:!1,error:l4(r)}),[3,5];case 5:return[2]}})})()},createProfile:function(e,n){return se(function(){return sr(this,function(r){switch(r.label){case 0:return[4,lQ(lB(e),{method:"POST",body:JSON.stringify(n)})];case 1:return r.sent(),[4,t().loadHarnesses()];case 2:return r.sent(),[2]}})})()},updateProfile:function(e,n,r){return se(function(){return sr(this,function(a){switch(a.label){case 0:return[4,lQ(lK(e,n),{method:"PATCH",body:JSON.stringify(r)})];case 1:return a.sent(),[4,t().loadHarnesses()];case 2:return a.sent(),[2]}})})()},deleteProfile:function(e,n){return se(function(){return sr(this,function(r){switch(r.label){case 0:return[4,lQ(lK(e,n),{method:"DELETE"})];case 1:return r.sent(),[4,t().loadHarnesses()];case 2:return r.sent(),[2]}})})()},activateProfile:function(n,r){return se(function(){var a,o,i,l;return sr(this,function(s){switch(s.label){case 0:return[4,lQ("".concat(lK(n,r),"/activate"),{method:"POST"})];case 1:return i=s.sent(),l=null!=(a=null==(o=t().harnesses.find(function(e){return e.id===n}))?void 0:o.label)?a:n,e({notice:[sa("notice.activated",t().currentUser,{harness:l,profile:r}),{key:"notice.activatedHint"}].concat(sn(i.warnings.map(l2)))}),[4,t().loadHarnesses()];case 2:return s.sent(),[2]}})})()},activateOfficial:function(n){return se(function(){var r,a,o,i;return sr(this,function(l){switch(l.label){case 0:return[4,lQ("/api/harnesses/".concat(n,"/official/activate"),{method:"POST"})];case 1:return o=l.sent(),i=null!=(r=null==(a=t().harnesses.find(function(e){return e.id===n}))?void 0:a.label)?r:n,e({notice:[sa("notice.officialRestored",t().currentUser,{harness:i}),{key:"notice.officialHint"}].concat(sn(o.warnings.map(l2)))}),[4,t().loadHarnesses()];case 2:return l.sent(),[2]}})})()},previewProfile:function(e,t){return se(function(){return sr(this,function(n){switch(n.label){case 0:return[4,lQ("".concat(lK(e,t),"/preview"))];case 1:return[2,n.sent().targets]}})})()},loadBackups:function(){return se(function(){var t;return sr(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,lQ(lV())];case 1:return e({backups:n.sent().items}),[3,3];case 2:return st(t=n.sent(),lH)&&401===t.status||e({error:l4(t)}),[3,3];case 3:return[2]}})})()},loadBackupDetail:function(e){return se(function(){return sr(this,function(t){return[2,lQ(lV(e))]})})()},restoreBackup:function(n){return se(function(){return sr(this,function(r){switch(r.label){case 0:return[4,lQ("".concat(lV(n),"/restore"),{method:"POST"})];case 1:return r.sent(),e({notice:[{key:"backup.written"}]}),[4,Promise.all([t().loadHarnesses(),t().loadBackups()])];case 2:return r.sent(),[2]}})})()},loadProviders:function(){return se(function(){var t;return sr(this,function(n){switch(n.label){case 0:e({providersLoading:!0,providersError:null}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,lQ(lW())];case 2:return e({providers:n.sent().items,providersLoading:!1}),[3,4];case 3:if(st(t=n.sent(),lH)&&401===t.status)return e({authenticated:!1,providersLoading:!1,providers:[]}),[2];return e({providersLoading:!1,providersError:l4(t)}),[3,4];case 4:return[2]}})})()},createProvider:function(e){return se(function(){return sr(this,function(n){switch(n.label){case 0:return[4,lQ(lW(),{method:"POST",body:JSON.stringify(e)})];case 1:return n.sent(),[4,t().loadProviders()];case 2:return n.sent(),[2]}})})()},updateProvider:function(e,n){return se(function(){var r;return sr(this,function(a){switch(a.label){case 0:return[4,lQ(lq(e),{method:"PATCH",body:JSON.stringify(n)})];case 1:return r=a.sent(),[4,t().loadProviders()];case 2:return a.sent(),[4,t().loadHarnesses()];case 3:return a.sent(),[4,t().loadDrift()];case 4:return a.sent(),[2,r]}})})()},deleteProvider:function(e){return se(function(){return sr(this,function(n){switch(n.label){case 0:return[4,lQ(lq(e),{method:"DELETE"})];case 1:return n.sent(),[4,t().loadProviders()];case 2:return n.sent(),[2]}})})()},revealProvider:function(e){return se(function(){return sr(this,function(t){return[2,lQ("".concat(lq(e),"/reveal"))]})})()},probeDraft:function(e){return se(function(){return sr(this,function(t){switch(t.label){case 0:return[4,lQ("/api/probe",{method:"POST",body:JSON.stringify(e)})];case 1:return[2,t.sent().result]}})})()},probeProfile:function(e,t){return se(function(){return sr(this,function(n){switch(n.label){case 0:return[4,lQ("".concat(lK(e,t),"/probe"),{method:"POST",body:JSON.stringify({})})];case 1:return[2,n.sent().result]}})})()},probeVaultEntry:function(e,t){return se(function(){return sr(this,function(n){switch(n.label){case 0:return[4,lQ("".concat(lq(e),"/probe"),{method:"POST",body:JSON.stringify(t?{endpoint:t}:{})})];case 1:return[2,n.sent().result]}})})()},loadDoctor:function(n){return se(function(){var r,a,o;return sr(this,function(i){switch(i.label){case 0:e({doctorLoading:!0,doctorError:null}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,lQ(n?"/api/doctor?harness=".concat(encodeURIComponent(n)):"/api/doctor")];case 2:return a=i.sent(),e({doctor:sn((null!=(r=t().doctor)?r:[]).filter(function(e){return e.harness!==n})).concat(sn(a.items.filter(function(e){return e.harness===n}))),doctorUpdatedAvailable:a.updatedAvailable,doctorLoading:!1}),[3,4];case 3:if(st(o=i.sent(),lH)&&401===o.status)return e({authenticated:!1,doctorLoading:!1,doctor:[]}),[2];return e({doctorLoading:!1,doctorError:l4(o)}),[3,4];case 4:return[2]}})})()},loadDrift:function(){return se(function(){var t,n;return sr(this,function(r){switch(r.label){case 0:e({driftLoading:!0,driftError:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,lQ(lZ())];case 2:return e({drift:null!=(t=r.sent().items)?t:[],driftLoading:!1}),[3,4];case 3:if(st(n=r.sent(),lH)&&401===n.status)return e({authenticated:!1,driftLoading:!1,drift:[]}),[2];return e({driftLoading:!1,driftError:l4(n)}),[3,4];case 4:return[2]}})})()},reapplyDrift:function(n){return se(function(){var r,a,o;return sr(this,function(i){switch(i.label){case 0:return[4,lQ("".concat(lZ(n),"/reapply"),{method:"POST"})];case 1:return o=i.sent(),e({notice:[{key:"drift.reapplied",params:{harness:null!=(r=null==(a=t().harnesses.find(function(e){return e.id===n}))?void 0:a.label)?r:n}}]}),[4,t().loadDrift()];case 2:return i.sent(),[2,o.files]}})})()},adoptDrift:function(n){return se(function(){var r,a,o;return sr(this,function(i){switch(i.label){case 0:return[4,lQ("".concat(lZ(n),"/adopt"),{method:"POST"})];case 1:return o=i.sent(),e({notice:[{key:"drift.adopted",params:{harness:null!=(r=null==(a=t().harnesses.find(function(e){return e.id===n}))?void 0:a.label)?r:n}}]}),[4,t().loadHarnesses()];case 2:return i.sent(),[2,o]}})})()},loadScan:function(){return se(function(){var t;return sr(this,function(n){switch(n.label){case 0:e({scanLoading:!0,scanError:null}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,lQ(lJ())];case 2:return e({scan:n.sent().items,scanLoading:!1}),[3,4];case 3:if(st(t=n.sent(),lH)&&401===t.status)return e({authenticated:!1,scanLoading:!1,scan:[]}),[2];return e({scanLoading:!1,scanError:l4(t)}),[3,4];case 4:return[2]}})})()},importScan:function(e){return se(function(){var n;return sr(this,function(r){switch(r.label){case 0:return[4,lQ("".concat(lJ(),"/import"),{method:"POST",body:JSON.stringify({selections:e})})];case 1:return n=r.sent(),[4,Promise.all([t().loadHarnesses(),t().loadProviders(),t().loadScan()])];case 2:return r.sent(),[2,n]}})})()},loadOperations:function(n){return se(function(){var r,a,o;return sr(this,function(i){switch(i.label){case 0:e({operationsLoading:!0,operationsError:null}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,lQ(lG(n))];case 2:return a=i.sent(),e({operations:sn((null!=(r=t().operations)?r:[]).filter(function(e){return e.harness!==n})).concat(sn(a.items.filter(function(e){return e.harness===n}))),operationsLoading:!1}),[3,4];case 3:if(st(o=i.sent(),lH)&&401===o.status)return e({authenticated:!1,operationsLoading:!1,operations:[]}),[2];return e({operationsLoading:!1,operationsError:l4(o)}),[3,4];case 4:return[2]}})})()},undoOperation:function(n){return se(function(){var r,a,o;return sr(this,function(i){switch(i.label){case 0:return[4,lQ("".concat(lG(),"/").concat(encodeURIComponent(n),"/undo"),{method:"POST"})];case 1:return o=i.sent().receipt,e({notice:[{key:"operations.undone",params:{harness:null!=(r=null==(a=t().harnesses.find(function(e){return e.id===o.harness}))?void 0:a.label)?r:o.harness}}]}),[4,Promise.all([t().loadHarnesses(),t().loadBackups(),t().loadOperations(o.harness)])];case 2:return i.sent(),[2]}})})()},setNotice:function(t){return e({notice:t})},clearNotice:function(){return e({notice:null})}}},l8(r)),Object.assign(n=e=>(function(e,t=e=>e){let n=y.useSyncExternalStore(e.subscribe,y.useCallback(()=>t(e.getState()),[e,t]),y.useCallback(()=>t(e.getInitialState()),[e,t]));return y.useDebugValue(n),n})(t,e),t),n);function si(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return si(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return si(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ss(e){var t,n=e.harnessId,r=(0,x.s9)().locale,a=(0,x.Bd)().t,o=so(function(e){return e.backups}),i=so(function(e){return e.loadBackups}),l=so(function(e){return e.loadBackupDetail}),s=so(function(e){return e.restoreBackup}),u=sl((0,y.useState)(!1),2),c=u[0],d=u[1],f=sl((0,y.useState)(null),2),p=f[0],h=f[1],m=sl((0,y.useState)(null),2),v=m[0],b=m[1],w=sl((0,y.useState)(null),2),k=w[0],j=w[1],S=sl((0,y.useState)(!1),2),O=S[0],C=S[1],N=o.filter(function(e){return e.harness===n}),P=null!=(t=o.find(function(e){return e.id===p}))?t:null,E=M[n];return(0,y.useEffect)(function(){i()},[i]),(0,y.useEffect)(function(){d(!1),h(null)},[n]),(0,y.useEffect)(function(){if(!p){b(null),j(null),C(!1);return}var e=!1;return b(null),j(null),C(!0),l(p).then(function(t){e||b(t)}).catch(function(t){e||j(l3(t,"backup.diffFailed"))}).finally(function(){e||C(!1)}),function(){e=!0}},[p,l]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(or,{className:"w-full justify-between",size:"sm",variant:"outline",onClick:function(){return d(!0)},children:[(0,g.jsx)(rN,{}),a("backup.history"),N.length>0?(0,g.jsx)(aR,{variant:"secondary",children:N.length}):null]}),(0,g.jsx)(ll,{open:c,onOpenChange:d,children:(0,g.jsxs)(l_,{className:"max-w-xl",children:[(0,g.jsxs)(lz,{children:[(0,g.jsx)(lA,{children:a("backup.historyTitle",{harness:E})}),(0,g.jsx)(lR,{children:a("backup.historyIntro")})]}),0===N.length?(0,g.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:a("backup.empty")}):(0,g.jsx)("ul",{className:"max-h-80 divide-y overflow-y-auto rounded-xl border",children:N.map(function(e){var t,n,o;return(0,g.jsxs)("li",{className:"flex items-center gap-3 px-3 py-2.5 hover:bg-muted/30",children:[(0,g.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,g.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,g.jsx)("p",{className:"truncate text-sm font-medium",children:e.profile}),e.current?(0,g.jsx)(aR,{children:a("backup.currentBadge")}):null]}),(0,g.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[(t=e.createdAt,n=r,Number.isNaN((o=new Date(t)).getTime())?t:o.toLocaleString(n))," \xb7"," ",a("backup.fileCount",{count:e.files.length}),e.files.some(function(e){return!e.existed})?" \xb7 ".concat(a("backup.withDeletions")):""]})]}),e.current?null:(0,g.jsx)(or,{size:"sm",variant:"outline",className:"shrink-0",onClick:function(){return h(e.id)},children:a("backup.restore")})]},e.id)})})]})}),(0,g.jsx)(ll,{open:null!==P,onOpenChange:function(e){return!e&&h(null)},children:(0,g.jsxs)(l_,{className:"flex max-h-[85vh] w-[min(64rem,calc(100vw-2rem))] max-w-5xl flex-col overflow-hidden",children:[(0,g.jsxs)(lz,{children:[(0,g.jsx)(lA,{children:a("backup.restoreHistoryTitle")}),(0,g.jsx)(lR,{children:a("backup.restoreHistoryBody")})]}),(0,g.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[O?(0,g.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:a("backup.comparing")}):null,k?(0,g.jsx)("p",{className:"py-8 text-center text-sm text-destructive",children:l6(a,k)}):null,v?(0,g.jsx)(aH,{files:v.files}):null]}),(0,g.jsxs)(lT,{children:[(0,g.jsx)(or,{variant:"outline",onClick:function(){return h(null)},children:a("common.cancel")}),(0,g.jsx)(or,{disabled:O||null!==k||null===v,onClick:function(){p&&s(p).then(function(){h(null),d(!1)})},children:a("backup.confirmRestore")})]})]})})]})}let su=O("stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]),sc=O("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]),sd=O("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);var sf={ok:"bg-emerald-500",warn:"bg-amber-500",error:"bg-red-500",unknown:"bg-slate-400"};function sp(e){var t,n=e.harnessId,r=e.open,a=e.onOpenChange,o=(0,x.Bd)().t,i=so(function(e){return e.doctor}),l=so(function(e){return e.doctorLoading}),s=so(function(e){return e.doctorError}),u=so(function(e){return e.doctorUpdatedAvailable}),c=so(function(e){return e.loadDoctor}),d=null!=(t=null==i?void 0:i.find(function(e){return e.harness===n}))?t:null;(0,y.useEffect)(function(){r&&null===d&&c(n)},[r,d,n,c]);var f=function(e){var t={ok:0,warn:0,error:0,unknown:0};if(!e)return t;var n=!0,r=!1,a=void 0;try{for(var o,i=e.checks[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var l=o.value;t[l.status]++}}catch(e){r=!0,a=e}finally{try{n||null==i.return||i.return()}finally{if(r)throw a}}return t}(d),p=M[n];return(0,g.jsx)(ll,{open:r,onOpenChange:a,children:(0,g.jsxs)(l_,{className:"flex max-h-[88vh] flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl",children:[(0,g.jsxs)(lz,{className:"shrink-0 space-y-1.5 px-6 pb-4 pt-6 pr-12",children:[(0,g.jsx)(lA,{children:o("doctor.titleFor",{harness:p})}),(0,g.jsx)(lR,{children:o("doctor.intro")})]}),(0,g.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-contain px-6",children:[l&&null===d?(0,g.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:o("doctor.checking")}):null,s?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(o,s)}):null,d?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[f.ok>0?(0,g.jsx)(aR,{variant:"secondary",children:o("doctor.countOk",{count:f.ok})}):null,f.warn>0?(0,g.jsx)(aR,{variant:"outline",className:"border-amber-500/30 text-amber-700 dark:text-amber-300",children:o("doctor.countWarn",{count:f.warn})}):null,f.error>0?(0,g.jsx)(aR,{variant:"destructive",children:o("doctor.countError",{count:f.error})}):null,f.unknown>0?(0,g.jsx)(aR,{variant:"outline",children:o("doctor.countUnknown",{count:f.unknown})}):null,u?(0,g.jsxs)("span",{className:"ml-auto flex items-center gap-1 text-xs text-emerald-600 dark:text-emerald-400",children:[(0,g.jsx)(sd,{className:"size-3.5"}),o("doctor.updateAvailable")]}):null]}),(0,g.jsx)(sh,{checks:d.checks})]}):null,null!==d||l||s?null:(0,g.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:o("doctor.notRun")})]}),(0,g.jsxs)(lT,{className:"shrink-0 px-6 py-4",children:[(0,g.jsxs)(or,{variant:"outline",disabled:l,onClick:function(){c(n)},children:[(0,g.jsx)(sc,{className:l?"animate-spin":void 0}),o("doctor.rerun")]}),(0,g.jsx)(or,{onClick:function(){return a(!1)},children:o("doctor.close")})]})]})})}function sh(e){var t=e.checks,n=(0,x.Bd)().t;return 0===t.length?(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:n("doctor.noChecks")}):(0,g.jsx)("ul",{className:"divide-y rounded-xl border",children:t.map(function(e){var t;return(0,g.jsxs)("li",{className:"flex items-start gap-3 px-3 py-2.5",children:[(0,g.jsx)("span",{className:aT("mt-1.5 size-2 shrink-0 rounded-full",sf[e.status]),"aria-hidden":!0}),(0,g.jsx)("div",{className:"min-w-0 flex-1",children:(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[(0,g.jsx)("p",{className:"text-sm leading-relaxed",children:l6(n,{key:null!=(t=e.code)?t:"doctor.unknownCheck",params:e.params,fallback:e.label})}),(0,g.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:n("doctor.status.".concat(e.status))})]})})]},e.id)})})}var sm=Object.defineProperty,sg=(e,t)=>sm(e,"name",{value:t,configurable:!0}),[sy,sv]=of("AlertDialog",[la]),sb=la(),sx=sg(e=>{let{__scopeAlertDialog:t,...n}=e,r=sb(t);return(0,g.jsx)(ll,{...r,...n,modal:!0})},"AlertDialog");y.forwardRef(sg(function(e,t){let{__scopeAlertDialog:n,...r}=e,a=sb(n);return(0,g.jsx)(ls,{...a,...r,ref:t})},"AlertDialogTrigger"));var sw=sg(e=>{let{__scopeAlertDialog:t,...n}=e,r=sb(t);return(0,g.jsx)(lf,{...r,...n})},"AlertDialogPortal"),sk=y.forwardRef(sg(function(e,t){let{__scopeAlertDialog:n,...r}=e,a=sb(n);return(0,g.jsx)(lh,{...a,...r,ref:t})},"AlertDialogOverlay")),[sj,sS]=sy("AlertDialogContent"),sO=y.forwardRef(sg(function(e,t){let{__scopeAlertDialog:n,children:r,...a}=e,o=sb(n),i=aG(t,y.useRef(null)),l=y.useRef(null);return(0,g.jsx)(sj,{scope:n,cancelRef:l,children:(0,g.jsx)(lv,{role:"alertdialog",...o,...a,ref:i,onOpenAutoFocus:ol(a.onOpenAutoFocus,e=>{e.preventDefault(),l.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},"AlertDialogContent")),sC=y.forwardRef(sg(function(e,t){let{__scopeAlertDialog:n,...r}=e,a=sb(n);return(0,g.jsx)(lk,{...a,...r,ref:t})},"AlertDialogTitle")),sN=y.forwardRef(sg(function(e,t){let{__scopeAlertDialog:n,...r}=e,a=sb(n);return(0,g.jsx)(lj,{...a,...r,ref:t})},"AlertDialogDescription")),sP=y.forwardRef(sg(function(e,t){let{__scopeAlertDialog:n,...r}=e,a=sb(n);return(0,g.jsx)(lS,{...a,...r,ref:t})},"AlertDialogAction")),sE=y.forwardRef(sg(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=sS("AlertDialogCancel",n),o=sb(n),i=aG(t,a);return(0,g.jsx)(lS,{...o,...r,ref:i})},"AlertDialogCancel"));function s_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function sz(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}function sT(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsx)(sk,s_({"data-slot":"alert-dialog-overlay",className:aT("fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t)},n))}function sA(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsxs)(sw,{children:[(0,g.jsx)(sT,{}),(0,g.jsx)(sO,s_({"data-slot":"alert-dialog-content",className:aT("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-card p-6 shadow-2xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-2xl",t)},n))]})}function sR(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsx)("div",s_({className:aT("flex flex-col space-y-2 text-center sm:text-left",t)},n))}function sL(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsx)("div",s_({className:aT("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},n))}function sI(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsx)(sC,s_({className:aT("text-lg font-semibold",t)},n))}function sM(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsx)(sN,s_({className:aT("text-sm text-muted-foreground",t)},n))}function sD(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsx)(sP,s_({className:aT(on(),t)},n))}function sF(e){var t=e.className,n=sz(e,["className"]);return(0,g.jsx)(sE,s_({className:aT(on({variant:"outline"}),"mt-2 sm:mt-0",t)},n))}function s$(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sU(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s$(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s$(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sH(e){switch(e){case"in-sync":return"border-transparent bg-emerald-500/15 text-emerald-600 dark:text-emerald-400";case"drifted":return"border-amber-500/30 text-amber-700 dark:text-amber-300";case"missing":case"invalid":return"border-transparent bg-destructive/15 text-destructive";default:return""}}function sB(e){var t,n=e.harness,r=e.open,a=e.onOpenChange,o=(0,x.Bd)().t,i=so(function(e){return e.drift}),l=so(function(e){return e.driftLoading}),s=so(function(e){return e.reapplyDrift}),u=so(function(e){return e.adoptDrift}),c=sU((0,y.useState)(null),2),d=c[0],f=c[1],p=sU((0,y.useState)(null),2),h=p[0],m=p[1],v=(0,y.useMemo)(function(){var e;return null!=(e=null==i?void 0:i.find(function(e){return e.harness===n.id}))?e:null},[i,n.id]),b=null!=(t=null==v?void 0:v.files.filter(function(e){return"in-sync"!==e.status}))?t:[],w=(null==v?void 0:v.active)===!0;return(0,g.jsxs)(ll,{open:r,onOpenChange:a,children:[(0,g.jsxs)(l_,{className:"flex max-h-[85vh] w-[min(64rem,calc(100vw-2rem))] max-w-5xl flex-col overflow-hidden",children:[(0,g.jsxs)(lz,{children:[(0,g.jsx)(lA,{children:o("drift.dialogTitle",{harness:n.label})}),(0,g.jsx)(lR,{children:o(w?"drift.legend":"drift.noActiveProfile")})]}),(0,g.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[l&&null===v?(0,g.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:o("drift.checking")}):null,null!==v||l?null:(0,g.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:o("drift.noData")}),v&&!w?(0,g.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:o("drift.nothingToCompare")}):null,v&&w?(0,g.jsx)("div",{className:"space-y-3",children:0===b.length?(0,g.jsx)("p",{className:"py-4 text-center text-sm text-muted-foreground",children:o("drift.allInSync")}):b.map(function(e){return(0,g.jsx)(sK,{file:e},e.key)})}):null]}),h?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(o,h)}):null,(0,g.jsxs)(lT,{children:[(0,g.jsx)(or,{variant:"outline",disabled:null===v||!w,onClick:function(){return f("adopt")},children:o("drift.adopt")}),(0,g.jsx)(or,{disabled:null===v||!w,onClick:function(){return f("reapply")},children:o("drift.reapply")})]})]}),(0,g.jsx)(sx,{open:"reapply"===d,onOpenChange:function(e){return!e&&f(null)},children:(0,g.jsxs)(sA,{children:[(0,g.jsxs)(sR,{children:[(0,g.jsx)(sI,{children:o("drift.reapplyTitle")}),(0,g.jsx)(sM,{children:o("drift.reapplyBody",{harness:n.label})})]}),(0,g.jsxs)(sL,{children:[(0,g.jsx)(sF,{children:o("common.cancel")}),(0,g.jsx)(sD,{onClick:function(){f(null),m(null),s(n.id).then(function(){return a(!1)}).catch(function(e){m(l3(e,"drift.reapplyFailed"))})},children:o("drift.confirmReapply")})]})]})}),(0,g.jsx)(sx,{open:"adopt"===d,onOpenChange:function(e){return!e&&f(null)},children:(0,g.jsxs)(sA,{children:[(0,g.jsxs)(sR,{children:[(0,g.jsx)(sI,{children:o("drift.adoptTitle")}),(0,g.jsx)(sM,{children:o("drift.adoptBody")})]}),(0,g.jsxs)(sL,{children:[(0,g.jsx)(sF,{children:o("common.cancel")}),(0,g.jsx)(sD,{onClick:function(){f(null),m(null),u(n.id).then(function(){return a(!1)}).catch(function(e){m(l3(e,"drift.adoptFailed"))})},children:o("drift.confirmAdopt")})]})]})})]})}function sK(e){var t=e.file,n=(0,x.Bd)().t;return(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,g.jsx)(aR,{className:sH(t.status),children:n("drift.status.".concat(t.status))}),(0,g.jsx)("p",{className:"min-w-0 truncate font-mono text-xs text-muted-foreground",title:t.path,children:t.path})]}),(0,g.jsx)(aH,{files:[{path:t.path,existed:null!==t.currentContent,content:t.expectedContent,currentContent:t.currentContent}]})]})}function sV(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sW(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return sV(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sV(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sq(e){var t,n,r,a=e.harness,o=(0,x.Bd)().t,i=so(function(e){return e.doctor}),l=so(function(e){return e.doctorLoading}),s=so(function(e){return e.doctorError}),u=so(function(e){return e.loadDoctor}),c=so(function(e){return e.drift}),d=so(function(e){return e.driftLoading}),f=so(function(e){return e.driftError}),p=so(function(e){return e.loadDrift}),h=sW((0,y.useState)(!1),2),m=h[0],v=h[1],b=sW((0,y.useState)(!1),2),w=b[0],k=b[1],j=null!=(t=null==i?void 0:i.find(function(e){return e.harness===a.id}))?t:null,S=null!=(n=null==c?void 0:c.find(function(e){return e.harness===a.id}))?n:null,O=null!=(r=null==S?void 0:S.files.filter(function(e){return"in-sync"!==e.status}))?r:[],C=null!==S&&S.active&&O.length>0&&"in-sync"!==S.status;return(0,y.useEffect)(function(){u(a.id)},[a.id,u]),(0,y.useEffect)(function(){null===c&&p()},[c,p]),(0,g.jsxs)("section",{className:"rounded-2xl border bg-card p-5 shadow-[0_12px_34px_-28px_rgb(36_39_70/0.38)]",children:[(0,g.jsxs)("div",{className:"flex items-center gap-2",children:[(0,g.jsx)(su,{className:"size-4 text-primary"}),(0,g.jsx)("h3",{className:"font-semibold",children:o("doctor.title")}),(0,g.jsx)("span",{className:"ml-auto",children:(0,g.jsx)(or,{size:"icon",variant:"ghost","aria-label":o("doctor.rerun"),onClick:function(){u(a.id),p()},children:(0,g.jsx)(sc,{className:l||d?"animate-spin":void 0})})})]}),(0,g.jsxs)("div",{className:"mt-4 space-y-3",children:[s?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(o,s)}):null===j?(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:o("doctor.checking")}):(0,g.jsx)(sZ,{report:j}),f?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(o,f)}):null===S?(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:o("drift.checking")}):(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(sJ,{report:S}),O.length>0?(0,g.jsxs)("ul",{className:"space-y-1",children:[O.slice(0,3).map(function(e){return(0,g.jsxs)("li",{className:"flex items-center gap-2 text-xs",children:[(0,g.jsx)("span",{className:"size-1.5 shrink-0 rounded-full bg-destructive/70"}),(0,g.jsx)("span",{className:"truncate font-mono text-muted-foreground",children:e.path.split("/").pop()}),(0,g.jsx)("span",{className:"ml-auto shrink-0 font-mono text-[11px] text-muted-foreground",children:o("drift.status.".concat(e.status))})]},e.key)}),O.length>3?(0,g.jsx)("li",{className:"pl-3.5 text-xs text-muted-foreground",children:o("drift.moreFiles",{count:O.length-3})}):null]}):null]})]}),(0,g.jsxs)("div",{className:"mt-4 grid gap-2 ".concat(C?"grid-cols-2":"grid-cols-1"),children:[(0,g.jsx)(or,{size:"sm",variant:"outline",disabled:null===j,onClick:function(){return v(!0)},children:o("doctor.viewDetails")}),C?(0,g.jsx)(or,{size:"sm",variant:"outline",onClick:function(){return k(!0)},children:o("drift.viewDiff")}):null]}),(0,g.jsx)(sp,{harnessId:a.id,open:m,onOpenChange:v}),(0,g.jsx)(sB,{harness:a,open:w,onOpenChange:k})]})}function sZ(e){var t=e.report,n=(0,x.Bd)().t,r=function(e){var t={ok:0,warn:0,error:0,unknown:0},n=!0,r=!1,a=void 0;try{for(var o,i=e.checks[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var l=o.value;t[l.status]++}}catch(e){r=!0,a=e}finally{try{n||null==i.return||i.return()}finally{if(r)throw a}}return t}(t),a=["error","warn","ok","unknown"].filter(function(e){return r[e]>0});return 0===a.length?(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:n("doctor.noChecks")}):(0,g.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(function(e){var t,a;return(0,g.jsx)(aR,{variant:"error"===(t=e)?"destructive":"ok"===t?"secondary":"outline",className:"warn"===e?"border-amber-500/30 text-amber-700 dark:text-amber-300":void 0,children:n("doctor.count".concat((a=e,"".concat(a[0].toUpperCase()).concat(a.slice(1)))),{count:r[e]})},e)})})}function sJ(e){var t=e.report,n=(0,x.Bd)().t;if(!t.active)return(0,g.jsx)(aR,{variant:"secondary",children:n("harness.inactive")});if("in-sync"===t.status)return(0,g.jsx)(aR,{variant:"secondary",children:n("drift.none")});if("drifted"===t.status){var r=t.files.filter(function(e){return"in-sync"!==e.status}).length;return(0,g.jsx)(aR,{variant:"outline",className:"border-amber-500/30 text-amber-700 dark:text-amber-300",children:n("drift.mismatch",{count:r})})}return(0,g.jsx)(aR,{className:sH(t.status),children:n("drift.status.".concat(t.status))})}let sG=O("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),sQ=O("circle-user-round",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),sY=O("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),sX=O("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),s0=O("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);function s1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s2(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s1(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s4(e){var t,n=e.harness,r=e.profile,a=e.open,o=e.onOpenChange,i=(0,x.Bd)().t,l=so(function(e){return e.previewProfile}),s=so(function(e){return e.activateProfile}),u=so(function(e){return e.currentUser}),c=s2((0,y.useState)(null),2),d=c[0],f=c[1],p=s2((0,y.useState)(null),2),h=p[0],m=p[1];(0,y.useEffect)(function(){if(a){var e=!1;return f(null),m(null),l(n.id,r.name).then(function(t){e||f(t)}).catch(function(t){e||m(l4(t))}),function(){e=!0}}},[a,n.id,r.name,l]);var v=null!=(t=null==d?void 0:d.map(function(e){return{path:e.path,existed:null!==e.currentContent,content:e.content,currentContent:e.currentContent}}))?t:[],b=v.filter(function(e){return"same"!==aU(e)}).length;return(0,g.jsx)(sx,{open:a,onOpenChange:o,children:(0,g.jsxs)(sA,{className:"max-h-[85dvh] overflow-y-auto sm:max-w-2xl",children:[(0,g.jsxs)(sR,{children:[(0,g.jsx)(sI,{children:i("activate.title")}),(0,g.jsx)(sM,{children:i("activate.body",{harness:n.label,profile:r.name,changed:b>0?i("activate.changedFiles",{count:b}):"",user:u||i("notice.currentUser")})})]}),h?(0,g.jsx)("p",{className:"text-sm text-destructive",children:i("activate.loadFailed",{reason:l6(i,h)})}):null===d?(0,g.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:i("activate.loading")}):(0,g.jsx)("div",{className:"max-h-[52dvh] overflow-y-auto rounded-xl border p-3",children:(0,g.jsx)(aH,{files:v})}),(0,g.jsxs)(sL,{children:[(0,g.jsx)(sF,{children:i("common.cancel")}),(0,g.jsx)(sD,{onClick:function(){s(n.id,r.name),o(!1)},children:i("activate.confirm")})]})]})})}function s3(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function s5(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}function s6(e){var t=e.className,n=s5(e,["className"]);return(0,g.jsx)("div",s3({"data-slot":"card",className:aT("rounded-2xl border bg-card text-card-foreground shadow-[0_12px_34px_-26px_rgb(36_39_70/0.38)]",t)},n))}function s8(e){var t=e.className,n=s5(e,["className"]);return(0,g.jsx)("div",s3({"data-slot":"card-title",className:aT("font-semibold leading-none tracking-tight",t)},n))}function s9(e){var t=e.className,n=s5(e,["className"]);return(0,g.jsx)("div",s3({"data-slot":"card-description",className:aT("text-sm text-muted-foreground",t)},n))}function s7(e){var t=e.className,n=s5(e,["className"]);return(0,g.jsx)("div",s3({"data-slot":"card-content",className:aT("p-5 pt-0",t)},n))}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ut(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ue(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function un(e){var t,n,r,a,o,i,l,s,u,c=e.harness,d=e.onAdd,f=e.onEdit,p=e.extraActions,h=(0,x.Bd)().t,m=so(function(e){return e.activateOfficial}),v=so(function(e){return e.deleteProfile}),b=ut((0,y.useState)(null),2),w=b[0],k=b[1],j=ut((0,y.useState)(null),2),S=j[0],O=j[1],C=(null==(r=c.active)?void 0:r.official)?h("harness.official"):null!=(t=null==(a=c.active)?void 0:a.name)?t:null;return(0,g.jsxs)("div",{className:"space-y-6",children:[(0,g.jsx)(s6,{className:"overflow-hidden border-primary/10",children:(0,g.jsxs)(s7,{className:"p-5 sm:p-6",children:[(0,g.jsxs)("div",{className:"grid gap-5 sm:grid-cols-[minmax(0,1fr)_minmax(15rem,0.85fr)] sm:divide-x",children:[(0,g.jsxs)("div",{className:"min-w-0 sm:pr-5",children:[(0,g.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,g.jsx)("span",{className:"size-2 rounded-full bg-primary shadow-[0_0_0_4px_rgb(99_91_255/0.1)]"}),h("harness.activeConfig")]}),(0,g.jsx)(s8,{className:"mt-3 truncate text-xl",children:null===C?h("harness.inactive"):h("harness.activeNamed",{name:C})}),(0,g.jsx)(s9,{className:"mt-1",children:null===C?h("harness.currentInactive"):h("harness.current",{name:C})})]}),(0,g.jsxs)("div",{className:"min-w-0 sm:pl-5",children:[(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:h("harness.writeTargets")}),(0,g.jsx)("p",{className:"mt-3 truncate font-mono text-sm",children:null!=(n=null==(o=c.targets[0])?void 0:o.path)?n:h("harness.noTargetFile")}),c.targets.length>1?(0,g.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:h("harness.moreFiles",{count:c.targets.length-1})}):null]})]}),(0,g.jsxs)("div",{className:"mt-5 flex items-start gap-3 border-t pt-4 text-sm text-muted-foreground",children:[(0,g.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/[0.08] text-primary",children:(0,g.jsx)(sG,{className:"size-4"})}),(0,g.jsx)("p",{className:"pt-1 leading-relaxed",children:h("harness.overwriteWarning")})]})]})}),(0,g.jsxs)("section",{children:[(0,g.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("h3",{className:"text-sm font-semibold",children:h("harness.profiles")}),(0,g.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:h("harness.profileCount",{count:c.profiles.length})})]}),p]}),(0,g.jsxs)("div",{className:"space-y-3",children:[c.supportsOfficialAuth?(0,g.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-xl border bg-card px-4 py-4 shadow-[0_10px_28px_-26px_rgb(36_39_70/0.38)]",children:[(0,g.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,g.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-muted text-muted-foreground",children:(0,g.jsx)(sQ,{className:"size-4"})}),(0,g.jsxs)("div",{className:"min-w-0",children:[(0,g.jsxs)("div",{className:"flex items-center gap-2",children:[(0,g.jsx)("p",{className:"font-medium",children:h("harness.official")}),(null==(i=c.active)?void 0:i.official)?(0,g.jsx)(aR,{variant:"secondary",children:h("harness.active")}):null]}),(0,g.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"claude"===c.id?h("harness.officialHintClaude"):h("harness.officialHintCodex")})]})]}),(0,g.jsx)(or,{size:"sm",variant:(null==(l=c.active)?void 0:l.official)?"secondary":"outline",disabled:null==(s=c.active)?void 0:s.official,onClick:function(){m(c.id)},children:(null==(u=c.active)?void 0:u.official)?h("harness.officialActive"):h("harness.officialSwitch")})]}):null,0===c.profiles.length?(0,g.jsxs)("div",{className:"rounded-xl border border-dashed bg-card/60 px-5 py-8 text-center",children:[(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:h("harness.noProfiles")}),(0,g.jsxs)(or,{className:"mt-4",size:"sm",onClick:d,children:[(0,g.jsx)(z,{}),h("harness.newProfile")]})]}):c.profiles.map(function(e){var t,n,r=(null==(t=c.active)?void 0:t.official)!==!0&&(null==(n=c.active)?void 0:n.name)===e.name;return(0,g.jsxs)("div",{className:aT("flex flex-col gap-4 rounded-xl border bg-card px-4 py-4 shadow-[0_10px_28px_-26px_rgb(36_39_70/0.38)] transition-[border-color,background-color,box-shadow] sm:flex-row sm:items-center sm:justify-between",r?"border-primary/20 bg-primary/[0.035] shadow-[0_12px_30px_-24px_rgb(99_91_255/0.35)]":"hover:border-primary/15 hover:bg-card/85"),children:[(0,g.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,g.jsx)("span",{className:aT("mt-2 size-2 shrink-0 rounded-full",r?"bg-primary":"bg-muted-foreground/30")}),(0,g.jsxs)("div",{className:"min-w-0",children:[(0,g.jsxs)("div",{className:"flex items-center gap-2",children:[(0,g.jsx)("p",{className:"font-medium",children:e.name}),r?(0,g.jsx)(aR,{children:h("harness.active")}):null,e.overriddenTargets.length>0?(0,g.jsx)(aR,{variant:"outline",children:h("harness.manualOverride")}):null]}),(0,g.jsx)("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",children:e.baseUrl}),e.model?(0,g.jsx)("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground",children:e.model}):null]})]}),(0,g.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5 self-end sm:self-auto",children:[(0,g.jsxs)(or,{size:"sm",variant:r?"secondary":"outline",onClick:function(){return O(e)},children:[r?null:(0,g.jsx)(sY,{}),r?h("harness.active"):h("harness.activate")]}),(0,g.jsx)(or,{size:"icon",variant:"ghost","aria-label":h("harness.edit",{name:e.name}),onClick:function(){return f(e)},children:(0,g.jsx)(sX,{})}),(0,g.jsx)(or,{size:"icon",variant:"ghost","aria-label":h("harness.delete",{name:e.name}),disabled:r,title:r?h("harness.deleteBlocked"):void 0,onClick:function(){return k(e.name)},children:(0,g.jsx)(s0,{className:r?void 0:"text-destructive"})})]})]},e.name)})]})]}),S?(0,g.jsx)(s4,{harness:c,profile:S,open:!0,onOpenChange:function(e){return!e&&O(null)}}):null,(0,g.jsx)(sx,{open:null!==w,onOpenChange:function(e){return!e&&k(null)},children:(0,g.jsxs)(sA,{children:[(0,g.jsxs)(sR,{children:[(0,g.jsx)(sI,{children:h("harness.deleteTitle")}),(0,g.jsx)(sM,{children:h("harness.deleteBody",{harness:c.label,profile:null!=w?w:"",extra:"additive"===c.mode?h("harness.deleteAdditiveExtra"):""})})]}),(0,g.jsxs)(sL,{children:[(0,g.jsx)(sF,{children:h("common.cancel")}),(0,g.jsx)(sD,{onClick:function(){w&&v(c.id,w)},children:h("common.delete")})]})]})})]})}function ur(e){return(ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var ua=["size","style"];function uo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ui(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uo(Object(n),!0).forEach(function(t){var r,a,o;r=e,a=t,o=n[t],(a=function(e){var t=function(e,t){if("object"!=ur(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ur(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ur(t)?t:String(t)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ul=(0,y.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,a=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,ua);return(0,g.jsxs)("svg",ui(ui({height:n,style:ui({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},a),{},{children:[(0,g.jsx)("title",{children:"Claude Code"}),(0,g.jsx)("path",{clipRule:"evenodd",d:"M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z",fill:"#D97757",fillRule:"evenodd"})]}))});let us=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;var uu=function(e){var t=(0,y.useId)(),n="lobe-icons-".concat(Array.from(e.match(us)??[]).map(e=>e.toLowerCase()).join("-"),"-").concat(t);return(0,y.useMemo)(function(){return{fill:"url(#".concat(n,")"),id:n}},[e])},uc="Codex";function ud(e){return(ud="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var uf=["size","style"];function up(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?up(Object(n),!0).forEach(function(t){var r,a,o;r=e,a=t,o=n[t],(a=function(e){var t=function(e,t){if("object"!=ud(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ud(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ud(t)?t:String(t)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):up(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var um=(0,y.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,a=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,uf),o=uu(uc),i=o.id,l=o.fill;return(0,g.jsxs)("svg",uh(uh({height:n,style:uh({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},a),{},{children:[(0,g.jsx)("title",{children:uc}),(0,g.jsx)("path",{d:"M19.503 0H4.496A4.496 4.496 0 000 4.496v15.007A4.496 4.496 0 004.496 24h15.007A4.496 4.496 0 0024 19.503V4.496A4.496 4.496 0 0019.503 0z",fill:"#fff"}),(0,g.jsx)("path",{d:"M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388zm3.482 10.565a.637.637 0 000 1.272h3.636a.637.637 0 100-1.272h-3.636zM8.462 9.23a.637.637 0 00-1.106.631l1.272 2.224-1.266 2.136a.636.636 0 101.095.649l1.454-2.455a.636.636 0 00.005-.64L8.462 9.23z",fill:l}),(0,g.jsx)("defs",{children:(0,g.jsxs)("linearGradient",{gradientUnits:"userSpaceOnUse",id:i,x1:"12",x2:"12",y1:"3",y2:"21",children:[(0,g.jsx)("stop",{stopColor:"#B1A7FF"}),(0,g.jsx)("stop",{offset:".5",stopColor:"#7A9DFF"}),(0,g.jsx)("stop",{offset:"1",stopColor:"#3941FF"})]})})]}))});function ug(e){return(ug="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var uy=["size","style"];function uv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ub(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uv(Object(n),!0).forEach(function(t){var r,a,o;r=e,a=t,o=n[t],(a=function(e){var t=function(e,t){if("object"!=ug(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ug(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ug(t)?t:String(t)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ux=(0,y.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,a=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,uy);return(0,g.jsxs)("svg",ub(ub({height:n,style:ub({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},a),{},{children:[(0,g.jsx)("title",{children:"DeepSeek"}),(0,g.jsx)("path",{d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z",fill:"#4D6BFE"})]}))});function uw(e){return(uw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var uk=["size","style"];function uj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uj(Object(n),!0).forEach(function(t){var r,a,o;r=e,a=t,o=n[t],(a=function(e){var t=function(e,t){if("object"!=uw(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=uw(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==uw(t)?t:String(t)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var uO=(0,y.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,a=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,uk);return(0,g.jsxs)("svg",uS(uS({fill:"currentColor",fillRule:"evenodd",height:n,style:uS({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},a),{},{children:[(0,g.jsx)("title",{children:"Kimi"}),(0,g.jsx)("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),(0,g.jsx)("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]}))});function uC(e){return(uC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var uN=["size","style"];function uP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uP(Object(n),!0).forEach(function(t){var r,a,o;r=e,a=t,o=n[t],(a=function(e){var t=function(e,t){if("object"!=uC(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=uC(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==uC(t)?t:String(t)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var u_={claude:ul,codex:um,kimi:uO,pi:(0,y.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,a=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,uN);return(0,g.jsxs)("svg",uE(uE({fill:"currentColor",fillRule:"evenodd",height:n,style:uE({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},a),{},{children:[(0,g.jsx)("title",{children:"Pi"}),(0,g.jsx)("path",{clipRule:"evenodd",d:"M1 1h16.5v11H12v5.5H6.5V23H1V1zm5.5 5.5V12H12V6.5H6.5z"}),(0,g.jsx)("path",{d:"M17.5 12H23v11h-5.5V12z"})]}))}),dsh:ux};function uz(e){var t=e.id,n=e.className,r=u_[t];return(0,g.jsx)(r,{"aria-hidden":!0,className:aT("size-5",n)})}let uT=O("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),uA=O("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);function uR(e){let[t,n]=y.useState(void 0);return oh(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,a;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(0,Object.defineProperty)(uR,"name",{value:"useSize",configurable:!0});var uL=Object.defineProperty,uI=(e,t)=>uL(e,"name",{value:t,configurable:!0}),uM="Checkbox",[uD,uF]=of(uM),[u$,uU]=uD(uM);function uH(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:o,form:i,name:l,onCheckedChange:s,required:u,value:c="on",internal_do_not_use_render:d}=e,[f,p]=oC({prop:n,defaultProp:a??!1,onChange:s,caller:uM}),[h,m]=y.useState(null),[v,b]=y.useState(null),x=y.useRef(!1),[w,k]=y.useReducer(e=>e+1,0),j=!h||!!i||!!h.closest("form"),S={checked:f,disabled:o,setChecked:p,control:h,setControl:m,name:l,form:i,value:c,hasConsumerStoppedPropagationRef:x,userInteractionCount:w,onUserInteraction:k,required:u,defaultChecked:!uZ(a)&&a,isFormControl:j,bubbleInput:v,setBubbleInput:b};return(0,g.jsx)(u$,{scope:t,...S,children:uq(d)?d(S):r})}uI(uH,"CheckboxProvider");var uB=y.forwardRef(uI(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a){let{control:o,value:i,disabled:l,checked:s,required:u,setControl:c,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:m}=uU("CheckboxTrigger",e),v=aG(a,c),b=y.useRef(s);return y.useEffect(()=>{let e=o?.form;if(e){let t=uI(()=>d(b.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[o,d]),(0,g.jsx)(oT.button,{type:"button",role:"checkbox","aria-checked":uZ(s)?"mixed":s,"aria-required":u,"data-state":uJ(s),"data-disabled":l?"":void 0,disabled:l,value:i,...r,ref:v,onKeyDown:ol(t,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:ol(n,e=>{p(),d(e=>!!uZ(e)||!e),m&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},"CheckboxTrigger")),uK=y.forwardRef(uI(function(e,t){let{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:i,disabled:l,value:s,onCheckedChange:u,form:c,...d}=e;return(0,g.jsx)(uH,{__scopeCheckbox:n,checked:a,defaultChecked:o,disabled:l,required:i,onCheckedChange:u,name:r,form:c,value:s,internal_do_not_use_render:({isFormControl:e})=>(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(uB,{...d,ref:t,__scopeCheckbox:n}),e&&(0,g.jsx)(uW,{__scopeCheckbox:n})]})})},"Checkbox")),uV=y.forwardRef(uI(function(e,t){let{__scopeCheckbox:n,forceMount:r,...a}=e,o=uU("CheckboxIndicator",n);return(0,g.jsx)(io,{present:r||uZ(o.checked)||!0===o.checked,children:(0,g.jsx)(oT.span,{"data-state":uJ(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),uW=y.forwardRef(uI(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:a,hasConsumerStoppedPropagationRef:o,userInteractionCount:i,checked:l,defaultChecked:s,required:u,disabled:c,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:m}=uU("CheckboxBubbleInput",e),v=aG(r,m),b=uR(a),x=y.useRef(!1),w=y.useRef(l),k=y.useRef(i);y.useEffect(()=>{if(!h)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=i!==k.current;k.current=i;let n=w.current!==l;w.current=l;let r=!(t&&o.current);if(n&&e){x.current=!t;let n=new Event("click",{bubbles:r});h.indeterminate=uZ(l),e.call(h,!uZ(l)&&l),h.dispatchEvent(n),x.current=!1}},[h,l,o,i]);let j=y.useRef(!uZ(l)&&l);return(0,g.jsx)(oT.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??j.current,required:u,disabled:c,name:d,value:f,form:p,...n,tabIndex:-1,ref:v,onClick:ol(t,e=>{x.current&&e.stopPropagation()}),style:{...n.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function uq(e){return"function"==typeof e}function uZ(e){return"indeterminate"===e}function uJ(e){return uZ(e)?"indeterminate":e?"checked":"unchecked"}uI(uq,"isFunction"),uI(uZ,"isIndeterminate"),uI(uJ,"getState");let uG=O("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);function uQ(e){var t,n,r=e.className,a=function(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,["className"]);return(0,g.jsx)(uK,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"checkbox",className:aT("peer size-4 shrink-0 cursor-pointer rounded-[5px] border border-input bg-card shadow-[0_1px_2px_rgb(20_24_40/0.04)] outline-none transition-[border-color,box-shadow,background-color] hover:border-ring/35 focus-visible:border-ring/50 focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",r)},a),n=n={children:(0,g.jsx)(uV,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current",children:(0,g.jsx)(uG,{className:"size-3",strokeWidth:3.5})})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}function uY(e){var t=e.className,n=e.type,r=function(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,["className","type"]);return(0,g.jsx)("input",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({type:n,"data-slot":"input",className:aT("flex h-10 w-full rounded-[10px] border border-input bg-card px-3 py-1 text-base shadow-[0_1px_2px_rgb(20_24_40/0.04)] transition-[border-color,box-shadow] file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t)},r))}var uX=Object.defineProperty,u0=y.forwardRef(uX(function(e,t){return(0,g.jsx)(oT.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}));function u1(e){var t=e.className,n=function(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,["className"]);return(0,g.jsx)(u0,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"label",className:aT("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t)},n))}function u2(e,[t,n]){return Math.min(n,Math.max(t,e))}(0,Object.defineProperty)(u2,"name",{value:"clamp",configurable:!0});var u4=Object.defineProperty,u3=(e,t)=>u4(e,"name",{value:t,configurable:!0});function u5(e){let t=e+"CollectionProvider",[n,r]=of(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=u3(e=>{let{scope:t,children:n}=e,r=y.useRef(null),o=y.useRef(new Map).current;return(0,g.jsx)(a,{scope:t,itemMap:o,collectionRef:r,children:n})},"CollectionProvider");i.displayName=t;let l=e+"CollectionSlot",s=aX(l),u=y.forwardRef((e,t)=>{let{scope:n,children:r}=e,a=aG(t,o(l,n).collectionRef);return(0,g.jsx)(s,{ref:a,children:r})});u.displayName=l;let c=e+"CollectionItemSlot",d="data-radix-collection-item",f=aX(c),p=y.forwardRef((e,t)=>{let{scope:n,children:r,...a}=e,i=y.useRef(null),l=aG(t,i),s=o(c,n);return y.useEffect(()=>(s.itemMap.set(i,{ref:i,...a}),()=>void s.itemMap.delete(i))),(0,g.jsx)(f,{...{[d]:""},ref:l,children:r})});function h(t){let n=o(e+"CollectionConsumer",t);return y.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return p.displayName=c,u3(h,"useCollection"),[{Provider:i,Slot:u,ItemSlot:p},h,r]}u3(u5,"createCollection");var u6=new WeakMap,u8=class e extends Map{static{u3(this,"OrderedDict")}#e;constructor(e){super(e),this.#e=[...super.keys()],u6.set(this,!0)}set(e,t){return u6.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r,a=this.has(t),o=this.#e.length,i=ce(e),l=i>=0?i:o+i,s=l<0||l>=o?-1:l;if(s===this.size||a&&s===this.size-1||-1===s)return this.set(t,n),this;let u=this.size+ +!a;i<0&&l++;let c=[...this.#e],d=!1;for(let e=l;e<u;e++)if(l===e){let o=c[e];c[e]===t&&(o=c[e+1]),a&&this.delete(t),r=this.get(o),this.set(t,n)}else{d||c[e-1]!==t||(d=!0);let n=c[d?e:e-1],a=r;r=this.get(n),this.delete(n),this.set(n,a)}return this}with(t,n,r){let a=new e(this);return a.insert(t,n,r),a}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=u9(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=u9(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return u9(this.#e,e)}from(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return -1}filter(t,n){let r=[],a=0;for(let e of this)Reflect.apply(t,n,[e,a,this])&&r.push(e),a++;return new e(r)}map(t,n){let r=[],a=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,a,this])]),a++;return new e(r)}reduce(...e){let[t,n]=e,r=0,a=n??this.at(0);for(let n of this)a=0===r&&1===e.length?n:Reflect.apply(t,this,[a,n,r,this]),r++;return a}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let a=this.at(n);r=n===this.size-1&&1===e.length?a:Reflect.apply(t,this,[r,a,n,this])}return r}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,a=this.size-1;if(void 0===t)return r;t<0&&(t+=this.size),void 0!==n&&n>0&&(a=n-1);for(let e=t;e<=a;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function u9(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=u7(e,t);return -1===n?void 0:e[n]}function u7(e,t){let n=e.length,r=ce(t),a=r>=0?r:n+r;return a<0||a>=n?-1:a}function ce(e){return e!=e||0===e?0:Math.trunc(e)}function ct(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}function cn(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function cr(e,t){return e[1].element&&t[1].element?cn(e[1].element,t[1].element)?-1:1:0}function ca(e){return new MutationObserver(t=>{for(let n of t)if("childList"===n.type)return void e()})}u3(u9,"at"),u3(u7,"toSafeIndex"),u3(ce,"toSafeInteger"),u3(function(e){let t=e+"CollectionProvider",[n,r]=of(t),[a,o]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new u8,setItemMap:u3(()=>void 0,"setItemMap")}),i=u3(({state:e,...t})=>e?(0,g.jsx)(s,{...t,state:e}):(0,g.jsx)(l,{...t}),"CollectionProvider");i.displayName=t;let l=u3(e=>{let t=m();return(0,g.jsx)(s,{...e,state:t})},"CollectionInit");l.displayName=t+"Init";let s=u3(e=>{let{scope:t,children:n,state:r}=e,o=y.useRef(null),[i,l]=y.useState(null),s=aG(o,l),[u,c]=r;return y.useEffect(()=>{if(!i)return;let e=ca(()=>{});return e.observe(i,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[i]),(0,g.jsx)(a,{scope:t,itemMap:u,setItemMap:c,collectionRef:s,collectionRefObject:o,collectionElement:i,children:n})},"CollectionProviderImpl");s.displayName=t+"Impl";let u=e+"CollectionSlot",c=aX(u),d=y.forwardRef((e,t)=>{let{scope:n,children:r}=e,a=aG(t,o(u,n).collectionRef);return(0,g.jsx)(c,{ref:a,children:r})});d.displayName=u;let f=e+"CollectionItemSlot",p=aX(f),h=y.forwardRef((e,t)=>{let{scope:n,children:r,...a}=e,i=y.useRef(null),[l,s]=y.useState(null),u=aG(t,i,s),{setItemMap:c}=o(f,n),d=y.useRef(a);ct(d.current,a)||(d.current=a);let h=d.current;return y.useEffect(()=>(c(e=>l?e.has(l)?e.set(l,{...h,element:l}).toSorted(cr):(e.set(l,{...h,element:l}),e.toSorted(cr)):e),()=>{c(e=>l&&e.has(l)?(e.delete(l),new u8(e)):e)}),[l,h,c]),(0,g.jsx)(p,{"data-radix-collection-item":"",ref:u,children:r})});function m(){return y.useState(new u8)}function v(t){let{itemMap:n}=o(e+"CollectionConsumer",t);return n}return h.displayName=f,u3(m,"useInitCollection"),u3(v,"useCollection"),[{Provider:i,Slot:d,ItemSlot:h},{createCollectionScope:r,useCollection:v,useInitCollection:m}]},"createCollection"),u3(ct,"shallowEqual"),u3(cn,"isElementPreceding"),u3(cr,"sortByDocumentPosition"),u3(ca,"getChildListObserver");var co=Object.defineProperty,ci=y.createContext(void 0);function cl(e){let t=y.useContext(ci);return e||t||"ltr"}co(cl,"name",{value:"useDirection",configurable:!0});let cs=["top","right","bottom","left"],cu=Math.min,cc=Math.max,cd=Math.round,cf=Math.floor,cp=e=>({x:e,y:e}),ch={left:"right",right:"left",bottom:"top",top:"bottom"};function cm(e,t){return"function"==typeof e?e(t):e}function cg(e){return e.split("-")[0]}function cy(e){return e.split("-")[1]}function cv(e){return"x"===e?"y":"x"}function cb(e){return"y"===e?"height":"width"}function cx(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function cw(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let ck=["left","right"],cj=["right","left"],cS=["top","bottom"],cO=["bottom","top"];function cC(e){let t=cg(e);return ch[t]+e.slice(t.length)}function cN(e){var t,n,r,a;return"number"!=typeof e?{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(r=e.bottom)?r:0,left:null!=(a=e.left)?a:0}:{top:e,right:e,bottom:e,left:e}}function cP(e){let{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function cE(e,t,n){let r,{reference:a,floating:o}=e,i=cx(t),l=cv(cx(t)),s=cb(l),u=cg(t),c=a.x+a.width/2-o.width/2,d=a.y+a.height/2-o.height/2,f=a[s]/2-o[s]/2;switch(u){case"top":r={x:c,y:a.y-o.height};break;case"bottom":r={x:c,y:a.y+a.height};break;case"right":r={x:a.x+a.width,y:d};break;case"left":r={x:a.x-o.width,y:d};break;default:r={x:a.x,y:a.y}}let p=cy(t);return p&&(r[l]+=f*("end"===p?1:-1)*(n&&"y"===i?-1:1)),r}async function c_(e,t){var n;void 0===t&&(t={});let{x:r,y:a,platform:o,rects:i,elements:l,strategy:s}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=cm(t,e),h=cN(p),m=l[f?"floating"===d?"reference":"floating":d],g=cP(await o.getClippingRect({element:null==(n=await (null==o.isElement?void 0:o.isElement(m)))||n?m:m.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:u,rootBoundary:c,strategy:s})),y="floating"===d?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,v=await (null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),b=await (null==o.isElement?void 0:o.isElement(v))&&await (null==o.getScale?void 0:o.getScale(v))||{x:1,y:1},x=cP(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:s}):y);return{top:(g.top-x.top+h.top)/b.y,bottom:(x.bottom-g.bottom+h.bottom)/b.y,left:(g.left-x.left+h.left)/b.x,right:(x.right-g.right+h.right)/b.x}}let cz=async(e,t,n)=>{let{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:c_},s=await (null==i.isRTL?void 0:i.isRTL(t)),u=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:c,y:d}=cE(u,r,s),f=r,p=0,h={};for(let n=0;n<o.length;n++){let m=o[n];if(!m)continue;let{name:g,fn:y}=m,{x:v,y:b,data:x,reset:w}=await y({x:c,y:d,initialPlacement:r,placement:f,strategy:a,middlewareData:h,rects:u,platform:l,elements:{reference:e,floating:t}});c=null!=v?v:c,d=null!=b?b:d,h[g]={...h[g],...x},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(u=!0===w.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):w.rects),{x:c,y:d}=cE(u,f,s)),n=-1)}return{x:c,y:d,placement:f,strategy:a,middlewareData:h}};function cT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cA(e){return cs.some(t=>e[t]>=0)}let cR=new Set(["left","top"]);async function cL(e,t){let{placement:n,platform:r,elements:a}=e,o=await (null==r.isRTL?void 0:r.isRTL(a.floating)),i=cg(n),l=cy(n),s="y"===cx(n),u=cR.has(i)?-1:1,c=o&&s?-1:1,d=cm(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&"number"==typeof h&&(p="end"===l?-1*h:h),s?{x:p*c,y:f*u}:{x:f*u,y:p*c}}function cI(){return"u">typeof window}function cM(e){return c$(e)?(e.nodeName||"").toLowerCase():"#document"}function cD(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function cF(e){var t;return null==(t=(c$(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function c$(e){return!!cI()&&(e instanceof Node||e instanceof cD(e).Node)}function cU(e){return!!cI()&&(e instanceof Element||e instanceof cD(e).Element)}function cH(e){return!!cI()&&(e instanceof HTMLElement||e instanceof cD(e).HTMLElement)}function cB(e){return!(!cI()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof cD(e).ShadowRoot)}function cK(e){let{overflow:t,overflowX:n,overflowY:r,display:a}=cY(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==a&&"contents"!==a}function cV(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let cW=/transform|translate|scale|rotate|perspective|filter/,cq=/paint|layout|strict|content/,cZ=e=>!!e&&"none"!==e;function cJ(e){let t=cU(e)?cY(e):e;return cZ(t.transform)||cZ(t.translate)||cZ(t.scale)||cZ(t.rotate)||cZ(t.perspective)||!cG()&&(cZ(t.backdropFilter)||cZ(t.filter))||cW.test(t.willChange||"")||cq.test(t.contain||"")}function cG(){return null==e&&(e="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),e}function cQ(e){return/^(html|body|#document)$/.test(cM(e))}function cY(e){return cD(e).getComputedStyle(e)}function cX(e){return cU(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function c0(e){if("html"===cM(e))return e;let t=e.assignedSlot||e.parentNode||cB(e)&&e.host||cF(e);return cB(t)?t.host:t}function c1(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let a=function e(t){let n=c0(t);return cQ(n)?(t.ownerDocument||t).body:cH(n)&&cK(n)?n:e(n)}(e),o=a===(null==(r=e.ownerDocument)?void 0:r.body),i=cD(a);if(!o)return t.concat(a,c1(a,[],n));{let e=c2(i);return t.concat(i,i.visualViewport||[],cK(a)?a:[],e&&n?c1(e):[])}}function c2(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function c4(e){let t=cY(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,a=cH(e),o=a?e.offsetWidth:n,i=a?e.offsetHeight:r,l=cd(n)!==o||cd(r)!==i;return l&&(n=o,r=i),{width:n,height:r,$:l}}function c3(e){return cU(e)?e:e.contextElement}function c5(e){let t=c3(e);if(!cH(t))return cp(1);let n=t.getBoundingClientRect(),{width:r,height:a,$:o}=c4(t),i=(o?cd(n.width):n.width)/r,l=(o?cd(n.height):n.height)/a;return i&&Number.isFinite(i)||(i=1),l&&Number.isFinite(l)||(l=1),{x:i,y:l}}let c6=cp(0);function c8(e){let t=cD(e);return cG()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:c6}function c9(e,t,n,r){var a;void 0===t&&(t=!1),void 0===n&&(n=!1);let o=e.getBoundingClientRect(),i=c3(e),l=cp(1);t&&(r?cU(r)&&(l=c5(r)):l=c5(e));let s=(void 0===(a=n)&&(a=!1),r&&a&&r===cD(i))?c8(i):cp(0),u=(o.left+s.x)/l.x,c=(o.top+s.y)/l.y,d=o.width/l.x,f=o.height/l.y;if(i&&r){let e=cD(i),t=cU(r)?cD(r):r,n=e,a=c2(n);for(;a&&t!==n;){let e=c5(a),t=a.getBoundingClientRect(),r=cY(a),o=t.left+(a.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(a.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,c*=e.y,d*=e.x,f*=e.y,u+=o,c+=i,a=c2(n=cD(a))}}return cP({width:d,height:f,x:u,y:c})}function c7(e,t){let n=cX(e).scrollLeft;return t?t.left+n:c9(cF(e)).left+n}function de(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-c7(e,n),y:n.top+t.scrollTop}}function dt(e,t,n){var r;let a;if("viewport"===t||"layoutViewport"===t)a=function(e,t,n){void 0===n&&(n="viewport");let r="layoutViewport"===n,a=cD(e),o=cF(e),i=a.visualViewport,l=o.clientWidth,s=o.clientHeight,u=0,c=0;if(i){let e=!cG()||"fixed"===t;r?e||(u=-i.offsetLeft,c=-i.offsetTop):(l=i.width,s=i.height,e&&(u=i.offsetLeft,c=i.offsetTop))}if(0>=c7(o)){let e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(o.clientWidth-t.clientWidth-r),i="stable both-edges"===getComputedStyle(o).scrollbarGutter?a/2:a;i<=25&&(l-=i)}return{width:l,height:s,x:u,y:c}}(e,n,t);else if("document"===t){let t,n,o,i,l,s;t=cX(r=cF(e)),n=r.ownerDocument.body,o=cc(r.scrollWidth,r.clientWidth,n.scrollWidth,n.clientWidth),i=cc(r.scrollHeight,r.clientHeight,n.scrollHeight,n.clientHeight),l=-t.scrollLeft+c7(r),s=-t.scrollTop,"rtl"===cY(n).direction&&(l+=cc(r.clientWidth,n.clientWidth)-o),a={width:o,height:i,x:l,y:s}}else if(cU(t)){let e,r,o,i,l,s;r=(e=c9(t,!0,"fixed"===n)).top+t.clientTop,o=e.left+t.clientLeft,i=c5(t),l=t.clientWidth*i.x,s=t.clientHeight*i.y,a={width:l,height:s,x:o*i.x,y:r*i.y}}else{let n=c8(e);a={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return cP(a)}function dn(e){return"static"===cY(e).position}function dr(e,t){if(!cH(e)||"fixed"===cY(e).position)return null;if(t)return t(e);let n=e.offsetParent;return cF(e)===n&&(n=n.ownerDocument.body),n}function da(e,t){var n;let r=cD(e);if(cV(e))return r;if(!cH(e)){let t=c0(e);for(;t&&!cQ(t);){if(cU(t)&&!dn(t))return t;t=c0(t)}return r}let a=dr(e,t);for(;a&&(n=a,/^(table|td|th)$/.test(cM(n)))&&dn(a);)a=dr(a,t);return a&&cQ(a)&&dn(a)&&!cJ(a)?r:a||function(e){let t=c0(e);for(;cH(t)&&!cQ(t);){if(cJ(t))return t;if(cV(t))break;t=c0(t)}return null}(e)||r}let di=async function(e){let t=this.getOffsetParent||da,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=cH(t),a=cF(t),o="fixed"===n,i=c9(e,!0,o,t),l={scrollLeft:0,scrollTop:0},s=cp(0);if((r||!o)&&(("body"!==cM(t)||cK(a))&&(l=cX(t)),r)){let e=c9(t,!0,o,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}!r&&a&&(s.x=c7(a));let u=!a||r||o?cp(0):de(a,l);return{x:i.left+l.scrollLeft-s.x-u.x,y:i.top+l.scrollTop-s.y-u.y,width:i.width,height:i.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},dl={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e,o="fixed"===a,i=cF(r),l=!!t&&cV(t.floating);if(r===i||l&&o)return n;let s={scrollLeft:0,scrollTop:0},u=cp(1),c=cp(0),d=cH(r);if((d||!o)&&(("body"!==cM(r)||cK(i))&&(s=cX(r)),d)){let e=c9(r);u=c5(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}let f=!i||d||o?cp(0):de(i,s);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-s.scrollTop*u.y+c.y+f.y}},getDocumentElement:cF,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e,o=[..."clippingAncestors"===n?cV(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=c1(e,[],!1).filter(e=>cU(e)&&"body"!==cM(e)),a=null,o="fixed"===cY(e).position,i=o?c0(e):e;for(;cU(i)&&!cQ(i);){let e=cY(i),t=cJ(i),n=a?a.position:o?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?a=e:r=r.filter(e=>e!==i),i=c0(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=dt(t,o[0],a),l=i.top,s=i.right,u=i.bottom,c=i.left;for(let e=1;e<o.length;e++){let n=dt(t,o[e],a);l=cc(n.top,l),s=cu(n.right,s),u=cu(n.bottom,u),c=cc(n.left,c)}return{width:s-c,height:u-l,x:c,y:l}},getOffsetParent:da,getElementRects:di,getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){let{width:t,height:n}=c4(e);return{width:t,height:n}},getScale:c5,isElement:cU,isRTL:function(e){return"rtl"===cY(e).direction}};function ds(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let du=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:a,rects:o,platform:i,elements:l,middlewareData:s}=t,{element:u,padding:c=0}=cm(e,t)||{};if(null==u)return{};let d=cN(c),f={x:n,y:r},p=cv(cx(a)),h=cb(p),m=await i.getDimensions(u),g="y"===p,y=g?"clientHeight":"clientWidth",v=o.reference[h]+o.reference[p]-f[p]-o.floating[h],b=f[p]-o.reference[p],x=await (null==i.getOffsetParent?void 0:i.getOffsetParent(u)),w=x?x[y]:0;w&&await (null==i.isElement?void 0:i.isElement(x))||(w=l.floating[y]||o.floating[h]);let k=w/2-m[h]/2-1,j=cu(d[g?"top":"left"],k),S=cu(d[g?"bottom":"right"],k),O=w-m[h]-S,C=w/2-m[h]/2+(v/2-b/2),N=cc(j,cu(C,O)),P=!s.arrow&&null!=cy(a)&&C!==N&&o.reference[h]/2-(C<j?j:S)-m[h]/2<0,E=P?C<j?C-j:C-O:0;return{[p]:f[p]+E,data:{[p]:N,centerOffset:C-N-E,...P&&{alignmentOffset:E}},reset:P}}});var dc="u">typeof document?y.useLayoutEffect:function(){};function dd(e,t){let n,r,a;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!dd(e[r],t[r]))return!1;return!0}if((n=(a=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,a[r]))return!1;for(r=n;0!=r--;){let n=a[r];if(("_owner"!==n||!e.$$typeof)&&!dd(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function df(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dp(e,t){let n=df(e);return Math.round(t*n)/n}function dh(e){let t=y.useRef(e);return dc(()=>{t.current=e}),t}var dm=Object.defineProperty,dg=(e,t)=>dm(e,"name",{value:t,configurable:!0}),dy="Popper",[dv,db]=of(dy),[dx,dw]=dv(dy),dk=dg(e=>{let{__scopePopper:t,children:n}=e,[r,a]=y.useState(null),[o,i]=y.useState(void 0);return(0,g.jsx)(dx,{scope:t,anchor:r,onAnchorChange:a,placementState:o,setPlacementState:i,children:n})},"Popper"),dj=y.forwardRef(dg(function(e,t){let{__scopePopper:n,virtualRef:r,...a}=e,o=dw("PopperAnchor",n),i=y.useRef(null),l=o.onAnchorChange,s=aG(t,y.useCallback(e=>{i.current=e,e&&l(e)},[l])),u=y.useRef(null);y.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&l(u.current)});let c=o.placementState&&d_(o.placementState),d=c?.[0],f=c?.[1];return r?null:(0,g.jsx)(oT.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...a,ref:s})},"PopperAnchor")),dS="PopperContent",[dO,dC]=dv(dS),dN=y.forwardRef(dg(function(e,t){var n,r,a,o,i,l,s,u,c,d,f,p,h,m,v,b,x,w,k,j,S;let O,C,N,P,E,_,{__scopePopper:z,side:T="bottom",sideOffset:A=0,align:R="center",alignOffset:L=0,arrowPadding:I=0,avoidCollisions:M=!0,collisionBoundary:D=[],collisionPadding:F=0,sticky:$="partial",hideWhenDetached:U=!1,updatePositionStrategy:H="optimized",onPlaced:B,...K}=e,V=dw(dS,z),[W,q]=y.useState(null),Z=aG(t,q),[J,G]=y.useState(null),Q=uR(J),Y=Q?.width??0,X=Q?.height??0,ee="number"==typeof F?F:{top:0,right:0,bottom:0,left:0,...F},et=Array.isArray(D)?D:[D],en=et.length>0,er={padding:ee,boundary:et.filter(dP),altBoundary:en},{refs:ea,floatingStyles:eo,placement:ei,isPositioned:el,middlewareData:es}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:i}={},transform:l=!0,whileElementsMounted:s,open:u}=e,[c,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=y.useState(r);dd(f,r)||p(r);let[h,m]=y.useState(null),[g,v]=y.useState(null),b=y.useCallback(e=>{e!==j.current&&(j.current=e,m(e))},[]),x=y.useCallback(e=>{e!==S.current&&(S.current=e,v(e))},[]),w=o||h,k=i||g,j=y.useRef(null),S=y.useRef(null),O=y.useRef(c),C=null!=s,N=dh(s),P=dh(a),E=dh(u),_=y.useCallback(()=>{var e,r;let a,o,i;if(!j.current||!S.current)return;let l={placement:t,strategy:n,middleware:f};P.current&&(l.platform=P.current),(e=j.current,r=S.current,a=new Map,o=null!=l?l:{},i={...dl,...o.platform,_c:a},cz(e,r,{...o,platform:i})).then(e=>{let t={...e,isPositioned:!1!==E.current};z.current&&!dd(O.current,t)&&(O.current=t,o_.flushSync(()=>{d(t)}))})},[f,t,n,P,E]);dc(()=>{!1===u&&O.current.isPositioned&&(O.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[u]);let z=y.useRef(!1);dc(()=>(z.current=!0,()=>{z.current=!1}),[]),dc(()=>{if(w&&(j.current=w),k&&(S.current=k),w&&k){if(N.current)return N.current(w,k,_);_()}},[w,k,_,N,C]);let T=y.useMemo(()=>({reference:j,floating:S,setReference:b,setFloating:x}),[b,x]),A=y.useMemo(()=>({reference:w,floating:k}),[w,k]),R=y.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=dp(A.floating,c.x),r=dp(A.floating,c.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...df(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,A.floating,c.x,c.y]);return y.useMemo(()=>({...c,update:_,refs:T,elements:A,floatingStyles:R}),[c,_,T,A,R])}({strategy:"fixed",placement:T+("center"!==R?"-"+R:""),whileElementsMounted:dg((...e)=>(function(e,t,n,r){let a;void 0===r&&(r={});let{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:u=!1}=r,c=c3(e),d=o||i?[...c?c1(c):[],...t?c1(t):[]]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n),i&&e.addEventListener("resize",n)});let f=c&&s?function(e,t,n){let r,a=null,o=cF(e);function i(){var e;clearTimeout(r),null==(e=a)||e.disconnect(),a=null}function l(n,s){void 0===n&&(n=!1),void 0===s&&(s=1),i();let u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:p}=u;if(n||t(),!f||!p)return;let h={rootMargin:-cf(d)+"px "+-cf(o.clientWidth-(c+f))+"px "+-cf(o.clientHeight-(d+p))+"px "+-cf(c)+"px",threshold:cc(0,cu(1,s))||1},m=!0;function g(t){let n=t[0].intersectionRatio;if(!ds(u,e.getBoundingClientRect()))return l();if(n!==s){if(!m)return l();n?l(!1,n):r=setTimeout(()=>{l(!1,1e-7)},1e3)}m=!1}try{a=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){a=new IntersectionObserver(g,h)}a.observe(e)}let s=cD(e),u=()=>l(n);return s.addEventListener("resize",u),l(!0),()=>{s.removeEventListener("resize",u),i()}}(c,n,i):null,p=-1,h=null;l&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!u&&h.observe(c),t&&h.observe(t));let m=u?c9(e):null;return u&&function t(){let r=c9(e);m&&!ds(m,r)&&n(),m=r,a=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=h)||e.disconnect(),h=null,u&&cancelAnimationFrame(a)}})(...e,{animationFrame:"always"===H}),"whileElementsMounted"),elements:{reference:V.anchor},middleware:[{name:(O={name:"offset",options:a=n={mainAxis:A+X,alignmentAxis:L},async fn(e){var t,n;let{x:r,y:o,placement:i,middlewareData:l}=e,s=await cL(e,a);return i===(null==(t=l.offset)?void 0:t.placement)&&null!=(n=l.arrow)&&n.alignmentOffset?{}:{x:r+s.x,y:o+s.y,data:{...s,placement:i}}}}).name,fn:O.fn,options:[n,r]},M&&{name:(C={name:"shift",options:c=s={mainAxis:!0,crossAxis:!1,limiter:"partial"===$?{fn:(void 0===(l=o)&&(l={}),{options:l,fn(e){var t,n,r,a;let{x:o,y:i,placement:s,rects:u,middlewareData:c}=e,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=cm(l,e),h={x:o,y:i},m=cx(s),g=cv(m),y=h[g],v=h[m],b=cm(d,e),x="number"==typeof b?{mainAxis:b,crossAxis:0}:{mainAxis:null!=(t=b.mainAxis)?t:0,crossAxis:null!=(n=b.crossAxis)?n:0};if(f){let e="y"===g?"height":"width",t=u.reference[g]-u.floating[e]+x.mainAxis,n=u.reference[g]+u.reference[e]-x.mainAxis;y<t?y=t:y>n&&(y=n)}if(p){let e="y"===g?"width":"height",t=cR.has(cg(s)),n=u.reference[m]-u.floating[e]+(t&&(null==(r=c.offset)?void 0:r[m])||0)+(t?0:x.crossAxis),o=u.reference[m]+u.reference[e]+(t?0:(null==(a=c.offset)?void 0:a[m])||0)-(t?x.crossAxis:0);v<n?v=n:v>o&&(v=o)}return{[g]:y,[m]:v}}}).fn,options:[o,i]}:void 0,...er},async fn(e){let{x:t,y:n,placement:r,platform:a}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=cm(c,e),u={x:t,y:n},d=await a.detectOverflow(e,s),f=cx(r),p=cv(f),h=u[p],m=u[f],g=(e,t)=>cc(t+d["y"===e?"top":"left"],cu(t,t-d["y"===e?"bottom":"right"]));o&&(h=g(p,h)),i&&(m=g(f,m));let y=l.fn({...e,[p]:h,[f]:m});return{...y,data:{x:y.x-t,y:y.y-n,enabled:{[p]:o,[f]:i}}}}}).name,fn:C.fn,options:[s,u]},M&&{name:(N={name:"flip",options:p=d={...er},async fn(e){var t,n,r,a,o,i,l,s;let u,c,d,{placement:f,middlewareData:h,rects:m,initialPlacement:g,platform:y,elements:v}=e,{mainAxis:b=!0,crossAxis:x=!0,fallbackPlacements:w,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:S=!0,...O}=cm(p,e);if(null!=(t=h.arrow)&&t.alignmentOffset)return{};let C=cg(f),N=cx(g),P=cg(g)===g,E=await (null==y.isRTL?void 0:y.isRTL(v.floating)),_=w||(P||!S?[cC(g)]:(u=cC(g),[cw(g),u,cw(u)])),z="none"!==j;!w&&z&&_.push(...(c=cy(g),d=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?cj:ck;return t?ck:cj;case"left":case"right":return t?cS:cO;default:return[]}}(cg(g),"start"===j,E),c&&(d=d.map(e=>e+"-"+c),S&&(d=d.concat(d.map(cw)))),d));let T=[g,..._],A=await y.detectOverflow(e,O),R=[],L=(null==(n=h.flip)?void 0:n.overflows)||[];if(b&&R.push(A[C]),x){let e,t,n,r,a=(i=f,l=m,void 0===(s=E)&&(s=!1),e=cy(i),n=cb(t=cv(cx(i))),r="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",l.reference[n]>l.floating[n]&&(r=cC(r)),[r,cC(r)]);R.push(A[a[0]],A[a[1]])}if(L=[...L,{placement:f,overflows:R}],!R.every(e=>e<=0)){let e=((null==(r=h.flip)?void 0:r.index)||0)+1,t=T[e];if(t&&("alignment"!==x||N===cx(t)||L.every(e=>cx(e.placement)!==N||e.overflows[0]>0)))return{data:{index:e,overflows:L},reset:{placement:t}};let n=null==(a=L.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:a.placement;if(!n)switch(k){case"bestFit":{let e=null==(o=L.filter(e=>{if(z){let t=cx(e.placement);return t===N||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(n=e);break}case"initialPlacement":n=g}if(f!==n)return{reset:{placement:n}}}return{}}}).name,fn:N.fn,options:[d,f]},{name:(P={name:"size",options:v=h={...er,apply:dg(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:a,height:o}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${o}px`)},"apply")},async fn(e){let t,n,{placement:r,rects:a,platform:o,elements:i}=e,{apply:l=()=>{},...s}=cm(v,e),u=await o.detectOverflow(e,s),c=cg(r),d=cy(r),f="y"===cx(r),{width:p,height:h}=a.floating;"top"===c||"bottom"===c?(t=c,n=d===(await (null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(n=c,t="end"===d?"top":"bottom");let m=h-u.top-u.bottom,g=p-u.left-u.right,y=cu(h-u[t],m),b=cu(p-u[n],g),x=e.middlewareData.shift,w=!x,k=y,j=b;null!=x&&x.enabled.x&&(j=g),null!=x&&x.enabled.y&&(k=m),w&&!d&&(f?j=p-2*cc(u.left,u.right):k=h-2*cc(u.top,u.bottom)),await l({...e,availableWidth:j,availableHeight:k});let S=await o.getDimensions(i.floating);return p!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}).name,fn:P.fn,options:[h,m]},J&&{name:(E={name:"arrow",options:w=b={element:J,padding:I},fn(e){let{element:t,padding:n}="function"==typeof w?w(e):w;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?du({element:t.current,padding:n}).fn(e):{}:t?du({element:t,padding:n}).fn(e):{}}}).name,fn:E.fn,options:[b,x]},dE({arrowWidth:Y,arrowHeight:X}),U&&{name:(_={name:"hide",options:S=k={strategy:"referenceHidden",...er,boundary:en?er.boundary:void 0},async fn(e){let{rects:t,platform:n}=e,{strategy:r="referenceHidden",...a}=cm(S,e);switch(r){case"referenceHidden":{let r=cT(await n.detectOverflow(e,{...a,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:cA(r)}}}case"escaped":{let r=cT(await n.detectOverflow(e,{...a,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:cA(r)}}}default:return{}}}}).name,fn:_.fn,options:[k,j]}]}),eu=V.setPlacementState;oh(()=>(eu(ei),()=>{eu(void 0)}),[ei,eu]);let[ec,ed]=d_(ei),ef=oR(B);oh(()=>{el&&ef?.()},[el,ef]);let ep=es.arrow?.x,eh=es.arrow?.y,em=es.arrow?.centerOffset!==0,[eg,ey]=y.useState();return oh(()=>{W&&ey(window.getComputedStyle(W).zIndex)},[W]),(0,g.jsx)("div",{ref:ea.setFloating,"data-radix-popper-content-wrapper":"",style:{...eo,transform:el?eo.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eg,"--radix-popper-transform-origin":[es.transformOrigin?.x,es.transformOrigin?.y].join(" "),...es.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,g.jsx)(dO,{scope:z,placedSide:ec,placedAlign:ed,onArrowChange:G,arrowX:ep,arrowY:eh,shouldHideArrow:em,children:(0,g.jsx)(oT.div,{"data-side":ec,"data-align":ed,...K,ref:Z,style:{...K.style,animation:el?K.style?.animation:"none"}})})})},"PopperContent"));function dP(e){return null!==e}dg(dP,"isNotNull");var dE=dg(e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:a}=t,o=a.arrow?.centerOffset!==0,i=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[s,u]=d_(n),c={start:"0%",center:"50%",end:"100%"}[u],d=(a.arrow?.x??0)+i/2,f=(a.arrow?.y??0)+l/2,p="",h="";return"bottom"===s?(p=o?c:`${d}px`,h=`${-l}px`):"top"===s?(p=o?c:`${d}px`,h=`${r.floating.height+l}px`):"right"===s?(p=`${-l}px`,h=o?c:`${f}px`):"left"===s&&(p=`${r.floating.width+l}px`,h=o?c:`${f}px`),{data:{x:p,y:h}}}}),"transformOrigin");function d_(e){let[t,n="center"]=e.split("-");return[t,n]}function dz(e){let t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}dg(d_,"getSideAndAlignFromPlacement"),(0,Object.defineProperty)(dz,"name",{value:"usePrevious",configurable:!0});var dT=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dA=Object.defineProperty,dR=(e,t)=>dA(e,"name",{value:t,configurable:!0}),dL=[" ","Enter","ArrowUp","ArrowDown"],dI=[" ","Enter"],dM="Select",[dD,dF,d$]=u5(dM),[dU,dH]=of(dM,[d$,db]),dB=db(),[dK,dV]=dU(dM),[dW,dq]=dU(dM);function dZ(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:i,defaultValue:l,onValueChange:s,dir:u,name:c,autoComplete:d,disabled:f,required:p,form:h,internal_do_not_use_render:m}=e,v=dB(t),[b,x]=y.useState(null),[w,k]=y.useState(null),[j,S]=y.useState(!1),O=cl(u),[C,N]=oC({prop:r,defaultProp:a??!1,onChange:o,caller:dM}),[P,E]=oC({prop:i,defaultProp:l,onChange:s,caller:dM}),_=y.useRef(null),z=y.useRef(P);y.useEffect(()=>{let e=h?b?.ownerDocument.getElementById(h):b?.form;if(e instanceof HTMLFormElement){let t=dR(()=>E(z.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[h,b,E]);let T=!b||!!h||!!b.closest("form"),[A,R]=y.useState(new Set),L=ov(),I=Array.from(A).map(e=>e.props.value).join(";"),M=y.useCallback(e=>{R(t=>new Set(t).add(e))},[]),D=y.useCallback(e=>{R(t=>{let n=new Set(t);return n.delete(e),n})},[]),F={required:p,trigger:b,onTriggerChange:x,valueNode:w,onValueNodeChange:k,valueNodeHasChildren:j,onValueNodeHasChildrenChange:S,contentId:L,value:P,onValueChange:E,open:C,onOpenChange:N,dir:O,triggerPointerDownPosRef:_,disabled:f,name:c,autoComplete:d,form:h,nativeOptions:A,nativeSelectKey:I,isFormControl:T};return(0,g.jsx)(dk,{...v,children:(0,g.jsx)(dK,{scope:t,...F,children:(0,g.jsx)(dD.Provider,{scope:t,children:(0,g.jsx)(dW,{scope:t,onNativeOptionAdd:M,onNativeOptionRemove:D,children:fk(m)?m(F):n})})})})}dR(dZ,"SelectProvider");var dJ=dR(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,g.jsx)(dZ,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,g.jsxs)(g.Fragment,{children:[n,e?(0,g.jsx)(fw,{__scopeSelect:t}):null]})})},"Select"),dG=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,disabled:r=!1,...a}=e,o=dB(n),i=dV("SelectTrigger",n),l=i.disabled||r,s=aG(t,i.onTriggerChange),u=dF(n),c=y.useRef("touch"),[d,f,p]=fS(e=>{let t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===i.value),r=fO(t,e,n);void 0!==r&&i.onValueChange(r.value)}),h=dR(e=>{l||(i.onOpenChange(!0),p()),e&&(i.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},"handleOpen");return(0,g.jsx)(dj,{asChild:!0,...o,children:(0,g.jsx)(oT.button,{type:"button",role:"combobox","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":fj(i.value)?"":void 0,...a,ref:s,onClick:ol(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==c.current&&h(e)}),onPointerDown:ol(a.onPointerDown,e=>{c.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(h(e),e.preventDefault())}),onKeyDown:ol(a.onKeyDown,e=>{let t=""!==d.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||f(e.key),(!t||" "!==e.key)&&dL.includes(e.key)&&(h(),e.preventDefault())})})})},"SelectTrigger")),dQ=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,className:r,style:a,children:o,placeholder:i="",...l}=e,s=dV("SelectValue",n),{onValueNodeHasChildrenChange:u}=s,c=void 0!==o,d=aG(t,s.onValueNodeChange);oh(()=>{u(c)},[u,c]);let f=fj(s.value);return(0,g.jsx)(oT.span,{...l,asChild:!f&&l.asChild,ref:d,style:{pointerEvents:"none"},children:(0,g.jsx)(y.Fragment,{children:f?i:o},f?"placeholder":"value")})},"SelectValue")),dY=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,children:r,...a}=e;return(0,g.jsx)(oT.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})},"SelectIcon")),[dX,d0]=dU("SelectPortal",{forceMount:void 0}),d1=dR(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,g.jsx)(dX,{scope:e.__scopeSelect,forceMount:n,children:(0,g.jsx)(ie,{asChild:!0,...r})})},"SelectPortal"),d2="SelectContent",d4=y.forwardRef(dR(function(e,t){let n=d0(d2,e.__scopeSelect),{forceMount:r=n.forceMount,...a}=e,o=dV(d2,e.__scopeSelect),[i,l]=y.useState();return oh(()=>{l(new DocumentFragment)},[]),(0,g.jsx)(io,{present:r||o.open,children:({present:e})=>e?(0,g.jsx)(d9,{...a,ref:t}):(0,g.jsx)(d3,{...a,fragment:i})})},"SelectContent")),d3=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,children:r,fragment:a}=e;return a?o_.createPortal((0,g.jsx)(d5,{scope:n,children:(0,g.jsx)(dD.Slot,{scope:n,children:(0,g.jsx)("div",{ref:t,children:r})})}),a):null},"SelectContentFragment")),[d5,d6]=dU(d2),d8=aX("SelectContent.RemoveScroll"),d9=y.forwardRef(dR(function(e,t){let{__scopeSelect:n}=e,{position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:i,side:l,sideOffset:s,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:v,...b}=e,x=dV(d2,n),[w,k]=y.useState(null),[j,S]=y.useState(null),O=aG(t,k),[C,N]=y.useState(null),[P,E]=y.useState(null),_=dF(n),[z,T]=y.useState(!1),A=y.useRef(!1);y.useEffect(()=>{if(w)return i7(w)},[w]),ig();let R=y.useCallback(e=>{let[t,...n]=_().map(e=>e.ref.current),[r]=n.slice(-1),a=document.activeElement;for(let n of e)if(n===a||(n?.scrollIntoView({block:"nearest"}),n===t&&j&&(j.scrollTop=0),n===r&&j&&(j.scrollTop=j.scrollHeight),n?.focus(),document.activeElement!==a))return},[_,j]),L=y.useCallback(()=>R([C,w]),[R,C,w]);y.useEffect(()=>{z&&L()},[z,L]);let{onOpenChange:I,triggerPointerDownPosRef:M}=x;y.useEffect(()=>{if(w){let e={x:0,y:0},t=dR(t=>{e={x:Math.abs(Math.round(t.pageX)-(M.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(M.current?.y??0))}},"handlePointerMove"),n=dR(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(w)||I(!1),document.removeEventListener("pointermove",t),M.current=null},"handlePointerUp");return null!==M.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[w,I,M]),y.useEffect(()=>{let e=dR(()=>I(!1),"close");return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[I]);let[D,F]=fS(e=>{let t=_().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=fO(t,e,n);r&&setTimeout(()=>r.ref.current?.focus())}),$=y.useCallback((e,t,n)=>{let r=!A.current&&!n;(void 0!==x.value&&x.value===t||r)&&(N(e),r&&(A.current=!0))},[x.value]),U=y.useCallback(()=>w?.focus(),[w]),H=y.useCallback((e,t,n)=>{let r=!A.current&&!n;(void 0!==x.value&&x.value===t||r)&&E(e)},[x.value]),B="popper"===r?fe:d7;return(0,g.jsx)(d5,{scope:n,content:w,viewport:j,onViewportChange:S,itemRefCallback:$,selectedItem:C,onItemLeave:U,itemTextRefCallback:H,focusSelectedItem:L,selectedItemText:P,position:r,isPositioned:z,searchRef:D,children:(0,g.jsx)(i2,{as:d8,allowPinchZoom:!0,children:(0,g.jsx)(oQ,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ol(a,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,g.jsx)(oF,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:(0,g.jsx)(B,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...B===fe?{side:l,sideOffset:s,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:v}:{},onPlaced:()=>T(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:ol(b.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||F(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=_().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>R(t)),e.preventDefault()}})})})})})})},"SelectContentImpl")),d7=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,onPlaced:r,...a}=e,o=dV(d2,n),i=d6(d2,n),[l,s]=y.useState(null),[u,c]=y.useState(null),d=aG(t,c),f=dF(n),p=y.useRef(!1),h=y.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:b,focusSelectedItem:x}=i,w=y.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&u&&m&&v&&b){let e=o.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),a=b.getBoundingClientRect();if("rtl"!==o.dir){let r=a.left-t.left,o=n.left-r,i=e.left-o,s=e.width+i,u=Math.max(s,t.width),c=u2(o,[10,Math.max(10,window.innerWidth-10-u)]);l.style.minWidth=s+"px",l.style.left=c+"px"}else{let r=t.right-a.right,o=window.innerWidth-n.right-r,i=window.innerWidth-e.right-o,s=e.width+i,u=Math.max(s,t.width),c=u2(o,[10,Math.max(10,window.innerWidth-10-u)]);l.style.minWidth=s+"px",l.style.right=c+"px"}let i=f(),s=window.innerHeight-20,c=m.scrollHeight,d=window.getComputedStyle(u),h=parseInt(d.borderTopWidth,10),g=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),x=h+g+c+parseInt(d.paddingBottom,10)+y,w=Math.min(5*v.offsetHeight,x),k=window.getComputedStyle(m),j=parseInt(k.paddingTop,10),S=parseInt(k.paddingBottom,10),O=e.top+e.height/2-10,C=v.offsetHeight/2,N=h+g+(v.offsetTop+C);if(N<=O){let e=i.length>0&&v===i[i.length-1].ref.current;l.style.bottom="0px";let t=Math.max(s-O,C+(e?S:0)+(u.clientHeight-m.offsetTop-m.offsetHeight)+y);l.style.height=N+t+"px"}else{let e=i.length>0&&v===i[0].ref.current;l.style.top="0px";let t=Math.max(O,h+m.offsetTop+(e?j:0)+C);l.style.height=t+(x-N)+"px",m.scrollTop=N-O+m.offsetTop}l.style.margin="10px 0",l.style.minHeight=w+"px",l.style.maxHeight=s+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,o.trigger,o.valueNode,l,u,m,v,b,o.dir,r]);oh(()=>w(),[w]);let[k,j]=y.useState();oh(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);let S=y.useCallback(e=>{e&&!0===h.current&&(w(),x?.(),h.current=!1)},[w,x]);return(0,g.jsx)(ft,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:S,children:(0,g.jsx)("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:(0,g.jsx)(oT.div,{...a,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})},"SelectItemAlignedPosition")),fe=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,align:r="start",collisionPadding:a=10,...o}=e,i=dB(n);return(0,g.jsx)(dN,{...i,...o,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[ft,fn]=dU(d2,{}),fr="SelectViewport",fa=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,nonce:r,...a}=e,o=d6(fr,n),i=fn(fr,n),l=aG(t,o.onViewportChange),s=y.useRef(0);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),(0,g.jsx)(dD.Slot,{scope:n,children:(0,g.jsx)(oT.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:ol(a.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=i;if(r?.current&&n){let e=Math.abs(s.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,a=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(a<r){let o=a+e,i=Math.min(r,o),l=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=l>0?l:0,n.style.justifyContent="flex-end")}}}s.current=t.scrollTop})})})]})},"SelectViewport")),[fo,fi]=dU("SelectGroup"),fl=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,...r}=e,a=fi("SelectLabel",n);return(0,g.jsx)(oT.div,{id:a.id,...r,ref:t})},"SelectLabel")),fs="SelectItem",[fu,fc]=dU(fs),fd=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...i}=e,l=dV(fs,n),s=d6(fs,n),u=l.value===r,[c,d]=y.useState(o??""),[f,p]=y.useState(!1),h=aG(t,oR(e=>s.itemRefCallback?.(e,r,a))),m=ov(),v=y.useRef("touch"),b=dR(()=>{a||(l.onValueChange(r),l.onOpenChange(!1))},"handleSelect");return(0,g.jsx)(fu,{scope:n,value:r,disabled:a,textId:m,isSelected:u,onItemTextChange:y.useCallback(e=>{d(t=>t||(e?.textContent??"").trim())},[]),children:(0,g.jsx)(dD.ItemSlot,{scope:n,value:r,disabled:a,textValue:c,children:(0,g.jsx)(oT.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...i,ref:h,onFocus:ol(i.onFocus,()=>p(!0)),onBlur:ol(i.onBlur,()=>p(!1)),onClick:ol(i.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:ol(i.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:ol(i.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:ol(i.onPointerMove,e=>{v.current=e.pointerType,a?s.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ol(i.onPointerLeave,e=>{e.currentTarget===document.activeElement&&s.onItemLeave?.()}),onKeyDown:ol(i.onKeyDown,e=>{a||e.target!==e.currentTarget||(s.searchRef?.current===""||" "!==e.key)&&(dI.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})},"SelectItem")),ff="SelectItemText",fp=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,className:r,style:a,...o}=e,i=dV(ff,n),l=d6(ff,n),s=fc(ff,n),u=dq(ff,n),[c,d]=y.useState(null),f=oR(e=>l.itemTextRefCallback?.(e,s.value,s.disabled)),p=aG(t,d,s.onItemTextChange,f),h=c?.textContent,m=y.useMemo(()=>(0,g.jsx)("option",{value:s.value,disabled:s.disabled,children:h},s.value),[s.disabled,s.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=u;return oh(()=>(v(m),()=>b(m)),[v,b,m]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(oT.span,{id:s.textId,...o,ref:p}),s.isSelected&&i.valueNode&&!i.valueNodeHasChildren&&!fj(i.value)?o_.createPortal(o.children,i.valueNode):null]})},"SelectItemText")),fh=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,...r}=e;return fc("SelectItemIndicator",n).isSelected?(0,g.jsx)(oT.span,{"aria-hidden":!0,...r,ref:t}):null},"SelectItemIndicator")),fm="SelectScrollUpButton",fg=y.forwardRef(dR(function(e,t){let n=d6(fm,e.__scopeSelect),r=fn(fm,e.__scopeSelect),[a,o]=y.useState(!1),i=aG(t,r.onScrollButtonChange);return oh(()=>{if(n.viewport&&n.isPositioned){let e=function(){o(t.scrollTop>0)};dR(e,"handleScroll");let t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),a?(0,g.jsx)(fb,{...e,ref:i,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null},"SelectScrollUpButton")),fy="SelectScrollDownButton",fv=y.forwardRef(dR(function(e,t){let n=d6(fy,e.__scopeSelect),r=fn(fy,e.__scopeSelect),[a,o]=y.useState(!1),i=aG(t,r.onScrollButtonChange);return oh(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;o(Math.ceil(t.scrollTop)<e)};dR(e,"handleScroll");let t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),a?(0,g.jsx)(fb,{...e,ref:i,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null},"SelectScrollDownButton")),fb=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...a}=e,o=d6("SelectScrollButton",n),i=y.useRef(null),l=dF(n),s=y.useCallback(()=>{null!==i.current&&(window.clearInterval(i.current),i.current=null)},[]);return y.useEffect(()=>()=>s(),[s]),oh(()=>{let e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),(0,g.jsx)(oT.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:ol(a.onPointerDown,()=>{null===i.current&&(i.current=window.setInterval(r,50))}),onPointerMove:ol(a.onPointerMove,()=>{o.onItemLeave?.(),null===i.current&&(i.current=window.setInterval(r,50))}),onPointerLeave:ol(a.onPointerLeave,()=>{s()})})},"SelectScrollButtonImpl")),fx=y.forwardRef(dR(function(e,t){let{__scopeSelect:n,...r}=e;return(0,g.jsx)(oT.div,{"aria-hidden":!0,...r,ref:t})},"SelectSeparator")),fw=y.forwardRef(dR(function({__scopeSelect:e,...t},n){let r=dV("SelectBubbleInput",e),{value:a,onValueChange:o,required:i,disabled:l,name:s,autoComplete:u,form:c}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=y.useRef(null),h=aG(n,p),m=a??"",v=dz(m),b=Array.from(d).some(e=>(e.props.value??"")==="");return y.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(v!==m&&t){let n=new Event("change",{bubbles:!0});t.call(e,m),e.dispatchEvent(n)}},[v,m]),(0,g.jsxs)(oT.select,{"aria-hidden":!0,required:i,tabIndex:-1,name:s,autoComplete:u,disabled:l,form:c,onChange:e=>o(e.target.value),...t,style:{...dT,...t.style},ref:h,defaultValue:m,children:[fj(a)&&!b?(0,g.jsx)("option",{value:""}):null,Array.from(d)]},f)},"SelectBubbleInput"));function fk(e){return"function"==typeof e}function fj(e){return""===e||void 0===e}function fS(e){let t=oR(e),n=y.useRef(""),r=y.useRef(0),a=y.useCallback(e=>{t(n.current+e)},[t]),o=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,o]}function fO(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=n?e.indexOf(n):-1,o=fC(e,Math.max(a,0));1===r.length&&(o=o.filter(e=>e!==n));let i=o.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return i!==n?i:void 0}function fC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}dR(fk,"isFunction"),dR(fj,"shouldShowPlaceholder"),dR(fS,"useTypeaheadSearch"),dR(fO,"findNextItem"),dR(fC,"wrapArray");let fN=O("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);function fP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fE(e){if(Array.isArray(e))return e}function f_(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fz(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function fT(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function fA(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}function fR(e,t){return fE(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||fI(e,t)||f_()}function fL(e){return fE(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||fI(e)||f_()}function fI(e,t){if(e){if("string"==typeof e)return fP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fP(e,t)}}var fM=y.forwardRef(function(e,t){var n=fL([e,t]),r=n[0],a=n.slice(1),o=r.className,i=r.children,l=fA(r,["className","children"]),s=fR(a,1)[0];return(0,g.jsxs)(dG,fT(fz({ref:s,"data-slot":"select-trigger",className:aT("flex h-10 w-full cursor-pointer items-center justify-between gap-2 rounded-[10px] border border-input bg-card px-3 py-2 text-sm text-foreground shadow-[0_1px_2px_rgb(20_24_40/0.04)] outline-none transition-[border-color,box-shadow,background-color] hover:border-ring/35 focus-visible:border-ring/50 focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:pointer-events-none disabled:opacity-50 data-[placeholder]:text-muted-foreground [&>span]:truncate",o)},l),{children:[i,(0,g.jsx)(dY,{asChild:!0,children:(0,g.jsx)(T,{className:"size-4 shrink-0 text-muted-foreground"})})]}))});fM.displayName=dG.displayName;var fD=y.forwardRef(function(e,t){var n=fL([e,t]),r=n[0],a=n.slice(1),o=r.className,i=fA(r,["className"]),l=fR(a,1)[0];return(0,g.jsx)(fg,fT(fz({ref:l,className:aT("flex cursor-default items-center justify-center py-1",o)},i),{children:(0,g.jsx)(fN,{className:"size-4"})}))});fD.displayName=fg.displayName;var fF=y.forwardRef(function(e,t){var n=fL([e,t]),r=n[0],a=n.slice(1),o=r.className,i=fA(r,["className"]),l=fR(a,1)[0];return(0,g.jsx)(fv,fT(fz({ref:l,className:aT("flex cursor-default items-center justify-center py-1",o)},i),{children:(0,g.jsx)(T,{className:"size-4"})}))});fF.displayName=fv.displayName;var f$=y.forwardRef(function(e,t){var n=fL([e,t]),r=n[0],a=n.slice(1),o=r.className,i=r.children,l=r.position,s=void 0===l?"popper":l,u=r.sideOffset,c=fA(r,["className","children","position","sideOffset"]),d=fR(a,1)[0];return(0,g.jsx)(d1,{children:(0,g.jsxs)(d4,fT(fz({ref:d,"data-slot":"select-content",position:s,sideOffset:void 0===u?6:u,className:aT("relative z-50 max-h-[min(20rem,var(--radix-select-content-available-height))] min-w-[8rem] overflow-hidden rounded-xl border border-border/80 bg-popover text-popover-foreground shadow-[0_18px_50px_rgb(22_27_45/0.14)] data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","popper"===s&&"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o)},c),{children:[(0,g.jsx)(fD,{}),(0,g.jsx)(fa,{className:aT("p-1.5","popper"===s&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:i}),(0,g.jsx)(fF,{})]}))})});f$.displayName=d4.displayName,y.forwardRef(function(e,t){var n=fL([e,t]),r=n[0],a=n.slice(1),o=r.className,i=fA(r,["className"]),l=fR(a,1)[0];return(0,g.jsx)(fl,fz({ref:l,className:aT("px-2 py-1.5 text-xs font-semibold text-muted-foreground",o)},i))}).displayName=fl.displayName;var fU=y.forwardRef(function(e,t){var n=fL([e,t]),r=n[0],a=n.slice(1),o=r.className,i=r.children,l=fA(r,["className","children"]),s=fR(a,1)[0];return(0,g.jsxs)(fd,fT(fz({ref:s,"data-slot":"select-item",className:aT("relative flex w-full cursor-pointer select-none items-center rounded-lg py-2 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o)},l),{children:[(0,g.jsx)(fp,{children:i}),(0,g.jsx)("span",{className:"absolute right-2 flex size-4 items-center justify-center text-primary",children:(0,g.jsx)(fh,{children:(0,g.jsx)(uG,{className:"size-4",strokeWidth:2.5})})})]}))});function fH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fB(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function fK(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){fK(e,t,n[t])})}return e}function fW(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return fH(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fH(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fq(e){var t=e.open,n=e.onOpenChange,r=(0,x.Bd)().t,a=so(function(e){return e.scan}),o=so(function(e){return e.scanLoading}),i=so(function(e){return e.scanError}),l=so(function(e){return e.loadScan}),s=so(function(e){return e.importScan}),u=so(function(e){return e.providers}),c=so(function(e){return e.loadProviders}),d=fW((0,y.useState)({}),2),f=d[0],p=d[1],h=fW((0,y.useState)(!1),2),m=h[0],v=h[1],b=fW((0,y.useState)(null),2),w=b[0],k=b[1],j=fW((0,y.useState)(null),2),S=j[0],O=j[1];(0,y.useEffect)(function(){t&&(O(null),k(null),l(),c())},[t,l,c]),(0,y.useEffect)(function(){a&&p(function(e){var t={},n=!0,r=!1,o=void 0;try{for(var i,l=a[Symbol.iterator]();!(n=(i=l.next()).done);n=!0){var s=i.value,u=!0,c=!1,d=void 0;try{for(var f,p=s.candidates[Symbol.iterator]();!(u=(f=p.next()).done);u=!0){var h,m,g=f.value;t[g.id]=null!=(h=e[g.id])?h:{selected:!1,name:g.suggestedName,target:g.matchesProvider?"vault":"profile",providerId:null!=(m=g.matchesProvider)?m:"",apiKey:"",overwrite:!1}}}catch(e){c=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(c)throw d}}}}catch(e){r=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw o}}return t})},[a]);var C=(null!=a?a:[]).flatMap(function(e){return e.candidates}).filter(function(e){var t;return null==(t=f[e.id])?void 0:t.selected}),N=C.filter(function(e){var t=f[e.id],n=!e.apiKeyPresent&&!t.apiKey.trim(),r="vault"===t.target&&""!==t.providerId;return!t.name.trim()||n&&!r});return(0,g.jsx)(ll,{open:t,onOpenChange:n,children:(0,g.jsxs)(l_,{className:"flex max-h-[85vh] w-[min(56rem,calc(100vw-2rem))] max-w-3xl flex-col overflow-hidden",children:[(0,g.jsxs)(lz,{children:[(0,g.jsx)(lA,{children:r("import.title")}),(0,g.jsx)(lR,{children:r("import.intro")})]}),(0,g.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto pr-1",children:[o?(0,g.jsxs)("p",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted-foreground",children:[(0,g.jsx)(uT,{className:"size-4 animate-spin"}),r("import.scanning")]}):null,i?(0,g.jsx)("p",{className:"py-6 text-sm text-destructive",children:l6(r,i)}):null,S?(0,g.jsxs)("div",{className:"rounded-xl border border-emerald-500/40 bg-emerald-500/5 px-4 py-3 text-sm",children:[(0,g.jsxs)("p",{className:"flex items-center gap-2 font-medium",children:[(0,g.jsx)(uA,{className:"size-4 text-emerald-600"}),r("import.summary",{imported:S.imported,skipped:S.skipped,providersCreated:S.providersCreated})]}),S.warnings.map(function(e){return(0,g.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:l6(r,e)},e.key+e.scope)})]}):null,(null!=a?a:[]).map(function(e){var t,n,a;return(0,g.jsxs)("section",{className:"rounded-2xl border bg-card px-4 py-3",children:[(0,g.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,g.jsx)("h3",{className:"text-sm font-semibold",children:e.label}),e.candidates.length>0?(0,g.jsx)(aR,{variant:"secondary",children:r("import.providerCount",{count:e.candidates.length})}):null]}),(0,g.jsx)("ul",{className:"mt-2 space-y-0.5",children:e.sources.map(function(e){return(0,g.jsxs)("li",{className:"truncate font-mono text-[11px] text-muted-foreground",children:[e.path," \xb7"," ",e.exists?e.parsable?r("import.sourceRead"):r("import.sourceUnparsable"):r("import.sourceMissing")]},e.key)})}),0===e.candidates.length?(0,g.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:(t=r,(n=e).note||n.noteCode?l6(t,{key:null!=(a=n.noteCode)?a:"scan.note.unknown",fallback:n.note}):"")}):(0,g.jsx)("ul",{className:"mt-3 space-y-3",children:e.candidates.map(function(e){return(0,g.jsx)(fZ,{candidate:e,choice:f[e.id],providers:null!=u?u:[],onChange:function(t){var n;return n=e.id,void p(function(e){var r,a;return r=fV({},e),a=null!=(a=fK({},n,fV({},e[n],t)))?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(a)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(a,e))}),r})}},e.id)})})]},e.harness)})]}),w?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(r,w)}):null,(0,g.jsxs)(lT,{className:"items-center",children:[(0,g.jsx)("span",{className:"mr-auto text-xs text-muted-foreground",children:C.length>0?r("import.selected",{count:C.length}):r("import.selectPrompt")}),(0,g.jsxs)(or,{variant:"outline",onClick:function(){l()},disabled:o,children:[(0,g.jsx)(P,{}),r("import.rescan")]}),(0,g.jsxs)(or,{disabled:0===C.length||N.length>0||m,onClick:function(){var e;(e=function(){var e;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:v(!0),k(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,s(C.map(function(e){var t=f[e.id];return fV({id:e.id,name:t.name.trim(),target:t.target},"vault"===t.target&&t.providerId?{providerId:t.providerId}:{},t.apiKey.trim()?{apiKey:t.apiKey.trim()}:{},t.overwrite?{overwrite:!0}:{})}))];case 2:return O({imported:(e=t.sent()).imported,skipped:e.skipped,providersCreated:e.providersCreated,warnings:e.warnings.map(l2)}),p({}),[3,5];case 3:return k(l3(t.sent(),"import.failed")),[3,5];case 4:return v(!1),[7];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){fB(o,r,a,i,l,"next",e)}function l(e){fB(o,r,a,i,l,"throw",e)}i(void 0)})})()},children:[m?(0,g.jsx)(uT,{className:"animate-spin"}):null,r("import.importSelected")]})]})]})})}function fZ(e){var t=e.candidate,n=e.choice,r=e.providers,a=e.onChange,o=(0,x.Bd)().t;if(!n)return null;var i="vault"===n.target&&""!==n.providerId,l=!t.apiKeyPresent&&!i;return(0,g.jsx)("li",{className:"rounded-xl border bg-background px-3 py-3",children:(0,g.jsxs)("div",{className:"flex items-start gap-3",children:[(0,g.jsx)(uQ,{className:"mt-1",checked:n.selected,onCheckedChange:function(e){return a({selected:!0===e})},"aria-label":o("import.select",{name:t.sourceKey})}),(0,g.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,g.jsx)("span",{className:"truncate font-mono text-sm",children:t.sourceKey}),t.active?(0,g.jsx)(aR,{children:o("import.inUse")}):null,t.conflictsWith?(0,g.jsx)(aR,{variant:"secondary",children:o("import.nameTaken")}):null,t.matchesProvider?(0,g.jsx)(aR,{variant:"secondary",children:o("import.matchesProvider",{name:t.matchesProvider})}):null]}),(0,g.jsxs)("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[t.baseUrl||o("import.noBaseUrl"),t.model?" \xb7 ".concat(t.model):"",t.apiKeyPresent?" \xb7 ".concat(t.apiKeyPreview):" \xb7 ".concat(o("import.keyOutsideConfig"))]}),n.selected?(0,g.jsxs)("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)(u1,{htmlFor:"name-".concat(t.id),children:o("import.profileName")}),(0,g.jsx)(uY,{id:"name-".concat(t.id),value:n.name,onChange:function(e){return a({name:e.target.value})}})]}),(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)(u1,{htmlFor:"target-".concat(t.id),children:o("import.credentialTarget")}),(0,g.jsxs)(dJ,{value:"vault"===n.target?n.providerId||"new-vault":"profile",onValueChange:function(e){return a("profile"===e?{target:"profile",providerId:""}:"new-vault"===e?{target:"vault",providerId:""}:{target:"vault",providerId:e})},children:[(0,g.jsx)(fM,{id:"target-".concat(t.id),children:(0,g.jsx)(dQ,{})}),(0,g.jsxs)(f$,{children:[(0,g.jsx)(fU,{value:"profile",children:o("import.targetProfile")}),(0,g.jsx)(fU,{value:"new-vault",children:o("import.targetNewVault")}),r.map(function(e){return(0,g.jsx)(fU,{value:e.id,children:o("import.targetExisting",{name:e.name})},e.id)})]})]})]}),l?(0,g.jsxs)("div",{className:"space-y-1.5 sm:col-span-2",children:[(0,g.jsx)(u1,{htmlFor:"key-".concat(t.id),children:"API key"}),(0,g.jsx)(uY,{id:"key-".concat(t.id),type:"password",value:n.apiKey,placeholder:o("import.apiKeyFromEnv"),onChange:function(e){return a({apiKey:e.target.value})}})]}):null,t.conflictsWith?(0,g.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground sm:col-span-2",children:[(0,g.jsx)(uQ,{checked:n.overwrite,onCheckedChange:function(e){return a({overwrite:!0===e})}}),o("import.overwriteExisting")]}):null]}):null]})]})})}fU.displayName=fd.displayName,y.forwardRef(function(e,t){var n=fL([e,t]),r=n[0],a=n.slice(1),o=r.className,i=fA(r,["className"]),l=fR(a,1)[0];return(0,g.jsx)(fx,fz({ref:l,className:aT("-mx-1 my-1 h-px bg-border",o)},i))}).displayName=fx.displayName;let fJ=O("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);function fG(){var e=(0,x.Bd)().t,t=(0,x.s9)(),n=t.language,r=t.setLanguage,a="en"===n,o=e(a?"language.toChinese":"language.toEnglish");return(0,g.jsxs)(or,{type:"button",size:"sm",variant:"outline","aria-label":o,title:o,onClick:function(){return r(a?"zh-CN":"en")},children:[(0,g.jsx)(fJ,{}),(0,g.jsx)("span",{className:"hidden sm:inline",children:e("language.short")})]})}function fQ(){var e=(0,x.Bd)().t,t=so(function(e){return e.notice}),n=so(function(e){return e.clearNotice});return((0,y.useEffect)(function(){if(t){var e=window.setTimeout(function(){return n()},8e3);return function(){return window.clearTimeout(e)}}},[t,n]),t)?(0,g.jsxs)("div",{role:"status",className:"fixed bottom-4 right-4 z-50 w-[min(28rem,calc(100vw-2rem))] rounded-2xl border bg-card p-4 shadow-[0_18px_50px_-24px_rgb(36_39_70/0.45)]",children:[(0,g.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,g.jsx)("p",{className:"text-sm font-medium",children:e("notice.title")}),(0,g.jsx)(or,{size:"sm",variant:"ghost",onClick:n,children:e("notice.close")})]}),t.map(function(t){var n;return(0,g.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:l6(e,t)},"".concat(t.key,"-").concat(null!=(n=t.scope)?n:""))})]}):null}let fY=O("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);function fX(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f0(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function f1(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return fX(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fX(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f2(e){var t,n,r=e.harnessId,a=e.open,o=e.onOpenChange,i=(0,x.s9)().locale,l=(0,x.Bd)().t,s=so(function(e){return e.operations}),u=so(function(e){return e.operationsLoading}),c=so(function(e){return e.operationsError}),d=so(function(e){return e.loadOperations}),f=so(function(e){return e.undoOperation}),p=f1((0,y.useState)(null),2),h=p[0],m=p[1],v=f1((0,y.useState)(!1),2),b=v[0],w=v[1],k=f1((0,y.useState)(null),2),j=k[0],S=k[1],O=null!=(t=null==s?void 0:s.filter(function(e){return e.harness===r}))?t:[],C=M[r];return(0,y.useEffect)(function(){a&&(S(null),d(r))},[a,r,d]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(ll,{open:a,onOpenChange:o,children:(0,g.jsxs)(l_,{className:"flex max-h-[85vh] w-[min(52rem,calc(100vw-2rem))] max-w-2xl flex-col gap-0 overflow-hidden p-0",children:[(0,g.jsxs)(lz,{className:"shrink-0 space-y-1.5 px-6 pb-4 pt-6 pr-12",children:[(0,g.jsx)(lA,{children:l("operations.titleFor",{harness:C})}),(0,g.jsx)(lR,{children:l("operations.intro")})]}),(0,g.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-6",children:[u&&0===O.length?(0,g.jsxs)("p",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted-foreground",children:[(0,g.jsx)(uT,{className:"size-4 animate-spin"}),l("operations.loading")]}):null,c?(0,g.jsx)("p",{className:"py-6 text-sm text-destructive",children:l6(l,c)}):null,u||0!==O.length?null:(0,g.jsx)("p",{className:"py-10 text-center text-sm text-muted-foreground",children:l("operations.empty")}),O.length>0?(0,g.jsx)("ul",{className:"divide-y rounded-xl border",children:O.map(function(e){var t,n,r,a,o;return(0,g.jsxs)("li",{className:"flex items-center gap-3 px-3 py-2.5",children:[(0,g.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,g.jsxs)("span",{className:"truncate text-sm font-medium",children:[l("operations.kind.".concat(e.kind))," \xb7 ",e.profile]}),(0,g.jsx)(aR,{variant:"degraded"===(n=e.state)?"destructive":"committed"===n?"default":"secondary",children:l("operations.state.".concat(e.state))})]}),(0,g.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[(r=null!=(t=e.finishedAt)?t:e.startedAt,a=i,Number.isNaN((o=new Date(r)).getTime())?r:o.toLocaleString(a))," \xb7"," ",l("operations.user",{user:e.user})," \xb7"," ",l("operations.fileCount",{count:e.files.length})]}),e.note?(0,g.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:e.note}):null]}),(0,g.jsxs)(or,{size:"sm",variant:"outline",className:"shrink-0",disabled:!e.undoable,onClick:function(){return m(e)},children:[(0,g.jsx)(fY,{}),l("operations.undo")]})]},e.id)})}):null]}),(0,g.jsx)(lT,{className:"shrink-0 px-6 py-4",children:(0,g.jsx)(or,{onClick:function(){return o(!1)},children:l("operations.close")})})]})}),(0,g.jsx)(ll,{open:null!==h,onOpenChange:function(e){return!e&&m(null)},children:(0,g.jsxs)(l_,{className:"max-w-lg",children:[(0,g.jsxs)(lz,{children:[(0,g.jsx)(lA,{children:l("operations.undoTitle")}),(0,g.jsx)(lR,{children:h?l("operations.undoBody",{harness:null!=(n=M[h.harness])?n:h.harness,count:h.files.length}):""})]}),j?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(l,j)}):null,(0,g.jsxs)(lT,{children:[(0,g.jsx)(or,{variant:"outline",onClick:function(){return m(null)},children:l("common.cancel")}),(0,g.jsxs)(or,{disabled:b,onClick:function(){var e;(e=function(){return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:if(!h)return[2];w(!0),S(null),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,f(h.id)];case 2:return e.sent(),m(null),[3,5];case 3:return S(l3(e.sent(),"operations.undoFailed")),[3,5];case 4:return w(!1),[7];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){f0(o,r,a,i,l,"next",e)}function l(e){f0(o,r,a,i,l,"throw",e)}i(void 0)})})()},children:[b?(0,g.jsx)(uT,{className:"animate-spin"}):null,l("operations.confirmUndo")]})]})]})})]})}function f4(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f3(e){var t,n,r=e.harness,a=(0,x.Bd)().t,o=so(function(e){return e.operations}),i=so(function(e){return e.operationsLoading}),l=so(function(e){return e.operationsError}),s=so(function(e){return e.loadOperations}),u=function(e){if(Array.isArray(e))return e}(t=(0,y.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(a.push(t.value),2!==a.length);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw n}}return a}}(t)||function(e){if(e){if("string"==typeof e)return f4(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return f4(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=u[0],d=u[1],f=null!=(n=null==o?void 0:o.filter(function(e){return e.harness===r.id}))?n:[];return(0,y.useEffect)(function(){s(r.id)},[r.id,s]),(0,g.jsxs)("section",{className:"rounded-2xl border bg-card p-5 shadow-[0_12px_34px_-28px_rgb(36_39_70/0.38)]",children:[(0,g.jsxs)("div",{className:"flex items-center gap-2",children:[(0,g.jsx)(rN,{className:"size-4 text-primary"}),(0,g.jsx)("h3",{className:"font-semibold",children:a("operations.title")}),(0,g.jsx)("span",{className:"ml-auto",children:(0,g.jsx)(or,{size:"icon",variant:"ghost","aria-label":a("operations.refresh"),onClick:function(){s(r.id)},children:(0,g.jsx)(sc,{className:i?"animate-spin":void 0})})})]}),(0,g.jsx)("div",{className:"mt-4",children:l?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(a,l)}):null===o||i?(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:a("operations.loading")}):0===f.length?(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:a("operations.empty")}):(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:a("operations.count",{count:f.length})})}),(0,g.jsx)(or,{className:"mt-4 w-full",size:"sm",variant:"outline",disabled:null===o,onClick:function(){return d(!0)},children:a("operations.viewDetails")}),(0,g.jsx)(f2,{harnessId:r.id,open:c,onOpenChange:d})]})}let f5=O("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),f6=O("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),f8=O("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);function f9(e){var t=e.result,n=(0,x.Bd)().t;if(t.ok){var r,a,o,i,l=null!=(a=null==(i=t.models)?void 0:i.length)?a:0;return(0,g.jsxs)("span",{className:"flex items-center gap-1.5 text-sm text-emerald-600 dark:text-emerald-400",children:[(0,g.jsx)(uA,{className:"size-4 shrink-0","aria-hidden":!0}),n(l>0?"probe.ok":"probe.okNoCatalog",{latencyMs:null!=(o=t.latencyMs)?o:"?",count:l})]})}return(0,g.jsxs)("span",{className:"flex items-center gap-1.5 text-sm text-destructive",children:[(0,g.jsx)(f8,{className:"size-4 shrink-0","aria-hidden":!0}),l6(n,l2({code:t.code,params:t.params,message:null!=(r=t.message)?r:""}))]})}function f7(e){var t=e.className,n=function(e,t){if(null==e)return{};var n,r,a,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(a=0,n=Reflect.ownKeys(Object(e));a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n]);return a}(e,t),Object.getOwnPropertySymbols)for(a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,["className"]);return(0,g.jsx)("textarea",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"textarea",className:aT("flex min-h-[60px] w-full rounded-[10px] border border-input bg-card px-3 py-2 text-base shadow-[0_1px_2px_rgb(20_24_40/0.04)] transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:border-ring/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t)},n))}function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function pn(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function pr(e){return function(e){if(Array.isArray(e))return pe(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return pe(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return pe(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var pa=[{id:"openrouter",baseUrl:"https://openrouter.ai/api/v1"},{id:"zai",baseUrl:"https://api.z.ai/api/paas/v4",model:"glm-4.6"},{id:"moonshot",baseUrl:"https://api.moonshot.cn/v1"},{id:"deepseek",baseUrl:"https://api.deepseek.com/v1"}],po={id:"cliproxyResponses",baseUrl:"https://api.seavey.ai/cliproxy/v1",model:"gpt-5.6-sol"},pi={claude:[{id:"zaiAnthropic",baseUrl:"https://api.z.ai/api/anthropic",model:"glm-4.6"},{id:"moonshotAnthropic",baseUrl:"https://api.moonshot.cn/anthropic"},{id:"deepseekAnthropic",baseUrl:"https://api.deepseek.com/anthropic"}],codex:pa,kimi:pa,pi:[pn(pt({},po),{extras:{api:"openai-responses",reasoning:"true"}})].concat(pr(pa)),dsh:[pn(pt({},po),{extras:{api:"openai-responses",reasoningEfforts:"low,medium,high,xhigh,max"}})].concat(pr(pa))};function pl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ps(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function pu(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){ps(o,r,a,i,l,"next",e)}function l(e){ps(o,r,a,i,l,"throw",e)}i(void 0)})}}function pc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){pc(e,t,n[t])})}return e}function pf(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function pp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||ph(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ph(e,t){if(e){if("string"==typeof e)return pl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pl(e,t)}}function pm(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var pg=[{role:"Sonnet",modelKey:"sonnetModel",nameKey:"sonnetModelName",oneMKey:"sonnetModel1m"},{role:"Opus",modelKey:"opusModel",nameKey:"opusModelName",oneMKey:"opusModel1m"},{role:"Fable",modelKey:"fableModel",nameKey:"fableModelName",oneMKey:"fableModel1m"},{role:"Haiku",modelKey:"haikuModel",nameKey:"haikuModelName",oneMKey:null}],py="subagentModel",pv="subagentModel1m",pb=new Set(((function(e){if(Array.isArray(e))return pl(e)})(c=pg.flatMap(function(e){var t=e.modelKey,n=e.nameKey,r=e.oneMKey;return r?[t,n,r]:[t,n]}))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(c)||ph(c)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([py,pv]));function px(e){var t,n,r,a,o,i,l,s,u,c=e.harness,d=e.profile,f=e.onOpenChange,p=(0,x.Bd)().t,h=so(function(e){return e.createProfile}),m=so(function(e){return e.updateProfile}),v=so(function(e){return e.previewProfile}),b=so(function(e){return e.providers}),w=so(function(e){return e.loadProviders}),k=so(function(e){return e.probeDraft}),j=so(function(e){return e.probeProfile}),S=null!==d,O=pp((0,y.useState)(null!=(t=null==d?void 0:d.name)?t:""),2),C=O[0],N=O[1],P=pp((0,y.useState)(null!=(n=null==d?void 0:d.baseUrl)?n:""),2),E=P[0],_=P[1],z=pp((0,y.useState)(""),2),A=z[0],R=z[1],L=pp((0,y.useState)(null!=(r=null==d?void 0:d.model)?r:""),2),I=L[0],M=L[1],D=pp((0,y.useState)(null!=(a=null==d?void 0:d.notes)?a:""),2),F=D[0],$=D[1],U=pp((0,y.useState)(function(){return function(e,t){var n={},r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var s,u,c=i.value;n[c.key]=null!=(s=null!=(u=null==t?void 0:t.extras[c.key])?u:c.defaultValue)?s:""}}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(c.fields,d)}),2),H=U[0],B=U[1],K=pp((0,y.useState)({}),2),V=K[0],W=K[1],q=pp((0,y.useState)(null!=(o=null==d?void 0:d.providerId)?o:""),2),Z=q[0],J=q[1],G=pp((0,y.useState)(null!=(i=null==d?void 0:d.providerEndpoint)?i:""),2),Q=G[0],Y=G[1],X=pp((0,y.useState)(!1),2),ee=X[0],et=X[1],en=pp((0,y.useState)(null),2),er=en[0],ea=en[1],eo=pp((0,y.useState)(null),2),ei=eo[0],el=eo[1],es=pp((0,y.useState)(!1),2),eu=es[0],ec=es[1],ed=pp((0,y.useState)({}),2),ef=ed[0],ep=ed[1],eh=pp((0,y.useState)(!1),2),em=eh[0],eg=eh[1],ey=pp((0,y.useState)(null),2),ev=ey[0],eb=ey[1],ex=null!=b?b:[],ew=null!=(l=ex.find(function(e){return e.id===Z}))?l:null,ek=null==ew?void 0:ew.endpoints.find(function(e){return e.key===Q}),ej=(null==ev?void 0:ev.ok)&&null!=(s=ev.models)?s:[];(0,y.useEffect)(function(){eb(null)},[E,A,Z,Q]);var eS=null!==b&&""!==Z&&null===ew,eO=null!==ew&&""!==Q&&void 0===ek,eC="claude"===c.id?c.fields.filter(function(e){return!pb.has(e.key)}):c.fields,eN="claude"===c.id?eC.filter(function(e){return"authVar"===e.key}):eC,eP="claude"===c.id?eC.filter(function(e){return"authVar"!==e.key}):[];function eE(){return pu(function(){var e;return pm(this,function(t){switch(t.label){case 0:if(!d)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,v(c.id,d.name)];case 2:return ea(e=t.sent()),W(Object.fromEntries(e.filter(function(e){return e.overridden}).map(function(e){return[e.key,e.content]}))),[3,4];case 3:return el(l4(t.sent())),[3,4];case 4:return[2]}})})()}function e_(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];ep(function(e){if(!t.some(function(t){return e[t]}))return e;var n=pd({},e),r=!0,a=!1,o=void 0;try{for(var i,l=t[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var s=i.value;delete n[s]}}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n})}function ez(){var e;return ew&&Q&&null!=(e=null==ek?void 0:ek.baseUrl)?e:E}return(0,y.useEffect)(function(){null===b&&w()},[b,w]),(0,g.jsx)(ll,{open:!0,onOpenChange:f,children:(0,g.jsx)(l_,{className:"max-h-[92vh] w-[calc(100vw-2rem)] overflow-hidden p-0 sm:max-w-[1120px]",children:(0,g.jsxs)("form",{onSubmit:function(e){return pu(function(){var t,n;return pm(this,function(r){switch(r.label){case 0:if(e.preventDefault(),!function(){var e={},t=C.trim();t?t.includes("/")||t.includes("\\")?e.name={key:"profile.error.nameSlash"}:t.length>120&&(e.name={key:"profile.error.nameTooLong",params:{max:120}}):e.name={key:"profile.error.nameRequired"},ez().trim()||(e.baseUrl={key:"profile.error.baseUrlRequired"}),S||null!==ew||A.trim()||(e.apiKey={key:"profile.error.apiKeyRequired"}),c.modelRequired&&!I.trim()&&(e.model={key:"profile.error.modelRequired"}),eS&&(e.providerId={key:"profile.error.providerGone"}),eO&&(e.providerEndpoint={key:"profile.error.endpointGone"});var n=!0,r=!1,a=void 0;try{for(var o,i=c.fields[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var l,s=o.value;!s.required||(null==(l=H[s.key])?void 0:l.trim())||(e["extra:".concat(s.key)]={key:"profile.error.fieldRequired",params:{label:s.label}})}}catch(e){r=!0,a=e}finally{try{n||null==i.return||i.return()}finally{if(r)throw a}}return ep(e),!(Object.keys(e).length>0)||(el({key:"profile.error.checkFields"}),!1)}())return[2];ec(!0),el(null),r.label=1;case 1:if(r.trys.push([1,6,7,8]),n=pd({name:C,baseUrl:ew&&Q&&null!=(t=null==ek?void 0:ek.baseUrl)?t:E,model:I,notes:F,extras:H},Z?pd({providerId:Z},Q?{providerEndpoint:Q}:{}):S?{providerId:""}:{},ew?{}:{apiKey:A||void 0}),!S)return[3,3];return[4,m(c.id,d.name,pf(pd({},n),{overrides:V}))];case 2:return r.sent(),[3,5];case 3:return[4,h(c.id,n)];case 4:r.sent(),r.label=5;case 5:return f(!1),[3,8];case 6:return el(l4(r.sent())),[3,8];case 7:return ec(!1),[7];case 8:return[2]}})})()},noValidate:!0,className:"flex max-h-[92vh] min-h-0 flex-col",children:[(0,g.jsxs)(lz,{className:"shrink-0 border-b bg-card px-6 py-5 pr-12",children:[(0,g.jsx)(lA,{children:S?p("profile.editTitle",{harness:c.label,profile:d.name}):p("profile.createTitle",{harness:c.label})}),(0,g.jsxs)(lR,{children:[p("profile.intro",{targets:c.targets.map(function(e){return e.label}).join(p("common.listSeparator"))}),"additive"===c.mode?p("profile.additiveNote"):""]})]}),(0,g.jsxs)("div",{"data-slot":"profile-dialog-scroll",className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 py-5",children:[(0,g.jsxs)("div",{"data-slot":"provider-reference-fields",className:"space-y-3 rounded-xl border p-3",children:[(0,g.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,g.jsx)(u1,{htmlFor:"provider-select",className:"font-medium",children:p("profile.useSharedProvider")}),ew?(0,g.jsx)(aR,{variant:"secondary",children:p("profile.keyFromVault")}):null]}),(0,g.jsxs)(dJ,{value:Z,onValueChange:function(e){J(e);var t,n,r=ex.find(function(t){return t.id===e});Y(null!=(t=null==r||null==(n=r.endpoints[0])?void 0:n.key)?t:""),e_("providerId","providerEndpoint","baseUrl","apiKey")},children:[(0,g.jsx)(fM,{id:"provider-select","aria-label":p("profile.useSharedProviderLabel"),"aria-invalid":!!ef.providerId||void 0,"aria-describedby":ef.providerId?"provider-select-error":void 0,children:(0,g.jsx)(dQ,{placeholder:p("profile.providerNone")})}),(0,g.jsxs)(f$,{children:[(0,g.jsx)(fU,{value:"",children:p("profile.providerNone")}),ex.map(function(e){return(0,g.jsx)(fU,{value:e.id,children:e.name},e.id)})]})]}),ef.providerId?(0,g.jsx)("p",{id:"provider-select-error",className:"text-xs text-destructive",children:l6(p,ef.providerId)}):null,0===ex.length?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:p("profile.vaultEmpty")}):null,ew?(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"provider-endpoint",children:p("profile.namedEndpoint")}),(0,g.jsxs)(dJ,{value:Q,onValueChange:function(e){Y(e),e_("providerEndpoint","baseUrl")},children:[(0,g.jsx)(fM,{id:"provider-endpoint","aria-label":p("profile.namedEndpointLabel"),"aria-invalid":!!ef.providerEndpoint||void 0,"aria-describedby":ef.providerEndpoint?"provider-endpoint-error":void 0,children:(0,g.jsx)(dQ,{placeholder:p("profile.endpointNone")})}),(0,g.jsxs)(f$,{children:[(0,g.jsx)(fU,{value:"",children:p("profile.endpointNone")}),ew.endpoints.map(function(e){return(0,g.jsx)(fU,{value:e.key,children:e.label?p("profile.endpointOption",{label:e.label,key:e.key}):e.key},e.key)})]})]}),ef.providerEndpoint?(0,g.jsx)("p",{id:"provider-endpoint-error",className:"text-xs text-destructive",children:l6(p,ef.providerEndpoint)}):null,0===ew.endpoints.length?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:p("profile.noEndpoints")}):null]}):null]}),(0,g.jsx)(pk,{harnessId:c.id,onPick:function(e){_(e.baseUrl),e_("baseUrl"),e.model&&(M(e.model),e_("model")),e.extras&&B(function(t){return pd({},t,e.extras)})}}),(0,g.jsxs)("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[(0,g.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,g.jsx)(u1,{htmlFor:"name",children:p("profile.name")}),(0,g.jsx)(uY,{id:"name",value:C,onChange:function(e){N(e.target.value),e_("name")},placeholder:p("profile.namePlaceholder"),"aria-invalid":!!ef.name||void 0,"aria-describedby":ef.name?"profile-name-error":void 0}),ef.name?(0,g.jsx)("p",{id:"profile-name-error",className:"text-xs text-destructive",children:l6(p,ef.name)}):null,S?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:p("profile.renameHint")}):null]}),(0,g.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,g.jsx)(u1,{htmlFor:"baseUrl",children:p("profile.baseUrl")}),(0,g.jsx)(uY,{id:"baseUrl",value:ew&&Q&&null!=(u=null==ek?void 0:ek.baseUrl)?u:E,onChange:function(e){_(e.target.value),e_("baseUrl")},placeholder:p("profile.baseUrlPlaceholder"),disabled:null!==ew&&""!==Q,"aria-invalid":!!ef.baseUrl||void 0,"aria-describedby":ef.baseUrl?"profile-base-url-error":void 0}),ef.baseUrl?(0,g.jsx)("p",{id:"profile-base-url-error",className:"text-xs text-destructive",children:l6(p,ef.baseUrl)}):null,ew&&Q?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:p("profile.baseUrlFromVault",{endpoint:Q})}):null]}),(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"apiKey",children:p("profile.apiKey")}),(0,g.jsx)(uY,{id:"apiKey",type:"password",value:A,onChange:function(e){R(e.target.value),e_("apiKey")},placeholder:ew?p("profile.keyFromVault"):S?p("profile.apiKeyKeep"):p("profile.apiKeyRequiredPlaceholder"),disabled:null!==ew,"aria-invalid":!!ef.apiKey||void 0,"aria-describedby":ef.apiKey?"profile-api-key-error":void 0}),ef.apiKey?(0,g.jsx)("p",{id:"profile-api-key-error",className:"text-xs text-destructive",children:l6(p,ef.apiKey)}):null,ew?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:p("profile.apiKeySharedHint")}):null]}),(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"model",children:"claude"===c.id?p("profile.fallbackModel"):p("profile.model")}),(0,g.jsx)(uY,{id:"model",value:I,list:ej.length>0?"profile-model-options":void 0,onChange:function(e){M(e.target.value),e_("model")},placeholder:"claude"===c.id?p("profile.fallbackModelPlaceholder"):p("profile.modelPlaceholder"),"aria-invalid":!!ef.model||void 0,"aria-describedby":ef.model?"profile-model-error":void 0}),ej.length>0?(0,g.jsx)("datalist",{id:"profile-model-options",children:ej.map(function(e){return(0,g.jsx)("option",{value:e},e)})}):null,ef.model?(0,g.jsx)("p",{id:"profile-model-error",className:"text-xs text-destructive",children:l6(p,ef.model)}):null,"claude"===c.id?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:p("profile.claudeModelHint")}):null]}),(0,g.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,g.jsxs)(or,{type:"button",variant:"outline",size:"sm",onClick:function(){return pu(function(){var e,t;return pm(this,function(n){switch(n.label){case 0:if(!(e=ez().trim()))return ep(function(e){return pf(pd({},e),{baseUrl:{key:"profile.error.baseUrlRequired"}})}),[2];eg(!0),el(null),eb(null),n.label=1;case 1:if(n.trys.push([1,7,8,9]),!(ew||A.trim()))return[3,3];return[4,k(pd({baseUrl:e},ew?{providerId:Z}:{apiKey:A}))];case 2:case 4:return t=n.sent(),[3,6];case 3:if(!(S&&d))return[3,5];return[4,j(c.id,d.name)];case 5:return ep(function(e){return pf(pd({},e),{apiKey:{key:"profile.error.apiKeyRequired"}})}),[2];case 6:return eb(t),[3,9];case 7:return el(l4(n.sent())),[3,9];case 8:return eg(!1),[7];case 9:return[2]}})})()},disabled:em,children:[em?(0,g.jsx)(uT,{className:"animate-spin"}):null,em?p("probe.probing"):p("probe.action")]}),ev?(0,g.jsx)(f9,{result:ev}):null]}),(null==ev?void 0:ev.ok)&&ej.length>0?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:p("probe.catalogHint")}):null]}),eN.map(function(e){var t;return(0,g.jsx)(pj,{field:e,value:null!=(t=H[e.key])?t:"",error:ef["extra:".concat(e.key)],onChange:function(t){B(function(n){return pf(pd({},n),pc({},e.key,t))}),e_("extra:".concat(e.key))}},e.key)}),"claude"===c.id?(0,g.jsx)(pC,{fields:c.fields,values:H,errors:ef,onChange:function(e,t){B(function(n){return pf(pd({},n),pc({},e,t))}),e_("extra:".concat(e))}}):null,eP.map(function(e){var t;return(0,g.jsx)(pj,{field:e,value:null!=(t=H[e.key])?t:"",error:ef["extra:".concat(e.key)],onChange:function(t){B(function(n){return pf(pd({},n),pc({},e.key,t))}),e_("extra:".concat(e.key))}},e.key)}),(0,g.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,g.jsx)(u1,{htmlFor:"notes",children:p("profile.notes")}),(0,g.jsx)(f7,{id:"notes",rows:2,value:F,onChange:function(e){return $(e.target.value)}})]})]}),(0,g.jsxs)("div",{className:"rounded-xl border",children:[(0,g.jsxs)("button",{type:"button",onClick:function(){var e=!ee;et(e),e&&null===er&&eE()},className:"flex w-full cursor-pointer items-center gap-2 px-3 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground active:bg-accent/80 ".concat(ee?"rounded-t-xl":"rounded-xl"),children:[ee?(0,g.jsx)(T,{className:"size-4"}):(0,g.jsx)(f5,{className:"size-4"}),p("profile.advanced"),d&&d.overriddenTargets.length>0?(0,g.jsx)(aR,{variant:"secondary",children:p("profile.overridden")}):null]}),ee?(0,g.jsx)("div",{className:"space-y-4 border-t px-3 py-3",children:S?(0,g.jsx)(pw,{targets:er,overrides:V,onEdit:function(e,t){return W(function(n){return pf(pd({},n),pc({},e,t))})},onReset:function(e){W(function(t){var n=pd({},t);return delete n[e],n}),eE()}}):(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:p("profile.saveFirst")})}):null]}),ei?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(p,ei)}):null]}),(0,g.jsxs)(lT,{className:"shrink-0 border-t bg-card px-6 py-4",children:[(0,g.jsx)(or,{type:"button",variant:"outline",onClick:function(){return f(!1)},children:p("common.cancel")}),(0,g.jsx)(or,{type:"submit",disabled:eu,children:eu?p("profile.saving"):p("profile.save")})]})]})})})}function pw(e){var t=e.targets,n=e.overrides,r=e.onEdit,a=e.onReset,o=(0,x.Bd)().t;return null===t?(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:o("profile.rawLoading")}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:o("profile.rawIntro")}),t.map(function(e){var t,i=void 0!==n[e.key];return(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,g.jsx)(u1,{htmlFor:"raw-".concat(e.key),className:"font-mono text-xs",children:e.path}),i?(0,g.jsxs)(or,{type:"button",size:"sm",variant:"ghost",onClick:function(){return a(e.key)},children:[(0,g.jsx)(f6,{}),o("profile.resetToGenerated")]}):null]}),(0,g.jsx)(f7,{id:"raw-".concat(e.key),rows:10,spellCheck:!1,className:"font-mono text-xs",value:null!=(t=n[e.key])?t:e.content,onChange:function(t){return r(e.key,t.target.value)}})]},e.key)})]})}function pk(e){var t,n=e.harnessId,r=e.onPick,a=(0,x.Bd)().t,o=null!=(t=pi[n])?t:[];return 0===o.length?null:(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,g.jsx)("span",{className:"text-xs text-muted-foreground",children:a("profile.quickFill")}),o.map(function(e){return(0,g.jsx)(or,{type:"button",size:"sm",variant:"outline",onClick:function(){return r(e)},children:a("preset.".concat(e.id))},e.id)})]})}function pj(e){var t,n,r=e.field,a=e.value,o=e.error,i=e.onChange,l=(0,x.Bd)().t,s="extra-".concat(r.key);return(0,g.jsxs)("div",{className:"textarea"===r.kind||r.fullWidth?"space-y-2 sm:col-span-2":"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:s,children:r.label}),"select"===r.kind?(0,g.jsxs)(dJ,{value:a,onValueChange:i,children:[(0,g.jsx)(fM,{id:s,"aria-label":r.label,"aria-invalid":!!o||void 0,"aria-describedby":o?"".concat(s,"-error"):void 0,children:(0,g.jsx)(dQ,{placeholder:null!=(t=r.placeholder)?t:l("profile.selectPlaceholder")})}),(0,g.jsx)(f$,{children:null==(n=r.options)?void 0:n.map(function(e){return(0,g.jsx)(fU,{value:e.value,children:e.label},e.value)})})]}):"textarea"===r.kind?(0,g.jsx)(f7,{id:s,rows:3,value:a,placeholder:r.placeholder,className:"font-mono text-xs","aria-invalid":!!o||void 0,"aria-describedby":o?"".concat(s,"-error"):void 0,onChange:function(e){return i(e.target.value)}}):(0,g.jsx)(uY,{id:s,type:"password"===r.kind?"password":"text",value:a,placeholder:r.placeholder,"aria-invalid":!!o||void 0,"aria-describedby":o?"".concat(s,"-error"):void 0,onChange:function(e){return i(e.target.value)}}),o?(0,g.jsx)("p",{id:"".concat(s,"-error"),className:"text-xs text-destructive",children:l6(l,o)}):null,r.help?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:r.help}):null]})}var pS="md:grid-cols-[6.5rem_minmax(0,1fr)_minmax(0,1fr)_8.5rem]",pO="grid gap-2 rounded-lg border bg-card/70 p-3 ".concat(pS," md:items-start md:gap-3 md:border-0 md:bg-transparent md:p-0");function pC(e){var t,n=e.fields,r=e.values,a=e.errors,o=e.onChange,i=(0,x.Bd)().t,l=new Map(n.map(function(e){return[e.key,e]})),s=l.get(py);return(0,g.jsxs)("section",{"data-slot":"claude-model-mapping",className:"space-y-4 rounded-xl border bg-muted/15 p-4 sm:col-span-2 sm:p-5",children:[(0,g.jsxs)("div",{className:"space-y-1",children:[(0,g.jsx)("h3",{className:"text-base font-semibold",children:i("profile.mapping.title")}),(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:i("profile.mapping.intro")})]}),(0,g.jsxs)("div",{className:"hidden gap-3 px-1 text-xs font-medium text-muted-foreground md:grid ".concat(pS),children:[(0,g.jsx)("span",{children:i("profile.mapping.role")}),(0,g.jsx)("span",{children:i("profile.mapping.displayName")}),(0,g.jsx)("span",{children:i("profile.mapping.actualModel")}),(0,g.jsx)("span",{children:i("profile.mapping.oneM")})]}),(0,g.jsxs)("div",{className:"space-y-3",children:[pg.map(function(e){var t,n,s,u=e.role,c=e.modelKey,d=e.nameKey,f=e.oneMKey,p=l.get(c),h=l.get(d);if(!p||!h)return null;var m=a["extra:".concat(c)],y=a["extra:".concat(d)];return(0,g.jsxs)("div",{className:pO,children:[(0,g.jsxs)("div",{className:"flex h-10 items-center rounded-lg border bg-muted/45 px-3 text-sm font-medium",children:[u,p.required?(0,g.jsx)("span",{className:"ml-1 text-destructive",children:"*"}):null]}),(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)(u1,{htmlFor:"extra-".concat(d),className:"text-xs md:sr-only",children:h.label}),(0,g.jsx)(uY,{id:"extra-".concat(d),value:null!=(t=r[d])?t:"",placeholder:(null==(s=r[c])?void 0:s.trim())?i("profile.mapping.defaultTo",{model:r[c].trim()}):h.placeholder,"aria-invalid":!!y||void 0,"aria-describedby":y?"extra-".concat(d,"-error"):void 0,onChange:function(e){return o(d,e.target.value)}}),y?(0,g.jsx)("p",{id:"extra-".concat(d,"-error"),className:"text-xs text-destructive",children:l6(i,y)}):null]}),(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)(u1,{htmlFor:"extra-".concat(c),className:"text-xs md:sr-only",children:p.label}),(0,g.jsx)(uY,{id:"extra-".concat(c),value:null!=(n=r[c])?n:"",placeholder:p.placeholder,"aria-invalid":!!m||void 0,"aria-describedby":m?"extra-".concat(c,"-error"):void 0,onChange:function(e){return o(c,e.target.value)}}),m?(0,g.jsx)("p",{id:"extra-".concat(c,"-error"),className:"text-xs text-destructive",children:l6(i,m)}):null]}),(0,g.jsx)(pN,{role:u,field:f?l.get(f):void 0,value:f?r[f]:void 0,error:f?a["extra:".concat(f)]:void 0,onChange:o})]},u)}),s?(0,g.jsxs)("div",{className:pO,children:[(0,g.jsx)("div",{className:"flex h-10 items-center rounded-lg border bg-muted/45 px-3 text-sm font-medium",children:"Subagent"}),(0,g.jsx)("div",{className:"flex h-10 items-center rounded-lg border bg-muted/30 px-3 text-sm text-muted-foreground",children:i("profile.mapping.notInMenu")}),(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)(u1,{htmlFor:"extra-subagentModel",className:"text-xs md:sr-only",children:s.label}),(0,g.jsx)(uY,{id:"extra-subagentModel",value:null!=(t=r.subagentModel)?t:"",placeholder:s.placeholder,"aria-invalid":!!a["extra:subagentModel"]||void 0,"aria-describedby":a["extra:subagentModel"]?"extra-subagentModel-error":void 0,onChange:function(e){return o("subagentModel",e.target.value)}}),a["extra:subagentModel"]?(0,g.jsx)("p",{id:"extra-subagentModel-error",className:"text-xs text-destructive",children:l6(i,a["extra:subagentModel"])}):null]}),(0,g.jsx)(pN,{role:"Subagent",field:l.get(pv),value:r[pv],error:a["extra:".concat(pv)],onChange:o})]}):null]})]})}function pN(e){var t=e.role,n=e.field,r=e.value,a=e.error,o=e.onChange,i=(0,x.Bd)().t;if(!n)return(0,g.jsx)("div",{"data-slot":"one-m-unsupported",className:"flex h-10 items-center rounded-lg border border-dashed bg-muted/20 px-3 text-sm text-muted-foreground",children:i("profile.mapping.oneMUnsupported",{role:t})});var l="extra-".concat(n.key);return(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)("div",{className:"flex h-10 items-center",children:(0,g.jsxs)("label",{htmlFor:l,className:"flex cursor-pointer items-center gap-2 text-sm text-muted-foreground",children:[(0,g.jsx)(uQ,{id:l,checked:"true"===r,"aria-label":n.label,"aria-invalid":!!a||void 0,"aria-describedby":a?"".concat(l,"-error"):void 0,onCheckedChange:function(e){return o(n.key,!0===e?"true":"false")}}),(0,g.jsx)("span",{className:"md:hidden",children:n.label}),(0,g.jsx)("span",{className:"hidden md:inline",children:i("profile.mapping.enable")})]})}),a?(0,g.jsx)("p",{id:"".concat(l,"-error"),className:"text-xs text-destructive",children:l6(i,a)}):null]})}let pP=O("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),pE=O("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function p_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pz(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function pT(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){pz(o,r,a,i,l,"next",e)}function l(e){pz(o,r,a,i,l,"throw",e)}i(void 0)})}}function pA(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){pA(e,t,n[t])})}return e}function pL(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function pI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||pD(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pM(e){return function(e){if(Array.isArray(e))return p_(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||pD(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pD(e,t){if(e){if("string"==typeof e)return p_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p_(e,t)}}function pF(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function p$(e){var t,n=e.open,r=e.onOpenChange,a=(0,x.s9)().locale,o=(0,x.Bd)().t,i=so(function(e){return e.providers}),l=so(function(e){return e.providersLoading}),s=so(function(e){return e.providersError}),u=so(function(e){return e.loadProviders}),c=so(function(e){return e.deleteProvider}),d=pI((0,y.useState)({kind:"list"}),2),f=d[0],p=d[1],h=pI((0,y.useState)(null),2),m=h[0],v=h[1],b=pI((0,y.useState)(null),2),w=b[0],k=b[1],j=pI((0,y.useState)(null),2),S=j[0],O=j[1],C=pI((0,y.useState)(null),2),N=C[0],P=C[1],E=pI((0,y.useState)({}),2),_=E[0],T=E[1],A=so(function(e){return e.revealProvider});(0,y.useEffect)(function(){n&&(p({kind:"list"}),v(null),k(null),P(null),null===i&&u())},[n,i,u]);var R=null!=i?i:[];return(0,g.jsxs)(ll,{open:n,onOpenChange:r,children:[(0,g.jsxs)(l_,{className:"max-h-[88vh] overflow-y-auto sm:max-w-2xl",children:[(0,g.jsxs)(lz,{children:[(0,g.jsx)(lA,{children:"create"===f.kind?o("vault.createTitle"):"edit"===f.kind?o("vault.editTitle",{name:f.entry.name}):o("vault.title")}),(0,g.jsx)(lR,{children:"list"===f.kind?o("vault.intro"):o("vault.formIntro")})]}),l&&0===R.length?(0,g.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:o("vault.loading")}):null,s?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(o,s)}):null,"create"===f.kind||"edit"===f.kind?(0,g.jsx)(pU,{entry:"edit"===f.kind?f.entry:null,onCancel:function(){p({kind:"list"}),k(null)},onSaved:function(e){p({kind:"list"}),v(e),k(null)}}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:o("vault.entryCount",{count:R.length})}),(0,g.jsxs)(or,{size:"sm",onClick:function(){return p({kind:"create"})},children:[(0,g.jsx)(z,{}),o("vault.add")]})]}),m?(0,g.jsx)("div",{className:"rounded-xl bg-emerald-500/10 px-3 py-2 text-sm text-emerald-600 dark:text-emerald-400",children:m.map(function(e){return(0,g.jsx)("p",{children:l6(o,e)},e.key+e.scope)})}):null,w?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(o,w)}):null,0===R.length?(0,g.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:o("vault.empty")}):(0,g.jsx)("ul",{className:"max-h-80 divide-y overflow-y-auto rounded-xl border",children:R.map(function(e){var t,n,r;return(0,g.jsxs)("li",{className:"px-4 py-3",children:[(0,g.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,g.jsxs)("div",{className:"min-w-0",children:[(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,g.jsx)("p",{className:"font-medium",children:e.name}),e.apiKeyConfigured?(0,g.jsx)(aR,{variant:"secondary",children:o("vault.keyConfigured")}):(0,g.jsx)(aR,{variant:"outline",children:o("vault.keyMissing")}),(0,g.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:(t=e.updatedAt,n=a,Number.isNaN((r=new Date(t)).getTime())?t:r.toLocaleString(n))})]}),e.notes?(0,g.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e.notes}):null,e.endpoints.length>0?(0,g.jsx)("ul",{className:"mt-2 space-y-1",children:e.endpoints.map(function(e){return(0,g.jsxs)("li",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[(0,g.jsx)("code",{className:"font-mono text-xs",children:e.key}),(0,g.jsx)("span",{className:"break-all font-mono text-[11px] text-muted-foreground",children:e.baseUrl})]},e.key)})}):(0,g.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:o("vault.noEndpoints")})]}),(0,g.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,g.jsx)(or,{size:"icon",variant:"ghost","aria-label":void 0!==_[e.id]?o("vault.hide",{name:e.name}):o("vault.reveal",{name:e.name}),onClick:function(){pT(function(){var t;return pF(this,function(n){switch(n.label){case 0:if(void 0!==_[e.id])return T(function(t){var n=pR({},t);return delete n[e.id],n}),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,A(e.id)];case 2:return t=n.sent().apiKey,T(function(n){return pL(pR({},n),pA({},e.id,t))}),[3,4];case 3:return k(l3(n.sent(),"vault.revealFailed")),[3,4];case 4:return[2]}})})()},children:void 0!==_[e.id]?(0,g.jsx)(pP,{}):(0,g.jsx)(pE,{})}),(0,g.jsx)(or,{size:"icon",variant:"ghost","aria-label":o("vault.edit",{name:e.name}),onClick:function(){p({kind:"edit",entry:e}),k(null)},children:(0,g.jsx)(sX,{})}),(0,g.jsx)(or,{size:"icon",variant:"ghost","aria-label":o("vault.delete",{name:e.name}),onClick:function(){P(null),O(e)},children:(0,g.jsx)(s0,{className:"text-destructive"})})]})]}),void 0!==_[e.id]?(0,g.jsx)("p",{className:"mt-2 break-all rounded-lg bg-muted/60 px-3 py-2 font-mono text-xs",children:_[e.id]}):null]},e.id)})})]}),"list"===f.kind?(0,g.jsx)(lT,{children:(0,g.jsx)(or,{variant:"outline",onClick:function(){return r(!1)},children:o("vault.close")})}):null]}),(0,g.jsx)(sx,{open:null!==S,onOpenChange:function(e){return!e&&O(null)},children:(0,g.jsxs)(sA,{children:[(0,g.jsxs)(sR,{children:[(0,g.jsx)(sI,{children:o("vault.deleteTitle")}),(0,g.jsx)(sM,{children:o("vault.deleteBody",{name:null!=(t=null==S?void 0:S.name)?t:""})})]}),N?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(o,N)}):null,(0,g.jsxs)(sL,{children:[(0,g.jsx)(sF,{children:o("common.cancel")}),(0,g.jsx)(sD,{onClick:function(e){e.preventDefault(),S&&pT(function(){return pF(this,function(e){switch(e.label){case 0:P(null),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c(S.id)];case 2:return e.sent(),O(null),v([{key:"vault.deleted"}]),[3,4];case 3:return P(l3(e.sent(),"vault.deleteFailed")),[3,4];case 4:return[2]}})})()},children:o("common.delete")})]})]})})]})}function pU(e){var t,n,r=e.entry,a=e.onCancel,o=e.onSaved,i=(0,x.Bd)().t,l=so(function(e){return e.createProvider}),s=so(function(e){return e.updateProvider}),u=so(function(e){return e.probeDraft}),c=null!==r,d=pI((0,y.useState)(null!=(t=null==r?void 0:r.name)?t:""),2),f=d[0],p=d[1],h=pI((0,y.useState)(""),2),m=h[0],v=h[1],b=pI((0,y.useState)(null!=(n=null==r?void 0:r.notes)?n:""),2),w=b[0],k=b[1],j=pI((0,y.useState)(function(){var e;return(null!=(e=null==r?void 0:r.endpoints)?e:[]).map(function(e){return{key:e.key,baseUrl:e.baseUrl,label:e.label}})}),2),S=j[0],O=j[1],C=pI((0,y.useState)(!1),2),N=C[0],P=C[1],E=pI((0,y.useState)(null),2),_=E[0],T=E[1],A=pI((0,y.useState)({}),2),R=A[0],L=A[1],I=pI((0,y.useState)({}),2),M=I[0],D=I[1],F=pI((0,y.useState)(!1),2),$=F[0],U=F[1],H=pI((0,y.useState)(null),2),B=H[0],K=H[1],V=pI((0,y.useState)(null),2),W=V[0],q=V[1],Z=pI((0,y.useState)(0),2),J=Z[0],G=Z[1],Q=JSON.stringify(S);function Y(e,t){O(function(n){return n.map(function(n,r){return r===e?pR({},n,t):n})}),D(function(n){if(!n[e])return n;var r=pR({},n),a=pR({},r[e]);return void 0!==t.key&&delete a.key,void 0!==t.baseUrl&&delete a.baseUrl,0===Object.keys(a).length?delete r[e]:r[e]=a,r})}return(0,y.useEffect)(function(){K(null),q(null)},[m,Q]),(0,g.jsxs)("form",{onSubmit:function(e){return pT(function(){var t,n,a,i,u,d,p,h,g,y,v,b;return pF(this,function(x){switch(x.label){case 0:e.preventDefault(),t=S.map(function(e){return{key:e.key.trim(),label:e.label.trim(),baseUrl:e.baseUrl.trim()}}),n=pR({},f.trim()?{}:{name:{key:"vault.error.nameRequired"}},c||m.trim()?{}:{apiKey:{key:"vault.error.apiKeyRequired"}}),a=new Map,i=!0,u=!1,d=void 0;try{for(p=t[Symbol.iterator]();!(i=(h=p.next()).done);i=!0)(g=h.value).key&&a.set(g.key,(null!=(y=a.get(g.key))?y:0)+1)}catch(e){u=!0,d=e}finally{try{i||null==p.return||p.return()}finally{if(u)throw d}}if(v=Object.fromEntries(t.flatMap(function(e,t){var n,r={};return e.key?e.key.includes("/")||e.key.includes("\\")||e.key.length>60?r.key={key:"vault.error.endpointKeyInvalid",params:{max:60}}:(null!=(n=a.get(e.key))?n:0)>1&&(r.key={key:"vault.error.endpointKeyDuplicate"}):r.key={key:"vault.error.endpointKeyRequired"},e.baseUrl||(r.baseUrl={key:"vault.error.endpointUrlRequired"}),Object.keys(r).length>0?[[t,r]]:[]})),L(n),D(v),Object.keys(n).length>0||Object.keys(v).length>0)return T({key:"vault.error.checkFields"}),[2];b={name:f.trim(),notes:w.trim()||void 0,endpoints:t},P(!0),T(null),x.label=1;case 1:if(x.trys.push([1,6,7,8]),!(c&&r))return[3,3];return[4,s(r.id,pR({},b,m.trim()?{apiKey:m.trim()}:{}))];case 2:return o([{key:"vault.updated"}].concat(pM(x.sent().warnings.map(l2)))),[3,5];case 3:return[4,l(pL(pR({},b),{apiKey:m.trim()}))];case 4:x.sent(),o([{key:"vault.created"}]),x.label=5;case 5:return[3,8];case 6:return T(l3(x.sent(),"vault.saveFailed")),[3,8];case 7:return P(!1),[7];case 8:return[2]}})})()},noValidate:!0,className:"space-y-4",children:[(0,g.jsxs)("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[(0,g.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,g.jsx)(u1,{htmlFor:"provider-name",children:i("vault.name")}),(0,g.jsx)(uY,{id:"provider-name",value:f,onChange:function(e){p(e.target.value),L(function(e){return pL(pR({},e),{name:void 0})})},placeholder:i("vault.namePlaceholder"),"aria-invalid":!!R.name||void 0,"aria-describedby":R.name?"provider-name-error":void 0}),R.name?(0,g.jsx)("p",{id:"provider-name-error",className:"text-xs text-destructive",children:l6(i,R.name)}):null]}),(0,g.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,g.jsx)(u1,{htmlFor:"provider-api-key",children:i("vault.apiKey")}),(0,g.jsx)(uY,{id:"provider-api-key",type:"password",value:m,onChange:function(e){v(e.target.value),L(function(e){return pL(pR({},e),{apiKey:void 0})})},placeholder:c?i("vault.apiKeyKeep"):i("vault.apiKeyRequiredPlaceholder"),"aria-invalid":!!R.apiKey||void 0,"aria-describedby":R.apiKey?"provider-api-key-error":void 0}),R.apiKey?(0,g.jsx)("p",{id:"provider-api-key-error",className:"text-xs text-destructive",children:l6(i,R.apiKey)}):null]}),(0,g.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,g.jsx)(u1,{htmlFor:"provider-notes",children:i("vault.notes")}),(0,g.jsx)(f7,{id:"provider-notes",rows:2,value:w,onChange:function(e){return k(e.target.value)}})]})]}),(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{children:i("vault.endpoints")}),(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:i("vault.endpointsHint")}),0===S.length?(0,g.jsx)("p",{className:"rounded-xl border border-dashed px-3 py-3 text-center text-xs text-muted-foreground",children:i("vault.noEndpointDrafts")}):(0,g.jsx)("div",{className:"space-y-2",children:S.map(function(e,t){var n,r,a,o,l,s;return(0,g.jsxs)("div",{className:"grid items-start gap-2 sm:grid-cols-[10rem_minmax(0,1fr)_minmax(0,1fr)_auto]",children:[(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)(uY,{"aria-label":i("vault.endpointKeyLabel",{index:t+1}),value:e.key,onChange:function(e){return Y(t,{key:e.target.value})},placeholder:i("vault.endpointKeyPlaceholder"),"aria-invalid":null!=(n=M[t])&&!!n.key||void 0,"aria-describedby":(null==(r=M[t])?void 0:r.key)?"endpoint-".concat(t,"-key-error"):void 0}),(null==(a=M[t])?void 0:a.key)?(0,g.jsx)("p",{id:"endpoint-".concat(t,"-key-error"),className:"text-xs text-destructive",children:l6(i,M[t].key)}):null]}),(0,g.jsxs)("div",{className:"space-y-1.5",children:[(0,g.jsx)(uY,{"aria-label":i("vault.endpointUrlLabel",{index:t+1}),value:e.baseUrl,onChange:function(e){return Y(t,{baseUrl:e.target.value})},placeholder:i("vault.endpointUrlPlaceholder"),"aria-invalid":null!=(o=M[t])&&!!o.baseUrl||void 0,"aria-describedby":(null==(l=M[t])?void 0:l.baseUrl)?"endpoint-".concat(t,"-url-error"):void 0}),(null==(s=M[t])?void 0:s.baseUrl)?(0,g.jsx)("p",{id:"endpoint-".concat(t,"-url-error"),className:"text-xs text-destructive",children:l6(i,M[t].baseUrl)}):null]}),(0,g.jsx)(uY,{"aria-label":i("vault.endpointLabelLabel",{index:t+1}),value:e.label,onChange:function(e){return Y(t,{label:e.target.value})},placeholder:i("vault.endpointLabelPlaceholder")}),(0,g.jsx)(or,{type:"button",size:"icon",variant:"ghost","aria-label":i("vault.removeEndpoint",{index:t+1}),onClick:function(){O(function(e){return e.filter(function(e,n){return n!==t})}),D({})},children:(0,g.jsx)(s0,{})})]},t)})}),(0,g.jsxs)(or,{type:"button",size:"sm",variant:"outline",onClick:function(){return O(function(e){return pM(e).concat([{key:"",baseUrl:"",label:""}])})},children:[(0,g.jsx)(z,{}),i("vault.addEndpoint")]}),(0,g.jsx)(pH,{options:S.map(function(e,t){return{index:t,key:e.key,baseUrl:e.baseUrl}}).filter(function(e){return e.baseUrl.trim()}),targetIndex:J,onTargetChange:G,hasStoredKey:c,hasTypedKey:m.trim().length>0,onMissingKey:function(){return L(function(e){return pL(pR({},e),{apiKey:{key:"vault.error.apiKeyRequired"}})})},probing:$,result:B,probeError:W,onProbe:function(){return pT(function(){var e,t,n,a;return pF(this,function(o){switch(o.label){case 0:if(!(n=null!=(e=(t=S.map(function(e,t){return{endpoint:e,index:t}}).filter(function(e){return""!==e.endpoint.baseUrl.trim()})).find(function(e){return e.index===J}))?e:t[0]))return K(null),q({key:"probe.missingBaseUrl"}),[2];if(!c&&!m.trim())return K(null),q(null),L(function(e){return pL(pR({},e),{apiKey:{key:"vault.error.apiKeyRequired"}})}),[2];U(!0),q(null),K(null),o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,u(pR({baseUrl:n.endpoint.baseUrl},m.trim()?{apiKey:m}:{providerId:null!=(a=null==r?void 0:r.id)?a:""}))];case 2:return K(o.sent()),[3,5];case 3:return q(l3(o.sent(),"vault.probeFailed")),[3,5];case 4:return U(!1),[7];case 5:return[2]}})})()}})]}),_?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(i,_)}):null,(0,g.jsxs)(lT,{className:"flex-row justify-end gap-2 space-x-0",children:[(0,g.jsx)(or,{type:"button",variant:"outline",className:"min-w-24",onClick:a,children:i("common.cancel")}),(0,g.jsx)(or,{type:"submit",className:"min-w-24",disabled:N,children:N?i("vault.saving"):c?i("vault.saveChanges"):i("vault.add")})]})]})}function pH(e){var t,n,r=e.options,a=e.targetIndex,o=e.onTargetChange,i=e.hasStoredKey,l=e.hasTypedKey,s=e.onMissingKey,u=e.probing,c=e.result,d=e.probeError,f=e.onProbe,p=(0,x.Bd)().t;if(0===r.length&&!i)return null;var h=null!=(t=r.find(function(e){return e.index===a}))?t:r[0];return(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t pt-3",children:[(0,g.jsxs)(or,{type:"button",variant:"outline",size:"sm",disabled:u||0===r.length&&!l,onClick:function(){l||i?f():s()},children:[u?(0,g.jsx)(uT,{className:"animate-spin"}):null,p(u?"probe.probing":"probe.action")]}),r.length>1?(0,g.jsxs)(dJ,{value:String(null!=(n=null==h?void 0:h.index)?n:""),onValueChange:function(e){return o(Number(e))},children:[(0,g.jsx)(fM,{className:"h-9 w-56","aria-label":p("vault.probeEndpointLabel"),children:(0,g.jsx)(dQ,{})}),(0,g.jsx)(f$,{children:r.map(function(e){return(0,g.jsx)(fU,{value:String(e.index),children:e.key||e.baseUrl},e.index)})})]}):null,d?(0,g.jsxs)("span",{className:"flex items-center gap-1.5 text-sm text-destructive",children:[(0,g.jsx)(f8,{className:"size-4 shrink-0","aria-hidden":!0}),l6(p,d)]}):c?(0,g.jsx)(f9,{result:c}):null]})}let pB=O("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),pK=O("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);var pV="hs-theme";function pW(e){document.documentElement.classList.toggle("dark","dark"===e),document.documentElement.style.colorScheme=e;try{localStorage.setItem(pV,e)}catch(e){}}function pq(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pZ(){var e,t=(0,x.Bd)().t,n=function(e){if(Array.isArray(e))return e}(e=(0,y.useState)("light"))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(a.push(t.value),2!==a.length);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw n}}return a}}(e)||function(e){if(e){if("string"==typeof e)return pq(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return pq(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],a=n[1];return(0,y.useEffect)(function(){var e,t=(e=function(){try{var e=localStorage.getItem(pV);return"light"===e||"dark"===e?e:null}catch(e){return null}}())?e:"u">typeof window&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a(t),pW(t)},[]),(0,g.jsx)(or,{type:"button",size:"icon",variant:"outline","aria-label":t("dark"===r?"theme.toLight":"theme.toDark"),onClick:function(){return a(function(e){var t;return pW(t="dark"===e?"light":"dark"),t})},children:"dark"===r?(0,g.jsx)(pB,{}):(0,g.jsx)(pK,{})})}let pJ=O("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),pG=O("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),pQ=O("file-lock-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v1",key:"jmtmu2"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"5",x:"2",y:"13",rx:"1",key:"10y5wo"}],["path",{d:"M8 13v-2a2 2 0 1 0-4 0v2",key:"1pdxzg"}]]);function pY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pX(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function p0(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){pX(o,r,a,i,l,"next",e)}function l(e){pX(o,r,a,i,l,"throw",e)}i(void 0)})}}function p1(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||p2(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p2(e,t){if(e){if("string"==typeof e)return pY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pY(e,t)}}function p4(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function p3(e){var t,n,r,a=e.open,o=e.onOpenChange,i=(0,x.Bd)().t,l=so(function(e){return e.loadHarnesses}),s=so(function(e){return e.setNotice}),u=(0,y.useRef)(null),c=p1((0,y.useState)(""),2),d=c[0],f=c[1],p=p1((0,y.useState)(""),2),h=p[0],m=p[1],v=p1((0,y.useState)(null),2),b=v[0],w=v[1],k=p1((0,y.useState)(!1),2),j=k[0],S=k[1],O=p1((0,y.useState)(null),2),C=O[0],N=O[1],P=p1((0,y.useState)(""),2),E=P[0],_=P[1],z=p1((0,y.useState)(""),2),T=z[0],A=z[1],R=p1((0,y.useState)(null),2),L=R[0],I=R[1],D=p1((0,y.useState)(!1),2),F=D[0],$=D[1],U=p1((0,y.useState)(!1),2),H=U[0],B=U[1],K=p1((0,y.useState)("skip"),2),V=K[0],W=K[1],q=p1((0,y.useState)(!0),2),Z=q[0],J=q[1],G=p1((0,y.useState)(!1),2),Q=G[0],Y=G[1],X=p1((0,y.useState)(null),2),ee=X[0],et=X[1],en=p1((0,y.useState)(null),2),er=en[0],ea=en[1],eo=p1((0,y.useState)(null),2),ei=eo[0],el=eo[1];(0,y.useEffect)(function(){if(!a){S(!1),B(!1),$(!1),Y(!1);return}var e=!1;return lQ("/api/transfer/export/preview").then(function(t){e||(w(t),S(!0===t.codexLoginCacheAvailable))}).catch(function(){e||w(null)}),function(){e=!0}},[a]);var es=d.length>=8&&d===h&&null===ee,eu=null!==C&&T.length>=8&&null===ee,ec=(null==L?void 0:L.conflictPolicy)===V&&(null==L?void 0:L.restoreActive)===Z,ed=null!==L&&ec&&!F&&null===ee,ef=L&&ec&&!F?function(e,t){switch(t){case"openai-api-key":return e("transfer.authEffect.openai-api-key");case"auth-override":return e("transfer.authEffect.auth-override");case"official-cleanup":return e("transfer.authEffect.official-cleanup");case"none":return null}}(i,L.codexActivationAuthEffect):null;return(0,g.jsx)(ll,{open:a,onOpenChange:o,children:(0,g.jsxs)(l_,{className:"max-h-[90vh] overflow-x-hidden overflow-y-auto sm:max-w-2xl",children:[(0,g.jsxs)(lz,{children:[(0,g.jsx)(lA,{children:i("transfer.title")}),(0,g.jsx)(lR,{children:i("transfer.intro")})]}),(0,g.jsxs)("section",{className:"space-y-4 rounded-2xl border bg-muted/25 p-4",children:[(0,g.jsxs)("div",{className:"flex items-start gap-3",children:[(0,g.jsx)("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary",children:(0,g.jsx)(pJ,{className:"size-4"})}),(0,g.jsxs)("div",{children:[(0,g.jsx)("h3",{className:"font-semibold",children:i("transfer.exportTitle")}),(0,g.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:i("transfer.exportIntro")})]})]}),(0,g.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"export-passphrase",children:i("transfer.passphrase")}),(0,g.jsx)(uY,{id:"export-passphrase",type:"password",autoComplete:"new-password",value:d,onChange:function(e){return f(e.target.value)},placeholder:i("transfer.passphrasePlaceholder",{min:8})})]}),(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"export-passphrase-confirm",children:i("transfer.passphraseConfirm")}),(0,g.jsx)(uY,{id:"export-passphrase-confirm",type:"password",autoComplete:"new-password",value:h,onChange:function(e){return m(e.target.value)},placeholder:i("transfer.passphraseConfirmPlaceholder")})]})]}),h&&d!==h?(0,g.jsx)("p",{className:"text-xs text-destructive",children:i("transfer.passphraseMismatch")}):null,(null==b?void 0:b.codexLoginCacheAvailable)?(0,g.jsx)("label",{className:"block space-y-2 rounded-xl border border-amber-500/30 bg-amber-500/5 p-3 text-sm",children:(0,g.jsxs)("span",{className:"flex cursor-pointer items-start gap-3",children:[(0,g.jsx)(uQ,{checked:j,onCheckedChange:function(e){return S(!0===e)},className:"mt-0.5"}),(0,g.jsxs)("span",{className:"min-w-0",children:[(0,g.jsx)("span",{className:"block font-medium",children:i("transfer.includeCache")}),(0,g.jsx)("span",{className:"mt-1 block text-xs leading-relaxed text-muted-foreground",children:i("transfer.includeCacheHint")})]})]})}):b?(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:i("transfer.noCacheToExport")}):null,(0,g.jsxs)(or,{type:"button",onClick:function(){p0(function(){return p4(this,function(e){switch(e.label){case 0:et("export"),el(null),ea(null),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,lQ("/api/transfer/export",{method:"POST",body:JSON.stringify({passphrase:d,includeCodexLoginCache:j})})];case 2:var t,n,r,a,o;return t=e.sent(),n=new Date().toISOString().slice(0,10),r=new Blob(["".concat(JSON.stringify(t,null,2),"\n")],{type:"application/json"}),a=URL.createObjectURL(r),(o=document.createElement("a")).href=a,o.download="harness-switch-".concat(n,".hsw-backup"),o.click(),URL.revokeObjectURL(a),ea(j?i("transfer.exportedWithCache"):i("transfer.exportedWithoutCache")),[3,5];case 3:return el(l4(e.sent())),[3,5];case 4:return et(null),[7];case 5:return[2]}})})()},disabled:!es,children:[(0,g.jsx)(pJ,{}),"export"===ee?i("transfer.encrypting"):i("transfer.download")]})]}),(0,g.jsxs)("section",{className:"space-y-4 rounded-2xl border p-4",children:[(0,g.jsxs)("div",{className:"flex items-start gap-3",children:[(0,g.jsx)("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary",children:(0,g.jsx)(pG,{className:"size-4"})}),(0,g.jsxs)("div",{children:[(0,g.jsx)("h3",{className:"font-semibold",children:i("transfer.importTitle")}),(0,g.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:i("transfer.importIntro")})]})]}),(0,g.jsx)("input",{ref:u,type:"file",accept:".hsw-backup,application/json",className:"sr-only",onChange:function(e){var t,n;n=null==(t=e.target.files)?void 0:t[0],p0(function(){var e,t,r;return p4(this,function(a){switch(a.label){case 0:if(I(null),$(!1),Y(!1),B(!1),ea(null),el(null),!n)return N(null),_(""),[2];a.label=1;case 1:return a.trys.push([1,3,,4]),t=JSON.parse,[4,n.text()];case 2:if("harness-switch-encrypted-export"!==(e=t.apply(JSON,[a.sent()])).format||1!==e.version)return el({key:"transfer.notAnExport"}),N(null),_(""),[2];return N(e),_(n.name),[3,4];case 3:return r=a.sent(),N(null),_(""),el(l4(r)),[3,4];case 4:return[2]}})})()}}),(0,g.jsxs)("button",{type:"button",className:"flex w-full cursor-pointer items-center gap-3 rounded-xl border border-dashed bg-muted/20 px-4 py-4 text-left transition-colors hover:border-primary/40 hover:bg-primary/5",onClick:function(){var e;return null==(e=u.current)?void 0:e.click()},children:[(0,g.jsx)(pQ,{className:"size-5 text-primary"}),(0,g.jsxs)("span",{className:"min-w-0",children:[(0,g.jsx)("span",{className:"block truncate text-sm font-medium",children:E||i("transfer.pickFile")}),(0,g.jsx)("span",{className:"mt-0.5 block text-xs text-muted-foreground",children:i("transfer.pickFileHint")})]})]}),(0,g.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end",children:[(0,g.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"import-passphrase",children:i("transfer.passphrase")}),(0,g.jsx)(uY,{id:"import-passphrase",type:"password",value:T,onChange:function(e){A(e.target.value),I(null),$(!1),Y(!1),B(!1)},placeholder:i("transfer.importPassphrasePlaceholder")})]}),(0,g.jsx)(or,{type:"button",variant:"outline",disabled:!eu,onClick:function(){p0(function(){var e,t,n;return p4(this,function(r){switch(r.label){case 0:if(!C)return[2];et("preview"),el(null),ea(null),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,lQ("/api/transfer/preview",{method:"POST",body:JSON.stringify({envelope:C,passphrase:T,conflictPolicy:V,restoreActive:Z})})];case 2:return I(t=r.sent()),$(!1),Y(!1),B((null==(e=t.codexLoginCache)?void 0:e.available)===!0&&!0===t.codexLoginCache.migrationNeeded),[3,5];case 3:return n=r.sent(),I(null),el(l4(n)),[3,5];case 4:return et(null),[7];case 5:return[2]}})})()},children:"preview"===ee?i("transfer.inspecting"):i("transfer.inspect")})]}),L?(0,g.jsxs)("div",{className:"space-y-4 rounded-xl border bg-card p-4",children:[(0,g.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,g.jsx)(aR,{children:i("transfer.profileCount",{count:L.profileCount})}),(0,g.jsx)(aR,{variant:"secondary",children:i("transfer.providerCount",{count:L.providerCount})}),(0,g.jsx)(aR,{variant:L.conflicts.length>0?"outline":"secondary",children:i("transfer.conflictCount",{count:L.conflicts.length})}),(0,g.jsx)(aR,{variant:"secondary",children:i("transfer.activeCount",{count:L.activeCount})})]}),(0,g.jsx)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground",children:L.harnesses.map(function(e){return(0,g.jsx)("span",{children:i("transfer.harnessProfiles",{harness:M[e.harness],count:e.profiles})},e.harness)})}),L.conflicts.length>0?(0,g.jsx)("div",{className:"rounded-xl bg-amber-500/10 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-300",children:i("transfer.conflictList",{items:L.conflicts.map(function(e){return"".concat(M[e.harness]," / ").concat(e.name)}).join(i("common.listSeparator"))})}):null,(null==(t=L.codexLoginCache)?void 0:t.available)&&L.codexLoginCache.migrationNeeded?(0,g.jsxs)("label",{className:"block space-y-2 rounded-xl border border-amber-500/30 bg-amber-500/5 p-3 text-sm",children:[(0,g.jsxs)("span",{className:"flex cursor-pointer items-start gap-3",children:[(0,g.jsx)(uQ,{checked:H,onCheckedChange:function(e){return B(!0===e)},className:"mt-0.5"}),(0,g.jsxs)("span",{className:"min-w-0",children:[(0,g.jsx)("span",{className:"block font-medium",children:i("transfer.migrateCache")}),(0,g.jsx)("span",{className:"mt-1 block text-xs leading-relaxed text-muted-foreground",children:i("transfer.migrateCacheHint")})]})]}),(null==(n=L.codexLoginCache)?void 0:n.targetExists)?(0,g.jsx)("span",{className:"block text-xs leading-relaxed text-amber-700 dark:text-amber-300",children:i("transfer.migrateCacheOverwrite")}):null]}):null,ef?(0,g.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-300",children:ef}):null,F?(0,g.jsx)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:i("transfer.previewStale")}):null,(0,g.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"conflict-policy",children:i("transfer.conflictPolicy")}),(0,g.jsxs)(dJ,{value:V,onValueChange:function(e){W(e),$(!0),Y(!1)},children:[(0,g.jsx)(fM,{id:"conflict-policy",children:(0,g.jsx)(dQ,{})}),(0,g.jsxs)(f$,{children:[(0,g.jsx)(fU,{value:"skip",children:i("transfer.policySkip")}),(0,g.jsx)(fU,{value:"overwrite",children:i("transfer.policyOverwrite")})]})]})]}),(0,g.jsxs)("label",{className:"flex cursor-pointer items-center gap-3 rounded-xl border px-3 py-2 text-sm",children:[(0,g.jsx)(uQ,{checked:Z,onCheckedChange:function(e){J(!0===e),$(!0),Y(!1)}}),i("transfer.restoreActive")]})]}),(0,g.jsxs)(or,{type:"button",disabled:!ed,onClick:function(){return Y(!0)},children:[(0,g.jsx)(pG,{}),F?i("transfer.recheckNeeded"):i("transfer.confirmImport")]}),(0,g.jsx)(sx,{open:Q,onOpenChange:Y,children:(0,g.jsxs)(sA,{children:[(0,g.jsxs)(sR,{children:[(0,g.jsx)(sI,{children:ef?i("transfer.confirmAuthTitle"):i("transfer.confirmTitle")}),(0,g.jsxs)(sM,{children:[i("transfer.confirmBody",{count:L.profileCount}),"overwrite"===V&&L.conflicts.length>0?i("transfer.confirmOverwrite",{count:L.conflicts.length}):i("transfer.confirmKeep"),H?(null==(r=L.codexLoginCache)?void 0:r.targetExists)?i("transfer.confirmCacheOverwrite"):i("transfer.confirmCacheWrite"):i("transfer.confirmCacheSkip"),ef?" ".concat(ef):null]})]}),(0,g.jsxs)(sL,{children:[(0,g.jsx)(sF,{children:i("common.cancel")}),(0,g.jsx)(sD,{onClick:function(){p0(function(){var e;return p4(this,function(t){switch(t.label){case 0:if(!C||!L||F)return[2];Y(!1),et("import"),el(null),t.label=1;case 1:return t.trys.push([1,4,5,6]),[4,lQ("/api/transfer/import",{method:"POST",body:JSON.stringify({envelope:C,passphrase:T,conflictPolicy:V,restoreActive:Z,migrateCodexLoginCache:H})})];case 2:return e=t.sent(),[4,l()];case 3:var n,r,a,u;return t.sent(),s((u=[(n=i)("transfer.importedCount",{count:(r=e).imported})],r.overwritten>0&&u.push(n("transfer.overwrittenCount",{count:r.overwritten})),r.providersCopied>0&&u.push(n("transfer.providersCopiedCount",{count:r.providersCopied})),r.skipped>0&&u.push(n("transfer.skippedCount",{count:r.skipped})),r.activeRestored>0&&u.push(n("transfer.activeRestoredCount",{count:r.activeRestored})),u.push(n(r.codexLoginCacheMigrated?"transfer.cacheMigrated":"transfer.cacheNotMigrated")),[{key:"transfer.importedSummary",params:{parts:u.join(n("common.listSeparator"))}}].concat(function(e){if(Array.isArray(e))return pY(e)}(a=r.warnings.map(function(e){return l2(e)}))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||p2(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))),I(null),$(!1),B(!1),o(!1),[3,6];case 4:return el(l4(t.sent())),[3,6];case 5:return et(null),[7];case 6:return[2]}})})()},children:ef?i("transfer.proceedAware"):"overwrite"===V?i("transfer.proceedOverwrite"):i("transfer.proceedSafe")})]})]})})]}):null]}),er?(0,g.jsx)("p",{className:"text-sm text-emerald-600 dark:text-emerald-400",children:er}):null,ei?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(i,ei)}):null]})})}function p5(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p6(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function p8(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p5(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p9(){var e=(0,x.Bd)().t,t=p8((0,y.useState)(null),2),n=t[0],r=t[1],a=p8((0,y.useState)(null),2),o=a[0],i=a[1],l=p8((0,y.useState)("idle"),2),s=l[0],u=l[1];return((0,y.useEffect)(function(){var e=!1;return lQ("/api/update/check").then(function(t){!e&&(r(t.current),t.updateAvailable&&t.latest&&i(t.latest))}).catch(function(){}),function(){e=!0}},[]),"updating"===s)?(0,g.jsxs)("span",{className:"flex h-6 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md bg-muted/70 px-2 font-mono text-[11px] text-muted-foreground",children:[(0,g.jsx)(uT,{className:"size-3 shrink-0 animate-spin"}),e("update.updating")]}):"failed"===s?(0,g.jsx)("span",{title:e("update.failedHint"),className:"flex h-6 shrink-0 items-center whitespace-nowrap rounded-md bg-destructive/10 px-2 font-mono text-[11px] text-destructive",children:e("update.failed")}):o?(0,g.jsxs)(or,{variant:"outline",size:"sm","aria-label":e("update.toVersion",{version:o}),className:"h-6 shrink-0 gap-1 whitespace-nowrap px-2 font-mono text-[11px]",onClick:function(){var e;(e=function(){var e;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:u("updating"),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,lQ("/api/update",{method:"POST"})];case 2:case 3:return t.sent(),[3,4];case 4:e=Date.now()+18e4,t.label=5;case 5:if(!(Date.now()<e))return[3,11];return[4,new Promise(function(e){return setTimeout(e,2500)})];case 6:t.sent(),t.label=7;case 7:return t.trys.push([7,9,,10]),[4,lQ("/api/version")];case 8:if(t.sent().version!==n)return window.location.reload(),[2];return[3,10];case 9:return t.sent(),[3,10];case 10:return[3,5];case 11:return u("failed"),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){p6(o,r,a,i,l,"next",e)}function l(e){p6(o,r,a,i,l,"throw",e)}i(void 0)})})()},children:[(0,g.jsx)(sd,{className:"size-3 shrink-0"}),(0,g.jsx)("span",{className:"sm:hidden",children:e("update.short")}),(0,g.jsx)("span",{className:"hidden sm:inline",children:e("update.toVersion",{version:o})})]}):null}let p7=O("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),he=O("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);function ht(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hn(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function hr(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){hn(o,r,a,i,l,"next",e)}function l(e){hn(o,r,a,i,l,"throw",e)}i(void 0)})}}function ha(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||hi(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ho(e){return function(e){if(Array.isArray(e))return ht(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||hi(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hi(e,t){if(e){if("string"==typeof e)return ht(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ht(e,t)}}function hl(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function hs(e){var t=e.open,n=e.onOpenChange,r=(0,x.Bd)().t,a=so(function(e){return e.users}),o=so(function(e){return e.currentUser}),i=so(function(e){return e.loadHarnesses}),l=so(function(e){return e.loadProviders}),s=so(function(e){return e.setNotice}),u=(0,y.useMemo)(function(){return a.filter(function(e){return e.username!==o})},[a,o]),c=ha((0,y.useState)(""),2),d=c[0],f=c[1],p=ha((0,y.useState)(null),2),h=p[0],m=p[1],v=ha((0,y.useState)([]),2),b=v[0],w=v[1],k=ha((0,y.useState)(!1),2),j=k[0],S=k[1],O=ha((0,y.useState)(!1),2),C=O[0],N=O[1],P=ha((0,y.useState)(!1),2),E=P[0],_=P[1],z=ha((0,y.useState)(null),2),T=z[0],A=z[1],R=(0,y.useMemo)(function(){return I.flatMap(function(e){var t,n=null!=(t=null==h?void 0:h.conflicts.filter(function(t){return t.harness===e}).length)?t:0;return n>0?[{harness:e,count:n}]:[]})},[h]),L=o||r("notice.currentUser");function D(){return hr(function(){var e;return hl(this,function(t){switch(t.label){case 0:if(!d||!h)return[2];_(!0),A(null),t.label=1;case 1:return t.trys.push([1,4,5,6]),[4,lQ("/api/users/sync",{method:"POST",body:JSON.stringify({sourceUser:d,conflictPolicy:"skip",overwriteHarnesses:b,migrateCodexLoginCache:j})})];case 2:return e=t.sent(),[4,Promise.all([i(),l()])];case 3:return t.sent(),s([{key:"sync.done",params:{imported:e.imported,overwritten:e.overwritten,skipped:e.skipped,providersCopied:e.providersCopied}},{key:e.codexLoginCacheMigrated?"sync.cacheMigrated":"sync.cacheNotMigrated"}].concat(ho(e.warnings.map(function(e){return l2(e)})))),n(!1),[3,6];case 4:return A(l4(t.sent())),[3,6];case 5:return _(!1),[7];case 6:return[2]}})})()}return(0,y.useEffect)(function(){t&&(f(function(e){var t,n;return u.some(function(t){return t.username===e})?e:null!=(t=null==(n=u[0])?void 0:n.username)?t:""}),m(null),w([]),S(!1),N(!1),A(null))},[t,u]),(0,g.jsx)(ll,{open:t,onOpenChange:n,children:(0,g.jsxs)(l_,{className:"flex max-h-[calc(100dvh-1rem)] w-[calc(100vw-1rem)] max-w-xl flex-col gap-0 overflow-hidden p-0 sm:max-h-[90dvh] sm:w-full",children:[(0,g.jsxs)(lz,{className:"shrink-0 border-b px-5 py-4 pr-12 text-left sm:px-6",children:[(0,g.jsx)(lA,{children:r("sync.title")}),(0,g.jsx)(lR,{children:r("sync.intro",{user:L})})]}),(0,g.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-4 sm:px-6",children:[u.length>0?(0,g.jsxs)("div",{className:"space-y-5",children:[(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"sync-source-user",children:r("sync.sourceUser")}),(0,g.jsxs)(dJ,{value:d,onValueChange:function(e){f(e),m(null),w([]),S(!1)},children:[(0,g.jsx)(fM,{id:"sync-source-user",children:(0,g.jsx)(dQ,{placeholder:r("sync.selectUser")})}),(0,g.jsx)(f$,{children:u.map(function(e){return(0,g.jsxs)(fU,{value:e.username,children:[e.username," \xb7 ",e.homeDir]},e.username)})})]})]}),h?(0,g.jsxs)("div",{className:"space-y-4 rounded-2xl border bg-muted/25 p-4",children:[(0,g.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,g.jsx)(aR,{variant:"secondary",children:r("sync.profileCount",{count:h.profileCount})}),(0,g.jsx)(aR,{variant:"secondary",children:r("sync.providerCount",{count:h.providerCount})}),(0,g.jsx)(aR,{variant:h.conflicts.length>0?"destructive":"outline",children:r("sync.conflictCount",{count:h.conflicts.length})})]}),h.conflicts.length>0?(0,g.jsxs)("div",{className:"space-y-3",children:[(0,g.jsxs)("div",{className:"space-y-1",children:[(0,g.jsx)(u1,{children:r("sync.overwriteByHarness")}),(0,g.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:r("sync.overwriteHint")})]}),(0,g.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:R.map(function(e){var t=e.harness,n=e.count;return(0,g.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 rounded-xl border bg-background/70 p-3 text-sm",children:[(0,g.jsx)(uQ,{checked:b.includes(t),onCheckedChange:function(e){return w(function(n){return!0===e?ho(n).concat([t]):n.filter(function(e){return e!==t})})},className:"mt-0.5"}),(0,g.jsxs)("span",{children:[(0,g.jsx)("span",{className:"block font-medium",children:r("sync.overwriteHarness",{harness:M[t]})}),(0,g.jsx)("span",{className:"mt-1 block text-xs text-muted-foreground",children:r("sync.conflictsInHarness",{count:n})})]})]},t)})})]}):null,h.codexLoginCache.available&&h.codexLoginCache.migrationNeeded?(0,g.jsxs)("label",{className:"block space-y-3 rounded-xl border bg-background/70 p-3 text-sm",children:[(0,g.jsxs)("span",{className:"flex cursor-pointer items-start gap-3",children:[(0,g.jsx)(uQ,{checked:j,onCheckedChange:function(e){return S(!0===e)},className:"mt-0.5"}),(0,g.jsxs)("span",{children:[(0,g.jsx)("span",{className:"block font-medium",children:r("sync.migrateCache")}),(0,g.jsx)("span",{className:"mt-1 block text-xs leading-relaxed text-muted-foreground",children:r("sync.migrateCacheHint")})]})]}),h.codexLoginCache.targetExists?(0,g.jsx)("span",{className:"block rounded-lg bg-amber-500/10 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-300",children:r("sync.migrateCacheOverwrite")}):null]}):null,(0,g.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:r("sync.storeOnlyHint")})]}):null]}):(0,g.jsxs)("div",{className:"flex items-start gap-3 rounded-2xl border bg-muted/25 p-4",children:[(0,g.jsx)(p7,{className:"mt-0.5 size-5 text-muted-foreground"}),(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:r("sync.noOtherUsers")})]}),T?(0,g.jsx)("p",{className:"mt-4 text-sm text-destructive",children:l6(r,T)}):null]}),(0,g.jsx)(lT,{className:"shrink-0 border-t bg-card px-4 py-3 pb-[max(.75rem,env(safe-area-inset-bottom))] sm:px-6 sm:py-4",children:h?j?(0,g.jsxs)(sx,{open:C,onOpenChange:N,children:[(0,g.jsxs)(or,{className:"w-full sm:w-auto",disabled:E,onClick:function(){return N(!0)},children:[(0,g.jsx)(he,{}),E?r("sync.syncing"):r("sync.syncTo",{user:L})]}),(0,g.jsxs)(sA,{children:[(0,g.jsxs)(sR,{children:[(0,g.jsx)(sI,{children:r("sync.confirmCacheTitle")}),(0,g.jsx)(sM,{children:r("sync.confirmCacheBody",{source:d,target:L,extra:h.codexLoginCache.targetExists?r("sync.confirmCacheOverwrite"):r("sync.confirmCacheFresh")})})]}),(0,g.jsxs)(sL,{children:[(0,g.jsx)(sF,{children:r("common.cancel")}),(0,g.jsx)(sD,{onClick:function(){D()},children:r("sync.confirmCacheAction")})]})]})]}):(0,g.jsxs)(or,{className:"w-full sm:w-auto",disabled:E,onClick:function(){D()},children:[(0,g.jsx)(he,{}),E?r("sync.syncing"):r("sync.syncTo",{user:L})]}):(0,g.jsxs)(or,{className:"w-full sm:w-auto",disabled:!d||E,onClick:function(){hr(function(){var e;return hl(this,function(t){switch(t.label){case 0:if(!d)return[2];_(!0),A(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,lQ("/api/users/sync/preview",{method:"POST",body:JSON.stringify({sourceUser:d})})];case 2:return m(t.sent()),w([]),S(!1),N(!1),[3,5];case 3:return e=t.sent(),m(null),w([]),A(l4(e)),[3,5];case 4:return _(!1),[7];case 5:return[2]}})})()},children:[(0,g.jsx)(he,{}),E?r("sync.inspecting"):r("sync.inspect")]})})]})})}function hu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hc(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,y.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(a.push(t.value),2!==a.length);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw n}}return a}}(e)||function(e){if(e){if("string"==typeof e)return hu(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return hu(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=t[0],r=t[1];return((0,y.useEffect)(function(){var e=!1;return lQ("/api/version").then(function(t){e||r(t.version)}).catch(function(){}),function(){e=!0}},[]),n)?(0,g.jsxs)("span",{className:"shrink-0 whitespace-nowrap rounded-md bg-muted/70 px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:["v",n]}):null}function hd(){return(0,x.Bd)().t,null}function hf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hp(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function hh(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){hp(o,r,a,i,l,"next",e)}function l(e){hp(o,r,a,i,l,"throw",e)}i(void 0)})}}function hm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return hf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hf(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hg(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function hy(){var e,t,n,r=(0,x.s9)().locale,a=(0,x.Bd)().t,o=so(function(e){return e.harnesses}),i=so(function(e){return e.envFile}),l=so(function(e){return e.backups}),s=hm((0,y.useState)(null),2),u=s[0],c=s[1],d=hm((0,y.useState)(!1),2),f=d[0],p=d[1],h=hm((0,y.useState)(!1),2),m=h[0],v=h[1],b=hm((0,y.useState)(!1),2),w=b[0],k=b[1],j=hm((0,y.useState)(!1),2),S=j[0],O=j[1],A=hm((0,y.useState)("claude"),2),R=A[0],L=A[1],I=o.find(function(e){return e.id===(null==u?void 0:u.harnessId)}),M=null!=(e=o.find(function(e){return e.id===R}))?e:o[0];return(0,g.jsxs)("div",{className:"min-h-[100dvh] bg-background",children:[(0,g.jsx)("header",{className:"sticky top-0 z-20 border-b bg-card/90 backdrop-blur-xl",children:(0,g.jsxs)("div",{className:"flex min-h-20 flex-wrap items-center justify-between gap-x-4 gap-y-2 px-4 py-2 sm:px-6",children:[(0,g.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,g.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-primary text-primary-foreground shadow-[0_10px_24px_-12px_rgb(99_91_255/0.8)]",children:(0,g.jsx)(C,{className:"size-5"})}),(0,g.jsxs)("div",{className:"min-w-0",children:[(0,g.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,g.jsx)("h1",{className:"min-w-0 flex-1 truncate text-base font-semibold tracking-tight",children:"harness-switch"}),(0,g.jsx)(hc,{}),(0,g.jsx)(hd,{}),(0,g.jsx)(p9,{})]}),(0,g.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:a("app.tagline")})]})]}),(0,g.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[(0,g.jsxs)(or,{variant:"outline",size:"sm",onClick:function(){return k(!0)},children:[(0,g.jsx)(N,{}),(0,g.jsx)("span",{className:"hidden lg:inline",children:a("nav.syncUserConfig")})]}),(0,g.jsxs)(or,{variant:"outline",size:"sm",onClick:function(){return O(!0)},children:[(0,g.jsx)(P,{}),(0,g.jsx)("span",{className:"hidden lg:inline",children:a("nav.importExisting")})]}),(0,g.jsxs)(or,{variant:"outline",size:"sm",onClick:function(){return p(!0)},children:[(0,g.jsx)(E,{}),(0,g.jsx)("span",{className:"hidden sm:inline",children:a("nav.transfer")})]}),(0,g.jsxs)(or,{variant:"outline",size:"sm",onClick:function(){return v(!0)},children:[(0,g.jsx)(_,{}),(0,g.jsx)("span",{className:"hidden sm:inline",children:a("nav.vault")})]}),(0,g.jsx)(fG,{}),(0,g.jsx)(pZ,{}),(0,g.jsx)(hv,{})]})]})}),(0,g.jsxs)("div",{className:"grid xl:grid-cols-[17rem_minmax(0,1fr)_18rem]",children:[(0,g.jsx)(hb,{harnesses:o,value:null==M?void 0:M.id,onChange:L}),M?(0,g.jsxs)("main",{role:"tabpanel",id:"harness-panel-".concat(M.id),"aria-labelledby":"harness-tab-".concat(M.id),className:"min-w-0 space-y-6 p-4 sm:p-6 xl:p-8",children:[(0,g.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("h2",{className:"text-2xl font-semibold tracking-tight",children:M.label}),(0,g.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:a("harness.subtitle")})]}),(0,g.jsxs)(or,{className:"self-start sm:self-auto",onClick:function(){return c({harnessId:M.id,profile:null})},children:[(0,g.jsx)(z,{}),a("harness.newProfile")]})]}),(0,g.jsx)(un,{harness:M,onAdd:function(){return c({harnessId:M.id,profile:null})},onEdit:function(e){return c({harnessId:M.id,profile:e})}}),(0,g.jsxs)("details",{className:"group rounded-2xl border bg-card px-5 py-4 text-sm shadow-[0_12px_34px_-28px_rgb(36_39_70/0.35)]",children:[(0,g.jsxs)("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 font-medium",children:[(0,g.jsx)("span",{className:"font-mono text-[13px]",children:a("env.title")}),(0,g.jsx)(T,{className:"size-4 text-muted-foreground transition-transform group-open:rotate-180"})]}),(0,g.jsx)("p",{className:"mt-4 leading-relaxed text-muted-foreground",children:a("env.intro")}),(0,g.jsxs)("code",{className:"mt-3 block rounded-xl bg-muted/70 px-4 py-3 font-mono text-[13px]",children:["source ",i||"~/.harness-switch/env.sh"]}),(0,g.jsx)("p",{className:"mt-3 leading-relaxed text-muted-foreground",children:a("env.note")})]})]}):null,M?(0,g.jsx)(hx,{harness:M,latestBackup:l.find(function(e){return e.harness===M.id}),locale:r}):null]}),u&&I?(0,g.jsx)(px,{harness:I,profile:u.profile,onOpenChange:function(e){return!e&&c(null)}},"".concat(u.harnessId,"-").concat(null!=(t=null==(n=u.profile)?void 0:n.name)?t:"new")):null,(0,g.jsx)(p3,{open:f,onOpenChange:p}),(0,g.jsx)(p$,{open:m,onOpenChange:v}),(0,g.jsx)(hs,{open:w,onOpenChange:k}),(0,g.jsx)(fq,{open:S,onOpenChange:O}),(0,g.jsx)(fQ,{})]})}function hv(){var e=(0,x.Bd)().t,t=so(function(e){return e.logout}),n=so(function(e){return e.users}),r=so(function(e){return e.currentUser}),a=so(function(e){return e.usersLoading}),o=so(function(e){return e.switchUser}),i=hm((0,y.useState)(!1),2),l=i[0],s=i[1],u=(0,y.useRef)(null);return(0,y.useEffect)(function(){var e=function(e){var t;(null==(t=u.current)?void 0:t.contains(e.target))||s(!1)};if(l)return window.addEventListener("pointerdown",e),function(){return window.removeEventListener("pointerdown",e)}},[l]),(0,g.jsxs)("div",{ref:u,className:"relative",children:[(0,g.jsxs)(or,{variant:"outline",size:"sm","aria-label":e("nav.currentLocalUser"),"aria-expanded":l,"aria-haspopup":"menu",disabled:a,onClick:function(){return s(function(e){return!e})},children:[(0,g.jsx)(A,{}),(0,g.jsx)("span",{className:"max-w-28 truncate",children:r||e("nav.localUser")}),(0,g.jsx)(T,{className:aT("transition-transform",l&&"rotate-180")})]}),l?(0,g.jsxs)("div",{role:"menu","aria-label":e("nav.currentLocalUser"),className:"absolute right-0 top-full z-30 mt-2 w-52 rounded-xl border bg-popover p-1 text-popover-foreground shadow-lg",children:[(0,g.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:e("nav.currentLocalUser")}),n.map(function(e){return(0,g.jsx)("button",{type:"button",role:"menuitemradio","aria-checked":e.username===r,disabled:a||e.username===r,onClick:function(){var t;t=e.username,hh(function(){return hg(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,o(t)];case 1:return e.sent(),s(!1),[3,3];case 2:return e.sent(),[3,3];case 3:return[2]}})})()},className:"flex w-full cursor-pointer items-center rounded-lg px-3 py-2 text-left text-sm hover:bg-accent disabled:cursor-default disabled:opacity-60",children:e.username},e.username)}),(0,g.jsx)("div",{className:"my-1 border-t"}),(0,g.jsxs)("button",{type:"button",role:"menuitem",disabled:a,onClick:function(){hh(function(){return hg(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,t()];case 1:return e.sent(),s(!1),[3,3];case 2:return e.sent(),[3,3];case 3:return[2]}})})()},className:"flex w-full cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-left text-sm text-destructive hover:bg-destructive/10 disabled:cursor-default disabled:opacity-60",children:[(0,g.jsx)(R,{className:"size-4"}),e("nav.signOut")]})]}):null]})}function hb(e){var t=e.harnesses,n=e.value,r=e.onChange,a=(0,x.Bd)().t;return(0,g.jsx)("div",{role:"tablist","aria-label":a("nav.switchHarness"),"aria-orientation":"vertical",className:"flex gap-2 overflow-x-auto border-b bg-card/45 p-3 xl:min-h-[calc(100dvh-80px)] xl:flex-col xl:overflow-x-visible xl:border-b-0 xl:border-r xl:p-4",children:t.map(function(e,o){var i,l,s,u=e.id===n,c=(null==(l=e.active)?void 0:l.official)?a("harness.official"):null!=(i=null==(s=e.active)?void 0:s.name)?i:null;return(0,g.jsxs)("button",{type:"button",role:"tab",id:"harness-tab-".concat(e.id),"aria-controls":"harness-panel-".concat(e.id),"aria-selected":u,tabIndex:u?0:-1,onClick:function(){return r(e.id)},onKeyDown:function(e){return function(e,n){var a="ArrowLeft"===e.key||"ArrowUp"===e.key,o="ArrowRight"===e.key||"ArrowDown"===e.key;if(a||o||"Home"===e.key||"End"===e.key){e.preventDefault();var i=n;i="Home"===e.key?0:"End"===e.key?t.length-1:(n+(o?1:-1)+t.length)%t.length;var l=t[i];if(l){r(l.id);var s,u,c=null==(s=e.currentTarget.parentElement)?void 0:s.querySelectorAll('[role="tab"]');null==c||null==(u=c[i])||u.focus()}}}(e,o)},className:aT("flex min-w-[12rem] shrink-0 cursor-pointer items-center gap-3 rounded-xl px-3 py-3 text-left transition-[color,background-color,box-shadow,transform] duration-150 active:translate-y-px xl:min-w-0 xl:w-full",u?"bg-primary/[0.09] text-primary shadow-[inset_0_0_0_1px_rgb(99_91_255/0.13)]":"text-muted-foreground hover:bg-card hover:text-foreground"),children:[(0,g.jsx)("span",{className:aT("flex size-10 shrink-0 items-center justify-center rounded-xl border bg-card shadow-[0_4px_12px_-8px_rgb(36_39_70/0.28)]",u?"border-primary/20":"border-border"),children:(0,g.jsx)(uz,{id:e.id})}),(0,g.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,g.jsx)("span",{className:"block truncate text-sm font-medium text-current",children:e.label}),(0,g.jsx)("span",{className:"mt-0.5 block truncate font-mono text-[11px] text-muted-foreground",children:null===c?a("harness.currentInactive"):a("harness.current",{name:c})})]}),(0,g.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:e.profiles.length})]},e.id)})})}function hx(e){var t=e.harness,n=e.latestBackup,r=e.locale,a=(0,x.Bd)().t;return(0,g.jsx)("aside",{className:"border-t bg-card/35 p-4 sm:p-6 xl:min-h-[calc(100dvh-80px)] xl:border-l xl:border-t-0 xl:p-5",children:(0,g.jsxs)("div",{className:"space-y-4 xl:sticky xl:top-[100px]",children:[(0,g.jsxs)("section",{className:"rounded-2xl border bg-card p-5 shadow-[0_12px_34px_-28px_rgb(36_39_70/0.38)]",children:[(0,g.jsxs)("div",{className:"flex items-center gap-2",children:[(0,g.jsx)(L,{className:"size-4 text-primary"}),(0,g.jsx)("h3",{className:"font-semibold",children:a("harness.writeTargets")})]}),(0,g.jsxs)("div",{className:"mt-5 space-y-4",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:a("harness.application")}),(0,g.jsx)("p",{className:"mt-1 text-sm font-medium",children:t.label})]}),t.targets.map(function(e){return(0,g.jsxs)("div",{children:[(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:e.label}),(0,g.jsx)("p",{className:"mt-1 break-all font-mono text-xs leading-relaxed",children:e.path})]},e.key)}),(0,g.jsxs)("div",{children:[(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:a("harness.writeMode")}),(0,g.jsx)("p",{className:"mt-1 text-sm",children:a("replace"===t.mode?"harness.modeReplace":"harness.modeAdditive")})]})]})]}),(0,g.jsx)(sq,{harness:t}),(0,g.jsx)(f3,{harness:t}),(0,g.jsxs)("section",{className:"rounded-2xl border bg-card p-5 shadow-[0_12px_34px_-28px_rgb(36_39_70/0.38)]",children:[(0,g.jsx)("h3",{className:"font-semibold",children:a("backup.latest")}),n?(0,g.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("p",{className:"text-xs text-muted-foreground",children:a("backup.profile")}),(0,g.jsx)("p",{className:"mt-1 truncate text-sm font-medium",children:n.profile})]}),(0,g.jsxs)("p",{className:"font-mono text-[11px] leading-relaxed text-muted-foreground",children:[new Date(n.createdAt).toLocaleString(r)," \xb7"," ",a("backup.fileCount",{count:n.files.length})]})]}):(0,g.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:a("backup.empty")}),(0,g.jsx)("div",{className:"mt-4 border-t pt-4",children:(0,g.jsx)(ss,{harnessId:t.id})})]})]})})}function hw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hk(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,a)}function hj(){var e,t=(0,x.Bd)().t,n=so(function(e){return e.login}),r=so(function(e){return e.loading}),a=function(e){if(Array.isArray(e))return e}(e=(0,y.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(a.push(t.value),2!==a.length);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw n}}return a}}(e)||function(e){if(e){if("string"==typeof e)return hw(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return hw(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=a[0],i=a[1];return(0,g.jsxs)("main",{className:"grid min-h-[100dvh] lg:grid-cols-2",children:[(0,g.jsxs)("section",{className:"hidden flex-col justify-between border-r bg-card p-10 lg:flex",children:[(0,g.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:t("app.brandMark")}),(0,g.jsxs)("div",{className:"max-w-sm space-y-3",children:[(0,g.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:t("login.title")}),(0,g.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:t("login.intro")})]}),(0,g.jsxs)("div",{className:"flex gap-2",children:[(0,g.jsx)(fG,{}),(0,g.jsx)(pZ,{})]})]}),(0,g.jsx)("section",{className:"flex items-center justify-center px-4 py-10",children:(0,g.jsxs)("form",{className:"w-full max-w-sm space-y-5",onSubmit:function(e){var t;return(t=function(){var t,r;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(a){switch(a.label){case 0:e.preventDefault(),t=new FormData(e.currentTarget),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,n(String(null!=(r=t.get("password"))?r:""))];case 2:return a.sent(),[3,4];case 3:return i(l4(a.sent())),[3,4];case 4:return[2]}})},function(){var e=this,n=arguments;return new Promise(function(r,a){var o=t.apply(e,n);function i(e){hk(o,r,a,i,l,"next",e)}function l(e){hk(o,r,a,i,l,"throw",e)}i(void 0)})})()},children:[(0,g.jsxs)("div",{className:"flex items-start justify-between gap-3 lg:hidden",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:t("app.brandMark")}),(0,g.jsx)("h1",{className:"mt-2 text-2xl font-semibold tracking-tight",children:t("login.title")})]}),(0,g.jsxs)("div",{className:"flex gap-2",children:[(0,g.jsx)(fG,{}),(0,g.jsx)(pZ,{})]})]}),(0,g.jsx)("p",{className:"text-sm text-muted-foreground",children:t("login.hint")}),(0,g.jsxs)("div",{className:"space-y-2",children:[(0,g.jsx)(u1,{htmlFor:"password",children:t("login.password")}),(0,g.jsx)(uY,{id:"password",name:"password",type:"password",autoFocus:!0,required:!0})]}),o?(0,g.jsx)("p",{className:"text-sm text-destructive",children:l6(t,o)}):null,(0,g.jsx)(or,{className:"w-full",type:"submit",disabled:r,children:t(r?"login.submitting":"login.submit")})]})})]})}(0,b.createRoot)(document.getElementById("root")).render((0,g.jsx)(y.StrictMode,{children:(0,g.jsx)(x.CY,{children:(0,g.jsx)(function(){var e=(0,x.Bd)().t,t=so(function(e){return e.sessionChecked}),n=so(function(e){return e.authenticated}),r=so(function(e){return e.loadSession});return((0,y.useEffect)(function(){r()},[r]),t)?n?(0,g.jsx)(hy,{}):(0,g.jsx)(hj,{}):(0,g.jsx)("div",{className:"flex min-h-[100dvh] items-center justify-center text-sm text-muted-foreground",children:e("app.checkingSession")})},{})})}))})()})();