orchestrator-server 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/index.js +355 -0
  2. package/package.json +60 -0
  3. package/prisma/migrations/20260422200035_init/migration.sql +23 -0
  4. package/prisma/migrations/migration_lock.toml +3 -0
  5. package/prisma/schema.prisma +49 -0
  6. package/prisma/seed.ts +186 -0
  7. package/prisma.config.ts +14 -0
  8. package/public/404.html +1 -0
  9. package/public/__next.__PAGE__.txt +9 -0
  10. package/public/__next._full.txt +18 -0
  11. package/public/__next._head.txt +6 -0
  12. package/public/__next._index.txt +5 -0
  13. package/public/__next._tree.txt +2 -0
  14. package/public/_next/static/3wVNKXGkEvcJKQQ41ykC8/_buildManifest.js +11 -0
  15. package/public/_next/static/3wVNKXGkEvcJKQQ41ykC8/_clientMiddlewareManifest.js +1 -0
  16. package/public/_next/static/3wVNKXGkEvcJKQQ41ykC8/_ssgManifest.js +1 -0
  17. package/public/_next/static/E8q98Qsrw4E60c3xYkyPl/_buildManifest.js +11 -0
  18. package/public/_next/static/E8q98Qsrw4E60c3xYkyPl/_clientMiddlewareManifest.js +1 -0
  19. package/public/_next/static/E8q98Qsrw4E60c3xYkyPl/_ssgManifest.js +1 -0
  20. package/public/_next/static/SwqlSKgnrxdsy4WFR-t8H/_buildManifest.js +11 -0
  21. package/public/_next/static/SwqlSKgnrxdsy4WFR-t8H/_clientMiddlewareManifest.js +1 -0
  22. package/public/_next/static/SwqlSKgnrxdsy4WFR-t8H/_ssgManifest.js +1 -0
  23. package/public/_next/static/aWmqEAVXz6UBBs_rqx3yi/_buildManifest.js +11 -0
  24. package/public/_next/static/aWmqEAVXz6UBBs_rqx3yi/_clientMiddlewareManifest.js +1 -0
  25. package/public/_next/static/aWmqEAVXz6UBBs_rqx3yi/_ssgManifest.js +1 -0
  26. package/public/_next/static/chunks/0.ash4e7s.y_n.js +1 -0
  27. package/public/_next/static/chunks/0227w9~5ech5o.js +6 -0
  28. package/public/_next/static/chunks/03~yq9q893hmn.js +1 -0
  29. package/public/_next/static/chunks/049jf9s0z~cli.js +5 -0
  30. package/public/_next/static/chunks/0mhs.xtrl10bx.css +1 -0
  31. package/public/_next/static/chunks/0njbtjaz48fw6.js +31 -0
  32. package/public/_next/static/chunks/0nv56i_s5cuzh.js +1 -0
  33. package/public/_next/static/chunks/0ozj8lowkja2v.js +1 -0
  34. package/public/_next/static/chunks/0rxy0xkqa_3on.js +6 -0
  35. package/public/_next/static/chunks/0th7jtcn7x3uc.js +6 -0
  36. package/public/_next/static/chunks/0v07aq9b8c~c4.js +5 -0
  37. package/public/_next/static/chunks/0wm_~5kuh.ots.js +31 -0
  38. package/public/_next/static/chunks/0x0nx44ub6fmc.js +1 -0
  39. package/public/_next/static/chunks/1365saokawb2b.css +1 -0
  40. package/public/_next/static/chunks/turbopack-0qtoh2fca~nc8.js +1 -0
  41. package/public/_next/static/chunks/turbopack-129sj.l69irpg.js +1 -0
  42. package/public/_next/static/mRojh1Ci0tjmSkgj_7ecu/_buildManifest.js +11 -0
  43. package/public/_next/static/mRojh1Ci0tjmSkgj_7ecu/_clientMiddlewareManifest.js +1 -0
  44. package/public/_next/static/mRojh1Ci0tjmSkgj_7ecu/_ssgManifest.js +1 -0
  45. package/public/_next/static/zGgAiq7Yp5kzCwj2dVIc8/_buildManifest.js +11 -0
  46. package/public/_next/static/zGgAiq7Yp5kzCwj2dVIc8/_clientMiddlewareManifest.js +1 -0
  47. package/public/_next/static/zGgAiq7Yp5kzCwj2dVIc8/_ssgManifest.js +1 -0
  48. package/public/_not-found/__next._full.txt +16 -0
  49. package/public/_not-found/__next._head.txt +6 -0
  50. package/public/_not-found/__next._index.txt +5 -0
  51. package/public/_not-found/__next._not-found.__PAGE__.txt +5 -0
  52. package/public/_not-found/__next._not-found.txt +5 -0
  53. package/public/_not-found/__next._tree.txt +2 -0
  54. package/public/_not-found.html +1 -0
  55. package/public/_not-found.txt +16 -0
  56. package/public/index.html +1 -0
  57. package/public/index.txt +18 -0
@@ -0,0 +1,6 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,61971,(e,t,r)=>{"use strict";var n=e.r(24395),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useState,i=n.useEffect,a=n.useLayoutEffect,l=n.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!o(e,r)}catch(e){return!0}}var u="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=s({inst:{value:r,getSnapshot:t}}),o=n[0].inst,u=n[1];return a(function(){o.value=r,o.getSnapshot=t,c(o)&&u({inst:o})},[e,r,t]),i(function(){return c(o)&&u({inst:o}),e(function(){c(o)&&u({inst:o})})},[e]),l(r),r};r.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:u},84841,(e,t,r)=>{"use strict";t.exports=e.r(61971)},64306,(e,t,r)=>{"use strict";var n=e.r(24395),o=e.r(84841),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=o.useSyncExternalStore,a=n.useRef,l=n.useEffect,c=n.useMemo,u=n.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,n,o){var d=a(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;var f=i(e,(d=c(function(){function e(e){if(!l){if(l=!0,i=e,e=n(e),void 0!==o&&h.hasValue){var t=h.value;if(o(t,e))return a=t}return a=e}if(t=a,s(i,e))return t;var r=n(e);return void 0!==o&&o(t,r)?(i=e,t):(i=e,a=r)}var i,a,l=!1,c=void 0===r?null:r;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,r,n,o]))[0],d[1]);return l(function(){h.hasValue=!0,h.value=f},[f]),u(f),f}},80681,(e,t,r)=>{"use strict";t.exports=e.r(64306)},17661,e=>{"use strict";let t,r,n,o,s,i,a;var l,c,u,d,h,f,p,m,g,b=e.i(27658),y=e.i(24395);let v=Object.create(null);v.open="0",v.close="1",v.ping="2",v.pong="3",v.message="4",v.upgrade="5",v.noop="6";let x=Object.create(null);Object.keys(v).forEach(e=>{x[v[e]]=e});let w={type:"error",data:"parser error"},k="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),S="function"==typeof ArrayBuffer,E=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,C=({type:e,data:t},r,n)=>{if(k&&t instanceof Blob)if(r)return n(t);else return _(t,n);if(S&&(t instanceof ArrayBuffer||E(t)))if(r)return n(t);else return _(new Blob([t]),n);return n(v[e]+(t||""))},_=(e,t)=>{let r=new FileReader;return r.onload=function(){t("b"+(r.result.split(",")[1]||""))},r.readAsDataURL(e)};function O(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T="u"<typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<j.length;e++)T[j.charCodeAt(e)]=e;let R="function"==typeof ArrayBuffer,N=(e,t)=>{if("string"!=typeof e)return{type:"message",data:M(e,t)};let r=e.charAt(0);return"b"===r?{type:"message",data:A(e.substring(1),t)}:x[r]?e.length>1?{type:x[r],data:e.substring(1)}:{type:x[r]}:w},A=(e,t)=>R?M((e=>{let t=.75*e.length,r=e.length,n,o=0,s,i,a,l;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);let c=new ArrayBuffer(t),u=new Uint8Array(c);for(n=0;n<r;n+=4)s=T[e.charCodeAt(n)],i=T[e.charCodeAt(n+1)],a=T[e.charCodeAt(n+2)],l=T[e.charCodeAt(n+3)],u[o++]=s<<2|i>>4,u[o++]=(15&i)<<4|a>>2,u[o++]=(3&a)<<6|63&l;return c})(e),t):{base64:!0,data:e},M=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer;function P(e){return e.reduce((e,t)=>e+t.length,0)}function D(e,t){if(e[0].length===t)return e.shift();let r=new Uint8Array(t),n=0;for(let o=0;o<t;o++)r[o]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function I(e){if(e){var t=e;for(var r in I.prototype)t[r]=I.prototype[r];return t}}I.prototype.on=I.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},I.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},I.prototype.off=I.prototype.removeListener=I.prototype.removeAllListeners=I.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<n.length;o++)if((r=n[o])===t||r.fn===t){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},I.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,o=r.length;n<o;++n)r[n].apply(this,t)}return this},I.prototype.emitReserved=I.prototype.emit,I.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},I.prototype.hasListeners=function(e){return!!this.listeners(e).length};let B="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),z="u">typeof self?self:"u">typeof window?window:Function("return this")();function L(e,...t){return t.reduce((t,r)=>(e.hasOwnProperty(r)&&(t[r]=e[r]),t),{})}let q=z.setTimeout,W=z.clearTimeout;function F(e,t){t.useNativeTimers?(e.setTimeoutFn=q.bind(z),e.clearTimeoutFn=W.bind(z)):(e.setTimeoutFn=z.setTimeout.bind(z),e.clearTimeoutFn=z.clearTimeout.bind(z))}function H(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class U extends Error{constructor(e,t,r){super(e),this.description=t,this.context=r,this.type="TransportError"}}class Y extends I{constructor(e){super(),this.writable=!1,F(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,r){return super.emitReserved("error",new U(e,t,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=N(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return -1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){let t=function(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}(e);return t.length?"?"+t:""}}class $ extends Y{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||t()})),this.writable||(e++,this.once("drain",function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};((e,t)=>{let r=e.split("\x1e"),n=[];for(let e=0;e<r.length;e++){let o=N(r[e],t);if(n.push(o),"error"===o.type)break}return n})(e,this.socket.binaryType).forEach(t),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){var t;let r,n,o;this.writable=!1,t=e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})},n=Array(r=e.length),o=0,e.forEach((e,s)=>{C(e,!1,e=>{n[s]=e,++o===r&&t(n.join("\x1e"))})})}uri(){let e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=H()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}}let V=!1;try{V="u">typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}let X=V;function K(){}class G extends ${constructor(e){if(super(e),"u">typeof location){const t="https:"===location.protocol;let r=location.port;r||(r=t?"443":"80"),this.xd="u">typeof location&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,t){let r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",(e,t)=>{this.onError("xhr post error",e,t)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,t)=>{this.onError("xhr poll error",e,t)}),this.pollXhr=e}}class Q extends I{constructor(e,t,r){super(),this.createRequest=e,F(this,r),this._opts=r,this._method=r.method||"GET",this._uri=t,this._data=void 0!==r.data?r.data:null,this._create()}_create(){var e;let t=L(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(t);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders)for(let e in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}catch(e){}if("POST"===this._method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}null==(e=this._opts.cookieJar)||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;3===r.readyState&&(null==(e=this._opts.cookieJar)||e.parseCookies(r.getResponseHeader("set-cookie"))),4===r.readyState&&(200===r.status||1223===r.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof r.status?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}"u">typeof document&&(this._index=Q.requestsCount++,Q.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=K,e)try{this._xhr.abort()}catch(e){}"u">typeof document&&delete Q.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}function J(){for(let e in Q.requests)Q.requests.hasOwnProperty(e)&&Q.requests[e].abort()}Q.requestsCount=0,Q.requests={},"u">typeof document&&("function"==typeof attachEvent?attachEvent("onunload",J):"function"==typeof addEventListener&&addEventListener("onpagehide"in z?"pagehide":"unload",J,!1));let Z=(o=ee({xdomain:!1}))&&null!==o.responseType;function ee(e){let t=e.xdomain;try{if("u">typeof XMLHttpRequest&&(!t||X))return new XMLHttpRequest}catch(e){}if(!t)try{return new z[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(e){}}let et="u">typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class er extends Y{get name(){return"websocket"}doOpen(){let e=this.uri(),t=this.opts.protocols,r=et?{}:L(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,r)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let r=e[t],n=t===e.length-1;C(r,this.supportsBinary,e=>{try{this.doWrite(r,e)}catch(e){}n&&B(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=H()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}let en=z.WebSocket||z.MozWebSocket,eo={websocket:class extends er{createSocket(e,t,r){return et?new en(e,t,r):t?new en(e,t):new en(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends Y{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{var n,o;let s,i,a,l,c=(n=Number.MAX_SAFE_INTEGER,o=this.socket.binaryType,r||(r=new TextDecoder),s=[],i=0,a=-1,l=!1,new TransformStream({transform(e,t){for(s.push(e);;){if(0===i){if(1>P(s))break;let e=D(s,1);l=(128&e[0])==128,i=(a=127&e[0])<126?3:126===a?1:2}else if(1===i){if(2>P(s))break;let e=D(s,2);a=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),i=3}else if(2===i){if(8>P(s))break;let e=D(s,8),r=new DataView(e.buffer,e.byteOffset,e.length),n=r.getUint32(0);if(n>2097151){t.enqueue(w);break}a=0x100000000*n+r.getUint32(4),i=3}else{if(P(s)<a)break;let e=D(s,a);t.enqueue(N(l?e:r.decode(e),o)),i=0}if(0===a||a>n){t.enqueue(w);break}}}})),u=e.readable.pipeThrough(c).getReader(),d=new TransformStream({transform(e,r){var n;n=t=>{let n,o=t.length;if(o<126)new DataView((n=new Uint8Array(1)).buffer).setUint8(0,o);else if(o<65536){let e=new DataView((n=new Uint8Array(3)).buffer);e.setUint8(0,126),e.setUint16(1,o)}else{let e=new DataView((n=new Uint8Array(9)).buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(o))}e.data&&"string"!=typeof e.data&&(n[0]|=128),r.enqueue(n),r.enqueue(t)},k&&e.data instanceof Blob?e.data.arrayBuffer().then(O).then(n):S&&(e.data instanceof ArrayBuffer||E(e.data))?n(O(e.data)):C(e,!1,e=>{t||(t=new TextEncoder),n(t.encode(e))})}});d.readable.pipeTo(e.writable),this._writer=d.writable.getWriter();let h=()=>{u.read().then(({done:e,value:t})=>{e||(this.onPacket(t),h())}).catch(e=>{})};h();let f={type:"open"};this.query.sid&&(f.data=`{"sid":"${this.query.sid}"}`),this._writer.write(f).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let r=e[t],n=t===e.length-1;this._writer.write(r).then(()=>{n&&B(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null==(e=this._transport)||e.close()}},polling:class extends G{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=Z&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Q(ee,this.uri(),e)}}},es=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ei=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ea(e){var t,r;let n,o;if(e.length>8e3)throw"URI too long";let s=e,i=e.indexOf("["),a=e.indexOf("]");-1!=i&&-1!=a&&(e=e.substring(0,i)+e.substring(i,a).replace(/:/g,";")+e.substring(a,e.length));let l=es.exec(e||""),c={},u=14;for(;u--;)c[ei[u]]=l[u]||"";return -1!=i&&-1!=a&&(c.source=s,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),n=(t=c.path).replace(/\/{2,9}/g,"/").split("/"),("/"==t.slice(0,1)||0===t.length)&&n.splice(0,1),"/"==t.slice(-1)&&n.splice(n.length-1,1),c.pathNames=n,r=c.query,o={},r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(o[t]=r)}),c.queryKey=o,c}let el="function"==typeof addEventListener&&"function"==typeof removeEventListener,ec=[];el&&addEventListener("offline",()=>{ec.forEach(e=>e())},!1);class eu extends I{constructor(e,t){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(t=e,e=null),e){const r=ea(e);t.hostname=r.host,t.secure="https"===r.protocol||"wss"===r.protocol,t.port=r.port,r.query&&(t.query=r.query)}else t.host&&(t.hostname=ea(t.host).host);F(this,t),this.secure=null!=t.secure?t.secure:"u">typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("u">typeof location?location.hostname:"localhost"),this.port=t.port||("u">typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{let t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},r=e.split("&");for(let e=0,n=r.length;e<n;e++){let n=r[e].split("=");t[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return t}(this.opts.query)),el&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ec.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);let r=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);let e=this.opts.rememberUpgrade&&eu.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";let t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",eu.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let t=Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){let r=this.writeBuffer[t].data;if(r&&(e+="string"==typeof r?function(e){let t=0,r=0;for(let n=0,o=e.length;n<o;n++)(t=e.charCodeAt(n))<128?r+=1:t<2048?r+=2:t<55296||t>=57344?r+=3:(n++,r+=4);return r}(r):Math.ceil(1.33*(r.byteLength||r.size))),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,B(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,r){return this._sendPacket("message",e,t,r),this}send(e,t,r){return this._sendPacket("message",e,t,r),this}_sendPacket(e,t,r,n){if("function"==typeof t&&(n=t,t=void 0),"function"==typeof r&&(n=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;let o={type:e,data:t,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},r=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(eu.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),el&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=ec.indexOf(this._offlineEventListener);-1!==e&&ec.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}eu.protocol=4;class ed extends eu{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),r=!1;eu.priorWebsocketSuccess=!1;let n=()=>{r||(t.send([{type:"ping",data:"probe"}]),t.once("packet",e=>{if(!r)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;eu.priorWebsocketSuccess="websocket"===t.name,this.transport.pause(()=>{r||"closed"!==this.readyState&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let e=Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}}))};function o(){r||(r=!0,c(),t.close(),t=null)}let s=e=>{let r=Error("probe error: "+e);r.transport=t.name,o(),this.emitReserved("upgradeError",r)};function i(){s("transport closed")}function a(){s("socket closed")}function l(e){t&&e.name!==t.name&&o()}let c=()=>{t.removeListener("open",n),t.removeListener("error",s),t.removeListener("close",i),this.off("close",a),this.off("upgrading",l)};t.once("open",n),t.once("error",s),t.once("close",i),this.once("close",a),this.once("upgrading",l),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{r||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}}class eh extends ed{constructor(e,t={}){const r="object"==typeof e?e:t;(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(e=>eo[e]).filter(e=>!!e)),super(e,r)}}eh.protocol;let ef="function"==typeof ArrayBuffer,ep=Object.prototype.toString,em="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===ep.call(Blob),eg="function"==typeof File||"u">typeof File&&"[object FileConstructor]"===ep.call(File);function eb(e){return ef&&(e instanceof ArrayBuffer||("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer))||em&&e instanceof Blob||eg&&e instanceof File}let ey=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];(l=g||(g={}))[l.CONNECT=0]="CONNECT",l[l.DISCONNECT=1]="DISCONNECT",l[l.EVENT=2]="EVENT",l[l.ACK=3]="ACK",l[l.CONNECT_ERROR=4]="CONNECT_ERROR",l[l.BINARY_EVENT=5]="BINARY_EVENT",l[l.BINARY_ACK=6]="BINARY_ACK";class ev extends I{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},"function"==typeof e?{reviver:e}:e)}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");let r=(t=this.decodeString(e)).type===g.BINARY_EVENT;r||t.type===g.BINARY_ACK?(t.type=r?g.EVENT:g.ACK,this.reconstructor=new ex(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(eb(e)||e.base64)if(this.reconstructor)(t=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw Error("got binary data when not reconstructing a packet");else throw Error("Unknown type: "+e)}decodeString(e){let t=0,r={type:Number(e.charAt(0))};if(void 0===g[r.type])throw Error("unknown packet type "+r.type);if(r.type===g.BINARY_EVENT||r.type===g.BINARY_ACK){let n=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);let o=e.substring(n,t);if(o!=Number(o)||"-"!==e.charAt(t))throw Error("Illegal attachments");let s=Number(o);if(!ew(s)||s<0)throw Error("Illegal attachments");if(s>this.opts.maxAttachments)throw Error("too many attachments");r.attachments=s}if("/"===e.charAt(t+1)){let n=t+1;for(;++t&&","!==e.charAt(t)&&t!==e.length;);r.nsp=e.substring(n,t)}else r.nsp="/";let n=e.charAt(t+1);if(""!==n&&Number(n)==n){let n=t+1;for(;++t;){let r=e.charAt(t);if(null==r||Number(r)!=r){--t;break}if(t===e.length)break}r.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){let n=this.tryParse(e.substr(t));if(ev.isPayloadValid(r.type,n))r.data=n;else throw Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case g.CONNECT:return ek(t);case g.DISCONNECT:return void 0===t;case g.CONNECT_ERROR:return"string"==typeof t||ek(t);case g.EVENT:case g.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===ey.indexOf(t[0]));case g.ACK:case g.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class ex{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t,r;let e=(t=this.reconPack,r=this.buffers,t.data=function e(t,r){if(!t)return t;if(t&&!0===t._placeholder){if("number"==typeof t.num&&t.num>=0&&t.num<r.length)return r[t.num];throw Error("illegal attachments")}if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=e(t[n],r);else if("object"==typeof t)for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=e(t[n],r));return t}(t.data,r),delete t.attachments,t);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}let ew=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function ek(e){return"[object Object]"===Object.prototype.toString.call(e)}function eS(e,t,r){return e.on(t,r),function(){e.off(t,r)}}e.s(["Decoder",0,ev,"Encoder",0,class{constructor(e){this.replacer=e}encode(e){return(e.type===g.EVENT||e.type===g.ACK)&&function e(t,r){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let r=0,n=t.length;r<n;r++)if(e(t[r]))return!0;return!1}if(eb(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1==arguments.length)return e(t.toJSON(),!0);for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return!0;return!1}(e)?this.encodeAsBinary({type:e.type===g.EVENT?g.BINARY_EVENT:g.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===g.BINARY_EVENT||e.type===g.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t,r,n=(t=[],r=e.data,e.data=function e(t,r){if(!t)return t;if(eb(t)){let e={_placeholder:!0,num:r.length};return r.push(t),e}if(Array.isArray(t)){let n=Array(t.length);for(let o=0;o<t.length;o++)n[o]=e(t[o],r);return n}if("object"==typeof t&&!(t instanceof Date)){let n={};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=e(t[o],r));return n}return t}(r,t),e.attachments=t.length,{packet:e,buffers:t}),o=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(o),s}},"PacketType",0,g,"isPacketValid",0,function(e){var t;return"string"==typeof e.nsp&&(void 0===(t=e.id)||ew(t))&&function(e,t){switch(e){case g.CONNECT:return void 0===t||ek(t);case g.DISCONNECT:return void 0===t;case g.EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===ey.indexOf(t[0]));case g.ACK:return Array.isArray(t);case g.CONNECT_ERROR:return"string"==typeof t||ek(t);default:return!1}}(e.type,e.data)},"protocol",0,5],11080);let eE=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class eC extends I{constructor(e,t,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[eS(e,"open",this.onopen.bind(this)),eS(e,"packet",this.onpacket.bind(this)),eS(e,"error",this.onerror.bind(this)),eS(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var r,n,o;if(eE.hasOwnProperty(e))throw Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let s={type:g.EVENT,data:t};if(s.options={},s.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){let e=this.ids++,r=t.pop();this._registerAckCallback(e,r),s.id=e}let i=null==(n=null==(r=this.io.engine)?void 0:r.transport)?void 0:n.writable,a=this.connected&&!(null==(o=this.io.engine)?void 0:o._hasPingExpired());return this.flags.volatile&&!i||(a?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(e,t){var r;let n=null!=(r=this.flags.timeout)?r:this._opts.ackTimeout;if(void 0===n){this.acks[e]=t;return}let o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,Error("operation has timed out"))},n),s=(...e)=>{this.io.clearTimeoutFn(o),t.apply(this,e)};s.withError=!0,this.acks[e]=s}emitWithAck(e,...t){return new Promise((r,n)=>{let o=(e,t)=>e?n(e):r(t);o.withError=!0,t.push(o),this.emit(e,...t)})}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());let r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...n)=>(this._queue[0],null!==e?r.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...n)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;let t=this._queue[0];(!t.pending||e)&&(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:g.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){let t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case g.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case g.EVENT:case g.BINARY_EVENT:this.onevent(e);break;case g.ACK:case g.BINARY_ACK:this.onack(e);break;case g.DISCONNECT:this.ondisconnect();break;case g.CONNECT_ERROR:this.destroy();let t=Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){let t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length)for(let t of this._anyListeners.slice())t.apply(this,e);super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,r=!1;return function(...n){r||(r=!0,t.packet({type:g.ACK,id:e,data:n}))}}onack(e){let t=this.acks[e.id];"function"==typeof t&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:g.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let r=0;r<t.length;r++)if(e===t[r]){t.splice(r,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let r=0;r<t.length;r++)if(e===t[r]){t.splice(r,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let t of this._anyOutgoingListeners.slice())t.apply(this,e.data)}}var e_=e.i(11080);function eO(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}eO.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=(1&Math.floor(10*t))==0?e-r:e+r}return 0|Math.min(e,this.max)},eO.prototype.reset=function(){this.attempts=0},eO.prototype.setMin=function(e){this.ms=e},eO.prototype.setMax=function(e){this.max=e},eO.prototype.setJitter=function(e){this.jitter=e};class ej extends I{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,F(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(r=t.randomizationFactor)?r:.5),this.backoff=new eO({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const n=t.parser||e_;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null==(t=this.backoff)||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null==(t=this.backoff)||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null==(t=this.backoff)||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new eh(this.uri,this.opts);let t=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;let n=eS(t,"open",function(){r.onopen(),e&&e()}),o=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},s=eS(t,"error",o);if(!1!==this._timeout){let e=this._timeout,r=this.setTimeoutFn(()=>{n(),o(Error("timeout")),t.close()},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}return this.subs.push(n),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(eS(e,"ping",this.onping.bind(this)),eS(e,"data",this.ondata.bind(this)),eS(e,"error",this.onerror.bind(this)),eS(e,"close",this.onclose.bind(this)),eS(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){B(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new eC(this,e,t),this.nsps[e]=r),r}_destroy(e){for(let e of Object.keys(this.nsps))if(this.nsps[e].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let r=0;r<t.length;r++)this.engine.write(t[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var r;this.cleanup(),null==(r=this.engine)||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()}))},t);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}let eT={};function eR(e,t){let r;"object"==typeof e&&(t=e,e=void 0);let n=function(e,t="",r){let n=e;r=r||"u">typeof location&&location,null==e&&(e=r.protocol+"//"+r.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==r?r.protocol+"//"+e:"https://"+e),n=ea(e)),!n.port&&(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";let o=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+o+":"+n.port+t,n.href=n.protocol+"://"+o+(r&&r.port===n.port?"":":"+n.port),n}(e,(t=t||{}).path||"/socket.io"),o=n.source,s=n.id,i=n.path,a=eT[s]&&i in eT[s].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||a?r=new ej(o,t):(eT[s]||(eT[s]=new ej(o,t)),r=eT[s]),n.query&&!t.query&&(t.query=n.queryKey),r.socket(n.path,t)}Object.assign(eR,{Manager:ej,Socket:eC,io:eR,connect:eR});let eN=e.i(74498).default.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";async function eA(){let e=await fetch(`${eN}/agents`);if(!e.ok)throw Error(`Failed to fetch agents: ${e.status}`);return e.json()}async function eM(e){let t=await fetch(`${eN}/agent/${e}`);if(!t.ok)throw Error(`Failed to fetch agent: ${t.status}`);return t.json()}async function eP(e){let t=await fetch(`${eN}/agent/${e}/resolve`,{method:"POST"});if(!t.ok)throw Error(`Failed to resolve agent: ${t.status}`)}let eD=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),eI=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var eB={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let ez=(0,y.createContext)({}),eL=(0,y.forwardRef)(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:n,className:o="",children:s,iconNode:i,...a},l)=>{let{size:c=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:h="currentColor",className:f=""}=(0,y.useContext)(ez)??{},p=n??d?24*Number(r??u)/Number(t??c):r??u;return(0,y.createElement)("svg",{ref:l,...eB,width:t??c??eB.width,height:t??c??eB.height,stroke:e??h,strokeWidth:p,className:eD("lucide",f,o),...!s&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(a)&&{"aria-hidden":"true"},...a},[...i.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(s)?s:[s]])}),eq=(e,t)=>{let r=(0,y.forwardRef)(({className:r,...n},o)=>(0,y.createElement)(eL,{ref:o,iconNode:t,className:eD(`lucide-${eI(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...n}));return r.displayName=eI(e),r},eW=eq("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),eF=eq("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),eH=eq("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),eU=eq("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);function eY(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=function e(t){var r,n,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var s=t.length;for(r=0;r<s;r++)t[r]&&(n=e(t[r]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}(e))&&(n&&(n+=" "),n+=t);return n}let e$=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),eV=[],eX=(e,t,r)=>{if(0==e.length-t)return r.classGroupId;let n=e[t],o=r.nextPart.get(n);if(o){let r=eX(e,t+1,o);if(r)return r}let s=r.validators;if(null===s)return;let i=0===t?e.join("-"):e.slice(t).join("-"),a=s.length;for(let e=0;e<a;e++){let t=s[e];if(t.validator(i))return t.classGroupId}},eK=(e,t)=>{let r=e$();for(let n in e)eG(e[n],r,n,t);return r},eG=(e,t,r,n)=>{let o=e.length;for(let s=0;s<o;s++)eQ(e[s],t,r,n)},eQ=(e,t,r,n)=>{"string"==typeof e?eJ(e,t,r):"function"==typeof e?eZ(e,t,r,n):e0(e,t,r,n)},eJ=(e,t,r)=>{(""===e?t:e1(t,e)).classGroupId=r},eZ=(e,t,r,n)=>{e2(e)?eG(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:r,validator:e}))},e0=(e,t,r,n)=>{let o=Object.entries(e),s=o.length;for(let e=0;e<s;e++){let[s,i]=o[e];eG(i,e1(t,s),r,n)}},e1=(e,t)=>{let r=e,n=t.split("-"),o=n.length;for(let e=0;e<o;e++){let t=n[e],o=r.nextPart.get(t);o||(o=e$(),r.nextPart.set(t,o)),r=o}return r},e2=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,e4=[],e3=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),e6=/\s+/,e5=e=>{let t;if("string"==typeof e)return e;let r="";for(let n=0;n<e.length;n++)e[n]&&(t=e5(e[n]))&&(r&&(r+=" "),r+=t);return r},e8=[],e9=e=>{let t=t=>t[e]||e8;return t.isThemeGetter=!0,t},e7=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,te=/^\((?:(\w[\w-]*):)?(.+)\)$/i,tt=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,tr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tn=/\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$/,to=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ts=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ti=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ta=e=>tt.test(e),tl=e=>!!e&&!Number.isNaN(Number(e)),tc=e=>!!e&&Number.isInteger(Number(e)),tu=e=>e.endsWith("%")&&tl(e.slice(0,-1)),td=e=>tr.test(e),th=()=>!0,tf=e=>tn.test(e)&&!to.test(e),tp=()=>!1,tm=e=>ts.test(e),tg=e=>ti.test(e),tb=e=>!tx(e)&&!tj(e),ty=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)),tv=e=>tI(e,tq,tp),tx=e=>e7.test(e),tw=e=>tI(e,tW,tf),tk=e=>tI(e,tF,tl),tS=e=>tI(e,tU,th),tE=e=>tI(e,tH,tp),tC=e=>tI(e,tz,tp),t_=e=>tI(e,tL,tg),tO=e=>tI(e,tY,tm),tj=e=>te.test(e),tT=e=>tB(e,tW),tR=e=>tB(e,tH),tN=e=>tB(e,tz),tA=e=>tB(e,tq),tM=e=>tB(e,tL),tP=e=>tB(e,tY,!0),tD=e=>tB(e,tU,!0),tI=(e,t,r)=>{let n=e7.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},tB=(e,t,r=!1)=>{let n=te.exec(e);return!!n&&(n[1]?t(n[1]):r)},tz=e=>"position"===e||"percentage"===e,tL=e=>"image"===e||"url"===e,tq=e=>"length"===e||"size"===e||"bg-size"===e,tW=e=>"length"===e,tF=e=>"number"===e,tH=e=>"family-name"===e,tU=e=>"number"===e||"weight"===e,tY=e=>"shadow"===e,t$=((e,...t)=>{let r,n,o,s,i=e=>{let t=n(e);if(t)return t;let s=((e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=t,a=[],l=e.trim().split(e6),c="";for(let e=l.length-1;e>=0;e-=1){let t,u=l[e],{isExternal:d,modifiers:h,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=r(u);if(d){c=u+(c.length>0?" "+c:c);continue}let g=!!m;if(g){let e=(t=n(p.substring(0,m)))&&i[t]?n(p):void 0;e&&e!==t&&(t=e,g=!1)}else t=n(p);if(!t){if(!g||!(t=n(p))){c=u+(c.length>0?" "+c:c);continue}g=!1}let b=0===h.length?"":1===h.length?h[0]:s(h).join(":"),y=f?b+"!":b,v=y+t;if(a.indexOf(v)>-1)continue;a.push(v);let x=o(t,g);for(let e=0;e<x.length;++e){let t=x[e];a.push(y+t)}c=u+(c.length>0?" "+c:c)}return c})(e,r);return o(e,s),s};return s=a=>{var l;let c;return n=(r={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null),o=(o,s)=>{r[o]=s,++t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(o(e,t),t):void 0},set(e,t){e in r?r[e]=t:o(e,t)}}})((l=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:r}=e,n=e=>{let t,r=[],n=0,o=0,s=0,i=e.length;for(let a=0;a<i;a++){let i=e[a];if(0===n&&0===o){if(":"===i){r.push(e.slice(s,a)),s=a+1;continue}if("/"===i){t=a;continue}}"["===i?n++:"]"===i?n--:"("===i?o++:")"===i&&o--}let a=0===r.length?e:e.slice(s),l=a,c=!1;return a.endsWith("!")?(l=a.slice(0,-1),c=!0):a.startsWith("!")&&(l=a.slice(1),c=!0),e3(r,c,l,t&&t>s?t-s:void 0)};if(t){let e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):e3(e4,!1,t,void 0,!0)}if(r){let e=n;n=t=>r({className:t,parseClassName:e})}return n})(l),sortModifiers:(c=new Map,l.orderSensitiveModifiers.forEach((e,t)=>{c.set(e,1e6+t)}),e=>{let t=[],r=[];for(let n=0;n<e.length;n++){let o=e[n],s="["===o[0],i=c.has(o);s||i?(r.length>0&&(r.sort(),t.push(...r),r=[]),t.push(o)):r.push(o)}return r.length>0&&(r.sort(),t.push(...r)),t}),postfixLookupClassGroupIds:(e=>{let t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let e=0;e<r.length;e++)t[r[e]]=!0;return t})(l),...(e=>{let t=(e=>{let{theme:t,classGroups:r}=e;return eK(r,t)})(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var r;let t,n,o;return -1===(r=e).slice(1,-1).indexOf(":")?void 0:(n=(t=r.slice(1,-1)).indexOf(":"),(o=t.slice(0,n))?"arbitrary.."+o:void 0)}let n=e.split("-"),o=+(""===n[0]&&n.length>1);return eX(n,o,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=n[e],o=r[e];if(t){if(o){let e=Array(o.length+t.length);for(let t=0;t<o.length;t++)e[t]=o[t];for(let r=0;r<t.length;r++)e[o.length+r]=t[r];return e}return t}return o||eV}return r[e]||eV}}})(l)}).cache.get,o=r.cache.set,s=i,i(a)},(...e)=>s(((...e)=>{let t,r,n=0,o="";for(;n<e.length;)(t=e[n++])&&(r=e5(t))&&(o&&(o+=" "),o+=r);return o})(...e))})(()=>{let e=e9("color"),t=e9("font"),r=e9("text"),n=e9("font-weight"),o=e9("tracking"),s=e9("leading"),i=e9("breakpoint"),a=e9("container"),l=e9("spacing"),c=e9("radius"),u=e9("shadow"),d=e9("inset-shadow"),h=e9("text-shadow"),f=e9("drop-shadow"),p=e9("blur"),m=e9("perspective"),g=e9("aspect"),b=e9("ease"),y=e9("animate"),v=()=>["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(),tj,tx],k=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto","contain","none"],E=()=>[tj,tx,l],C=()=>[ta,"full","auto",...E()],_=()=>[tc,"none","subgrid",tj,tx],O=()=>["auto",{span:["full",tc,tj,tx]},tc,tj,tx],j=()=>[tc,"auto",tj,tx],T=()=>["auto","min","max","fr",tj,tx],R=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],N=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...E()],M=()=>[ta,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],P=()=>[ta,"screen","full","dvw","lvw","svw","min","max","fit",...E()],D=()=>[ta,"screen","full","lh","dvh","lvh","svh","min","max","fit",...E()],I=()=>[e,tj,tx],B=()=>[...x(),tN,tC,{position:[tj,tx]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",tA,tv,{size:[tj,tx]}],q=()=>[tu,tT,tw],W=()=>["","none","full",c,tj,tx],F=()=>["",tl,tT,tw],H=()=>["solid","dashed","dotted","double"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[tl,tu,tN,tC],$=()=>["","none",p,tj,tx],V=()=>["none",tl,tj,tx],X=()=>["none",tl,tj,tx],K=()=>[tl,tj,tx],G=()=>[ta,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[td],breakpoint:[td],color:[th],container:[td],"drop-shadow":[td],ease:["in","out","in-out"],font:[tb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[td],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[td],shadow:[td],spacing:["px",tl],text:[td],"text-shadow":[td],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ta,tx,tj,g]}],container:["container"],"container-type":[{"@container":["","normal","size",tj,tx]}],"container-named":[ty],columns:[{columns:[tl,tx,tj,a]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"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:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{"inset-s":C(),start:C()}],end:[{"inset-e":C(),end:C()}],"inset-bs":[{"inset-bs":C()}],"inset-be":[{"inset-be":C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[tc,"auto",tj,tx]}],basis:[{basis:[ta,"full","auto",a,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[tl,ta,"auto","initial","none",tx]}],grow:[{grow:["",tl,tj,tx]}],shrink:[{shrink:["",tl,tj,tx]}],order:[{order:[tc,"first","last","none",tj,tx]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...R(),"normal"]}],"justify-items":[{"justify-items":[...N(),"normal"]}],"justify-self":[{"justify-self":["auto",...N()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[...N(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...N(),{baseline:["","last"]}]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[...N(),"baseline"]}],"place-self":[{"place-self":["auto",...N()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pbs:[{pbs:E()}],pbe:[{pbe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:M()}],"inline-size":[{inline:["auto",...P()]}],"min-inline-size":[{"min-inline":["auto",...P()]}],"max-inline-size":[{"max-inline":["none",...P()]}],"block-size":[{block:["auto",...D()]}],"min-block-size":[{"min-block":["auto",...D()]}],"max-block-size":[{"max-block":["none",...D()]}],w:[{w:[a,"screen",...M()]}],"min-w":[{"min-w":[a,"screen","none",...M()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...M()]}],h:[{h:["screen","lh",...M()]}],"min-h":[{"min-h":["screen","lh","none",...M()]}],"max-h":[{"max-h":["screen","lh",...M()]}],"font-size":[{text:["base",r,tT,tw]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,tD,tS]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tu,tx]}],"font-family":[{font:[tR,tE,t]}],"font-features":[{"font-features":[tx]}],"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:[o,tj,tx]}],"line-clamp":[{"line-clamp":[tl,"none",tj,tk]}],leading:[{leading:[s,...E()]}],"list-image":[{"list-image":["none",tj,tx]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",tj,tx]}],"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:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:[tl,"from-font","auto",tj,tw]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[tl,"auto",tj,tx]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"tab-size":[{tab:[tc,tj,tx]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",tj,tx]}],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",tj,tx]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},tc,tj,tx],radial:["",tj,tx],conic:[tc,tj,tx]},tM,t_]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-bs":[{"border-bs":F()}],"border-w-be":[{"border-be":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":F()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...H(),"hidden","none"]}],"divide-style":[{divide:[...H(),"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:[...H(),"none","hidden"]}],"outline-offset":[{"outline-offset":[tl,tj,tx]}],"outline-w":[{outline:["",tl,tT,tw]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",u,tP,tO]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",d,tP,tO]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[tl,tw]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",h,tP,tO]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[tl,tj,tx]}],"mix-blend":[{"mix-blend":[...U(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":U()}],"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":[tl]}],"mask-image-linear-from-pos":[{"mask-linear-from":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"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":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"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":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"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":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"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":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"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":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"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":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[tj,tx]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"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":[tl]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"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:B()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",tj,tx]}],filter:[{filter:["","none",tj,tx]}],blur:[{blur:$()}],brightness:[{brightness:[tl,tj,tx]}],contrast:[{contrast:[tl,tj,tx]}],"drop-shadow":[{"drop-shadow":["","none",f,tP,tO]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",tl,tj,tx]}],"hue-rotate":[{"hue-rotate":[tl,tj,tx]}],invert:[{invert:["",tl,tj,tx]}],saturate:[{saturate:[tl,tj,tx]}],sepia:[{sepia:["",tl,tj,tx]}],"backdrop-filter":[{"backdrop-filter":["","none",tj,tx]}],"backdrop-blur":[{"backdrop-blur":$()}],"backdrop-brightness":[{"backdrop-brightness":[tl,tj,tx]}],"backdrop-contrast":[{"backdrop-contrast":[tl,tj,tx]}],"backdrop-grayscale":[{"backdrop-grayscale":["",tl,tj,tx]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[tl,tj,tx]}],"backdrop-invert":[{"backdrop-invert":["",tl,tj,tx]}],"backdrop-opacity":[{"backdrop-opacity":[tl,tj,tx]}],"backdrop-saturate":[{"backdrop-saturate":[tl,tj,tx]}],"backdrop-sepia":[{"backdrop-sepia":["",tl,tj,tx]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",tj,tx]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[tl,"initial",tj,tx]}],ease:[{ease:["linear","initial",b,tj,tx]}],delay:[{delay:[tl,tj,tx]}],animate:[{animate:["none",y,tj,tx]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,tj,tx]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:K()}],"skew-x":[{"skew-x":K()}],"skew-y":[{"skew-y":K()}],transform:[{transform:[tj,tx,"","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:[tc,tj,tx]}],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",tj,tx]}],"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":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mbs":[{"scroll-mbs":E()}],"scroll-mbe":[{"scroll-mbe":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pbs":[{"scroll-pbs":E()}],"scroll-pbe":[{"scroll-pbe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",tj,tx]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[tl,tT,tw,tk]}],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 tV(...e){return t$(eY(e))}function tX({className:e,size:t="default",...r}){return(0,b.jsx)("div",{"data-slot":"card","data-size":t,className:tV("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...r})}function tK({className:e,...t}){return(0,b.jsx)("div",{"data-slot":"card-content",className:tV("px-4 group-data-[size=sm]/card:px-3",e),...t})}function tG({className:e,...t}){return(0,b.jsx)("div",{"data-slot":"skeleton",className:tV("animate-pulse rounded-md bg-muted",e),...t})}let tQ=[{label:"Total Agents",icon:eU,color:"text-foreground",iconBg:"bg-muted"},{label:"Running",icon:eW,color:"text-blue-600 dark:text-blue-400",iconBg:"bg-blue-50 dark:bg-blue-950/30"},{label:"Needs Attention",icon:eF,color:"text-amber-600 dark:text-amber-400",iconBg:"bg-amber-50 dark:bg-amber-950/30"},{label:"Completed",icon:eH,color:"text-emerald-600 dark:text-emerald-400",iconBg:"bg-emerald-50 dark:bg-emerald-950/30"}];function tJ({agents:e,loading:t}){let r=(0,y.useMemo)(()=>(function(e){let t=0,r=0,n=0;for(let o of e)"running"===o.status&&t++,o.needsAttention&&r++,"done"===o.status&&n++;return[e.length,t,r,n]})(e),[e]);return(0,b.jsx)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:tQ.map(({label:e,icon:n,color:o,iconBg:s},i)=>(0,b.jsx)(tX,{children:(0,b.jsxs)(tK,{className:"flex items-center gap-4 p-5",children:[(0,b.jsx)("div",{className:tV("rounded-lg p-2.5",s,o),children:(0,b.jsx)(n,{className:"h-4 w-4"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:e}),t?(0,b.jsx)(tG,{className:"mt-1 h-7 w-10"}):(0,b.jsx)("p",{className:"text-2xl font-semibold tracking-tight tabular-nums",children:r[i]})]})]})},e))})}function tZ(){return"u">typeof window}function t0(e){return t2(e)?(e.nodeName||"").toLowerCase():"#document"}function t1(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function t2(e){return!!tZ()&&(e instanceof Node||e instanceof t1(e).Node)}function t4(e){return!!tZ()&&(e instanceof Element||e instanceof t1(e).Element)}function t3(e){return!!tZ()&&(e instanceof HTMLElement||e instanceof t1(e).HTMLElement)}function t6(e){return!(!tZ()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof t1(e).ShadowRoot)}function t5(e){let{overflow:t,overflowX:r,overflowY:n,display:o}=t9(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&"inline"!==o&&"contents"!==o}function t8(e){return/^(html|body|#document)$/.test(t0(e))}function t9(e){return t1(e).getComputedStyle(e)}let t7={};function re(e,t){let r=y.useRef(t7);return r.current===t7&&(r.current=e(t)),r}let rt=y[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],rr=rt&&rt!==y.useLayoutEffect?rt:e=>e();function rn(e){let t=re(ro).current;return t.next=e,rr(t.effect),t.trampoline}function ro(){let e={next:void 0,callback:rs,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function rs(){}let ri="u">typeof document?y.useLayoutEffect:()=>{};function ra(e,t){return e&&!t?e:!e&&t?t:e||t?{...e,...t}:void 0}let rl={};function rc(e,t,r,n,o){if(!r&&!n&&!o&&!e)return ru(t);let s=ru(e);return t&&(s=rd(s,t)),r&&(s=rd(s,r)),n&&(s=rd(s,n)),o&&(s=rd(s,o)),s}function ru(e){return rf(e)?{...rp(e,rl)}:function(e){let t={...e};for(let e in t){let r=t[e];rh(e,r)&&(t[e]=rm(r))}return t}(e)}function rd(e,t){return rf(t)?rp(t,e):function(e,t){if(!t)return e;for(let r in t){let n=t[r];switch(r){case"style":e[r]=ra(e.style,n);break;case"className":e[r]=rb(e.className,n);break;default:rh(r,n)?e[r]=function(e,t){return t?e?(...r)=>{let n=r[0];if(ry(n)){rg(n);let o=t(...r);return n.baseUIHandlerPrevented||e?.(...r),o}let o=t(...r);return e?.(...r),o}:rm(t):e}(e[r],n):e[r]=n}}return e}(e,t)}function rh(e,t){let r=e.charCodeAt(0),n=e.charCodeAt(1),o=e.charCodeAt(2);return 111===r&&110===n&&o>=65&&o<=90&&("function"==typeof t||void 0===t)}function rf(e){return"function"==typeof e}function rp(e,t){return rf(e)?e(t):e??rl}function rm(e){return e?(...t)=>{let r=t[0];return ry(r)&&rg(r),e(...t)}:e}function rg(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function rb(e,t){return t?e?t+" "+e:t:e}function ry(e){return null!=e&&"object"==typeof e&&"nativeEvent"in e}let rv=function(e,...t){let r=new URL("https://base-ui.com/production-error");return r.searchParams.set("code",e.toString()),t.forEach(e=>r.searchParams.append("args[]",e)),`Base UI error #${e}; visit ${r} for the full message.`},rx=y.createContext(void 0);function rw(e={}){let{disabled:t=!1,focusableWhenDisabled:r,tabIndex:n=0,native:o=!0,composite:s}=e,i=y.useRef(null),a=function(e=!1){let t=y.useContext(rx);if(void 0===t&&!e)throw Error(rv(16));return t}(!0),l=s??void 0!==a,{props:c}=function(e){let{focusableWhenDisabled:t,disabled:r,composite:n=!1,tabIndex:o=0,isNativeButton:s}=e,i=n&&!1!==t,a=n&&!1===t;return{props:y.useMemo(()=>{let e={onKeyDown(e){r&&t&&"Tab"!==e.key&&e.preventDefault()}};return n||(e.tabIndex=o,!s&&r&&(e.tabIndex=t?o:-1)),(s&&(t||i)||!s&&r)&&(e["aria-disabled"]=r),s&&(!t||a)&&(e.disabled=r),e},[n,r,t,i,a,s,o])}}({focusableWhenDisabled:r,disabled:t,composite:l,tabIndex:n,isNativeButton:o}),u=y.useCallback(()=>{let e=i.current;rk(e)&&l&&t&&void 0===c.disabled&&e.disabled&&(e.disabled=!1)},[t,c.disabled,l]);return ri(u,[u]),{getButtonProps:y.useCallback((e={})=>{let{onClick:r,onMouseDown:n,onKeyUp:s,onKeyDown:i,onPointerDown:a,...u}=e;return rc({type:o?"button":void 0,onClick(e){t?e.preventDefault():r?.(e)},onMouseDown(e){t||n?.(e)},onKeyDown(e){var n;if(t||(rg(e),i?.(e),e.baseUIHandlerPrevented))return;let s=e.target===e.currentTarget,a=e.currentTarget,c=rk(a),u=!o&&(n=a,!!(n?.tagName==="A"&&n?.href)),d=s&&(o?c:!u),h="Enter"===e.key,f=" "===e.key,p=a.getAttribute("role"),m=p?.startsWith("menuitem")||"option"===p||"gridcell"===p;if(s&&l&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),u||o&&c?(a.click(),e.preventBaseUIHandler()):d&&(r?.(e),e.preventBaseUIHandler());return}d&&(!o&&(f||h)&&e.preventDefault(),!o&&h&&r?.(e))},onKeyUp(e){t||((rg(e),s?.(e),e.target===e.currentTarget&&o&&l&&rk(e.currentTarget)&&" "===e.key)?e.preventDefault():!e.baseUIHandlerPrevented&&(e.target!==e.currentTarget||o||l||" "!==e.key||r?.(e)))},onPointerDown(e){t?e.preventDefault():a?.(e)}},o?void 0:{role:"button"},c,u)},[t,c,l,o]),buttonRef:rn(e=>{i.current=e,u()})}}function rk(e){return t3(e)&&"BUTTON"===e.tagName}function rS(e,t,r,n){var o,s,i,a,l;let c=re(rE).current;return o=c,s=e,i=t,a=r,l=n,(o.refs[0]!==s||o.refs[1]!==i||o.refs[2]!==a||o.refs[3]!==l)&&rC(c,[e,t,r,n]),c.callback}function rE(){return{callback:null,cleanup:null,refs:[]}}function rC(e,t){if(e.refs=t,t.every(e=>null==e)){e.callback=null;return}e.callback=r=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),null!=r){let n=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let o=t[e];if(null!=o)switch(typeof o){case"function":{let t=o(r);"function"==typeof t&&(n[e]=t);break}case"object":o.current=r}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let r=t[e];if(null!=r)switch(typeof r){case"function":{let t=n[e];"function"==typeof t?t():r(null);break}case"object":r.current=null}}}}}}let r_=parseInt(y.version,10);function rO(e){if(!y.isValidElement(e))return null;let t=e.props;return(r_>=19?t?.ref:e.ref)??null}function rj(){}Object.freeze([]);let rT=Object.freeze({});function rR(e,t,r={}){let n=t.render,o=function(e,t={}){var r,n,o;let{className:s,style:i,render:a}=e,{state:l=rT,ref:c,props:u,stateAttributesMapping:d,enabled:h=!0}=t,f=h?"function"==typeof s?s(l):s:void 0,p=h?"function"==typeof i?i(l):i:void 0,m=h?function(e,t){let r={};for(let n in e){let o=e[n];if(t?.hasOwnProperty(n)){let e=t[n](o);null!=e&&Object.assign(r,e);continue}!0===o?r[`data-${n.toLowerCase()}`]="":o&&(r[`data-${n.toLowerCase()}`]=o.toString())}return r}(l,d):rT,g=h&&u?function(e){if(Array.isArray(e)){if(0===e.length)return rl;if(1===e.length)return ru(e[0]);let t=ru(e[0]);for(let r=1;r<e.length;r+=1)t=rd(t,e[r]);return t}return rc(void 0,e)}(u):void 0,b=h?ra(m,g)??{}:rT;if("u">typeof document)if(h)if(Array.isArray(c)){let e;r=[b.ref,rO(a),...c],n=e=re(rE).current,o=r,(n.refs.length!==o.length||n.refs.some((e,t)=>e!==o[t]))&&rC(e,r),b.ref=e.callback}else b.ref=rS(b.ref,rO(a),c);else rS(null,null);return h?(void 0!==f&&(b.className=rb(b.className,f)),void 0!==p&&(b.style=ra(b.style,p)),b):rT}(t,r);return!1===r.enabled?null:function(e,t,r,n){if(t){if("function"==typeof t)return t(r,n);let e=rc(r,t.props);e.ref=r.ref;let o=t;return o?.$$typeof===rN&&(o=y.Children.toArray(t)[0]),y.cloneElement(o,e)}if(e&&"string"==typeof e){var o,s;return o=e,s=r,"button"===o?(0,y.createElement)("button",{type:"button",...s,key:s.key}):"img"===o?(0,y.createElement)("img",{alt:"",...s,key:s.key}):y.createElement(o,s)}throw Error(rv(8))}(e,n,o,r.state??rT)}let rN=Symbol.for("react.lazy"),rA=y.forwardRef(function(e,t){let{render:r,className:n,disabled:o=!1,focusableWhenDisabled:s=!1,nativeButton:i=!0,style:a,...l}=e,{getButtonProps:c,buttonRef:u}=rw({disabled:o,focusableWhenDisabled:s,native:i});return rR("button",e,{state:{disabled:o},ref:[t,u],props:[l,c]})}),rM=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,rP=(s="group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i={variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}},e=>{var t;if((null==i?void 0:i.variants)==null)return eY(s,null==e?void 0:e.class,null==e?void 0:e.className);let{variants:r,defaultVariants:n}=i,o=Object.keys(r).map(t=>{let o=null==e?void 0:e[t],s=null==n?void 0:n[t];if(null===o)return null;let i=rM(o)||rM(s);return r[t][i]}),a=e&&Object.entries(e).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return eY(s,o,null==i||null==(t=i.compoundVariants)?void 0:t.reduce((e,t)=>{let{class:r,className:o,...s}=t;return Object.entries(s).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...n,...a}[t]):({...n,...a})[t]===r})?[...e,r,o]:e},[]),null==e?void 0:e.class,null==e?void 0:e.className)});function rD({className:e,variant:t="default",size:r="default",...n}){return(0,b.jsx)(rA,{"data-slot":"button",className:tV(rP({variant:t,size:r,className:e})),...n})}function rI({agents:e,onResolve:t}){let r=e.filter(e=>e.needsAttention);return 0===r.length?null:(0,b.jsxs)("div",{className:"rounded-xl border border-amber-200 bg-amber-50/50 p-4 dark:border-amber-900/40 dark:bg-amber-950/10",children:[(0,b.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,b.jsx)(eF,{className:"h-4 w-4 text-amber-600 dark:text-amber-400"}),(0,b.jsxs)("h2",{className:"text-sm font-semibold text-amber-800 dark:text-amber-300",children:["Needs Attention (",r.length,")"]})]}),(0,b.jsx)("div",{className:"flex flex-col gap-2",children:r.map(e=>(0,b.jsx)(rB,{agent:e,onResolve:t},e.id))})]})}function rB({agent:e,onResolve:t}){let[r,n]=(0,y.useState)(!1),o=(0,y.useCallback)(async()=>{n(!0);try{await eP(e.id),t()}finally{n(!1)}},[e.id,t]);return(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-lg bg-white px-4 py-2.5 ring-1 ring-amber-200/60 dark:bg-amber-950/20 dark:ring-amber-800/30",children:[(0,b.jsx)("span",{className:"font-medium text-sm",children:e.name}),(0,b.jsx)("span",{className:"flex-1 truncate text-sm text-muted-foreground",children:e.attentionReason}),(0,b.jsx)(rD,{size:"sm",variant:"outline",disabled:r,onClick:o,className:"shrink-0",children:r?"Resolving...":"Resolve"})]})}let rz=Symbol.for("constructDateFrom");function rL(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&rz in e?e[rz](t):e instanceof Date?new e.constructor(t):new Date(t)}let rq={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function rW(e){return (t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}let rF={date:rW({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:rW({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:rW({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},rH={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function rU(e){return(t,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,o=r?.width?String(r.width):t;n=e.formattingValues[o]||e.formattingValues[t]}else{let t=e.defaultWidth,o=r?.width?String(r.width):e.defaultWidth;n=e.values[o]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function rY(e){return(t,r={})=>{let n,o=r.width,s=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;let a=i[0],l=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}(l,e=>e.test(a)):function(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}(l,e=>e.test(a));return n=e.valueCallback?e.valueCallback(c):c,{value:n=r.valueCallback?r.valueCallback(n):n,rest:t.slice(a.length)}}}let r$={code:"en-US",formatDistance:(e,t,r)=>{let n,o=rq[e];if(n="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),r?.addSuffix)if(r.comparison&&r.comparison>0)return"in "+n;else return n+" ago";return n},formatLong:rF,formatRelative:(e,t,r,n)=>rH[e],localize:{ordinalNumber:(e,t)=>{let r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:rU({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:rU({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:rU({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:rU({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:rU({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(c={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{let r=e.match(c.matchPattern);if(!r)return null;let n=r[0],o=e.match(c.parsePattern);if(!o)return null;let s=c.valueCallback?c.valueCallback(o[0]):o[0];return{value:s=t.valueCallback?t.valueCallback(s):s,rest:e.slice(n.length)}}),era:rY({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:rY({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:rY({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:rY({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:rY({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},rV={};function rX(e,t){return rL(t||e,e)}function rK(e){let t=rX(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),e-r}function rG(e,...t){let r=rL.bind(null,e||t.find(e=>"object"==typeof e));return t.map(r)}function rQ(e,t){let r=rX(e)-rX(t);return r<0?-1:r>0?1:r}function rJ(e,t){return function(e,t,r){var n;let o,s=r?.locale??rV.locale??r$,i=rQ(e,t);if(isNaN(i))throw RangeError("Invalid time value");let a=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:i}),[l,c]=rG(r?.in,...i>0?[t,e]:[e,t]),u=(n=void 0,e=>{let t=(n?Math[n]:Math.trunc)(e);return 0===t?0:t})((rX(c)-rX(l))/1e3),d=Math.round((u-(rK(c)-rK(l))/1e3)/60);if(d<2)if(r?.includeSeconds)if(u<5)return s.formatDistance("lessThanXSeconds",5,a);else if(u<10)return s.formatDistance("lessThanXSeconds",10,a);else if(u<20)return s.formatDistance("lessThanXSeconds",20,a);else if(u<40)return s.formatDistance("halfAMinute",0,a);else if(u<60)return s.formatDistance("lessThanXMinutes",1,a);else return s.formatDistance("xMinutes",1,a);else if(0===d)return s.formatDistance("lessThanXMinutes",1,a);else return s.formatDistance("xMinutes",d,a);if(d<45)return s.formatDistance("xMinutes",d,a);if(d<90)return s.formatDistance("aboutXHours",1,a);if(d<1440){let e=Math.round(d/60);return s.formatDistance("aboutXHours",e,a)}if(d<2520)return s.formatDistance("xDays",1,a);else if(d<43200){let e=Math.round(d/1440);return s.formatDistance("xDays",e,a)}else if(d<86400)return o=Math.round(d/43200),s.formatDistance("aboutXMonths",o,a);if((o=function(e,t){var r,n;let o,s,i,a,[l,c,u]=rG(void 0,e,e,t),d=rQ(c,u),h=Math.abs(function(e,t){let[r,n]=rG(void 0,e,t);return 12*(r.getFullYear()-n.getFullYear())+(r.getMonth()-n.getMonth())}(c,u));if(h<1)return 0;1===c.getMonth()&&c.getDate()>27&&c.setDate(30),c.setMonth(c.getMonth()-d*h);let f=rQ(c,u)===-d;+(o=rX(l,void 0),r=void 0,(s=rX(o,r?.in)).setHours(23,59,59,999),s)==+(n=void 0,a=(i=rX(o,n?.in)).getMonth(),i.setFullYear(i.getFullYear(),a+1,0),i.setHours(23,59,59,999),i)&&1===h&&1===rQ(l,u)&&(f=!1);let p=d*(h-f);return 0===p?0:p}(c,l))<12){let e=Math.round(d/43200);return s.formatDistance("xMonths",e,a)}{let e=o%12,t=Math.trunc(o/12);return e<3?s.formatDistance("aboutXYears",t,a):e<9?s.formatDistance("overXYears",t,a):s.formatDistance("almostXYears",t+1,a)}}(e,rL(e,Date.now()),t)}function rZ({className:e,...t}){return(0,b.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,b.jsx)("table",{"data-slot":"table",className:tV("w-full caption-bottom text-sm",e),...t})})}function r0({className:e,...t}){return(0,b.jsx)("thead",{"data-slot":"table-header",className:tV("[&_tr]:border-b",e),...t})}function r1({className:e,...t}){return(0,b.jsx)("tbody",{"data-slot":"table-body",className:tV("[&_tr:last-child]:border-0",e),...t})}function r2({className:e,...t}){return(0,b.jsx)("tr",{"data-slot":"table-row",className:tV("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function r4({className:e,...t}){return(0,b.jsx)("th",{"data-slot":"table-head",className:tV("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",e),...t})}function r3({className:e,...t}){return(0,b.jsx)("td",{"data-slot":"table-cell",className:tV("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",e),...t})}let r6={running:{label:"Running",dot:"bg-blue-500 animate-pulse",bg:"bg-blue-50 dark:bg-blue-950/20",text:"text-blue-700 dark:text-blue-400",border:"border-blue-200 dark:border-blue-800/60"},done:{label:"Done",dot:"bg-neutral-400 dark:bg-neutral-500",bg:"bg-neutral-50 dark:bg-neutral-800/30",text:"text-neutral-600 dark:text-neutral-400",border:"border-neutral-200 dark:border-neutral-700/60"}};function r5({status:e}){let t=r6[e]??r6.done;return(0,b.jsxs)("span",{className:tV("inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-xs font-medium",t.bg,t.text,t.border),children:[(0,b.jsx)("span",{className:tV("h-1.5 w-1.5 rounded-full",t.dot)}),t.label]})}let r8=eq("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),r9=`import { Agent } from "orchestrator-sdk";
2
+
3
+ const agent = new Agent("my-agent");
4
+ await agent.start();
5
+ await agent.step("doing something...");
6
+ await agent.end();`;function r7(){return(0,b.jsxs)("div",{className:"flex flex-col items-center gap-5 rounded-xl border border-dashed py-16 text-center",children:[(0,b.jsx)("div",{className:"rounded-full bg-muted p-3",children:(0,b.jsx)(r8,{className:"h-6 w-6 text-muted-foreground"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-base font-medium",children:"No agents yet"}),(0,b.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Install the SDK and start your first agent to see it here."})]}),(0,b.jsx)("code",{className:"rounded-lg bg-muted px-4 py-2 text-sm font-mono",children:"npm install orchestrator-sdk"}),(0,b.jsx)("pre",{className:"max-w-sm rounded-lg bg-muted px-6 py-4 text-left text-xs leading-relaxed font-mono",children:r9})]})}function ne(){return(0,b.jsxs)(rZ,{children:[(0,b.jsx)(r0,{children:(0,b.jsxs)(r2,{children:[(0,b.jsx)(r4,{children:"Name"}),(0,b.jsx)(r4,{children:"Status"}),(0,b.jsx)(r4,{children:"Last message"}),(0,b.jsx)(r4,{className:"text-right",children:"Last update"})]})}),(0,b.jsx)(r1,{children:Array.from({length:4}).map((e,t)=>(0,b.jsxs)(r2,{children:[(0,b.jsx)(r3,{children:(0,b.jsx)(tG,{className:"h-4 w-28"})}),(0,b.jsx)(r3,{children:(0,b.jsx)(tG,{className:"h-5 w-16 rounded-full"})}),(0,b.jsx)(r3,{children:(0,b.jsx)(tG,{className:"h-4 w-48"})}),(0,b.jsx)(r3,{className:"text-right",children:(0,b.jsx)(tG,{className:"ml-auto h-4 w-24"})})]},t))})]})}function nt({agents:e,loading:t,onSelect:r}){let n=(0,y.useMemo)(()=>[...e].sort((e,t)=>new Date(t.lastUpdateAt).getTime()-new Date(e.lastUpdateAt).getTime()),[e]);return t?(0,b.jsx)(ne,{}):0===e.length?(0,b.jsx)(r7,{}):(0,b.jsx)("div",{className:"rounded-xl border",children:(0,b.jsxs)(rZ,{children:[(0,b.jsx)(r0,{children:(0,b.jsxs)(r2,{className:"hover:bg-transparent",children:[(0,b.jsx)(r4,{children:"Name"}),(0,b.jsx)(r4,{children:"Status"}),(0,b.jsx)(r4,{children:"Last message"}),(0,b.jsx)(r4,{className:"text-right",children:"Last update"})]})}),(0,b.jsx)(r1,{children:n.map(e=>(0,b.jsxs)(r2,{className:"cursor-pointer transition-colors",onClick:()=>r(e.id),tabIndex:0,role:"button",onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),r(e.id))},children:[(0,b.jsx)(r3,{className:"font-medium",children:e.name}),(0,b.jsx)(r3,{children:(0,b.jsx)(r5,{status:e.status})}),(0,b.jsx)(r3,{className:"max-w-xs truncate text-muted-foreground",children:e.events[0]?.message??"—"}),(0,b.jsx)(r3,{className:"text-right text-muted-foreground",children:rJ(new Date(e.lastUpdateAt),{addSuffix:!0})})]},e.id))})]})})}function nr(e,t){let r=rX(e,t?.in);return r.setHours(0,0,0,0),r}function nn(e,t){let r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??rV.weekStartsOn??rV.locale?.options?.weekStartsOn??0,n=rX(e,t?.in),o=n.getDay();return n.setDate(n.getDate()-(7*(o<r)+o-r)),n.setHours(0,0,0,0),n}function no(e,t){return nn(e,{...t,weekStartsOn:1})}function ns(e,t){let r=rX(e,t?.in),n=r.getFullYear(),o=rL(r,0);o.setFullYear(n+1,0,4),o.setHours(0,0,0,0);let s=no(o),i=rL(r,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);let a=no(i);return r.getTime()>=s.getTime()?n+1:r.getTime()>=a.getTime()?n:n-1}function ni(e,t){let r=rX(e,t?.in),n=r.getFullYear(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??rV.firstWeekContainsDate??rV.locale?.options?.firstWeekContainsDate??1,s=rL(t?.in||e,0);s.setFullYear(n+1,0,o),s.setHours(0,0,0,0);let i=nn(s,t),a=rL(t?.in||e,0);a.setFullYear(n,0,o),a.setHours(0,0,0,0);let l=nn(a,t);return+r>=+i?n+1:+r>=+l?n:n-1}function na(e,t){let r=Math.abs(e).toString().padStart(t,"0");return(e<0?"-":"")+r}let nl={y(e,t){let r=e.getFullYear(),n=r>0?r:1-r;return na("yy"===t?n%100:n,t.length)},M(e,t){let r=e.getMonth();return"M"===t?String(r+1):na(r+1,2)},d:(e,t)=>na(e.getDate(),t.length),a(e,t){let r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>na(e.getHours()%12||12,t.length),H:(e,t)=>na(e.getHours(),t.length),m:(e,t)=>na(e.getMinutes(),t.length),s:(e,t)=>na(e.getSeconds(),t.length),S(e,t){let r=t.length;return na(Math.trunc(e.getMilliseconds()*Math.pow(10,r-3)),t.length)}},nc={G:function(e,t,r){let n=+(e.getFullYear()>0);switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){let t=e.getFullYear();return r.ordinalNumber(t>0?t:1-t,{unit:"year"})}return nl.y(e,t)},Y:function(e,t,r,n){let o=ni(e,n),s=o>0?o:1-o;return"YY"===t?na(s%100,2):"Yo"===t?r.ordinalNumber(s,{unit:"year"}):na(s,t.length)},R:function(e,t){return na(ns(e),t.length)},u:function(e,t){return na(e.getFullYear(),t.length)},Q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return na(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return na(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){let n=e.getMonth();switch(t){case"M":case"MM":return nl.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){let n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return na(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){let o,s,i,a,l=Math.round((nn(o=rX(e,n?.in),n)-(s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??rV.firstWeekContainsDate??rV.locale?.options?.firstWeekContainsDate??1,i=ni(o,n),(a=rL(n?.in||o,0)).setFullYear(i,0,s),a.setHours(0,0,0,0),nn(a,n)))/6048e5)+1;return"wo"===t?r.ordinalNumber(l,{unit:"week"}):na(l,t.length)},I:function(e,t,r){let n,o,s,i=Math.round((no(n=rX(e,void 0))-(o=ns(n,void 0),(s=rL(n,0)).setFullYear(o,0,4),s.setHours(0,0,0,0),no(s)))/6048e5)+1;return"Io"===t?r.ordinalNumber(i,{unit:"week"}):na(i,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):nl.d(e,t)},D:function(e,t,r){let n,o,s=function(e,t){let[r,n]=rG(void 0,e,t),o=nr(r),s=nr(n);return Math.round((o-rK(o)-(s-rK(s)))/864e5)}(o=rX(e,void 0),((n=rX(o,void 0)).setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n))+1;return"Do"===t?r.ordinalNumber(s,{unit:"dayOfYear"}):na(s,t.length)},E:function(e,t,r){let n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){let o=e.getDay(),s=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return na(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){let o=e.getDay(),s=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return na(s,t.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){let n=e.getDay(),o=0===n?7:n;switch(t){case"i":return String(o);case"ii":return na(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){let n,o=e.getHours();switch(n=12===o?"noon":0===o?"midnight":o/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){let n,o=e.getHours();switch(n=o>=17?"evening":o>=12?"afternoon":o>=4?"morning":"night",t){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return nl.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):nl.H(e,t)},K:function(e,t,r){let n=e.getHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):na(n,t.length)},k:function(e,t,r){let n=e.getHours();return(0===n&&(n=24),"ko"===t)?r.ordinalNumber(n,{unit:"hour"}):na(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):nl.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):nl.s(e,t)},S:function(e,t){return nl.S(e,t)},X:function(e,t,r){let n=e.getTimezoneOffset();if(0===n)return"Z";switch(t){case"X":return nd(n);case"XXXX":case"XX":return nh(n);default:return nh(n,":")}},x:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"x":return nd(n);case"xxxx":case"xx":return nh(n);default:return nh(n,":")}},O:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+nu(n,":");default:return"GMT"+nh(n,":")}},z:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+nu(n,":");default:return"GMT"+nh(n,":")}},t:function(e,t,r){return na(Math.trunc(e/1e3),t.length)},T:function(e,t,r){return na(+e,t.length)}};function nu(e,t=""){let r=e>0?"-":"+",n=Math.abs(e),o=Math.trunc(n/60),s=n%60;return 0===s?r+String(o):r+String(o)+t+na(s,2)}function nd(e,t){return e%60==0?(e>0?"-":"+")+na(Math.abs(e)/60,2):nh(e,t)}function nh(e,t=""){let r=Math.abs(e);return(e>0?"-":"+")+na(Math.trunc(r/60),2)+t+na(r%60,2)}let nf=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},np=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},nm={p:np,P:(e,t)=>{let r,n=e.match(/(P+)(p+)?/)||[],o=n[1],s=n[2];if(!s)return nf(e,t);switch(o){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",nf(o,t)).replace("{{time}}",np(s,t))}},ng=/^D+$/,nb=/^Y+$/,ny=["D","DD","YY","YYYY"],nv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nw=/^'([^]*?)'?$/,nk=/''/g,nS=/[a-zA-Z]/,nE=eq("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),nC=eq("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),n_=eq("coins",[["path",{d:"M13.744 17.736a6 6 0 1 1-7.48-7.48",key:"bq4yh3"}],["path",{d:"M15 6h1v4",key:"11y1tn"}],["path",{d:"m6.134 14.768.866-.5 2 3.464",key:"17snzx"}],["circle",{cx:"16",cy:"8",r:"6",key:"14bfc9"}]]);e.s([],36295),e.i(36295);let nO=y.createContext(void 0);function nj(e){let t=y.useContext(nO);if(!1===e&&void 0===t)throw Error(rv(27));return t}let nT=((u={}).startingStyle="data-starting-style",u.endingStyle="data-ending-style",u),nR={[nT.startingStyle]:""},nN={[nT.endingStyle]:""},nA={transitionStatus:e=>"starting"===e?nR:"ending"===e?nN:null},nM=((d={}).open="data-open",d.closed="data-closed",d[d.startingStyle=nT.startingStyle]="startingStyle",d[d.endingStyle=nT.endingStyle]="endingStyle",d.anchorHidden="data-anchor-hidden",d.side="data-side",d.align="data-align",d),nP=((h={}).popupOpen="data-popup-open",h.pressed="data-pressed",h),nD={[nP.popupOpen]:""};nP.popupOpen,nP.pressed;let nI={[nM.open]:""},nB={[nM.closed]:""},nz={[nM.anchorHidden]:""},nL={open:e=>e?nD:null},nq={open:e=>e?nI:nB,anchorHidden:e=>e?nz:null},nW={...nq,...nA},nF=y.forwardRef(function(e,t){let{render:r,className:n,style:o,forceRender:s=!1,...i}=e,{store:a}=nj(),l=a.useState("open"),c=a.useState("nested"),u=a.useState("mounted");return rR("div",e,{state:{open:l,transitionStatus:a.useState("transitionStatus")},ref:[a.context.backdropRef,t],stateAttributesMapping:nW,props:[{role:"presentation",hidden:!u,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!c})});function nH(e,t,r,n){let o=!1,s=!1,i=n??rT;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){s=!0},get isCanceled(){return o},get isPropagationAllowed(){return s},trigger:r,...i}}e.s(["cancelOpen",0,"cancel-open","chipRemovePress",0,"chip-remove-press","clearPress",0,"clear-press","closePress",0,"close-press","closeWatcher",0,"close-watcher","decrementPress",0,"decrement-press","disabled",0,"disabled","drag",0,"drag","escapeKey",0,"escape-key","focusOut",0,"focus-out","imperativeAction",0,"imperative-action","incrementPress",0,"increment-press","inputBlur",0,"input-blur","inputChange",0,"input-change","inputClear",0,"input-clear","inputPaste",0,"input-paste","inputPress",0,"input-press","itemPress",0,"item-press","keyboard",0,"keyboard","linkPress",0,"link-press","listNavigation",0,"list-navigation","none",0,"none","outsidePress",0,"outside-press","pointer",0,"pointer","scrub",0,"scrub","siblingOpen",0,"sibling-open","swipe",0,"swipe","trackPress",0,"track-press","triggerFocus",0,"trigger-focus","triggerHover",0,"trigger-hover","triggerPress",0,"trigger-press","wheel",0,"wheel","windowResize",0,"window-resize"],64783);var nU=e.i(64783),nU=nU;let nY=y.forwardRef(function(e,t){let{render:r,className:n,disabled:o=!1,nativeButton:s=!0,style:i,...a}=e,{store:l}=nj(),c=l.useState("open"),{getButtonProps:u,buttonRef:d}=rw({disabled:o,native:s});return rR("button",e,{state:{disabled:o},ref:[t,d],props:[{onClick:function(e){c&&l.setOpen(!1,nH(nU.closePress,e.nativeEvent))}},a,u]})}),n$={...y},nV=0,nX=n$.useId;function nK(e,t){if(void 0!==nX){let r=nX();return e??(t?`${t}-${r}`:r)}return function(e,t="mui"){let[r,n]=y.useState(e),o=e||r;return y.useEffect(()=>{null==r&&(nV+=1,n(`${t}-${nV}`))},[r,t]),o}(e,t)}function nG(e){return nK(e,"base-ui")}let nQ=y.forwardRef(function(e,t){let{render:r,className:n,style:o,id:s,...i}=e,{store:a}=nj(),l=nG(s);return a.useSyncedValueWithCleanup("descriptionElementId",l),rR("p",e,{ref:t,props:[{id:l},i]})});function nJ(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function nZ(...e){return()=>{for(let t=0;t<e.length;t+=1){let r=e[t];r&&r()}}}function n0(e){let t=re(n1,e).current;return t.next=e,ri(t.effect),t}function n1(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}let n2=[];function n4(e){y.useEffect(e,n2)}class n3{static create(){return new n3}currentId=0;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,t()},e)}isStarted(){return 0!==this.currentId}clear=()=>{0!==this.currentId&&(clearTimeout(this.currentId),this.currentId=0)};disposeEffect=()=>this.clear}function n6(){let e=re(n3.create).current;return n4(e.disposeEffect),e}let n5="u">typeof navigator,n8=function(){if(!n5)return{platform:"",maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}(),n9=function(){if(!n5)return"";let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}(),n7=function(){if(!n5)return"";let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(" "):navigator.userAgent}(),oe="u">typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter:none"),ot="MacIntel"===n8.platform&&n8.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(n8.platform);n5&&/firefox/i.test(n7);let or=n5&&/apple/i.test(navigator.vendor);n5&&/Edg/i.test(n7);let on=n5&&/android/i.test(n9)||/android/i.test(n7);n5&&n9.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;let oo=n7.includes("jsdom/"),os=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let r=0;r<t.length;r+=1)t[r]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,this.callbacksCount-=1)}};class oi{static create(){return new oi}static request(e){return os.request(e)}static cancel(e){return os.cancel(e)}currentId=null;request(e){this.cancel(),this.currentId=os.request(()=>{this.currentId=null,e()})}cancel=()=>{null!==this.currentId&&(os.cancel(this.currentId),this.currentId=null)};disposeEffect=()=>this.cancel}function oa(){let e=re(oi.create).current;return n4(e.disposeEffect),e}function ol(e){return e?.ownerDocument||document}let oc={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ou={...oc,position:"fixed",top:0,left:0};({...oc,position:"absolute"});let od=y.forwardRef(function(e,t){let[r,n]=y.useState();return ri(()=>{or&&n("button")},[]),(0,b.jsx)("span",{...e,ref:t,style:ou,"aria-hidden":!r||void 0,tabIndex:0,role:r,"data-base-ui-focus-guard":""})});function oh(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function of(e,t){if(!e||!t)return!1;let r=t.getRootNode?.();if(e.contains(t))return!0;if(r&&t6(r)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function op(e){return"composedPath"in e?e.composedPath()[0]:e.target}let om="data-base-ui-focusable",og="active",ob="selected";function oy(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}function ov(e){return t3(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function ox(e){return!!e&&"combobox"===e.getAttribute("role")&&ov(e)}function ow(e){return e?e.hasAttribute(om)?e:e.querySelector(`[${om}]`)||e:null}function ok(e,t){let r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function oS(e){let t=e.type;return"click"===t||"mousedown"===t||"keydown"===t||"keyup"===t}function oE(e,t=e?t9(e):null){var r;return!!e&&!!e.isConnected&&!!t&&"hidden"!==(r=t).visibility&&"collapse"!==r.visibility&&("function"==typeof e.checkVisibility?e.checkVisibility():"none"!==t.display&&"contents"!==t.display)}function oC(e){for(let t of Array.from(e.children))if("summary"===t0(t))return t;return null}function o_(e){let t=e?t0(e):"";return null!=e&&e.matches('a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]')&&("summary"!==t||null!=e.parentElement&&"details"===t0(e.parentElement)&&oC(e.parentElement)===e)&&("details"!==t||null==oC(e))&&("input"!==t||"hidden"!==e.type)}function oO(e){if(!o_(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=function(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let r=e.getRootNode();return t6(r)?r.host:null}(t)){let r=t!==e,n="slot"===t0(t);if(t.hasAttribute("inert")||r&&"details"===t0(t)&&!t.open&&!function(e,t){let r=oC(t);return!!r&&(e===r||of(r,e))}(e,t)||t.hasAttribute("hidden")||!n&&!function(e,t){let r=t9(e);return t?"none"!==r.display:oE(e,r)}(t,r))return!1}return!0}function oj(e){let t=e.tabIndex;if(t<0){let t=t0(e);if("details"===t||"audio"===t||"video"===t||t3(e)&&e.isContentEditable)return 0}return t}function oT(e){return"input"!==t0(e)?null:"radio"===e.type&&""!==e.name?e:null}function oR(e){if(t3(e)&&"slot"===t0(e)){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return t3(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function oN(e){return oO(e)&&oj(e)>=0}function oA(e){let t=[];return!function e(t,r){oR(t).forEach(t=>{o_(t)&&r.push(t),e(t,r)})}(e,t),t.filter(oO)}function oM(e){let t=oA(e);return t.filter(e=>oj(e)>=0&&function(e,t){let r=oT(e);if(!r)return!0;let n=t.find(e=>{let t=oT(e);return t?.name===r.name&&t.form===r.form&&t.checked});return n?n===r:t.find(e=>{let t=oT(e);return t?.name===r.name&&t.form===r.form})===r}(e,t))}function oP(e,t){let r=oM(e),n=r.length;if(0===n)return;let o=oh(ol(e)),s=r.indexOf(o);return r[-1===s?1===t?0:n-1:s+t]}function oD(e){return oP(ol(e).body,1)||e}function oI(e){return oP(ol(e).body,-1)||e}function oB(e,t){let r=t||e.currentTarget,n=e.relatedTarget;return!n||!of(r,n)}function oz(e){let t=[];!function e(t,r,n){oR(t).forEach(t=>{t3(t)&&t.matches(r)&&n.push(t),e(t,r,n)})}(e,"[data-tabindex]",t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}function oL(e,t,r=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!r||t.context?.open?[t]:[],...oL(e,t.id,r)])}function oq(e,t){let r=[],n=e.find(e=>e.id===t)?.parentId;for(;n;){let t=e.find(e=>e.id===n);n=t?.parentId,t&&(r=r.concat(t))}return r}var nU=nU;function oW(e){return`data-base-ui-${e}`}let oF=0;function oH(e,t={}){let{preventScroll:r=!1,cancelPrevious:n=!0,sync:o=!1}=t;n&&cancelAnimationFrame(oF);let s=()=>e?.focus({preventScroll:r});if(o)return s(),rj;let i=requestAnimationFrame(s);return oF=i,()=>{oF===i&&(cancelAnimationFrame(i),oF=0)}}let oU={inert:new WeakMap,"aria-hidden":new WeakMap},oY="data-base-ui-inert",o$={inert:new WeakSet,"aria-hidden":new WeakSet},oV=new WeakMap,oX=0,oK=(e,t)=>t.map(t=>{if(e.contains(t))return t;let r=function e(t){return t?t6(t)?t.host:e(t.parentNode):null}(t);return e.contains(r)?r:null}).filter(e=>null!=e),oG=e=>{let t=new Set;return e.forEach(e=>{let r=e;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},oQ=(e,t,r)=>{let n=[],o=e=>{!e||r.has(e)||Array.from(e.children).forEach(e=>{"script"!==t0(e)&&(t.has(e)?o(e):n.push(e))})};return o(e),n};function oJ(e,t={}){let{ariaHidden:r=!1,inert:n=!1,mark:o=!0,markerIgnoreElements:s=[]}=t,i=ol(e[0]).body;return function(e,t,r,n,{mark:o=!0,markerIgnoreElements:s=[]}){let i=n?"inert":r?"aria-hidden":null,a=null,l=null,c=oK(t,e),u=new Set(o?oK(t,s):[]),d=o?oQ(t,oG(c),new Set(c)).filter(e=>!u.has(e)):[],h=[],f=[];if(i){let e=oU[i],r=o$[i];l=r,a=e;let n=oK(t,Array.from(t.querySelectorAll("[aria-live]"))),o=c.concat(n);oQ(t,oG(o),new Set(o)).forEach(t=>{let n=t.getAttribute(i),o=null!==n&&"false"!==n,s=(e.get(t)||0)+1;e.set(t,s),h.push(t),1===s&&o&&r.add(t),o||t.setAttribute(i,"inert"===i?"":"true")})}return o&&d.forEach(e=>{let t=(oV.get(e)||0)+1;oV.set(e,t),f.push(e),1===t&&e.setAttribute(oY,"")}),oX+=1,()=>{a&&h.forEach(e=>{let t=(a.get(e)||0)-1;a.set(e,t),t||(!l?.has(e)&&i&&e.removeAttribute(i),l?.delete(e))}),o&&f.forEach(e=>{let t=(oV.get(e)||0)-1;oV.set(e,t),t||e.removeAttribute(oY)}),(oX-=1)||(oU.inert=new WeakMap,oU["aria-hidden"]=new WeakMap,o$.inert=new WeakSet,o$["aria-hidden"]=new WeakSet,oV=new WeakMap)}}(e,i,r,n,{mark:o,markerIgnoreElements:s})}var oZ=e.i(17630),nU=nU;let o0="data-base-ui-click-trigger",o1={clipPath:"inset(50%)",position:"fixed",top:0,left:0},o2=y.createContext(null),o4=oW("portal"),o3=y.forwardRef(function(e,t){let{children:r,container:n,className:o,render:s,renderGuards:i,style:a,...l}=e,{portalNode:c,portalSubtree:u}=function(e={}){let{ref:t,container:r,componentProps:n=rT,elementProps:o}=e,s=nK(),i=y.useContext(o2),a=i?.portalNode,[l,c]=y.useState(null),[u,d]=y.useState(null),h=rn(e=>{null!==e&&d(e)}),f=y.useRef(null);ri(()=>{if(null===r){f.current&&(f.current=null,d(null),c(null));return}if(null==s)return;let e=(r&&(t2(r)?r:r.current))??a??document.body;if(null==e){f.current&&(f.current=null,d(null),c(null));return}f.current!==e&&(f.current=e,d(null),c(e))},[r,a,s]);let p=rR("div",n,{ref:[t,h],props:[{id:s,[o4]:""},o]});return{portalNode:u,portalSubtree:l&&p?oZ.createPortal(p,l):null}}({container:n,ref:t,componentProps:e,elementProps:l}),d=y.useRef(null),h=y.useRef(null),f=y.useRef(null),p=y.useRef(null),[m,g]=y.useState(null),v=y.useRef(!1),x=m?.modal,w=m?.open,k="boolean"==typeof i?i:!!m&&!m.modal&&m.open&&!!c;y.useEffect(()=>{if(c&&!x)return nZ(nJ(c,"focusin",e,!0),nJ(c,"focusout",e,!0));function e(e){c&&e.relatedTarget&&oB(e)&&("focusin"===e.type?v.current&&(oz(c),v.current=!1):(oM(c).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}),v.current=!0))}},[c,x]),y.useEffect(()=>{c&&!1===w&&(oz(c),v.current=!1)},[w,c]);let S=y.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:h,beforeInsideRef:f,afterInsideRef:p,portalNode:c,setFocusManagerState:g}),[c]);return(0,b.jsxs)(y.Fragment,{children:[u,(0,b.jsxs)(o2.Provider,{value:S,children:[k&&c&&(0,b.jsx)(od,{"data-type":"outside",ref:d,onFocus:e=>{if(oB(e,c))f.current?.focus();else{let e=oI(m?m.domReference:null);e?.focus()}}}),k&&c&&(0,b.jsx)("span",{"aria-owns":c.id,style:o1}),c&&oZ.createPortal(r,c),k&&c&&(0,b.jsx)(od,{"data-type":"outside",ref:h,onFocus:e=>{if(oB(e,c))p.current?.focus();else{let t=oD(m?m.domReference:null);t?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,nH(nU.focusOut,e.nativeEvent))}}})]})]})}),o6=y.createContext(null),o5=y.createContext(null),o8=()=>y.useContext(o6)?.id||null,o9=e=>{let t=y.useContext(o5);return e??t};function o7(e){return null==e?e:"current"in e?e.current:e}let se=[];function st(){se=se.filter(e=>e.deref()?.isConnected)}function sr(){return st(),se[se.length-1]?.deref()}function sn(e,t){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;let r=oA(e).filter(e=>{let t=e.getAttribute("data-tabindex")||"";return oN(e)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),n=e.getAttribute("tabindex");t.current.includes("floating")||0===r.length?"0"!==n&&e.setAttribute("tabindex","0"):("-1"!==n||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function so(e){let{context:t,children:r,disabled:n=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:a=!0,closeOnFocusOut:l=!0,openInteractionType:c="",nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:h,externalTree:f,getInsideElements:p}=e,m="rootStore"in t?t.rootStore:t,g=m.useState("open"),v=m.useState("domReferenceElement"),x=m.useState("floatingElement"),{events:w,dataRef:k}=m.context,S=rn(()=>k.current.floatingContext?.nodeId),E=!1===o,C=ox(v)&&E,_=y.useRef(["content"]),O=n0(o),j=n0(s),T=n0(c),R=o9(f),N=y.useContext(o2),A=y.useRef(!1),M=y.useRef(!1),P=y.useRef(!1),D=y.useRef(null),I=y.useRef(""),B=y.useRef(""),z=y.useRef(null),L=y.useRef(null),q=rS(z,h,N?.beforeInsideRef),W=rS(L,N?.afterInsideRef),F=n6(),H=n6(),U=oa(),Y=null!=N,$=ow(x),V=rn((e=$)=>e?oM(e):[]),X=rn(()=>p?.().filter(e=>null!=e)??[]);y.useEffect(()=>{if(!n&&a)return nJ(ol($),"keydown",function(e){"Tab"===e.key&&of($,oh(ol($)))&&0===V().length&&!C&&(e.preventDefault(),e.stopPropagation())})},[n,v,$,a,_,C,V]),y.useEffect(()=>{if(n||!g)return;let e=ol($);function t(){P.current=!1}return nZ(nJ(e,"pointerdown",function(e){let t=op(e),r=X();P.current=!(of(x,t)||of(v,t)||of(N?.portalNode,t)||r.some(e=>e===t||of(e,t))),B.current=e.pointerType||"keyboard",t?.closest(`[${o0}]`)&&(M.current=!0)},!0),nJ(e,"pointerup",t,!0),nJ(e,"pointercancel",t,!0),nJ(e,"keydown",function(){B.current="keyboard"},!0))},[n,x,v,$,g,N,X]),y.useEffect(()=>{if(n||!l)return;let e=ol($);function t(t){let r=t.relatedTarget,n=t.currentTarget,o=op(t);queueMicrotask(()=>{let s=S(),l=m.context.triggerElements,c=X(),h=r?.hasAttribute(oW("focus-guard"))&&[z.current,L.current,N?.beforeInsideRef.current,N?.afterInsideRef.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,o7(d),o7(u)].includes(r),f=!(of(v,r)||of(x,r)||of(r,x)||of(N?.portalNode,r)||c.some(e=>e===r||of(e,r))||null!=r&&l.hasElement(r)||l.hasMatchingElement(e=>of(e,r))||h||R&&(oL(R.nodesRef.current,s).find(e=>of(e.context?.elements.floating,r)||of(e.context?.elements.domReference,r))||oq(R.nodesRef.current,s).find(e=>[e.context?.elements.floating,ow(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(n===v&&$&&sn($,_),i&&n!==v&&!oE(o)&&oh(e)===e.body){if(t3($)&&($.focus(),"popup"===i))return void U.request(()=>{$.focus()});let e=V(),t=D.current,r=(t&&e.includes(t)?t:null)||e[e.length-1]||$;t3(r)&&r.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(C||!a)&&r&&f&&!M.current&&(C||r!==sr())&&(A.current=!0,m.setOpen(!1,nH(nU.focusOut,t)))})}let r=t3(v)?v:null;if(x||r)return nZ(r&&nJ(r,"focusout",t),r&&nJ(r,"pointerdown",function(){M.current=!0,H.start(0,()=>{M.current=!1})}),x&&nJ(x,"focusin",function(e){let t=op(e);oN(t)&&(D.current=t)}),x&&nJ(x,"focusout",t),x&&N&&nJ(x,"focusout",function(){P.current||(k.current.insideReactTree=!0,F.start(0,()=>{k.current.insideReactTree=!1}))},!0))},[n,v,x,$,a,R,N,m,l,i,V,C,S,_,k,F,H,U,u,d,X]),y.useEffect(()=>{if(n||!x||!g)return;let e=Array.from(N?.portalNode?.querySelectorAll(`[${oW("portal")}]`)||[]),t=R?oq(R.nodesRef.current,S()):[],r=t.find(e=>ox(e.context?.elements.domReference||null))?.context?.elements.domReference,o=oJ([x,...e,z.current,L.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,...X(),r,o7(d),o7(u),C?v:null].filter(e=>null!=e),{ariaHidden:a||C,mark:!1}),s=oJ([x,...e].filter(e=>null!=e));return()=>{s(),o()}},[g,n,v,x,a,_,N,C,R,S,u,d,X]),ri(()=>{if(!g||n||!t3($))return;let e=oh(ol($));queueMicrotask(()=>{let t,r=O.current,n="function"==typeof r?r(T.current||""):r;if(void 0===n||!1===n||of($,e))return;let o=null,s=()=>(null==o&&(o=V($)),o[0]||$);oH(t=(t=!0===n||null===n?s():o7(n))||s(),{preventScroll:t===$})})},[n,g,$,E,V,O,T]),ri(()=>{var e;if(n||!$)return;let t=ol($);function r(e){var t,r,n,o;let s;if(e.open||(t=e.nativeEvent,r=B.current,s=t1(op(t)),I.current=t instanceof s.KeyboardEvent?"keyboard":t instanceof s.FocusEvent?r||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof s.MouseEvent?r||(0===t.detail?"keyboard":"mouse"):""),e.reason===nU.triggerHover&&"mouseleave"===e.nativeEvent.type&&(A.current=!0),e.reason===nU.outsidePress)if(e.nested)A.current=!1;else if((""===(n=e.nativeEvent).pointerType&&n.isTrusted?0:on&&n.pointerType?"click"!==n.type||1!==n.buttons:0!==n.detail||n.pointerType)&&(o=e.nativeEvent,oo?1:(on||0!==o.width||0!==o.height)&&(!on||1!==o.width||1!==o.height||0!==o.pressure||0!==o.detail||"mouse"!==o.pointerType)&&(!(o.width<1)||!(o.height<1)||0!==o.pressure||0!==o.detail||"touch"!==o.pointerType))){let e=!1;ol($).createElement("div").focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}else A.current=!1}return e=oh(t),st(),e&&"body"!==t0(e)&&(se.push(new WeakRef(e)),se.length>20&&(se=se.slice(-20))),w.on("openchange",r),()=>{w.off("openchange",r);let e=oh(t),n=X(),o=of(x,e)||n.some(t=>t===e||of(t,e))||R&&oL(R.nodesRef.current,S(),!1).some(t=>of(t.context?.elements.floating,e)),s=j.current,i=function(){let e=j.current,t="function"==typeof e?e(I.current):e;if(void 0===t||!1===t)return null;if(null===t&&(t=!0),"boolean"==typeof t){let e=v||sr();return e&&e.isConnected?e:null}let r=v||sr();return o7(t)||r||null}();queueMicrotask(()=>{let r=i?oN(i)?i:oM(i)[0]||i:null;s&&!A.current&&t3(r)&&("boolean"!=typeof s||r===e||e===t.body||o)&&r.focus({preventScroll:!0}),A.current=!1})}},[n,x,$,j,k,w,R,v,S,X]),ri(()=>{if(!oe||g||!x)return;let e=oh(ol(x));t3(e)&&ov(e)&&of(x,e)&&e.blur()},[g,x]),ri(()=>{if(!n&&N)return N.setFocusManagerState({modal:a,closeOnFocusOut:l,open:g,onOpenChange:m.setOpen,domReference:v}),()=>{N.setFocusManagerState(null)}},[n,N,a,g,m,l,v]),ri(()=>{if(!n&&$)return sn($,_),()=>{queueMicrotask(st)}},[n,$,_]);let K=!n&&(!a||!C)&&(Y||a);return(0,b.jsxs)(y.Fragment,{children:[K&&(0,b.jsx)(od,{"data-type":"inside",ref:q,onFocus:e=>{if(a){let e=V();oH(e[e.length-1])}else if(N?.portalNode)if(A.current=!1,oB(e,N.portalNode)){let e=oD(v);e?.focus()}else o7(d??N.beforeOutsideRef)?.focus()}}),r,K&&(0,b.jsx)(od,{"data-type":"inside",ref:W,onFocus:e=>{if(a)oH(V()[0]);else if(N?.portalNode)if(l&&(A.current=!0),oB(e,N.portalNode)){let e=oI(v);e?.focus()}else o7(u??N.afterOutsideRef)?.focus()}})]})}let ss=((f={}).nestedDialogs="--nested-dialogs",f),si=((p={})[p.open=nM.open]="open",p[p.closed=nM.closed]="closed",p[p.startingStyle=nM.startingStyle]="startingStyle",p[p.endingStyle=nM.endingStyle]="endingStyle",p.nested="data-nested",p.nestedDialogOpen="data-nested-dialog-open",p),sa=y.createContext(void 0);function sl(){let e=y.useContext(sa);if(void 0===e)throw Error(rv(26));return e}function sc(e){let{enabled:t=!0,open:r,ref:n,onComplete:o}=e,s=rn(o),i=function(e,t=!1,r=!0){let n=oa();return rn((o,s=null)=>{n.cancel();let i=o7(e);if(null==i)return;let a=()=>{oZ.flushSync(o)};if("function"!=typeof i.getAnimations||globalThis.BASE_UI_ANIMATIONS_DISABLED)return void o();function l(){Promise.all(i.getAnimations().map(e=>e.finished)).then(()=>{s?.aborted||a()}).catch(()=>{if(r){s?.aborted||a();return}let e=i.getAnimations();!s?.aborted&&e.length>0&&e.some(e=>e.pending||"finished"!==e.playState)&&l()})}if(t){let e=nT.startingStyle;if(!i.hasAttribute(e))return void n.request(l);let t=new MutationObserver(()=>{i.hasAttribute(e)||(t.disconnect(),l())});return t.observe(i,{attributes:!0,attributeFilter:[e]}),void s?.addEventListener("abort",()=>t.disconnect(),{once:!0})}n.request(l)})}(n,r,!1);y.useEffect(()=>{if(!t)return;let e=new AbortController;return i(s,e.signal),()=>{e.abort()}},[t,r,s,i])}let su="ArrowUp",sd="ArrowDown",sh="ArrowLeft",sf="ArrowRight";[...new Set([...new Set([sh,sf]),...new Set([su,sd])])];let sp=new Set([su,sd,sh,sf,"Home","End"]),sm={...nq,...nA,nestedDialogOpen:e=>e?{[si.nestedDialogOpen]:""}:null},sg=y.forwardRef(function(e,t){let{className:r,finalFocus:n,initialFocus:o,render:s,style:i,...a}=e,{store:l}=nj(),c=l.useState("descriptionElementId"),u=l.useState("disablePointerDismissal"),d=l.useState("floatingRootContext"),h=l.useState("popupProps"),f=l.useState("modal"),p=l.useState("mounted"),m=l.useState("nested"),g=l.useState("nestedOpenDialogCount"),y=l.useState("open"),v=l.useState("openMethod"),x=l.useState("titleElementId"),w=l.useState("transitionStatus"),k=l.useState("role");sl(),sc({open:y,ref:l.context.popupRef,onComplete(){y&&l.context.onOpenChangeComplete?.(!0)}});let S=void 0===o?function(e){return"touch"!==e||l.context.popupRef.current}:o,E=rR("div",e,{state:{open:y,nested:m,transitionStatus:w,nestedDialogOpen:g>0},props:[h,{"aria-labelledby":x??void 0,"aria-describedby":c??void 0,role:k,tabIndex:-1,hidden:!p,onKeyDown(e){sp.has(e.key)&&e.stopPropagation()},style:{[ss.nestedDialogs]:g}},a],ref:[t,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:sm});return(0,b.jsx)(so,{context:d,openInteractionType:v,disabled:!p,closeOnFocusOut:!u,initialFocus:S,returnFocus:n,modal:!1!==f,restoreFocus:"popup",children:E})}),sb=y.forwardRef(function(e,t){let r,{cutout:n,...o}=e;if(n){let e=n.getBoundingClientRect();r=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,b.jsx)("div",{ref:t,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:r}})}),sy=y.forwardRef(function(e,t){var r;let{keepMounted:n=!1,...o}=e,{store:s}=nj(),i=s.useState("mounted"),a=s.useState("modal"),l=s.useState("open");return i||n?(0,b.jsx)(sa.Provider,{value:n,children:(0,b.jsxs)(o3,{ref:t,...o,children:[i&&!0===a&&(0,b.jsx)(sb,{ref:s.context.internalBackdropRef,inert:(r=!l,r_>=19?r:r?"true":void 0)}),e.children]})}):null}),sv={},sx={},sw="";class sk{lockCount=0;restore=null;timeoutLock=n3.create();timeoutUnlock=n3.create();acquire(e){return this.lockCount+=1,1===this.lockCount&&null===this.restore&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{this.lockCount-=1,0===this.lockCount&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{0===this.lockCount&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){let t,r,n,o,s;if(0===this.lockCount||null!==this.restore)return;let i=ol(e).documentElement,a=t1(i).getComputedStyle(i).overflowY;if("hidden"===a||"clip"===a){this.restore=rj;return}let l=ot||!function(e){if("u"<typeof document)return!1;let t=ol(e);return t1(t).innerWidth-t.documentElement.clientWidth>0}(e);this.restore=l?(r=(t=ol(e)).documentElement,n=t.body,s={overflowY:(o=t5(r)?r:n).style.overflowY,overflowX:o.style.overflowX},Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}):function(e){let t=ol(e),r=t.documentElement,n=t.body,o=t1(r),s=0,i=0,a=!1,l=oi.create();if(oe&&(o.visualViewport?.scale??1)!==1)return()=>{};function c(){let t=o.getComputedStyle(r),l=o.getComputedStyle(n),c=(t.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=r.scrollTop,i=r.scrollLeft,sv={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY,overflowX:r.style.overflowX},sw=r.style.scrollBehavior,sx={position:n.style.position,height:n.style.height,width:n.style.width,boxSizing:n.style.boxSizing,overflowY:n.style.overflowY,overflowX:n.style.overflowX,scrollBehavior:n.style.scrollBehavior};let u=r.scrollHeight>r.clientHeight,d=r.scrollWidth>r.clientWidth,h="scroll"===t.overflowY||"scroll"===l.overflowY,f="scroll"===t.overflowX||"scroll"===l.overflowX,p=Math.max(0,o.innerWidth-n.clientWidth),m=Math.max(0,o.innerHeight-n.clientHeight),g=parseFloat(l.marginTop)+parseFloat(l.marginBottom),b=parseFloat(l.marginLeft)+parseFloat(l.marginRight),y=t5(r)?r:n;if(a=function(e){if(!("u">typeof CSS&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||"u"<typeof document)return!1;let t=ol(e),r=t.documentElement,n=t.body,o=t5(r)?r:n,s=o.style.overflowY,i=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";let a=o.offsetWidth;o.style.overflowY="hidden";let l=o.offsetWidth;return o.style.overflowY=s,r.style.scrollbarGutter=i,a===l}(e)){r.style.scrollbarGutter=c,y.style.overflowY="hidden",y.style.overflowX="hidden";return}Object.assign(r.style,{scrollbarGutter:c,overflowY:"hidden",overflowX:"hidden"}),(u||h)&&(r.style.overflowY="scroll"),(d||f)&&(r.style.overflowX="scroll"),Object.assign(n.style,{position:"relative",height:g||m?`calc(100dvh - ${g+m}px)`:"100dvh",width:b||p?`calc(100vw - ${b+p}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),n.scrollTop=s,n.scrollLeft=i,r.setAttribute("data-base-ui-scroll-locked",""),r.style.scrollBehavior="unset"}function u(){Object.assign(r.style,sv),Object.assign(n.style,sx),a||(r.scrollTop=s,r.scrollLeft=i,r.removeAttribute("data-base-ui-scroll-locked"),r.style.scrollBehavior=sw)}c();let d=nJ(o,"resize",function(){u(),l.request(c)});return()=>{l.cancel(),u(),"function"==typeof o.removeEventListener&&d()}}(e)}}let sS=new sk;var nU=nU;let sE={intentional:"onClick",sloppy:"onPointerDown"};function sC(){return!1}function s_(e=[]){let t=e.map(e=>e?.reference),r=e.map(e=>e?.floating),n=e.map(e=>e?.item),o=e.map(e=>e?.trigger),s=y.useCallback(t=>sO(t,e,"reference"),t),i=y.useCallback(t=>sO(t,e,"floating"),r),a=y.useCallback(t=>sO(t,e,"item"),n),l=y.useCallback(t=>sO(t,e,"trigger"),o);return y.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:l}),[s,i,a,l])}function sO(e,t,r){let n=new Map,o="item"===r,s={};for(let t in"floating"===r&&(s.tabIndex=-1,s[om]=""),e)o&&e&&(t===og||t===ob)||(s[t]=e[t]);for(let i=0;i<t.length;i+=1){let a,l=t[i]?.[r];(a="function"==typeof l?e?l(e):null:l)&&sj(s,a,o,n)}return sj(s,e,o,n),s}function sj(e,t,r,n){for(let o in t){let s=t[o];r&&(o===og||o===ob)||(o.startsWith("on")?(n.has(o)||n.set(o,[]),"function"==typeof s&&(n.get(o)?.push(s),e[o]=(...e)=>n.get(o)?.map(t=>t(...e)).find(e=>void 0!==e))):e[o]=s)}}let sT=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]),sR=(e,t,r,n,o,s,...i)=>{let a;if(i.length>0)throw Error(rv(1));if(e&&t&&r&&n&&o&&s)a=(i,a,l,c)=>s(e(i,a,l,c),t(i,a,l,c),r(i,a,l,c),n(i,a,l,c),o(i,a,l,c),a,l,c);else if(e&&t&&r&&n&&o)a=(s,i,a,l)=>o(e(s,i,a,l),t(s,i,a,l),r(s,i,a,l),n(s,i,a,l),i,a,l);else if(e&&t&&r&&n)a=(o,s,i,a)=>n(e(o,s,i,a),t(o,s,i,a),r(o,s,i,a),s,i,a);else if(e&&t&&r)a=(n,o,s,i)=>r(e(n,o,s,i),t(n,o,s,i),o,s,i);else if(e&&t)a=(r,n,o,s)=>t(e(r,n,o,s),n,o,s);else if(e)a=e;else throw Error("Missing arguments");return a};var sN=e.i(84841),sA=e.i(80681);let sM=r_>=19?function(e,t,r,n,o){let s;if(!a){let s;return s=y.useCallback(()=>t(e.getSnapshot(),r,n,o),[e,t,r,n,o]),(0,sN.useSyncExternalStore)(e.subscribe,s,s)}let i=a.syncIndex;return a.syncIndex+=1,a.didInitialize?(s=a.syncHooks[i]).store===e&&s.selector===t&&Object.is(s.a1,r)&&Object.is(s.a2,n)&&Object.is(s.a3,o)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=r,s.a2=n,s.a3=o,s.didChange=!0):(s={store:e,selector:t,a1:r,a2:n,a3:o,value:t(e.getSnapshot(),r,n,o),didChange:!1},a.syncHooks.push(s)),s.value}:function(e,t,r,n,o){return(0,sA.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,r,n,o))};[].push({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let r=0;r<e.syncHooks.length;r+=1){let n=e.syncHooks[r],o=n.selector(n.store.state,n.a1,n.a2,n.a3);(n.didChange||!Object.is(n.value,o))&&(t=!0,n.value=o,n.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let r=new Set;for(let t of e.syncHooks)r.add(t.store);let n=[];for(let e of r)n.push(e.subscribe(t));return()=>{for(let e of n)e()}}),(0,sN.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});class sP{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let r of this.listeners){if(t!==this.updateTick)return;r(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t]))return void this.setState({...this.state,...e})}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,r,n){return sM(this,e,t,r,n)}}class sD extends sP{constructor(e,t={},r){super(e),this.context=t,this.selectors=r}useSyncedValue(e,t){y.useDebugValue(e),ri(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let r=this;ri(()=>(r.state[e]!==t&&r.set(e,t),()=>{r.set(e,void 0)}),[r,e,t])}useSyncedValues(e){let t=this;ri(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){y.useDebugValue(e);let r=void 0!==t;ri(()=>{r&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,r])}select(e,t,r,n){return(0,this.selectors[e])(this.state,t,r,n)}useState(e,t,r,n){return y.useDebugValue(e),sM(this,this.selectors[e],t,r,n)}useContextCallback(e,t){y.useDebugValue(e);let r=rn(t??rj);this.context[e]=r}useStateSetter(e){let t=y.useRef(void 0);return void 0===t.current&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let r,n=(r="function"==typeof e?e:this.selectors[e])(this.state);return t(n,n,this),this.subscribe(e=>{let o=r(e);if(!Object.is(n,o)){let e=n;n=o,t(o,e,this)}})}}let sI={open:sR(e=>e.open),transitionStatus:sR(e=>e.transitionStatus),domReferenceElement:sR(e=>e.domReferenceElement),referenceElement:sR(e=>e.positionReference??e.referenceElement),floatingElement:sR(e=>e.floatingElement),floatingId:sR(e=>e.floatingId)};class sB extends sD{constructor(e){const{syncOnly:t,nested:r,onOpenChange:n,triggerElements:o,...s}=e;super({...s,positionReference:s.referenceElement,domReferenceElement:s.referenceElement},{onOpenChange:n,dataRef:{current:{}},events:function(){let e=new Map;return{emit(t,r){e.get(t)?.forEach(e=>e(r))},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r)},off(t,r){e.get(t)?.delete(r)}}}(),nested:r,triggerElements:o},sI),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||null!=t&&oS(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let r={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",r)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}}var nU=nU;class sz{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let r=this.idMap.get(e);r!==t&&(void 0!==r&&this.elementsSet.delete(r),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}let sL=sR(e=>e.triggerIdProp??e.activeTriggerId),sq={...{open:sR(e=>e.openProp??e.open),mounted:sR(e=>e.mounted),transitionStatus:sR(e=>e.transitionStatus),floatingRootContext:sR(e=>e.floatingRootContext),preventUnmountingOnClose:sR(e=>e.preventUnmountingOnClose),payload:sR(e=>e.payload),activeTriggerId:sL,activeTriggerElement:sR(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:sR((e,t)=>void 0!==t&&sL(e)===t),isOpenedByTrigger:sR((e,t)=>void 0!==t&&sL(e)===t&&e.open),isMountedByTrigger:sR((e,t)=>void 0!==t&&sL(e)===t&&e.mounted),triggerProps:sR((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:sR(e=>e.popupProps),popupElement:sR(e=>e.popupElement),positionerElement:sR(e=>e.positionerElement)},modal:sR(e=>e.modal),nested:sR(e=>e.nested),nestedOpenDialogCount:sR(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:sR(e=>e.nestedOpenDrawerCount),disablePointerDismissal:sR(e=>e.disablePointerDismissal),openMethod:sR(e=>e.openMethod),descriptionElementId:sR(e=>e.descriptionElementId),titleElementId:sR(e=>e.titleElementId),viewportElement:sR(e=>e.viewportElement),role:sR(e=>e.role)};class sW extends sD{constructor(e){super(function(e={}){return{...{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new sB({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new sz,floatingId:"",syncOnly:!1,nested:!1,onOpenChange:void 0}),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:rT,inactiveTriggerProps:rT,popupProps:rT},modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}(e),{popupRef:y.createRef(),backdropRef:y.createRef(),internalBackdropRef:y.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new sz,onOpenChange:void 0,onOpenChangeComplete:void 0},sq)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},e||null!=t.trigger||null==this.state.activeTriggerId||(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let r={open:e},n=t.trigger?.id??null;(n||e)&&(r.activeTriggerId=n,r.activeTriggerElement=t.trigger??null),this.update(r)};static useStore(e,t){let r=re(()=>new sW(t)).current;return e??r}}let sF=y.createContext(!1),sH=((m={})[m.open=nM.open]="open",m[m.closed=nM.closed]="closed",m[m.startingStyle=nM.startingStyle]="startingStyle",m[m.endingStyle=nM.endingStyle]="endingStyle",m.nested="data-nested",m.nestedDialogOpen="data-nested-dialog-open",m),sU={...nq,...nA,nested:e=>e?{[sH.nested]:""}:null,nestedDialogOpen:e=>e?{[sH.nestedDialogOpen]:""}:null},sY=y.forwardRef(function(e,t){let{className:r,render:n,children:o,style:s,...i}=e,a=sl(),{store:l}=nj(),c=l.useState("open"),u=l.useState("nested"),d=l.useState("transitionStatus"),h=l.useState("nestedOpenDialogCount"),f=l.useState("mounted");return rR("div",e,{enabled:a||f,state:{open:c,nested:u,transitionStatus:d,nestedDialogOpen:h>0},ref:[t,l.useStateSetter("viewportElement")],stateAttributesMapping:sU,props:[{role:"presentation",hidden:!f,style:{pointerEvents:c?void 0:"none"},children:o},i]})}),s$=y.forwardRef(function(e,t){let{render:r,className:n,style:o,id:s,...i}=e,{store:a}=nj(),l=nG(s);return a.useSyncedValueWithCleanup("titleElementId",l),rR("h2",e,{ref:t,props:[{id:l},i]})});var nU=nU;let sV=y.forwardRef(function(e,t){var r;let n,o,s,i,a,{render:l,className:c,disabled:u=!1,nativeButton:d=!0,id:h,payload:f,handle:p,style:m,...g}=e,b=nj(!0),v=p?.store??b?.store;if(!v)throw Error(rv(79));let x=nG(h),w=v.useState("floatingRootContext"),k=v.useState("isOpenedByTrigger",x),S=y.useRef(null),{registerTrigger:E,isMountedByThisTrigger:C}=(r={payload:f},n=v.useState("isMountedByTrigger",x),o=y.useRef(null),s=y.useRef(null),i=y.useCallback(e=>{if(void 0!==x){if(null!==o.current){let e=o.current,t=s.current,r=v.context.triggerElements.getById(e);t&&r===t&&v.context.triggerElements.delete(e),o.current=null,s.current=null}null!==e&&(o.current=x,s.current=e,v.context.triggerElements.add(x,e))}},[v,x]),a=rn(e=>{if(i(e),!e||!v.select("open"))return;let t=v.select("activeTriggerId");t===x?v.update({activeTriggerElement:e,...r}):null==t&&v.update({activeTriggerId:x,activeTriggerElement:e,...r})}),ri(()=>{n&&v.update({activeTriggerElement:S.current,...r})},[n,v,S,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:n}),{getButtonProps:_,buttonRef:O}=rw({disabled:u,native:d}),j=s_([function(e,t={}){let r="rootStore"in e?e.rootStore:e,n=r.context.dataRef,{enabled:o=!0,event:s="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:c=0,reason:u=nU.triggerPress}=t,d=y.useRef(void 0),h=oa(),f=n6(),p=y.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){let t=d.current,o=e.nativeEvent,p=r.select("open");if(0!==e.button||"click"===s||ok(t,!0)&&a)return;let m=n.current.openEvent,g=m?.type,b=r.select("domReferenceElement")!==e.currentTarget,y=p&&b||!(p&&i&&(!m||!l||"click"===g||"mousedown"===g)),v=op(o);if(ov(v)){let e=nH(u,o,v);y&&"touch"===t&&c>0?f.start(c,()=>{r.setOpen(!0,e)}):r.setOpen(y,e);return}let x=e.currentTarget;h.request(()=>{let e=nH(u,o,x);y&&"touch"===t&&c>0?f.start(c,()=>{r.setOpen(!0,e)}):r.setOpen(y,e)})},onClick(e){if("mousedown-only"===s)return;let t=d.current;if("mousedown"===s&&t){d.current=void 0;return}if(ok(t,!0)&&a)return;let o=r.select("open"),h=n.current.openEvent,p=r.select("domReferenceElement")!==e.currentTarget,m=o&&p||!(o&&i&&(!h||!l||oS(h))),g=nH(u,e.nativeEvent,e.currentTarget);m&&"touch"===t&&c>0?f.start(c,()=>{r.setOpen(!0,g)}):r.setOpen(m,g)},onKeyDown(){d.current=void 0}}),[n,s,a,r,l,i,h,f,c,u]);return y.useMemo(()=>o?{reference:p}:rT,[o,p])}(w,{enabled:null!=w})]),T=v.useState("triggerProps",C);return rR("button",e,{state:{disabled:u,open:k},ref:[O,t,E,S],props:[j.getReferenceProps(),T,{[o0]:"",id:x},g,_],stateAttributesMapping:nL})});var nU=nU;class sX{constructor(e){this.store=e??new sW}open(e){let t=e?this.store.context.triggerElements.getById(e):void 0;this.store.setOpen(!0,nH(nU.imperativeAction,void 0,t))}openWithPayload(e){this.store.set("payload",e),this.store.setOpen(!0,nH(nU.imperativeAction,void 0,void 0))}close(){this.store.setOpen(!1,nH(nU.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}e.s(["Backdrop",0,nF,"Close",0,nY,"Description",0,nQ,"Handle",0,sX,"Popup",0,sg,"Portal",0,sy,"Root",0,function(e){let t,{children:r,open:o,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:u,handle:d,triggerId:h,defaultTriggerId:f=null}=e,p=nj(!0),m=y.useContext(sF),g=!!p,v=sW.useStore(d?.store,{open:s,openProp:o,activeTriggerId:f,triggerIdProp:h,modal:c,disablePointerDismissal:l,nested:g});(t=y.useRef(!0)).current&&(t.current=!1,(()=>{void 0===o&&!1===v.state.open&&!0===s&&v.update({open:!0,activeTriggerId:f})})()),v.useControlledProp("openProp",o),v.useControlledProp("triggerIdProp",h),v.useSyncedValues({disablePointerDismissal:l,nested:g,modal:c}),v.useContextCallback("onOpenChange",i),v.useContextCallback("onOpenChangeComplete",a);let x=v.useState("payload");!function(e){let t,{store:r,parentContext:o,actionsRef:s,isDrawer:i}=e,a=r.useState("open"),l=r.useState("disablePointerDismissal"),c=r.useState("modal"),u=r.useState("popupElement"),{openMethod:d,triggerProps:h}=function(e){let t,r,n,o,[s,i]=y.useState(null),a=rn((t,r)=>{e||i(r||(ot?"touch":""))});t=y.useRef(e),ri(()=>{t.current!==e&&r(t.current)},[e,r=rn(t=>{t&&!e&&i(null)})]),ri(()=>{t.current=e},[e]);let{onClick:l,onPointerDown:c}=(n=y.useRef(""),o=y.useCallback(e=>{e.defaultPrevented||(n.current=e.pointerType,a(e,e.pointerType))},[a]),{onClick:y.useCallback(e=>{0===e.detail?a(e,"keyboard"):(a(e,"pointerType"in e?e.pointerType:n.current),n.current="")},[a]),onPointerDown:o});return y.useMemo(()=>({openMethod:s,triggerProps:{onClick:l,onPointerDown:c}}),[s,l,c])}(a);ri(()=>{if(t&&!r.select("activeTriggerId")&&1===r.context.triggerElements.size){let e=r.context.triggerElements.entries().next();if(!e.done){let[t,n]=e.value;r.update({activeTriggerId:t,activeTriggerElement:n})}}},[t=r.useState("open"),r]);let{forceUnmount:f}=function(e,t){let{mounted:r,setMounted:n,transitionStatus:o}=function(e,t=!1,r=!1){let[n,o]=y.useState(e&&t?"idle":void 0),[s,i]=y.useState(e);return e&&!s&&(i(!0),o("starting")),e||!s||"ending"===n||r||o("ending"),e||s||"ending"!==n||o(void 0),ri(()=>{if(!e&&s&&"ending"!==n&&r){let e=oi.request(()=>{o("ending")});return()=>{oi.cancel(e)}}},[e,s,n,r]),ri(()=>{if(!e||t)return;let r=oi.request(()=>{o(void 0)});return()=>{oi.cancel(r)}},[t,e]),ri(()=>{if(!e||!t)return;e&&s&&"idle"!==n&&o("starting");let r=oi.request(()=>{o("idle")});return()=>{oi.cancel(r)}},[t,e,s,n]),{mounted:s,setMounted:i,transitionStatus:n}}(e);t.useSyncedValues({mounted:r,transitionStatus:o});let s=rn(()=>{n(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),t.context.onOpenChangeComplete?.(!1)});return sc({enabled:!t.useState("preventUnmountingOnClose"),open:e,ref:t.context.popupRef,onComplete(){e||s()}}),{forceUnmount:s,transitionStatus:o}}(a,r),p=y.useCallback(()=>{r.setOpen(!1,nH(nU.imperativeAction))},[r]);y.useImperativeHandle(s,()=>({unmount:f,close:p}),[f,p]);let m=function(e){let{popupStore:t,treatPopupAsFloatingElement:r=!1,onOpenChange:n}=e,o=nK(),s=null!=o8(),i=t.useState("open"),a=t.useState("activeTriggerElement"),l=t.useState(r?"popupElement":"positionerElement"),c=t.context.triggerElements,u=re(()=>new sB({open:i,transitionStatus:void 0,referenceElement:a,floatingElement:l,triggerElements:c,onOpenChange:n,floatingId:o,syncOnly:!0,nested:s})).current;return ri(()=>{let e={open:i,floatingId:o,referenceElement:a,floatingElement:l};t4(a)&&(e.domReferenceElement=a),u.state.positionReference===u.state.referenceElement&&(e.positionReference=a),u.update(e)},[i,o,a,l,u]),u.context.onOpenChange=n,u.context.nested=s,u}({popupStore:r,onOpenChange:r.setOpen,treatPopupAsFloatingElement:!0}),[g,b]=y.useState(0),[v,x]=y.useState(0),w=0===g,k=function(e,t={}){let r="rootStore"in e?e.rootStore:e,n=r.useState("open"),o=r.useState("floatingId"),s=r.useState("domReferenceElement"),i=r.useState("floatingElement"),{role:a="dialog"}=t,l=nK(),c=s?.id||l,u=y.useMemo(()=>ow(i)?.id||o,[i,o]),d=sT.get(a)??a,h=null!=o8(),f=y.useMemo(()=>"tooltip"===d||"label"===a?rT:{"aria-haspopup":"alertdialog"===d?"dialog":d,"aria-expanded":"false",..."listbox"===d&&{role:"combobox"},..."menu"===d&&h&&{role:"menuitem"},..."select"===a&&{"aria-autocomplete":"none"},..."combobox"===a&&{"aria-autocomplete":"list"}},[d,h,a]),p=y.useMemo(()=>"tooltip"===d||"label"===a?{[`aria-${"label"===a?"labelledby":"describedby"}`]:n?u:void 0}:{...f,"aria-expanded":n?"true":"false","aria-controls":n?u:void 0,..."menu"===d&&{id:c}},[d,u,n,c,a,f]),m=y.useMemo(()=>{let e={id:u,...d&&{role:d}};return"tooltip"===d||"label"===a?e:{...e,..."menu"===d&&{"aria-labelledby":c}}},[d,u,c,a]),g=y.useCallback(({active:e,selected:t})=>{let r={role:"option",...e&&{id:`${u}-fui-option`}};switch(a){case"select":case"combobox":return{...r,"aria-selected":t}}return{}},[u,a]);return y.useMemo(()=>({reference:p,floating:m,item:g,trigger:f}),[p,m,f,g])}(m),S=function(e,t={}){let r="rootStore"in e?e.rootStore:e,o=r.useState("open"),s=r.useState("floatingElement"),{dataRef:i}=r.context,{enabled:a=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="sloppy",referencePress:d=sC,referencePressEvent:h="sloppy",bubbles:f,externalTree:p}=t,m=o9(p),g=rn("function"==typeof c?c:()=>!1),b="function"==typeof c?g:c,v=!1!==b,x=rn(()=>u),w=y.useRef(!1),k=y.useRef(!1),S=y.useRef(!1),{escapeKey:E,outsidePress:C}={escapeKey:"boolean"==typeof f?f:f?.escapeKey??!1,outsidePress:"boolean"==typeof f?f:f?.outsidePress??!0},_=y.useRef(null),O=n6(),j=n6(),T=rn(()=>{j.clear(),i.current.insideReactTree=!1}),R=y.useRef(!1),N=y.useRef(""),A=rn(d),M=rn(e=>{if(!o||!a||!l||"Escape"!==e.key||R.current)return;let t=i.current.floatingContext?.nodeId,n=m?oL(m.nodesRef.current,t):[];if(!E&&n.length>0){let e=!0;if(n.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let s="nativeEvent"in e?e.nativeEvent:e,c=nH(nU.escapeKey,s);r.setOpen(!1,c),E||c.isPropagationAllowed||e.stopPropagation()}),P=rn(()=>{i.current.insideReactTree=!0,j.start(0,T)});y.useEffect(()=>{if(!o||!a)return;i.current.__escapeKeyBubbles=E,i.current.__outsidePressBubbles=C;let e=new n3,t=new n3;function c(){S.current=!0,t.start(0,()=>{S.current=!1})}function u(){w.current=!1,k.current=!1}function d(){let e=N.current,t=x(),r="function"==typeof t?t():t;return"string"==typeof r?r:r["pen"!==e&&e?e:"mouse"]}function h(e){let t=i.current.floatingContext?.nodeId,n=m&&oL(m.nodesRef.current,t).some(t=>oy(e,t.context?.elements.floating));return oy(e,r.select("floatingElement"))||oy(e,r.select("domReferenceElement"))||n}function f(e){let n;if("intentional"===(n=d())&&"click"!==e.type||"sloppy"===n&&"click"===e.type||i.current.insideReactTree)return void T();let o=op(e),s=`[${oW("inert")}]`,a=t4(o)?o.getRootNode():null,l=Array.from((t6(a)?a:ol(r.select("floatingElement"))).querySelectorAll(s)),c=r.context.triggerElements;if(o&&(c.hasElement(o)||c.hasMatchingElement(e=>of(e,o))))return;let u=t4(o)?o:null;for(;u&&!t8(u);){let e=function(e){var t;if("html"===t0(e))return e;let r=e.assignedSlot||e.parentNode||t6(e)&&e.host||(null==(t=(t2(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement);return t6(r)?r.host:r}(u);if(t8(e)||!t4(e))break;u=e}if(l.length&&t4(o)&&!o.matches("html,body")&&!of(o,r.select("floatingElement"))&&l.every(e=>!of(u,e)))return;if(t3(o)&&!("touches"in e)){let t=t8(o),r=t9(o),n=/auto|scroll/,s=t||n.test(r.overflowX),i=t||n.test(r.overflowY),a=s&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,l=i&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,c="rtl"===r.direction,u=l&&(c?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=a&&e.offsetY>o.clientHeight;if(u||d)return}if(h(e))return;if("intentional"===d()&&S.current){t.clear(),S.current=!1;return}if("function"==typeof b&&!b(e))return;let f=i.current.floatingContext?.nodeId,p=m?oL(m.nodesRef.current,f):[];if(p.length>0){let e=!0;if(p.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}r.setOpen(!1,nH(nU.outsidePress,e)),T()}function p(e){if("sloppy"!==d()||!r.select("open")||!a||oy(e,r.select("floatingElement"))||oy(e,r.select("domReferenceElement")))return;let t=e.touches[0];t&&(_.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{_.current&&(_.current.dismissOnTouchEnd=!1,_.current.dismissOnMouseDown=!1)}))}function g(e,t){let r=op(e);if(!r)return;let n=nJ(r,e.type,()=>{t(e),n()})}function y(e){O.clear(),"pointerdown"===e.type&&(N.current=e.pointerType),("mousedown"!==e.type||!_.current||_.current.dismissOnMouseDown)&&g(e,e=>{if("pointerdown"===e.type)"sloppy"!==d()||"touch"===e.pointerType||!r.select("open")||!a||oy(e,r.select("floatingElement"))||oy(e,r.select("domReferenceElement"))||f(e);else f(e)})}function j(e){if(!w.current)return;let r=k.current;if(u(),"intentional"===d()){if("pointercancel"===e.type){r&&c();return}h(e)||(r?c():("function"!=typeof b||b(e))&&(t.clear(),S.current=!0,T()))}}function A(e){if("sloppy"!==d()||!_.current||oy(e,r.select("floatingElement"))||oy(e,r.select("domReferenceElement")))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-_.current.startX),o=Math.abs(t.clientY-_.current.startY),s=Math.sqrt(n*n+o*o);s>5&&(_.current.dismissOnTouchEnd=!0),s>10&&(f(e),O.clear(),_.current=null)}function P(e){"sloppy"!==d()||!_.current||oy(e,r.select("floatingElement"))||oy(e,r.select("domReferenceElement"))||(_.current.dismissOnTouchEnd&&f(e),O.clear(),_.current=null)}let D=ol(s),I=nZ(l&&nZ(nJ(D,"keydown",M),nJ(D,"compositionstart",function(){e.clear(),R.current=!0}),nJ(D,"compositionend",function(){e.start(5*(null==n&&(n="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),!!n),()=>{R.current=!1})})),v&&nZ(nJ(D,"click",y,!0),nJ(D,"pointerdown",y,!0),nJ(D,"pointerup",j,!0),nJ(D,"pointercancel",j,!0),nJ(D,"mousedown",y,!0),nJ(D,"mouseup",j,!0),nJ(D,"touchstart",function(e){N.current="touch",g(e,p)},!0),nJ(D,"touchmove",function(e){g(e,A)},!0),nJ(D,"touchend",function(e){g(e,P)},!0)));return()=>{I(),e.clear(),t.clear(),u(),S.current=!1}},[i,s,l,v,b,o,a,E,C,M,T,x,m,r,O]),y.useEffect(T,[b,T]);let D=y.useMemo(()=>({onKeyDown:M,[sE[h]]:e=>{A()&&r.setOpen(!1,nH(nU.triggerPress,e.nativeEvent))},..."intentional"!==h&&{onClick(e){A()&&r.setOpen(!1,nH(nU.triggerPress,e.nativeEvent))}}}),[M,r,h,A]),I=rn(e=>{if(!o||!a||0!==e.button)return;let t=op(e.nativeEvent);of(r.select("floatingElement"),t)&&(w.current||(w.current=!0,k.current=!1))}),B=rn(e=>{!o||!a||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&w.current&&(k.current=!0)}),z=y.useMemo(()=>({onKeyDown:M,onPointerDown:B,onMouseDown:B,onClickCapture:P,onMouseDownCapture(e){P(),I(e)},onPointerDownCapture(e){P(),I(e)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[M,P,I,B]);return y.useMemo(()=>a?{reference:D,floating:z,trigger:D}:{},[a,D,z])}(m,{outsidePressEvent:()=>r.context.internalBackdropRef.current||r.context.backdropRef.current?"intentional":{mouse:"trap-focus"===c?"sloppy":"intentional",touch:"sloppy"},outsidePress(e){if(!r.context.outsidePressEnabledRef.current||"button"in e&&0!==e.button||"touches"in e&&1!==e.touches.length)return!1;let t=op(e);return!!w&&!l&&(!c||!r.context.internalBackdropRef.current&&!r.context.backdropRef.current||r.context.internalBackdropRef.current===t||r.context.backdropRef.current===t||of(t,u)&&!t?.hasAttribute("data-base-ui-portal"))},escapeKey:w});!function(e=!0,t=null){ri(()=>{if(e)return sS.acquire(t)},[e,t])}(a&&!0===c,u);let{getReferenceProps:E,getFloatingProps:C,getTriggerProps:_}=s_([k,S]);r.useContextCallback("onNestedDialogOpen",(e,t)=>{b(e),x(t)}),r.useContextCallback("onNestedDialogClose",()=>{b(0),x(0)}),y.useEffect(()=>(o?.onNestedDialogOpen&&a&&o.onNestedDialogOpen(g+1,v+ +!!i),o?.onNestedDialogClose&&!a&&o.onNestedDialogClose(),()=>{o?.onNestedDialogClose&&a&&o.onNestedDialogClose()}),[i,a,g,v,o]);let O=y.useMemo(()=>E(h),[E,h]),j=y.useMemo(()=>_(h),[_,h]),T=y.useMemo(()=>C(),[C]);r.useSyncedValues({openMethod:d,activeTriggerProps:O,inactiveTriggerProps:j,popupProps:T,floatingRootContext:m,nestedOpenDialogCount:g,nestedOpenDrawerCount:v})}({store:v,actionsRef:u,parentContext:p?.store.context,isDrawer:m,onOpenChange:i,triggerIdProp:h});let w=y.useMemo(()=>({store:v}),[v]);return(0,b.jsx)(sF.Provider,{value:!1,children:(0,b.jsx)(nO.Provider,{value:w,children:"function"==typeof r?r({payload:x}):r})})},"Title",0,s$,"Trigger",0,sV,"Viewport",0,sY,"createHandle",0,function(){return new sX}],24216);var sK=e.i(24216),sK=sK;let sG=eq("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function sQ({...e}){return(0,b.jsx)(sK.Root,{"data-slot":"sheet",...e})}function sJ({...e}){return(0,b.jsx)(sK.Portal,{"data-slot":"sheet-portal",...e})}function sZ({className:e,...t}){return(0,b.jsx)(sK.Backdrop,{"data-slot":"sheet-overlay",className:tV("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function s0({className:e,children:t,side:r="right",showCloseButton:n=!0,...o}){return(0,b.jsxs)(sJ,{children:[(0,b.jsx)(sZ,{}),(0,b.jsxs)(sK.Popup,{"data-slot":"sheet-content","data-side":r,className:tV("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...o,children:[t,n&&(0,b.jsxs)(sK.Close,{"data-slot":"sheet-close",render:(0,b.jsx)(rD,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,b.jsx)(sG,{}),(0,b.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function s1({className:e,...t}){return(0,b.jsx)("div",{"data-slot":"sheet-header",className:tV("flex flex-col gap-0.5 p-4",e),...t})}function s2({className:e,...t}){return(0,b.jsx)(sK.Title,{"data-slot":"sheet-title",className:tV("font-heading text-base font-medium text-foreground",e),...t})}function s4({className:e,...t}){return(0,b.jsx)(sK.Description,{"data-slot":"sheet-description",className:tV("text-sm text-muted-foreground",e),...t})}let s3=y.forwardRef(function(e,t){let{className:r,render:n,orientation:o="horizontal",style:s,...i}=e;return rR("div",e,{state:{orientation:o},ref:t,props:[{role:"separator","aria-orientation":o},i]})});function s6({className:e,orientation:t="horizontal",...r}){return(0,b.jsx)(s3,{"data-slot":"separator",orientation:t,className:tV("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...r})}function s5({agentId:e,onClose:t}){let{agent:r,loading:n}=function(e){let[t,r]=(0,y.useState)(null),[n,o]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{e?(o(!0),eM(e).then(r).finally(()=>o(!1))):r(null)},[e]),{agent:t,loading:n}}(e);return(0,b.jsx)(sQ,{open:!!e,onOpenChange:e=>!e&&t(),children:(0,b.jsxs)(s0,{className:"flex w-full flex-col sm:max-w-lg",children:[(0,b.jsx)(s1,{children:n||!r?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(tG,{className:"h-5 w-36"}),(0,b.jsx)(tG,{className:"h-4 w-24"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(s2,{className:"flex items-center gap-3",children:[r.name,(0,b.jsx)(r5,{status:r.status})]}),(0,b.jsx)(s4,{children:(0,b.jsxs)("span",{className:"flex items-center gap-2",children:["Started ",function(e,t){let r=(void 0)??rV.locale??r$,n=(void 0)??void 0??rV.firstWeekContainsDate??rV.locale?.options?.firstWeekContainsDate??1,o=(void 0)??void 0??rV.weekStartsOn??rV.locale?.options?.weekStartsOn??0,s=rX(e,void 0);if(!(s instanceof Date||"object"==typeof s&&"[object Date]"===Object.prototype.toString.call(s))&&"number"!=typeof s||isNaN(+rX(s)))throw RangeError("Invalid time value");let i=t.match(nx).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,nm[t])(e,r.formatLong):e}).join("").match(nv).map(e=>{if("''"===e)return{isToken:!1,value:"'"};let t=e[0];if("'"===t){var r;let t;return{isToken:!1,value:(t=(r=e).match(nw))?t[1].replace(nk,"'"):r}}if(nc[t])return{isToken:!0,value:e};if(t.match(nS))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});r.localize.preprocessor&&(i=r.localize.preprocessor(s,i));let a={firstWeekContainsDate:n,weekStartsOn:o,locale:r};return i.map(n=>{if(!n.isToken)return n.value;let o=n.value;return(nb.test(o)||ng.test(o))&&function(e,t,r){var n,o,s;let i,a=(n=e,o=t,s=r,i="Y"===n[0]?"years":"days of the month",`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${o}\`) for formatting ${i} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(a),ny.includes(e))throw RangeError(a)}(o,t,String(e)),(0,nc[o[0]])(s,o,r.localize,a)}).join("")}(new Date(r.createdAt),"MMM d, h:mm a"),r.attentionReason&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"·"}),(0,b.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:r.attentionReason})]})]})})]})}),(0,b.jsx)(s6,{}),(0,b.jsx)("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:n||!r?(0,b.jsx)(s8,{}):0===r.events.length?(0,b.jsx)("p",{className:"py-12 text-center text-sm text-muted-foreground",children:"No events recorded"}):(0,b.jsx)(s9,{events:r.events})})]})})}function s8(){return(0,b.jsx)("div",{className:"flex flex-col gap-3 pt-2",children:Array.from({length:5}).map((e,t)=>(0,b.jsx)(tG,{className:"h-14 w-full rounded-lg"},t))})}function s9({events:e}){let t=[...e].reverse();return(0,b.jsxs)("div",{className:"relative flex flex-col gap-0 pt-2",children:[(0,b.jsx)("div",{className:"absolute left-[11px] top-6 bottom-2 w-px bg-border"}),t.map(e=>(0,b.jsx)(s7,{event:e},e.id))]})}function s7({event:e}){let t="error"===e.type;return(0,b.jsxs)("div",{className:"relative flex gap-3 py-2 pl-0",children:[(0,b.jsx)("div",{className:tV("relative z-10 mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full ring-4 ring-background",t?"bg-red-100 text-red-600 dark:bg-red-950/50 dark:text-red-400":"bg-muted text-muted-foreground"),children:t?(0,b.jsx)(nC,{className:"h-3 w-3"}):(0,b.jsx)(nE,{className:"h-3 w-3"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:tV("text-sm leading-relaxed",t?"font-medium text-red-700 dark:text-red-300":"text-foreground"),children:e.message}),(0,b.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:rJ(new Date(e.timestamp),{addSuffix:!0})}),(null!=e.tokens||null!=e.cost)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground/50",children:"·"}),(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[(0,b.jsx)(n_,{className:"h-3 w-3"}),null!=e.tokens&&(0,b.jsxs)("span",{children:[e.tokens," tokens"]}),null!=e.tokens&&null!=e.cost&&(0,b.jsx)("span",{children:"·"}),null!=e.cost&&(0,b.jsxs)("span",{children:["$",e.cost.toFixed(4)]})]})]})]})]})]})}e.s(["default",0,function(){let{agents:e,loading:t,error:r,refetch:n}=function(){let[e,t]=(0,y.useState)([]),[r,n]=(0,y.useState)(!0),[o,s]=(0,y.useState)(null),i=(0,y.useRef)(null),a=(0,y.useCallback)(async()=>{try{let e=await eA();t(e),s(null)}catch(e){s(e instanceof Error?e.message:"Failed to fetch")}finally{n(!1)}},[]);return(0,y.useEffect)(()=>{a();let e=eR(eN,{reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:5e3});return i.current=e,e.on("agents:update",a),e.on("reconnect",a),()=>{e.disconnect(),i.current=null}},[a]),{agents:e,loading:r,error:o,refetch:a}}(),[o,s]=(0,y.useState)(null),i=(0,y.useCallback)(()=>s(null),[]);return(0,b.jsxs)("div",{className:"mx-auto flex w-full max-w-7xl flex-col gap-6 px-6 py-8",children:[(0,b.jsxs)("header",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Orchestrator"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"Monitor your AI agents in real time"})]}),r&&(0,b.jsx)("button",{onClick:n,className:"rounded-lg bg-red-50 px-3 py-1.5 text-xs font-medium text-red-700 transition-colors hover:bg-red-100 dark:bg-red-950/30 dark:text-red-400 dark:hover:bg-red-950/50",children:"Connection error — retry"})]}),(0,b.jsx)(tJ,{agents:e,loading:t}),(0,b.jsx)(rI,{agents:e,onResolve:n}),(0,b.jsx)(nt,{agents:e,loading:t,onSelect:s}),(0,b.jsx)(s5,{agentId:o,onClose:i})]})}],17661)}]);