a?32:a,N.T=null,a=Df,Df=null;var p=yo,w=Gr;if(Ut=0,ia=yo=null,Gr=0,(rt&6)!==0)throw Error(i(331));var R=rt;if(rt|=4,Cy(p.current),xy(p,p.current,w,a),rt=R,gs(0,!1),se&&typeof se.onPostCommitFiberRoot=="function")try{se.onPostCommitFiberRoot(F,p)}catch{}return!0}finally{Y.p=f,N.T=u,Uy(t,o)}}function By(t,o,a){o=Gn(a,o),o=ff(t.stateNode,o,2),t=co(t,o,2),t!==null&&(_t(t,2),Sr(t))}function at(t,o,a){if(t.tag===3)By(t,t,a);else for(;o!==null;){if(o.tag===3){By(o,t,a);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(vo===null||!vo.has(u))){t=Gn(a,t),a=qv(2),u=co(o,a,2),u!==null&&(Gv(a,u,o,t),_t(u,2),Sr(u));break}}o=o.return}}function If(t,o,a){var u=t.pingCache;if(u===null){u=t.pingCache=new gE;var f=new Set;u.set(o,f)}else f=u.get(o),f===void 0&&(f=new Set,u.set(o,f));f.has(a)||(Af=!0,f.add(a),t=xE.bind(null,t,o,a),o.then(t,t))}function xE(t,o,a){var u=t.pingCache;u!==null&&u.delete(o),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,ht===t&&(Ze&a)===a&&(Rt===4||Rt===3&&(Ze&62914560)===Ze&&300>zt()-Wl?(rt&2)===0&&aa(t,0):Mf|=a,oa===Ze&&(oa=0)),Sr(t)}function qy(t,o){o===0&&(o=Gt()),t=Qo(t,o),t!==null&&(_t(t,o),Sr(t))}function wE(t){var o=t.memoizedState,a=0;o!==null&&(a=o.retryLane),qy(t,a)}function _E(t,o){var a=0;switch(t.tag){case 31:case 13:var u=t.stateNode,f=t.memoizedState;f!==null&&(a=f.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(i(314))}u!==null&&u.delete(o),qy(t,a)}function CE(t,o){return rr(t,o)}var au=null,la=null,$f=!1,su=!1,Vf=!1,So=0;function Sr(t){t!==la&&t.next===null&&(la===null?au=la=t:la=la.next=t),su=!0,$f||($f=!0,RE())}function gs(t,o){if(!Vf&&su){Vf=!0;do for(var a=!1,u=au;u!==null;){if(t!==0){var f=u.pendingLanes;if(f===0)var p=0;else{var w=u.suspendedLanes,R=u.pingedLanes;p=(1<<31-pe(42|t)+1)-1,p&=f&~(w&~R),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(a=!0,Yy(u,p))}else p=Ze,p=Me(u,u===ht?p:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(p&3)===0||mt(u,p)||(a=!0,Yy(u,p));u=u.next}while(a);Vf=!1}}function EE(){Gy()}function Gy(){su=$f=!1;var t=0;So!==0&&LE()&&(t=So);for(var o=zt(),a=null,u=au;u!==null;){var f=u.next,p=Zy(u,o);p===0?(u.next=null,a===null?au=f:a.next=f,f===null&&(la=a)):(a=u,(t!==0||(p&3)!==0)&&(su=!0)),u=f}Ut!==0&&Ut!==5||gs(t),So!==0&&(So=0)}function Zy(t,o){for(var a=t.suspendedLanes,u=t.pingedLanes,f=t.expirationTimes,p=t.pendingLanes&-62914561;0R)break;var te=D.transferSize,ie=D.initiatorType;te&&r0(ie)&&(D=D.responseEnd,w+=te*(D"u"?null:document;function p0(t,o,a){var u=ua;if(u&&typeof o=="string"&&o){var f=Bn(o);f='link[rel="'+t+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),m0.has(f)||(m0.add(f),t={rel:t,crossOrigin:a,href:o},u.querySelector(f)===null&&(o=u.createElement("link"),rn(o,"link",t),Zt(o),u.head.appendChild(o)))}}function qE(t){Zr.D(t),p0("dns-prefetch",t,null)}function GE(t,o){Zr.C(t,o),p0("preconnect",t,o)}function ZE(t,o,a){Zr.L(t,o,a);var u=ua;if(u&&t&&o){var f='link[rel="preload"][as="'+Bn(o)+'"]';o==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+Bn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+Bn(a.imageSizes)+'"]')):f+='[href="'+Bn(t)+'"]';var p=f;switch(o){case"style":p=ca(t);break;case"script":p=da(t)}Jn.has(p)||(t=g({rel:"preload",href:o==="image"&&a&&a.imageSrcSet?void 0:t,as:o},a),Jn.set(p,t),u.querySelector(f)!==null||o==="style"&&u.querySelector(Ss(p))||o==="script"&&u.querySelector(xs(p))||(o=u.createElement("link"),rn(o,"link",t),Zt(o),u.head.appendChild(o)))}}function KE(t,o){Zr.m(t,o);var a=ua;if(a&&t){var u=o&&typeof o.as=="string"?o.as:"script",f='link[rel="modulepreload"][as="'+Bn(u)+'"][href="'+Bn(t)+'"]',p=f;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=da(t)}if(!Jn.has(p)&&(t=g({rel:"modulepreload",href:t},o),Jn.set(p,t),a.querySelector(f)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(xs(p)))return}u=a.createElement("link"),rn(u,"link",t),Zt(u),a.head.appendChild(u)}}}function YE(t,o,a){Zr.S(t,o,a);var u=ua;if(u&&t){var f=zi(u).hoistableStyles,p=ca(t);o=o||"default";var w=f.get(p);if(!w){var R={loading:0,preload:null};if(w=u.querySelector(Ss(p)))R.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":o},a),(a=Jn.get(p))&&th(t,a);var D=w=u.createElement("link");Zt(D),rn(D,"link",t),D._p=new Promise(function(G,te){D.onload=G,D.onerror=te}),D.addEventListener("load",function(){R.loading|=1}),D.addEventListener("error",function(){R.loading|=2}),R.loading|=4,fu(w,o,u)}w={type:"stylesheet",instance:w,count:1,state:R},f.set(p,w)}}}function QE(t,o){Zr.X(t,o);var a=ua;if(a&&t){var u=zi(a).hoistableScripts,f=da(t),p=u.get(f);p||(p=a.querySelector(xs(f)),p||(t=g({src:t,async:!0},o),(o=Jn.get(f))&&nh(t,o),p=a.createElement("script"),Zt(p),rn(p,"link",t),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},u.set(f,p))}}function XE(t,o){Zr.M(t,o);var a=ua;if(a&&t){var u=zi(a).hoistableScripts,f=da(t),p=u.get(f);p||(p=a.querySelector(xs(f)),p||(t=g({src:t,async:!0,type:"module"},o),(o=Jn.get(f))&&nh(t,o),p=a.createElement("script"),Zt(p),rn(p,"link",t),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},u.set(f,p))}}function g0(t,o,a,u){var f=(f=re.current)?du(f):null;if(!f)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(o=ca(a.href),a=zi(f).hoistableStyles,u=a.get(o),u||(u={type:"style",instance:null,count:0,state:null},a.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=ca(a.href);var p=zi(f).hoistableStyles,w=p.get(t);if(w||(f=f.ownerDocument||f,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(t,w),(p=f.querySelector(Ss(t)))&&!p._p&&(w.instance=p,w.state.loading=5),Jn.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Jn.set(t,a),p||JE(f,t,a,w.state))),o&&u===null)throw Error(i(528,""));return w}if(o&&u!==null)throw Error(i(529,""));return null;case"script":return o=a.async,a=a.src,typeof a=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=da(a),a=zi(f).hoistableScripts,u=a.get(o),u||(u={type:"script",instance:null,count:0,state:null},a.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function ca(t){return'href="'+Bn(t)+'"'}function Ss(t){return'link[rel="stylesheet"]['+t+"]"}function v0(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function JE(t,o,a,u){t.querySelector('link[rel="preload"][as="style"]['+o+"]")?u.loading=1:(o=t.createElement("link"),u.preload=o,o.addEventListener("load",function(){return u.loading|=1}),o.addEventListener("error",function(){return u.loading|=2}),rn(o,"link",a),Zt(o),t.head.appendChild(o))}function da(t){return'[src="'+Bn(t)+'"]'}function xs(t){return"script[async]"+t}function y0(t,o,a){if(o.count++,o.instance===null)switch(o.type){case"style":var u=t.querySelector('style[data-href~="'+Bn(a.href)+'"]');if(u)return o.instance=u,Zt(u),u;var f=g({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),Zt(u),rn(u,"style",f),fu(u,a.precedence,t),o.instance=u;case"stylesheet":f=ca(a.href);var p=t.querySelector(Ss(f));if(p)return o.state.loading|=4,o.instance=p,Zt(p),p;u=v0(a),(f=Jn.get(f))&&th(u,f),p=(t.ownerDocument||t).createElement("link"),Zt(p);var w=p;return w._p=new Promise(function(R,D){w.onload=R,w.onerror=D}),rn(p,"link",u),o.state.loading|=4,fu(p,a.precedence,t),o.instance=p;case"script":return p=da(a.src),(f=t.querySelector(xs(p)))?(o.instance=f,Zt(f),f):(u=a,(f=Jn.get(p))&&(u=g({},a),nh(u,f)),t=t.ownerDocument||t,f=t.createElement("script"),Zt(f),rn(f,"link",u),t.head.appendChild(f),o.instance=f);case"void":return null;default:throw Error(i(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(u=o.instance,o.state.loading|=4,fu(u,a.precedence,t));return o.instance}function fu(t,o,a){for(var u=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=u.length?u[u.length-1]:null,p=f,w=0;w title"):null)}function WE(t,o,a){if(a===1||o.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(t=o.disabled,typeof o.precedence=="string"&&t==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function x0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function eR(t,o,a,u){if(a.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=ca(u.href),p=o.querySelector(Ss(f));if(p){o=p._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(t.count++,t=mu.bind(t),o.then(t,t)),a.state.loading|=4,a.instance=p,Zt(p);return}p=o.ownerDocument||o,u=v0(u),(f=Jn.get(f))&&th(u,f),p=p.createElement("link"),Zt(p);var w=p;w._p=new Promise(function(R,D){w.onload=R,w.onerror=D}),rn(p,"link",u),a.instance=p}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,o),(o=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=mu.bind(t),o.addEventListener("load",a),o.addEventListener("error",a))}}var rh=0;function tR(t,o){return t.stylesheets&&t.count===0&&gu(t,t.stylesheets),0rh?50:800)+o);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(f)}}:null}function mu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var pu=null;function gu(t,o){t.stylesheets=null,t.unsuspend!==null&&(t.count++,pu=new Map,o.forEach(nR,t),pu=null,mu.call(t))}function nR(t,o){if(!(o.state.loading&4)){var a=pu.get(t);if(a)var u=a.get(null);else{a=new Map,pu.set(t,a);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),fh.exports=yR(),fh.exports}var SR=bR(),el=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},xR=class extends el{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Dm=new xR,wR={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},_R=class{#e=wR;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,n){return this.#e.setTimeout(e,n)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,n){return this.#e.setInterval(e,n)}clearInterval(e){this.#e.clearInterval(e)}},fi=new _R;function CR(e){setTimeout(e,0)}var ER=typeof window>"u"||"Deno"in globalThis;function An(){}function RR(e,n){return typeof e=="function"?e(n):e}function Kh(e){return typeof e=="number"&&e>=0&&e!==1/0}function PS(e,n){return Math.max(e+(n||0)-Date.now(),0)}function jo(e,n){return typeof e=="function"?e(n):e}function Vn(e,n){return typeof e=="function"?e(n):e}function q0(e,n){const{type:r="all",exact:i,fetchStatus:s,predicate:l,queryKey:c,stale:d}=e;if(c){if(i){if(n.queryHash!==Nm(c,n.options))return!1}else if(!Ps(n.queryKey,c))return!1}if(r!=="all"){const h=n.isActive();if(r==="active"&&!h||r==="inactive"&&h)return!1}return!(typeof d=="boolean"&&n.isStale()!==d||s&&s!==n.state.fetchStatus||l&&!l(n))}function G0(e,n){const{exact:r,status:i,predicate:s,mutationKey:l}=e;if(l){if(!n.options.mutationKey)return!1;if(r){if(Fs(n.options.mutationKey)!==Fs(l))return!1}else if(!Ps(n.options.mutationKey,l))return!1}return!(i&&n.state.status!==i||s&&!s(n))}function Nm(e,n){return(n?.queryKeyHashFn||Fs)(e)}function Fs(e){return JSON.stringify(e,(n,r)=>Qh(r)?Object.keys(r).sort().reduce((i,s)=>(i[s]=r[s],i),{}):r)}function Ps(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(r=>Ps(e[r],n[r])):!1}var TR=Object.prototype.hasOwnProperty;function US(e,n,r=0){if(e===n)return e;if(r>500)return n;const i=Z0(e)&&Z0(n);if(!i&&!(Qh(e)&&Qh(n)))return n;const l=(i?e:Object.keys(e)).length,c=i?n:Object.keys(n),d=c.length,h=i?new Array(d):{};let m=0;for(let y=0;y{fi.setTimeout(n,e)})}function Xh(e,n,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,n):r.structuralSharing!==!1?US(e,n):n}function AR(e,n,r=0){const i=[...e,n];return r&&i.length>r?i.slice(1):i}function MR(e,n,r=0){const i=[n,...e];return r&&i.length>r?i.slice(0,-1):i}var km=Symbol();function HS(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===km?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function BS(e,n){return typeof e=="function"?e(...n):!!e}function jR(e,n,r){let i=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=n(),i||(i=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Us=(()=>{let e=()=>ER;return{isServer(){return e()},setIsServer(n){e=n}}})();function Jh(){let e,n;const r=new Promise((s,l)=>{e=s,n=l});r.status="pending",r.catch(()=>{});function i(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{i({status:"fulfilled",value:s}),e(s)},r.reject=s=>{i({status:"rejected",reason:s}),n(s)},r}var zR=CR;function DR(){let e=[],n=0,r=d=>{d()},i=d=>{d()},s=zR;const l=d=>{n?e.push(d):s(()=>{r(d)})},c=()=>{const d=e;e=[],d.length&&s(()=>{i(()=>{d.forEach(h=>{r(h)})})})};return{batch:d=>{let h;n++;try{h=d()}finally{n--,n||c()}return h},batchCalls:d=>(...h)=>{l(()=>{d(...h)})},schedule:l,setNotifyFunction:d=>{r=d},setBatchNotifyFunction:d=>{i=d},setScheduler:d=>{s=d}}}var sn=DR(),NR=class extends el{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},Yu=new NR;function kR(e){return Math.min(1e3*2**e,3e4)}function qS(e){return(e??"online")==="online"?Yu.isOnline():!0}var Wh=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function GS(e){let n=!1,r=0,i;const s=Jh(),l=()=>s.status!=="pending",c=C=>{if(!l()){const E=new Wh(C);b(E),e.onCancel?.(E)}},d=()=>{n=!0},h=()=>{n=!1},m=()=>Dm.isFocused()&&(e.networkMode==="always"||Yu.isOnline())&&e.canRun(),y=()=>qS(e.networkMode)&&e.canRun(),g=C=>{l()||(i?.(),s.resolve(C))},b=C=>{l()||(i?.(),s.reject(C))},S=()=>new Promise(C=>{i=E=>{(l()||m())&&C(E)},e.onPause?.()}).then(()=>{i=void 0,l()||e.onContinue?.()}),_=()=>{if(l())return;let C;const E=r===0?e.initialPromise:void 0;try{C=E??e.fn()}catch(T){C=Promise.reject(T)}Promise.resolve(C).then(g).catch(T=>{if(l())return;const O=e.retry??(Us.isServer()?0:3),A=e.retryDelay??kR,k=typeof A=="function"?A(r,T):A,L=O===!0||typeof O=="number"&&rm()?void 0:S()).then(()=>{n?b(T):_()})})};return{promise:s,status:()=>s.status,cancel:c,continue:()=>(i?.(),s),cancelRetry:d,continueRetry:h,canStart:y,start:()=>(y()?_():S().then(_),s)}}var ZS=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Kh(this.gcTime)&&(this.#e=fi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Us.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(fi.clearTimeout(this.#e),this.#e=void 0)}};function LR(e){return{onFetch:(n,r)=>{const i=n.options,s=n.fetchOptions?.meta?.fetchMore?.direction,l=n.state.data?.pages||[],c=n.state.data?.pageParams||[];let d={pages:[],pageParams:[]},h=0;const m=async()=>{let y=!1;const g=_=>{jR(_,()=>n.signal,()=>y=!0)},b=HS(n.options,n.fetchOptions),S=async(_,C,E)=>{if(y)return Promise.reject(n.signal.reason);if(C==null&&_.pages.length)return Promise.resolve(_);const O=(()=>{const q={client:n.client,queryKey:n.queryKey,pageParam:C,direction:E?"backward":"forward",meta:n.options.meta};return g(q),q})(),A=await b(O),{maxPages:k}=n.options,L=E?MR:AR;return{pages:L(_.pages,A,k),pageParams:L(_.pageParams,C,k)}};if(s&&l.length){const _=s==="backward",C=_?IR:Y0,E={pages:l,pageParams:c},T=C(i,E);d=await S(E,T,_)}else{const _=e??l.length;do{const C=h===0?c[0]??i.initialPageParam:Y0(i,d);if(h>0&&C==null)break;d=await S(d,C),h++}while(h<_)}return d};n.options.persister?n.fetchFn=()=>n.options.persister?.(m,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},r):n.fetchFn=m}}}function Y0(e,{pages:n,pageParams:r}){const i=n.length-1;return n.length>0?e.getNextPageParam(n[i],n,r[i],r):void 0}function IR(e,{pages:n,pageParams:r}){return n.length>0?e.getPreviousPageParam?.(n[0],n,r[0],r):void 0}var $R=class extends ZS{#e;#t;#n;#r;#i;#o;#s;#a;constructor(e){super(),this.#a=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=X0(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#o?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=X0(this.options);n.data!==void 0&&(this.setState(Q0(n.data,n.dataUpdatedAt)),this.#t=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,n){const r=Xh(this.state.data,e,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),r}setState(e){this.#l({type:"setState",state:e})}cancel(e){const n=this.#o?.promise;return this.#o?.cancel(e),n?n.then(An).catch(An):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Vn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===km||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>jo(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!PS(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#o&&(this.#a||this.#c()?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#o?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(m=>m.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,i=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#a=!0,r.signal)})},s=()=>{const h=HS(this.options,n),y=(()=>{const g={client:this.#i,queryKey:this.queryKey,meta:this.meta};return i(g),g})();return this.#a=!1,this.options.persister?this.options.persister(h,y,this):h(y)},c=(()=>{const h={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:s};return i(h),h})();(this.#e==="infinite"?LR(this.options.pages):this.options.behavior)?.onFetch(c,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#l({type:"fetch",meta:c.fetchOptions?.meta}),this.#o=GS({initialPromise:n?.initialPromise,fn:c.fetchFn,onCancel:h=>{h instanceof Wh&&h.revert&&this.setState({...this.#n,fetchStatus:"idle"}),r.abort()},onFail:(h,m)=>{this.#l({type:"failed",failureCount:h,error:m})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const h=await this.#o.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#r.config.onSuccess?.(h,this),this.#r.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof Wh){if(h.silent)return this.#o.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#l({type:"error",error:h}),this.#r.config.onError?.(h,this),this.#r.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#l(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...KS(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...Q0(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?i:void 0,i;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),sn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function KS(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qS(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Q0(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function X0(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,r=n!==void 0,i=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var VR=class extends el{constructor(e,n){super(),this.options=n,this.#e=e,this.#a=null,this.#s=Jh(),this.bindMethods(),this.setOptions(n)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#o;#s;#a;#c;#l;#m;#d;#f;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),J0(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return em(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return em(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#x(),this.#t.removeObserver(this)}setOptions(e){const n=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Vn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),n._defaulted&&!Yh(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&W0(this.#t,r,this.options,n)&&this.#h(),this.updateResult(),i&&(this.#t!==r||Vn(this.options.enabled,this.#t)!==Vn(n.enabled,this.#t)||jo(this.options.staleTime,this.#t)!==jo(n.staleTime,this.#t))&&this.#g();const s=this.#v();i&&(this.#t!==r||Vn(this.options.enabled,this.#t)!==Vn(n.enabled,this.#t)||s!==this.#u)&&this.#y(s)}getOptimisticResult(e){const n=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(n,e);return PR(this,r)&&(this.#r=r,this.#o=this.options,this.#i=this.#t.state),r}getCurrentResult(){return this.#r}trackResult(e,n){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),n?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#w();let n=this.#t.fetch(this.options,e);return e?.throwOnError||(n=n.catch(An)),n}#g(){this.#S();const e=jo(this.options.staleTime,this.#t);if(Us.isServer()||this.#r.isStale||!Kh(e))return;const r=PS(this.#r.dataUpdatedAt,e)+1;this.#d=fi.setTimeout(()=>{this.#r.isStale||this.updateResult()},r)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#u=e,!(Us.isServer()||Vn(this.options.enabled,this.#t)===!1||!Kh(this.#u)||this.#u===0)&&(this.#f=fi.setInterval(()=>{(this.options.refetchIntervalInBackground||Dm.isFocused())&&this.#h()},this.#u))}#b(){this.#g(),this.#y(this.#v())}#S(){this.#d!==void 0&&(fi.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(fi.clearInterval(this.#f),this.#f=void 0)}createResult(e,n){const r=this.#t,i=this.options,s=this.#r,l=this.#i,c=this.#o,h=e!==r?e.state:this.#n,{state:m}=e;let y={...m},g=!1,b;if(n._optimisticResults){const $=this.hasListeners(),he=!$&&J0(e,n),ve=$&&W0(e,r,n,i);(he||ve)&&(y={...y,...KS(m.data,e.options)}),n._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:S,errorUpdatedAt:_,status:C}=y;b=y.data;let E=!1;if(n.placeholderData!==void 0&&b===void 0&&C==="pending"){let $;s?.isPlaceholderData&&n.placeholderData===c?.placeholderData?($=s.data,E=!0):$=typeof n.placeholderData=="function"?n.placeholderData(this.#m?.state.data,this.#m):n.placeholderData,$!==void 0&&(C="success",b=Xh(s?.data,$,n),g=!0)}if(n.select&&b!==void 0&&!E)if(s&&b===l?.data&&n.select===this.#c)b=this.#l;else try{this.#c=n.select,b=n.select(b),b=Xh(s?.data,b,n),this.#l=b,this.#a=null}catch($){this.#a=$}this.#a&&(S=this.#a,b=this.#l,_=Date.now(),C="error");const T=y.fetchStatus==="fetching",O=C==="pending",A=C==="error",k=O&&T,L=b!==void 0,H={status:C,fetchStatus:y.fetchStatus,isPending:O,isSuccess:C==="success",isError:A,isInitialLoading:k,isLoading:k,data:b,dataUpdatedAt:y.dataUpdatedAt,error:S,errorUpdatedAt:_,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:y.dataUpdateCount>h.dataUpdateCount||y.errorUpdateCount>h.errorUpdateCount,isFetching:T,isRefetching:T&&!O,isLoadingError:A&&!L,isPaused:y.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:A&&L,isStale:Lm(e,n),refetch:this.refetch,promise:this.#s,isEnabled:Vn(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const $=H.data!==void 0,he=H.status==="error"&&!$,ve=ae=>{he?ae.reject(H.error):$&&ae.resolve(H.data)},de=()=>{const ae=this.#s=H.promise=Jh();ve(ae)},le=this.#s;switch(le.status){case"pending":e.queryHash===r.queryHash&&ve(le);break;case"fulfilled":(he||H.data!==le.value)&&de();break;case"rejected":(!he||H.error!==le.reason)&&de();break}}return H}updateResult(){const e=this.#r,n=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#o=this.options,this.#i.data!==void 0&&(this.#m=this.#t),Yh(n,e))return;this.#r=n;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!this.#p.size)return!0;const l=new Set(s??this.#p);return this.options.throwOnError&&l.add("error"),Object.keys(this.#r).some(c=>{const d=c;return this.#r[d]!==e[d]&&l.has(d)})};this.#_({listeners:r()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const n=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(n?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){sn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function FR(e,n){return Vn(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Vn(n.retryOnMount,e)===!1)}function J0(e,n){return FR(e,n)||e.state.data!==void 0&&em(e,n,n.refetchOnMount)}function em(e,n,r){if(Vn(n.enabled,e)!==!1&&jo(n.staleTime,e)!=="static"){const i=typeof r=="function"?r(e):r;return i==="always"||i!==!1&&Lm(e,n)}return!1}function W0(e,n,r,i){return(e!==n||Vn(i.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Lm(e,r)}function Lm(e,n){return Vn(n.enabled,e)!==!1&&e.isStaleByTime(jo(n.staleTime,e))}function PR(e,n){return!Yh(e.getCurrentResult(),n)}var UR=class extends ZS{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||HR(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(n=>n!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=GS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(l,c)=>{this.#i({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",s=!this.#r.canStart();try{if(i)n();else{this.#i({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);const c=await this.options.onMutate?.(e,r);c!==this.state.context&&this.#i({type:"pending",context:c,variables:e,isPaused:s})}const l=await this.#r.start();return await this.#n.config.onSuccess?.(l,e,this.state.context,this,r),await this.options.onSuccess?.(l,e,this.state.context,r),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(l,null,e,this.state.context,r),this.#i({type:"success",data:l}),l}catch(l){try{await this.#n.config.onError?.(l,e,this.state.context,this,r)}catch(c){Promise.reject(c)}try{await this.options.onError?.(l,e,this.state.context,r)}catch(c){Promise.reject(c)}try{await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,r)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,l,e,this.state.context,r)}catch(c){Promise.reject(c)}throw this.#i({type:"error",error:l}),l}finally{this.#n.runNext(this)}}#i(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),sn.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function HR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var BR=class extends el{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,r){const i=new UR({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){this.#e.add(e);const n=Cu(e);if(typeof n=="string"){const r=this.#t.get(n);r?r.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=Cu(e);if(typeof n=="string"){const r=this.#t.get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Cu(e);if(typeof n=="string"){const i=this.#t.get(n)?.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){const n=Cu(e);return typeof n=="string"?this.#t.get(n)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){sn.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(r=>G0(n,r))}findAll(e={}){return this.getAll().filter(n=>G0(e,n))}notify(e){sn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return sn.batch(()=>Promise.all(e.map(n=>n.continue().catch(An))))}};function Cu(e){return e.options.scope?.id}var qR=class extends el{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,r){const i=n.queryKey,s=n.queryHash??Nm(i,n);let l=this.get(s);return l||(l=new $R({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){sn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>q0(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>q0(e,r)):n}notify(e){sn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){sn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){sn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},GR=class{#e;#t;#n;#r;#i;#o;#s;#a;constructor(e={}){this.#e=e.queryCache||new qR,this.#t=e.mutationCache||new BR,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#s=Dm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=Yu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#s?.(),this.#s=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),r=this.#e.build(this,n),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(jo(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(e,n,r){const i=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(i.queryHash)?.state.data,c=RR(n,l);if(c!==void 0)return this.#e.build(this,i).setData(c,{...r,manual:!0})}setQueriesData(e,n,r){return sn.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;sn.batch(()=>{n.findAll(e).forEach(r=>{n.remove(r)})})}resetQueries(e,n){const r=this.#e;return sn.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const r={revert:!0,...n},i=sn.batch(()=>this.#e.findAll(e).map(s=>s.cancel(r)));return Promise.all(i).then(An).catch(An)}invalidateQueries(e,n={}){return sn.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},i=sn.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let l=s.fetch(void 0,r);return r.throwOnError||(l=l.catch(An)),s.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(An)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const r=this.#e.build(this,n);return r.isStaleByTime(jo(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(An).catch(An)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(An).catch(An)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Yu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#r.set(Fs(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#r.values()],r={};return n.forEach(i=>{Ps(e,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(e,n){this.#i.set(Fs(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#i.values()],r={};return n.forEach(i=>{Ps(e,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=Nm(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===km&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},YS=x.createContext(void 0),tl=e=>{const n=x.useContext(YS);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},ZR=({client:e,children:n})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(YS.Provider,{value:e,children:n})),QS=x.createContext(!1),KR=()=>x.useContext(QS);QS.Provider;function YR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var QR=x.createContext(YR()),XR=()=>x.useContext(QR),JR=(e,n,r)=>{const i=r?.state.error&&typeof e.throwOnError=="function"?BS(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(n.isReset()||(e.retryOnMount=!1))},WR=e=>{x.useEffect(()=>{e.clearReset()},[e])},eT=({result:e,errorResetBoundary:n,throwOnError:r,query:i,suspense:s})=>e.isError&&!n.isReset()&&!e.isFetching&&i&&(s&&e.data===void 0||BS(r,[e.error,i])),tT=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...s)=>r(i(...s)):r(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},nT=(e,n)=>e.isLoading&&e.isFetching&&!n,rT=(e,n)=>e?.suspense&&n.isPending,eb=(e,n,r)=>n.fetchOptimistic(e).catch(()=>{r.clearReset()});function oT(e,n,r){const i=KR(),s=XR(),l=tl(),c=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const d=l.getQueryCache().get(c.queryHash),h=e.subscribed!==!1;c._optimisticResults=i?"isRestoring":h?"optimistic":void 0,tT(c),JR(c,s,d),WR(s);const m=!l.getQueryCache().get(c.queryHash),[y]=x.useState(()=>new n(l,c)),g=y.getOptimisticResult(c),b=!i&&h;if(x.useSyncExternalStore(x.useCallback(S=>{const _=b?y.subscribe(sn.batchCalls(S)):An;return y.updateResult(),_},[y,b]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),x.useEffect(()=>{y.setOptions(c)},[c,y]),rT(c,g))throw eb(c,y,s);if(eT({result:g,errorResetBoundary:s,throwOnError:c.throwOnError,query:d,suspense:c.suspense}))throw g.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(c,g),c.experimental_prefetchInRender&&!Us.isServer()&&nT(g,i)&&(m?eb(c,y,s):d?.promise)?.catch(An).finally(()=>{y.updateResult()}),c.notifyOnChangeProps?g:y.trackResult(g)}function jn(e,n){return oT(e,VR)}function XS(){throw location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),new Error("signing in…")}function iT(e,n){const r=n.trim();switch(e){case 403:return r.includes("seat")?"This plan is out of seats. Upgrade to add more people.":r.includes("owner")?"Only owners can do that.":"You don't have access to that.";case 409:return r?r[0].toUpperCase()+r.slice(1):"That is managed outside this hub.";case 404:return"That is gone — it may have been removed already.";case 429:return"Too many requests. Give it a moment.";default:return e>=500?"The server had a problem. Try again.":r?r[0].toUpperCase()+r.slice(1):"Something went wrong."}}async function Im(e){throw new Error(iT(e.status,await e.text()))}async function Fn(e){const n=await fetch(e);return n.status===401&&XS(),n.ok||await Im(n),n.json()}async function zo(e,n,r){const i={method:e};r!==void 0&&(i.headers={"Content-Type":"application/json"},i.body=JSON.stringify(r));const s=await fetch(n,i);return s.ok||await Im(s),s.status===204?{}:s.json()}async function Oa(e,n){const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n||{})});return r.status===401&&XS(),r.ok||await Im(r),r.json()}function aT(){return jn({queryKey:["config"],queryFn:async()=>{const e=await Fn("/api/config");return e.auth.enabled&&!e.me&&(location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),await new Promise(()=>{})),e},staleTime:1/0})}var Si=FS();const sT=VS(Si);function tb(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Aa(...e){return n=>{let r=!1;const i=e.map(s=>{const l=tb(s,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let s=0;s{let{children:s,...l}=r,c=null,d=!1;const h=[];nb(s)&&typeof Eu=="function"&&(s=Eu(s._payload)),x.Children.forEach(s,b=>{if(hT(b)){d=!0;const S=b;let _="child"in S.props?S.props.child:S.props.children;nb(_)&&typeof Eu=="function"&&(_=Eu(_._payload)),c=cT(S,_),h.push(c?.props?.children)}else h.push(b)}),c?c=x.cloneElement(c,void 0,h):!d&&x.Children.count(s)===1&&x.isValidElement(s)&&(c=s);const m=c?fT(c):void 0,y=ot(i,m);if(!c){if(s||s===0)throw new Error(d?vT(e):gT(e));return s}const g=dT(l,c.props??{});return c.type!==x.Fragment&&(g.ref=i?y:m),x.cloneElement(c,g)});return n.displayName=`${e}.Slot`,n}var lT=hi("Slot"),JS=Symbol.for("radix.slottable");function uT(e){const n=r=>"child"in r?r.children(r.child):r.children;return n.displayName=`${e}.Slottable`,n.__radixId=JS,n}var cT=(e,n)=>{if("child"in e.props){const r=e.props.child;return x.isValidElement(r)?x.cloneElement(r,void 0,e.props.children(r.props.children)):null}return x.isValidElement(n)?n:null};function dT(e,n){const r={...n};for(const i in n){const s=e[i],l=n[i];/^on[A-Z]/.test(i)?s&&l?r[i]=(...d)=>{const h=l(...d);return s(...d),h}:s&&(r[i]=s):i==="style"?r[i]={...s,...l}:i==="className"&&(r[i]=[s,l].filter(Boolean).join(" "))}return{...e,...r}}function fT(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function hT(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===JS}var mT=Symbol.for("react.lazy");function nb(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===mT&&"_payload"in e&&pT(e._payload)}function pT(e){return typeof e=="object"&&e!==null&&"then"in e}var gT=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,vT=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Eu=vc[" use ".trim().toString()],yT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=yT.reduce((e,n)=>{const r=hi(`Primitive.${n}`),i=x.forwardRef((s,l)=>{const{asChild:c,...d}=s,h=c?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(h,{...d,ref:l})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function WS(e,n){e&&Si.flushSync(()=>e.dispatchEvent(n))}var ex=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),bT="VisuallyHidden",tx=x.forwardRef((e,n)=>v.jsx(Pe.span,{...e,ref:n,style:{...ex,...e.style}}));tx.displayName=bT;var ST=tx;function $o(e,n=[]){let r=[];function i(l,c){const d=x.createContext(c);d.displayName=l+"Context";const h=r.length;r=[...r,c];const m=g=>{const{scope:b,children:S,..._}=g,C=b?.[e]?.[h]||d,E=x.useMemo(()=>_,Object.values(_));return v.jsx(C.Provider,{value:E,children:S})};m.displayName=l+"Provider";function y(g,b,S={}){const{optional:_=!1}=S,C=b?.[e]?.[h]||d,E=x.useContext(C);if(E)return E;if(c!==void 0)return c;if(!_)throw new Error(`\`${g}\` must be used within \`${l}\``)}return[m,y]}const s=()=>{const l=r.map(c=>x.createContext(c));return function(d){const h=d?.[e]||l;return x.useMemo(()=>({[`__scope${e}`]:{...d,[e]:h}}),[d,h])}};return s.scopeName=e,[i,xT(s,...n)]}function xT(...e){const n=e[0];if(e.length===1)return n;const r=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(l){const c=i.reduce((d,{useScope:h,scopeName:m})=>{const g=h(l)[`__scope${m}`];return{...d,...g}},{});return x.useMemo(()=>({[`__scope${n.scopeName}`]:c}),[c])}};return r.scopeName=n.scopeName,r}function $m(e){const n=e+"CollectionProvider",[r,i]=$o(n),[s,l]=r(n,{collectionRef:{current:null},itemMap:new Map}),c=C=>{const{scope:E,children:T}=C,O=x.useRef(null),A=x.useRef(new Map).current;return v.jsx(s,{scope:E,itemMap:A,collectionRef:O,children:T})};c.displayName=n;const d=e+"CollectionSlot",h=hi(d),m=x.forwardRef((C,E)=>{const{scope:T,children:O}=C,A=l(d,T),k=ot(E,A.collectionRef);return v.jsx(h,{ref:k,children:O})});m.displayName=d;const y=e+"CollectionItemSlot",g="data-radix-collection-item",b=hi(y),S=x.forwardRef((C,E)=>{const{scope:T,children:O,...A}=C,k=x.useRef(null),L=ot(E,k),q=l(y,T);return x.useEffect(()=>(q.itemMap.set(k,{ref:k,...A}),()=>{q.itemMap.delete(k)})),v.jsx(b,{[g]:"",ref:L,children:O})});S.displayName=y;function _(C){const E=l(e+"CollectionConsumer",C);return x.useCallback(()=>{const O=E.collectionRef.current;if(!O)return[];const A=Array.from(O.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((q,H)=>A.indexOf(q.ref.current)-A.indexOf(H.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:S},_,i]}function Re(e,n,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e?.(s),r===!1||!s||!s.defaultPrevented)return n?.(s)}}var Qt=globalThis?.document?x.useLayoutEffect:()=>{},wT=vc[" useInsertionEffect ".trim().toString()]||Qt;function Ma({prop:e,defaultProp:n,onChange:r=()=>{},caller:i}){const[s,l,c]=_T({defaultProp:n,onChange:r}),d=e!==void 0,h=d?e:s;{const y=x.useRef(e!==void 0);x.useEffect(()=>{const g=y.current;g!==d&&console.warn(`${i} is changing from ${g?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=d},[d,i])}const m=x.useCallback(y=>{if(d){const g=CT(y)?y(e):y;g!==e&&c.current?.(g)}else l(y)},[d,e,l,c]);return[h,m]}function _T({defaultProp:e,onChange:n}){const[r,i]=x.useState(e),s=x.useRef(r),l=x.useRef(n);return wT(()=>{l.current=n},[n]),x.useEffect(()=>{s.current!==r&&(l.current?.(r),s.current=r)},[r,s]),[r,i,l]}function CT(e){return typeof e=="function"}function ET(e,n){return x.useReducer((r,i)=>n[r][i]??r,e)}var pr=e=>{const{present:n,children:r}=e,i=RT(n),s=typeof r=="function"?r({present:i.isPresent}):x.Children.only(r),l=TT(i.ref,OT(s));return typeof r=="function"||i.isPresent?x.cloneElement(s,{ref:l}):null};pr.displayName="Presence";function RT(e){const[n,r]=x.useState(),i=x.useRef(null),s=x.useRef(e),l=x.useRef("none"),c=x.useRef(void 0),d=e?"mounted":"unmounted",[h,m]=ET(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{h==="mounted"?(l.current=c.current??Os(i.current),c.current=void 0):l.current="none"},[h]),Qt(()=>{const y=i.current,g=s.current;if(g!==e){const S=l.current,_=Os(y);e?(c.current=_,m("MOUNT")):_==="none"||y?.display==="none"?m("UNMOUNT"):m(g&&S!==_?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,m]),Qt(()=>{if(n){let y;const g=n.ownerDocument.defaultView??window,b=_=>{const E=Os(i.current).includes(CSS.escape(_.animationName));if(_.target===n&&E&&(m("ANIMATION_END"),!s.current)){const T=n.style.animationFillMode;n.style.animationFillMode="forwards",y=g.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=T)})}},S=_=>{_.target===n&&(l.current=Os(i.current))};return n.addEventListener("animationstart",S),n.addEventListener("animationcancel",b),n.addEventListener("animationend",b),()=>{g.clearTimeout(y),n.removeEventListener("animationstart",S),n.removeEventListener("animationcancel",b),n.removeEventListener("animationend",b)}}else m("ANIMATION_END")},[n,m]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:x.useCallback(y=>{if(y){const g=getComputedStyle(y);i.current=g,c.current=Os(g)}else i.current=null;r(y)},[])}}function rb(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function TT(...e){const n=x.useRef(e);return n.current=e,x.useCallback(r=>{const i=n.current;let s=!1;const l=i.map(c=>{const d=rb(c,r);return!s&&typeof d=="function"&&(s=!0),d});if(s)return()=>{for(let c=0;c{}),MT=0;function hn(e){const[n,r]=x.useState(AT());return Qt(()=>{r(i=>i??String(MT++))},[e]),n?`radix-${n}`:""}var jT=x.createContext(void 0);function Vm(e){const n=x.useContext(jT);return e||n||"ltr"}function tr(e){const n=x.useRef(e);return x.useEffect(()=>{n.current=e}),x.useMemo(()=>((...r)=>n.current?.(...r)),[])}var zT="DismissableLayer",tm="dismissableLayer.update",DT="dismissableLayer.pointerDownOutside",NT="dismissableLayer.focusOutside",ob,Fm=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),nl=x.forwardRef((e,n)=>{const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,onDismiss:h,...m}=e,y=x.useContext(Fm),[g,b]=x.useState(null),S=g?.ownerDocument??globalThis?.document,[,_]=x.useState({}),C=ot(n,b),E=Array.from(y.layers),[T]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),O=T?E.indexOf(T):-1,A=g?E.indexOf(g):-1,k=y.layersWithOutsidePointerEventsDisabled.size>0,L=A>=O,q=x.useRef(!1),H=VT(de=>{l?.(de),d?.(de),de.defaultPrevented||h?.()},{ownerDocument:S,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:q,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:x.useCallback(de=>{if(!(de instanceof Node))return!1;const le=[...y.branches].some(ae=>ae.contains(de));return L&&!le},[y.branches,L])}),$=FT(de=>{if(i&&q.current)return;const le=de.target;[...y.branches].some(me=>me.contains(le))||(c?.(de),d?.(de),de.defaultPrevented||h?.())},S),he=g?A===E.length-1:!1,ve=tr(de=>{de.key==="Escape"&&(s?.(de),!de.defaultPrevented&&h&&(de.preventDefault(),h()))});return x.useEffect(()=>{if(he)return S.addEventListener("keydown",ve,{capture:!0}),()=>S.removeEventListener("keydown",ve,{capture:!0})},[S,he,ve]),x.useEffect(()=>{if(g)return r&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(ob=S.body.style.pointerEvents,S.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(g)),y.layers.add(g),ib(),()=>{r&&(y.layersWithOutsidePointerEventsDisabled.delete(g),y.layersWithOutsidePointerEventsDisabled.size===0&&(S.body.style.pointerEvents=ob))}},[g,S,r,y]),x.useEffect(()=>()=>{g&&(y.layers.delete(g),y.layersWithOutsidePointerEventsDisabled.delete(g),ib())},[g,y]),x.useEffect(()=>{const de=()=>_({});return document.addEventListener(tm,de),()=>document.removeEventListener(tm,de)},[]),v.jsx(Pe.div,{...m,ref:C,style:{pointerEvents:k?L?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,$.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,$.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,H.onPointerDownCapture)})});nl.displayName=zT;var kT="DismissableLayerBranch",LT=x.forwardRef((e,n)=>{const r=x.useContext(Fm),i=x.useRef(null),s=ot(n,i);return x.useEffect(()=>{const l=i.current;if(l)return r.branches.add(l),()=>{r.branches.delete(l)}},[r.branches]),v.jsx(Pe.div,{...e,ref:s})});LT.displayName=kT;function IT(){const e=x.useContext(Fm),[n,r]=x.useState(null);return x.useEffect(()=>{if(n)return e.dismissableSurfaces.add(n),()=>{e.dismissableSurfaces.delete(n)}},[n,e.dismissableSurfaces]),r}var $T=()=>!0;function VT(e,n){const{ownerDocument:r=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:l,shouldHandlePointerDownOutside:c=$T}=n,d=tr(e),h=x.useRef(!1),m=x.useRef(!1),y=x.useRef(new Map),g=x.useRef(()=>{});return x.useEffect(()=>{function b(){m.current=!1,s.current=!1,y.current.clear()}function S(){return Array.from(y.current.values()).some(Boolean)}function _(A){if(!m.current)return;const k=A.target;k instanceof Node&&[...l].some(q=>q.contains(k))||y.current.set(A.type,!0),A.type==="click"&&window.setTimeout(()=>{m.current&&g.current()},0)}function C(A){m.current&&y.current.set(A.type,!1)}const E=A=>{if(A.target&&!h.current){let k=function(){r.removeEventListener("click",g.current);const q=S();b(),q||nx(DT,d,L,{discrete:!0})};if(!c(A.target)){r.removeEventListener("click",g.current),b(),h.current=!1;return}const L={originalEvent:A};m.current=!0,s.current=i&&A.button===0,y.current.clear(),!i||A.button!==0?k():(r.removeEventListener("click",g.current),g.current=k,r.addEventListener("click",g.current,{once:!0}))}else r.removeEventListener("click",g.current),b();h.current=!1},T=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const A of T)r.addEventListener(A,_,!0),r.addEventListener(A,C);const O=window.setTimeout(()=>{r.addEventListener("pointerdown",E)},0);return()=>{window.clearTimeout(O),r.removeEventListener("pointerdown",E),r.removeEventListener("click",g.current);for(const A of T)r.removeEventListener(A,_,!0),r.removeEventListener(A,C)}},[r,d,i,s,l,c]),{onPointerDownCapture:()=>h.current=!0}}function FT(e,n=globalThis?.document){const r=tr(e),i=x.useRef(!1);return x.useEffect(()=>{const s=l=>{l.target&&!i.current&&nx(NT,r,{originalEvent:l},{discrete:!1})};return n.addEventListener("focusin",s),()=>n.removeEventListener("focusin",s)},[n,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function ib(){const e=new CustomEvent(tm);document.dispatchEvent(e)}function nx(e,n,r,{discrete:i}){const s=r.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});n&&s.addEventListener(e,n,{once:!0}),i?WS(s,l):s.dispatchEvent(l)}var gh="focusScope.autoFocusOnMount",vh="focusScope.autoFocusOnUnmount",ab={bubbles:!1,cancelable:!0},PT="FocusScope",yc=x.forwardRef((e,n)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...c}=e,[d,h]=x.useState(null),m=tr(s),y=tr(l),g=x.useRef(null),b=ot(n,h),S=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(i){let C=function(A){if(S.paused||!d)return;const k=A.target;d.contains(k)?g.current=k:Oo(g.current,{select:!0})},E=function(A){if(S.paused||!d)return;const k=A.relatedTarget;k!==null&&(d.contains(k)||Oo(g.current,{select:!0}))},T=function(A){if(document.activeElement===document.body)for(const L of A)L.removedNodes.length>0&&Oo(d)};document.addEventListener("focusin",C),document.addEventListener("focusout",E);const O=new MutationObserver(T);return d&&O.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",E),O.disconnect()}}},[i,d,S.paused]),x.useEffect(()=>{if(d){lb.add(S);const C=document.activeElement;if(!d.contains(C)){const T=new CustomEvent(gh,ab);d.addEventListener(gh,m),d.dispatchEvent(T),T.defaultPrevented||(UT(ZT(rx(d)),{select:!0}),document.activeElement===C&&Oo(d))}return()=>{d.removeEventListener(gh,m),setTimeout(()=>{const T=new CustomEvent(vh,ab);d.addEventListener(vh,y),d.dispatchEvent(T),T.defaultPrevented||Oo(C??document.body,{select:!0}),d.removeEventListener(vh,y),lb.remove(S)},0)}}},[d,m,y,S]);const _=x.useCallback(C=>{if(!r&&!i||S.paused)return;const E=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,T=document.activeElement;if(E&&T){const O=C.currentTarget,[A,k]=HT(O);A&&k?!C.shiftKey&&T===k?(C.preventDefault(),r&&Oo(A,{select:!0})):C.shiftKey&&T===A&&(C.preventDefault(),r&&Oo(k,{select:!0})):T===O&&C.preventDefault()}},[r,i,S.paused]);return v.jsx(Pe.div,{tabIndex:-1,...c,ref:b,onKeyDown:_})});yc.displayName=PT;function UT(e,{select:n=!1}={}){const r=document.activeElement;for(const i of e)if(Oo(i,{select:n}),document.activeElement!==r)return}function HT(e){const n=rx(e),r=sb(n,e),i=sb(n.reverse(),e);return[r,i]}function rx(e){const n=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)n.push(r.currentNode);return n}function sb(e,n){const r=typeof n.checkVisibility=="function"&&n.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(r?!i.checkVisibility({checkVisibilityCSS:!0}):BT(i,{upTo:n})))return i}function BT(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function qT(e){return e instanceof HTMLInputElement&&"select"in e}function Oo(e,{select:n=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&qT(e)&&n&&e.select()}}var lb=GT();function GT(){let e=[];return{add(n){const r=e[0];n!==r&&r?.pause(),e=ub(e,n),e.unshift(n)},remove(n){e=ub(e,n),e[0]?.resume()}}}function ub(e,n){const r=[...e],i=r.indexOf(n);return i!==-1&&r.splice(i,1),r}function ZT(e){return e.filter(n=>n.tagName!=="A")}var KT="Portal",rl=x.forwardRef((e,n)=>{const{container:r,...i}=e,[s,l]=x.useState(!1);Qt(()=>l(!0),[]);const c=r||s&&globalThis?.document?.body;return c?Si.createPortal(v.jsx(Pe.div,{...i,ref:n}),c):null});rl.displayName=KT;var Ru=0,ha=null;function Pm(){x.useEffect(()=>{ha||(ha={start:cb(),end:cb()});const{start:e,end:n}=ha;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==n&&document.body.insertAdjacentElement("beforeend",n),Ru++,()=>{Ru===1&&(ha?.start.remove(),ha?.end.remove(),ha=null),Ru=Math.max(0,Ru-1)}},[])}function cb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Er=function(){return Er=Object.assign||function(n){for(var r,i=1,s=arguments.length;i"u")return dO;var n=fO(e),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,i-r+n[2]-n[0])}},mO=sx(),Ea="data-scroll-locked",pO=function(e,n,r,i){var s=e.left,l=e.top,c=e.right,d=e.gap;return r===void 0&&(r="margin"),`
- .`.concat(QT,` {
- overflow: hidden `).concat(i,`;
- padding-right: `).concat(d,"px ").concat(i,`;
- }
- body[`).concat(Ea,`] {
- overflow: hidden `).concat(i,`;
- overscroll-behavior: contain;
- `).concat([n&&"position: relative ".concat(i,";"),r==="margin"&&`
- padding-left: `.concat(s,`px;
- padding-top: `).concat(l,`px;
- padding-right: `).concat(c,`px;
- margin-left:0;
- margin-top:0;
- margin-right: `).concat(d,"px ").concat(i,`;
- `),r==="padding"&&"padding-right: ".concat(d,"px ").concat(i,";")].filter(Boolean).join(""),`
- }
-
- .`).concat(Uu,` {
- right: `).concat(d,"px ").concat(i,`;
- }
-
- .`).concat(Hu,` {
- margin-right: `).concat(d,"px ").concat(i,`;
- }
-
- .`).concat(Uu," .").concat(Uu,` {
- right: 0 `).concat(i,`;
- }
-
- .`).concat(Hu," .").concat(Hu,` {
- margin-right: 0 `).concat(i,`;
- }
-
- body[`).concat(Ea,`] {
- `).concat(XT,": ").concat(d,`px;
- }
-`)},fb=function(){var e=parseInt(document.body.getAttribute(Ea)||"0",10);return isFinite(e)?e:0},gO=function(){x.useEffect(function(){return document.body.setAttribute(Ea,(fb()+1).toString()),function(){var e=fb()-1;e<=0?document.body.removeAttribute(Ea):document.body.setAttribute(Ea,e.toString())}},[])},vO=function(e){var n=e.noRelative,r=e.noImportant,i=e.gapMode,s=i===void 0?"margin":i;gO();var l=x.useMemo(function(){return hO(s)},[s]);return x.createElement(mO,{styles:pO(l,!n,s,r?"":"!important")})},nm=!1;if(typeof window<"u")try{var Tu=Object.defineProperty({},"passive",{get:function(){return nm=!0,!0}});window.addEventListener("test",Tu,Tu),window.removeEventListener("test",Tu,Tu)}catch{nm=!1}var ma=nm?{passive:!1}:!1,yO=function(e){return e.tagName==="TEXTAREA"},lx=function(e,n){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[n]!=="hidden"&&!(r.overflowY===r.overflowX&&!yO(e)&&r[n]==="visible")},bO=function(e){return lx(e,"overflowY")},SO=function(e){return lx(e,"overflowX")},hb=function(e,n){var r=n.ownerDocument,i=n;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var s=ux(e,i);if(s){var l=cx(e,i),c=l[1],d=l[2];if(c>d)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},xO=function(e){var n=e.scrollTop,r=e.scrollHeight,i=e.clientHeight;return[n,r,i]},wO=function(e){var n=e.scrollLeft,r=e.scrollWidth,i=e.clientWidth;return[n,r,i]},ux=function(e,n){return e==="v"?bO(n):SO(n)},cx=function(e,n){return e==="v"?xO(n):wO(n)},_O=function(e,n){return e==="h"&&n==="rtl"?-1:1},CO=function(e,n,r,i,s){var l=_O(e,window.getComputedStyle(n).direction),c=l*i,d=r.target,h=n.contains(d),m=!1,y=c>0,g=0,b=0;do{if(!d)break;var S=cx(e,d),_=S[0],C=S[1],E=S[2],T=C-E-l*_;(_||T)&&ux(e,d)&&(g+=T,b+=_);var O=d.parentNode;d=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!h&&d!==document.body||h&&(n.contains(d)||n===d));return(y&&Math.abs(g)<1||!y&&Math.abs(b)<1)&&(m=!0),m},Ou=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},mb=function(e){return[e.deltaX,e.deltaY]},pb=function(e){return e&&"current"in e?e.current:e},EO=function(e,n){return e[0]===n[0]&&e[1]===n[1]},RO=function(e){return`
- .block-interactivity-`.concat(e,` {pointer-events: none;}
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
-`)},TO=0,pa=[];function OO(e){var n=x.useRef([]),r=x.useRef([0,0]),i=x.useRef(),s=x.useState(TO++)[0],l=x.useState(sx)[0],c=x.useRef(e);x.useEffect(function(){c.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var C=YT([e.lockRef.current],(e.shards||[]).map(pb),!0).filter(Boolean);return C.forEach(function(E){return E.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),C.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var d=x.useCallback(function(C,E){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!c.current.allowPinchZoom;var T=Ou(C),O=r.current,A="deltaX"in C?C.deltaX:O[0]-T[0],k="deltaY"in C?C.deltaY:O[1]-T[1],L,q=C.target,H=Math.abs(A)>Math.abs(k)?"h":"v";if("touches"in C&&H==="h"&&q.type==="range")return!1;var $=window.getSelection(),he=$&&$.anchorNode,ve=he?he===q||he.contains(q):!1;if(ve)return!1;var de=hb(H,q);if(!de)return!0;if(de?L=H:(L=H==="v"?"h":"v",de=hb(H,q)),!de)return!1;if(!i.current&&"changedTouches"in C&&(A||k)&&(i.current=L),!L)return!0;var le=i.current||L;return CO(le,E,C,le==="h"?A:k)},[]),h=x.useCallback(function(C){var E=C;if(!(!pa.length||pa[pa.length-1]!==l)){var T="deltaY"in E?mb(E):Ou(E),O=n.current.filter(function(L){return L.name===E.type&&(L.target===E.target||E.target===L.shadowParent)&&EO(L.delta,T)})[0];if(O&&O.should){E.cancelable&&E.preventDefault();return}if(!O){var A=(c.current.shards||[]).map(pb).filter(Boolean).filter(function(L){return L.contains(E.target)}),k=A.length>0?d(E,A[0]):!c.current.noIsolation;k&&E.cancelable&&E.preventDefault()}}},[]),m=x.useCallback(function(C,E,T,O){var A={name:C,delta:E,target:T,should:O,shadowParent:AO(T)};n.current.push(A),setTimeout(function(){n.current=n.current.filter(function(k){return k!==A})},1)},[]),y=x.useCallback(function(C){r.current=Ou(C),i.current=void 0},[]),g=x.useCallback(function(C){m(C.type,mb(C),C.target,d(C,e.lockRef.current))},[]),b=x.useCallback(function(C){m(C.type,Ou(C),C.target,d(C,e.lockRef.current))},[]);x.useEffect(function(){return pa.push(l),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",h,ma),document.addEventListener("touchmove",h,ma),document.addEventListener("touchstart",y,ma),function(){pa=pa.filter(function(C){return C!==l}),document.removeEventListener("wheel",h,ma),document.removeEventListener("touchmove",h,ma),document.removeEventListener("touchstart",y,ma)}},[]);var S=e.removeScrollBar,_=e.inert;return x.createElement(x.Fragment,null,_?x.createElement(l,{styles:RO(s)}):null,S?x.createElement(vO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function AO(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const MO=oO(ax,OO);var Sc=x.forwardRef(function(e,n){return x.createElement(bc,Er({},e,{ref:n,sideCar:MO}))});Sc.classNames=bc.classNames;var jO=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},ga=new WeakMap,Au=new WeakMap,Mu={},xh=0,dx=function(e){return e&&(e.host||dx(e.parentNode))},zO=function(e,n){return n.map(function(r){if(e.contains(r))return r;var i=dx(r);return i&&e.contains(i)?i:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},DO=function(e,n,r,i){var s=zO(n,Array.isArray(e)?e:[e]);Mu[r]||(Mu[r]=new WeakMap);var l=Mu[r],c=[],d=new Set,h=new Set(s),m=function(g){!g||d.has(g)||(d.add(g),m(g.parentNode))};s.forEach(m);var y=function(g){!g||h.has(g)||Array.prototype.forEach.call(g.children,function(b){if(d.has(b))y(b);else try{var S=b.getAttribute(i),_=S!==null&&S!=="false",C=(ga.get(b)||0)+1,E=(l.get(b)||0)+1;ga.set(b,C),l.set(b,E),c.push(b),C===1&&_&&Au.set(b,!0),E===1&&b.setAttribute(r,"true"),_||b.setAttribute(i,"true")}catch(T){console.error("aria-hidden: cannot operate on ",b,T)}})};return y(n),d.clear(),xh++,function(){c.forEach(function(g){var b=ga.get(g)-1,S=l.get(g)-1;ga.set(g,b),l.set(g,S),b||(Au.has(g)||g.removeAttribute(i),Au.delete(g)),S||g.removeAttribute(r)}),xh--,xh||(ga=new WeakMap,ga=new WeakMap,Au=new WeakMap,Mu={})}},Um=function(e,n,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),s=jO(e);return s?(i.push.apply(i,Array.from(s.querySelectorAll("[aria-live], script"))),DO(i,s,r,"aria-hidden")):function(){return null}},xc="Dialog",[fx]=$o(xc),[NO,gr]=fx(xc),Hm=e=>{const{__scopeDialog:n,children:r,open:i,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,d=x.useRef(null),h=x.useRef(null),[m,y]=Ma({prop:i,defaultProp:s??!1,onChange:l,caller:xc});return v.jsx(NO,{scope:n,triggerRef:d,contentRef:h,contentId:hn(),titleId:hn(),descriptionId:hn(),open:m,onOpenChange:y,onOpenToggle:x.useCallback(()=>y(g=>!g),[y]),modal:c,children:r})};Hm.displayName=xc;var hx="DialogTrigger",kO=x.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,s=gr(hx,r),l=ot(n,s.triggerRef);return v.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Km(s.open),...i,ref:l,onClick:Re(e.onClick,s.onOpenToggle)})});kO.displayName=hx;var Bm="DialogPortal",[LO,mx]=fx(Bm,{forceMount:void 0}),qm=e=>{const{__scopeDialog:n,forceMount:r,children:i,container:s}=e,l=gr(Bm,n);return v.jsx(LO,{scope:n,forceMount:r,children:x.Children.map(i,c=>v.jsx(pr,{present:r||l.open,children:v.jsx(rl,{asChild:!0,container:s,children:c})}))})};qm.displayName=Bm;var Qu="DialogOverlay",Gm=x.forwardRef((e,n)=>{const r=mx(Qu,e.__scopeDialog),{forceMount:i=r.forceMount,...s}=e,l=gr(Qu,e.__scopeDialog);return l.modal?v.jsx(pr,{present:i||l.open,children:v.jsx($O,{...s,ref:n})}):null});Gm.displayName=Qu;var IO=hi("DialogOverlay.RemoveScroll"),$O=x.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,s=gr(Qu,r),l=IT(),c=ot(n,l);return v.jsx(Sc,{as:IO,allowPinchZoom:!0,shards:[s.contentRef],children:v.jsx(Pe.div,{"data-state":Km(s.open),...i,ref:c,style:{pointerEvents:"auto",...i.style}})})}),ja="DialogContent",Zm=x.forwardRef((e,n)=>{const r=mx(ja,e.__scopeDialog),{forceMount:i=r.forceMount,...s}=e,l=gr(ja,e.__scopeDialog);return v.jsx(pr,{present:i||l.open,children:l.modal?v.jsx(VO,{...s,ref:n}):v.jsx(FO,{...s,ref:n})})});Zm.displayName=ja;var VO=x.forwardRef((e,n)=>{const r=gr(ja,e.__scopeDialog),i=x.useRef(null),s=ot(n,r.contentRef,i);return x.useEffect(()=>{const l=i.current;if(l)return Um(l)},[]),v.jsx(px,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Re(e.onCloseAutoFocus,l=>{l.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,l=>l.preventDefault())})}),FO=x.forwardRef((e,n)=>{const r=gr(ja,e.__scopeDialog),i=x.useRef(!1),s=x.useRef(!1);return v.jsx(px,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{e.onCloseAutoFocus?.(l),l.defaultPrevented||(i.current||r.triggerRef.current?.focus(),l.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:l=>{e.onInteractOutside?.(l),l.defaultPrevented||(i.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;r.triggerRef.current?.contains(c)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),px=x.forwardRef((e,n)=>{const{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:l,...c}=e,d=gr(ja,r);return Pm(),v.jsx(v.Fragment,{children:v.jsx(yc,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:l,children:v.jsx(nl,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Km(d.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1)})})})}),gx="DialogTitle",vx=x.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,s=gr(gx,r);return v.jsx(Pe.h2,{id:s.titleId,...i,ref:n})});vx.displayName=gx;var yx="DialogDescription",PO=x.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,s=gr(yx,r);return v.jsx(Pe.p,{id:s.descriptionId,...i,ref:n})});PO.displayName=yx;var bx="DialogClose",Sx=x.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,s=gr(bx,r);return v.jsx(Pe.button,{type:"button",...i,ref:n,onClick:Re(e.onClick,()=>s.onOpenChange(!1))})});Sx.displayName=bx;function Km(e){return e?"open":"closed"}function UO(e){const n=x.useRef({value:e,previous:e});return x.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}function HO(e){const[n,r]=x.useState(void 0);return Qt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let c,d;if("borderBoxSize"in l){const h=l.borderBoxSize,m=Array.isArray(h)?h[0]:h;c=m.inlineSize,d=m.blockSize}else c=e.offsetWidth,d=e.offsetHeight;r({width:c,height:d})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else r(void 0)},[e]),n}const BO=["top","right","bottom","left"],Do=Math.min,Qr=Math.max,Xu=Math.round,ju=Math.floor,Xr=e=>({x:e,y:e}),qO={left:"right",right:"left",bottom:"top",top:"bottom"};function xx(e,n,r){return Qr(e,Do(n,r))}function Jr(e,n){return typeof e=="function"?e(n):e}function No(e){return e.split("-")[0]}function Da(e){return e.split("-")[1]}function Ym(e){return e==="x"?"y":"x"}function Qm(e){return e==="y"?"height":"width"}function Rr(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function Xm(e){return Ym(Rr(e))}function GO(e,n,r){r===void 0&&(r=!1);const i=Da(e),s=Xm(e),l=Qm(s);let c=s==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return n.reference[l]>n.floating[l]&&(c=Ju(c)),[c,Ju(c)]}function ZO(e){const n=Ju(e);return[rm(e),n,rm(n)]}function rm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const gb=["left","right"],vb=["right","left"],KO=["top","bottom"],YO=["bottom","top"];function QO(e,n,r){switch(e){case"top":case"bottom":return r?n?vb:gb:n?gb:vb;case"left":case"right":return n?KO:YO;default:return[]}}function XO(e,n,r,i){const s=Da(e);let l=QO(No(e),r==="start",i);return s&&(l=l.map(c=>c+"-"+s),n&&(l=l.concat(l.map(rm)))),l}function Ju(e){const n=No(e);return qO[n]+e.slice(n.length)}function JO(e){var n,r,i,s;return{top:(n=e.top)!=null?n:0,right:(r=e.right)!=null?r:0,bottom:(i=e.bottom)!=null?i:0,left:(s=e.left)!=null?s:0}}function wx(e){return typeof e!="number"?JO(e):{top:e,right:e,bottom:e,left:e}}function Wu(e){const{x:n,y:r,width:i,height:s}=e;return{width:i,height:s,top:r,left:n,right:n+i,bottom:r+s,x:n,y:r}}function yb(e,n,r){let{reference:i,floating:s}=e;const l=Rr(n),c=Xm(n),d=Qm(c),h=No(n),m=l==="y",y=i.x+i.width/2-s.width/2,g=i.y+i.height/2-s.height/2,b=i[d]/2-s[d]/2;let S;switch(h){case"top":S={x:y,y:i.y-s.height};break;case"bottom":S={x:y,y:i.y+i.height};break;case"right":S={x:i.x+i.width,y:g};break;case"left":S={x:i.x-s.width,y:g};break;default:S={x:i.x,y:i.y}}const _=Da(n);return _&&(S[c]+=b*(_==="end"?1:-1)*(r&&m?-1:1)),S}async function WO(e,n){var r;n===void 0&&(n={});const{x:i,y:s,platform:l,rects:c,elements:d,strategy:h}=e,{boundary:m="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:b=!1,padding:S=0}=Jr(n,e),_=wx(S),E=d[b?g==="floating"?"reference":"floating":g],T=Wu(await l.getClippingRect({element:(r=await(l.isElement==null?void 0:l.isElement(E)))==null||r?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:m,rootBoundary:y,strategy:h})),O=g==="floating"?{x:i,y:s,width:c.floating.width,height:c.floating.height}:c.reference,A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),k=await(l.isElement==null?void 0:l.isElement(A))&&await(l.getScale==null?void 0:l.getScale(A))||{x:1,y:1},L=Wu(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:O,offsetParent:A,strategy:h}):O);return{top:(T.top-L.top+_.top)/k.y,bottom:(L.bottom-T.bottom+_.bottom)/k.y,left:(T.left-L.left+_.left)/k.x,right:(L.right-T.right+_.right)/k.x}}const eA=50,tA=async(e,n,r)=>{const{placement:i="bottom",strategy:s="absolute",middleware:l=[],platform:c}=r,d=c.detectOverflow?c:{...c,detectOverflow:WO},h=await(c.isRTL==null?void 0:c.isRTL(n));let m=await c.getElementRects({reference:e,floating:n,strategy:s}),{x:y,y:g}=yb(m,i,h),b=i,S=0;const _={};for(let C=0;C({name:"arrow",options:e,async fn(n){const{x:r,y:i,placement:s,rects:l,platform:c,elements:d,middlewareData:h}=n,{element:m,padding:y=0}=Jr(e,n)||{};if(m==null)return{};const g=wx(y),b={x:r,y:i},S=Xm(s),_=Qm(S),C=await c.getDimensions(m),E=S==="y",T=E?"top":"left",O=E?"bottom":"right",A=E?"clientHeight":"clientWidth",k=l.reference[_]+l.reference[S]-b[S]-l.floating[_],L=b[S]-l.reference[S],q=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let H=q?q[A]:0;(!H||!await(c.isElement==null?void 0:c.isElement(q)))&&(H=d.floating[A]||l.floating[_]);const $=k/2-L/2,he=H/2-C[_]/2-1,ve=Do(g[T],he),de=Do(g[O],he),le=H-C[_]-de,ae=H/2-C[_]/2+$,me=xx(ve,ae,le),ye=!h.arrow&&Da(s)!=null&&ae!==me&&l.reference[_]/2-(aeme<=0)){var de,le;const me=(((de=l.flip)==null?void 0:de.index)||0)+1,ye=H[me];if(ye&&(!(g==="alignment"?O!==Rr(ye):!1)||ve.every(ne=>Rr(ne.placement)===O?ne.overflows[0]>0:!0)))return{data:{index:me,overflows:ve},reset:{placement:ye}};let N=(le=ve.filter(Y=>Y.overflows[0]<=0).sort((Y,ne)=>Y.overflows[1]-ne.overflows[1])[0])==null?void 0:le.placement;if(!N)switch(S){case"bestFit":{var ae;const Y=(ae=ve.filter(ne=>{if(q){const J=Rr(ne.placement);return J===O||J==="y"}return!0}).map(ne=>[ne.placement,ne.overflows.filter(J=>J>0).reduce((J,W)=>J+W,0)]).sort((ne,J)=>ne[1]-J[1])[0])==null?void 0:ae[0];Y&&(N=Y);break}case"initialPlacement":N=d;break}if(s!==N)return{reset:{placement:N}}}return{}}}};function bb(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function Sb(e){return BO.some(n=>e[n]>=0)}const oA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:r,platform:i}=n,{strategy:s="referenceHidden",...l}=Jr(e,n);switch(s){case"referenceHidden":{const c=await i.detectOverflow(n,{...l,elementContext:"reference"}),d=bb(c,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Sb(d)}}}case"escaped":{const c=await i.detectOverflow(n,{...l,altBoundary:!0}),d=bb(c,r.floating);return{data:{escapedOffsets:d,escaped:Sb(d)}}}default:return{}}}}},_x=new Set(["left","top"]);async function iA(e,n){const{placement:r,platform:i,elements:s}=e,l=await(i.isRTL==null?void 0:i.isRTL(s.floating)),c=No(r),d=Da(r),h=Rr(r)==="y",m=_x.has(c)?-1:1,y=l&&h?-1:1,g=Jr(n,e);let{mainAxis:b,crossAxis:S,alignmentAxis:_}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof _=="number"&&(S=d==="end"?_*-1:_),h?{x:S*y,y:b*m}:{x:b*m,y:S*y}}const aA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var r,i;const{x:s,y:l,placement:c,middlewareData:d}=n,h=await iA(n,e);return c===((r=d.offset)==null?void 0:r.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:s+h.x,y:l+h.y,data:{...h,placement:c}}}}},sA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:r,y:i,placement:s,platform:l}=n,{mainAxis:c=!0,crossAxis:d=!1,limiter:h={fn:O=>{let{x:A,y:k}=O;return{x:A,y:k}}},...m}=Jr(e,n),y={x:r,y:i},g=await l.detectOverflow(n,m),b=Rr(s),S=Ym(b);let _=y[S],C=y[b];const E=(O,A)=>xx(A+g[O==="y"?"top":"left"],A,A-g[O==="y"?"bottom":"right"]);c&&(_=E(S,_)),d&&(C=E(b,C));const T=h.fn({...n,[S]:_,[b]:C});return{...T,data:{x:T.x-r,y:T.y-i,enabled:{[S]:c,[b]:d}}}}}},lA=function(e){return e===void 0&&(e={}),{options:e,fn(n){var r,i;const{x:s,y:l,placement:c,rects:d,middlewareData:h}=n,{offset:m=0,mainAxis:y=!0,crossAxis:g=!0}=Jr(e,n),b={x:s,y:l},S=Rr(c),_=Ym(S);let C=b[_],E=b[S];const T=Jr(m,n),O=typeof T=="number"?{mainAxis:T,crossAxis:0}:{mainAxis:(r=T.mainAxis)!=null?r:0,crossAxis:(i=T.crossAxis)!=null?i:0};if(y){const L=_==="y"?"height":"width",q=d.reference[_]-d.floating[L]+O.mainAxis,H=d.reference[_]+d.reference[L]-O.mainAxis;CH&&(C=H)}if(g){var A,k;const L=_==="y"?"width":"height",q=_x.has(No(c)),H=d.reference[S]-d.floating[L]+(q&&((A=h.offset)==null?void 0:A[S])||0)+(q?0:O.crossAxis),$=d.reference[S]+d.reference[L]+(q?0:((k=h.offset)==null?void 0:k[S])||0)-(q?O.crossAxis:0);E$&&(E=$)}return{[_]:C,[S]:E}}}},uA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){const{placement:r,rects:i,platform:s,elements:l}=n,{apply:c=()=>{},...d}=Jr(e,n),h=await s.detectOverflow(n,d),m=No(r),y=Da(r),g=Rr(r)==="y",{width:b,height:S}=i.floating;let _,C;m==="top"||m==="bottom"?(_=m,C=y===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(C=m,_=y==="end"?"top":"bottom");const E=S-h.top-h.bottom,T=b-h.left-h.right,O=Do(S-h[_],E),A=Do(b-h[C],T),k=n.middlewareData.shift,L=!k;let q=O,H=A;k!=null&&k.enabled.x&&(H=T),k!=null&&k.enabled.y&&(q=E),L&&!y&&(g?H=b-2*Qr(h.left,h.right):q=S-2*Qr(h.top,h.bottom)),await c({...n,availableWidth:H,availableHeight:q});const $=await s.getDimensions(l.floating);return b!==$.width||S!==$.height?{reset:{rects:!0}}:{}}}};function wc(){return typeof window<"u"}function Na(e){return Cx(e)?(e.nodeName||"").toLowerCase():"#document"}function Mn(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Wr(e){var n;return(n=(Cx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function Cx(e){return wc()?e instanceof Node||e instanceof Mn(e).Node:!1}function Tr(e){return wc()?e instanceof Element||e instanceof Mn(e).Element:!1}function Vo(e){return wc()?e instanceof HTMLElement||e instanceof Mn(e).HTMLElement:!1}function xb(e){return!wc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mn(e).ShadowRoot}function _c(e){const{overflow:n,overflowX:r,overflowY:i,display:s}=Or(e);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&s!=="inline"&&s!=="contents"}function cA(e){return/^(table|td|th)$/.test(Na(e))}function Cc(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const dA=/transform|translate|scale|rotate|perspective|filter/,fA=/paint|layout|strict|content/,ui=e=>!!e&&e!=="none";let wh;function Jm(e){const n=Tr(e)?Or(e):e;return ui(n.transform)||ui(n.translate)||ui(n.scale)||ui(n.rotate)||ui(n.perspective)||!Wm()&&(ui(n.backdropFilter)||ui(n.filter))||dA.test(n.willChange||"")||fA.test(n.contain||"")}function hA(e){let n=mi(e);for(;Vo(n)&&!Hs(n);){if(Jm(n))return n;if(Cc(n))return null;n=mi(n)}return null}function Wm(){return wh==null&&(wh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),wh}function Hs(e){return/^(html|body|#document)$/.test(Na(e))}function Or(e){return Mn(e).getComputedStyle(e)}function Ec(e){return Tr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mi(e){if(Na(e)==="html")return e;const n=e.assignedSlot||e.parentNode||xb(e)&&e.host||Wr(e);return xb(n)?n.host:n}function Ex(e){const n=mi(e);return Hs(n)?(e.ownerDocument||e).body:Vo(n)&&_c(n)?n:Ex(n)}function Bs(e,n,r){var i;n===void 0&&(n=[]),r===void 0&&(r=!0);const s=Ex(e),l=s===((i=e.ownerDocument)==null?void 0:i.body),c=Mn(s);if(l){const d=om(c);return n.concat(c,c.visualViewport||[],_c(s)?s:[],d&&r?Bs(d):[])}else return n.concat(s,Bs(s,[],r))}function om(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Rx(e){const n=Or(e);let r=parseFloat(n.width)||0,i=parseFloat(n.height)||0;const s=Vo(e),l=s?e.offsetWidth:r,c=s?e.offsetHeight:i,d=Xu(r)!==l||Xu(i)!==c;return d&&(r=l,i=c),{width:r,height:i,$:d}}function ep(e){return Tr(e)?e:e.contextElement}function Ra(e){const n=ep(e);if(!Vo(n))return Xr(1);const r=n.getBoundingClientRect(),{width:i,height:s,$:l}=Rx(n);let c=(l?Xu(r.width):r.width)/i,d=(l?Xu(r.height):r.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const mA=Xr(0);function Tx(e){const n=Mn(e);return!Wm()||!n.visualViewport?mA:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function pA(e,n,r){return n===void 0&&(n=!1),!!r&&n&&r===Mn(e)}function pi(e,n,r,i){n===void 0&&(n=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),l=ep(e);let c=Xr(1);n&&(i?Tr(i)&&(c=Ra(i)):c=Ra(e));const d=pA(l,r,i)?Tx(l):Xr(0);let h=(s.left+d.x)/c.x,m=(s.top+d.y)/c.y,y=s.width/c.x,g=s.height/c.y;if(l&&i){const b=Mn(l),S=Tr(i)?Mn(i):i;let _=b,C=om(_);for(;C&&S!==_;){const E=Ra(C),T=C.getBoundingClientRect(),O=Or(C),A=T.left+(C.clientLeft+parseFloat(O.paddingLeft))*E.x,k=T.top+(C.clientTop+parseFloat(O.paddingTop))*E.y;h*=E.x,m*=E.y,y*=E.x,g*=E.y,h+=A,m+=k,_=Mn(C),C=om(_)}}return Wu({width:y,height:g,x:h,y:m})}function Rc(e,n){const r=Ec(e).scrollLeft;return n?n.left+r:pi(Wr(e)).left+r}function Ox(e,n){const r=e.getBoundingClientRect(),i=r.left+n.scrollLeft-Rc(e,r),s=r.top+n.scrollTop;return{x:i,y:s}}function gA(e){let{elements:n,rect:r,offsetParent:i,strategy:s}=e;const l=s==="fixed",c=Wr(i),d=n?Cc(n.floating):!1;if(i===c||d&&l)return r;let h={scrollLeft:0,scrollTop:0},m=Xr(1);const y=Xr(0),g=Vo(i);if((g||!l)&&((Na(i)!=="body"||_c(c))&&(h=Ec(i)),g)){const S=pi(i);m=Ra(i),y.x=S.x+i.clientLeft,y.y=S.y+i.clientTop}const b=c&&!g&&!l?Ox(c,h):Xr(0);return{width:r.width*m.x,height:r.height*m.y,x:r.x*m.x-h.scrollLeft*m.x+y.x+b.x,y:r.y*m.y-h.scrollTop*m.y+y.y+b.y}}function vA(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function yA(e){const n=Ec(e),r=e.ownerDocument.body,i=Qr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Qr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Rc(e);const c=-n.scrollTop;return Or(r).direction==="rtl"&&(l+=Qr(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:l,y:c}}const bA=25;function SA(e,n,r){r===void 0&&(r="viewport");const i=r==="layoutViewport",s=Mn(e),l=Wr(e),c=s.visualViewport;let d=l.clientWidth,h=l.clientHeight,m=0,y=0;if(c){const b=!Wm()||n==="fixed";i?b||(m=-c.offsetLeft,y=-c.offsetTop):(d=c.width,h=c.height,b&&(m=c.offsetLeft,y=c.offsetTop))}if(Rc(l)<=0){const b=l.ownerDocument,S=b.body,_=getComputedStyle(S),C=b.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,E=Math.abs(l.clientWidth-S.clientWidth-C),T=getComputedStyle(l).scrollbarGutter==="stable both-edges"?E/2:E;T<=bA&&(d-=T)}return{width:d,height:h,x:m,y}}function xA(e,n){const r=pi(e,!0,n==="fixed"),i=r.top+e.clientTop,s=r.left+e.clientLeft,l=Ra(e),c=e.clientWidth*l.x,d=e.clientHeight*l.y,h=s*l.x,m=i*l.y;return{width:c,height:d,x:h,y:m}}function wb(e,n,r){let i;if(n==="viewport"||n==="layoutViewport")i=SA(e,r,n);else if(n==="document")i=yA(Wr(e));else if(Tr(n))i=xA(n,r);else{const s=Tx(e);i={x:n.x-s.x,y:n.y-s.y,width:n.width,height:n.height}}return Wu(i)}function wA(e,n){const r=n.get(e);if(r)return r;let i=Bs(e,[],!1).filter(d=>Tr(d)&&Na(d)!=="body"),s=null;const l=Or(e).position==="fixed";let c=l?mi(e):e;for(;Tr(c)&&!Hs(c);){const d=Or(c),h=Jm(c),m=s?s.position:l?"fixed":"";!h&&(m==="fixed"||m==="absolute"&&d.position==="static")?i=i.filter(g=>g!==c):s=d,c=mi(c)}return n.set(e,i),i}function _A(e){let{element:n,boundary:r,rootBoundary:i,strategy:s}=e;const c=[...r==="clippingAncestors"?Cc(n)?[]:wA(n,this._c):[].concat(r),i],d=wb(n,c[0],s);let h=d.top,m=d.right,y=d.bottom,g=d.left;for(let b=1;b{d(!1,1e-7)},1e3)}H=!1}try{i=new IntersectionObserver($,{...q,root:l.ownerDocument})}catch{i=new IntersectionObserver($,q)}i.observe(e)}const h=Mn(e),m=()=>d(r);return h.addEventListener("resize",m),d(!0),()=>{h.removeEventListener("resize",m),c()}}function MA(e,n,r,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:h=!1}=i,m=ep(e),y=s||l?[...m?Bs(m):[],...n?Bs(n):[]]:[];y.forEach(T=>{s&&T.addEventListener("scroll",r),l&&T.addEventListener("resize",r)});const g=m&&d?AA(m,r,l):null;let b=-1,S=null;c&&(S=new ResizeObserver(T=>{let[O]=T;O&&O.target===m&&S&&n&&(S.unobserve(n),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=S)==null||A.observe(n)})),r()}),m&&!h&&S.observe(m),n&&S.observe(n));let _,C=h?pi(e):null;h&&E();function E(){const T=pi(e);C&&!Mx(C,T)&&r(),C=T,_=requestAnimationFrame(E)}return r(),()=>{var T;y.forEach(O=>{s&&O.removeEventListener("scroll",r),l&&O.removeEventListener("resize",r)}),g?.(),(T=S)==null||T.disconnect(),S=null,h&&cancelAnimationFrame(_)}}const jA=aA,zA=sA,DA=rA,NA=uA,kA=oA,Cb=nA,LA=lA,IA=(e,n,r)=>{const i=new Map,s=r??{},l={...OA,...s.platform,_c:i};return tA(e,n,{...s,platform:l})};var $A=typeof document<"u",VA=function(){},Bu=$A?x.useLayoutEffect:VA;function ec(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let r,i,s;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==n.length)return!1;for(i=r;i--!==0;)if(!ec(e[i],n[i]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){const l=s[i];if(!(l==="_owner"&&e.$$typeof)&&!ec(e[l],n[l]))return!1}return!0}return e!==e&&n!==n}function jx(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Eb(e,n){const r=jx(e);return Math.round(n*r)/r}function Ch(e){const n=x.useRef(e);return Bu(()=>{n.current=e}),n}function FA(e){e===void 0&&(e={});const{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:s,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:h,open:m}=e,[y,g]=x.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[b,S]=x.useState(i);ec(b,i)||S(i);const[_,C]=x.useState(null),[E,T]=x.useState(null),O=x.useCallback(ne=>{ne!==q.current&&(q.current=ne,C(ne))},[]),A=x.useCallback(ne=>{ne!==H.current&&(H.current=ne,T(ne))},[]),k=l||_,L=c||E,q=x.useRef(null),H=x.useRef(null),$=x.useRef(y),he=h!=null,ve=Ch(h),de=Ch(s),le=Ch(m),ae=x.useCallback(()=>{if(!q.current||!H.current)return;const ne={placement:n,strategy:r,middleware:b};de.current&&(ne.platform=de.current),IA(q.current,H.current,ne).then(J=>{const W={...J,isPositioned:le.current!==!1};me.current&&!ec($.current,W)&&($.current=W,Si.flushSync(()=>{g(W)}))})},[b,n,r,de,le]);Bu(()=>{m===!1&&$.current.isPositioned&&($.current.isPositioned=!1,g(ne=>({...ne,isPositioned:!1})))},[m]);const me=x.useRef(!1);Bu(()=>(me.current=!0,()=>{me.current=!1}),[]),Bu(()=>{if(k&&(q.current=k),L&&(H.current=L),k&&L){if(ve.current)return ve.current(k,L,ae);ae()}},[k,L,ae,ve,he]);const ye=x.useMemo(()=>({reference:q,floating:H,setReference:O,setFloating:A}),[O,A]),N=x.useMemo(()=>({reference:k,floating:L}),[k,L]),Y=x.useMemo(()=>{const ne={position:r,left:0,top:0};if(!N.floating)return ne;const J=Eb(N.floating,y.x),W=Eb(N.floating,y.y);return d?{...ne,transform:"translate("+J+"px, "+W+"px)",...jx(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:J,top:W}},[r,d,N.floating,y.x,y.y]);return x.useMemo(()=>({...y,update:ae,refs:ye,elements:N,floatingStyles:Y}),[y,ae,ye,N,Y])}const PA=e=>{function n(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:i,padding:s}=typeof e=="function"?e(r):e;return i&&n(i)?i.current!=null?Cb({element:i.current,padding:s}).fn(r):{}:i?Cb({element:i,padding:s}).fn(r):{}}}},UA=(e,n)=>{const r=jA(e);return{name:r.name,fn:r.fn,options:[e,n]}},HA=(e,n)=>{const r=zA(e);return{name:r.name,fn:r.fn,options:[e,n]}},BA=(e,n)=>({fn:LA(e).fn,options:[e,n]}),qA=(e,n)=>{const r=DA(e);return{name:r.name,fn:r.fn,options:[e,n]}},GA=(e,n)=>{const r=NA(e);return{name:r.name,fn:r.fn,options:[e,n]}},ZA=(e,n)=>{const r=kA(e);return{name:r.name,fn:r.fn,options:[e,n]}},KA=(e,n)=>{const r=PA(e);return{name:r.name,fn:r.fn,options:[e,n]}};var YA="Arrow",zx=x.forwardRef((e,n)=>{const{children:r,width:i=10,height:s=5,...l}=e;return v.jsx(Pe.svg,{...l,ref:n,width:i,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});zx.displayName=YA;var QA=zx,tp="Popper",[Dx,ka]=$o(tp),[XA,Nx]=Dx(tp),kx=e=>{const{__scopePopper:n,children:r}=e,[i,s]=x.useState(null),[l,c]=x.useState(void 0);return v.jsx(XA,{scope:n,anchor:i,onAnchorChange:s,placementState:l,setPlacementState:c,children:r})};kx.displayName=tp;var Lx="PopperAnchor",Ix=x.forwardRef((e,n)=>{const{__scopePopper:r,virtualRef:i,...s}=e,l=Nx(Lx,r),c=x.useRef(null),d=l.onAnchorChange,h=x.useCallback(_=>{c.current=_,_&&d(_)},[d]),m=ot(n,h),y=x.useRef(null);x.useEffect(()=>{if(!i)return;const _=y.current;y.current=i.current,_!==y.current&&d(y.current)});const g=l.placementState&&rp(l.placementState),b=g?.[0],S=g?.[1];return i?null:v.jsx(Pe.div,{"data-radix-popper-side":b,"data-radix-popper-align":S,...s,ref:m})});Ix.displayName=Lx;var np="PopperContent",[JA,WA]=Dx(np),$x=x.forwardRef((e,n)=>{const{__scopePopper:r,side:i="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:h=!0,collisionBoundary:m=[],collisionPadding:y=0,sticky:g="partial",hideWhenDetached:b=!1,updatePositionStrategy:S="optimized",onPlaced:_,...C}=e,E=Nx(np,r),[T,O]=x.useState(null),A=ot(n,O),[k,L]=x.useState(null),q=HO(k),H=q?.width??0,$=q?.height??0,he=i+(l!=="center"?"-"+l:""),ve=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},de=Array.isArray(m)?m:[m],le=de.length>0,ae={padding:ve,boundary:de.filter(tM),altBoundary:le},{refs:me,floatingStyles:ye,placement:N,isPositioned:Y,middlewareData:ne}=FA({strategy:"fixed",placement:he,whileElementsMounted:(...ge)=>MA(...ge,{animationFrame:S==="always"}),elements:{reference:E.anchor},middleware:[UA({mainAxis:s+$,alignmentAxis:c}),h&&HA({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?BA():void 0,...ae}),h&&qA({...ae}),GA({...ae,apply:({elements:ge,rects:be,availableWidth:De,availableHeight:Ie})=>{const{width:Fe,height:st}=be.reference,Qe=ge.floating.style;Qe.setProperty("--radix-popper-available-width",`${De}px`),Qe.setProperty("--radix-popper-available-height",`${Ie}px`),Qe.setProperty("--radix-popper-anchor-width",`${Fe}px`),Qe.setProperty("--radix-popper-anchor-height",`${st}px`)}}),k&&KA({element:k,padding:d}),nM({arrowWidth:H,arrowHeight:$}),b&&ZA({strategy:"referenceHidden",...ae,boundary:le?ae.boundary:void 0})]}),J=E.setPlacementState;Qt(()=>(J(N),()=>{J(void 0)}),[N,J]);const[W,z]=rp(N),j=tr(_);Qt(()=>{Y&&j?.()},[Y,j]);const U=ne.arrow?.x,Q=ne.arrow?.y,Z=ne.arrow?.centerOffset!==0,[re,ee]=x.useState();return Qt(()=>{T&&ee(window.getComputedStyle(T).zIndex)},[T]),v.jsx("div",{ref:me.setFloating,"data-radix-popper-content-wrapper":"",style:{...ye,transform:Y?ye.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[ne.transformOrigin?.x,ne.transformOrigin?.y].join(" "),...ne.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(JA,{scope:r,placedSide:W,placedAlign:z,onArrowChange:L,arrowX:U,arrowY:Q,shouldHideArrow:Z,children:v.jsx(Pe.div,{"data-side":W,"data-align":z,...C,ref:A,style:{...C.style,animation:Y?void 0:"none"}})})})});$x.displayName=np;var Vx="PopperArrow",eM={top:"bottom",right:"left",bottom:"top",left:"right"},Fx=x.forwardRef(function(n,r){const{__scopePopper:i,...s}=n,l=WA(Vx,i),c=eM[l.placedSide];return v.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:v.jsx(QA,{...s,ref:r,style:{...s.style,display:"block"}})})});Fx.displayName=Vx;function tM(e){return e!==null}var nM=e=>({name:"transformOrigin",options:e,fn(n){const{placement:r,rects:i,middlewareData:s}=n,c=s.arrow?.centerOffset!==0,d=c?0:e.arrowWidth,h=c?0:e.arrowHeight,[m,y]=rp(r),g={start:"0%",center:"50%",end:"100%"}[y],b=(s.arrow?.x??0)+d/2,S=(s.arrow?.y??0)+h/2;let _="",C="";return m==="bottom"?(_=c?g:`${b}px`,C=`${-h}px`):m==="top"?(_=c?g:`${b}px`,C=`${i.floating.height+h}px`):m==="right"?(_=`${-h}px`,C=c?g:`${S}px`):m==="left"&&(_=`${i.floating.width+h}px`,C=c?g:`${S}px`),{data:{x:_,y:C}}}});function rp(e){const[n,r="center"]=e.split("-");return[n,r]}var op=kx,ip=Ix,ap=$x,sp=Fx,Eh=!1;function rM(){const[e,n]=x.useState(Eh);return x.useEffect(()=>{Eh||(Eh=!0,n(!0))},[]),e}var Px=vc[" useSyncExternalStore ".trim().toString()];function oM(){return()=>{}}function iM(){return Px(oM,()=>!0,()=>!1)}var aM=typeof Px=="function"?iM:rM,Rh="rovingFocusGroup.onEntryFocus",sM={bubbles:!1,cancelable:!0},ol="RovingFocusGroup",[im,Ux,lM]=$m(ol),[uM,Hx]=$o(ol,[lM]),[cM,dM]=uM(ol),Bx=x.forwardRef((e,n)=>v.jsx(im.Provider,{scope:e.__scopeRovingFocusGroup,children:v.jsx(im.Slot,{scope:e.__scopeRovingFocusGroup,children:v.jsx(fM,{...e,ref:n})})}));Bx.displayName=ol;var fM=x.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:r,orientation:i,loop:s=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:h,onEntryFocus:m,preventScrollOnEntryFocus:y=!1,...g}=e,b=x.useRef(null),S=ot(n,b),_=Vm(l),[C,E]=Ma({prop:c,defaultProp:d??null,onChange:h,caller:ol}),[T,O]=x.useState(!1),A=tr(m),k=Ux(r),L=x.useRef(!1),[q,H]=x.useState(0);return x.useEffect(()=>{const $=b.current;if($)return $.addEventListener(Rh,A),()=>$.removeEventListener(Rh,A)},[A]),v.jsx(cM,{scope:r,orientation:i,dir:_,loop:s,currentTabStopId:C,onItemFocus:x.useCallback($=>E($),[E]),onItemShiftTab:x.useCallback(()=>O(!0),[]),onFocusableItemAdd:x.useCallback(()=>H($=>$+1),[]),onFocusableItemRemove:x.useCallback(()=>H($=>$-1),[]),children:v.jsx(Pe.div,{tabIndex:T||q===0?-1:0,"data-orientation":i,...g,ref:S,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{L.current=!0}),onFocus:Re(e.onFocus,$=>{const he=!L.current;if($.target===$.currentTarget&&he&&!T){const ve=new CustomEvent(Rh,sM);if($.currentTarget.dispatchEvent(ve),!ve.defaultPrevented){const de=k().filter(N=>N.focusable),le=de.find(N=>N.active),ae=de.find(N=>N.id===C),ye=[le,ae,...de].filter(Boolean).map(N=>N.ref.current);Zx(ye,y)}}L.current=!1}),onBlur:Re(e.onBlur,()=>O(!1))})})}),qx="RovingFocusGroupItem",Gx=x.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:i=!0,active:s=!1,tabStopId:l,children:c,...d}=e,h=hn(),m=l||h,y=dM(qx,r),g=y.currentTabStopId===m,b=Ux(r),{onFocusableItemAdd:S,onFocusableItemRemove:_,currentTabStopId:C}=y,E=aM();return Qt(()=>{if(!(!E||!i))return S(),()=>_()},[E,i,S,_]),x.useEffect(()=>{if(!(E||!i))return S(),()=>_()},[E,i,S,_]),v.jsx(im.ItemSlot,{scope:r,id:m,focusable:i,active:s,children:v.jsx(Pe.span,{tabIndex:g?0:-1,"data-orientation":y.orientation,...d,ref:n,onMouseDown:Re(e.onMouseDown,T=>{i?y.onItemFocus(m):T.preventDefault()}),onFocus:Re(e.onFocus,()=>y.onItemFocus(m)),onKeyDown:Re(e.onKeyDown,T=>{if(T.key==="Tab"&&T.shiftKey){y.onItemShiftTab();return}if(T.target!==T.currentTarget)return;const O=pM(T,y.orientation,y.dir);if(O!==void 0){if(T.metaKey||T.ctrlKey||T.altKey||T.shiftKey)return;T.preventDefault();let k=b().filter(L=>L.focusable).map(L=>L.ref.current);if(O==="last")k.reverse();else if(O==="prev"||O==="next"){O==="prev"&&k.reverse();const L=k.indexOf(T.currentTarget);k=y.loop?gM(k,L+1):k.slice(L+1)}setTimeout(()=>Zx(k))}}),children:typeof c=="function"?c({isCurrentTabStop:g,hasTabStop:C!=null}):c})})});Gx.displayName=qx;var hM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mM(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function pM(e,n,r){const i=mM(e.key,r);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return hM[i]}function Zx(e,n=!1){const r=document.activeElement;for(const i of e)if(i===r||(i.focus({preventScroll:n}),document.activeElement!==r))return}function gM(e,n){return e.map((r,i)=>e[(n+i)%e.length])}var vM=Bx,yM=Gx,am=["Enter"," "],bM=["ArrowDown","PageUp","Home"],Kx=["ArrowUp","PageDown","End"],SM=[...bM,...Kx],xM={ltr:[...am,"ArrowRight"],rtl:[...am,"ArrowLeft"]},wM={ltr:["ArrowLeft"],rtl:["ArrowRight"]},il="Menu",[qs,_M,CM]=$m(il),[xi,Yx]=$o(il,[CM,ka,Hx]),Tc=ka(),Qx=Hx(),[EM,wi]=xi(il),[RM,al]=xi(il),Xx=e=>{const{__scopeMenu:n,open:r=!1,children:i,dir:s,onOpenChange:l,modal:c=!0}=e,d=Tc(n),[h,m]=x.useState(null),y=x.useRef(!1),g=tr(l),b=Vm(s);return x.useEffect(()=>{const S=()=>{y.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},_=()=>y.current=!1;return document.addEventListener("keydown",S,{capture:!0}),()=>{document.removeEventListener("keydown",S,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),x.useEffect(()=>{if(!r)return;const S=()=>g(!1);return window.addEventListener("blur",S),()=>window.removeEventListener("blur",S)},[r,g]),v.jsx(op,{...d,children:v.jsx(EM,{scope:n,open:r,onOpenChange:g,content:h,onContentChange:m,children:v.jsx(RM,{scope:n,onClose:x.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:y,dir:b,modal:c,children:i})})})};Xx.displayName=il;var TM="MenuAnchor",lp=x.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e,s=Tc(r);return v.jsx(ip,{...s,...i,ref:n})});lp.displayName=TM;var up="MenuPortal",[OM,Jx]=xi(up,{forceMount:void 0}),Wx=e=>{const{__scopeMenu:n,forceMount:r,children:i,container:s}=e,l=wi(up,n);return v.jsx(OM,{scope:n,forceMount:r,children:v.jsx(pr,{present:r||l.open,children:v.jsx(rl,{asChild:!0,container:s,children:i})})})};Wx.displayName=up;var er="MenuContent",[AM,cp]=xi(er),ew=x.forwardRef((e,n)=>{const r=Jx(er,e.__scopeMenu),{forceMount:i=r.forceMount,...s}=e,l=wi(er,e.__scopeMenu),c=al(er,e.__scopeMenu);return v.jsx(qs.Provider,{scope:e.__scopeMenu,children:v.jsx(pr,{present:i||l.open,children:v.jsx(qs.Slot,{scope:e.__scopeMenu,children:c.modal?v.jsx(MM,{...s,ref:n}):v.jsx(jM,{...s,ref:n})})})})}),MM=x.forwardRef((e,n)=>{const r=wi(er,e.__scopeMenu),i=x.useRef(null),s=ot(n,i);return x.useEffect(()=>{const l=i.current;if(l)return Um(l)},[]),v.jsx(dp,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),jM=x.forwardRef((e,n)=>{const r=wi(er,e.__scopeMenu);return v.jsx(dp,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),zM=hi("MenuContent.ScrollLock"),dp=x.forwardRef((e,n)=>{const{__scopeMenu:r,loop:i=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEntryFocus:h,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:b,onDismiss:S,disableOutsideScroll:_,...C}=e,E=wi(er,r),T=al(er,r),O=Tc(r),A=Qx(r),k=_M(r),[L,q]=x.useState(null),H=x.useRef(null),$=ot(n,H,E.onContentChange),he=x.useRef(0),ve=x.useRef(""),de=x.useRef(0),le=x.useRef(null),ae=x.useRef("right"),me=x.useRef(0),ye=_?Sc:x.Fragment,N=_?{as:zM,allowPinchZoom:!0}:void 0,Y=J=>{const W=ve.current+J,z=k().filter(ee=>!ee.disabled),j=document.activeElement,U=z.find(ee=>ee.ref.current===j)?.textValue,Q=z.map(ee=>ee.textValue),Z=BM(Q,W,U),re=z.find(ee=>ee.textValue===Z)?.ref.current;(function ee(ge){ve.current=ge,window.clearTimeout(he.current),ge!==""&&(he.current=window.setTimeout(()=>ee(""),1e3))})(W),re&&setTimeout(()=>re.focus())};x.useEffect(()=>()=>window.clearTimeout(he.current),[]),Pm();const ne=x.useCallback(J=>ae.current===le.current?.side&&GM(J,le.current?.area),[]);return v.jsx(AM,{scope:r,searchRef:ve,onItemEnter:x.useCallback(J=>{ne(J)&&J.preventDefault()},[ne]),onItemLeave:x.useCallback(J=>{ne(J)||(H.current?.focus(),q(null))},[ne]),onTriggerLeave:x.useCallback(J=>{ne(J)&&J.preventDefault()},[ne]),pointerGraceTimerRef:de,onPointerGraceIntentChange:x.useCallback(J=>{le.current=J},[]),children:v.jsx(ye,{...N,children:v.jsx(yc,{asChild:!0,trapped:s,onMountAutoFocus:Re(l,J=>{J.preventDefault(),H.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:v.jsx(nl,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:b,onDismiss:S,children:v.jsx(vM,{asChild:!0,...A,dir:T.dir,orientation:"vertical",loop:i,currentTabStopId:L,onCurrentTabStopIdChange:q,onEntryFocus:Re(h,J=>{T.isUsingKeyboardRef.current||J.preventDefault()}),preventScrollOnEntryFocus:!0,children:v.jsx(ap,{role:"menu","aria-orientation":"vertical","data-state":gw(E.open),"data-radix-menu-content":"",dir:T.dir,...O,...C,ref:$,style:{outline:"none",...C.style},onKeyDown:Re(C.onKeyDown,J=>{const z=J.target.closest("[data-radix-menu-content]")===J.currentTarget,j=J.ctrlKey||J.altKey||J.metaKey,U=J.key.length===1;z&&(J.key==="Tab"&&J.preventDefault(),!j&&U&&Y(J.key));const Q=H.current;if(J.target!==Q||!SM.includes(J.key))return;J.preventDefault();const re=k().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);Kx.includes(J.key)&&re.reverse(),UM(re)}),onBlur:Re(e.onBlur,J=>{J.currentTarget.contains(J.target)||(window.clearTimeout(he.current),ve.current="")}),onPointerMove:Re(e.onPointerMove,Gs(J=>{const W=J.target,z=me.current!==J.clientX;if(J.currentTarget.contains(W)&&z){const j=J.clientX>me.current?"right":"left";ae.current=j,me.current=J.clientX}}))})})})})})})});ew.displayName=er;var DM="MenuGroup",fp=x.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e;return v.jsx(Pe.div,{role:"group",...i,ref:n})});fp.displayName=DM;var NM="MenuLabel",tw=x.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e;return v.jsx(Pe.div,{...i,ref:n})});tw.displayName=NM;var tc="MenuItem",Rb="menu.itemSelect",Oc=x.forwardRef((e,n)=>{const{disabled:r=!1,onSelect:i,...s}=e,l=x.useRef(null),c=al(tc,e.__scopeMenu),d=cp(tc,e.__scopeMenu),h=ot(n,l),m=x.useRef(!1),y=()=>{const g=l.current;if(!r&&g){const b=new CustomEvent(Rb,{bubbles:!0,cancelable:!0});g.addEventListener(Rb,S=>i?.(S),{once:!0}),WS(g,b),b.defaultPrevented?m.current=!1:c.onClose()}};return v.jsx(nw,{...s,ref:h,disabled:r,onClick:Re(e.onClick,y),onPointerDown:g=>{e.onPointerDown?.(g),m.current=!0},onPointerUp:Re(e.onPointerUp,g=>{m.current||g.currentTarget?.click()}),onKeyDown:Re(e.onKeyDown,g=>{r||g.target!==g.currentTarget||d.searchRef.current!==""&&g.key===" "||am.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});Oc.displayName=tc;var nw=x.forwardRef((e,n)=>{const{__scopeMenu:r,disabled:i=!1,textValue:s,...l}=e,c=cp(tc,r),d=Qx(r),h=x.useRef(null),m=ot(n,h),[y,g]=x.useState(!1),[b,S]=x.useState("");return x.useEffect(()=>{const _=h.current;_&&S((_.textContent??"").trim())},[l.children]),v.jsx(qs.ItemSlot,{scope:r,disabled:i,textValue:s??b,children:v.jsx(yM,{asChild:!0,...d,focusable:!i,children:v.jsx(Pe.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...l,ref:m,onPointerMove:Re(e.onPointerMove,Gs(_=>{i?c.onItemLeave(_):(c.onItemEnter(_),_.defaultPrevented||_.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,Gs(_=>c.onItemLeave(_))),onFocus:Re(e.onFocus,()=>g(!0)),onBlur:Re(e.onBlur,()=>g(!1))})})})}),kM="MenuCheckboxItem",rw=x.forwardRef((e,n)=>{const{checked:r=!1,onCheckedChange:i,...s}=e;return v.jsx(lw,{scope:e.__scopeMenu,checked:r,children:v.jsx(Oc,{role:"menuitemcheckbox","aria-checked":nc(r)?"mixed":r,...s,ref:n,"data-state":mp(r),onSelect:Re(s.onSelect,()=>i?.(nc(r)?!0:!r),{checkForDefaultPrevented:!1})})})});rw.displayName=kM;var ow="MenuRadioGroup",[LM,IM]=xi(ow,{value:void 0,onValueChange:()=>{}}),iw=x.forwardRef((e,n)=>{const{value:r,onValueChange:i,...s}=e,l=tr(i);return v.jsx(LM,{scope:e.__scopeMenu,value:r,onValueChange:l,children:v.jsx(fp,{...s,ref:n})})});iw.displayName=ow;var aw="MenuRadioItem",sw=x.forwardRef((e,n)=>{const{value:r,...i}=e,s=IM(aw,e.__scopeMenu),l=r===s.value;return v.jsx(lw,{scope:e.__scopeMenu,checked:l,children:v.jsx(Oc,{role:"menuitemradio","aria-checked":l,...i,ref:n,"data-state":mp(l),onSelect:Re(i.onSelect,()=>s.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});sw.displayName=aw;var hp="MenuItemIndicator",[lw,$M]=xi(hp,{checked:!1}),uw=x.forwardRef((e,n)=>{const{__scopeMenu:r,forceMount:i,...s}=e,l=$M(hp,r);return v.jsx(pr,{present:i||nc(l.checked)||l.checked===!0,children:v.jsx(Pe.span,{...s,ref:n,"data-state":mp(l.checked)})})});uw.displayName=hp;var VM="MenuSeparator",cw=x.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e;return v.jsx(Pe.div,{role:"separator","aria-orientation":"horizontal",...i,ref:n})});cw.displayName=VM;var FM="MenuArrow",dw=x.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e,s=Tc(r);return v.jsx(sp,{...s,...i,ref:n})});dw.displayName=FM;var PM="MenuSub",[v$,fw]=xi(PM),Ns="MenuSubTrigger",hw=x.forwardRef((e,n)=>{const r=wi(Ns,e.__scopeMenu),i=al(Ns,e.__scopeMenu),s=fw(Ns,e.__scopeMenu),l=cp(Ns,e.__scopeMenu),c=x.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:h}=l,m={__scopeMenu:e.__scopeMenu},y=x.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);x.useEffect(()=>y,[y]),x.useEffect(()=>{const b=d.current;return()=>{window.clearTimeout(b),h(null)}},[d,h]);const g=ot(n,s.onTriggerChange);return v.jsx(lp,{asChild:!0,...m,children:v.jsx(nw,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":gw(r.open),...e,ref:g,onClick:b=>{e.onClick?.(b),!(e.disabled||b.defaultPrevented)&&(b.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,Gs(b=>{l.onItemEnter(b),!b.defaultPrevented&&!e.disabled&&!r.open&&!c.current&&(l.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{r.onOpenChange(!0),y()},100))})),onPointerLeave:Re(e.onPointerLeave,Gs(b=>{y();const S=r.content?.getBoundingClientRect();if(S){const _=r.content?.dataset.side,C=_==="right",E=C?-5:5,T=S[C?"left":"right"],O=S[C?"right":"left"];l.onPointerGraceIntentChange({area:[{x:b.clientX+E,y:b.clientY},{x:T,y:S.top},{x:O,y:S.top},{x:O,y:S.bottom},{x:T,y:S.bottom}],side:_}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(b),b.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Re(e.onKeyDown,b=>{e.disabled||b.target!==b.currentTarget||l.searchRef.current!==""&&b.key===" "||xM[i.dir].includes(b.key)&&(r.onOpenChange(!0),r.content?.focus(),b.preventDefault())})})})});hw.displayName=Ns;var mw="MenuSubContent",pw=x.forwardRef((e,n)=>{const r=Jx(er,e.__scopeMenu),{forceMount:i=r.forceMount,align:s="start",...l}=e,c=wi(er,e.__scopeMenu),d=al(er,e.__scopeMenu),h=fw(mw,e.__scopeMenu),m=x.useRef(null),y=ot(n,m);return v.jsx(qs.Provider,{scope:e.__scopeMenu,children:v.jsx(pr,{present:i||c.open,children:v.jsx(qs.Slot,{scope:e.__scopeMenu,children:v.jsx(dp,{id:h.contentId,"aria-labelledby":h.triggerId,...l,ref:y,align:s,side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{d.isUsingKeyboardRef.current&&m.current?.focus(),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:Re(e.onFocusOutside,g=>{g.target!==h.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,g=>{d.onClose(),g.preventDefault()}),onKeyDown:Re(e.onKeyDown,g=>{const b=g.currentTarget.contains(g.target),S=wM[d.dir].includes(g.key);b&&S&&(c.onOpenChange(!1),h.trigger?.focus(),g.preventDefault())})})})})})});pw.displayName=mw;function gw(e){return e?"open":"closed"}function nc(e){return e==="indeterminate"}function mp(e){return nc(e)?"indeterminate":e?"checked":"unchecked"}function UM(e){const n=document.activeElement;for(const r of e)if(r===n||(r.focus(),document.activeElement!==n))return}function HM(e,n){return e.map((r,i)=>e[(n+i)%e.length])}function BM(e,n,r){const s=n.length>1&&Array.from(n).every(m=>m===n[0])?n[0]:n,l=r?e.indexOf(r):-1;let c=HM(e,Math.max(l,0));s.length===1&&(c=c.filter(m=>m!==r));const h=c.find(m=>m.toLowerCase().startsWith(s.toLowerCase()));return h!==r?h:void 0}function qM(e,n){const{x:r,y:i}=e;let s=!1;for(let l=0,c=n.length-1;li!=b>i&&r<(g-m)*(i-y)/(b-y)+m&&(s=!s)}return s}function GM(e,n){if(!n)return!1;const r={x:e.clientX,y:e.clientY};return qM(r,n)}function Gs(e){return n=>n.pointerType==="mouse"?e(n):void 0}var ZM=Xx,KM=lp,YM=Wx,QM=ew,XM=fp,JM=tw,WM=Oc,e2=rw,t2=iw,n2=sw,r2=uw,o2=cw,i2=dw,a2=hw,s2=pw,Ac="DropdownMenu",[l2]=$o(Ac,[Yx]),vn=Yx(),[u2,vw]=l2(Ac),yw=e=>{const{__scopeDropdownMenu:n,children:r,dir:i,open:s,defaultOpen:l,onOpenChange:c,modal:d=!0}=e,h=vn(n),m=x.useRef(null),[y,g]=Ma({prop:s,defaultProp:l??!1,onChange:c,caller:Ac});return v.jsx(u2,{scope:n,triggerId:hn(),triggerRef:m,contentId:hn(),open:y,onOpenChange:g,onOpenToggle:x.useCallback(()=>g(b=>!b),[g]),modal:d,children:v.jsx(ZM,{...h,open:y,onOpenChange:g,dir:i,modal:d,children:r})})};yw.displayName=Ac;var bw="DropdownMenuTrigger",Sw=x.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,disabled:i=!1,...s}=e,l=vw(bw,r),c=vn(r),d=ot(n,l.triggerRef);return v.jsx(KM,{asChild:!0,...c,children:v.jsx(Pe.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...s,ref:d,onPointerDown:Re(e.onPointerDown,h=>{!i&&h.button===0&&h.ctrlKey===!1&&(l.onOpenToggle(),l.open||h.preventDefault())}),onKeyDown:Re(e.onKeyDown,h=>{i||(["Enter"," "].includes(h.key)&&l.onOpenToggle(),h.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(h.key)&&h.preventDefault())})})})});Sw.displayName=bw;var c2="DropdownMenuPortal",xw=e=>{const{__scopeDropdownMenu:n,...r}=e,i=vn(n);return v.jsx(YM,{...i,...r})};xw.displayName=c2;var ww="DropdownMenuContent",_w=x.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=vw(ww,r),l=vn(r),c=x.useRef(!1);return v.jsx(QM,{id:s.contentId,"aria-labelledby":s.triggerId,...l,...i,ref:n,onCloseAutoFocus:Re(e.onCloseAutoFocus,d=>{c.current||s.triggerRef.current?.focus(),c.current=!1,d.preventDefault()}),onInteractOutside:Re(e.onInteractOutside,d=>{const h=d.detail.originalEvent,m=h.button===0&&h.ctrlKey===!0,y=h.button===2||m;(!s.modal||y)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});_w.displayName=ww;var d2="DropdownMenuGroup",f2=x.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=vn(r);return v.jsx(XM,{...s,...i,ref:n})});f2.displayName=d2;var h2="DropdownMenuLabel",Cw=x.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=vn(r);return v.jsx(JM,{...s,...i,ref:n})});Cw.displayName=h2;var m2="DropdownMenuItem",Ew=x.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=vn(r);return v.jsx(WM,{...s,...i,ref:n})});Ew.displayName=m2;var p2="DropdownMenuCheckboxItem",g2=x.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=vn(r);return v.jsx(e2,{...s,...i,ref:n})});g2.displayName=p2;var v2="DropdownMenuRadioGroup",y2=x.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=vn(r);return v.jsx(t2,{...s,...i,ref:n})});y2.displayName=v2;var b2="DropdownMenuRadioItem",S2=x.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=vn(r);return v.jsx(n2,{...s,...i,ref:n})});S2.displayName=b2;var x2="DropdownMenuItemIndicator",w2=x.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=vn(r);return v.jsx(r2,{...s,...i,ref:n})});w2.displayName=x2;var _2="DropdownMenuSeparator",C2=x.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=vn(r);return v.jsx(o2,{...s,...i,ref:n})});C2.displayName=_2;var E2="DropdownMenuArrow",R2=x.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=vn(r);return v.jsx(i2,{...s,...i,ref:n})});R2.displayName=E2;var T2="DropdownMenuSubTrigger",O2=x.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=vn(r);return v.jsx(a2,{...s,...i,ref:n})});O2.displayName=T2;var A2="DropdownMenuSubContent",M2=x.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=vn(r);return v.jsx(s2,{...s,...i,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});M2.displayName=A2;var j2=yw,z2=Sw,D2=xw,N2=_w,k2=Cw,L2=Ew;function Tb(e,[n,r]){return Math.min(r,Math.max(n,e))}var I2=[" ","Enter","ArrowUp","ArrowDown"],$2=[" ","Enter"],gi="Select",[Mc,jc,V2]=$m(gi),[_i]=$o(gi,[V2,ka]),zc=ka(),[F2,Fo]=_i(gi),[P2,U2]=_i(gi),H2="SelectProvider";function Rw(e){const{__scopeSelect:n,children:r,open:i,defaultOpen:s,onOpenChange:l,value:c,defaultValue:d,onValueChange:h,dir:m,name:y,autoComplete:g,disabled:b,required:S,form:_,internal_do_not_use_render:C}=e,E=zc(n),[T,O]=x.useState(null),[A,k]=x.useState(null),[L,q]=x.useState(!1),H=Vm(m),[$,he]=Ma({prop:i,defaultProp:s??!1,onChange:l,caller:gi}),[ve,de]=Ma({prop:c,defaultProp:d,onChange:h,caller:gi}),le=x.useRef(null),ae=x.useRef(ve);x.useEffect(()=>{const j=_?T?.ownerDocument.getElementById(_):T?.form;if(j instanceof HTMLFormElement){const U=()=>de(ae.current);return j.addEventListener("reset",U),()=>j.removeEventListener("reset",U)}},[_,T,de]);const me=T?!!_||!!T.closest("form"):!0,[ye,N]=x.useState(new Set),Y=hn(),ne=Array.from(ye).map(j=>j.props.value).join(";"),J=x.useCallback(j=>{N(U=>new Set(U).add(j))},[]),W=x.useCallback(j=>{N(U=>{const Q=new Set(U);return Q.delete(j),Q})},[]),z={required:S,trigger:T,onTriggerChange:O,valueNode:A,onValueNodeChange:k,valueNodeHasChildren:L,onValueNodeHasChildrenChange:q,contentId:Y,value:ve,onValueChange:de,open:$,onOpenChange:he,dir:H,triggerPointerDownPosRef:le,disabled:b,name:y,autoComplete:g,form:_,nativeOptions:ye,nativeSelectKey:ne,isFormControl:me};return v.jsx(op,{...E,children:v.jsx(F2,{scope:n,...z,children:v.jsx(Mc.Provider,{scope:n,children:v.jsx(P2,{scope:n,onNativeOptionAdd:J,onNativeOptionRemove:W,children:aj(C)?C(z):r})})})})}Rw.displayName=H2;var Tw=e=>{const{__scopeSelect:n,children:r,...i}=e;return v.jsx(Rw,{__scopeSelect:n,...i,internal_do_not_use_render:({isFormControl:s})=>v.jsxs(v.Fragment,{children:[r,s?v.jsx(Ww,{__scopeSelect:n}):null]})})};Tw.displayName=gi;var Ow="SelectTrigger",Aw=x.forwardRef((e,n)=>{const{__scopeSelect:r,disabled:i=!1,...s}=e,l=zc(r),c=Fo(Ow,r),d=c.disabled||i,h=ot(n,c.onTriggerChange),m=jc(r),y=x.useRef("touch"),[g,b,S]=e1(C=>{const E=m().filter(A=>!A.disabled),T=E.find(A=>A.value===c.value),O=t1(E,C,T);O!==void 0&&c.onValueChange(O.value)}),_=C=>{d||(c.onOpenChange(!0),S()),C&&(c.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return v.jsx(ip,{asChild:!0,...l,children:v.jsx(Pe.button,{type:"button",role:"combobox","aria-controls":c.open?c.contentId:void 0,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":Dc(c.value)?"":void 0,...s,ref:h,onClick:Re(s.onClick,C=>{C.currentTarget.focus(),y.current!=="mouse"&&_(C)}),onPointerDown:Re(s.onPointerDown,C=>{y.current=C.pointerType;const E=C.target;E.hasPointerCapture(C.pointerId)&&E.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(_(C),C.preventDefault())}),onKeyDown:Re(s.onKeyDown,C=>{const E=g.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&b(C.key),!(E&&C.key===" ")&&I2.includes(C.key)&&(_(),C.preventDefault())})})})});Aw.displayName=Ow;var Mw="SelectValue",jw=x.forwardRef((e,n)=>{const{__scopeSelect:r,className:i,style:s,children:l,placeholder:c="",...d}=e,h=Fo(Mw,r),{onValueNodeHasChildrenChange:m}=h,y=l!==void 0,g=ot(n,h.onValueNodeChange);Qt(()=>{m(y)},[m,y]);const b=Dc(h.value);return v.jsx(Pe.span,{...d,asChild:b?!1:d.asChild,ref:g,style:{pointerEvents:"none"},children:v.jsx(x.Fragment,{children:b?c:l},b?"placeholder":"value")})});jw.displayName=Mw;var B2="SelectIcon",zw=x.forwardRef((e,n)=>{const{__scopeSelect:r,children:i,...s}=e;return v.jsx(Pe.span,{"aria-hidden":!0,...s,ref:n,children:i||"▼"})});zw.displayName=B2;var Dw="SelectPortal",[q2,G2]=_i(Dw,{forceMount:void 0}),Nw=e=>{const{__scopeSelect:n,forceMount:r,...i}=e;return v.jsx(q2,{scope:e.__scopeSelect,forceMount:r,children:v.jsx(rl,{asChild:!0,...i})})};Nw.displayName=Dw;var ko="SelectContent",kw=x.forwardRef((e,n)=>{const r=G2(ko,e.__scopeSelect),{forceMount:i=r.forceMount,...s}=e,l=Fo(ko,e.__scopeSelect),[c,d]=x.useState();return Qt(()=>{d(new DocumentFragment)},[]),v.jsx(pr,{present:i||l.open,children:({present:h})=>h?v.jsx($w,{...s,ref:n}):v.jsx(Lw,{...s,fragment:c})})});kw.displayName=ko;var Lw=x.forwardRef((e,n)=>{const{__scopeSelect:r,children:i,fragment:s}=e;return s?Si.createPortal(v.jsx(Iw,{scope:r,children:v.jsx(Mc.Slot,{scope:r,children:v.jsx("div",{ref:n,children:i})})}),s):null});Lw.displayName="SelectContentFragment";var cr=10,[Iw,Po]=_i(ko),Z2="SelectContentImpl",K2=hi("SelectContent.RemoveScroll"),$w=x.forwardRef((e,n)=>{const{__scopeSelect:r}=e,{position:i="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:l,onPointerDownOutside:c,side:d,sideOffset:h,align:m,alignOffset:y,arrowPadding:g,collisionBoundary:b,collisionPadding:S,sticky:_,hideWhenDetached:C,avoidCollisions:E,...T}=e,O=Fo(ko,r),[A,k]=x.useState(null),[L,q]=x.useState(null),H=ot(n,k),[$,he]=x.useState(null),[ve,de]=x.useState(null),le=jc(r),[ae,me]=x.useState(!1),ye=x.useRef(!1);x.useEffect(()=>{if(A)return Um(A)},[A]),Pm();const N=x.useCallback(ee=>{const[ge,...be]=le().map(Fe=>Fe.ref.current),[De]=be.slice(-1),Ie=document.activeElement;for(const Fe of ee)if(Fe===Ie||(Fe?.scrollIntoView({block:"nearest"}),Fe===ge&&L&&(L.scrollTop=0),Fe===De&&L&&(L.scrollTop=L.scrollHeight),Fe?.focus(),document.activeElement!==Ie))return},[le,L]),Y=x.useCallback(()=>N([$,A]),[N,$,A]);x.useEffect(()=>{ae&&Y()},[ae,Y]);const{onOpenChange:ne,triggerPointerDownPosRef:J}=O;x.useEffect(()=>{if(A){let ee={x:0,y:0};const ge=De=>{ee={x:Math.abs(Math.round(De.pageX)-(J.current?.x??0)),y:Math.abs(Math.round(De.pageY)-(J.current?.y??0))}},be=De=>{ee.x<=10&&ee.y<=10?De.preventDefault():De.composedPath().includes(A)||ne(!1),document.removeEventListener("pointermove",ge),J.current=null};return J.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",be,{capture:!0})}}},[A,ne,J]),x.useEffect(()=>{const ee=()=>ne(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[ne]);const[W,z]=e1(ee=>{const ge=le().filter(Ie=>!Ie.disabled),be=ge.find(Ie=>Ie.ref.current===document.activeElement),De=t1(ge,ee,be);De&&setTimeout(()=>De.ref.current?.focus())}),j=x.useCallback((ee,ge,be)=>{const De=!ye.current&&!be;(O.value!==void 0&&O.value===ge||De)&&(he(ee),De&&(ye.current=!0))},[O.value]),U=x.useCallback(()=>A?.focus(),[A]),Q=x.useCallback((ee,ge,be)=>{const De=!ye.current&&!be;(O.value!==void 0&&O.value===ge||De)&&de(ee)},[O.value]),Z=i==="popper"?sm:Vw,re=Z===sm?{side:d,sideOffset:h,align:m,alignOffset:y,arrowPadding:g,collisionBoundary:b,collisionPadding:S,sticky:_,hideWhenDetached:C,avoidCollisions:E}:{};return v.jsx(Iw,{scope:r,content:A,viewport:L,onViewportChange:q,itemRefCallback:j,selectedItem:$,onItemLeave:U,itemTextRefCallback:Q,focusSelectedItem:Y,selectedItemText:ve,position:i,isPositioned:ae,searchRef:W,children:v.jsx(Sc,{as:K2,allowPinchZoom:!0,children:v.jsx(yc,{asChild:!0,trapped:O.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:Re(s,ee=>{O.trigger?.focus({preventScroll:!0}),ee.preventDefault()}),children:v.jsx(nl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:v.jsx(Z,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:ee=>ee.preventDefault(),...T,...re,onPlaced:()=>me(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...T.style},onKeyDown:Re(T.onKeyDown,ee=>{const ge=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!ge&&ee.key.length===1&&z(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let De=le().filter(Ie=>!Ie.disabled).map(Ie=>Ie.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(De=De.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const Ie=ee.target,Fe=De.indexOf(Ie);De=De.slice(Fe+1)}setTimeout(()=>N(De)),ee.preventDefault()}})})})})})})});$w.displayName=Z2;var Y2="SelectItemAlignedPosition",Vw=x.forwardRef((e,n)=>{const{__scopeSelect:r,onPlaced:i,...s}=e,l=Fo(ko,r),c=Po(ko,r),[d,h]=x.useState(null),[m,y]=x.useState(null),g=ot(n,y),b=jc(r),S=x.useRef(!1),_=x.useRef(!0),{viewport:C,selectedItem:E,selectedItemText:T,focusSelectedItem:O}=c,A=x.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&m&&C&&E&&T){const H=l.trigger.getBoundingClientRect(),$=m.getBoundingClientRect(),he=l.valueNode.getBoundingClientRect(),ve=T.getBoundingClientRect();if(l.dir!=="rtl"){const Ie=ve.left-$.left,Fe=he.left-Ie,st=H.left-Fe,Qe=H.width+st,Xt=Math.max(Qe,$.width),mn=window.innerWidth-cr,qt=Tb(Fe,[cr,Math.max(cr,mn-Xt)]);d.style.minWidth=Qe+"px",d.style.left=qt+"px"}else{const Ie=$.right-ve.right,Fe=window.innerWidth-he.right-Ie,st=window.innerWidth-H.right-Fe,Qe=H.width+st,Xt=Math.max(Qe,$.width),mn=window.innerWidth-cr,qt=Tb(Fe,[cr,Math.max(cr,mn-Xt)]);d.style.minWidth=Qe+"px",d.style.right=qt+"px"}const de=b(),le=window.innerHeight-cr*2,ae=C.scrollHeight,me=window.getComputedStyle(m),ye=parseInt(me.borderTopWidth,10),N=parseInt(me.paddingTop,10),Y=parseInt(me.borderBottomWidth,10),ne=parseInt(me.paddingBottom,10),J=ye+N+ae+ne+Y,W=Math.min(E.offsetHeight*5,J),z=window.getComputedStyle(C),j=parseInt(z.paddingTop,10),U=parseInt(z.paddingBottom,10),Q=H.top+H.height/2-cr,Z=le-Q,re=E.offsetHeight/2,ee=E.offsetTop+re,ge=ye+N+ee,be=J-ge;if(ge<=Q){const Ie=de.length>0&&E===de[de.length-1].ref.current;d.style.bottom="0px";const Fe=m.clientHeight-C.offsetTop-C.offsetHeight,st=Math.max(Z,re+(Ie?U:0)+Fe+Y),Qe=ge+st;d.style.height=Qe+"px"}else{const Ie=de.length>0&&E===de[0].ref.current;d.style.top="0px";const st=Math.max(Q,ye+C.offsetTop+(Ie?j:0)+re)+be;d.style.height=st+"px",C.scrollTop=ge-Q+C.offsetTop}d.style.margin=`${cr}px 0`,d.style.minHeight=W+"px",d.style.maxHeight=le+"px",i?.(),requestAnimationFrame(()=>S.current=!0)}},[b,l.trigger,l.valueNode,d,m,C,E,T,l.dir,i]);Qt(()=>A(),[A]);const[k,L]=x.useState();Qt(()=>{m&&L(window.getComputedStyle(m).zIndex)},[m]);const q=x.useCallback(H=>{H&&_.current===!0&&(A(),O?.(),_.current=!1)},[A,O]);return v.jsx(X2,{scope:r,contentWrapper:d,shouldExpandOnScrollRef:S,onScrollButtonChange:q,children:v.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:v.jsx(Pe.div,{...s,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Vw.displayName=Y2;var Q2="SelectPopperPosition",sm=x.forwardRef((e,n)=>{const{__scopeSelect:r,align:i="start",collisionPadding:s=cr,...l}=e,c=zc(r);return v.jsx(ap,{...c,...l,ref:n,align:i,collisionPadding:s,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});sm.displayName=Q2;var[X2,pp]=_i(ko,{}),lm="SelectViewport",Fw=x.forwardRef((e,n)=>{const{__scopeSelect:r,nonce:i,...s}=e,l=Po(lm,r),c=pp(lm,r),d=ot(n,l.onViewportChange),h=x.useRef(0);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),v.jsx(Mc.Slot,{scope:r,children:v.jsx(Pe.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Re(s.onScroll,m=>{const y=m.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=c;if(b?.current&&g){const S=Math.abs(h.current-y.scrollTop);if(S>0){const _=window.innerHeight-cr*2,C=parseFloat(g.style.minHeight),E=parseFloat(g.style.height),T=Math.max(C,E);if(T<_){const O=T+S,A=Math.min(_,O),k=O-A;g.style.height=A+"px",g.style.bottom==="0px"&&(y.scrollTop=k>0?k:0,g.style.justifyContent="flex-end")}}}h.current=y.scrollTop})})})]})});Fw.displayName=lm;var Pw="SelectGroup",[J2,W2]=_i(Pw),ej=x.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e,s=hn();return v.jsx(J2,{scope:r,id:s,children:v.jsx(Pe.div,{role:"group","aria-labelledby":s,...i,ref:n})})});ej.displayName=Pw;var Uw="SelectLabel",tj=x.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e,s=W2(Uw,r);return v.jsx(Pe.div,{id:s.id,...i,ref:n})});tj.displayName=Uw;var rc="SelectItem",[nj,Hw]=_i(rc),Bw=x.forwardRef((e,n)=>{const{__scopeSelect:r,value:i,disabled:s=!1,textValue:l,...c}=e,d=Fo(rc,r),h=Po(rc,r),m=d.value===i,[y,g]=x.useState(l??""),[b,S]=x.useState(!1),_=tr(A=>h.itemRefCallback?.(A,i,s)),C=ot(n,_),E=hn(),T=x.useRef("touch"),O=()=>{s||(d.onValueChange(i),d.onOpenChange(!1))};return v.jsx(nj,{scope:r,value:i,disabled:s,textId:E,isSelected:m,onItemTextChange:x.useCallback(A=>{g(k=>k||(A?.textContent??"").trim())},[]),children:v.jsx(Mc.ItemSlot,{scope:r,value:i,disabled:s,textValue:y,children:v.jsx(Pe.div,{role:"option","aria-labelledby":E,"data-highlighted":b?"":void 0,"aria-selected":m&&b,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:C,onFocus:Re(c.onFocus,()=>S(!0)),onBlur:Re(c.onBlur,()=>S(!1)),onClick:Re(c.onClick,()=>{T.current!=="mouse"&&O()}),onPointerUp:Re(c.onPointerUp,()=>{T.current==="mouse"&&O()}),onPointerDown:Re(c.onPointerDown,A=>{T.current=A.pointerType}),onPointerMove:Re(c.onPointerMove,A=>{T.current=A.pointerType,s?h.onItemLeave?.():T.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(c.onPointerLeave,A=>{A.currentTarget===document.activeElement&&h.onItemLeave?.()}),onKeyDown:Re(c.onKeyDown,A=>{s||A.target!==A.currentTarget||h.searchRef?.current!==""&&A.key===" "||($2.includes(A.key)&&O(),A.key===" "&&A.preventDefault())})})})})});Bw.displayName=rc;var ks="SelectItemText",qw=x.forwardRef((e,n)=>{const{__scopeSelect:r,className:i,style:s,...l}=e,c=Fo(ks,r),d=Po(ks,r),h=Hw(ks,r),m=U2(ks,r),[y,g]=x.useState(null),b=tr(O=>d.itemTextRefCallback?.(O,h.value,h.disabled)),S=ot(n,g,h.onItemTextChange,b),_=y?.textContent,C=x.useMemo(()=>v.jsx("option",{value:h.value,disabled:h.disabled,children:_},h.value),[h.disabled,h.value,_]),{onNativeOptionAdd:E,onNativeOptionRemove:T}=m;return Qt(()=>(E(C),()=>T(C)),[E,T,C]),v.jsxs(v.Fragment,{children:[v.jsx(Pe.span,{id:h.textId,...l,ref:S}),h.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!Dc(c.value)?Si.createPortal(l.children,c.valueNode):null]})});qw.displayName=ks;var Gw="SelectItemIndicator",Zw=x.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e;return Hw(Gw,r).isSelected?v.jsx(Pe.span,{"aria-hidden":!0,...i,ref:n}):null});Zw.displayName=Gw;var um="SelectScrollUpButton",Kw=x.forwardRef((e,n)=>{const r=Po(um,e.__scopeSelect),i=pp(um,e.__scopeSelect),[s,l]=x.useState(!1),c=ot(n,i.onScrollButtonChange);return Qt(()=>{if(r.viewport&&r.isPositioned){let d=function(){const m=h.scrollTop>0;l(m)};const h=r.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),s?v.jsx(Qw,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=r;d&&h&&(d.scrollTop=d.scrollTop-h.offsetHeight)}}):null});Kw.displayName=um;var cm="SelectScrollDownButton",Yw=x.forwardRef((e,n)=>{const r=Po(cm,e.__scopeSelect),i=pp(cm,e.__scopeSelect),[s,l]=x.useState(!1),c=ot(n,i.onScrollButtonChange);return Qt(()=>{if(r.viewport&&r.isPositioned){let d=function(){const m=h.scrollHeight-h.clientHeight,y=Math.ceil(h.scrollTop)h.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),s?v.jsx(Qw,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=r;d&&h&&(d.scrollTop=d.scrollTop+h.offsetHeight)}}):null});Yw.displayName=cm;var Qw=x.forwardRef((e,n)=>{const{__scopeSelect:r,onAutoScroll:i,...s}=e,l=Po("SelectScrollButton",r),c=x.useRef(null),d=jc(r),h=x.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return x.useEffect(()=>()=>h(),[h]),Qt(()=>{d().find(y=>y.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[d]),v.jsx(Pe.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:Re(s.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(i,50))}),onPointerMove:Re(s.onPointerMove,()=>{l.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(i,50))}),onPointerLeave:Re(s.onPointerLeave,()=>{h()})})}),rj="SelectSeparator",oj=x.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e;return v.jsx(Pe.div,{"aria-hidden":!0,...i,ref:n})});oj.displayName=rj;var Xw="SelectArrow",ij=x.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e,s=zc(r);return Po(Xw,r).position==="popper"?v.jsx(sp,{...s,...i,ref:n}):null});ij.displayName=Xw;var Jw="SelectBubbleInput",Ww=x.forwardRef(({__scopeSelect:e,...n},r)=>{const i=Fo(Jw,e),{value:s,onValueChange:l,required:c,disabled:d,name:h,autoComplete:m,form:y}=i,{nativeOptions:g,nativeSelectKey:b}=i,S=x.useRef(null),_=ot(r,S),C=s??"",E=UO(C),T=Array.from(g).some(O=>(O.props.value??"")==="");return x.useEffect(()=>{const O=S.current;if(!O)return;const A=window.HTMLSelectElement.prototype,L=Object.getOwnPropertyDescriptor(A,"value").set;if(E!==C&&L){const q=new Event("change",{bubbles:!0});L.call(O,C),O.dispatchEvent(q)}},[E,C]),v.jsxs(Pe.select,{"aria-hidden":!0,required:c,tabIndex:-1,name:h,autoComplete:m,disabled:d,form:y,onChange:O=>l(O.target.value),...n,style:{...ex,...n.style},ref:_,defaultValue:C,children:[Dc(s)&&!T?v.jsx("option",{value:""}):null,Array.from(g)]},b)});Ww.displayName=Jw;function aj(e){return typeof e=="function"}function Dc(e){return e===""||e===void 0}function e1(e){const n=tr(e),r=x.useRef(""),i=x.useRef(0),s=x.useCallback(c=>{const d=r.current+c;n(d),(function h(m){r.current=m,window.clearTimeout(i.current),m!==""&&(i.current=window.setTimeout(()=>h(""),1e3))})(d)},[n]),l=x.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,s,l]}function t1(e,n,r){const s=n.length>1&&Array.from(n).every(m=>m===n[0])?n[0]:n,l=r?e.indexOf(r):-1;let c=sj(e,Math.max(l,0));s.length===1&&(c=c.filter(m=>m!==r));const h=c.find(m=>m.textValue.toLowerCase().startsWith(s.toLowerCase()));return h!==r?h:void 0}function sj(e,n){return e.map((r,i)=>e[(n+i)%e.length])}var[Nc]=$o("Tooltip",[ka]),kc=ka(),n1="TooltipProvider",lj=700,dm="tooltip.open",[uj,gp]=Nc(n1),r1=e=>{const{__scopeTooltip:n,delayDuration:r=lj,skipDelayDuration:i=300,disableHoverableContent:s=!1,children:l}=e,c=x.useRef(!0),d=x.useRef(!1),h=x.useRef(0);return x.useEffect(()=>{const m=h.current;return()=>window.clearTimeout(m)},[]),v.jsx(uj,{scope:n,isOpenDelayedRef:c,delayDuration:r,onOpen:x.useCallback(()=>{i<=0||(window.clearTimeout(h.current),c.current=!1)},[i]),onClose:x.useCallback(()=>{i<=0||(window.clearTimeout(h.current),h.current=window.setTimeout(()=>c.current=!0,i))},[i]),isPointerInTransitRef:d,onPointerInTransitChange:x.useCallback(m=>{d.current=m},[]),disableHoverableContent:s,children:l})};r1.displayName=n1;var Zs="Tooltip",[cj,sl]=Nc(Zs),o1=e=>{const{__scopeTooltip:n,children:r,open:i,defaultOpen:s,onOpenChange:l,disableHoverableContent:c,delayDuration:d}=e,h=gp(Zs,e.__scopeTooltip),m=kc(n),[y,g]=x.useState(null),b=hn(),S=x.useRef(0),_=c??h.disableHoverableContent,C=d??h.delayDuration,E=x.useRef(!1),[T,O]=Ma({prop:i,defaultProp:s??!1,onChange:H=>{H?(h.onOpen(),document.dispatchEvent(new CustomEvent(dm))):h.onClose(),l?.(H)},caller:Zs}),A=x.useMemo(()=>T?E.current?"delayed-open":"instant-open":"closed",[T]),k=x.useCallback(()=>{window.clearTimeout(S.current),S.current=0,E.current=!1,O(!0)},[O]),L=x.useCallback(()=>{window.clearTimeout(S.current),S.current=0,O(!1)},[O]),q=x.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{E.current=!0,O(!0),S.current=0},C)},[C,O]);return x.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]),v.jsx(op,{...m,children:v.jsx(cj,{scope:n,contentId:b,open:T,stateAttribute:A,trigger:y,onTriggerChange:g,onTriggerEnter:x.useCallback(()=>{h.isOpenDelayedRef.current?q():k()},[h.isOpenDelayedRef,q,k]),onTriggerLeave:x.useCallback(()=>{_?L():(window.clearTimeout(S.current),S.current=0)},[L,_]),onOpen:k,onClose:L,disableHoverableContent:_,children:r})})};o1.displayName=Zs;var fm="TooltipTrigger",i1=x.forwardRef((e,n)=>{const{__scopeTooltip:r,...i}=e,s=sl(fm,r),l=gp(fm,r),c=kc(r),d=x.useRef(null),h=ot(n,d,s.onTriggerChange),m=x.useRef(!1),y=x.useRef(!1),g=x.useCallback(()=>m.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),v.jsx(ip,{asChild:!0,...c,children:v.jsx(Pe.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...i,ref:h,onPointerMove:Re(e.onPointerMove,b=>{b.pointerType!=="touch"&&!y.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),y.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{s.onTriggerLeave(),y.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Re(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:Re(e.onBlur,s.onClose),onClick:Re(e.onClick,s.onClose)})})});i1.displayName=fm;var vp="TooltipPortal",[dj,fj]=Nc(vp,{forceMount:void 0}),a1=e=>{const{__scopeTooltip:n,forceMount:r,children:i,container:s}=e,l=sl(vp,n);return v.jsx(dj,{scope:n,forceMount:r,children:v.jsx(pr,{present:r||l.open,children:v.jsx(rl,{asChild:!0,container:s,children:i})})})};a1.displayName=vp;var za="TooltipContent",s1=x.forwardRef((e,n)=>{const r=fj(za,e.__scopeTooltip),{forceMount:i=r.forceMount,side:s="top",...l}=e,c=sl(za,e.__scopeTooltip);return v.jsx(pr,{present:i||c.open,children:c.disableHoverableContent?v.jsx(l1,{side:s,...l,ref:n}):v.jsx(hj,{side:s,...l,ref:n})})}),hj=x.forwardRef((e,n)=>{const r=sl(za,e.__scopeTooltip),i=gp(za,e.__scopeTooltip),s=x.useRef(null),l=ot(n,s),[c,d]=x.useState(null),{trigger:h,onClose:m}=r,y=s.current,{onPointerInTransitChange:g}=i,b=x.useCallback(()=>{d(null),g(!1)},[g]),S=x.useCallback((_,C)=>{const E=_.currentTarget,T={x:_.clientX,y:_.clientY},O=vj(T,E.getBoundingClientRect()),A=yj(T,O),k=bj(C.getBoundingClientRect()),L=xj([...A,...k]);d(L),g(!0)},[g]);return x.useEffect(()=>()=>b(),[b]),x.useEffect(()=>{if(h&&y){const _=E=>S(E,y),C=E=>S(E,h);return h.addEventListener("pointerleave",_),y.addEventListener("pointerleave",C),()=>{h.removeEventListener("pointerleave",_),y.removeEventListener("pointerleave",C)}}},[h,y,S,b]),x.useEffect(()=>{if(c){const _=C=>{const E=C.target,T={x:C.clientX,y:C.clientY},O=h?.contains(E)||y?.contains(E),A=!Sj(T,c);O?b():A&&(b(),m())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[h,y,c,m,b]),v.jsx(l1,{...e,ref:l})}),[mj,pj]=Nc(Zs,{isInside:!1}),gj=uT("TooltipContent"),l1=x.forwardRef((e,n)=>{const{__scopeTooltip:r,children:i,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,h=sl(za,r),m=kc(r),{onClose:y}=h;return x.useEffect(()=>(document.addEventListener(dm,y),()=>document.removeEventListener(dm,y)),[y]),x.useEffect(()=>{if(h.trigger){const g=b=>{b.target instanceof Node&&b.target.contains(h.trigger)&&y()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[h.trigger,y]),v.jsx(nl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:y,children:v.jsxs(ap,{"data-state":h.stateAttribute,...m,...d,ref:n,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(gj,{children:i}),v.jsx(mj,{scope:r,isInside:!0,children:v.jsx(ST,{id:h.contentId,role:"tooltip",children:s||i})})]})})});s1.displayName=za;var u1="TooltipArrow",c1=x.forwardRef((e,n)=>{const{__scopeTooltip:r,...i}=e,s=kc(r);return pj(u1,r).isInside?null:v.jsx(sp,{...s,...i,ref:n})});c1.displayName=u1;function vj(e,n){const r=Math.abs(n.top-e.y),i=Math.abs(n.bottom-e.y),s=Math.abs(n.right-e.x),l=Math.abs(n.left-e.x);switch(Math.min(r,i,s,l)){case l:return"left";case s:return"right";case r:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function yj(e,n,r=5){const i=[];switch(n){case"top":i.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":i.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":i.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":i.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return i}function bj(e){const{top:n,right:r,bottom:i,left:s}=e;return[{x:s,y:n},{x:r,y:n},{x:r,y:i},{x:s,y:i}]}function Sj(e,n){const{x:r,y:i}=e;let s=!1;for(let l=0,c=n.length-1;li!=b>i&&r<(g-m)*(i-y)/(b-y)+m&&(s=!s)}return s}function xj(e){const n=e.slice();return n.sort((r,i)=>r.xi.x?1:r.yi.y?1:0),wj(n)}function wj(e){if(e.length<=1)return e.slice();const n=[];for(let i=0;i=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))n.pop();else break}n.push(s)}n.pop();const r=[];for(let i=e.length-1;i>=0;i--){const s=e[i];for(;r.length>=2;){const l=r[r.length-1],c=r[r.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))r.pop();else break}r.push(s)}return r.pop(),n.length===1&&r.length===1&&n[0].x===r[0].x&&n[0].y===r[0].y?n:n.concat(r)}var _j=r1,Cj=o1,Ej=i1,Rj=a1,Tj=s1,Oj=c1;function d1(e){var n,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(n=0;n{const r=new Array(e.length+n.length);for(let i=0;i({classGroupId:e,validator:n}),h1=(e=new Map,n=null,r)=>({nextPart:e,validators:n,classGroupId:r}),oc="-",Ob=[],jj="arbitrary..",zj=e=>{const n=Nj(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return Dj(c);const d=c.split(oc),h=d[0]===""&&d.length>1?1:0;return m1(d,h,n)},getConflictingClassGroupIds:(c,d)=>{if(d){const h=i[c],m=r[c];return h?m?Aj(m,h):h:m||Ob}return r[c]||Ob}}},m1=(e,n,r)=>{if(e.length-n===0)return r.classGroupId;const s=e[n],l=r.nextPart.get(s);if(l){const m=m1(e,n+1,l);if(m)return m}const c=r.validators;if(c===null)return;const d=n===0?e.join(oc):e.slice(n).join(oc),h=c.length;for(let m=0;me.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),r=n.indexOf(":"),i=n.slice(0,r);return i?jj+i:void 0})(),Nj=e=>{const{theme:n,classGroups:r}=e;return kj(r,n)},kj=(e,n)=>{const r=h1();for(const i in e){const s=e[i];yp(s,r,i,n)}return r},yp=(e,n,r,i)=>{const s=e.length;for(let l=0;l{if(typeof e=="string"){Ij(e,n,r);return}if(typeof e=="function"){$j(e,n,r,i);return}Vj(e,n,r,i)},Ij=(e,n,r)=>{const i=e===""?n:p1(n,e);i.classGroupId=r},$j=(e,n,r,i)=>{if(Fj(e)){yp(e(i),n,r,i);return}n.validators===null&&(n.validators=[]),n.validators.push(Mj(r,e))},Vj=(e,n,r,i)=>{const s=Object.entries(e),l=s.length;for(let c=0;c{let r=e;const i=n.split(oc),s=i.length;for(let l=0;l"isThemeGetter"in e&&e.isThemeGetter===!0,Pj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,r=Object.create(null),i=Object.create(null);const s=(l,c)=>{r[l]=c,n++,n>e&&(n=0,i=r,r=Object.create(null))};return{get(l){let c=r[l];if(c!==void 0)return c;if((c=i[l])!==void 0)return s(l,c),c},set(l,c){l in r?r[l]=c:s(l,c)}}},hm="!",Ab=":",Uj=[],Mb=(e,n,r,i,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:r,maybePostfixModifierPosition:i,isExternal:s}),Hj=e=>{const{prefix:n,experimentalParseClassName:r}=e;let i=s=>{const l=[];let c=0,d=0,h=0,m;const y=s.length;for(let C=0;Ch?m-h:void 0;return Mb(l,S,b,_)};if(n){const s=n+Ab,l=i;i=c=>c.startsWith(s)?l(c.slice(s.length)):Mb(Uj,!1,c,void 0,!0)}if(r){const s=i;i=l=>r({className:l,parseClassName:s})}return i},Bj=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((r,i)=>{n.set(r,1e6+i)}),r=>{const i=[];let s=[];for(let l=0;l0&&(s.sort(),i.push(...s),s=[]),i.push(c)):s.push(c)}return s.length>0&&(s.sort(),i.push(...s)),i}},qj=e=>({cache:Pj(e.cacheSize),parseClassName:Hj(e),sortModifiers:Bj(e),postfixLookupClassGroupIds:Gj(e),...zj(e)}),Gj=e=>{const n=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let i=0;i{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:s,sortModifiers:l,postfixLookupClassGroupIds:c}=n,d=[],h=e.trim().split(Zj);let m="";for(let y=h.length-1;y>=0;y-=1){const g=h[y],{isExternal:b,modifiers:S,hasImportantModifier:_,baseClassName:C,maybePostfixModifierPosition:E}=r(g);if(b){m=g+(m.length>0?" "+m:m);continue}let T=!!E,O;if(T){const H=C.substring(0,E);O=i(H);const $=O&&c[O]?i(C):void 0;$&&$!==O&&(O=$,T=!1)}else O=i(C);if(!O){if(!T){m=g+(m.length>0?" "+m:m);continue}if(O=i(C),!O){m=g+(m.length>0?" "+m:m);continue}T=!1}const A=S.length===0?"":S.length===1?S[0]:l(S).join(":"),k=_?A+hm:A,L=k+O;if(d.indexOf(L)>-1)continue;d.push(L);const q=s(O,T);for(let H=0;H0?" "+m:m)}return m},Yj=(...e)=>{let n=0,r,i,s="";for(;n{if(typeof e=="string")return e;let n,r="";for(let i=0;i{let r,i,s,l;const c=h=>{const m=n.reduce((y,g)=>g(y),e());return r=qj(m),i=r.cache.get,s=r.cache.set,l=d,d(h)},d=h=>{const m=i(h);if(m)return m;const y=Kj(h,r);return s(h,y),y};return l=c,(...h)=>l(Yj(...h))},Xj=[],Ht=e=>{const n=r=>r[e]||Xj;return n.isThemeGetter=!0,n},v1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,y1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Jj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Wj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ez=/\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$/,tz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,To=e=>Jj.test(e),Be=e=>!!e&&!Number.isNaN(Number(e)),xr=e=>!!e&&Number.isInteger(Number(e)),Th=e=>e.endsWith("%")&&Be(e.slice(0,-1)),Kr=e=>Wj.test(e),b1=()=>!0,oz=e=>ez.test(e)&&!tz.test(e),bp=()=>!1,iz=e=>nz.test(e),az=e=>rz.test(e),sz=e=>!_e(e)&&!Ce(e),lz=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),uz=e=>Uo(e,w1,bp),_e=e=>v1.test(e),ci=e=>Uo(e,_1,oz),jb=e=>Uo(e,vz,Be),cz=e=>Uo(e,E1,b1),dz=e=>Uo(e,C1,bp),zb=e=>Uo(e,S1,bp),fz=e=>Uo(e,x1,az),zu=e=>Uo(e,R1,iz),Ce=e=>y1.test(e),As=e=>Ci(e,_1),hz=e=>Ci(e,C1),Db=e=>Ci(e,S1),mz=e=>Ci(e,w1),pz=e=>Ci(e,x1),Du=e=>Ci(e,R1,!0),gz=e=>Ci(e,E1,!0),Uo=(e,n,r)=>{const i=v1.exec(e);return i?i[1]?n(i[1]):r(i[2]):!1},Ci=(e,n,r=!1)=>{const i=y1.exec(e);return i?i[1]?n(i[1]):r:!1},S1=e=>e==="position"||e==="percentage",x1=e=>e==="image"||e==="url",w1=e=>e==="length"||e==="size"||e==="bg-size",_1=e=>e==="length",vz=e=>e==="number",C1=e=>e==="family-name",E1=e=>e==="number"||e==="weight",R1=e=>e==="shadow",yz=()=>{const e=Ht("color"),n=Ht("font"),r=Ht("text"),i=Ht("font-weight"),s=Ht("tracking"),l=Ht("leading"),c=Ht("breakpoint"),d=Ht("container"),h=Ht("spacing"),m=Ht("radius"),y=Ht("shadow"),g=Ht("inset-shadow"),b=Ht("text-shadow"),S=Ht("drop-shadow"),_=Ht("blur"),C=Ht("perspective"),E=Ht("aspect"),T=Ht("ease"),O=Ht("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...k(),Ce,_e],q=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],$=()=>[Ce,_e,h],he=()=>[To,"full","auto",...$()],ve=()=>[xr,"none","subgrid",Ce,_e],de=()=>["auto",{span:["full",xr,Ce,_e]},xr,Ce,_e],le=()=>[xr,"auto",Ce,_e],ae=()=>["auto","min","max","fr",Ce,_e],me=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ye=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...$()],Y=()=>[To,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...$()],ne=()=>[To,"screen","full","dvw","lvw","svw","min","max","fit",...$()],J=()=>[To,"screen","full","lh","dvh","lvh","svh","min","max","fit",...$()],W=()=>[e,Ce,_e],z=()=>[...k(),Db,zb,{position:[Ce,_e]}],j=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",mz,uz,{size:[Ce,_e]}],Q=()=>[Th,As,ci],Z=()=>["","none","full",m,Ce,_e],re=()=>["",Be,As,ci],ee=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],be=()=>[Be,Th,Db,zb],De=()=>["","none",_,Ce,_e],Ie=()=>["none",Be,Ce,_e],Fe=()=>["none",Be,Ce,_e],st=()=>[Be,Ce,_e],Qe=()=>[To,"full",...$()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Kr],breakpoint:[Kr],color:[b1],container:[Kr],"drop-shadow":[Kr],ease:["in","out","in-out"],font:[sz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Kr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Kr],shadow:[Kr],spacing:["px",Be],text:[Kr],"text-shadow":[Kr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",To,_e,Ce,E]}],container:["container"],"container-type":[{"@container":["","normal","size",Ce,_e]}],"container-named":[lz],columns:[{columns:[Be,_e,Ce,d]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:L()}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:he()}],"inset-x":[{"inset-x":he()}],"inset-y":[{"inset-y":he()}],start:[{"inset-s":he(),start:he()}],end:[{"inset-e":he(),end:he()}],"inset-bs":[{"inset-bs":he()}],"inset-be":[{"inset-be":he()}],top:[{top:he()}],right:[{right:he()}],bottom:[{bottom:he()}],left:[{left:he()}],visibility:["visible","invisible","collapse"],z:[{z:[xr,"auto",Ce,_e]}],basis:[{basis:[To,"full","auto",d,...$()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Be,To,"auto","initial","none",_e]}],grow:[{grow:["",Be,Ce,_e]}],shrink:[{shrink:["",Be,Ce,_e]}],order:[{order:[xr,"first","last","none",Ce,_e]}],"grid-cols":[{"grid-cols":ve()}],"col-start-end":[{col:de()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":ve()}],"row-start-end":[{row:de()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:$()}],"gap-x":[{"gap-x":$()}],"gap-y":[{"gap-y":$()}],"justify-content":[{justify:[...me(),"normal"]}],"justify-items":[{"justify-items":[...ye(),"normal"]}],"justify-self":[{"justify-self":["auto",...ye()]}],"align-content":[{content:["normal",...me()]}],"align-items":[{items:[...ye(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ye(),{baseline:["","last"]}]}],"place-content":[{"place-content":me()}],"place-items":[{"place-items":[...ye(),"baseline"]}],"place-self":[{"place-self":["auto",...ye()]}],p:[{p:$()}],px:[{px:$()}],py:[{py:$()}],ps:[{ps:$()}],pe:[{pe:$()}],pbs:[{pbs:$()}],pbe:[{pbe:$()}],pt:[{pt:$()}],pr:[{pr:$()}],pb:[{pb:$()}],pl:[{pl:$()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mbs:[{mbs:N()}],mbe:[{mbe:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":$()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":$()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...ne()]}],"min-inline-size":[{"min-inline":["auto",...ne()]}],"max-inline-size":[{"max-inline":["none",...ne()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[d,"screen",...Y()]}],"min-w":[{"min-w":[d,"screen","none",...Y()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",r,As,ci]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,gz,cz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Th,_e]}],"font-family":[{font:[hz,dz,n]}],"font-features":[{"font-features":[_e]}],"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:[s,Ce,_e]}],"line-clamp":[{"line-clamp":[Be,"none",Ce,jb]}],leading:[{leading:[l,...$()]}],"list-image":[{"list-image":["none",Ce,_e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ce,_e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:[Be,"from-font","auto",Ce,ci]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[Be,"auto",Ce,_e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"tab-size":[{tab:[xr,Ce,_e]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ce,_e]}],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",Ce,_e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:j()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xr,Ce,_e],radial:["",Ce,_e],conic:[xr,Ce,_e]},pz,fz]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ee(),"hidden","none"]}],"divide-style":[{divide:[...ee(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-bs":[{"border-bs":W()}],"border-color-be":[{"border-be":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...ee(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Be,Ce,_e]}],"outline-w":[{outline:["",Be,As,ci]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",y,Du,zu]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",g,Du,zu]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[Be,ci]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",b,Du,zu]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[Be,Ce,_e]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"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":[Be]}],"mask-image-linear-from-pos":[{"mask-linear-from":be()}],"mask-image-linear-to-pos":[{"mask-linear-to":be()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":be()}],"mask-image-t-to-pos":[{"mask-t-to":be()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":be()}],"mask-image-r-to-pos":[{"mask-r-to":be()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":be()}],"mask-image-b-to-pos":[{"mask-b-to":be()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":be()}],"mask-image-l-to-pos":[{"mask-l-to":be()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":be()}],"mask-image-x-to-pos":[{"mask-x-to":be()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":be()}],"mask-image-y-to-pos":[{"mask-y-to":be()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[Ce,_e]}],"mask-image-radial-from-pos":[{"mask-radial-from":be()}],"mask-image-radial-to-pos":[{"mask-radial-to":be()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[Be]}],"mask-image-conic-from-pos":[{"mask-conic-from":be()}],"mask-image-conic-to-pos":[{"mask-conic-to":be()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:j()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ce,_e]}],filter:[{filter:["","none",Ce,_e]}],blur:[{blur:De()}],brightness:[{brightness:[Be,Ce,_e]}],contrast:[{contrast:[Be,Ce,_e]}],"drop-shadow":[{"drop-shadow":["","none",S,Du,zu]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",Be,Ce,_e]}],"hue-rotate":[{"hue-rotate":[Be,Ce,_e]}],invert:[{invert:["",Be,Ce,_e]}],saturate:[{saturate:[Be,Ce,_e]}],sepia:[{sepia:["",Be,Ce,_e]}],"backdrop-filter":[{"backdrop-filter":["","none",Ce,_e]}],"backdrop-blur":[{"backdrop-blur":De()}],"backdrop-brightness":[{"backdrop-brightness":[Be,Ce,_e]}],"backdrop-contrast":[{"backdrop-contrast":[Be,Ce,_e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Be,Ce,_e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Be,Ce,_e]}],"backdrop-invert":[{"backdrop-invert":["",Be,Ce,_e]}],"backdrop-opacity":[{"backdrop-opacity":[Be,Ce,_e]}],"backdrop-saturate":[{"backdrop-saturate":[Be,Ce,_e]}],"backdrop-sepia":[{"backdrop-sepia":["",Be,Ce,_e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":$()}],"border-spacing-x":[{"border-spacing-x":$()}],"border-spacing-y":[{"border-spacing-y":$()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ce,_e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Be,"initial",Ce,_e]}],ease:[{ease:["linear","initial",T,Ce,_e]}],delay:[{delay:[Be,Ce,_e]}],animate:[{animate:["none",O,Ce,_e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,Ce,_e]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Ie()}],"rotate-x":[{"rotate-x":Ie()}],"rotate-y":[{"rotate-y":Ie()}],"rotate-z":[{"rotate-z":Ie()}],scale:[{scale:Fe()}],"scale-x":[{"scale-x":Fe()}],"scale-y":[{"scale-y":Fe()}],"scale-z":[{"scale-z":Fe()}],"scale-3d":["scale-3d"],skew:[{skew:st()}],"skew-x":[{"skew-x":st()}],"skew-y":[{"skew-y":st()}],transform:[{transform:[Ce,_e,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Qe()}],"translate-x":[{"translate-x":Qe()}],"translate-y":[{"translate-y":Qe()}],"translate-z":[{"translate-z":Qe()}],"translate-none":["translate-none"],zoom:[{zoom:[xr,Ce,_e]}],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"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",Ce,_e]}],"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":W()}],"scrollbar-track-color":[{"scrollbar-track":W()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mbs":[{"scroll-mbs":$()}],"scroll-mbe":[{"scroll-mbe":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pbs":[{"scroll-pbs":$()}],"scroll-pbe":[{"scroll-pbe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",Ce,_e]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[Be,As,ci,jb]}],stroke:[{stroke:["none",...W()]}],"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"]}},bz=Qj(yz);function St(...e){return bz(f1(e))}function Sz({delayDuration:e=0,...n}){return v.jsx(_j,{"data-slot":"tooltip-provider",delayDuration:e,...n})}function xz({...e}){return v.jsx(Cj,{"data-slot":"tooltip",...e})}function wz({...e}){return v.jsx(Ej,{"data-slot":"tooltip-trigger",...e})}function _z({className:e,sideOffset:n=0,children:r,...i}){return v.jsx(Rj,{children:v.jsxs(Tj,{"data-slot":"tooltip-content",sideOffset:n,className:St("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...i,children:[r,v.jsx(Oj,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const mm=new Set;function Cz(e){return mm.add(e),()=>mm.delete(e)}function Ez(){for(const e of mm)e()}const T1=(...e)=>e.filter((n,r,i)=>!!n&&n.trim()!==""&&i.indexOf(n)===r).join(" ").trim();const Rz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Tz=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,r,i)=>i?i.toUpperCase():r.toLowerCase());const Nb=e=>{const n=Tz(e);return n.charAt(0).toUpperCase()+n.slice(1)};var Oh={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"};const Oz=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},Az=x.createContext({}),Mz=()=>x.useContext(Az),jz=x.forwardRef(({color:e,size:n,strokeWidth:r,absoluteStrokeWidth:i,className:s="",children:l,iconNode:c,...d},h)=>{const{size:m=24,strokeWidth:y=2,absoluteStrokeWidth:g=!1,color:b="currentColor",className:S=""}=Mz()??{},_=i??g?Number(r??y)*24/Number(n??m):r??y;return x.createElement("svg",{ref:h,...Oh,width:n??m??Oh.width,height:n??m??Oh.height,stroke:e??b,strokeWidth:_,className:T1("lucide",S,s),...!l&&!Oz(d)&&{"aria-hidden":"true"},...d},[...c.map(([C,E])=>x.createElement(C,E)),...Array.isArray(l)?l:[l]])});const tt=(e,n)=>{const r=x.forwardRef(({className:i,...s},l)=>x.createElement(jz,{ref:l,iconNode:n,className:T1(`lucide-${Rz(Nb(e))}`,`lucide-${e}`,i),...s}));return r.displayName=Nb(e),r};const zz=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],O1=tt("check",zz);const Dz=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Sp=tt("chevron-down",Dz);const Nz=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],kz=tt("chevron-right",Nz);const Lz=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Iz=tt("chevron-up",Lz);const $z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Vz=tt("circle-check",$z);const Fz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Pz=tt("clock",Fz);const Uz=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Hz=tt("copy",Uz);const Bz=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],qz=tt("download",Bz);const Gz=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Zz=tt("ellipsis",Gz);const Kz=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Yz=tt("file-text",Kz);const Qz=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Xz=tt("folder",Qz);const Jz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Wz=tt("globe",Jz);const eD=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],tD=tt("history",eD);const nD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],rD=tt("info",nD);const oD=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],iD=tt("layout-dashboard",oD);const aD=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],sD=tt("link",aD);const lD=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],uD=tt("loader-circle",lD);const cD=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],dD=tt("lock",cD);const fD=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],hD=tt("log-out",fD);const mD=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],pD=tt("menu",mD);const gD=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],vD=tt("octagon-x",gD);const yD=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],bD=tt("plus",yD);const SD=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],A1=tt("search",SD);const xD=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],wD=tt("settings",xD);const _D=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],CD=tt("share-2",_D);const ED=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],RD=tt("shield",ED);const TD=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],OD=tt("square-terminal",TD);const AD=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],MD=tt("trash-2",AD);const jD=[["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"}]],M1=tt("triangle-alert",jD);const zD=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],DD=tt("upload",zD);const ND=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],kD=tt("users",ND);const LD=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],j1=tt("x",LD);function ID(){const e=!document.body.classList.contains("sb-open");document.body.classList.toggle("sb-open"),Lc(),e?document.getElementById("sidebar")?.querySelector($D)?.focus():document.getElementById("menu-btn")?.focus()}const $D='a[href], button:not(:disabled), select, input, [tabindex]:not([tabindex="-1"])';function fr(){const e=document.body.classList.contains("sb-open");document.body.classList.remove("sb-open"),Lc(),e&&window.innerWidth<=qu&&document.getElementById("menu-btn")?.focus()}const qu=900;function Lc(){const e=document.getElementById("sidebar");if(!e)return;const n=document.body.classList.contains("sb-open");window.innerWidth<=qu&&!n?e.setAttribute("inert",""):e.removeAttribute("inert");const i=document.getElementById("main");i&&(n&&window.innerWidth<=qu?i.setAttribute("inert",""):i.removeAttribute("inert")),e.setAttribute("aria-modal",String(n&&window.innerWidth<=qu)),document.getElementById("menu-btn")?.setAttribute("aria-expanded",String(n))}typeof window<"u"&&(window.addEventListener("resize",Lc),window.addEventListener("keydown",e=>{e.key==="Escape"&&document.body.classList.contains("sb-open")&&fr()}));const VD={alert:M1,check:O1,chev:kz,chevd:Sp,clock:Pz,copy:Hz,doc:Yz,dots:Zz,download:qz,folder:Xz,dashboard:iD,gear:wD,globe:Wz,hist:tD,link:sD,lock:dD,menu:pD,plus:bD,power:hD,search:A1,share:CD,shield:RD,terminal:OD,trash:MD,upload:DD,users:kD,x:j1};function Yt({name:e}){const n=VD[e];return n?v.jsx(n,{className:"ico","aria-hidden":"true"}):null}function FD({size:e=22}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 32 32",fill:"currentColor",role:"img","aria-label":"BearDrive",children:[v.jsx("rect",{x:"4",y:"4",width:"5.6",height:"24"}),v.jsx("rect",{x:"11.2",y:"4",width:"14.4",height:"11.2"}),v.jsx("rect",{x:"11.2",y:"16.8",width:"16.8",height:"11.2"})]})}function ic(e){const n=["page",e.width??"app",e.className].filter(Boolean).join(" ");return v.jsx("div",{className:n,children:e.children})}function PD(e){e&&Lc()}function Ks(e){return v.jsxs(v.Fragment,{children:[v.jsx("div",{id:"sb-backdrop",onClick:fr}),v.jsxs("aside",{id:"sidebar",ref:PD,children:[e.vault,e.projectsNav,e.tree??v.jsx("nav",{id:"tree","aria-label":"Files"}),e.orgBar]}),v.jsxs("main",{id:"main",children:[e.topbar,v.jsx("article",{id:"content",ref:e.contentRef,onScroll:e.onContentScroll,children:e.children})]})]})}function Ic(e){const{name:n,onHome:r,showSignout:i,search:s}=e;return v.jsxs("header",{id:"vault",children:[v.jsx("span",{id:"vault-badge",children:v.jsx(FD,{size:22})}),v.jsx("span",{id:"vault-name",className:r?"vault-link":void 0,onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,onKeyDown:l=>{r&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r())},children:n}),v.jsxs("div",{className:"vault-actions",children:[s&&v.jsxs(xz,{delayDuration:150,children:[v.jsx(wz,{asChild:!0,children:v.jsx("button",{id:"search-btn",className:"icon-btn2","aria-label":"Search",onClick:()=>{Ez(),fr()},children:v.jsx(Yt,{name:"search"})})}),v.jsxs(_z,{className:"tipcard",sideOffset:6,children:["Search ",v.jsx("kbd",{children:"⌘K"})]})]}),i&&v.jsx("a",{id:"signout",href:"/auth/logout",title:"Sign out","aria-label":"Sign out",children:v.jsx(Yt,{name:"power"})})]})]})}function Ys(e){return v.jsxs("header",{id:"topbar",children:[v.jsx("button",{id:"menu-btn",className:"icon-btn",title:"Menu","aria-label":"Menu","aria-controls":"sidebar","aria-expanded":"false",onClick:ID,children:v.jsx(Yt,{name:"menu"})}),v.jsx("span",{id:"crumb",children:e.crumb}),v.jsx("span",{id:"meta",children:e.meta}),e.actions]})}function UD(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const HD=e=>{switch(e){case"success":return GD;case"info":return KD;case"warning":return ZD;case"error":return YD;default:return null}},BD=Array(12).fill(0),qD=({visible:e,className:n})=>fe.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},fe.createElement("div",{className:"sonner-spinner"},BD.map((r,i)=>fe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),GD=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),ZD=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),KD=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),YD=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),QD=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},fe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),fe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),XD=()=>{const[e,n]=fe.useState(document.hidden);return fe.useEffect(()=>{const r=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let pm=1;class JD{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const r=this.subscribers.indexOf(n);this.subscribers.splice(r,1)}),this.publish=n=>{this.subscribers.forEach(r=>r(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var r;const{message:i,...s}=n,l=typeof n?.id=="number"||((r=n.id)==null?void 0:r.length)>0?n.id:pm++,c=this.toasts.find(h=>h.id===l),d=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),c?this.toasts=this.toasts.map(h=>h.id===l?(this.publish({...h,...n,id:l,title:i}),{...h,...n,id:l,dismissible:d,title:i}):h):this.addToast({title:i,...s,dismissible:d,id:l}),l},this.dismiss=n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:n,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(i=>i({id:r.id,dismiss:!0}))}),n),this.message=(n,r)=>this.create({...r,message:n}),this.error=(n,r)=>this.create({...r,message:n,type:"error"}),this.success=(n,r)=>this.create({...r,type:"success",message:n}),this.info=(n,r)=>this.create({...r,type:"info",message:n}),this.warning=(n,r)=>this.create({...r,type:"warning",message:n}),this.loading=(n,r)=>this.create({...r,type:"loading",message:n}),this.promise=(n,r)=>{if(!r)return;let i;r.loading!==void 0&&(i=this.create({...r,promise:n,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let l=i!==void 0,c;const d=s.then(async m=>{if(c=["resolve",m],fe.isValidElement(m))l=!1,this.create({id:i,type:"default",message:m});else if(eN(m)&&!m.ok){l=!1;const g=typeof r.error=="function"?await r.error(`HTTP error! status: ${m.status}`):r.error,b=typeof r.description=="function"?await r.description(`HTTP error! status: ${m.status}`):r.description,_=typeof g=="object"&&!fe.isValidElement(g)?g:{message:g};this.create({id:i,type:"error",description:b,..._})}else if(m instanceof Error){l=!1;const g=typeof r.error=="function"?await r.error(m):r.error,b=typeof r.description=="function"?await r.description(m):r.description,_=typeof g=="object"&&!fe.isValidElement(g)?g:{message:g};this.create({id:i,type:"error",description:b,..._})}else if(r.success!==void 0){l=!1;const g=typeof r.success=="function"?await r.success(m):r.success,b=typeof r.description=="function"?await r.description(m):r.description,_=typeof g=="object"&&!fe.isValidElement(g)?g:{message:g};this.create({id:i,type:"success",description:b,..._})}}).catch(async m=>{if(c=["reject",m],r.error!==void 0){l=!1;const y=typeof r.error=="function"?await r.error(m):r.error,g=typeof r.description=="function"?await r.description(m):r.description,S=typeof y=="object"&&!fe.isValidElement(y)?y:{message:y};this.create({id:i,type:"error",description:g,...S})}}).finally(()=>{l&&(this.dismiss(i),i=void 0),r.finally==null||r.finally.call(r)}),h=()=>new Promise((m,y)=>d.then(()=>c[0]==="reject"?y(c[1]):m(c[1])).catch(y));return typeof i!="string"&&typeof i!="number"?{unwrap:h}:Object.assign(i,{unwrap:h})},this.custom=(n,r)=>{const i=r?.id||pm++;return this.create({jsx:n(i),id:i,...r}),i},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const On=new JD,WD=(e,n)=>{const r=n?.id||pm++;return On.addToast({title:e,...n,id:r}),r},eN=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",tN=WD,nN=()=>On.toasts,rN=()=>On.getActiveToasts(),kb=Object.assign(tN,{success:On.success,info:On.info,warning:On.warning,error:On.error,custom:On.custom,message:On.message,promise:On.promise,dismiss:On.dismiss,loading:On.loading},{getHistory:nN,getToasts:rN});UD("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Nu(e){return e.label!==void 0}const oN=3,iN="24px",aN="16px",Lb=4e3,sN=356,lN=14,uN=45,cN=200;function wr(...e){return e.filter(Boolean).join(" ")}function dN(e){const[n,r]=e.split("-"),i=[];return n&&i.push(n),r&&i.push(r),i}const fN=e=>{var n,r,i,s,l,c,d,h,m;const{invert:y,toast:g,unstyled:b,interacting:S,setHeights:_,visibleToasts:C,heights:E,index:T,toasts:O,expanded:A,removeToast:k,defaultRichColors:L,closeButton:q,style:H,cancelButtonStyle:$,actionButtonStyle:he,className:ve="",descriptionClassName:de="",duration:le,position:ae,gap:me,expandByDefault:ye,classNames:N,icons:Y,closeButtonAriaLabel:ne="Close toast"}=e,[J,W]=fe.useState(null),[z,j]=fe.useState(null),[U,Q]=fe.useState(!1),[Z,re]=fe.useState(!1),[ee,ge]=fe.useState(!1),[be,De]=fe.useState(!1),[Ie,Fe]=fe.useState(!1),[st,Qe]=fe.useState(0),[Xt,mn]=fe.useState(0),qt=fe.useRef(g.duration||le||Lb),Ft=fe.useRef(null),Pt=fe.useRef(null),rr=T===0,$e=T+1<=C,ze=g.type,Xe=g.dismissible!==!1,zt=g.className||"",eo=g.descriptionClassName||"",or=fe.useMemo(()=>E.findIndex(Me=>Me.toastId===g.id)||0,[E,g.id]),Ri=fe.useMemo(()=>{var Me;return(Me=g.closeButton)!=null?Me:q},[g.closeButton,q]),to=fe.useMemo(()=>g.duration||le||Lb,[g.duration,le]),Ti=fe.useRef(0),Un=fe.useRef(0),M=fe.useRef(0),V=fe.useRef(null),[F,se]=ae.split("-"),ce=fe.useMemo(()=>E.reduce((Me,mt,yt)=>yt>=or?Me:Me+mt.height,0),[E,or]),pe=XD(),Se=g.invert||y,xe=ze==="loading";Un.current=fe.useMemo(()=>or*me+ce,[or,ce]),fe.useEffect(()=>{qt.current=to},[to]),fe.useEffect(()=>{Q(!0)},[]),fe.useEffect(()=>{const Me=Pt.current;if(Me){const mt=Me.getBoundingClientRect().height;return mn(mt),_(yt=>[{toastId:g.id,height:mt,position:g.position},...yt]),()=>_(yt=>yt.filter(Gt=>Gt.toastId!==g.id))}},[_,g.id]),fe.useLayoutEffect(()=>{if(!U)return;const Me=Pt.current,mt=Me.style.height;Me.style.height="auto";const yt=Me.getBoundingClientRect().height;Me.style.height=mt,mn(yt),_(Gt=>Gt.find(_t=>_t.toastId===g.id)?Gt.map(_t=>_t.toastId===g.id?{..._t,height:yt}:_t):[{toastId:g.id,height:yt,position:g.position},...Gt])},[U,g.title,g.description,_,g.id,g.jsx,g.action,g.cancel]);const Te=fe.useCallback(()=>{re(!0),Qe(Un.current),_(Me=>Me.filter(mt=>mt.toastId!==g.id)),setTimeout(()=>{k(g)},cN)},[g,k,_,Un]);fe.useEffect(()=>{if(g.promise&&ze==="loading"||g.duration===1/0||g.type==="loading")return;let Me;return A||S||pe?(()=>{if(M.current{g.onAutoClose==null||g.onAutoClose.call(g,g),Te()},qt.current)),()=>clearTimeout(Me)},[A,S,g,ze,pe,Te]),fe.useEffect(()=>{g.delete&&(Te(),g.onDismiss==null||g.onDismiss.call(g,g))},[Te,g.delete]);function nt(){var Me;if(Y?.loading){var mt;return fe.createElement("div",{className:wr(N?.loader,g==null||(mt=g.classNames)==null?void 0:mt.loader,"sonner-loader"),"data-visible":ze==="loading"},Y.loading)}return fe.createElement(qD,{className:wr(N?.loader,g==null||(Me=g.classNames)==null?void 0:Me.loader),visible:ze==="loading"})}const wt=g.icon||Y?.[ze]||HD(ze);var Jt,Dt;return fe.createElement("li",{tabIndex:0,ref:Pt,className:wr(ve,zt,N?.toast,g==null||(n=g.classNames)==null?void 0:n.toast,N?.default,N?.[ze],g==null||(r=g.classNames)==null?void 0:r[ze]),"data-sonner-toast":"","data-rich-colors":(Jt=g.richColors)!=null?Jt:L,"data-styled":!(g.jsx||g.unstyled||b),"data-mounted":U,"data-promise":!!g.promise,"data-swiped":Ie,"data-removed":Z,"data-visible":$e,"data-y-position":F,"data-x-position":se,"data-index":T,"data-front":rr,"data-swiping":ee,"data-dismissible":Xe,"data-type":ze,"data-invert":Se,"data-swipe-out":be,"data-swipe-direction":z,"data-expanded":!!(A||ye&&U),"data-testid":g.testId,style:{"--index":T,"--toasts-before":T,"--z-index":O.length-T,"--offset":`${Z?st:Un.current}px`,"--initial-height":ye?"auto":`${Xt}px`,...H,...g.style},onDragEnd:()=>{ge(!1),W(null),V.current=null},onPointerDown:Me=>{Me.button!==2&&(xe||!Xe||(Ft.current=new Date,Qe(Un.current),Me.target.setPointerCapture(Me.pointerId),Me.target.tagName!=="BUTTON"&&(ge(!0),V.current={x:Me.clientX,y:Me.clientY})))},onPointerUp:()=>{var Me,mt,yt;if(be||!Xe)return;V.current=null;const Gt=Number(((Me=Pt.current)==null?void 0:Me.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ir=Number(((mt=Pt.current)==null?void 0:mt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_t=new Date().getTime()-((yt=Ft.current)==null?void 0:yt.getTime()),yn=J==="x"?Gt:ir,qo=Math.abs(yn)/_t;if(Math.abs(yn)>=uN||qo>.11){Qe(Un.current),g.onDismiss==null||g.onDismiss.call(g,g),j(J==="x"?Gt>0?"right":"left":ir>0?"down":"up"),Te(),De(!0);return}else{var bn,Sn;(bn=Pt.current)==null||bn.style.setProperty("--swipe-amount-x","0px"),(Sn=Pt.current)==null||Sn.style.setProperty("--swipe-amount-y","0px")}Fe(!1),ge(!1),W(null)},onPointerMove:Me=>{var mt,yt,Gt;if(!V.current||!Xe||((mt=window.getSelection())==null?void 0:mt.toString().length)>0)return;const _t=Me.clientY-V.current.y,yn=Me.clientX-V.current.x;var qo;const bn=(qo=e.swipeDirections)!=null?qo:dN(ae);!J&&(Math.abs(yn)>1||Math.abs(_t)>1)&&W(Math.abs(yn)>Math.abs(_t)?"x":"y");let Sn={x:0,y:0};const Oi=ar=>1/(1.5+Math.abs(ar)/20);if(J==="y"){if(bn.includes("top")||bn.includes("bottom"))if(bn.includes("top")&&_t<0||bn.includes("bottom")&&_t>0)Sn.y=_t;else{const ar=_t*Oi(_t);Sn.y=Math.abs(ar)0)Sn.x=yn;else{const ar=yn*Oi(yn);Sn.x=Math.abs(ar)0||Math.abs(Sn.y)>0)&&Fe(!0),(yt=Pt.current)==null||yt.style.setProperty("--swipe-amount-x",`${Sn.x}px`),(Gt=Pt.current)==null||Gt.style.setProperty("--swipe-amount-y",`${Sn.y}px`)}},Ri&&!g.jsx&&ze!=="loading"?fe.createElement("button",{"aria-label":ne,"data-disabled":xe,"data-close-button":!0,onClick:xe||!Xe?()=>{}:()=>{Te(),g.onDismiss==null||g.onDismiss.call(g,g)},className:wr(N?.closeButton,g==null||(i=g.classNames)==null?void 0:i.closeButton)},(Dt=Y?.close)!=null?Dt:QD):null,(ze||g.icon||g.promise)&&g.icon!==null&&(Y?.[ze]!==null||g.icon)?fe.createElement("div",{"data-icon":"",className:wr(N?.icon,g==null||(s=g.classNames)==null?void 0:s.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||nt():null,g.type!=="loading"?wt:null):null,fe.createElement("div",{"data-content":"",className:wr(N?.content,g==null||(l=g.classNames)==null?void 0:l.content)},fe.createElement("div",{"data-title":"",className:wr(N?.title,g==null||(c=g.classNames)==null?void 0:c.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?fe.createElement("div",{"data-description":"",className:wr(de,eo,N?.description,g==null||(d=g.classNames)==null?void 0:d.description)},typeof g.description=="function"?g.description():g.description):null),fe.isValidElement(g.cancel)?g.cancel:g.cancel&&Nu(g.cancel)?fe.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||$,onClick:Me=>{Nu(g.cancel)&&Xe&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,Me),Te())},className:wr(N?.cancelButton,g==null||(h=g.classNames)==null?void 0:h.cancelButton)},g.cancel.label):null,fe.isValidElement(g.action)?g.action:g.action&&Nu(g.action)?fe.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||he,onClick:Me=>{Nu(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,Me),!Me.defaultPrevented&&Te())},className:wr(N?.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function Ib(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function hN(e,n){const r={};return[e,n].forEach((i,s)=>{const l=s===1,c=l?"--mobile-offset":"--offset",d=l?aN:iN;function h(m){["top","right","bottom","left"].forEach(y=>{r[`${c}-${y}`]=typeof m=="number"?`${m}px`:m})}typeof i=="number"||typeof i=="string"?h(i):typeof i=="object"?["top","right","bottom","left"].forEach(m=>{i[m]===void 0?r[`${c}-${m}`]=d:r[`${c}-${m}`]=typeof i[m]=="number"?`${i[m]}px`:i[m]}):h(d)}),r}const mN=fe.forwardRef(function(n,r){const{id:i,invert:s,position:l="bottom-right",hotkey:c=["altKey","KeyT"],expand:d,closeButton:h,className:m,offset:y,mobileOffset:g,theme:b="light",richColors:S,duration:_,style:C,visibleToasts:E=oN,toastOptions:T,dir:O=Ib(),gap:A=lN,icons:k,containerAriaLabel:L="Notifications"}=n,[q,H]=fe.useState([]),$=fe.useMemo(()=>i?q.filter(U=>U.toasterId===i):q.filter(U=>!U.toasterId),[q,i]),he=fe.useMemo(()=>Array.from(new Set([l].concat($.filter(U=>U.position).map(U=>U.position)))),[$,l]),[ve,de]=fe.useState([]),[le,ae]=fe.useState(!1),[me,ye]=fe.useState(!1),[N,Y]=fe.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ne=fe.useRef(null),J=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=fe.useRef(null),z=fe.useRef(!1),j=fe.useCallback(U=>{H(Q=>{var Z;return(Z=Q.find(re=>re.id===U.id))!=null&&Z.delete||On.dismiss(U.id),Q.filter(({id:re})=>re!==U.id)})},[]);return fe.useEffect(()=>On.subscribe(U=>{if(U.dismiss){requestAnimationFrame(()=>{H(Q=>Q.map(Z=>Z.id===U.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{sT.flushSync(()=>{H(Q=>{const Z=Q.findIndex(re=>re.id===U.id);return Z!==-1?[...Q.slice(0,Z),{...Q[Z],...U},...Q.slice(Z+1)]:[U,...Q]})})})}),[q]),fe.useEffect(()=>{if(b!=="system"){Y(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:Q})=>{Y(Q?"dark":"light")})}catch{U.addListener(({matches:Z})=>{try{Y(Z?"dark":"light")}catch(re){console.error(re)}})}},[b]),fe.useEffect(()=>{q.length<=1&&ae(!1)},[q]),fe.useEffect(()=>{const U=Q=>{var Z;if(c.every(ge=>Q[ge]||Q.code===ge)){var ee;ae(!0),(ee=ne.current)==null||ee.focus()}Q.code==="Escape"&&(document.activeElement===ne.current||(Z=ne.current)!=null&&Z.contains(document.activeElement))&&ae(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[c]),fe.useEffect(()=>{if(ne.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,z.current=!1)}},[ne.current]),fe.createElement("section",{ref:r,"aria-label":`${L} ${J}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},he.map((U,Q)=>{var Z;const[re,ee]=U.split("-");return $.length?fe.createElement("ol",{key:U,dir:O==="auto"?Ib():O,tabIndex:-1,ref:ne,className:m,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":re,"data-x-position":ee,style:{"--front-toast-height":`${((Z=ve[0])==null?void 0:Z.height)||0}px`,"--width":`${sN}px`,"--gap":`${A}px`,...C,...hN(y,g)},onBlur:ge=>{z.current&&!ge.currentTarget.contains(ge.relatedTarget)&&(z.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:ge=>{ge.target instanceof HTMLElement&&ge.target.dataset.dismissible==="false"||z.current||(z.current=!0,W.current=ge.relatedTarget)},onMouseEnter:()=>ae(!0),onMouseMove:()=>ae(!0),onMouseLeave:()=>{me||ae(!1)},onDragEnd:()=>ae(!1),onPointerDown:ge=>{ge.target instanceof HTMLElement&&ge.target.dataset.dismissible==="false"||ye(!0)},onPointerUp:()=>ye(!1)},$.filter(ge=>!ge.position&&Q===0||ge.position===U).map((ge,be)=>{var De,Ie;return fe.createElement(fN,{key:ge.id,icons:k,index:be,toast:ge,defaultRichColors:S,duration:(De=T?.duration)!=null?De:_,className:T?.className,descriptionClassName:T?.descriptionClassName,invert:s,visibleToasts:E,closeButton:(Ie=T?.closeButton)!=null?Ie:h,interacting:me,position:U,style:T?.style,unstyled:T?.unstyled,classNames:T?.classNames,cancelButtonStyle:T?.cancelButtonStyle,actionButtonStyle:T?.actionButtonStyle,closeButtonAriaLabel:T?.closeButtonAriaLabel,removeToast:j,toasts:$.filter(Fe=>Fe.position==ge.position),heights:ve.filter(Fe=>Fe.position==ge.position),setHeights:de,expandByDefault:d,gap:A,expanded:le,swipeDirections:n.swipeDirections})})):null}))}),pN=({...e})=>v.jsx(mN,{theme:"dark",className:"toaster group",icons:{success:v.jsx(Vz,{className:"size-4"}),info:v.jsx(rD,{className:"size-4"}),warning:v.jsx(M1,{className:"size-4"}),error:v.jsx(vD,{className:"size-4"}),loading:v.jsx(uD,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius-ctl)"},...e});function Je(e,n=!1){n?kb.error(e,{duration:1/0,closeButton:!0}):kb(e)}function gN(){return v.jsx(pN,{position:"bottom-center"})}const $b=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Vb=f1,vN=(e,n)=>r=>{var i;if(n?.variants==null)return Vb(e,r?.class,r?.className);const{variants:s,defaultVariants:l}=n,c=Object.keys(s).map(m=>{const y=r?.[m],g=l?.[m];if(y===null)return null;const b=$b(y)||$b(g);return s[m][b]}),d=r&&Object.entries(r).reduce((m,y)=>{let[g,b]=y;return b===void 0||(m[g]=b),m},{}),h=n==null||(i=n.compoundVariants)===null||i===void 0?void 0:i.reduce((m,y)=>{let{class:g,className:b,...S}=y;return Object.entries(S).every(_=>{let[C,E]=_;return Array.isArray(E)?E.includes({...l,...d}[C]):{...l,...d}[C]===E})?[...m,g,b]:m},[]);return Vb(e,c,h,r?.class,r?.className)},yN=vN("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[background-color,border-color,color] disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",primary:"pbtn",danger:"danger-btn",subtle:"ai-btn",toolbar:"btn",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Bt({className:e,variant:n="default",size:r="default",asChild:i=!1,...s}){const l=i?lT:"button";return v.jsx(l,{"data-slot":"button","data-variant":n,"data-size":r,className:St(yN({variant:n,size:r,className:e})),...s})}function xp({...e}){return v.jsx(Hm,{"data-slot":"dialog",...e})}function bN({...e}){return v.jsx(qm,{"data-slot":"dialog-portal",...e})}function SN({className:e,...n}){return v.jsx(Gm,{"data-slot":"dialog-overlay",className:St("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...n})}function wp({className:e,children:n,showCloseButton:r=!0,...i}){return v.jsxs(bN,{"data-slot":"dialog-portal",children:[v.jsx(SN,{}),v.jsxs(Zm,{"data-slot":"dialog-content",className:St("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...i,children:[n,r&&v.jsxs(Sx,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[v.jsx(j1,{}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function $c({className:e,...n}){return v.jsx(vx,{"data-slot":"dialog-title",className:St("text-lg leading-none font-semibold",e),...n})}let z1=null,Gu=[];function ll(e){z1=e,Gu.forEach(n=>n())}function _p(e,n,r="",i="OK",s={}){return new Promise(l=>ll({kind:"prompt",title:e,label:n,value:r,okLabel:i,...s,resolve:l}))}function Cp(e,n,r="Confirm",i=!1){return new Promise(s=>ll({kind:"confirm",title:e,message:n,confirmLabel:r,danger:i,resolve:s}))}function xN(){const e=x.useSyncExternalStore(r=>(Gu.push(r),()=>{Gu=Gu.filter(i=>i!==r)}),()=>z1);if(!e)return null;const n=()=>{ll(null),e.kind==="prompt"?e.resolve(null):e.resolve(!1)};return v.jsx(xp,{open:!0,onOpenChange:r=>!r&&n(),children:v.jsx(wp,{className:"modal",showCloseButton:!1,children:e.kind==="prompt"?v.jsx(wN,{m:e}):v.jsx(_N,{m:e})})})}function wN({m:e}){const n=x.useRef(null),r=m=>{ll(null),e.resolve(m)},[i,s]=x.useState(""),[l,c]=x.useState(e.value),d=e.match===void 0||l.trim()===e.match,h=()=>{const m=l;if(d){if(!m.trim()){s("Give it a name."),n.current.focus();return}r(m)}};return v.jsxs(v.Fragment,{children:[v.jsx($c,{asChild:!0,children:v.jsx("h3",{children:e.title})}),v.jsx("label",{className:"modal-label",htmlFor:"modal-input",children:e.label}),v.jsx("input",{className:"modal-input",type:"text",autoComplete:"off",value:l,ref:n,id:"modal-input",autoFocus:!0,onFocus:m=>m.currentTarget.select(),"aria-invalid":!!i,"aria-describedby":i?"modal-input-err":void 0,onChange:m=>{c(m.currentTarget.value),i&&s("")},onKeyDown:m=>m.key==="Enter"&&h()}),i&&v.jsx("span",{id:"modal-input-err",role:"alert",className:"field-err",children:i}),v.jsxs("div",{className:"modal-actions",children:[v.jsx(Bt,{variant:"subtle",onClick:()=>r(null),children:"Cancel"}),v.jsx(Bt,{variant:e.danger?"danger":"primary",onClick:h,disabled:!d,children:e.okLabel})]})]})}function _N({m:e}){const n=r=>{ll(null),e.resolve(r)};return v.jsxs(v.Fragment,{children:[v.jsx($c,{asChild:!0,children:v.jsx("h3",{children:e.title})}),v.jsx("p",{className:"modal-msg",children:e.message}),v.jsxs("div",{className:"modal-actions",children:[v.jsx(Bt,{variant:"subtle",onClick:()=>n(!1),autoFocus:e.danger,children:"Cancel"}),v.jsx(Bt,{variant:e.danger?"danger":"primary",onClick:()=>n(!0),autoFocus:!e.danger,children:e.confirmLabel})]})]})}function CN(e){return jn({queryKey:["projects"],queryFn:()=>Fn("/api/projects"),enabled:e,refetchInterval:3e4,select:n=>n.projects||[]})}function EN(e){return jn({queryKey:["orgs"],queryFn:()=>Fn("/api/orgs"),enabled:e,select:n=>n.orgs||[]})}function D1(e){return jn({queryKey:["admin","pending"],queryFn:()=>Fn("/api/admin/pending"),enabled:e,select:n=>n.pending||[]})}function N1(){const e=tl();return()=>Promise.all([e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["orgs"]})]).then(()=>{})}function k1(e){return e.split("/").map(encodeURIComponent).join("/")}function Fb(e){return e.split("/").map(decodeURIComponent).join("/")}const RN=new Set(["insights","history","install","settings"]);function L1(e,n){const r=e.replace(/^\/+/,"");if(n!=="hub")return{path:r?Fb(r):""};if(r==="orgs"||r.startsWith("orgs/"))return{org:r.slice(5).replace(/\/+$/,""),path:""};const i=r.indexOf("/");if(i===-1)return{project:r,path:""};const s={project:r.slice(0,i),path:Fb(r.slice(i+1))},l=s.path.indexOf("/"),c=l===-1?s.path:s.path.slice(0,l);return RN.has(c)&&(s.view=c,s.viewTarget=l===-1?"":s.path.slice(l+1).replace(/\/+$/,""),s.path=""),s}function TN(e,n){const r=k1(e);return n?"/"+n+(r?"/"+r:""):"/"+r}function _a(e,n,r){let i=(n?"/"+n:"")+"/"+e;return r&&(i+="/"+k1(r.replace(/\/+$/,""))),i}let Ep="POP";const gm=new Set;function I1(){for(const e of gm)e()}window.addEventListener("popstate",()=>{Ep="POP",I1()});function fn(e,n){const r=location.pathname+location.search;!n?.replace&&r===e||(history[n?.replace?"replaceState":"pushState"](null,"",e),Ep=n?.replace?"REPLACE":"PUSH",I1())}function Rp(){return x.useSyncExternalStore(e=>(gm.add(e),()=>{gm.delete(e)}),()=>location.pathname)}function ON(){return Ep}function $1(e){return e.startsWith("/")&&!e.startsWith("//")?{href:e,onClick:r=>{r.defaultPrevented||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||r.button!==0||(r.preventDefault(),fn(e),document.body.classList.remove("sb-open"))}}:{href:e,target:"_blank",rel:"noopener noreferrer"}}function AN({to:e}){return x.useEffect(()=>{fn(e,{replace:!0})},[e]),null}function V1(){return{accessor:(e,n)=>typeof e=="function"?{...n,accessorFn:e}:{...n,accessorKey:e},display:e=>e,group:e=>e}}function Ao(e,n){return typeof e=="function"?e(n):e}function Pn(e,n){return r=>{n.setState(i=>({...i,[e]:Ao(r,i[e])}))}}function Vc(e){return e instanceof Function}function MN(e){return Array.isArray(e)&&e.every(n=>typeof n=="number")}function jN(e,n){const r=[],i=s=>{s.forEach(l=>{r.push(l);const c=n(l);c!=null&&c.length&&i(c)})};return i(e),r}function Ne(e,n,r){let i=[],s;return l=>{let c;r.key&&r.debug&&(c=Date.now());const d=e(l);if(!(d.length!==i.length||d.some((y,g)=>i[g]!==y)))return s;i=d;let m;if(r.key&&r.debug&&(m=Date.now()),s=n(...d),r==null||r.onChange==null||r.onChange(s),r.key&&r.debug&&r!=null&&r.debug()){const y=Math.round((Date.now()-c)*100)/100,g=Math.round((Date.now()-m)*100)/100,b=g/16,S=(_,C)=>{for(_=String(_);_.length{var s;return(s=e?.debugAll)!=null?s:e[n]},key:!1,onChange:i}}function zN(e,n,r,i){const s=()=>{var c;return(c=l.getValue())!=null?c:e.options.renderFallbackValue},l={id:`${n.id}_${r.id}`,row:n,column:r,getValue:()=>n.getValue(i),renderValue:s,getContext:Ne(()=>[e,r,n,l],(c,d,h,m)=>({table:c,column:d,row:h,cell:m,getValue:m.getValue,renderValue:m.renderValue}),ke(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(l,r,n,e)},{}),l}function DN(e,n,r,i){var s,l;const d={...e._getDefaultColumnDef(),...n},h=d.accessorKey;let m=(s=(l=d.id)!=null?l:h?typeof String.prototype.replaceAll=="function"?h.replaceAll(".","_"):h.replace(/\./g,"_"):void 0)!=null?s:typeof d.header=="string"?d.header:void 0,y;if(d.accessorFn?y=d.accessorFn:h&&(h.includes(".")?y=b=>{let S=b;for(const C of h.split(".")){var _;S=(_=S)==null?void 0:_[C]}return S}:y=b=>b[d.accessorKey]),!m)throw new Error;let g={id:`${String(m)}`,accessorFn:y,parent:i,depth:r,columnDef:d,columns:[],getFlatColumns:Ne(()=>[!0],()=>{var b;return[g,...(b=g.columns)==null?void 0:b.flatMap(S=>S.getFlatColumns())]},ke(e.options,"debugColumns")),getLeafColumns:Ne(()=>[e._getOrderColumnsFn()],b=>{var S;if((S=g.columns)!=null&&S.length){let _=g.columns.flatMap(C=>C.getLeafColumns());return b(_)}return[g]},ke(e.options,"debugColumns"))};for(const b of e._features)b.createColumn==null||b.createColumn(g,e);return g}const dn="debugHeaders";function Pb(e,n,r){var i;let l={id:(i=r.id)!=null?i:n.id,column:n,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const c=[],d=h=>{h.subHeaders&&h.subHeaders.length&&h.subHeaders.map(d),c.push(h)};return d(l),c},getContext:()=>({table:e,header:l,column:n})};return e._features.forEach(c=>{c.createHeader==null||c.createHeader(l,e)}),l}const NN={createTable:e=>{e.getHeaderGroups=Ne(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i,s)=>{var l,c;const d=(l=i?.map(g=>r.find(b=>b.id===g)).filter(Boolean))!=null?l:[],h=(c=s?.map(g=>r.find(b=>b.id===g)).filter(Boolean))!=null?c:[],m=r.filter(g=>!(i!=null&&i.includes(g.id))&&!(s!=null&&s.includes(g.id)));return ku(n,[...d,...m,...h],e)},ke(e.options,dn)),e.getCenterHeaderGroups=Ne(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i,s)=>(r=r.filter(l=>!(i!=null&&i.includes(l.id))&&!(s!=null&&s.includes(l.id))),ku(n,r,e,"center")),ke(e.options,dn)),e.getLeftHeaderGroups=Ne(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,r,i)=>{var s;const l=(s=i?.map(c=>r.find(d=>d.id===c)).filter(Boolean))!=null?s:[];return ku(n,l,e,"left")},ke(e.options,dn)),e.getRightHeaderGroups=Ne(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,r,i)=>{var s;const l=(s=i?.map(c=>r.find(d=>d.id===c)).filter(Boolean))!=null?s:[];return ku(n,l,e,"right")},ke(e.options,dn)),e.getFooterGroups=Ne(()=>[e.getHeaderGroups()],n=>[...n].reverse(),ke(e.options,dn)),e.getLeftFooterGroups=Ne(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),ke(e.options,dn)),e.getCenterFooterGroups=Ne(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),ke(e.options,dn)),e.getRightFooterGroups=Ne(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),ke(e.options,dn)),e.getFlatHeaders=Ne(()=>[e.getHeaderGroups()],n=>n.map(r=>r.headers).flat(),ke(e.options,dn)),e.getLeftFlatHeaders=Ne(()=>[e.getLeftHeaderGroups()],n=>n.map(r=>r.headers).flat(),ke(e.options,dn)),e.getCenterFlatHeaders=Ne(()=>[e.getCenterHeaderGroups()],n=>n.map(r=>r.headers).flat(),ke(e.options,dn)),e.getRightFlatHeaders=Ne(()=>[e.getRightHeaderGroups()],n=>n.map(r=>r.headers).flat(),ke(e.options,dn)),e.getCenterLeafHeaders=Ne(()=>[e.getCenterFlatHeaders()],n=>n.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),ke(e.options,dn)),e.getLeftLeafHeaders=Ne(()=>[e.getLeftFlatHeaders()],n=>n.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),ke(e.options,dn)),e.getRightLeafHeaders=Ne(()=>[e.getRightFlatHeaders()],n=>n.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),ke(e.options,dn)),e.getLeafHeaders=Ne(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,r,i)=>{var s,l,c,d,h,m;return[...(s=(l=n[0])==null?void 0:l.headers)!=null?s:[],...(c=(d=r[0])==null?void 0:d.headers)!=null?c:[],...(h=(m=i[0])==null?void 0:m.headers)!=null?h:[]].map(y=>y.getLeafHeaders()).flat()},ke(e.options,dn))}};function ku(e,n,r,i){var s,l;let c=0;const d=function(b,S){S===void 0&&(S=1),c=Math.max(c,S),b.filter(_=>_.getIsVisible()).forEach(_=>{var C;(C=_.columns)!=null&&C.length&&d(_.columns,S+1)},0)};d(e);let h=[];const m=(b,S)=>{const _={depth:S,id:[i,`${S}`].filter(Boolean).join("_"),headers:[]},C=[];b.forEach(E=>{const T=[...C].reverse()[0],O=E.column.depth===_.depth;let A,k=!1;if(O&&E.column.parent?A=E.column.parent:(A=E.column,k=!0),T&&T?.column===A)T.subHeaders.push(E);else{const L=Pb(r,A,{id:[i,S,A.id,E?.id].filter(Boolean).join("_"),isPlaceholder:k,placeholderId:k?`${C.filter(q=>q.column===A).length}`:void 0,depth:S,index:C.length});L.subHeaders.push(E),C.push(L)}_.headers.push(E),E.headerGroup=_}),h.push(_),S>0&&m(C,S-1)},y=n.map((b,S)=>Pb(r,b,{depth:c,index:S}));m(y,c-1),h.reverse();const g=b=>b.filter(_=>_.column.getIsVisible()).map(_=>{let C=0,E=0,T=[0];_.subHeaders&&_.subHeaders.length?(T=[],g(_.subHeaders).forEach(A=>{let{colSpan:k,rowSpan:L}=A;C+=k,T.push(L)})):C=1;const O=Math.min(...T);return E=E+O,_.colSpan=C,_.rowSpan=E,{colSpan:C,rowSpan:E}});return g((s=(l=h[0])==null?void 0:l.headers)!=null?s:[]),h}const kN=(e,n,r,i,s,l,c)=>{let d={id:n,index:i,original:r,depth:s,parentId:c,_valuesCache:{},_uniqueValuesCache:{},getValue:h=>{if(d._valuesCache.hasOwnProperty(h))return d._valuesCache[h];const m=e.getColumn(h);if(m!=null&&m.accessorFn)return d._valuesCache[h]=m.accessorFn(d.original,i),d._valuesCache[h]},getUniqueValues:h=>{if(d._uniqueValuesCache.hasOwnProperty(h))return d._uniqueValuesCache[h];const m=e.getColumn(h);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(d._uniqueValuesCache[h]=m.columnDef.getUniqueValues(d.original,i),d._uniqueValuesCache[h]):(d._uniqueValuesCache[h]=[d.getValue(h)],d._uniqueValuesCache[h])},renderValue:h=>{var m;return(m=d.getValue(h))!=null?m:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>jN(d.subRows,h=>h.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let h=[],m=d;for(;;){const y=m.getParentRow();if(!y)break;h.push(y),m=y}return h.reverse()},getAllCells:Ne(()=>[e.getAllLeafColumns()],h=>h.map(m=>zN(e,d,m,m.id)),ke(e.options,"debugRows")),_getAllCellsByColumnId:Ne(()=>[d.getAllCells()],h=>h.reduce((m,y)=>(m[y.column.id]=y,m),{}),ke(e.options,"debugRows"))};for(let h=0;h{e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},F1=(e,n,r)=>{var i,s;const l=r==null||(i=r.toString())==null?void 0:i.toLowerCase();return!!(!((s=e.getValue(n))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(l))};F1.autoRemove=e=>mr(e);const P1=(e,n,r)=>{var i;return!!(!((i=e.getValue(n))==null||(i=i.toString())==null)&&i.includes(r))};P1.autoRemove=e=>mr(e);const U1=(e,n,r)=>{var i;return((i=e.getValue(n))==null||(i=i.toString())==null?void 0:i.toLowerCase())===r?.toLowerCase()};U1.autoRemove=e=>mr(e);const H1=(e,n,r)=>{var i;return(i=e.getValue(n))==null?void 0:i.includes(r)};H1.autoRemove=e=>mr(e);const B1=(e,n,r)=>!r.some(i=>{var s;return!((s=e.getValue(n))!=null&&s.includes(i))});B1.autoRemove=e=>mr(e)||!(e!=null&&e.length);const q1=(e,n,r)=>r.some(i=>{var s;return(s=e.getValue(n))==null?void 0:s.includes(i)});q1.autoRemove=e=>mr(e)||!(e!=null&&e.length);const G1=(e,n,r)=>e.getValue(n)===r;G1.autoRemove=e=>mr(e);const Z1=(e,n,r)=>e.getValue(n)==r;Z1.autoRemove=e=>mr(e);const Tp=(e,n,r)=>{let[i,s]=r;const l=e.getValue(n);return l>=i&&l<=s};Tp.resolveFilterValue=e=>{let[n,r]=e,i=typeof n!="number"?parseFloat(n):n,s=typeof r!="number"?parseFloat(r):r,l=n===null||Number.isNaN(i)?-1/0:i,c=r===null||Number.isNaN(s)?1/0:s;if(l>c){const d=l;l=c,c=d}return[l,c]};Tp.autoRemove=e=>mr(e)||mr(e[0])&&mr(e[1]);const Yr={includesString:F1,includesStringSensitive:P1,equalsString:U1,arrIncludes:H1,arrIncludesAll:B1,arrIncludesSome:q1,equals:G1,weakEquals:Z1,inNumberRange:Tp};function mr(e){return e==null||e===""}const IN={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Pn("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const r=n.getCoreRowModel().flatRows[0],i=r?.getValue(e.id);return typeof i=="string"?Yr.includesString:typeof i=="number"?Yr.inNumberRange:typeof i=="boolean"||i!==null&&typeof i=="object"?Yr.equals:Array.isArray(i)?Yr.arrIncludes:Yr.weakEquals},e.getFilterFn=()=>{var r,i;return Vc(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(r=(i=n.options.filterFns)==null?void 0:i[e.columnDef.filterFn])!=null?r:Yr[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,i,s;return((r=e.columnDef.enableColumnFilter)!=null?r:!0)&&((i=n.options.enableColumnFilters)!=null?i:!0)&&((s=n.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return(r=n.getState().columnFilters)==null||(r=r.find(i=>i.id===e.id))==null?void 0:r.value},e.getFilterIndex=()=>{var r,i;return(r=(i=n.getState().columnFilters)==null?void 0:i.findIndex(s=>s.id===e.id))!=null?r:-1},e.setFilterValue=r=>{n.setColumnFilters(i=>{const s=e.getFilterFn(),l=i?.find(y=>y.id===e.id),c=Ao(r,l?l.value:void 0);if(Ub(s,c,e)){var d;return(d=i?.filter(y=>y.id!==e.id))!=null?d:[]}const h={id:e.id,value:c};if(l){var m;return(m=i?.map(y=>y.id===e.id?h:y))!=null?m:[]}return i!=null&&i.length?[...i,h]:[h]})}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const r=e.getAllLeafColumns(),i=s=>{var l;return(l=Ao(n,s))==null?void 0:l.filter(c=>{const d=r.find(h=>h.id===c.id);if(d){const h=d.getFilterFn();if(Ub(h,c.value,d))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(i)},e.resetColumnFilters=n=>{var r,i;e.setColumnFilters(n?[]:(r=(i=e.initialState)==null?void 0:i.columnFilters)!=null?r:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Ub(e,n,r){return(e&&e.autoRemove?e.autoRemove(n,r):!1)||typeof n>"u"||typeof n=="string"&&!n}const $N=(e,n,r)=>r.reduce((i,s)=>{const l=s.getValue(e);return i+(typeof l=="number"?l:0)},0),VN=(e,n,r)=>{let i;return r.forEach(s=>{const l=s.getValue(e);l!=null&&(i>l||i===void 0&&l>=l)&&(i=l)}),i},FN=(e,n,r)=>{let i;return r.forEach(s=>{const l=s.getValue(e);l!=null&&(i=l)&&(i=l)}),i},PN=(e,n,r)=>{let i,s;return r.forEach(l=>{const c=l.getValue(e);c!=null&&(i===void 0?c>=c&&(i=s=c):(i>c&&(i=c),s{let r=0,i=0;if(n.forEach(s=>{let l=s.getValue(e);l!=null&&(l=+l)>=l&&(++r,i+=l)}),r)return i/r},HN=(e,n)=>{if(!n.length)return;const r=n.map(l=>l.getValue(e));if(!MN(r))return;if(r.length===1)return r[0];const i=Math.floor(r.length/2),s=r.sort((l,c)=>l-c);return r.length%2!==0?s[i]:(s[i-1]+s[i])/2},BN=(e,n)=>Array.from(new Set(n.map(r=>r.getValue(e))).values()),qN=(e,n)=>new Set(n.map(r=>r.getValue(e))).size,GN=(e,n)=>n.length,Ah={sum:$N,min:VN,max:FN,extent:PN,mean:UN,median:HN,unique:BN,uniqueCount:qN,count:GN},ZN={getDefaultColumnDef:()=>({aggregatedCell:e=>{var n,r;return(n=(r=e.getValue())==null||r.toString==null?void 0:r.toString())!=null?n:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Pn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,n)=>{e.toggleGrouping=()=>{n.setGrouping(r=>r!=null&&r.includes(e.id)?r.filter(i=>i!==e.id):[...r??[],e.id])},e.getCanGroup=()=>{var r,i;return((r=e.columnDef.enableGrouping)!=null?r:!0)&&((i=n.options.enableGrouping)!=null?i:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return(r=n.getState().grouping)==null?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return(r=n.getState().grouping)==null?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const r=e.getCanGroup();return()=>{r&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=n.getCoreRowModel().flatRows[0],i=r?.getValue(e.id);if(typeof i=="number")return Ah.sum;if(Object.prototype.toString.call(i)==="[object Date]")return Ah.extent},e.getAggregationFn=()=>{var r,i;if(!e)throw new Error;return Vc(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(r=(i=n.options.aggregationFns)==null?void 0:i[e.columnDef.aggregationFn])!=null?r:Ah[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=n=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(n),e.resetGrouping=n=>{var r,i;e.setGrouping(n?[]:(r=(i=e.initialState)==null?void 0:i.grouping)!=null?r:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,n)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const i=n.getColumn(r);return i!=null&&i.columnDef.getGroupingValue?(e._groupingValuesCache[r]=i.columnDef.getGroupingValue(e.original),e._groupingValuesCache[r]):e.getValue(r)},e._groupingValuesCache={}},createCell:(e,n,r,i)=>{e.getIsGrouped=()=>n.getIsGrouped()&&n.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&n.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=r.subRows)!=null&&s.length)}}};function KN(e,n,r){if(!(n!=null&&n.length)||!r)return e;const i=e.filter(l=>!n.includes(l.id));return r==="remove"?i:[...n.map(l=>e.find(c=>c.id===l)).filter(Boolean),...i]}const YN={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Pn("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=Ne(r=>[$s(n,r)],r=>r.findIndex(i=>i.id===e.id),ke(n.options,"debugColumns")),e.getIsFirstColumn=r=>{var i;return((i=$s(n,r)[0])==null?void 0:i.id)===e.id},e.getIsLastColumn=r=>{var i;const s=$s(n,r);return((i=s[s.length-1])==null?void 0:i.id)===e.id}},createTable:e=>{e.setColumnOrder=n=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(n),e.resetColumnOrder=n=>{var r;e.setColumnOrder(n?[]:(r=e.initialState.columnOrder)!=null?r:[])},e._getOrderColumnsFn=Ne(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,r,i)=>s=>{let l=[];if(!(n!=null&&n.length))l=s;else{const c=[...n],d=[...s];for(;d.length&&c.length;){const h=c.shift(),m=d.findIndex(y=>y.id===h);m>-1&&l.push(d.splice(m,1)[0])}l=[...l,...d]}return KN(l,r,i)},ke(e.options,"debugTable"))}},Mh=()=>({left:[],right:[]}),QN={getInitialState:e=>({columnPinning:Mh(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Pn("columnPinning",e)}),createColumn:(e,n)=>{e.pin=r=>{const i=e.getLeafColumns().map(s=>s.id).filter(Boolean);n.setColumnPinning(s=>{var l,c;if(r==="right"){var d,h;return{left:((d=s?.left)!=null?d:[]).filter(g=>!(i!=null&&i.includes(g))),right:[...((h=s?.right)!=null?h:[]).filter(g=>!(i!=null&&i.includes(g))),...i]}}if(r==="left"){var m,y;return{left:[...((m=s?.left)!=null?m:[]).filter(g=>!(i!=null&&i.includes(g))),...i],right:((y=s?.right)!=null?y:[]).filter(g=>!(i!=null&&i.includes(g)))}}return{left:((l=s?.left)!=null?l:[]).filter(g=>!(i!=null&&i.includes(g))),right:((c=s?.right)!=null?c:[]).filter(g=>!(i!=null&&i.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(i=>{var s,l,c;return((s=i.columnDef.enablePinning)!=null?s:!0)&&((l=(c=n.options.enableColumnPinning)!=null?c:n.options.enablePinning)!=null?l:!0)}),e.getIsPinned=()=>{const r=e.getLeafColumns().map(d=>d.id),{left:i,right:s}=n.getState().columnPinning,l=r.some(d=>i?.includes(d)),c=r.some(d=>s?.includes(d));return l?"left":c?"right":!1},e.getPinnedIndex=()=>{var r,i;const s=e.getIsPinned();return s?(r=(i=n.getState().columnPinning)==null||(i=i[s])==null?void 0:i.indexOf(e.id))!=null?r:-1:0}},createRow:(e,n)=>{e.getCenterVisibleCells=Ne(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(r,i,s)=>{const l=[...i??[],...s??[]];return r.filter(c=>!l.includes(c.column.id))},ke(n.options,"debugRows")),e.getLeftVisibleCells=Ne(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left],(r,i)=>(i??[]).map(l=>r.find(c=>c.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),ke(n.options,"debugRows")),e.getRightVisibleCells=Ne(()=>[e._getAllVisibleCells(),n.getState().columnPinning.right],(r,i)=>(i??[]).map(l=>r.find(c=>c.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),ke(n.options,"debugRows"))},createTable:e=>{e.setColumnPinning=n=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(n),e.resetColumnPinning=n=>{var r,i;return e.setColumnPinning(n?Mh():(r=(i=e.initialState)==null?void 0:i.columnPinning)!=null?r:Mh())},e.getIsSomeColumnsPinned=n=>{var r;const i=e.getState().columnPinning;if(!n){var s,l;return!!((s=i.left)!=null&&s.length||(l=i.right)!=null&&l.length)}return!!((r=i[n])!=null&&r.length)},e.getLeftLeafColumns=Ne(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.id===i)).filter(Boolean),ke(e.options,"debugColumns")),e.getRightLeafColumns=Ne(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.id===i)).filter(Boolean),ke(e.options,"debugColumns")),e.getCenterLeafColumns=Ne(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i)=>{const s=[...r??[],...i??[]];return n.filter(l=>!s.includes(l.id))},ke(e.options,"debugColumns"))}};function XN(e){return e||(typeof document<"u"?document:null)}const Lu={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},jh=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),JN={getDefaultColumnDef:()=>Lu,getInitialState:e=>({columnSizing:{},columnSizingInfo:jh(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Pn("columnSizing",e),onColumnSizingInfoChange:Pn("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var r,i,s;const l=n.getState().columnSizing[e.id];return Math.min(Math.max((r=e.columnDef.minSize)!=null?r:Lu.minSize,(i=l??e.columnDef.size)!=null?i:Lu.size),(s=e.columnDef.maxSize)!=null?s:Lu.maxSize)},e.getStart=Ne(r=>[r,$s(n,r),n.getState().columnSizing],(r,i)=>i.slice(0,e.getIndex(r)).reduce((s,l)=>s+l.getSize(),0),ke(n.options,"debugColumns")),e.getAfter=Ne(r=>[r,$s(n,r),n.getState().columnSizing],(r,i)=>i.slice(e.getIndex(r)+1).reduce((s,l)=>s+l.getSize(),0),ke(n.options,"debugColumns")),e.resetSize=()=>{n.setColumnSizing(r=>{let{[e.id]:i,...s}=r;return s})},e.getCanResize=()=>{var r,i;return((r=e.columnDef.enableResizing)!=null?r:!0)&&((i=n.options.enableColumnResizing)!=null?i:!0)},e.getIsResizing=()=>n.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,n)=>{e.getSize=()=>{let r=0;const i=s=>{if(s.subHeaders.length)s.subHeaders.forEach(i);else{var l;r+=(l=s.column.getSize())!=null?l:0}};return i(e),r},e.getStart=()=>{if(e.index>0){const r=e.headerGroup.headers[e.index-1];return r.getStart()+r.getSize()}return 0},e.getResizeHandler=r=>{const i=n.getColumn(e.column.id),s=i?.getCanResize();return l=>{if(!i||!s||(l.persist==null||l.persist(),zh(l)&&l.touches&&l.touches.length>1))return;const c=e.getSize(),d=e?e.getLeafHeaders().map(T=>[T.column.id,T.column.getSize()]):[[i.id,i.getSize()]],h=zh(l)?Math.round(l.touches[0].clientX):l.clientX,m={},y=(T,O)=>{typeof O=="number"&&(n.setColumnSizingInfo(A=>{var k,L;const q=n.options.columnResizeDirection==="rtl"?-1:1,H=(O-((k=A?.startOffset)!=null?k:0))*q,$=Math.max(H/((L=A?.startSize)!=null?L:0),-.999999);return A.columnSizingStart.forEach(he=>{let[ve,de]=he;m[ve]=Math.round(Math.max(de+de*$,0)*100)/100}),{...A,deltaOffset:H,deltaPercentage:$}}),(n.options.columnResizeMode==="onChange"||T==="end")&&n.setColumnSizing(A=>({...A,...m})))},g=T=>y("move",T),b=T=>{y("end",T),n.setColumnSizingInfo(O=>({...O,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},S=XN(r),_={moveHandler:T=>g(T.clientX),upHandler:T=>{S?.removeEventListener("mousemove",_.moveHandler),S?.removeEventListener("mouseup",_.upHandler),b(T.clientX)}},C={moveHandler:T=>(T.cancelable&&(T.preventDefault(),T.stopPropagation()),g(T.touches[0].clientX),!1),upHandler:T=>{var O;S?.removeEventListener("touchmove",C.moveHandler),S?.removeEventListener("touchend",C.upHandler),T.cancelable&&(T.preventDefault(),T.stopPropagation()),b((O=T.touches[0])==null?void 0:O.clientX)}},E=WN()?{passive:!1}:!1;zh(l)?(S?.addEventListener("touchmove",C.moveHandler,E),S?.addEventListener("touchend",C.upHandler,E)):(S?.addEventListener("mousemove",_.moveHandler,E),S?.addEventListener("mouseup",_.upHandler,E)),n.setColumnSizingInfo(T=>({...T,startOffset:h,startSize:c,deltaOffset:0,deltaPercentage:0,columnSizingStart:d,isResizingColumn:i.id}))}}},createTable:e=>{e.setColumnSizing=n=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(n),e.setColumnSizingInfo=n=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(n),e.resetColumnSizing=n=>{var r;e.setColumnSizing(n?{}:(r=e.initialState.columnSizing)!=null?r:{})},e.resetHeaderSizeInfo=n=>{var r;e.setColumnSizingInfo(n?jh():(r=e.initialState.columnSizingInfo)!=null?r:jh())},e.getTotalSize=()=>{var n,r;return(n=(r=e.getHeaderGroups()[0])==null?void 0:r.headers.reduce((i,s)=>i+s.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,r;return(n=(r=e.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((i,s)=>i+s.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,r;return(n=(r=e.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((i,s)=>i+s.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,r;return(n=(r=e.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((i,s)=>i+s.getSize(),0))!=null?n:0}}};let Iu=null;function WN(){if(typeof Iu=="boolean")return Iu;let e=!1;try{const n={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,n),window.removeEventListener("test",r)}catch{e=!1}return Iu=e,Iu}function zh(e){return e.type==="touchstart"}const ek={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Pn("columnVisibility",e)}),createColumn:(e,n)=>{e.toggleVisibility=r=>{e.getCanHide()&&n.setColumnVisibility(i=>({...i,[e.id]:r??!e.getIsVisible()}))},e.getIsVisible=()=>{var r,i;const s=e.columns;return(r=s.length?s.some(l=>l.getIsVisible()):(i=n.getState().columnVisibility)==null?void 0:i[e.id])!=null?r:!0},e.getCanHide=()=>{var r,i;return((r=e.columnDef.enableHiding)!=null?r:!0)&&((i=n.options.enableHiding)!=null?i:!0)},e.getToggleVisibilityHandler=()=>r=>{e.toggleVisibility==null||e.toggleVisibility(r.target.checked)}},createRow:(e,n)=>{e._getAllVisibleCells=Ne(()=>[e.getAllCells(),n.getState().columnVisibility],r=>r.filter(i=>i.column.getIsVisible()),ke(n.options,"debugRows")),e.getVisibleCells=Ne(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(r,i,s)=>[...r,...i,...s],ke(n.options,"debugRows"))},createTable:e=>{const n=(r,i)=>Ne(()=>[i(),i().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),ke(e.options,"debugColumns"));e.getVisibleFlatColumns=n("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=n("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=n("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=n("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=n("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=r=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(r),e.resetColumnVisibility=r=>{var i;e.setColumnVisibility(r?{}:(i=e.initialState.columnVisibility)!=null?i:{})},e.toggleAllColumnsVisible=r=>{var i;r=(i=r)!=null?i:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,l)=>({...s,[l.id]:r||!(l.getCanHide!=null&&l.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>r=>{var i;e.toggleAllColumnsVisible((i=r.target)==null?void 0:i.checked)}}};function $s(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const tk={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},nk={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Pn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:n=>{var r;const i=(r=e.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[n.id])==null?void 0:r.getValue();return typeof i=="string"||typeof i=="number"}}),createColumn:(e,n)=>{e.getCanGlobalFilter=()=>{var r,i,s,l;return((r=e.columnDef.enableGlobalFilter)!=null?r:!0)&&((i=n.options.enableGlobalFilter)!=null?i:!0)&&((s=n.options.enableFilters)!=null?s:!0)&&((l=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Yr.includesString,e.getGlobalFilterFn=()=>{var n,r;const{globalFilterFn:i}=e.options;return Vc(i)?i:i==="auto"?e.getGlobalAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[i])!=null?n:Yr[i]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},rk={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Pn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,r=!1;e._autoResetExpanded=()=>{var i,s;if(!n){e._queue(()=>{n=!0});return}if((i=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?i:!e.options.manualExpanding){if(r)return;r=!0,e._queue(()=>{e.resetExpanded(),r=!1})}},e.setExpanded=i=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(i),e.toggleAllRowsExpanded=i=>{i??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=i=>{var s,l;e.setExpanded(i?{}:(s=(l=e.initialState)==null?void 0:l.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(i=>i.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>i=>{i.persist==null||i.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const i=e.getState().expanded;return i===!0||Object.values(i).some(Boolean)},e.getIsAllRowsExpanded=()=>{const i=e.getState().expanded;return typeof i=="boolean"?i===!0:!(!Object.keys(i).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let i=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(l=>{const c=l.split(".");i=Math.max(i,c.length)}),i},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,n)=>{e.toggleExpanded=r=>{n.setExpanded(i=>{var s;const l=i===!0?!0:!!(i!=null&&i[e.id]);let c={};if(i===!0?Object.keys(n.getRowModel().rowsById).forEach(d=>{c[d]=!0}):c=i,r=(s=r)!=null?s:!l,!l&&r)return{...c,[e.id]:!0};if(l&&!r){const{[e.id]:d,...h}=c;return h}return i})},e.getIsExpanded=()=>{var r;const i=n.getState().expanded;return!!((r=n.options.getIsRowExpanded==null?void 0:n.options.getIsRowExpanded(e))!=null?r:i===!0||i?.[e.id])},e.getCanExpand=()=>{var r,i,s;return(r=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?r:((i=n.options.enableExpanding)!=null?i:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let r=!0,i=e;for(;r&&i.parentId;)i=n.getRow(i.parentId,!0),r=i.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const r=e.getCanExpand();return()=>{r&&e.toggleExpanded()}}}},vm=0,ym=10,Dh=()=>({pageIndex:vm,pageSize:ym}),ok={getInitialState:e=>({...e,pagination:{...Dh(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Pn("pagination",e)}),createTable:e=>{let n=!1,r=!1;e._autoResetPageIndex=()=>{var i,s;if(!n){e._queue(()=>{n=!0});return}if((i=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?i:!e.options.manualPagination){if(r)return;r=!0,e._queue(()=>{e.resetPageIndex(),r=!1})}},e.setPagination=i=>{const s=l=>Ao(i,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=i=>{var s;e.setPagination(i?Dh():(s=e.initialState.pagination)!=null?s:Dh())},e.setPageIndex=i=>{e.setPagination(s=>{let l=Ao(i,s.pageIndex);const c=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.max(0,Math.min(l,c)),{...s,pageIndex:l}})},e.resetPageIndex=i=>{var s,l;e.setPageIndex(i?vm:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?s:vm)},e.resetPageSize=i=>{var s,l;e.setPageSize(i?ym:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?s:ym)},e.setPageSize=i=>{e.setPagination(s=>{const l=Math.max(1,Ao(i,s.pageSize)),c=s.pageSize*s.pageIndex,d=Math.floor(c/l);return{...s,pageIndex:d,pageSize:l}})},e.setPageCount=i=>e.setPagination(s=>{var l;let c=Ao(i,(l=e.options.pageCount)!=null?l:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...s,pageCount:c}}),e.getPageOptions=Ne(()=>[e.getPageCount()],i=>{let s=[];return i&&i>0&&(s=[...new Array(i)].fill(null).map((l,c)=>c)),s},ke(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:i}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:ie.setPageIndex(i=>i-1),e.nextPage=()=>e.setPageIndex(i=>i+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var i;return(i=e.options.pageCount)!=null?i:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var i;return(i=e.options.rowCount)!=null?i:e.getPrePaginationRowModel().rows.length}}},Nh=()=>({top:[],bottom:[]}),ik={getInitialState:e=>({rowPinning:Nh(),...e}),getDefaultOptions:e=>({onRowPinningChange:Pn("rowPinning",e)}),createRow:(e,n)=>{e.pin=(r,i,s)=>{const l=i?e.getLeafRows().map(h=>{let{id:m}=h;return m}):[],c=s?e.getParentRows().map(h=>{let{id:m}=h;return m}):[],d=new Set([...c,e.id,...l]);n.setRowPinning(h=>{var m,y;if(r==="bottom"){var g,b;return{top:((g=h?.top)!=null?g:[]).filter(C=>!(d!=null&&d.has(C))),bottom:[...((b=h?.bottom)!=null?b:[]).filter(C=>!(d!=null&&d.has(C))),...Array.from(d)]}}if(r==="top"){var S,_;return{top:[...((S=h?.top)!=null?S:[]).filter(C=>!(d!=null&&d.has(C))),...Array.from(d)],bottom:((_=h?.bottom)!=null?_:[]).filter(C=>!(d!=null&&d.has(C)))}}return{top:((m=h?.top)!=null?m:[]).filter(C=>!(d!=null&&d.has(C))),bottom:((y=h?.bottom)!=null?y:[]).filter(C=>!(d!=null&&d.has(C)))}})},e.getCanPin=()=>{var r;const{enableRowPinning:i,enablePinning:s}=n.options;return typeof i=="function"?i(e):(r=i??s)!=null?r:!0},e.getIsPinned=()=>{const r=[e.id],{top:i,bottom:s}=n.getState().rowPinning,l=r.some(d=>i?.includes(d)),c=r.some(d=>s?.includes(d));return l?"top":c?"bottom":!1},e.getPinnedIndex=()=>{var r,i;const s=e.getIsPinned();if(!s)return-1;const l=(r=s==="top"?n.getTopRows():n.getBottomRows())==null?void 0:r.map(c=>{let{id:d}=c;return d});return(i=l?.indexOf(e.id))!=null?i:-1}},createTable:e=>{e.setRowPinning=n=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(n),e.resetRowPinning=n=>{var r,i;return e.setRowPinning(n?Nh():(r=(i=e.initialState)==null?void 0:i.rowPinning)!=null?r:Nh())},e.getIsSomeRowsPinned=n=>{var r;const i=e.getState().rowPinning;if(!n){var s,l;return!!((s=i.top)!=null&&s.length||(l=i.bottom)!=null&&l.length)}return!!((r=i[n])!=null&&r.length)},e._getPinnedRows=(n,r,i)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(r??[]).map(c=>{const d=e.getRow(c,!0);return d.getIsAllParentsExpanded()?d:null}):(r??[]).map(c=>n.find(d=>d.id===c))).filter(Boolean).map(c=>({...c,position:i}))},e.getTopRows=Ne(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,r)=>e._getPinnedRows(n,r,"top"),ke(e.options,"debugRows")),e.getBottomRows=Ne(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,r)=>e._getPinnedRows(n,r,"bottom"),ke(e.options,"debugRows")),e.getCenterRows=Ne(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,r,i)=>{const s=new Set([...r??[],...i??[]]);return n.filter(l=>!s.has(l.id))},ke(e.options,"debugRows"))}},ak={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Pn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=n=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(n),e.resetRowSelection=n=>{var r;return e.setRowSelection(n?{}:(r=e.initialState.rowSelection)!=null?r:{})},e.toggleAllRowsSelected=n=>{e.setRowSelection(r=>{n=typeof n<"u"?n:!e.getIsAllRowsSelected();const i={...r},s=e.getPreGroupedRowModel().flatRows;return n?s.forEach(l=>{l.getCanSelect()&&(i[l.id]=!0)}):s.forEach(l=>{delete i[l.id]}),i})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(r=>{const i=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),s={...r};return e.getRowModel().rows.forEach(l=>{bm(s,l.id,i,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ne(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,r)=>Object.keys(n).length?kh(e,r):{rows:[],flatRows:[],rowsById:{}},ke(e.options,"debugTable")),e.getFilteredSelectedRowModel=Ne(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,r)=>Object.keys(n).length?kh(e,r):{rows:[],flatRows:[],rowsById:{}},ke(e.options,"debugTable")),e.getGroupedSelectedRowModel=Ne(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,r)=>Object.keys(n).length?kh(e,r):{rows:[],flatRows:[],rowsById:{}},ke(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const n=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let i=!!(n.length&&Object.keys(r).length);return i&&n.some(s=>s.getCanSelect()&&!r[s.id])&&(i=!1),i},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:r}=e.getState();let i=!!n.length;return i&&n.some(s=>!r[s.id])&&(i=!1),i},e.getIsSomeRowsSelected=()=>{var n;const r=Object.keys((n=e.getState().rowSelection)!=null?n:{}).length;return r>0&&r{const n=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:n.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>n=>{e.toggleAllRowsSelected(n.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>n=>{e.toggleAllPageRowsSelected(n.target.checked)}},createRow:(e,n)=>{e.toggleSelected=(r,i)=>{const s=e.getIsSelected();n.setRowSelection(l=>{var c;if(r=typeof r<"u"?r:!s,e.getCanSelect()&&s===r)return l;const d={...l};return bm(d,e.id,r,(c=i?.selectChildren)!=null?c:!0,n),d})},e.getIsSelected=()=>{const{rowSelection:r}=n.getState();return Op(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=n.getState();return Sm(e,r)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=n.getState();return Sm(e,r)==="all"},e.getCanSelect=()=>{var r;return typeof n.options.enableRowSelection=="function"?n.options.enableRowSelection(e):(r=n.options.enableRowSelection)!=null?r:!0},e.getCanSelectSubRows=()=>{var r;return typeof n.options.enableSubRowSelection=="function"?n.options.enableSubRowSelection(e):(r=n.options.enableSubRowSelection)!=null?r:!0},e.getCanMultiSelect=()=>{var r;return typeof n.options.enableMultiRowSelection=="function"?n.options.enableMultiRowSelection(e):(r=n.options.enableMultiRowSelection)!=null?r:!0},e.getToggleSelectedHandler=()=>{const r=e.getCanSelect();return i=>{var s;r&&e.toggleSelected((s=i.target)==null?void 0:s.checked)}}}},bm=(e,n,r,i,s)=>{var l;const c=s.getRow(n,!0);r?(c.getCanMultiSelect()||Object.keys(e).forEach(d=>delete e[d]),c.getCanSelect()&&(e[n]=!0)):delete e[n],i&&(l=c.subRows)!=null&&l.length&&c.getCanSelectSubRows()&&c.subRows.forEach(d=>bm(e,d.id,r,i,s))};function kh(e,n){const r=e.getState().rowSelection,i=[],s={},l=function(c,d){return c.map(h=>{var m;const y=Op(h,r);if(y&&(i.push(h),s[h.id]=h),(m=h.subRows)!=null&&m.length&&(h={...h,subRows:l(h.subRows)}),y)return h}).filter(Boolean)};return{rows:l(n.rows),flatRows:i,rowsById:s}}function Op(e,n){var r;return(r=n[e.id])!=null?r:!1}function Sm(e,n,r){var i;if(!((i=e.subRows)!=null&&i.length))return!1;let s=!0,l=!1;return e.subRows.forEach(c=>{if(!(l&&!s)&&(c.getCanSelect()&&(Op(c,n)?l=!0:s=!1),c.subRows&&c.subRows.length)){const d=Sm(c,n);d==="all"?l=!0:(d==="some"&&(l=!0),s=!1)}}),s?"all":l?"some":!1}const xm=/([0-9]+)/gm,sk=(e,n,r)=>K1(Lo(e.getValue(r)).toLowerCase(),Lo(n.getValue(r)).toLowerCase()),lk=(e,n,r)=>K1(Lo(e.getValue(r)),Lo(n.getValue(r))),uk=(e,n,r)=>Ap(Lo(e.getValue(r)).toLowerCase(),Lo(n.getValue(r)).toLowerCase()),ck=(e,n,r)=>Ap(Lo(e.getValue(r)),Lo(n.getValue(r))),dk=(e,n,r)=>{const i=e.getValue(r),s=n.getValue(r);return i>s?1:iAp(e.getValue(r),n.getValue(r));function Ap(e,n){return e===n?0:e>n?1:-1}function Lo(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function K1(e,n){const r=e.split(xm).filter(Boolean),i=n.split(xm).filter(Boolean);for(;r.length&&i.length;){const s=r.shift(),l=i.shift(),c=parseInt(s,10),d=parseInt(l,10),h=[c,d].sort();if(isNaN(h[0])){if(s>l)return 1;if(l>s)return-1;continue}if(isNaN(h[1]))return isNaN(c)?-1:1;if(c>d)return 1;if(d>c)return-1}return r.length-i.length}const Ms={alphanumeric:sk,alphanumericCaseSensitive:lk,text:uk,textCaseSensitive:ck,datetime:dk,basic:fk},hk={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Pn("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const r=n.getFilteredRowModel().flatRows.slice(10);let i=!1;for(const s of r){const l=s?.getValue(e.id);if(Object.prototype.toString.call(l)==="[object Date]")return Ms.datetime;if(typeof l=="string"&&(i=!0,l.split(xm).length>1))return Ms.alphanumeric}return i?Ms.text:Ms.basic},e.getAutoSortDir=()=>{const r=n.getFilteredRowModel().flatRows[0];return typeof r?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var r,i;if(!e)throw new Error;return Vc(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(r=(i=n.options.sortingFns)==null?void 0:i[e.columnDef.sortingFn])!=null?r:Ms[e.columnDef.sortingFn]},e.toggleSorting=(r,i)=>{const s=e.getNextSortingOrder(),l=typeof r<"u"&&r!==null;n.setSorting(c=>{const d=c?.find(S=>S.id===e.id),h=c?.findIndex(S=>S.id===e.id);let m=[],y,g=l?r:s==="desc";if(c!=null&&c.length&&e.getCanMultiSort()&&i?d?y="toggle":y="add":c!=null&&c.length&&h!==c.length-1?y="replace":d?y="toggle":y="replace",y==="toggle"&&(l||s||(y="remove")),y==="add"){var b;m=[...c,{id:e.id,desc:g}],m.splice(0,m.length-((b=n.options.maxMultiSortColCount)!=null?b:Number.MAX_SAFE_INTEGER))}else y==="toggle"?m=c.map(S=>S.id===e.id?{...S,desc:g}:S):y==="remove"?m=c.filter(S=>S.id!==e.id):m=[{id:e.id,desc:g}];return m})},e.getFirstSortDir=()=>{var r,i;return((r=(i=e.columnDef.sortDescFirst)!=null?i:n.options.sortDescFirst)!=null?r:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=r=>{var i,s;const l=e.getFirstSortDir(),c=e.getIsSorted();return c?c!==l&&((i=n.options.enableSortingRemoval)==null||i)&&(!(r&&(s=n.options.enableMultiRemove)!=null)||s)?!1:c==="desc"?"asc":"desc":l},e.getCanSort=()=>{var r,i;return((r=e.columnDef.enableSorting)!=null?r:!0)&&((i=n.options.enableSorting)!=null?i:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,i;return(r=(i=e.columnDef.enableMultiSort)!=null?i:n.options.enableMultiSort)!=null?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const i=(r=n.getState().sorting)==null?void 0:r.find(s=>s.id===e.id);return i?i.desc?"desc":"asc":!1},e.getSortIndex=()=>{var r,i;return(r=(i=n.getState().sorting)==null?void 0:i.findIndex(s=>s.id===e.id))!=null?r:-1},e.clearSorting=()=>{n.setSorting(r=>r!=null&&r.length?r.filter(i=>i.id!==e.id):[])},e.getToggleSortingHandler=()=>{const r=e.getCanSort();return i=>{r&&(i.persist==null||i.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?n.options.isMultiSortEvent==null?void 0:n.options.isMultiSortEvent(i):!1))}}},createTable:e=>{e.setSorting=n=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(n),e.resetSorting=n=>{var r,i;e.setSorting(n?[]:(r=(i=e.initialState)==null?void 0:i.sorting)!=null?r:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},mk=[NN,ek,YN,QN,LN,IN,tk,nk,hk,ZN,rk,ok,ik,ak,JN];function pk(e){var n,r;const i=[...mk,...(n=e._features)!=null?n:[]];let s={_features:i};const l=s._features.reduce((b,S)=>Object.assign(b,S.getDefaultOptions==null?void 0:S.getDefaultOptions(s)),{}),c=b=>s.options.mergeOptions?s.options.mergeOptions(l,b):{...l,...b};let h={...{},...(r=e.initialState)!=null?r:{}};s._features.forEach(b=>{var S;h=(S=b.getInitialState==null?void 0:b.getInitialState(h))!=null?S:h});const m=[];let y=!1;const g={_features:i,options:{...l,...e},initialState:h,_queue:b=>{m.push(b),y||(y=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();y=!1}).catch(S=>setTimeout(()=>{throw S})))},reset:()=>{s.setState(s.initialState)},setOptions:b=>{const S=Ao(b,s.options);s.options=c(S)},getState:()=>s.options.state,setState:b=>{s.options.onStateChange==null||s.options.onStateChange(b)},_getRowId:(b,S,_)=>{var C;return(C=s.options.getRowId==null?void 0:s.options.getRowId(b,S,_))!=null?C:`${_?[_.id,S].join("."):S}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(b,S)=>{let _=(S?s.getPrePaginationRowModel():s.getRowModel()).rowsById[b];if(!_&&(_=s.getCoreRowModel().rowsById[b],!_))throw new Error;return _},_getDefaultColumnDef:Ne(()=>[s.options.defaultColumn],b=>{var S;return b=(S=b)!=null?S:{},{header:_=>{const C=_.header.column.columnDef;return C.accessorKey?C.accessorKey:C.accessorFn?C.id:null},cell:_=>{var C,E;return(C=(E=_.renderValue())==null||E.toString==null?void 0:E.toString())!=null?C:null},...s._features.reduce((_,C)=>Object.assign(_,C.getDefaultColumnDef==null?void 0:C.getDefaultColumnDef()),{}),...b}},ke(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:Ne(()=>[s._getColumnDefs()],b=>{const S=function(_,C,E){return E===void 0&&(E=0),_.map(T=>{const O=DN(s,T,E,C),A=T;return O.columns=A.columns?S(A.columns,O,E+1):[],O})};return S(b)},ke(e,"debugColumns")),getAllFlatColumns:Ne(()=>[s.getAllColumns()],b=>b.flatMap(S=>S.getFlatColumns()),ke(e,"debugColumns")),_getAllFlatColumnsById:Ne(()=>[s.getAllFlatColumns()],b=>b.reduce((S,_)=>(S[_.id]=_,S),{}),ke(e,"debugColumns")),getAllLeafColumns:Ne(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(b,S)=>{let _=b.flatMap(C=>C.getLeafColumns());return S(_)},ke(e,"debugColumns")),getColumn:b=>s._getAllFlatColumnsById()[b]};Object.assign(s,g);for(let b=0;bNe(()=>[e.options.data],n=>{const r={rows:[],flatRows:[],rowsById:{}},i=function(s,l,c){l===void 0&&(l=0);const d=[];for(let m=0;me._autoResetPageIndex()))}function Q1(){return e=>Ne(()=>[e.getState().sorting,e.getPreSortedRowModel()],(n,r)=>{if(!r.rows.length||!(n!=null&&n.length))return r;const i=e.getState().sorting,s=[],l=i.filter(h=>{var m;return(m=e.getColumn(h.id))==null?void 0:m.getCanSort()}),c={};l.forEach(h=>{const m=e.getColumn(h.id);m&&(c[h.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const d=h=>{const m=h.map(y=>({...y}));return m.sort((y,g)=>{for(let S=0;S{var g;s.push(y),(g=y.subRows)!=null&&g.length&&(y.subRows=d(y.subRows))}),m};return{rows:d(r.rows),flatRows:s,rowsById:r.rowsById}},ke(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function ac(e,n){return e?gk(e)?x.createElement(e,n):e:null}function gk(e){return vk(e)||typeof e=="function"||yk(e)}function vk(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function yk(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function X1(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=x.useState(()=>({current:pk(n)})),[i,s]=x.useState(()=>r.current.initialState);return r.current.setOptions(l=>({...l,...e,state:{...i,...e.state},onStateChange:c=>{s(c),e.onStateChange==null||e.onStateChange(c)}})),r.current}var ul=e=>e.type==="checkbox",Mo=e=>e instanceof Date,an=e=>e==null;const Mp=e=>typeof e=="object";var Tt=e=>!an(e)&&!Array.isArray(e)&&Mp(e)&&!Mo(e),bk=e=>Tt(e)&&e.target?ul(e.target)?e.target.checked:e.target.value:e,Sk=(e,n)=>n.split(".").some((r,i,s)=>!isNaN(Number(r))&&e.has(s.slice(0,i).join("."))),J1=e=>{const n=e.constructor&&e.constructor.prototype;return Tt(n)&&n.hasOwnProperty("isPrototypeOf")},Fc=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Mt(e){if(e instanceof Date)return new Date(e);const n=typeof FileList<"u"&&e instanceof FileList;if(Fc&&(e instanceof Blob||n))return e;const r=Array.isArray(e);if(!r&&!(Tt(e)&&J1(e)))return e;const i=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=Mt(e[s]));return i}const va={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},hr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},dr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},W1="root",jp=["__proto__","constructor","prototype"],xk=/^\w*$/;var cl=e=>xk.test(e),vt=e=>e===void 0;const wk=/[.[\]'"]/;var Pc=e=>e.split(wk).filter(Boolean),we=(e,n,r)=>{if(!n||!Tt(e))return r;const i=cl(n)?[n]:Pc(n);if(i.some(l=>jp.includes(l)))return r;const s=i.reduce((l,c)=>an(l)?void 0:l[c],e);return vt(s)||s===e?vt(e[n])?r:e[n]:s},_r=e=>typeof e=="boolean",Wn=e=>typeof e=="function",dt=(e,n,r)=>{let i=-1;const s=cl(n)?[n]:Pc(n),l=s.length,c=l-1;for(;++i{const s={};for(const l in e)Object.defineProperty(s,l,{get:()=>{const c=l;return n._proxyFormState[c]!==hr.all&&(n._proxyFormState[c]=!i||hr.all),e[c]}});return s};const Ek=Fc?fe.useLayoutEffect:fe.useEffect;var ln=e=>typeof e=="string",Rk=(e,n,r,i,s)=>ln(e)?(i&&n.watch.add(e),we(r,e,s)):Array.isArray(e)?e.map(l=>(i&&n.watch.add(l),we(r,l))):(i&&(n.watchAll=!0),r),wm=e=>an(e)||!Mp(e);const Hb=(e,n)=>n.length===0&&!Array.isArray(e)&&!J1(e);function Cr(e,n,r=new WeakMap){if(e===n)return!0;if(wm(e)||wm(n))return Object.is(e,n);if(Mo(e)&&Mo(n))return Object.is(e.getTime(),n.getTime());const i=Object.keys(e),s=Object.keys(n);if(i.length!==s.length)return!1;if(Hb(e,i)||Hb(n,s))return Object.is(e,n);if(!i.length&&Array.isArray(e)!==Array.isArray(n))return!1;const l=r.get(e);if(l&&l.has(n))return!0;if(l)l.add(n);else{const c=new WeakSet;c.add(n),r.set(e,c)}for(const c of i){const d=e[c];if(!(c in n))return!1;if(c!=="ref"){const h=n[c];if(Mo(d)&&Mo(h)||(Tt(d)||Array.isArray(d))&&(Tt(h)||Array.isArray(h))?!Cr(d,h,r):!Object.is(d,h))return!1}}return!0}var $u=e=>({isOnSubmit:!e||e===hr.onSubmit,isOnBlur:e===hr.onBlur,isOnChange:e===hr.onChange,isOnAll:e===hr.all,isOnTouch:e===hr.onTouched}),Lh=(e,n,r)=>{if(r)return!1;if(n.watchAll||n.watch.has(e))return!0;for(const i of n.watch)if(e.startsWith(i)&&e.charAt(i.length)===".")return!0;return!1};const Vs=(e,n,r,i)=>{for(const s of r||Object.keys(e)){const l=we(e,s);if(l){const{_f:c,...d}=l;if(c){if(c.refs&&c.refs[0]&&n(c.refs[0],s)&&!i)return!0;if(c.ref&&n(c.ref,c.name)&&!i)return!0;if(Vs(d,n))break}else if(Tt(d)&&Vs(d,n))break}}};var Bb=(e,n,r)=>{const i=we(e,r),s=Array.isArray(i)?i:[];return dt(s,W1,n[r]),dt(e,r,s),e},on=e=>Tt(e)&&!Object.keys(e).length,zp=e=>e.type==="file",sc=e=>{if(!Fc)return!1;const n=e?e.ownerDocument:0;return e instanceof(n&&n.defaultView?n.defaultView.HTMLElement:HTMLElement)},Dp=e=>e.type==="radio",lc=e=>e instanceof RegExp,Np=(e,n,r,i,s)=>n?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[i]:s||!0}}:{};const qb={value:!1,isValid:!1},Gb={value:!0,isValid:!0};var e_=e=>{if(Array.isArray(e)){if(e.length>1){const n=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:n,isValid:!!n.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!vt(e[0].attributes.value)?vt(e[0].value)||e[0].value===""?Gb:{value:e[0].value,isValid:!0}:Gb:qb}return qb};const Zb={isValid:!1,value:null};var t_=e=>Array.isArray(e)?e.reduce((n,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:n,Zb):Zb;function Kb(e,n,r="validate"){if(ln(e)||Array.isArray(e)&&e.every(ln)||_r(e)&&!e)return{type:r,message:ln(e)?e:"",ref:n}}var ya=e=>Tt(e)&&!lc(e)?e:{value:e,message:""},Yb=async(e,n,r,i,s,l)=>{const{ref:c,refs:d,required:h,maxLength:m,minLength:y,min:g,max:b,pattern:S,validate:_,name:C,valueAsNumber:E,mount:T}=e._f,O=we(r,C);if(!T||n.has(C))return{};const A=d?d[0]:c,k=le=>{if(s&&A.reportValidity){const ae=_r(le)?"":le||"";d?d.forEach(me=>me.setCustomValidity(ae)):A.setCustomValidity(ae),A.reportValidity()}},L={},q=Dp(c),H=ul(c),$=q||H,he=(E||zp(c))&&vt(c.value)&&vt(O)||sc(c)&&c.value===""||O===""||Array.isArray(O)&&!O.length,ve=Np.bind(null,C,i,L),de=(le,ae,me,ye=dr.maxLength,N=dr.minLength)=>{const Y=le?ae:me;L[C]={type:le?ye:N,message:Y,ref:c,...ve(le?ye:N,Y)}};if(l?!Array.isArray(O)||!O.length:h&&(!$&&(he||an(O))||_r(O)&&!O||H&&!e_(d).isValid||q&&!t_(d).isValid)){const{value:le,message:ae}=ln(h)?{value:!!h,message:h}:ya(h);if(le&&(L[C]={type:dr.required,message:ae,ref:A,...ve(dr.required,ae)},!i))return k(ae),L}if(!he&&(!an(g)||!an(b))){let le,ae;const me=ya(b),ye=ya(g);if(!an(O)&&!isNaN(O)){const N=c.valueAsNumber||O&&+O;an(me.value)||(le=N>me.value),an(ye.value)||(ae=Nnew Date(new Date().toDateString()+" "+W),ne=c.type=="time",J=c.type=="week";ln(me.value)&&O&&(le=ne?Y(O)>Y(me.value):J?O>me.value:N>new Date(me.value)),ln(ye.value)&&O&&(ae=ne?Y(O)+le.value,ye=!an(ae.value)&&O.length<+ae.value;if((me||ye)&&(de(me,le.message,ae.message),!i))return k(L[C].message),L}if(S&&!he&&ln(O)){const{value:le,message:ae}=ya(S);if(lc(le)&&!O.match(le)&&(L[C]={type:dr.pattern,message:ae,ref:c,...ve(dr.pattern,ae)},!i))return k(ae),L}if(_){if(Wn(_)){const le=await _(O,r),ae=Kb(le,A);if(ae&&(L[C]={...ae,...ve(dr.validate,ae.message)},!i))return k(ae.message),L}else if(Tt(_)){let le={};for(const ae in _){if(!on(le)&&!i)break;const me=Kb(await _[ae](O,r),A,ae);me&&(le={...me,...ve(ae,me.message)},k(me.message),i&&(L[C]=le))}if(!on(le)&&(L[C]={ref:A,...le},!i))return L}}return k(!0),L},Zu=e=>Array.isArray(e)?e:[e],n_=e=>Array.isArray(e)?e.filter(Boolean):[];function Tk(e,n){const r=n.slice(0,-1).length;let i=0;for(;ijp.includes(String(c))))return e;const i=r.length===1?e:Tk(e,r),s=r.length-1,l=r[s];return i&&delete i[l],s!==0&&(Tt(i)&&on(i)||Array.isArray(i)&&Ok(i))&&jt(e,r.slice(0,-1)),e}const r_=e=>{const n={};for(const r of Object.keys(e))if(Mp(e[r])&&e[r]!==null&&!Mo(e[r])){const i=r_(e[r]);for(const s of Object.keys(i))n[`${r}.${s}`]=i[s]}else n[r]=e[r];return n},Ak=fe.createContext(null);Ak.displayName="HookFormContext";var Qb=()=>{let e=[];return{get observers(){return e},next:s=>{for(const l of e)l.next&&l.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(l=>l!==s)}}),unsubscribe:()=>{e=[]}}};function o_(e,n){const r={};for(const i in e)if(e.hasOwnProperty(i)){const s=e[i],l=n[i];if(s&&Tt(s)&&l){const c=o_(s,l);Tt(c)&&(r[i]=c)}else e[i]&&(r[i]=l)}return r}var i_=e=>e.type==="select-multiple",Mk=e=>Dp(e)||ul(e),Ih=e=>sc(e)&&e.isConnected,jk=e=>{for(const n in e)if(Wn(e[n]))return!0;return!1};function a_(e){return Array.isArray(e)||Tt(e)&&!jk(e)}function s_(e){return!!(e&&"_f"in e)}function l_(e){return Array.isArray(e)?!e.some(n=>!vt(n)):!Object.keys(e).length}function _m(e,n){Array.isArray(e)?e[n]=void 0:delete e[n]}function Cm(e,n={},r){for(const i in e){const s=e[i],l=r&&r[i];a_(s)&&(!Array.isArray(s)||!s_(l))?(n[i]=Array.isArray(s)?[]:{},Cm(s,n[i],l),l_(n[i])&&_m(n,i)):vt(s)||(n[i]=!0)}return n}function di(e,n,r,i){r||(r=Cm(n,{},i));for(const s in e){const l=e[s],c=i&&i[s];a_(l)&&(!Array.isArray(l)||!s_(c))?(vt(n)||wm(r[s])?r[s]=Cm(l,Array.isArray(l)?[]:{},c):di(l,an(n)?{}:n[s],r[s],c),l_(r[s])&&_m(r,s)):Cr(l,n[s])?_m(r,s):r[s]=!0}return r}var u_=(e,{valueAsNumber:n,valueAsDate:r,setValueAs:i})=>vt(e)?e:n?e===""?NaN:e&&+e:r&&ln(e)?new Date(e):i?i(e):e;function Xb(e){const n=e.ref;return zp(n)?n.files:Dp(n)?t_(e.refs).value:i_(n)?[...n.selectedOptions].map(({value:r})=>r):ul(n)?e_(e.refs).value:u_(vt(n.value)?e.ref.value:n.value,e)}var zk=(e,n,r,i)=>{const s={};for(const l of e){const c=we(n,l);c&&dt(s,l,c._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:i}},js=e=>vt(e)?e:lc(e)?e.source:Tt(e)?lc(e.value)?e.value.source:e.value:e;const Jb="AsyncFunction";var Dk=e=>{if(!e||!e.validate)return!1;if(Wn(e.validate))return e.validate.constructor.name===Jb;if(Tt(e.validate)){for(const n in e.validate)if(e.validate[n].constructor.name===Jb)return!0}return!1},Nk=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Wb(e,n,r){const i=we(e,r);if(i||cl(r))return{error:i,name:r};const s=r.split(".");for(;s.length;){const l=s.join("."),c=we(n,l),d=we(e,l);if(c&&!Array.isArray(c)&&r!==l)return{name:r};if(d&&d.type)return{name:l,error:d};if(d&&d.root&&d.root.type)return{name:`${l}.root`,error:d.root};s.pop()}return{name:r}}var kk=(e,n,r,i)=>{r(e);const{name:s,...l}=e,c=Object.keys(l);return!c.length||i&&c.length>=Object.keys(n).length||c.find(d=>n[d]===(!i||hr.all))},Lk=(e,n,r)=>!e||!n||e===n||Zu(e).some(i=>i&&(r?i===n||i.startsWith(n+"."):i.startsWith(n)||n.startsWith(i))),Ik=(e,n,r,i,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(n||e):(r?i.isOnBlur:s.isOnBlur)?!e:(r?i.isOnChange:s.isOnChange)?e:!0,$k=(e,n)=>!n_(we(e,n)).length&&jt(e,n);const Vk={mode:hr.onSubmit,reValidateMode:hr.onChange,shouldFocusError:!0},$h="form",c_={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Fk(e={}){let n={...Vk,...e},r={...Mt(c_),isLoading:Wn(n.defaultValues),errors:n.errors||{},disabled:n.disabled||!1},i={},s=Tt(n.defaultValues)||Tt(n.values)?Mt(n.defaultValues||n.values)||{}:{},l=n.shouldUnregister?{}:Mt(s),c={action:!1,mount:!1,watch:!1,keepIsValid:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const h={},m={};let y=0,g=$u(n.mode),b=$u(n.reValidateMode);const S={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},_={...S};let C={..._};const E={array:Qb(),state:Qb()};let T=0;const O=n.criteriaMode===hr.all,A=(M,V)=>F=>{clearTimeout(m[M]),m[M]=setTimeout(V,F)},k=async M=>{if(!c.keepIsValid&&!n.disabled&&(_.isValid||C.isValid||M)){const V=++T;let F;n.resolver?(F=on((await me()).errors),V===T&&L()):F=await Y({fields:i,onlyCheckValid:!0,eventType:va.VALID}),V===T&&F!==r.isValid&&E.state.next({isValid:F})}},L=(M,V)=>{!n.disabled&&(_.isValidating||_.validatingFields||C.isValidating||C.validatingFields)&&((M||Array.from(d.mount)).forEach(F=>{F&&(V?dt(r.validatingFields,F,V):jt(r.validatingFields,F))}),E.state.next({validatingFields:r.validatingFields,isValidating:!on(r.validatingFields)}))},q=()=>{r.dirtyFields=di(s,l,void 0,i)},H=(M,V=[],F,se,ce=!0,pe=!0)=>{if(se&&F&&!n.disabled){if(c.action=!0,pe&&Array.isArray(we(i,M))){const Se=F(we(i,M),se.argA,se.argB);ce&&dt(i,M,Se)}if(pe&&Array.isArray(we(r.errors,M))){const Se=F(we(r.errors,M),se.argA,se.argB);ce&&dt(r.errors,M,Se),$k(r.errors,M)}if((_.touchedFields||C.touchedFields)&&pe&&Array.isArray(we(r.touchedFields,M))){const Se=F(we(r.touchedFields,M),se.argA,se.argB);ce&&dt(r.touchedFields,M,Se)}(_.dirtyFields||C.dirtyFields)&&q(),E.state.next({name:M,isDirty:J(M,V),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else dt(l,M,V)},$=(M,V)=>{dt(r.errors,M,V),r.errors={...r.errors},E.state.next({errors:r.errors})},he=M=>{r.errors=M,E.state.next({errors:r.errors,isValid:!1})},ve=M=>{const V=cl(M)?[M]:Pc(M);let F=l,se=s;for(let ce=0;ce{const ce=we(i,M);if(ce){if(ve(M))return;const pe=vt(we(l,M)),Se=we(l,M,vt(F)?we(s,M):F);vt(Se)||se&&se.defaultChecked||V?dt(l,M,V?Se:Xb(ce._f)):j(M,Se),c.mount&&!c.action&&(k(),pe&&r.isDirty&&(_.isDirty||C.isDirty)&&(J()||(r.isDirty=!1,E.state.next({...r}))),e.shouldUnregister&&pe&&!vt(we(l,M))&&Lh(M,d)&&(c.watch=!0))}},le=(M,V,F,se,ce)=>{let pe=!1,Se=!1;const xe={name:M};if(!n.disabled||se===!0){if(!F||se){const Te=Cr(we(s,M),V);(_.isDirty||C.isDirty)&&(Se=r.isDirty,r.isDirty=xe.isDirty=!Te||J(),pe=Se!==xe.isDirty),Se=!!we(r.dirtyFields,M),Te!==r.isDirty?r.dirtyFields=di(s,l,void 0,i):Te?jt(r.dirtyFields,M):dt(r.dirtyFields,M,!0),xe.dirtyFields=r.dirtyFields,pe=pe||(_.dirtyFields||C.dirtyFields)&&Se!==!Te}if(F){const Te=we(r.touchedFields,M);Te||(dt(r.touchedFields,M,F),xe.touchedFields=r.touchedFields,pe=pe||(_.touchedFields||C.touchedFields)&&Te!==F)}pe&&ce&&E.state.next(xe)}return pe?xe:{}},ae=(M,V,F,se)=>{const ce=we(r.errors,M),pe=(_.isValid||C.isValid)&&_r(V)&&r.isValid!==V;if(n.delayError&&F?(h[M]=A(M,()=>$(M,F)),h[M](n.delayError)):(clearTimeout(m[M]),delete h[M],F?dt(r.errors,M,F):jt(r.errors,M),r.errors={...r.errors}),(F?!Cr(ce,F):ce)||!on(se)||pe){const Se={...se,...pe&&_r(V)?{isValid:V}:{},errors:r.errors,name:M};r={...r,...Se},E.state.next(Se)}},me=async M=>(L(M,!0),await n.resolver(l,n.context,zk(M||d.mount,i,n.criteriaMode,n.shouldUseNativeValidation))),ye=async M=>{const{errors:V}=await me(M);if(L(M),M){for(const F of M){const se=we(V,F);se?d.array.has(F)&&Tt(se)&&!Object.keys(se).some(ce=>!Number.isNaN(Number(ce)))?Bb(r.errors,{[F]:se},F):dt(r.errors,F,se):jt(r.errors,F)}r.errors={...r.errors}}else r.errors=V;return V},N=async({name:M,eventType:V})=>{if(e.validate){const F=await e.validate({formValues:l,formState:r,name:M,eventType:V});if(Tt(F))for(const se in F){const ce=F[se];ce&&st(`${$h}.${se}`,{message:ln(ce.message)?ce.message:"",type:ce.type||dr.validate})}else ln(F)||!F?st($h,{message:F||"",type:dr.validate}):Fe($h);return F}return!0},Y=async({fields:M,onlyCheckValid:V,name:F,eventType:se,context:ce={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(ce.runRootValidation=!0,!await N({name:F,eventType:se})&&(ce.valid=!1,V)))return ce.valid;for(const pe in M){const Se=M[pe];if(Se){const{_f:xe,...Te}=Se;if(xe){const nt=d.array.has(xe.name),wt=Se._f&&Dk(Se._f),Jt=_.validatingFields||_.isValidating||C.validatingFields||C.isValidating;wt&&Jt&&L([xe.name],!0);const Dt=await Yb(Se,d.disabled,l,O,n.shouldUseNativeValidation&&!V,nt);if(wt&&Jt&&L([xe.name]),Dt[xe.name]&&(ce.valid=!1,V)||(!V&&(we(Dt,xe.name)?nt?Bb(r.errors,Dt,xe.name):dt(r.errors,xe.name,Dt[xe.name]):jt(r.errors,xe.name)),e.shouldUseNativeValidation&&Dt[xe.name]))break}!on(Te)&&await Y({context:ce,onlyCheckValid:V,fields:Te,name:pe,eventType:se})}}return ce.valid},ne=()=>{for(const M of d.unMount){const V=we(i,M);V&&(V._f.refs?V._f.refs.every(F=>!Ih(F)):!Ih(V._f.ref))&&qt(M)}d.unMount=new Set},J=(M,V)=>(M&&V&&dt(l,M,V),!Cr(c.mount?l:s,s)),W=(M,V,F)=>Rk(M,d,{...c.mount?l:vt(V)?s:ln(M)?{[M]:V}:V},F,V),z=M=>n_(we(c.mount?l:s,M,n.shouldUnregister?we(s,M,[]):[])),j=(M,V,F={},se=!1,ce=!1)=>{const pe=we(i,M);let Se=V;if(pe){const xe=pe._f;xe&&(!xe.disabled&&dt(l,M,u_(V,xe)),Se=sc(xe.ref)&&an(V)?"":V,i_(xe.ref)?[...xe.ref.options].forEach(Te=>Te.selected=Se.includes(Te.value)):xe.refs?ul(xe.ref)?xe.refs.forEach(Te=>{(!Te.defaultChecked||!Te.disabled)&&(Array.isArray(Se)?Te.checked=!!Se.find(nt=>nt===Te.value):Te.checked=Se===Te.value||!!Se)}):xe.refs.forEach(Te=>Te.checked=Te.value===Se):zp(xe.ref)?xe.ref.value="":(xe.ref.value=Se,!xe.ref.type&&!ce&&E.state.next({name:M,values:se?l:Mt(l)})))}(F.shouldDirty||F.shouldTouch)&&le(M,Se,F.shouldTouch,F.shouldDirty,!ce),F.shouldValidate&&be(M,{delayError:F.delayError})},U=(M,V,F,se=!1,ce=!1)=>{for(const pe in V){if(!V.hasOwnProperty(pe))return;const Se=V[pe],xe=M+"."+pe,Te=we(i,xe);(d.array.has(M)||Tt(Se)||Te&&!Te._f)&&!Mo(Se)?U(xe,Se,F,se,ce):j(xe,Se,F,se,ce)}},Q=(M,V,F,se,ce=!1)=>{const pe=we(i,M),Se=d.array.has(M),xe=se?V:Mt(V),Te=we(l,M),nt=Cr(Te,xe);if(nt||dt(l,M,xe),Se)E.array.next({name:M,values:se?l:Mt(l)}),(_.isDirty||_.dirtyFields||C.isDirty||C.dirtyFields)&&F.shouldDirty&&(q(),ce||E.state.next({name:M,dirtyFields:r.dirtyFields,isDirty:J(M,xe)}));else{const wt=Array.isArray(xe)&&!xe.length||on(xe);!pe||pe._f||an(xe)||wt?j(M,xe,F,se,ce):U(M,xe,F,se,ce)}if(!nt&&!ce){const wt=Lh(M,d),Jt=se?l:Mt(l);E.state.next({...wt&&r,name:c.mount||wt?M:void 0,values:Jt})}},Z=(M,V,F={})=>Q(M,V,F,!1),re=(M,V={})=>{const F=Wn(M)?M(l):M;if(!Cr(l,F)){l={...l,...F};const se=r_(F);for(const ce of d.mount)ce in se&&Q(ce,se[ce],V,!0,!0);E.state.next({...r,name:void 0,type:void 0,...y?{values:l}:{}}),V.shouldValidate&&k()}},ee=async M=>{c.mount=!0;const V=M.target;let F=V.name,se=!0;const ce=we(i,F),pe=Se=>{se=Number.isNaN(Se)||Mo(Se)&&isNaN(Se.getTime())||Cr(Se,we(l,F,Se))};if(ce){let Se,xe;const Te=V.type?Xb(ce._f):bk(M),nt=M.type===va.BLUR||M.type===va.FOCUS_OUT,wt=!Nk(ce._f)&&!e.validate&&!n.resolver&&!we(r.errors,F)&&!ce._f.deps,Jt=wt||Ik(nt,we(r.touchedFields,F),r.isSubmitted,b,g),Dt=Lh(F,d,nt);if(dt(l,F,Te),nt){if(!V||!V.readOnly){ce._f.onBlur&&ce._f.onBlur(M);const yt=h[F];yt&&yt(0)}}else ce._f.onChange&&ce._f.onChange(M);const Me=le(F,Te,nt),mt=!on(Me)||Dt;if(!nt&&E.state.next({name:F,type:M.type,...y?{values:Mt(l)}:{}}),Jt)return(!wt||!r.isValid)&&(_.isValid||C.isValid)&&(n.mode==="onBlur"?nt&&k():nt||k()),mt&&E.state.next({name:F,...Dt?{}:Me});if(!n.resolver&&e.validate&&await N({name:F,eventType:M.type}),!nt&&Dt&&E.state.next({...r}),n.resolver){const{errors:yt}=await me([F]);if(L([F]),pe(Te),!se){!on(Me)&&E.state.next(Me);return}const Gt=Wb(r.errors,i,F),ir=Wb(yt,i,Gt.name||F);Se=ir.error,F=ir.name,xe=on(yt)}else L([F],!0),Se=(await Yb(ce,d.disabled,l,O,n.shouldUseNativeValidation))[F],L([F]),pe(Te),se&&(Se?xe=!1:(_.isValid||C.isValid)&&(xe=await Y({fields:i,onlyCheckValid:!0,name:F,eventType:M.type})));se&&(ce._f.deps&&(!Array.isArray(ce._f.deps)||ce._f.deps.length>0)&&be(ce._f.deps),ae(F,xe,Se,Me))}},ge=(M,V)=>{if(we(r.errors,V)&&M.focus)return M.focus(),1},be=async(M,V={})=>{let F,se;const ce=Zu(M);if(n.resolver){const pe=await ye(vt(M)?M:ce);F=on(pe),se=M?!ce.some(Se=>we(pe,Se)):F}else M?(se=(await Promise.all(ce.map(async pe=>{const Se=we(i,pe);return await Y({fields:Se&&Se._f?{[pe]:Se}:Se,eventType:va.TRIGGER})}))).every(Boolean),!(!se&&!r.isValid)&&k()):se=F=await Y({fields:i,name:M,eventType:va.TRIGGER});if(V.delayError&&n.delayError&&ln(M)){const pe=we(r.errors,M);pe?(jt(r.errors,M),h[M]=A(M,()=>$(M,pe)),h[M](n.delayError)):(clearTimeout(m[M]),delete h[M])}return E.state.next({...!ln(M)||(_.isValid||C.isValid)&&F!==r.isValid?{}:{name:M},...n.resolver||!M?{isValid:F}:{},errors:r.errors}),V.shouldFocus&&!se&&Vs(i,ge,M?ce:d.mount),se},De=(M,V)=>{let F={...c.mount?l:s};return V&&(F=o_(V.dirtyFields?r.dirtyFields:r.touchedFields,F)),vt(M)?F:ln(M)?we(F,M):M.map(se=>we(F,se))},Ie=(M,V)=>({invalid:!!we((V||r).errors,M),isDirty:!!we((V||r).dirtyFields,M),error:we((V||r).errors,M),isValidating:!!we(r.validatingFields,M),isTouched:!!we((V||r).touchedFields,M)}),Fe=M=>{const V=M?Zu(M):void 0;V?.forEach(F=>jt(r.errors,F)),V?V.forEach(F=>{E.state.next({name:F,errors:r.errors})}):E.state.next({errors:{}})},st=(M,V,F)=>{const se=(we(i,M,{_f:{}})._f||{}).ref,ce=we(r.errors,M)||{},{ref:pe,message:Se,type:xe,...Te}=ce;dt(r.errors,M,{...Te,...V,ref:se}),E.state.next({name:M,errors:r.errors,isValid:!1}),F&&F.shouldFocus&&se&&se.focus&&se.focus()},Qe=(M,V)=>{if(Wn(M)){y++;const{unsubscribe:F}=E.state.subscribe({next:ce=>"values"in ce&&M(ce.values||W(void 0,V),ce)});let se=!1;return{unsubscribe:()=>{se||(se=!0,y--,F())}}}return W(M,V,!0)},Xt=M=>{var V;const F=!!(!((V=M.formState)===null||V===void 0)&&V.values);F&&y++;const{unsubscribe:se}=E.state.subscribe({next:pe=>{if(Lk(M.name,pe.name,M.exact)&&kk(pe,M.formState||_,Ri,M.reRenderRoot)){const Se={...l};M.callback({values:Se,...r,...pe,defaultValues:s})}}});if(!F)return se;let ce=!1;return()=>{ce||(ce=!0,y--,se())}},mn=M=>(c.mount=!0,C={...C,...M.formState},Xt({...M,formState:{...S,...M.formState}})),qt=(M,V={})=>{for(const F of M?Zu(M):d.mount)d.mount.delete(F),d.array.delete(F),V.keepValue||(jt(i,F),jt(l,F)),!V.keepError&&jt(r.errors,F),!V.keepDirty&&jt(r.dirtyFields,F),!V.keepTouched&&jt(r.touchedFields,F),!V.keepIsValidating&&jt(r.validatingFields,F),!n.shouldUnregister&&!V.keepDefaultValue&&jt(s,F);E.state.next({values:Mt(l)}),E.state.next({...r,...V.keepDirty?{isDirty:J()}:{}}),!V.keepIsValid&&k()},Ft=({disabled:M,name:V})=>{if(_r(M)&&c.mount||M||d.disabled.has(V)){const ce=d.disabled.has(V)!==!!M;M?d.disabled.add(V):d.disabled.delete(V),ce&&c.mount&&!c.action&&k()}},Pt=(M,V={})=>{let F=we(i,M);const se=_r(V.disabled)||_r(n.disabled),ce=!d.registerName.has(M)&&F&&F._f&&!F._f.mount;return dt(i,M,{...F||{},_f:{...F&&F._f?F._f:{ref:{name:M}},name:M,mount:!0,...V}}),d.mount.add(M),F&&!ce?Ft({disabled:_r(V.disabled)?V.disabled:n.disabled,name:M}):de(M,!0,V.value),{...se?{disabled:V.disabled||n.disabled}:{},...n.progressive?{required:!!V.required,min:js(V.min),max:js(V.max),minLength:js(V.minLength),maxLength:js(V.maxLength),pattern:js(V.pattern)}:{},name:M,onChange:ee,onBlur:ee,ref:pe=>{if(pe){d.registerName.add(M),Pt(M,V),d.registerName.delete(M),F=we(i,M);const Se=vt(pe.value)&&pe.querySelectorAll&&pe.querySelectorAll("input,select,textarea")[0]||pe,xe=Mk(Se),Te=F._f.refs||[];if(xe?Te.find(nt=>nt===Se):Se===F._f.ref)return;dt(i,M,{_f:{...F._f,...xe?{refs:[...Te.filter(Ih),Se,...Array.isArray(we(s,M))?[{}]:[]],ref:{type:Se.type,name:M}}:{ref:Se}}}),de(M,!1,void 0,Se)}else F=we(i,M,{}),F._f&&(F._f.mount=!1),(n.shouldUnregister||V.shouldUnregister)&&!(Sk(d.array,M)&&c.action)&&d.unMount.add(M)}}},rr=()=>n.shouldFocusError&&!n.shouldUseNativeValidation&&Vs(i,ge,d.mount),$e=M=>{_r(M)&&(E.state.next({disabled:M}),Vs(i,(V,F)=>{const se=we(i,F);se&&(V.disabled=se._f.disabled||M,Array.isArray(se._f.refs)&&se._f.refs.forEach(ce=>{ce.disabled=se._f.disabled||M}))},0,!1))},ze=(M,V)=>async F=>{let se;F&&(F.preventDefault&&F.preventDefault(),F.persist&&F.persist());let ce=Mt(l);if(E.state.next({isSubmitting:!0}),n.resolver){const{errors:pe,values:Se}=await me();L(),r.errors=pe,ce=Mt(Se)}else await Y({fields:i,eventType:va.SUBMIT});if(d.disabled.size)for(const pe of d.disabled)jt(ce,pe);if(jt(r.errors,W1),on(r.errors)){E.state.next({errors:{}});try{await M(ce,F)}catch(pe){se=pe}}else V&&await V({...r.errors},F),rr(),setTimeout(rr);if(E.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:on(r.errors)&&!se,submitCount:r.submitCount+1,errors:r.errors}),se)throw se},Xe=(M,V={})=>{we(i,M)&&(vt(V.defaultValue)?Z(M,Mt(we(s,M))):(Z(M,V.defaultValue),dt(s,M,Mt(V.defaultValue))),V.keepTouched||jt(r.touchedFields,M),V.keepDirty||(jt(r.dirtyFields,M),r.isDirty=V.defaultValue?J(M,Mt(we(s,M))):J()),V.keepError||(jt(r.errors,M),_.isValid&&k()),E.state.next({...r}))},zt=(M,V={})=>{const F=M?Mt(M):s,se=Mt(F),ce=on(M),pe=se,Se=i;if(V.keepDefaultValues||(s=F),!V.keepValues){if(V.keepDirtyValues){const xe=new Set([...d.mount,...Object.keys(di(s,l,void 0,Se))]);for(const Te of Array.from(xe)){const nt=we(r.dirtyFields,Te),wt=we(l,Te),Jt=we(pe,Te);nt&&!vt(wt)?dt(pe,Te,wt):!nt&&!vt(Jt)&&Z(Te,Jt)}}else{if(Fc&&vt(M))for(const xe of d.mount){const Te=we(i,xe);if(Te&&Te._f){const nt=Array.isArray(Te._f.refs)?Te._f.refs[0]:Te._f.ref;if(sc(nt)){const wt=nt.closest("form");if(wt){wt.reset();break}}}}if(V.keepFieldsRef)for(const xe of d.mount)Z(xe,we(pe,xe));else i={}}if(n.shouldUnregister){if(l=V.keepDefaultValues?Mt(s):{},V.keepFieldsRef)for(const xe of d.mount)dt(l,xe,we(pe,xe))}else l=Mt(pe);E.array.next({values:{...pe}}),E.state.next({name:void 0,type:void 0,values:{...pe}})}d={mount:V.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!_.isValid||!!V.keepIsValid||!!V.keepDirtyValues||!n.shouldUnregister&&!on(pe),c.watch=!!n.shouldUnregister,c.keepIsValid=!!V.keepIsValid,c.action=!1,V.keepErrors||(r.errors={}),E.state.next({submitCount:V.keepSubmitCount?r.submitCount:0,isDirty:ce?!1:V.keepDirty?r.isDirty:V.keepValues?J():!!(V.keepDefaultValues&&!Cr(M,s)),isSubmitted:V.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:ce?{}:V.keepDirtyValues?V.keepDefaultValues&&l?di(s,l,void 0,Se):r.dirtyFields:V.keepDefaultValues&&M?di(s,M,void 0,Se):V.keepDirty?r.dirtyFields:{},touchedFields:V.keepTouched?r.touchedFields:{},errors:V.keepErrors?r.errors:{},isSubmitSuccessful:V.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},eo=(M,V)=>zt(Wn(M)?M(l):M,{...n.resetOptions,...V}),or=(M,V={})=>{const F=we(i,M),se=F&&F._f;if(se){const ce=se.refs?se.refs[0]:se.ref;ce.focus&&setTimeout(()=>{ce.focus(),V.shouldSelect&&Wn(ce.select)&&ce.select()})}},Ri=M=>{const{name:V,type:F,values:se,...ce}=M;r={...r,...ce}},Un={control:{register:Pt,unregister:qt,getFieldState:Ie,handleSubmit:ze,setError:st,_subscribe:Xt,_runSchema:me,_updateIsValidating:L,_focusError:rr,_getWatch:W,_getDirty:J,_setValid:k,_setFieldArray:H,_setDisabledField:Ft,_setErrors:he,_getFieldArray:z,_reset:zt,_resetDefaultValues:()=>Wn(n.defaultValues)&&n.defaultValues().then(M=>{eo(M,n.resetOptions),E.state.next({isLoading:!1})}),_removeUnmounted:ne,_disableForm:$e,_subjects:E,_proxyFormState:_,get _fields(){return i},get _formValues(){return l},get _state(){return c},set _state(M){c=M},get _defaultValues(){return s},get _names(){return d},set _names(M){d=M},get _formState(){return r},get _options(){return n},set _options(M){n={...n,...M},g=$u(n.mode),b=$u(n.reValidateMode)}},subscribe:mn,trigger:be,register:Pt,handleSubmit:ze,watch:Qe,setValue:Z,setValues:re,getValues:De,reset:eo,resetField:Xe,resetDefaultValues:(M,V={})=>{if(s=Mt(M),!V.keepDirty){const F=di(s,l,void 0,i);r.dirtyFields=F,r.isDirty=!on(F)}V.keepIsValid||k(),E.state.next({...r,defaultValues:s})},clearErrors:Fe,unregister:qt,setError:st,setFocus:or,getFieldState:Ie};return{...Un,formControl:Un}}function uc(e={}){const n=fe.useRef(void 0),r=fe.useRef(void 0),i=fe.useRef(e.formControl),[s,l]=fe.useState(()=>({...Mt(c_),isLoading:Wn(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Wn(e.defaultValues)?void 0:e.defaultValues}));if(!n.current||e.formControl&&i.current!==e.formControl)if(i.current=e.formControl,e.formControl)n.current={...e.formControl,formState:s},e.defaultValues&&!Wn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:d,...h}=Fk(e);n.current={...h,formState:s}}const c=n.current.control;return c._options=e,Ek(()=>{const d=c._subscribe({formState:c._proxyFormState,callback:()=>l({...c._formState,defaultValues:c._defaultValues}),reRenderRoot:!0});return l(h=>({...h,isReady:!0})),c._formState.isReady=!0,d},[c]),fe.useEffect(()=>c._disableForm(e.disabled),[c,e.disabled]),fe.useEffect(()=>{e.mode&&(c._options.mode=e.mode),e.reValidateMode&&(c._options.reValidateMode=e.reValidateMode)},[c,e.mode,e.reValidateMode]),fe.useEffect(()=>{e.errors&&(c._setErrors(e.errors),c._focusError())},[c,e.errors]),fe.useEffect(()=>{e.shouldUnregister&&c._subjects.state.next({values:c._getWatch()})},[c,e.shouldUnregister]),fe.useEffect(()=>{if(c._proxyFormState.isDirty){const d=c._getDirty();d!==s.isDirty&&c._subjects.state.next({isDirty:d})}},[c,s.isDirty]),fe.useEffect(()=>{var d;e.values&&!Cr(e.values,r.current)?(c._reset(e.values,{keepFieldsRef:!0,...c._options.resetOptions}),!((d=c._options.resetOptions)===null||d===void 0)&&d.keepIsValid||c._setValid(),r.current=e.values,l(h=>({...h}))):c._resetDefaultValues()},[c,e.values]),fe.useEffect(()=>{c._state.mount||(c._setValid(),c._state.mount=!0),c._state.watch&&(c._state.watch=!1,c._subjects.state.next({...c._formState})),c._removeUnmounted()}),n.current.formState=fe.useMemo(()=>Ck(s,c),[c,s]),n.current}const eS=(e,n,r)=>{if(e&&"reportValidity"in e){const i=we(r,n);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},Em=(e,n)=>{for(const r in n.fields){const i=n.fields[r];i&&i.ref&&"reportValidity"in i.ref?eS(i.ref,r,e):i&&i.refs&&i.refs.forEach(s=>eS(s,r,e))}},tS=(e,n)=>{n.shouldUseNativeValidation&&Em(e,n);const r={};for(const i in e){const s=we(n.fields,i),l=Object.assign(e[i]||{},{ref:s&&s.ref});if(Pk(n.names||Object.keys(e),i)){const c=Object.assign({},we(r,i));dt(c,"root",l),dt(r,i,c)}else dt(r,i,l)}return r},Pk=(e,n)=>{const r=nS(n).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(i=>nS(i).match(`^${r}\\.\\d+`))};function nS(e){return e.replace(/[\[\]]/g,"")}var rS;function ue(e,n,r){function i(d,h){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:h,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),n(d,h);const m=c.prototype,y=Object.keys(m);for(let g=0;gr?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class Ta extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class d_ extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}(rS=globalThis).__zod_globalConfig??(rS.__zod_globalConfig={});const kp=globalThis.__zod_globalConfig;function vi(e){return kp}function f_(e){const n=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,s])=>n.indexOf(+i)===-1).map(([i,s])=>s)}function Rm(e,n){return typeof n=="bigint"?n.toString():n}function Lp(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Ip(e){return e==null}function $p(e){const n=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(n,r)}const oS=Symbol("evaluating");function ft(e,n,r){let i;Object.defineProperty(e,n,{get(){if(i!==oS)return i===void 0&&(i=oS,i=r()),i},set(s){Object.defineProperty(e,n,{value:s})},configurable:!0})}function Ei(e,n,r){Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ho(...e){const n={};for(const r of e){const i=Object.getOwnPropertyDescriptors(r);Object.assign(n,i)}return Object.defineProperties({},n)}function iS(e){return JSON.stringify(e)}function Uk(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const h_="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function cc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Hk=Lp(()=>{if(kp.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Qs(e){if(cc(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const r=n.prototype;return!(cc(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function m_(e){return Qs(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Bk=new Set(["string","number","symbol"]);function Uc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bo(e,n,r){const i=new e._zod.constr(n??e._zod.def);return(!n||r?.parent)&&(i._zod.parent=e),i}function Le(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function qk(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}function Gk(e,n){const r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const l=Ho(e._zod.def,{get shape(){const c={};for(const d in n){if(!(d in r.shape))throw new Error(`Unrecognized key: "${d}"`);n[d]&&(c[d]=r.shape[d])}return Ei(this,"shape",c),c},checks:[]});return Bo(e,l)}function Zk(e,n){const r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const l=Ho(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const d in n){if(!(d in r.shape))throw new Error(`Unrecognized key: "${d}"`);n[d]&&delete c[d]}return Ei(this,"shape",c),c},checks:[]});return Bo(e,l)}function Kk(e,n){if(!Qs(n))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const l=e._zod.def.shape;for(const c in n)if(Object.getOwnPropertyDescriptor(l,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Ho(e._zod.def,{get shape(){const l={...e._zod.def.shape,...n};return Ei(this,"shape",l),l}});return Bo(e,s)}function Yk(e,n){if(!Qs(n))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Ho(e._zod.def,{get shape(){const i={...e._zod.def.shape,...n};return Ei(this,"shape",i),i}});return Bo(e,r)}function Qk(e,n){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=Ho(e._zod.def,{get shape(){const i={...e._zod.def.shape,...n._zod.def.shape};return Ei(this,"shape",i),i},get catchall(){return n._zod.def.catchall},checks:n._zod.def.checks??[]});return Bo(e,r)}function Xk(e,n,r){const s=n._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const c=Ho(n._zod.def,{get shape(){const d=n._zod.def.shape,h={...d};if(r)for(const m in r){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);r[m]&&(h[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)h[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Ei(this,"shape",h),h},checks:[]});return Bo(n,c)}function Jk(e,n,r){const i=Ho(n._zod.def,{get shape(){const s=n._zod.def.shape,l={...s};if(r)for(const c in r){if(!(c in l))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(l[c]=new e({type:"nonoptional",innerType:s[c]}))}else for(const c in s)l[c]=new e({type:"nonoptional",innerType:s[c]});return Ei(this,"shape",l),l}});return Bo(n,i)}function Ca(e,n=0){if(e.aborted===!0)return!0;for(let r=n;r{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Vu(e){return typeof e=="string"?e:e?.message}function yi(e,n,r){const i=e.message?e.message:Vu(e.inst?._zod.def?.error?.(e))??Vu(n?.error?.(e))??Vu(r.customError?.(e))??Vu(r.localeError?.(e))??"Invalid input",{inst:s,continue:l,input:c,...d}=e;return d.path??(d.path=[]),d.message=i,n?.reportInput&&(d.input=c),d}function Vp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Xs(...e){const[n,r,i]=e;return typeof n=="string"?{message:n,code:"custom",input:r,inst:i}:{...n}}const g_=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,Rm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Fp=ue("$ZodError",g_),Hc=ue("$ZodError",g_,{Parent:Error});function e4(e,n=r=>r.message){const r={},i=[];for(const s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(n(s))):i.push(n(s));return{formErrors:i,fieldErrors:r}}function t4(e,n=r=>r.message){const r={_errors:[]},i=(s,l=[])=>{for(const c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>i({issues:d},[...l,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...l,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...l,...c.path]);else{const d=[...l,...c.path];if(d.length===0)r._errors.push(n(c));else{let h=r,m=0;for(;m(n,r,i,s)=>{const l=i?{...i,async:!1}:{async:!1},c=n._zod.run({value:r,issues:[]},l);if(c instanceof Promise)throw new Ta;if(c.issues.length){const d=new(s?.Err??e)(c.issues.map(h=>yi(h,l,vi())));throw h_(d,s?.callee),d}return c.value},n4=Bc(Hc),qc=e=>async(n,r,i,s)=>{const l=i?{...i,async:!0}:{async:!0};let c=n._zod.run({value:r,issues:[]},l);if(c instanceof Promise&&(c=await c),c.issues.length){const d=new(s?.Err??e)(c.issues.map(h=>yi(h,l,vi())));throw h_(d,s?.callee),d}return c.value},r4=qc(Hc),Gc=e=>(n,r,i)=>{const s=i?{...i,async:!1}:{async:!1},l=n._zod.run({value:r,issues:[]},s);if(l instanceof Promise)throw new Ta;return l.issues.length?{success:!1,error:new(e??Fp)(l.issues.map(c=>yi(c,s,vi())))}:{success:!0,data:l.value}},o4=Gc(Hc),Zc=e=>async(n,r,i)=>{const s=i?{...i,async:!0}:{async:!0};let l=n._zod.run({value:r,issues:[]},s);return l instanceof Promise&&(l=await l),l.issues.length?{success:!1,error:new e(l.issues.map(c=>yi(c,s,vi())))}:{success:!0,data:l.value}},i4=Zc(Hc),a4=e=>(n,r,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return Bc(e)(n,r,s)},s4=e=>(n,r,i)=>Bc(e)(n,r,i),l4=e=>async(n,r,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return qc(e)(n,r,s)},u4=e=>async(n,r,i)=>qc(e)(n,r,i),c4=e=>(n,r,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return Gc(e)(n,r,s)},d4=e=>(n,r,i)=>Gc(e)(n,r,i),f4=e=>async(n,r,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return Zc(e)(n,r,s)},h4=e=>async(n,r,i)=>Zc(e)(n,r,i),m4=/^[cC][0-9a-z]{6,}$/,p4=/^[0-9a-z]+$/,g4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,v4=/^[0-9a-vA-V]{20}$/,y4=/^[A-Za-z0-9]{27}$/,b4=/^[a-zA-Z0-9_-]{21}$/,S4=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,x4=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,aS=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,w4=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function C4(){return new RegExp(_4,"u")}const E4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,R4=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,T4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,O4=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,A4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,v_=/^[A-Za-z0-9_-]*$/,M4=/^https?$/,j4=/^\+[1-9]\d{6,14}$/,y_="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",z4=new RegExp(`^${y_}$`);function b_(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function D4(e){return new RegExp(`^${b_(e)}$`)}function N4(e){const n=b_({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${n}(?:${r.join("|")})`;return new RegExp(`^${y_}T(?:${i})$`)}const k4=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},L4=/^(?:true|false)$/i,I4=/^[^A-Z]*$/,$4=/^[^a-z]*$/,Ar=ue("$ZodCheck",(e,n)=>{var r;e._zod??(e._zod={}),e._zod.def=n,(r=e._zod).onattach??(r.onattach=[])}),V4=ue("$ZodCheckMaxLength",(e,n)=>{var r;Ar.init(e,n),(r=e._zod.def).when??(r.when=i=>{const s=i.value;return!Ip(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{const s=i._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum{const s=i.value;if(s.length<=n.maximum)return;const c=Vp(s);i.issues.push({origin:c,code:"too_big",maximum:n.maximum,inclusive:!0,input:s,inst:e,continue:!n.abort})}}),F4=ue("$ZodCheckMinLength",(e,n)=>{var r;Ar.init(e,n),(r=e._zod.def).when??(r.when=i=>{const s=i.value;return!Ip(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{const s=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>s&&(i._zod.bag.minimum=n.minimum)}),e._zod.check=i=>{const s=i.value;if(s.length>=n.minimum)return;const c=Vp(s);i.issues.push({origin:c,code:"too_small",minimum:n.minimum,inclusive:!0,input:s,inst:e,continue:!n.abort})}}),P4=ue("$ZodCheckLengthEquals",(e,n)=>{var r;Ar.init(e,n),(r=e._zod.def).when??(r.when=i=>{const s=i.value;return!Ip(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{const s=i._zod.bag;s.minimum=n.length,s.maximum=n.length,s.length=n.length}),e._zod.check=i=>{const s=i.value,l=s.length;if(l===n.length)return;const c=Vp(s),d=l>n.length;i.issues.push({origin:c,...d?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!n.abort})}}),Kc=ue("$ZodCheckStringFormat",(e,n)=>{var r,i;Ar.init(e,n),e._zod.onattach.push(s=>{const l=s._zod.bag;l.format=n.format,n.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(n.pattern))}),n.pattern?(r=e._zod).check??(r.check=s=>{n.pattern.lastIndex=0,!n.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:n.format,input:s.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(i=e._zod).check??(i.check=()=>{})}),U4=ue("$ZodCheckRegex",(e,n)=>{Kc.init(e,n),e._zod.check=r=>{n.pattern.lastIndex=0,!n.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),H4=ue("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=I4),Kc.init(e,n)}),B4=ue("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=$4),Kc.init(e,n)}),q4=ue("$ZodCheckIncludes",(e,n)=>{Ar.init(e,n);const r=Uc(n.includes),i=new RegExp(typeof n.position=="number"?`^.{${n.position}}${r}`:r);n.pattern=i,e._zod.onattach.push(s=>{const l=s._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(i)}),e._zod.check=s=>{s.value.includes(n.includes,n.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:s.value,inst:e,continue:!n.abort})}}),G4=ue("$ZodCheckStartsWith",(e,n)=>{Ar.init(e,n);const r=new RegExp(`^${Uc(n.prefix)}.*`);n.pattern??(n.pattern=r),e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(n.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:i.value,inst:e,continue:!n.abort})}}),Z4=ue("$ZodCheckEndsWith",(e,n)=>{Ar.init(e,n);const r=new RegExp(`.*${Uc(n.suffix)}$`);n.pattern??(n.pattern=r),e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(n.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:i.value,inst:e,continue:!n.abort})}}),K4=ue("$ZodCheckOverwrite",(e,n)=>{Ar.init(e,n),e._zod.check=r=>{r.value=n.tx(r.value)}});class Y4{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const i=n.split(`
-`).filter(c=>c),s=Math.min(...i.map(c=>c.length-c.trimStart().length)),l=i.map(c=>c.slice(s)).map(c=>" ".repeat(this.indent*2)+c);for(const c of l)this.content.push(c)}compile(){const n=Function,r=this?.args,s=[...(this?.content??[""]).map(l=>` ${l}`)];return new n(...r,s.join(`
-`))}}const Q4={major:4,minor:4,patch:3},$t=ue("$ZodType",(e,n)=>{var r;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=Q4;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const s of i)for(const l of s._zod.onattach)l(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(c,d,h)=>{let m=Ca(c),y;for(const g of d){if(g._zod.def.when){if(Wk(c)||!g._zod.def.when(c))continue}else if(m)continue;const b=c.issues.length,S=g._zod.check(c);if(S instanceof Promise&&h?.async===!1)throw new Ta;if(y||S instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await S,c.issues.length!==b&&(m||(m=Ca(c,b)))});else{if(c.issues.length===b)continue;m||(m=Ca(c,b))}}return y?y.then(()=>c):c},l=(c,d,h)=>{if(Ca(c))return c.aborted=!0,c;const m=s(d,i,h);if(m instanceof Promise){if(h.async===!1)throw new Ta;return m.then(y=>e._zod.parse(y,h))}return e._zod.parse(m,h)};e._zod.run=(c,d)=>{if(d.skipChecks)return e._zod.parse(c,d);if(d.direction==="backward"){const m=e._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(y=>l(y,c,d)):l(m,c,d)}const h=e._zod.parse(c,d);if(h instanceof Promise){if(d.async===!1)throw new Ta;return h.then(m=>s(m,i,d))}return s(h,i,d)}}ft(e,"~standard",()=>({validate:s=>{try{const l=o4(e,s);return l.success?{value:l.data}:{issues:l.error?.issues}}catch{return i4(e,s).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},vendor:"zod",version:1}))}),Pp=ue("$ZodString",(e,n)=>{$t.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??k4(e._zod.bag),e._zod.parse=(r,i)=>{if(n.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),xt=ue("$ZodStringFormat",(e,n)=>{Kc.init(e,n),Pp.init(e,n)}),X4=ue("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=x4),xt.init(e,n)}),J4=ue("$ZodUUID",(e,n)=>{if(n.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(i===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=aS(i))}else n.pattern??(n.pattern=aS());xt.init(e,n)}),W4=ue("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=w4),xt.init(e,n)}),e3=ue("$ZodURL",(e,n)=>{xt.init(e,n),e._zod.check=r=>{try{const i=r.value.trim();if(!n.normalize&&n.protocol?.source===M4.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!n.abort});return}const s=new URL(i);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(s.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:r.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:r.value,inst:e,continue:!n.abort})),n.normalize?r.value=s.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!n.abort})}}}),t3=ue("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=C4()),xt.init(e,n)}),n3=ue("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=b4),xt.init(e,n)}),r3=ue("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=m4),xt.init(e,n)}),o3=ue("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=p4),xt.init(e,n)}),i3=ue("$ZodULID",(e,n)=>{n.pattern??(n.pattern=g4),xt.init(e,n)}),a3=ue("$ZodXID",(e,n)=>{n.pattern??(n.pattern=v4),xt.init(e,n)}),s3=ue("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=y4),xt.init(e,n)}),l3=ue("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=N4(n)),xt.init(e,n)}),u3=ue("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=z4),xt.init(e,n)}),c3=ue("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=D4(n)),xt.init(e,n)}),d3=ue("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=S4),xt.init(e,n)}),f3=ue("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=E4),xt.init(e,n),e._zod.bag.format="ipv4"}),h3=ue("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=R4),xt.init(e,n),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!n.abort})}}}),m3=ue("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=T4),xt.init(e,n)}),p3=ue("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=O4),xt.init(e,n),e._zod.check=r=>{const i=r.value.split("/");try{if(i.length!==2)throw new Error;const[s,l]=i;if(!l)throw new Error;const c=Number(l);if(`${c}`!==l)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${s}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!n.abort})}}});function S_(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const g3=ue("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=A4),xt.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{S_(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!n.abort})}});function v3(e){if(!v_.test(e))return!1;const n=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return S_(r)}const y3=ue("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=v_),xt.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{v3(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!n.abort})}}),b3=ue("$ZodE164",(e,n)=>{n.pattern??(n.pattern=j4),xt.init(e,n)});function S3(e,n=null){try{const r=e.split(".");if(r.length!==3)return!1;const[i]=r;if(!i)return!1;const s=JSON.parse(atob(i));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||n&&(!("alg"in s)||s.alg!==n))}catch{return!1}}const x3=ue("$ZodJWT",(e,n)=>{xt.init(e,n),e._zod.check=r=>{S3(r.value,n.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!n.abort})}}),w3=ue("$ZodBoolean",(e,n)=>{$t.init(e,n),e._zod.pattern=L4,e._zod.parse=(r,i)=>{if(n.coerce)try{r.value=!!r.value}catch{}const s=r.value;return typeof s=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),r}}),_3=ue("$ZodUnknown",(e,n)=>{$t.init(e,n),e._zod.parse=r=>r}),C3=ue("$ZodNever",(e,n)=>{$t.init(e,n),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function sS(e,n,r){e.issues.length&&n.issues.push(...p_(r,e.issues)),n.value[r]=e.value}const E3=ue("$ZodArray",(e,n)=>{$t.init(e,n),e._zod.parse=(r,i)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);const l=[];for(let c=0;csS(m,r,c))):sS(h,r,c)}return l.length?Promise.all(l).then(()=>r):r}});function dc(e,n,r,i,s,l){const c=r in i;if(e.issues.length){if(s&&l&&!c)return;n.issues.push(...p_(r,e.issues))}if(!c&&!s){e.issues.length||n.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?c&&(n.value[r]=void 0):n.value[r]=e.value}function x_(e){const n=Object.keys(e.shape);for(const i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const r=qk(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function w_(e,n,r,i,s,l){const c=[],d=s.keySet,h=s.catchall._zod,m=h.def.type,y=h.optin==="optional",g=h.optout==="optional";for(const b in n){if(b==="__proto__"||d.has(b))continue;if(m==="never"){c.push(b);continue}const S=h.run({value:n[b],issues:[]},i);S instanceof Promise?e.push(S.then(_=>dc(_,r,b,n,y,g))):dc(S,r,b,n,y,g)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:n,inst:l}),e.length?Promise.all(e).then(()=>r):r}const R3=ue("$ZodObject",(e,n)=>{if($t.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const d=n.shape;Object.defineProperty(n,"shape",{get:()=>{const h={...d};return Object.defineProperty(n,"shape",{value:h}),h}})}const i=Lp(()=>x_(n));ft(e._zod,"propValues",()=>{const d=n.shape,h={};for(const m in d){const y=d[m]._zod;if(y.values){h[m]??(h[m]=new Set);for(const g of y.values)h[m].add(g)}}return h});const s=cc,l=n.catchall;let c;e._zod.parse=(d,h)=>{c??(c=i.value);const m=d.value;if(!s(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const y=[],g=c.shape;for(const b of c.keys){const S=g[b],_=S._zod.optin==="optional",C=S._zod.optout==="optional",E=S._zod.run({value:m[b],issues:[]},h);E instanceof Promise?y.push(E.then(T=>dc(T,d,b,m,_,C))):dc(E,d,b,m,_,C)}return l?w_(y,m,d,h,i.value,e):y.length?Promise.all(y).then(()=>d):d}}),T3=ue("$ZodObjectJIT",(e,n)=>{R3.init(e,n);const r=e._zod.parse,i=Lp(()=>x_(n)),s=b=>{const S=new Y4(["shape","payload","ctx"]),_=i.value,C=A=>{const k=iS(A);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};S.write("const input = payload.value;");const E=Object.create(null);let T=0;for(const A of _.keys)E[A]=`key_${T++}`;S.write("const newResult = {};");for(const A of _.keys){const k=E[A],L=iS(A),q=b[A],H=q?._zod?.optin==="optional",$=q?._zod?.optout==="optional";S.write(`const ${k} = ${C(A)};`),H&&$?S.write(`
- if (${k}.issues.length) {
- if (${L} in input) {
- payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
- ...iss,
- path: iss.path ? [${L}, ...iss.path] : [${L}]
- })));
- }
- }
-
- if (${k}.value === undefined) {
- if (${L} in input) {
- newResult[${L}] = undefined;
- }
- } else {
- newResult[${L}] = ${k}.value;
- }
-
- `):H?S.write(`
- if (${k}.issues.length) {
- payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
- ...iss,
- path: iss.path ? [${L}, ...iss.path] : [${L}]
- })));
- }
-
- if (${k}.value === undefined) {
- if (${L} in input) {
- newResult[${L}] = undefined;
- }
- } else {
- newResult[${L}] = ${k}.value;
- }
-
- `):S.write(`
- const ${k}_present = ${L} in input;
- if (${k}.issues.length) {
- payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
- ...iss,
- path: iss.path ? [${L}, ...iss.path] : [${L}]
- })));
- }
- if (!${k}_present && !${k}.issues.length) {
- payload.issues.push({
- code: "invalid_type",
- expected: "nonoptional",
- input: undefined,
- path: [${L}]
- });
- }
-
- if (${k}_present) {
- if (${k}.value === undefined) {
- newResult[${L}] = undefined;
- } else {
- newResult[${L}] = ${k}.value;
- }
- }
-
- `)}S.write("payload.value = newResult;"),S.write("return payload;");const O=S.compile();return(A,k)=>O(b,A,k)};let l;const c=cc,d=!kp.jitless,m=d&&Hk.value,y=n.catchall;let g;e._zod.parse=(b,S)=>{g??(g=i.value);const _=b.value;return c(_)?d&&m&&S?.async===!1&&S.jitless!==!0?(l||(l=s(n.shape)),b=l(b,S),y?w_([],_,b,S,g,e):b):r(b,S):(b.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),b)}});function lS(e,n,r,i){for(const l of e)if(l.issues.length===0)return n.value=l.value,n;const s=e.filter(l=>!Ca(l));return s.length===1?(n.value=s[0].value,s[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:r,errors:e.map(l=>l.issues.map(c=>yi(c,i,vi())))}),n)}const O3=ue("$ZodUnion",(e,n)=>{$t.init(e,n),ft(e._zod,"optin",()=>n.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ft(e._zod,"optout",()=>n.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ft(e._zod,"values",()=>{if(n.options.every(i=>i._zod.values))return new Set(n.options.flatMap(i=>Array.from(i._zod.values)))}),ft(e._zod,"pattern",()=>{if(n.options.every(i=>i._zod.pattern)){const i=n.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>$p(s.source)).join("|")})$`)}});const r=n.options.length===1?n.options[0]._zod.run:null;e._zod.parse=(i,s)=>{if(r)return r(i,s);let l=!1;const c=[];for(const d of n.options){const h=d._zod.run({value:i.value,issues:[]},s);if(h instanceof Promise)c.push(h),l=!0;else{if(h.issues.length===0)return h;c.push(h)}}return l?Promise.all(c).then(d=>lS(d,i,e,s)):lS(c,i,e,s)}}),A3=ue("$ZodIntersection",(e,n)=>{$t.init(e,n),e._zod.parse=(r,i)=>{const s=r.value,l=n.left._zod.run({value:s,issues:[]},i),c=n.right._zod.run({value:s,issues:[]},i);return l instanceof Promise||c instanceof Promise?Promise.all([l,c]).then(([h,m])=>uS(r,h,m)):uS(r,l,c)}});function Tm(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(Qs(e)&&Qs(n)){const r=Object.keys(n),i=Object.keys(e).filter(l=>r.indexOf(l)!==-1),s={...e,...n};for(const l of i){const c=Tm(e[l],n[l]);if(!c.valid)return{valid:!1,mergeErrorPath:[l,...c.mergeErrorPath]};s[l]=c.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let i=0;id.l&&d.r).map(([d])=>d);if(l.length&&s&&e.issues.push({...s,keys:l}),Ca(e))return e;const c=Tm(n.value,r.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const M3=ue("$ZodEnum",(e,n)=>{$t.init(e,n);const r=f_(n.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(s=>Bk.has(typeof s)).map(s=>typeof s=="string"?Uc(s):s.toString()).join("|")})$`),e._zod.parse=(s,l)=>{const c=s.value;return i.has(c)||s.issues.push({code:"invalid_value",values:r,input:c,inst:e}),s}}),j3=ue("$ZodTransform",(e,n)=>{$t.init(e,n),e._zod.optin="optional",e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new d_(e.constructor.name);const s=n.transform(r.value,r);if(i.async)return(s instanceof Promise?s:Promise.resolve(s)).then(c=>(r.value=c,r.fallback=!0,r));if(s instanceof Promise)throw new Ta;return r.value=s,r.fallback=!0,r}});function cS(e,n){return n===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const __=ue("$ZodOptional",(e,n)=>{$t.init(e,n),e._zod.optin="optional",e._zod.optout="optional",ft(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),ft(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${$p(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(n.innerType._zod.optin==="optional"){const s=r.value,l=n.innerType._zod.run(r,i);return l instanceof Promise?l.then(c=>cS(c,s)):cS(l,s)}return r.value===void 0?r:n.innerType._zod.run(r,i)}}),z3=ue("$ZodExactOptional",(e,n)=>{__.init(e,n),ft(e._zod,"values",()=>n.innerType._zod.values),ft(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(r,i)=>n.innerType._zod.run(r,i)}),D3=ue("$ZodNullable",(e,n)=>{$t.init(e,n),ft(e._zod,"optin",()=>n.innerType._zod.optin),ft(e._zod,"optout",()=>n.innerType._zod.optout),ft(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${$p(r.source)}|null)$`):void 0}),ft(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:n.innerType._zod.run(r,i)}),N3=ue("$ZodDefault",(e,n)=>{$t.init(e,n),e._zod.optin="optional",ft(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return n.innerType._zod.run(r,i);if(r.value===void 0)return r.value=n.defaultValue,r;const s=n.innerType._zod.run(r,i);return s instanceof Promise?s.then(l=>dS(l,n)):dS(s,n)}});function dS(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const k3=ue("$ZodPrefault",(e,n)=>{$t.init(e,n),e._zod.optin="optional",ft(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=n.defaultValue),n.innerType._zod.run(r,i))}),L3=ue("$ZodNonOptional",(e,n)=>{$t.init(e,n),ft(e._zod,"values",()=>{const r=n.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const s=n.innerType._zod.run(r,i);return s instanceof Promise?s.then(l=>fS(l,e)):fS(s,e)}});function fS(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const I3=ue("$ZodCatch",(e,n)=>{$t.init(e,n),e._zod.optin="optional",ft(e._zod,"optout",()=>n.innerType._zod.optout),ft(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return n.innerType._zod.run(r,i);const s=n.innerType._zod.run(r,i);return s instanceof Promise?s.then(l=>(r.value=l.value,l.issues.length&&(r.value=n.catchValue({...r,error:{issues:l.issues.map(c=>yi(c,i,vi()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=s.value,s.issues.length&&(r.value=n.catchValue({...r,error:{issues:s.issues.map(l=>yi(l,i,vi()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),$3=ue("$ZodPipe",(e,n)=>{$t.init(e,n),ft(e._zod,"values",()=>n.in._zod.values),ft(e._zod,"optin",()=>n.in._zod.optin),ft(e._zod,"optout",()=>n.out._zod.optout),ft(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){const l=n.out._zod.run(r,i);return l instanceof Promise?l.then(c=>Fu(c,n.in,i)):Fu(l,n.in,i)}const s=n.in._zod.run(r,i);return s instanceof Promise?s.then(l=>Fu(l,n.out,i)):Fu(s,n.out,i)}});function Fu(e,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}const V3=ue("$ZodReadonly",(e,n)=>{$t.init(e,n),ft(e._zod,"propValues",()=>n.innerType._zod.propValues),ft(e._zod,"values",()=>n.innerType._zod.values),ft(e._zod,"optin",()=>n.innerType?._zod?.optin),ft(e._zod,"optout",()=>n.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return n.innerType._zod.run(r,i);const s=n.innerType._zod.run(r,i);return s instanceof Promise?s.then(hS):hS(s)}});function hS(e){return e.value=Object.freeze(e.value),e}const F3=ue("$ZodCustom",(e,n)=>{Ar.init(e,n),$t.init(e,n),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,s=n.fn(i);if(s instanceof Promise)return s.then(l=>mS(l,r,i,e));mS(s,r,i,e)}});function mS(e,n,r,i){if(!e){const s={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(s.params=i._zod.def.params),n.issues.push(Xs(s))}}var pS;class P3{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...r){const i=r[0];return this._map.set(n,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const r=this._map.get(n);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(n),this}get(n){const r=n._zod.parent;if(r){const i={...this.get(r)??{}};delete i.id;const s={...i,...this._map.get(n)};return Object.keys(s).length?s:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function U3(){return new P3}(pS=globalThis).__zod_globalRegistry??(pS.__zod_globalRegistry=U3());const Ls=globalThis.__zod_globalRegistry;function H3(e,n){return new e({type:"string",...Le(n)})}function B3(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Le(n)})}function gS(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Le(n)})}function q3(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Le(n)})}function G3(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Le(n)})}function Z3(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Le(n)})}function K3(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Le(n)})}function Y3(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Le(n)})}function Q3(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Le(n)})}function X3(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Le(n)})}function J3(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Le(n)})}function W3(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Le(n)})}function e5(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Le(n)})}function t5(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Le(n)})}function n5(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Le(n)})}function r5(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Le(n)})}function o5(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Le(n)})}function i5(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Le(n)})}function a5(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Le(n)})}function s5(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Le(n)})}function l5(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Le(n)})}function u5(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Le(n)})}function c5(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Le(n)})}function d5(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Le(n)})}function f5(e,n){return new e({type:"string",format:"date",check:"string_format",...Le(n)})}function h5(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...Le(n)})}function m5(e,n){return new e({type:"string",format:"duration",check:"string_format",...Le(n)})}function p5(e,n){return new e({type:"boolean",...Le(n)})}function g5(e){return new e({type:"unknown"})}function v5(e,n){return new e({type:"never",...Le(n)})}function C_(e,n){return new V4({check:"max_length",...Le(n),maximum:e})}function fc(e,n){return new F4({check:"min_length",...Le(n),minimum:e})}function E_(e,n){return new P4({check:"length_equals",...Le(n),length:e})}function y5(e,n){return new U4({check:"string_format",format:"regex",...Le(n),pattern:e})}function b5(e){return new H4({check:"string_format",format:"lowercase",...Le(e)})}function S5(e){return new B4({check:"string_format",format:"uppercase",...Le(e)})}function x5(e,n){return new q4({check:"string_format",format:"includes",...Le(n),includes:e})}function w5(e,n){return new G4({check:"string_format",format:"starts_with",...Le(n),prefix:e})}function _5(e,n){return new Z4({check:"string_format",format:"ends_with",...Le(n),suffix:e})}function La(e){return new K4({check:"overwrite",tx:e})}function C5(e){return La(n=>n.normalize(e))}function E5(){return La(e=>e.trim())}function R5(){return La(e=>e.toLowerCase())}function T5(){return La(e=>e.toUpperCase())}function O5(){return La(e=>Uk(e))}function A5(e,n,r){return new e({type:"array",element:n,...Le(r)})}function M5(e,n,r){return new e({type:"custom",check:"custom",fn:n,...Le(r)})}function j5(e,n){const r=z5(i=>(i.addIssue=s=>{if(typeof s=="string")i.issues.push(Xs(s,i.value,r._zod.def));else{const l=s;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=i.value),l.inst??(l.inst=r),l.continue??(l.continue=!r._zod.def.abort),i.issues.push(Xs(l))}},e(i.value,i)),n);return r}function z5(e,n){const r=new Ar({check:"custom",...Le(n)});return r._zod.check=e,r}function R_(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ls,target:n,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function un(e,n,r={path:[],schemaPath:[]}){var i;const s=e._zod.def,l=n.seen.get(e);if(l)return l.count++,r.schemaPath.includes(e)&&(l.cycle=r.path),l.schema;const c={schema:{},count:1,cycle:void 0,path:r.path};n.seen.set(e,c);const d=e._zod.toJSONSchema?.();if(d)c.schema=d;else{const y={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,c.schema,y);else{const b=c.schema,S=n.processors[s.type];if(!S)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);S(e,n,b,y)}const g=e._zod.parent;g&&(c.ref||(c.ref=g),un(g,n,y),n.seen.get(g).isParent=!0)}const h=n.metadataRegistry.get(e);return h&&Object.assign(c.schema,h),n.io==="input"&&gn(e)&&(delete c.schema.examples,delete c.schema.default),n.io==="input"&&"_prefault"in c.schema&&((i=c.schema).default??(i.default=c.schema._prefault)),delete c.schema._prefault,n.seen.get(e).schema}function T_(e,n){const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const c of e.seen.entries()){const d=e.metadataRegistry.get(c[0])?.id;if(d){const h=i.get(d);if(h&&h!==c[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(d,c[0])}}const s=c=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=e.external.registry.get(c[0])?.id,b=e.external.uri??(_=>_);if(g)return{ref:b(g)};const S=c[1].defId??c[1].schema.id??`schema${e.counter++}`;return c[1].defId=S,{defId:S,ref:`${b("__shared")}#/${d}/${S}`}}if(c[1]===r)return{ref:"#"};const m=`#/${d}/`,y=c[1].schema.id??`__schema${e.counter++}`;return{defId:y,ref:m+y}},l=c=>{if(c[1].schema.$ref)return;const d=c[1],{ref:h,defId:m}=s(c);d.def={...d.schema},m&&(d.defId=m);const y=d.schema;for(const g in y)delete y[g];y.$ref=h};if(e.cycles==="throw")for(const c of e.seen.entries()){const d=c[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/
-
-Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const c of e.seen.entries()){const d=c[1];if(n===c[0]){l(c);continue}if(e.external){const m=e.external.registry.get(c[0])?.id;if(n!==c[0]&&m){l(c);continue}}if(e.metadataRegistry.get(c[0])?.id){l(c);continue}if(d.cycle){l(c);continue}if(d.count>1&&e.reused==="ref"){l(c);continue}}}function O_(e,n){const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=d=>{const h=e.seen.get(d);if(h.ref===null)return;const m=h.def??h.schema,y={...m},g=h.ref;if(h.ref=null,g){i(g);const S=e.seen.get(g),_=S.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(_)):Object.assign(m,_),Object.assign(m,y),d._zod.parent===g)for(const E in m)E==="$ref"||E==="allOf"||E in y||delete m[E];if(_.$ref&&S.def)for(const E in m)E==="$ref"||E==="allOf"||E in S.def&&JSON.stringify(m[E])===JSON.stringify(S.def[E])&&delete m[E]}const b=d._zod.parent;if(b&&b!==g){i(b);const S=e.seen.get(b);if(S?.schema.$ref&&(m.$ref=S.schema.$ref,S.def))for(const _ in m)_==="$ref"||_==="allOf"||_ in S.def&&JSON.stringify(m[_])===JSON.stringify(S.def[_])&&delete m[_]}e.override({zodSchema:d,jsonSchema:m,path:h.path??[]})};for(const d of[...e.seen.entries()].reverse())i(d[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(n)?.id;if(!d)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(d)}Object.assign(s,r.def??r.schema);const l=e.metadataRegistry.get(n)?.id;l!==void 0&&s.id===l&&delete s.id;const c=e.external?.defs??{};for(const d of e.seen.entries()){const h=d[1];h.def&&h.defId&&(h.def.id===h.defId&&delete h.def.id,c[h.defId]=h.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?s.$defs=c:s.definitions=c);try{const d=JSON.parse(JSON.stringify(s));return Object.defineProperty(d,"~standard",{value:{...n["~standard"],jsonSchema:{input:hc(n,"input",e.processors),output:hc(n,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function gn(e,n){const r=n??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return gn(i.element,r);if(i.type==="set")return gn(i.valueType,r);if(i.type==="lazy")return gn(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return gn(i.innerType,r);if(i.type==="intersection")return gn(i.left,r)||gn(i.right,r);if(i.type==="record"||i.type==="map")return gn(i.keyType,r)||gn(i.valueType,r);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:gn(i.in,r)||gn(i.out,r);if(i.type==="object"){for(const s in i.shape)if(gn(i.shape[s],r))return!0;return!1}if(i.type==="union"){for(const s of i.options)if(gn(s,r))return!0;return!1}if(i.type==="tuple"){for(const s of i.items)if(gn(s,r))return!0;return!!(i.rest&&gn(i.rest,r))}return!1}const D5=(e,n={})=>r=>{const i=R_({...r,processors:n});return un(e,i),T_(i,e),O_(i,e)},hc=(e,n,r={})=>i=>{const{libraryOptions:s,target:l}=i??{},c=R_({...s??{},target:l,io:n,processors:r});return un(e,c),T_(c,e),O_(c,e)},N5={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},k5=(e,n,r,i)=>{const s=r;s.type="string";const{minimum:l,maximum:c,format:d,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof l=="number"&&(s.minLength=l),typeof c=="number"&&(s.maxLength=c),d&&(s.format=N5[d]??d,s.format===""&&delete s.format,d==="time"&&delete s.format),m&&(s.contentEncoding=m),h&&h.size>0){const y=[...h];y.length===1?s.pattern=y[0].source:y.length>1&&(s.allOf=[...y.map(g=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},L5=(e,n,r,i)=>{r.type="boolean"},I5=(e,n,r,i)=>{r.not={}},$5=(e,n,r,i)=>{},V5=(e,n,r,i)=>{const s=e._zod.def,l=f_(s.entries);l.every(c=>typeof c=="number")&&(r.type="number"),l.every(c=>typeof c=="string")&&(r.type="string"),r.enum=l},F5=(e,n,r,i)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},P5=(e,n,r,i)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},U5=(e,n,r,i)=>{const s=r,l=e._zod.def,{minimum:c,maximum:d}=e._zod.bag;typeof c=="number"&&(s.minItems=c),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=un(l.element,n,{...i,path:[...i.path,"items"]})},H5=(e,n,r,i)=>{const s=r,l=e._zod.def;s.type="object",s.properties={};const c=l.shape;for(const m in c)s.properties[m]=un(c[m],n,{...i,path:[...i.path,"properties",m]});const d=new Set(Object.keys(c)),h=new Set([...d].filter(m=>{const y=l.shape[m]._zod;return n.io==="input"?y.optin===void 0:y.optout===void 0}));h.size>0&&(s.required=Array.from(h)),l.catchall?._zod.def.type==="never"?s.additionalProperties=!1:l.catchall?l.catchall&&(s.additionalProperties=un(l.catchall,n,{...i,path:[...i.path,"additionalProperties"]})):n.io==="output"&&(s.additionalProperties=!1)},B5=(e,n,r,i)=>{const s=e._zod.def,l=s.inclusive===!1,c=s.options.map((d,h)=>un(d,n,{...i,path:[...i.path,l?"oneOf":"anyOf",h]}));l?r.oneOf=c:r.anyOf=c},q5=(e,n,r,i)=>{const s=e._zod.def,l=un(s.left,n,{...i,path:[...i.path,"allOf",0]}),c=un(s.right,n,{...i,path:[...i.path,"allOf",1]}),d=m=>"allOf"in m&&Object.keys(m).length===1,h=[...d(l)?l.allOf:[l],...d(c)?c.allOf:[c]];r.allOf=h},G5=(e,n,r,i)=>{const s=e._zod.def,l=un(s.innerType,n,i),c=n.seen.get(e);n.target==="openapi-3.0"?(c.ref=s.innerType,r.nullable=!0):r.anyOf=[l,{type:"null"}]},Z5=(e,n,r,i)=>{const s=e._zod.def;un(s.innerType,n,i);const l=n.seen.get(e);l.ref=s.innerType},K5=(e,n,r,i)=>{const s=e._zod.def;un(s.innerType,n,i);const l=n.seen.get(e);l.ref=s.innerType,r.default=JSON.parse(JSON.stringify(s.defaultValue))},Y5=(e,n,r,i)=>{const s=e._zod.def;un(s.innerType,n,i);const l=n.seen.get(e);l.ref=s.innerType,n.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},Q5=(e,n,r,i)=>{const s=e._zod.def;un(s.innerType,n,i);const l=n.seen.get(e);l.ref=s.innerType;let c;try{c=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=c},X5=(e,n,r,i)=>{const s=e._zod.def,l=s.in._zod.traits.has("$ZodTransform"),c=n.io==="input"?l?s.out:s.in:s.out;un(c,n,i);const d=n.seen.get(e);d.ref=c},J5=(e,n,r,i)=>{const s=e._zod.def;un(s.innerType,n,i);const l=n.seen.get(e);l.ref=s.innerType,r.readOnly=!0},A_=(e,n,r,i)=>{const s=e._zod.def;un(s.innerType,n,i);const l=n.seen.get(e);l.ref=s.innerType};function Om(){return Om=Object.assign?Object.assign.bind():function(e){for(var n=1;n0){var h=s.errors[0][0];r[d]={message:h.message,type:h.code}}else r[d]={message:c,type:l};if(s.code==="invalid_union"&&s.errors.forEach(function(g){return g.forEach(function(b){return e.push(Om({},b,{path:[].concat(s.path,b.path)}))})}),n){var m=r[d].types,y=m&&m[s.code];r[d]=Np(d,n,r,l,y?[].concat(y,s.message):s.message)}e.shift()};e.length;)i();return r}function mc(e,n,r){if(r===void 0&&(r={}),(function(i){return"_def"in i&&typeof i._def=="object"&&"typeName"in i._def})(e))return function(i,s,l){try{return Promise.resolve(vS(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](i,n)).then(function(c){return l.shouldUseNativeValidation&&Em({},l),{errors:{},values:r.raw?Object.assign({},i):c}})},function(c){if((function(d){return Array.isArray(d?.issues)})(c))return{values:{},errors:tS(W5(c.errors,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw c}))}catch(c){return Promise.reject(c)}};if((function(i){return"_zod"in i&&typeof i._zod=="object"})(e))return function(i,s,l){try{return Promise.resolve(vS(function(){return Promise.resolve((r.mode==="sync"?n4:r4)(e,i,n)).then(function(c){return l.shouldUseNativeValidation&&Em({},l),{errors:{},values:r.raw?Object.assign({},i):c}})},function(c){if((function(d){return d instanceof Fp})(c))return{values:{},errors:tS(eL(c.issues,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw c}))}catch(c){return Promise.reject(c)}};throw new Error("Invalid input: not a Zod schema")}const tL=ue("ZodISODateTime",(e,n)=>{l3.init(e,n),Ct.init(e,n)});function nL(e){return d5(tL,e)}const rL=ue("ZodISODate",(e,n)=>{u3.init(e,n),Ct.init(e,n)});function oL(e){return f5(rL,e)}const iL=ue("ZodISOTime",(e,n)=>{c3.init(e,n),Ct.init(e,n)});function aL(e){return h5(iL,e)}const sL=ue("ZodISODuration",(e,n)=>{d3.init(e,n),Ct.init(e,n)});function lL(e){return m5(sL,e)}const uL=(e,n)=>{Fp.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>t4(e,r)},flatten:{value:r=>e4(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Rm,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Rm,2)}},isEmpty:{get(){return e.issues.length===0}}})},nr=ue("ZodError",uL,{Parent:Error}),cL=Bc(nr),dL=qc(nr),fL=Gc(nr),hL=Zc(nr),mL=a4(nr),pL=s4(nr),gL=l4(nr),vL=u4(nr),yL=c4(nr),bL=d4(nr),SL=f4(nr),xL=h4(nr),yS=new WeakMap;function Yc(e,n,r){const i=Object.getPrototypeOf(e);let s=yS.get(i);if(s||(s=new Set,yS.set(i,s)),!s.has(n)){s.add(n);for(const l in r){const c=r[l];Object.defineProperty(i,l,{configurable:!0,enumerable:!1,get(){const d=c.bind(this);return Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:!0,value:d}),d},set(d){Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:!0,value:d})}})}}}const Vt=ue("ZodType",(e,n)=>($t.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:hc(e,"input"),output:hc(e,"output")}}),e.toJSONSchema=D5(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.parse=(r,i)=>cL(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>fL(e,r,i),e.parseAsync=async(r,i)=>dL(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>hL(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>mL(e,r,i),e.decode=(r,i)=>pL(e,r,i),e.encodeAsync=async(r,i)=>gL(e,r,i),e.decodeAsync=async(r,i)=>vL(e,r,i),e.safeEncode=(r,i)=>yL(e,r,i),e.safeDecode=(r,i)=>bL(e,r,i),e.safeEncodeAsync=async(r,i)=>SL(e,r,i),e.safeDecodeAsync=async(r,i)=>xL(e,r,i),Yc(e,"ZodType",{check(...r){const i=this.def;return this.clone(Ho(i,{checks:[...i.checks??[],...r.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,i){return Bo(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(m6(r,i))},superRefine(r,i){return this.check(p6(r,i))},overwrite(r){return this.check(La(r))},optional(){return wS(this)},exactOptional(){return t6(this)},nullable(){return _S(this)},nullish(){return wS(_S(this))},nonoptional(r){return s6(this,r)},array(){return qL(this)},or(r){return KL([this,r])},and(r){return QL(this,r)},transform(r){return CS(this,WL(r))},default(r){return o6(this,r)},prefault(r){return a6(this,r)},catch(r){return u6(this,r)},pipe(r){return CS(this,r)},readonly(){return f6(this)},describe(r){const i=this.clone();return Ls.add(i,{description:r}),i},meta(...r){if(r.length===0)return Ls.get(this);const i=this.clone();return Ls.add(i,r[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Ls.get(e)?.description},configurable:!0}),e)),M_=ue("_ZodString",(e,n)=>{Pp.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(i,s,l)=>k5(e,i,s);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Yc(e,"_ZodString",{regex(...i){return this.check(y5(...i))},includes(...i){return this.check(x5(...i))},startsWith(...i){return this.check(w5(...i))},endsWith(...i){return this.check(_5(...i))},min(...i){return this.check(fc(...i))},max(...i){return this.check(C_(...i))},length(...i){return this.check(E_(...i))},nonempty(...i){return this.check(fc(1,...i))},lowercase(i){return this.check(b5(i))},uppercase(i){return this.check(S5(i))},trim(){return this.check(E5())},normalize(...i){return this.check(C5(...i))},toLowerCase(){return this.check(R5())},toUpperCase(){return this.check(T5())},slugify(){return this.check(O5())}})}),wL=ue("ZodString",(e,n)=>{Pp.init(e,n),M_.init(e,n),e.email=r=>e.check(B3(_L,r)),e.url=r=>e.check(Y3(CL,r)),e.jwt=r=>e.check(c5(VL,r)),e.emoji=r=>e.check(Q3(EL,r)),e.guid=r=>e.check(gS(bS,r)),e.uuid=r=>e.check(q3(Pu,r)),e.uuidv4=r=>e.check(G3(Pu,r)),e.uuidv6=r=>e.check(Z3(Pu,r)),e.uuidv7=r=>e.check(K3(Pu,r)),e.nanoid=r=>e.check(X3(RL,r)),e.guid=r=>e.check(gS(bS,r)),e.cuid=r=>e.check(J3(TL,r)),e.cuid2=r=>e.check(W3(OL,r)),e.ulid=r=>e.check(e5(AL,r)),e.base64=r=>e.check(s5(LL,r)),e.base64url=r=>e.check(l5(IL,r)),e.xid=r=>e.check(t5(ML,r)),e.ksuid=r=>e.check(n5(jL,r)),e.ipv4=r=>e.check(r5(zL,r)),e.ipv6=r=>e.check(o5(DL,r)),e.cidrv4=r=>e.check(i5(NL,r)),e.cidrv6=r=>e.check(a5(kL,r)),e.e164=r=>e.check(u5($L,r)),e.datetime=r=>e.check(nL(r)),e.date=r=>e.check(oL(r)),e.time=r=>e.check(aL(r)),e.duration=r=>e.check(lL(r))});function Up(e){return H3(wL,e)}const Ct=ue("ZodStringFormat",(e,n)=>{xt.init(e,n),M_.init(e,n)}),_L=ue("ZodEmail",(e,n)=>{W4.init(e,n),Ct.init(e,n)}),bS=ue("ZodGUID",(e,n)=>{X4.init(e,n),Ct.init(e,n)}),Pu=ue("ZodUUID",(e,n)=>{J4.init(e,n),Ct.init(e,n)}),CL=ue("ZodURL",(e,n)=>{e3.init(e,n),Ct.init(e,n)}),EL=ue("ZodEmoji",(e,n)=>{t3.init(e,n),Ct.init(e,n)}),RL=ue("ZodNanoID",(e,n)=>{n3.init(e,n),Ct.init(e,n)}),TL=ue("ZodCUID",(e,n)=>{r3.init(e,n),Ct.init(e,n)}),OL=ue("ZodCUID2",(e,n)=>{o3.init(e,n),Ct.init(e,n)}),AL=ue("ZodULID",(e,n)=>{i3.init(e,n),Ct.init(e,n)}),ML=ue("ZodXID",(e,n)=>{a3.init(e,n),Ct.init(e,n)}),jL=ue("ZodKSUID",(e,n)=>{s3.init(e,n),Ct.init(e,n)}),zL=ue("ZodIPv4",(e,n)=>{f3.init(e,n),Ct.init(e,n)}),DL=ue("ZodIPv6",(e,n)=>{h3.init(e,n),Ct.init(e,n)}),NL=ue("ZodCIDRv4",(e,n)=>{m3.init(e,n),Ct.init(e,n)}),kL=ue("ZodCIDRv6",(e,n)=>{p3.init(e,n),Ct.init(e,n)}),LL=ue("ZodBase64",(e,n)=>{g3.init(e,n),Ct.init(e,n)}),IL=ue("ZodBase64URL",(e,n)=>{y3.init(e,n),Ct.init(e,n)}),$L=ue("ZodE164",(e,n)=>{b3.init(e,n),Ct.init(e,n)}),VL=ue("ZodJWT",(e,n)=>{x3.init(e,n),Ct.init(e,n)}),FL=ue("ZodBoolean",(e,n)=>{w3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>L5(e,r,i)});function SS(e){return p5(FL,e)}const PL=ue("ZodUnknown",(e,n)=>{_3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>$5()});function xS(){return g5(PL)}const UL=ue("ZodNever",(e,n)=>{C3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>I5(e,r,i)});function HL(e){return v5(UL,e)}const BL=ue("ZodArray",(e,n)=>{E3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>U5(e,r,i,s),e.element=n.element,Yc(e,"ZodArray",{min(r,i){return this.check(fc(r,i))},nonempty(r){return this.check(fc(1,r))},max(r,i){return this.check(C_(r,i))},length(r,i){return this.check(E_(r,i))},unwrap(){return this.element}})});function qL(e,n){return A5(BL,e,n)}const GL=ue("ZodObject",(e,n)=>{T3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>H5(e,r,i,s),ft(e,"shape",()=>n.shape),Yc(e,"ZodObject",{keyof(){return XL(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:xS()})},loose(){return this.clone({...this._zod.def,catchall:xS()})},strict(){return this.clone({...this._zod.def,catchall:HL()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return Kk(this,r)},safeExtend(r){return Yk(this,r)},merge(r){return Qk(this,r)},pick(r){return Gk(this,r)},omit(r){return Zk(this,r)},partial(...r){return Xk(j_,this,r[0])},required(...r){return Jk(z_,this,r[0])}})});function Qc(e,n){const r={type:"object",shape:e??{},...Le(n)};return new GL(r)}const ZL=ue("ZodUnion",(e,n)=>{O3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>B5(e,r,i,s),e.options=n.options});function KL(e,n){return new ZL({type:"union",options:e,...Le(n)})}const YL=ue("ZodIntersection",(e,n)=>{A3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>q5(e,r,i,s)});function QL(e,n){return new YL({type:"intersection",left:e,right:n})}const Am=ue("ZodEnum",(e,n)=>{M3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(i,s,l)=>V5(e,i,s),e.enum=n.entries,e.options=Object.values(n.entries);const r=new Set(Object.keys(n.entries));e.extract=(i,s)=>{const l={};for(const c of i)if(r.has(c))l[c]=n.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Am({...n,checks:[],...Le(s),entries:l})},e.exclude=(i,s)=>{const l={...n.entries};for(const c of i)if(r.has(c))delete l[c];else throw new Error(`Key ${c} not found in enum`);return new Am({...n,checks:[],...Le(s),entries:l})}});function XL(e,n){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Am({type:"enum",entries:r,...Le(n)})}const JL=ue("ZodTransform",(e,n)=>{j3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>P5(e,r),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new d_(e.constructor.name);r.addIssue=l=>{if(typeof l=="string")r.issues.push(Xs(l,r.value,n));else{const c=l;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=r.value),c.inst??(c.inst=e),r.issues.push(Xs(c))}};const s=n.transform(r.value,r);return s instanceof Promise?s.then(l=>(r.value=l,r.fallback=!0,r)):(r.value=s,r.fallback=!0,r)}});function WL(e){return new JL({type:"transform",transform:e})}const j_=ue("ZodOptional",(e,n)=>{__.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>A_(e,r,i,s),e.unwrap=()=>e._zod.def.innerType});function wS(e){return new j_({type:"optional",innerType:e})}const e6=ue("ZodExactOptional",(e,n)=>{z3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>A_(e,r,i,s),e.unwrap=()=>e._zod.def.innerType});function t6(e){return new e6({type:"optional",innerType:e})}const n6=ue("ZodNullable",(e,n)=>{D3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>G5(e,r,i,s),e.unwrap=()=>e._zod.def.innerType});function _S(e){return new n6({type:"nullable",innerType:e})}const r6=ue("ZodDefault",(e,n)=>{N3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>K5(e,r,i,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function o6(e,n){return new r6({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():m_(n)}})}const i6=ue("ZodPrefault",(e,n)=>{k3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>Y5(e,r,i,s),e.unwrap=()=>e._zod.def.innerType});function a6(e,n){return new i6({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():m_(n)}})}const z_=ue("ZodNonOptional",(e,n)=>{L3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>Z5(e,r,i,s),e.unwrap=()=>e._zod.def.innerType});function s6(e,n){return new z_({type:"nonoptional",innerType:e,...Le(n)})}const l6=ue("ZodCatch",(e,n)=>{I3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>Q5(e,r,i,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function u6(e,n){return new l6({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const c6=ue("ZodPipe",(e,n)=>{$3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>X5(e,r,i,s),e.in=n.in,e.out=n.out});function CS(e,n){return new c6({type:"pipe",in:e,out:n})}const d6=ue("ZodReadonly",(e,n)=>{V3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>J5(e,r,i,s),e.unwrap=()=>e._zod.def.innerType});function f6(e){return new d6({type:"readonly",innerType:e})}const h6=ue("ZodCustom",(e,n)=>{F3.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,s)=>F5(e,r)});function m6(e,n={}){return M5(h6,e,n)}function p6(e,n){return j5(e,n)}const g6=/\.(md|markdown)$/i,v6=/\.(png|jpe?g|gif|svg|webp|ico|bmp|avif)$/i,D_=/\.html?$/i,y6=/\.(txt|log|json|ya?ml|toml|csv|go|py|js|ts|jsx|tsx|sh|bash|zsh|rb|rs|c|h|cpp|java|kt|swift|sql|css|xml|ini|conf|env|mod|sum|jsonl)$/i;function N_(e){if(e<1024)return e+" B";const n=["KB","MB","GB","TB"];let r=-1;do e/=1024,r++;while(e>=1024&&r[role=checkbox]]:translate-y-[2px]",e),...n})}function V_({className:e,...n}){return v.jsx("td",{"data-slot":"table-cell",className:St("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n})}const b6=Qc({name:Up().trim().min(1,"Give the organization a name.").max(60,"Keep it under 60 characters.")});function F_({header:e}){const n=e.column.getIsSorted();return e.column.getCanSort()?v.jsx(ES,{"data-sort":n||void 0,"aria-sort":n==="asc"?"ascending":n==="desc"?"descending":"none",children:v.jsxs("button",{type:"button",className:"th-sort",onClick:e.column.getToggleSortingHandler(),children:[ac(e.column.columnDef.header,e.getContext()),n==="asc"?" ↑":n==="desc"?" ↓":""]})}):v.jsx(ES,{children:ac(e.column.columnDef.header,e.getContext())})}function S6({org:e,projects:n,myEmail:r,onProjectsChanged:i}){const s=tl(),l=e.role==="owner",c=()=>s.invalidateQueries({queryKey:["orgs"]}),d=()=>s.invalidateQueries({queryKey:["invites",e.id]}),h=()=>s.invalidateQueries({queryKey:["orgShares",e.id]}),m=uc({resolver:mc(b6),values:{name:e.name}}),{data:y}=jn({queryKey:["invites",e.id],queryFn:()=>Fn(`/api/orgs/${e.id}/invites`),enabled:l,select:S=>S.invites||[]}),{data:g}=jn({queryKey:["orgShares",e.id],queryFn:()=>Fn(`/api/orgs/${e.id}/shares`),enabled:l,select:S=>S.shares||[]}),b=n.filter(S=>S.org===e.id);return v.jsxs("div",{className:"admin",children:[v.jsx("h1",{id:"org-title",children:e.name}),!l&&v.jsx("p",{className:"role-chip-row",children:v.jsx("span",{className:"ai-tag role-chip",children:"Member"})}),!l&&v.jsx("p",{className:"admin-sub",children:"Only owners can rename this organization, manage members, or issue invite links."}),l&&v.jsxs("form",{className:"admin-row",onSubmit:m.handleSubmit(async({name:S})=>{try{await zo("PATCH","/api/orgs/"+e.id,{name:S}),Je("Renamed."),c()}catch(_){Je(_.message,!0)}}),children:[v.jsx("label",{className:"admin-lbl",htmlFor:"org-rename",children:"Organization name"}),v.jsx("input",{id:"org-rename",type:"text","aria-invalid":!!m.formState.errors.name,"aria-describedby":m.formState.errors.name?"org-rename-err":void 0,...m.register("name")}),v.jsx(Bt,{variant:"subtle",id:"org-rename-btn",type:"submit",disabled:!m.formState.isDirty,children:"Rename org"}),m.formState.errors.name&&v.jsx("span",{id:"org-rename-err",role:"alert",className:"field-err",children:m.formState.errors.name.message})]}),v.jsx("h3",{children:"Members"}),v.jsx(x6,{org:e,owner:l,myEmail:r,onChanged:c}),!l&&v.jsxs(v.Fragment,{children:[v.jsx("h3",{children:"Projects"}),v.jsxs("div",{className:"admin-list",children:[b.length===0&&v.jsx("div",{className:"admin-empty",children:"No projects yet."}),b.map(S=>v.jsx("div",{className:"admin-item",children:v.jsx("span",{className:"ai-main",title:S.name,children:S.name})},S.id))]})]}),l&&v.jsxs(v.Fragment,{children:[v.jsx("h3",{children:"Projects"}),v.jsxs("div",{className:"admin-list",children:[b.length===0&&v.jsx("div",{className:"admin-empty",children:"No projects yet."}),b.map(S=>v.jsxs("div",{className:"admin-item",children:[v.jsx("span",{className:"ai-main",title:S.name,children:S.name}),v.jsx(Bt,{variant:"subtle","aria-label":`Rename ${S.name}`,onClick:async()=>{const _=await _p("Rename project","New name",S.name,"Rename");if(!(_===null||_.trim()===S.name))try{await zo("PATCH","/api/projects/"+S.id,{name:_}),Je("Renamed."),await i()}catch(C){Je(C.message,!0)}},children:"Rename"})]},S.id))]}),v.jsxs("div",{className:"admin-h",children:[v.jsx("h3",{children:"Invite links"}),v.jsx(Bt,{variant:"primary",onClick:async()=>{try{const S=await Oa(`/api/orgs/${e.id}/invites`),_=await Js(S.url);Je(_?"Invite link copied to clipboard.":"Invite created — copy it from the list below."),d()}catch(S){Je(S.message,!0)}},children:"New invite"})]}),v.jsxs("div",{className:"admin-list",children:[y&&y.length===0&&v.jsx("div",{className:"admin-empty",children:"No active invite links."}),(y||[]).map(S=>v.jsxs("div",{className:"admin-item",children:[v.jsx("button",{type:"button",className:"ai-main mono ai-copy","aria-label":`Copy invite link ${S.url}`,title:S.url,onClick:()=>Js(S.url).then(_=>Je(_?"Copied.":"Select and copy the link.")),children:S.url}),v.jsx("span",{className:"ai-tag",children:(S.creator?"by "+S.creator+" · ":"")+(S.uses?S.uses+" joined · ":"unused · ")+"expires "+new Date(S.expires).toLocaleDateString()}),v.jsx("button",{className:"ai-del","aria-label":`Revoke invite ${S.token.slice(0,8)}`,onClick:async()=>{if(await Cp("Revoke invite",`Revoke the link starting ${S.token.slice(0,8)}…? Anyone still holding it won't be able to join.`,"Revoke",!0))try{await zo("DELETE",`/api/orgs/${e.id}/invites/${S.token}`),Je("Revoked."),d()}catch(_){Je(_.message,!0)}},children:"Revoke"})]},S.token))]}),v.jsx("h3",{children:"Public share links"}),v.jsx(w6,{shares:g||[],onChanged:h})]})]})}function x6({org:e,owner:n,myEmail:r,onChanged:i}){const[s,l]=x.useState([{id:"email",desc:!1}]),c=x.useMemo(()=>V1(),[]),d=x.useMemo(()=>[c.accessor("email",{id:"email",header:"Member",cell:m=>{const y=!!r&&m.getValue().toLowerCase()===r.toLowerCase();return v.jsx("span",{className:"ai-main",title:m.getValue(),children:m.getValue()+(y?" (you)":"")})}}),c.accessor("role",{id:"role",header:"Role",cell:m=>{const y=m.row.original,g=!!r&&y.email.toLowerCase()===r.toLowerCase();return!n||g?v.jsx("span",{className:"ai-tag role-static",children:y.role}):v.jsxs("span",{className:"role-cell",children:[v.jsxs("select",{"aria-label":`Role for ${y.email}`,value:y.role,onChange:async b=>{try{await zo("PATCH",`/api/orgs/${e.id}/members/${encodeURIComponent(y.email)}`,{role:b.target.value}),Je("Role updated.")}catch(S){Je(S.message,!0)}i()},children:[v.jsx("option",{value:"owner",children:"owner"}),v.jsx("option",{value:"member",children:"member"})]}),v.jsx("button",{className:"ai-del","aria-label":`Remove ${y.email}`,onClick:async()=>{if(await Cp("Remove member",`Remove ${y.email} from ${e.name}?`,"Remove",!0))try{await zo("DELETE",`/api/orgs/${e.id}/members/${encodeURIComponent(y.email)}`),Je("Removed."),i()}catch(b){Je(b.message,!0)}},children:"Remove"})]})}})],[c,e.id,e.name,n,r]),h=X1({data:e.members,columns:d,state:{sorting:s},onSortingChange:l,getCoreRowModel:Y1(),getSortedRowModel:Q1()});return v.jsx("div",{className:"admin-list admin-card-table",children:v.jsxs(L_,{className:"admin-table",children:[v.jsx(I_,{children:h.getHeaderGroups().map(m=>v.jsx(pc,{children:m.headers.map(y=>v.jsx(F_,{header:y},y.id))},m.id))}),v.jsx($_,{children:h.getRowModel().rows.map(m=>v.jsx(pc,{className:"admin-item",children:m.getVisibleCells().map(y=>v.jsx(V_,{children:ac(y.column.columnDef.cell,y.getContext())},y.id))},m.id))})]})})}function w6({shares:e,onChanged:n}){const[r,i]=x.useState([]),s=x.useMemo(()=>V1(),[]),l=x.useMemo(()=>[s.accessor("path",{header:"Path",cell:d=>v.jsx("a",{className:"ai-main mono",href:d.row.original.url,target:"_blank",rel:"noopener noreferrer",title:d.getValue(),children:d.getValue()})}),s.accessor(d=>d.project_name||"",{id:"project",header:"Project",cell:d=>v.jsx("span",{className:"ai-tag",children:(d.getValue()||"")+(d.row.original.creator?" · by "+d.row.original.creator:"")+(d.row.original.created?" · "+new Date(d.row.original.created).toLocaleDateString():"")})}),s.display({id:"actions",header:"",cell:d=>v.jsx("button",{className:"ai-del","aria-label":`Revoke the share of ${d.row.original.path}`,onClick:async()=>{const h=d.row.original;if(await Cp("Revoke share link",`Revoke the public link to “${h.path}”? Anyone with the URL will lose access.`,"Revoke",!0))try{await zo("DELETE","/api/shares/"+h.token),Je("Share revoked."),n()}catch(m){Je(m.message,!0)}},children:"Revoke"})})],[s,n]),c=X1({data:e,columns:l,state:{sorting:r},onSortingChange:i,getCoreRowModel:Y1(),getSortedRowModel:Q1()});return e.length===0?v.jsx("div",{className:"admin-list",children:v.jsx("div",{className:"admin-empty",children:"No public shares."})}):v.jsx("div",{className:"admin-list admin-card-table",children:v.jsxs(L_,{className:"admin-table",children:[v.jsx(I_,{children:c.getHeaderGroups().map(d=>v.jsx(pc,{children:d.headers.map(h=>v.jsx(F_,{header:h},h.id))},d.id))}),v.jsx($_,{children:c.getRowModel().rows.map(d=>v.jsx(pc,{className:"admin-item",children:d.getVisibleCells().map(h=>v.jsx(V_,{children:ac(h.column.columnDef.cell,h.getContext())},h.id))},d.id))})]})})}const _6=Qc({require_verification:SS(),require_approval:SS()});function C6(){const e=tl(),{data:n,error:r}=jn({queryKey:["admin","policy"],queryFn:()=>Fn("/api/admin/policy")}),{data:i}=D1(!0),s=uc({resolver:mc(_6),values:n?{require_verification:n.require_verification&&n.mailer,require_approval:n.require_approval}:{require_verification:!1,require_approval:!1}});if(x.useEffect(()=>{r&&Je(r.message,!0)},[r]),!n)return null;const l=async(c,d,h)=>{try{await Oa(`/api/admin/pending/${c}/${d}`),Je((d==="approve"?"Approved ":"Denied ")+h),e.invalidateQueries({queryKey:["admin","pending"]})}catch(m){Je(m.message,!0)}};return v.jsxs("div",{className:"admin",children:[v.jsx("h1",{children:"Signup & access"}),v.jsx("p",{className:"admin-sub",children:"Who can create an account on this hub, and how new accounts are vetted."}),v.jsx("h3",{children:"New-account vetting"}),v.jsxs("form",{onSubmit:s.handleSubmit(async c=>{try{await Oa("/api/admin/policy",c),Je("Signup policy saved."),e.invalidateQueries({queryKey:["admin","policy"]})}catch(d){Je(d.message,!0)}}),children:[v.jsxs("div",{className:"admin-list",children:[v.jsx(RS,{label:"Require email verification",desc:n.mailer?"New accounts must click an emailed link before they can sign in — proves they control the address.":"Configure SMTP on the server (auth.smtp) to enable email verification.",disabled:!n.mailer,inputProps:s.register("require_verification")}),v.jsx(RS,{label:"Require admin approval",desc:"New accounts wait for a hub admin to approve them before they gain access.",inputProps:s.register("require_approval")})]}),v.jsx(Bt,{variant:"primary",type:"submit",style:{marginTop:14},disabled:!s.formState.isDirty,children:"Save policy"})]}),v.jsx("h3",{children:"Who can sign up"}),v.jsxs("div",{className:"admin-list",children:[v.jsxs("div",{className:"admin-item",children:[v.jsx("span",{className:"ai-main",children:"Allowed email domains"}),v.jsx("span",{className:"ai-tag",children:n.allowed_domains&&n.allowed_domains.length?n.allowed_domains.map(c=>"@"+c).join(", "):"any"})]}),v.jsxs("div",{className:"admin-item",children:[v.jsx("span",{className:"ai-main",children:"Self-signup"}),v.jsx("span",{className:"ai-tag",children:n.allow_signup?"open":"invite-only"})]}),v.jsxs("div",{className:"admin-item",children:[v.jsx("span",{className:"ai-main",children:"Hub admins"}),v.jsx("span",{className:"ai-tag",children:n.admins&&n.admins.length?n.admins.join(", "):"none"})]})]}),v.jsx("p",{className:"admin-sub",children:"Domains and admins are set in the server config file (they can't be widened from the browser)."}),v.jsx("h3",{children:"Pending signups"}),v.jsxs("div",{className:"admin-list",children:[(!i||i.length===0)&&v.jsx("div",{className:"admin-empty",children:"No one is waiting for approval."}),(i||[]).map(c=>v.jsxs("div",{className:"admin-item",children:[v.jsx("span",{className:"ai-main",children:(c.name?c.name+" · ":"")+c.email}),v.jsx(Bt,{variant:"primary",onClick:()=>l(c.id,"approve",c.email),children:"Approve"}),v.jsx("button",{className:"ai-del",onClick:()=>l(c.id,"deny",c.email),children:"Deny"})]},c.id))]})]})}function RS({label:e,desc:n,disabled:r,inputProps:i}){return v.jsxs("label",{className:"admin-item toggle",style:r?{opacity:.55}:void 0,children:[v.jsxs("span",{className:"ai-main",children:[v.jsx("div",{className:"tg-label",children:e}),v.jsx("div",{className:"tg-desc",children:n})]}),v.jsx("input",{type:"checkbox",disabled:r,...i})]})}function E6({...e}){return v.jsx(Tw,{"data-slot":"select",...e})}function R6({...e}){return v.jsx(jw,{"data-slot":"select-value",...e})}function T6({className:e,size:n="default",children:r,...i}){return v.jsxs(Aw,{"data-slot":"select-trigger","data-size":n,className:St("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...i,children:[r,v.jsx(zw,{asChild:!0,children:v.jsx(Sp,{className:"size-4 opacity-50"})})]})}function O6({className:e,children:n,position:r="item-aligned",align:i="center",...s}){return v.jsx(Nw,{children:v.jsxs(kw,{"data-slot":"select-content",className:St("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,align:i,...s,children:[v.jsx(M6,{}),v.jsx(Fw,{className:St("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),v.jsx(j6,{})]})})}function A6({className:e,children:n,...r}){return v.jsxs(Bw,{"data-slot":"select-item",className:St("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[v.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:v.jsx(Zw,{children:v.jsx(O1,{className:"size-4"})})}),v.jsx(qw,{children:n})]})}function M6({className:e,...n}){return v.jsx(Kw,{"data-slot":"select-scroll-up-button",className:St("flex cursor-default items-center justify-center py-1",e),...n,children:v.jsx(Iz,{className:"size-4"})})}function j6({className:e,...n}){return v.jsx(Yw,{"data-slot":"select-scroll-down-button",className:St("flex cursor-default items-center justify-center py-1",e),...n,children:v.jsx(Sp,{className:"size-4"})})}const TS=["#5b8def","#f5a623","#4cc38a","#e0679b","#8b7bf0","#3ec8c8","#e6934a"];function P_(e){let n=0;for(const r of e)n=n*31+r.charCodeAt(0)>>>0;return TS[n%TS.length]}function OS({projects:e,currentId:n,menu:r}){const i=N1(),s=async()=>{const l=await _p("New project","Project name","","Create");if(l!==null)try{const c=await Oa("/api/projects",{name:l});await i(),fn("/"+c.project.id),Je(`Created “${c.project.name}”.`)}catch(c){Je("Could not create the project: "+c.message,!0)}};return v.jsxs("nav",{id:"projects","aria-label":"Projects",children:[v.jsxs("div",{className:"nav-head",children:[v.jsx("span",{children:"Projects"}),v.jsx("button",{className:"nav-add",title:"New project","aria-label":"New project",onClick:s,children:"+"})]}),v.jsx("div",{className:"proj-row",children:v.jsxs(E6,{value:n||"",onValueChange:l=>{l&&l!==n&&(fn("/"+l),fr())},children:[v.jsxs(T6,{id:"project-select","aria-label":`Switch project — current: ${e.find(l=>l.id===n)?.name??"none"}`,title:e.find(l=>l.id===n)?.name,className:"proj-trigger",children:[n&&v.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:P_(e.find(l=>l.id===n)?.name||"")}}),v.jsx(R6,{placeholder:"Select a project"})]}),v.jsx(O6,{className:"proj-menu",position:"popper",sideOffset:4,children:e.map(l=>v.jsx(A6,{value:l.id,children:l.name},l.id))})]})}),r&&v.jsx("ul",{className:"nav-menu","aria-label":"Project pages",children:[["dashboard","Dashboard","dashboard",r.onDashboard],["install","Installation","terminal",r.onInstall],["history","History","hist",r.onHistory],["settings","Settings","gear",r.onSettings]].map(([l,c,d,h])=>v.jsx("li",{children:v.jsxs("div",{id:"nav-"+l,className:"row"+(r.active===l?" active":""),role:"button",tabIndex:0,onClick:h,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),h())},children:[v.jsx(Yt,{name:d}),v.jsx("span",{className:"label",children:c})]})},l))})]})}function z6({...e}){return v.jsx(j2,{"data-slot":"dropdown-menu",...e})}function D6({...e}){return v.jsx(z2,{"data-slot":"dropdown-menu-trigger",...e})}function N6({className:e,sideOffset:n=4,...r}){return v.jsx(D2,{children:v.jsx(N2,{"data-slot":"dropdown-menu-content",sideOffset:n,className:St("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...r})})}function Vh({className:e,inset:n,variant:r="default",...i}){return v.jsx(L2,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":r,className:St("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",e),...i})}function Fh({className:e,inset:n,...r}){return v.jsx(k2,{"data-slot":"dropdown-menu-label","data-inset":n,className:St("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}function k6({me:e,org:n,admin:r,orgActive:i}){const s=e.name||e.email,[l,c]=x.useState(!1),d=n?$1(n.manage_url):null;return v.jsx("footer",{id:"accountbar",children:v.jsxs(z6,{modal:!1,open:l,onOpenChange:c,children:[v.jsx(D6,{asChild:!0,children:v.jsxs("button",{id:"account-btn",className:i?"active":void 0,"aria-label":"Account menu",children:[v.jsx("span",{className:"avatar",style:{background:P_(e.email)},"aria-hidden":"true",children:(s.trim()[0]||"?").toUpperCase()}),v.jsxs("span",{className:"acct",children:[v.jsx("b",{children:s}),e.name&&v.jsx("small",{children:e.email})]}),v.jsx(Yt,{name:"chev"})]})}),v.jsxs(N6,{id:"account-menu",side:"top",align:"start",sideOffset:6,className:"acct-menu",children:[n&&v.jsxs(v.Fragment,{children:[v.jsx(Fh,{className:"menu-sec",children:"Organization"}),v.jsx(Vh,{asChild:!0,children:v.jsxs("a",{id:"menu-org-settings","aria-current":i?"page":void 0,...d,onClick:h=>{d?.onClick?.(h),c(!1)},children:[v.jsx(Yt,{name:"gear"}),v.jsxs("span",{children:[v.jsx("b",{children:n.name})," Settings"]}),!n.manage_url.startsWith("/")&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"ext","aria-hidden":"true",children:"↗"}),v.jsx("span",{className:"sr-only",children:" (opens in a new tab)"})]})]})})]}),r&&v.jsxs(v.Fragment,{children:[v.jsx(Fh,{className:"menu-sec",children:"Hub"}),v.jsxs(Vh,{id:"menu-hub-admin",onSelect:r.onClick,children:[v.jsx(Yt,{name:"shield"}),v.jsxs("span",{children:["Signup & access",r.pending?` · ${r.pending}`:""]})]})]}),v.jsx(Fh,{className:"menu-sec",children:"Account"}),v.jsx(Vh,{asChild:!0,children:v.jsxs("a",{id:"signout",href:"/auth/logout",children:[v.jsx(Yt,{name:"power"}),v.jsx("span",{children:"Log out"})]})})]})]})})}function L6({project:e,org:n,onDeleted:r}){return v.jsxs("div",{className:"project-settings",children:[v.jsx("h2",{children:e.name}),v.jsxs("dl",{className:"ps-facts",children:[v.jsx("dt",{children:"Project id"}),v.jsx("dd",{children:v.jsx("code",{children:e.id})}),n&&v.jsxs(v.Fragment,{children:[v.jsx("dt",{children:"Workspace"}),v.jsx("dd",{children:n.name})]}),e.created&&v.jsxs(v.Fragment,{children:[v.jsx("dt",{children:"Created"}),v.jsx("dd",{children:new Date(e.created).toLocaleDateString()})]})]}),n?.role==="owner"&&v.jsxs("section",{className:"ps-danger",children:[v.jsx("h3",{children:"Danger zone"}),v.jsx("p",{children:"Deleting removes the project from this hub. Its files stay in storage. This can't be undone."}),v.jsx(Bt,{variant:"danger",onClick:async()=>{if(await _p(`Delete “${e.name}”?`,"This can't be undone. Type the project name to confirm:","","Delete project",{match:e.name,danger:!0})!==null)try{await zo("DELETE","/api/projects/"+e.id),Je(`Deleted “${e.name}”.`),await r()}catch(s){Je(s.message,!0)}},children:"Delete project"})]})]})}const Ph=[{key:"claude",label:"Claude Code & Cowork"},{key:"hermes",label:"Hermes",agent:"hermes",skillDir:"~/.hermes/skills/beardrive/"},{key:"codex",label:"Codex",agent:"codex",skillDir:"~/.codex/skills/beardrive/",extra:"Codex asks once to trust the project's .codex hooks layer — answer yes (or run /hooks) and from then on every turn pulls, edits push automatically, and reads are reported to Insights."}];function I6(e,n){const r=window.location.origin,i=n.id;return e.key==="claude"?[{title:"Add the BearDrive plugin",desc:"One time, in any Claude Code session. The plugin ships the beardrive skill, the /beardrive commands, and turn-boundary sync hooks — and Claude Cowork shares the same plugins, so installing it once covers both.",code:`/plugin marketplace add runbear-io/beardrive
-/plugin install beardrive@beardrive`},{title:"Set up this project conversationally",desc:"In a Claude Code or Cowork session in the folder where you want the files, run:",code:"/beardrive:install connect to "+r+", project "+i,extra:"Claude installs the CLI, signs this machine in, mounts the project, and registers the sync hooks — pull the latest before every turn, push after edits (stamped with the session that made them), and report file reads to Insights. It asks before anything it changes."}]:[{title:"Paste this into "+e.label,desc:"Start "+e.label+" in the folder where you want the files (an existing folder works too — contents merge), then paste:",code:$6(e,n),extra:"Approve the shell commands when it asks. It installs the CLI, signs this machine in (it hands you a code and a URL — the folder itself never holds credentials), mounts the project, and registers the sync hooks: pull before every turn, push after edits stamped with the session that made them, file reads into Insights. It also keeps the beardrive skill in "+e.skillDir+", so from here on you can just ask."+(e.extra?" "+e.extra:"")}]}function $6(e,n){return["Set up BearDrive in this folder.","1. If `bdrive` is missing, install it: brew install runbear-io/tap/beardrive"," (no Homebrew? grab the release binary for this OS/arch from"," https://github.com/runbear-io/beardrive/releases)","2. bdrive skill install --agent "+e.agent+" # so you know the CLI next time","3. bdrive login --device "+window.location.origin+" # show me the code and the URL","4. bdrive init --project "+n.id,"5. bdrive hooks install # don't skip this - it's what syncs every turn","Then tell me what got set up."].join(`
-`)}function V6(e,n){return`brew install runbear-io/tap/beardrive
-bdrive skill install --agent `+e.agent+`
-bdrive login `+window.location.origin+`
-bdrive init --project `+n.id+`
-bdrive hooks install --agent `+e.agent}function F6(){try{return localStorage.getItem("bdrive-guide-agent")||"claude"}catch{return"claude"}}function U_({project:e}){const[n,r]=x.useState(F6),i=Ph.find(l=>l.key===n)||Ph[0],s=I6(i,e);return v.jsxs("div",{className:"guide",children:[v.jsx("h1",{className:"in-title",children:e.name}),v.jsx("p",{className:"dl-sub",children:"Mount this project as a folder on any machine and connect your coding agent: files sync both ways in the background, every change is journaled with who made it, and agent reads feed Insights."}),v.jsx("div",{className:"gd-tabs",children:Ph.map(l=>v.jsx("button",{className:"gd-tab"+(l.key===i.key?" active":""),"data-key":l.key,onClick:()=>{r(l.key);try{localStorage.setItem("bdrive-guide-agent",l.key)}catch{}},children:l.label},l.key))}),v.jsxs("div",{className:"gd-body",children:[s.map((l,c)=>v.jsxs("div",{className:"gd-step"+(s.length>1?"":" gd-solo"),children:[v.jsxs("div",{className:"gd-step-head",children:[s.length>1&&v.jsx("span",{className:"gd-num",children:c+1}),v.jsx("span",{className:"gd-step-title",children:l.title})]}),l.desc&&v.jsx("p",{className:"gd-desc",children:l.desc}),l.code&&v.jsx(AS,{code:l.code}),l.extra&&v.jsx("p",{className:"gd-desc gd-extra",children:l.extra})]},c)),i.agent&&v.jsxs("details",{className:"gd-manual",children:[v.jsx("summary",{children:"Or run it yourself"}),v.jsx("p",{className:"gd-desc",children:"Same result, in the folder you want the files. Don't skip the last line — the hooks are what keep every turn starting from the latest state."}),v.jsx(AS,{code:V6(i,e)})]}),v.jsx("p",{className:"gd-done",children:"That's it — the folder now syncs on its own. Every agent turn starts from the latest state, edits appear here (and on every teammate's mount) within seconds, and what your agents read shows up in Insights."})]})]})}function AS({code:e}){const[n,r]=x.useState("Copy");return v.jsxs("pre",{className:"gd-code",children:[v.jsx("code",{children:e}),v.jsx("button",{className:"gd-copy",onClick:async()=>{r(await Js(e)?"Copied":"Copy failed"),setTimeout(()=>r("Copy"),1400)},children:n})]})}const P6=Qc({invite:Up().trim().refine(e=>/join\/([0-9a-f]+)/.test(e)||/^[0-9a-f]{8,}$/.test(e),{message:"That doesn't look like an invite link."})}),U6=Qc({name:Up().trim().min(1,"Give the project a name.").max(60,"Keep it under 60 characters.")});function H6({authEnabled:e,onCreate:n}){const r=uc({resolver:mc(P6),defaultValues:{invite:""}}),i=uc({resolver:mc(U6),defaultValues:{name:""}});return v.jsxs("div",{className:"onboard",children:[v.jsx("h1",{children:"Welcome to BearDrive"}),v.jsx("p",{children:"You're signed in, but you're not part of any project yet."}),e&&v.jsxs("div",{className:"ob-card",children:[v.jsx("h3",{children:"Have an invite link?"}),v.jsx("p",{children:"A teammate can send you a join link. Paste it here:"}),v.jsxs("form",{className:"ob-row",onSubmit:r.handleSubmit(({invite:s})=>{const l=s.match(/join\/([0-9a-f]+)/)||s.match(/^([0-9a-f]{8,})$/);location.href="/join/"+l[1]}),children:[v.jsx("input",{id:"ob-invite",type:"text",placeholder:"https://…/join/…",autoComplete:"off",...r.register("invite")}),v.jsx(Bt,{id:"ob-join",variant:"primary",type:"submit",children:"Join"})]}),r.formState.errors.invite&&v.jsx("p",{className:"field-err",children:r.formState.errors.invite.message})]}),v.jsxs("div",{className:"ob-card",children:[v.jsx("h3",{children:"Or start a new project"}),v.jsx("p",{children:"Create a shared space for your team's files."}),v.jsxs("form",{className:"ob-row",onSubmit:i.handleSubmit(({name:s})=>n(s)),children:[v.jsx("input",{id:"ob-name",type:"text",placeholder:"Project name, e.g. wiki",autoComplete:"off",...i.register("name")}),v.jsx(Bt,{id:"ob-create",variant:"primary",type:"submit",children:"Create"})]}),i.formState.errors.name&&v.jsx("p",{className:"field-err",children:i.formState.errors.name.message})]})]})}function B6(e,n=!0){const r=jn({queryKey:["tree",e],queryFn:()=>Fn(e+"tree"),enabled:n,refetchInterval:15e3}),i=x.useMemo(()=>{const s=[],l=new Map,c=d=>{for(const h of d.children||[])h.dir?(l.set(h.path,h),c(h)):s.push(h)};return r.data&&c(r.data),{flatFiles:s,dirIndex:l}},[r.data]);return{tree:r.data,...i,loaded:!!r.data}}function q6(e,n){return jn({queryKey:["heat",e],queryFn:()=>Fn(e+"heat?days=30"),enabled:n,staleTime:6e4,refetchInterval:6e4}).data?.entries??null}function G6(e,n,r){return jn({queryKey:["history",e,"prefix",n,20],queryFn:()=>Fn(e+"history?prefix="+encodeURIComponent(n)+"&n=20"),enabled:r,staleTime:15e3}).data?.entries??null}function MS(e,n,r){if(!e)return null;if(!r)return e[n]||null;const i={human:0,agent:0,share:0};for(const[s,l]of Object.entries(e))s.startsWith(n+"/")&&(i.human+=l.human||0,i.agent+=l.agent||0,i.share+=l.share||0);return i.human||i.agent||i.share?i:null}function Ws(e){return(e.human||0)+(e.agent||0)+(e.share||0)}function Ku(e){const n=Ws(e);if(!n)return"";let r=n+(n===1?" read":" reads");return e.agent&&(r+=" ("+e.agent+" agent)"),r}function Z6(e){const n=Ws(e);return n?n<3?1:n<10?2:n<30?3:4:0}function K6(e,n,r){const i=new Array(e);return new Proxy(i,{get(s,l,c){if(typeof l=="string"){const d=l.charCodeAt(0);if(d>=48&&d<=57){const h=+l;if(Number.isInteger(h)&&h>=0&&hi[y]!==m))&&(i=d,s=n(...d),r?.onChange&&!(l&&r.skipInitialOnChange)&&r.onChange(s),l=!1),s}return c.updateDeps=d=>{i=d},c}function jS(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const Y6=(e,n)=>Math.abs(e-n)<1.01,Q6=(e,n,r)=>{let i;return function(...s){e.clearTimeout(i),i=e.setTimeout(()=>n.apply(this,s),r)}};let zs;const Uh=()=>{if(zs!==void 0)return zs;if(typeof navigator>"u")return zs=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return zs=!0;const e=navigator.maxTouchPoints;return zs=navigator.platform==="MacIntel"&&e!==void 0&&e>0},zS=e=>{const{offsetWidth:n,offsetHeight:r}=e;return{width:n,height:r}},X6=e=>e,J6=e=>{const n=Math.max(e.startIndex-e.overscan,0),i=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,s=new Array(i);for(let l=0;l{const r=e.scrollElement;if(!r)return;const i=e.targetWindow;if(!i)return;const s=c=>{const{width:d,height:h}=c;n({width:Math.round(d),height:Math.round(h)})};if(s(zS(r)),!i.ResizeObserver)return()=>{};const l=new i.ResizeObserver(c=>{const d=()=>{const h=c[0];if(h?.borderBoxSize){const m=h.borderBoxSize[0];if(m){s({width:m.inlineSize,height:m.blockSize});return}}s(zS(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return l.observe(r,{box:"border-box"}),()=>{l.unobserve(r)}},gc={passive:!0},eI=typeof window>"u"?!0:"onscrollend"in window,tI=(e,n,r)=>{const i=e.scrollElement;if(!i)return;const s=e.targetWindow;if(!s)return;const l=e.options.useScrollendEvent&&eI;let c=0;const d=l?null:Q6(s,()=>n(c,!1),e.options.isScrollingResetDelay),h=g=>()=>{c=r(i),d?.(),n(c,g)},m=h(!0),y=h(!1);return i.addEventListener("scroll",m,gc),l&&i.addEventListener("scrollend",y,gc),()=>{i.removeEventListener("scroll",m),l&&i.removeEventListener("scrollend",y)}},nI=(e,n)=>tI(e,n,r=>{const{horizontal:i,isRtl:s}=e.options;return i?r.scrollLeft*(s&&-1||1):r.scrollTop}),rI=(e,n,r)=>{if(r.options.useCachedMeasurements){const i=r.indexFromElement(e),s=r.options.getItemKey(i);return r.itemSizeCache.get(s)??r.options.estimateSize(i)}if(n?.borderBoxSize){const i=n.borderBoxSize[0];if(i)return Math.round(i[r.options.horizontal?"inlineSize":"blockSize"])}if(!n){const i=r.indexFromElement(e),s=r.options.getItemKey(i),l=r.itemSizeCache.get(s);if(l!==void 0)return l}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},oI=(e,{adjustments:n=0,behavior:r},i)=>{var s,l;(l=(s=i.scrollElement)==null?void 0:s.scrollTo)==null||l.call(s,{[i.options.horizontal?"left":"top"]:e+n,behavior:r})},iI=oI;class aI{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var r,i,s;return((s=(i=(r=this.targetWindow)==null?void 0:r.performance)==null?void 0:i.now)==null?void 0:s.call(i))??Date.now()},this.observer=(()=>{let r=null;const i=()=>r||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:r=new this.targetWindow.ResizeObserver(s=>{s.forEach(l=>{const c=()=>{const d=l.target,h=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[m,y]of this.elementsCache)if(y===d){this.elementsCache.delete(m);break}return}this.shouldMeasureDuringScroll(h)&&this.resizeItem(h,this.options.measureElement(d,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()})}));return{disconnect:()=>{var s;(s=i())==null||s.disconnect(),r=null},observe:s=>{var l;return(l=i())==null?void 0:l.observe(s,{box:"border-box"})},unobserve:s=>{var l;return(l=i())==null?void 0:l.unobserve(s)}}})(),this.range=null,this.setOptions=r=>{var i,s;const l={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:X6,rangeExtractor:J6,onChange:()=>{},measureElement:rI,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const b in r){const S=r[b];S!==void 0&&(l[b]=S)}const c=this.options;let d=null,h=null,m=!1;if(c!==void 0&&c.enabled&&l.enabled&&l.anchorTo==="end"&&this.scrollElement!==null){const b=c.count,S=l.count,_=this.getMeasurements(),C=b>0?((i=_[0])==null?void 0:i.key)??c.getItemKey(0):null,E=b>0?((s=_[b-1])==null?void 0:s.key)??c.getItemKey(b-1):null;if(S!==b||b>0&&S>0&&(l.getItemKey(0)!==C||l.getItemKey(S-1)!==E)){m=!0;const A=b>0?this.getVirtualItemForOffset(this.getScrollOffset())??_[0]:null;A&&(d=[A.key,this.getScrollOffset()-A.start]);const k=l.followOnAppend===!0?"auto":l.followOnAppend||null;k&&S>b&&this.isAtEnd(c.scrollEndThreshold)&&(b===0||l.getItemKey(S-1)!==E)&&(h=k)}}this.options=l,m&&(this.pendingMin=0,this.itemSizeCacheVersion++);let y=!1,g=0;if(d&&this.scrollOffset!==null){const[b,S]=d,_=this.getMeasurements(),{count:C,getItemKey:E}=this.options;let T=0;for(;T{var i,s;(s=(i=this.options).onChange)==null||s.call(i,this,r)},this.maybeNotify=ba(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),r=>{this.notify(r)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(r=>r()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var r;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}if(this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((r=this.scrollElement)==null?void 0:r.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,c)=>{if(c&&this._intendedScrollOffset===null&&l===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(l-this._intendedScrollOffset)<1.5&&(l=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=c?d===l?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!Uh()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};l.addEventListener("touchstart",c,gc),l.addEventListener("touchend",d,gc),this.unsubs.push(()=>{l.removeEventListener("touchstart",c),l.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[l,c,d,h]=s;l!==null&&!d&&(Uh()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?h!==0&&(this._iosDeferredAdjustment+=h):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const r=this.getScrollOffset(),i=this.getMaxScrollOffset();if(r<0||r>i)return;const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(r,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=ba(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(r,i,s,l,c,d,h,m)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:r,paddingStart:i,scrollMargin:s,getItemKey:l,enabled:c,lanes:d,laneAssignmentMode:h,gap:m}),{key:!1}),this.getMeasurements=ba(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:r,paddingStart:i,scrollMargin:s,getItemKey:l,enabled:c,lanes:d,laneAssignmentMode:h,gap:m},y)=>{const g=this.itemSizeCache;if(!c)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>r)for(const T of this.laneAssignments.keys())T>=r&&this.laneAssignments.delete(T);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(T=>{this.itemSizeCache.set(T.key,T.size)}));const b=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===r&&(this.lanesSettling=!1),d===1){const T=r*2;let O=this._flatMeasurements;if(!O||O.length0&&L.set(O.subarray(0,b*2)),O=L,this._flatMeasurements=O}let A;if(b===0)A=i+s;else{const L=b-1;A=O[L*2]+O[L*2+1]+m}for(let L=b;L1){k=A;const ve=_[k],de=ve!==void 0?S[ve]:void 0;L=de?de.end+m:i+s}else if(E===d){let ve=0,de=C[0],le=_[0];for(let ae=1;aethis.options.debug}),this.calculateRange=ba(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(r,i,s,l)=>r.length===0||i===0?(this.range=null,null):(this.range=lI(r,i,s,l,l===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ba(()=>{let r=null,i=null;const s=this.calculateRange();return s&&(r=s.startIndex,i=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,r,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,r,i]},(r,i,s,l,c)=>l===null||c===null?[]:r({startIndex:l,endIndex:c,overscan:i,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=r=>{const i=this.options.indexAttribute,s=r.getAttribute(i);return s?parseInt(s,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=r=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(s!==void 0&&this.range){const l=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),c=Math.max(0,s-l),d=Math.min(this.options.count-1,s+l);return r>=c&&r<=d}return!0},this.measureElement=r=>{if(!r){this.elementsCache.forEach((c,d)=>{c.isConnected||(this.observer.unobserve(c),this.elementsCache.delete(d))});return}const i=this.indexFromElement(r),s=this.options.getItemKey(i),l=this.elementsCache.get(s);l!==r&&(l&&this.observer.unobserve(l),this.observer.observe(r),this.elementsCache.set(s,r)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(r,void 0,this))},this.resizeItem=(r,i)=>{var s,l;if(r<0||r>=this.options.count)return;let c,d,h;const m=this._flatMeasurements;if(this.options.lanes===1&&m!==null)h=this.options.getItemKey(r),d=m[r*2],c=m[r*2+1];else{const b=this.measurementsCache[r];if(!b)return;h=b.key,d=b.start,c=b.size}const y=this.itemSizeCache.get(h)??c,g=i-y;if(g!==0){const b=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,S=b?this.getTotalSize():0,_=((l=this.scrollState)==null?void 0:l.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[r]??{index:r,key:h,start:d,size:c,end:d+c,lane:0},g,this):d[this.getVirtualIndexes(),this.getMeasurements()],(r,i)=>{const s=[];for(let l=0,c=r.length;lthis.options.debug}),this.getVirtualItemForOffset=r=>{const i=this.getMeasurements();if(i.length===0)return;const s=this._flatMeasurements,l=this.options.lanes===1&&s!=null,c=H_(0,i.length-1,l?d=>s[d*2]:d=>jS(i[d]).start,r);return jS(i[c])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const r=this.scrollElement.document.documentElement;return this.options.horizontal?r.scrollWidth-this.scrollElement.innerWidth:r.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(r=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=r,this.getOffsetForAlignment=(r,i,s=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),c=this.getScrollOffset();i==="auto"&&(i=r>=c+l?"end":"start"),i==="center"?r+=(s-l)/2:i==="end"&&(r-=l);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,r),0)},this.getOffsetForIndex=(r,i="auto")=>{r=Math.max(0,Math.min(r,this.options.count-1));const s=this.getSize(),l=this.getScrollOffset(),c=this.measurementsCache[r];if(!c)return;if(i==="auto")if(c.end>=l+s-this.options.scrollPaddingEnd)i="end";else if(c.start<=l+this.options.scrollPaddingStart)i="start";else return[l,i];if(i==="end"&&r===this.options.count-1)return[this.getMaxScrollOffset(),i];const d=i==="end"?c.end+this.options.scrollPaddingEnd:c.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,i,c.size),i]},this.scrollToOffset=(r,{align:i="start",behavior:s="auto"}={})=>{const l=this.getOffsetForAlignment(r,i),c=this.now();this.scrollState={index:null,align:i,behavior:s,startedAt:c,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(r,{align:i="auto",behavior:s="auto"}={})=>{r=Math.max(0,Math.min(r,this.options.count-1));const l=this.getOffsetForIndex(r,i);if(!l)return;const[c,d]=l,h=this.now();this.scrollState={index:r,align:d,behavior:s,startedAt:h,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(r,{behavior:i="auto"}={})=>{const s=this.getScrollOffset()+r,l=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:l,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:r="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:r});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:r})},this.getTotalSize=()=>{var r;const i=this.getMeasurements();let s;if(i.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const l=i.length-1,c=this._flatMeasurements;c!=null?s=c[l*2]+c[l*2+1]:s=((r=i[l])==null?void 0:r.end)??0}else{const l=Array(this.options.lanes).fill(null);let c=i.length-1;for(;c>=0&&l.some(d=>d===null);){const d=i[c];l[d.lane]===null&&(l[d.lane]=d.end),c--}s=Math.max(...l.filter(d=>d!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const r=[];if(this.itemSizeCache.size===0)return r;const i=this.getMeasurements();for(const s of i)s&&this.itemSizeCache.has(s.key)&&r.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return r},this._scrollToOffset=(r,{adjustments:i,behavior:s})=>{this._intendedScrollOffset=r+(i??0),this.options.scrollToFn(r,{behavior:s,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,r){n!==0&&(Uh()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=n:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:r}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=i?i[0]:this.scrollState.lastTargetOffset,l=1,c=s!==this.scrollState.lastTargetOffset;if(!c&&Y6(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,c){const d=this.getSize()||600,h=Math.abs(s-this.getScrollOffset()),m=this.scrollState.behavior==="smooth"&&h>d;this.scrollState.lastTargetOffset=s,m||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:m?"smooth":"auto"})}this.scheduleScrollReconcile()}}const H_=(e,n,r,i)=>{for(;e<=n;){const s=(e+n)/2|0,l=r(s);if(li)n=s-1;else return s}return e>0?e-1:0};function sI(e,n,r){let i=0;for(;i<=n;){const s=(i+n)/2|0,l=e[s*2];if(lr)n=s-1;else return s}return i>0?i-1:0}function lI(e,n,r,i,s){const l=e.length-1;if(e.length<=i)return{startIndex:0,endIndex:l};if(i===1&&s!==null){const m=sI(s,l,r);let y=m;const g=r+n;for(;ye[m].start,r),h=d;if(i===1)for(;h1){const m=Array(i).fill(0);for(;hg=0&&y.some(g=>g>=r);){const g=e[d];y[g.lane]=g.start,d--}d=Math.max(0,d-d%i),h=Math.min(l,h+(i-1-h%i))}return{startIndex:d,endIndex:h}}const Hh=typeof document<"u"?x.useLayoutEffect:x.useEffect;function uI({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:r="transform",...i}){const s=x.useReducer(m=>m+1,0)[1],l=x.useRef({enabled:n,mode:r,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});l.current.enabled=n,l.current.mode=r;const c=m=>{const y=l.current;if(!y.enabled||!y.container)return;const g=m.getTotalSize();if(g!==y.lastSize){y.lastSize=g;const T=m.options.horizontal?"width":"height";y.container.style[T]=`${g}px`}const b=!!m.options.horizontal,S=y.mode==="transform",_=b?"left":"top",C=m.options.scrollMargin,E=m.getVirtualItems();for(const T of E){const O=T.start-C,A=m.elementsCache.get(T.key);A&&y.lastPositions.get(A)!==O&&(y.lastPositions.set(A,O),S?A.style.transform=b?`translate3d(${O}px, 0, 0)`:`translate3d(0, ${O}px, 0)`:A.style[_]=`${O}px`)}},d={...i,onChange:(m,y)=>{var g;const b=l.current;let S=!0;if(b.enabled){c(m);const _=m.range,C=b.prevRange;S=!C||C.isScrolling!==m.isScrolling||C.startIndex!==_?.startIndex||C.endIndex!==_?.endIndex,S&&(b.prevRange=_?{startIndex:_.startIndex,endIndex:_.endIndex,isScrolling:m.isScrolling}:null)}S&&(e&&y?Si.flushSync(s):s()),(g=i.onChange)==null||g.call(i,m,y)}},[h]=x.useState(()=>{const m=new aI(d);return Object.assign(m,{containerRef:y=>{const g=l.current;if(g.container=y,g.lastSize=null,y&&g.enabled){const b=m.getTotalSize();g.lastSize=b;const S=m.options.horizontal?"width":"height";y.style[S]=`${b}px`}}})});return h.setOptions(d),Hh(()=>h._didMount(),[]),Hh(()=>h._willUpdate()),Hh(()=>{c(h)}),h}function cI(e){return uI({observeElementRect:W6,observeElementOffset:nI,scrollToFn:iI,...e})}function dI(e,n){const r=[],i=(s,l)=>{for(const c of s)r.push({node:c,depth:l}),c.dir&&n.has(c.path)&&i(c.children||[],l+1)};return i(e?.children||[],0),r}function fI(e){const{root:n,expanded:r,onToggle:i,currentPath:s,listingShowing:l,onOpen:c}=e,d=x.useRef(null),h=x.useMemo(()=>dI(n,r),[n,r]),m=cI({count:h.length,getScrollElement:()=>d.current,estimateSize:()=>window.matchMedia("(max-width: 768px)").matches?44:28,overscan:12,getItemKey:y=>h[y].node.path});return x.useEffect(()=>{if(!s)return;const y=h.findIndex(g=>g.node.path===s);y>=0&&m.scrollToIndex(y,{align:"auto"})},[s,h]),v.jsx("nav",{id:"tree","aria-label":"Files",ref:d,children:v.jsx("div",{style:{height:m.getTotalSize(),position:"relative"},children:m.getVirtualItems().map(y=>{const{node:g,depth:b}=h[y.index],S=g.dir?r.has(g.path):!1,_=()=>{if(g.dir&&s===g.path&&l){i(g.path);return}c(g.path),g.dir||fr()};return v.jsxs("div",{className:"row "+(g.dir?"dir":"file")+(s===g.path?" active":"")+(g.dir&&!S?" collapsed":""),"data-path":g.path,tabIndex:0,role:"button",title:g.name,"aria-expanded":g.dir?S:void 0,style:{position:"absolute",top:0,left:0,right:0,transform:`translateY(${y.start}px)`,paddingLeft:8+b*13},onClick:_,onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),_())},children:[Array.from({length:b},(C,E)=>v.jsx("span",{className:"tguide",style:{left:8+E*13+5},"aria-hidden":"true"},E)),v.jsx("span",{className:"chev",onClick:C=>{g.dir&&(C.stopPropagation(),i(g.path))},children:v.jsx(Yt,{name:"chevd"})}),v.jsx("span",{className:"ticon",children:v.jsx(Yt,{name:g.dir?"folder":"doc"})}),v.jsx("span",{className:"label",children:g.name})]},y.key)})})})}function hI(e){const n=e.split("/"),r=[];let i="";for(let s=0;s{i=i?i+"/"+s:s;const c=i,d=l===r.length-1;return v.jsxs("span",{children:[l>0&&v.jsx("span",{className:"crumb-sep",children:"/"}),d?v.jsx("span",{children:s}):v.jsx("span",{className:"crumb-seg",title:c,onClick:()=>n(c),children:s})]},c)})})}const pI={add:"plus",edit:"edit",delete:"x"},gI={add:"added",edit:"edited",delete:"deleted"};function B_({entry:e,onOpen:n}){const[r,i]=x.useState(!1),s=e.kind==="put"?"edit":e.kind,l=e.user_name?`${e.user_name} <${e.user}>`:e.user||e.author||"unknown",c=[e.device.name||e.device.id,e.device.os,e.device.ip].filter(Boolean).join(" · "),d=s!=="delete",h=m=>{m.target.tagName!=="A"&&d&&n(e.path)};return v.jsxs("div",{className:"hentry "+s+(d?" clickable":""),tabIndex:d?0:void 0,role:d?"button":void 0,onClick:h,onKeyDown:m=>{d&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n(e.path))},children:[v.jsxs("div",{className:"hline",children:[v.jsx("span",{className:"hkind",children:v.jsx(Yt,{name:pI[s]||"dot"})}),v.jsx("span",{className:"hpath",children:e.path}),v.jsx("span",{className:"htag",children:gI[s]||s}),v.jsx("span",{className:"htime",children:new Date(e.time).toLocaleString()})]}),v.jsxs("div",{className:"hmeta",children:[v.jsx("span",{className:"hwho",children:l}),v.jsx("span",{className:"hdev",children:c}),v.jsx("span",{className:"hsize",children:e.size?N_(e.size):""})]}),e.note&&v.jsx("div",{className:"hnote"+(r?" open":""),tabIndex:0,role:"button",title:r?"Collapse note":"Show full note","aria-expanded":r,onClick:m=>{m.stopPropagation(),m.target.tagName!=="A"&&i(!r)},onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),m.stopPropagation(),i(!r))},children:e.note.split(/(https?:\/\/\S+)/).map((m,y)=>/^https?:\/\//.test(m)?v.jsx("a",{href:m,target:"_blank",rel:"noopener",children:m},y):m)})]})}function vI(e){const{node:n,heatMap:r,onOpen:i}=e,s=(n.children||[]).slice().sort((m,y)=>Number(y.dir||!1)-Number(m.dir||!1)||m.name.localeCompare(y.name)),l=s.filter(m=>m.dir).length,c=s.length-l,d=[];l&&d.push(l+(l===1?" folder":" folders")),c&&d.push(c+(c===1?" file":" files"));const h=MS(r,n.path,!0);return h&&d.push(Ku(h)+" in 30 days"),v.jsxs("div",{className:"dirlist",children:[v.jsxs("h1",{className:"dl-title",children:[v.jsx("span",{className:"dl-title-icon",children:v.jsx(Yt,{name:"folder"})}),v.jsx("span",{children:n.name})]}),v.jsx("p",{className:"dl-sub",children:d.join(" · ")||"Empty folder"}),s.length===0?v.jsx("div",{className:"dl-empty",children:"Nothing in this folder yet."}):v.jsx("div",{className:"dl-items",children:s.map(m=>{let y="";if(m.dir){const b=(m.children||[]).length;y=b+(b===1?" item":" items")}else y=[m.size?N_(m.size):"",m.time?new Date(m.time).toLocaleDateString():""].filter(Boolean).join(" · ");const g=MS(r,m.path,!!m.dir);return g&&(y=Ku(g)+(y?" · "+y:"")),v.jsxs("div",{className:"dl-row",tabIndex:0,role:"button",title:m.path,onClick:()=>i(m.path),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),i(m.path))},children:[v.jsx("span",{className:"ticon",children:v.jsx(Yt,{name:m.dir?"folder":"doc"})}),v.jsx("span",{className:"dl-name",children:m.name}),g&&v.jsx("span",{className:"heatdot lvl"+Z6(g),title:Ku(g)+" in 30 days"}),v.jsx("span",{className:"dl-meta",children:y})]},m.path)})}),e.hub&&v.jsx(yI,{apiBase:e.apiBase,prefix:n.path+"/",onOpen:i,onFullHistory:()=>e.onFullHistory(n.path+"/"),onRendered:e.onRendered})]})}function yI(e){const n=G6(e.apiBase,e.prefix,!0),{onRendered:r}=e;return x.useEffect(()=>{n&&n.length&&r&&r()},[n,r]),!n||n.length===0?null:v.jsxs("div",{className:"dl-history",children:[v.jsx("h3",{className:"dl-h3",children:"Recent changes"}),v.jsx("div",{className:"history dl-hlist",children:n.map((i,s)=>v.jsx(B_,{entry:i,onOpen:e.onOpen},s))}),v.jsx("button",{className:"ai-btn dl-more",onClick:e.onFullHistory,children:"Full history"})]})}function bI(e){const{apiBase:n,path:r,onMeta:i}=e,s=n+"file?path="+encodeURIComponent(r);return x.useEffect(()=>()=>i(""),[r,i]),g6.test(r)?v.jsx(SI,{...e}):D_.test(r)?v.jsx("iframe",{className:"htmlview",sandbox:"allow-scripts",src:s,title:r,onLoad:e.onRendered}):v6.test(r)?v.jsx(_I,{src:s,alt:r,onRendered:e.onRendered}):y6.test(r)?v.jsx(CI,{...e,fileURL:s}):v.jsxs("div",{className:"filecard",children:[v.jsx("div",{className:"name",children:r.split("/").pop()}),v.jsx("p",{children:"No preview for this file type."}),v.jsx("a",{className:"btn",download:!0,href:n+"download?path="+encodeURIComponent(r),children:"Download"})]})}function SI(e){const{apiBase:n,path:r,heatMap:i,flatFiles:s,onOpenFile:l,onMeta:c,onRendered:d}=e,{data:h,error:m}=jn({queryKey:["render",n,r],queryFn:()=>Fn(n+"render?path="+encodeURIComponent(r))}),y=x.useMemo(()=>h?wI(h.html,r,n):"",[h,r,n]);return x.useEffect(()=>{if(!h)return;const g=[];h.author&&g.push(h.author+(h.device?" on "+h.device:"")),h.time&&g.push(new Date(h.time).toLocaleString());const b=i&&i[h.path];b&&Ws(b)&&g.push(Ku(b)+" / 30d"),c(g.join(" · ")),d?.()},[h,i,c,d]),m?v.jsxs("div",{className:"empty",children:["Could not load file: ",m.message]}):h?v.jsx("div",{dangerouslySetInnerHTML:{__html:y},onClick:g=>xI(g,r,s,l)}):null}function xI(e,n,r,i){const s=e.target.closest("a");if(!s||!e.currentTarget.contains(s))return;const l=s.getAttribute("href")||"",c=n.includes("/")?n.slice(0,n.lastIndexOf("/")):"";l.startsWith("wiki:")?(e.preventDefault(),EI(decodeURIComponent(l.slice(5)),r,i)):/^([a-z]+:|\/|#)/i.test(l)||(e.preventDefault(),i(k_(c,decodeURIComponent(l))))}function wI(e,n,r){const i=n.includes("/")?n.slice(0,n.lastIndexOf("/")):"",s=c=>r+"file?path="+encodeURIComponent(c),l=new DOMParser().parseFromString(e,"text/html");for(const c of l.querySelectorAll("img")){const d=c.getAttribute("src")||"";/^([a-z]+:|\/)/i.test(d)||c.setAttribute("src",s(k_(i,d)))}for(const c of l.querySelectorAll("a")){const d=c.getAttribute("href")||"";/^https?:/i.test(d)&&(c.setAttribute("target","_blank"),c.setAttribute("rel","noopener"))}return l.body.innerHTML}function _I({src:e,alt:n,onRendered:r}){return v.jsx("img",{src:e,alt:n,onLoad:r})}function CI(e){const{path:n,fileURL:r,onRendered:i}=e,{data:s,error:l}=jn({queryKey:["text",r],queryFn:async()=>{const c=await fetch(r);if(!c.ok)throw new Error(await c.text());return c.text()}});return x.useEffect(()=>{s!=null&&i?.()},[s,i]),l?v.jsxs("div",{className:"empty",children:["Could not load file: ",l.message]}):s==null?null:v.jsx("pre",{className:"plain",children:s},n)}function EI(e,n,r){const i=e.toLowerCase(),s=n.find(l=>l.path.toLowerCase()===i||l.path.toLowerCase()===i+".md")||n.find(l=>{const c=l.name.toLowerCase();return c===i||c===i+".md"});s&&r(s.path)}function RI({url:e,copied:n,onClose:r}){const i=e.split("/s/")[1];return v.jsx(xp,{open:!0,onOpenChange:s=>!s&&r(),children:v.jsxs(wp,{className:"modal",showCloseButton:!1,children:[v.jsx($c,{asChild:!0,children:v.jsx("h3",{children:"Public link created"})}),v.jsxs("p",{children:[v.jsx("b",{children:"Anyone with this link can view this file"})," — no account needed. It always shows the latest version until you revoke it."]}),v.jsx("div",{className:"modal-url",children:e}),v.jsxs("div",{className:"modal-actions",children:[v.jsx(Bt,{variant:"primary",onClick:()=>Js(e).then(s=>Je(s?"Copied.":"Select and copy the link above.")),children:n?"Copied ✓":"Copy link"}),v.jsx(Bt,{variant:"subtle",onClick:()=>window.open(e,"_blank"),children:"Open"}),v.jsx(Bt,{variant:"subtle",className:"ai-del",onClick:async()=>{try{await zo("DELETE","/api/shares/"+i),Je("Link revoked — it no longer works."),r()}catch(s){Je(s.message,!0)}},children:"Revoke"}),v.jsx(Bt,{variant:"subtle",onClick:r,children:"Done"})]})]})})}var DS=1,TI=.9,OI=.8,AI=.17,Bh=.1,qh=.999,MI=.9999,jI=.99,zI=/[\\\/_+.#"@\[\(\{&]/,DI=/[\\\/_+.#"@\[\(\{&]/g,NI=/[\s-]/,q_=/[\s-]/g;function Mm(e,n,r,i,s,l,c){if(l===n.length)return s===e.length?DS:jI;var d=`${s},${l}`;if(c[d]!==void 0)return c[d];for(var h=i.charAt(l),m=r.indexOf(h,s),y=0,g,b,S,_;m>=0;)g=Mm(e,n,r,i,m+1,l+1,c),g>y&&(m===s?g*=DS:zI.test(e.charAt(m-1))?(g*=OI,S=e.slice(s,m-1).match(DI),S&&s>0&&(g*=Math.pow(qh,S.length))):NI.test(e.charAt(m-1))?(g*=TI,_=e.slice(s,m-1).match(q_),_&&s>0&&(g*=Math.pow(qh,_.length))):(g*=AI,s>0&&(g*=Math.pow(qh,m-s))),e.charAt(m)!==n.charAt(l)&&(g*=MI)),(gg&&(g=b*Bh)),g>y&&(y=g),m=r.indexOf(h,m+1);return c[d]=y,y}function NS(e){return e.toLowerCase().replace(q_," ")}function kI(e,n,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Mm(e,n,NS(e),NS(n),0,0,{})}var Ds='[cmdk-group=""]',Gh='[cmdk-group-items=""]',LI='[cmdk-group-heading=""]',G_='[cmdk-item=""]',kS=`${G_}:not([aria-disabled="true"])`,jm="cmdk-item-select",Sa="data-value",II=(e,n,r)=>kI(e,n,r),Z_=x.createContext(void 0),dl=()=>x.useContext(Z_),K_=x.createContext(void 0),Hp=()=>x.useContext(K_),Y_=x.createContext(void 0),Q_=x.forwardRef((e,n)=>{let r=xa(()=>{var j,U;return{search:"",value:(U=(j=e.value)!=null?j:e.defaultValue)!=null?U:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=xa(()=>new Set),s=xa(()=>new Map),l=xa(()=>new Map),c=xa(()=>new Set),d=X_(e),{label:h,children:m,value:y,onValueChange:g,filter:b,shouldFilter:S,loop:_,disablePointerSelection:C=!1,vimBindings:E=!0,...T}=e,O=hn(),A=hn(),k=hn(),L=x.useRef(null),q=KI();bi(()=>{if(y!==void 0){let j=y.trim();r.current.value=j,H.emit()}},[y]),bi(()=>{q(6,ae)},[]);let H=x.useMemo(()=>({subscribe:j=>(c.current.add(j),()=>c.current.delete(j)),snapshot:()=>r.current,setState:(j,U,Q)=>{var Z,re,ee,ge;if(!Object.is(r.current[j],U)){if(r.current[j]=U,j==="search")le(),ve(),q(1,de);else if(j==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let be=document.getElementById(k);be?be.focus():(Z=document.getElementById(O))==null||Z.focus()}if(q(7,()=>{var be;r.current.selectedItemId=(be=me())==null?void 0:be.id,H.emit()}),Q||q(5,ae),((re=d.current)==null?void 0:re.value)!==void 0){let be=U??"";(ge=(ee=d.current).onValueChange)==null||ge.call(ee,be);return}}H.emit()}},emit:()=>{c.current.forEach(j=>j())}}),[]),$=x.useMemo(()=>({value:(j,U,Q)=>{var Z;U!==((Z=l.current.get(j))==null?void 0:Z.value)&&(l.current.set(j,{value:U,keywords:Q}),r.current.filtered.items.set(j,he(U,Q)),q(2,()=>{ve(),H.emit()}))},item:(j,U)=>(i.current.add(j),U&&(s.current.has(U)?s.current.get(U).add(j):s.current.set(U,new Set([j]))),q(3,()=>{le(),ve(),r.current.value||de(),H.emit()}),()=>{l.current.delete(j),i.current.delete(j),r.current.filtered.items.delete(j);let Q=me();q(4,()=>{le(),Q?.getAttribute("id")===j&&de(),H.emit()})}),group:j=>(s.current.has(j)||s.current.set(j,new Set),()=>{l.current.delete(j),s.current.delete(j)}),filter:()=>d.current.shouldFilter,label:h||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:O,inputId:k,labelId:A,listInnerRef:L}),[]);function he(j,U){var Q,Z;let re=(Z=(Q=d.current)==null?void 0:Q.filter)!=null?Z:II;return j?re(j,r.current.search,U):0}function ve(){if(!r.current.search||d.current.shouldFilter===!1)return;let j=r.current.filtered.items,U=[];r.current.filtered.groups.forEach(Z=>{let re=s.current.get(Z),ee=0;re.forEach(ge=>{let be=j.get(ge);ee=Math.max(be,ee)}),U.push([Z,ee])});let Q=L.current;ye().sort((Z,re)=>{var ee,ge;let be=Z.getAttribute("id"),De=re.getAttribute("id");return((ee=j.get(De))!=null?ee:0)-((ge=j.get(be))!=null?ge:0)}).forEach(Z=>{let re=Z.closest(Gh);re?re.appendChild(Z.parentElement===re?Z:Z.closest(`${Gh} > *`)):Q.appendChild(Z.parentElement===Q?Z:Z.closest(`${Gh} > *`))}),U.sort((Z,re)=>re[1]-Z[1]).forEach(Z=>{var re;let ee=(re=L.current)==null?void 0:re.querySelector(`${Ds}[${Sa}="${encodeURIComponent(Z[0])}"]`);ee?.parentElement.appendChild(ee)})}function de(){let j=ye().find(Q=>Q.getAttribute("aria-disabled")!=="true"),U=j?.getAttribute(Sa);H.setState("value",U||void 0)}function le(){var j,U,Q,Z;if(!r.current.search||d.current.shouldFilter===!1){r.current.filtered.count=i.current.size;return}r.current.filtered.groups=new Set;let re=0;for(let ee of i.current){let ge=(U=(j=l.current.get(ee))==null?void 0:j.value)!=null?U:"",be=(Z=(Q=l.current.get(ee))==null?void 0:Q.keywords)!=null?Z:[],De=he(ge,be);r.current.filtered.items.set(ee,De),De>0&&re++}for(let[ee,ge]of s.current)for(let be of ge)if(r.current.filtered.items.get(be)>0){r.current.filtered.groups.add(ee);break}r.current.filtered.count=re}function ae(){var j,U,Q;let Z=me();Z&&(((j=Z.parentElement)==null?void 0:j.firstChild)===Z&&((Q=(U=Z.closest(Ds))==null?void 0:U.querySelector(LI))==null||Q.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function me(){var j;return(j=L.current)==null?void 0:j.querySelector(`${G_}[aria-selected="true"]`)}function ye(){var j;return Array.from(((j=L.current)==null?void 0:j.querySelectorAll(kS))||[])}function N(j){let U=ye()[j];U&&H.setState("value",U.getAttribute(Sa))}function Y(j){var U;let Q=me(),Z=ye(),re=Z.findIndex(ge=>ge===Q),ee=Z[re+j];(U=d.current)!=null&&U.loop&&(ee=re+j<0?Z[Z.length-1]:re+j===Z.length?Z[0]:Z[re+j]),ee&&H.setState("value",ee.getAttribute(Sa))}function ne(j){let U=me(),Q=U?.closest(Ds),Z;for(;Q&&!Z;)Q=j>0?GI(Q,Ds):ZI(Q,Ds),Z=Q?.querySelector(kS);Z?H.setState("value",Z.getAttribute(Sa)):Y(j)}let J=()=>N(ye().length-1),W=j=>{j.preventDefault(),j.metaKey?J():j.altKey?ne(1):Y(1)},z=j=>{j.preventDefault(),j.metaKey?N(0):j.altKey?ne(-1):Y(-1)};return x.createElement(Pe.div,{ref:n,tabIndex:-1,...T,"cmdk-root":"",onKeyDown:j=>{var U;(U=T.onKeyDown)==null||U.call(T,j);let Q=j.nativeEvent.isComposing||j.keyCode===229;if(!(j.defaultPrevented||Q))switch(j.key){case"n":case"j":{E&&j.ctrlKey&&W(j);break}case"ArrowDown":{W(j);break}case"p":case"k":{E&&j.ctrlKey&&z(j);break}case"ArrowUp":{z(j);break}case"Home":{j.preventDefault(),N(0);break}case"End":{j.preventDefault(),J();break}case"Enter":{j.preventDefault();let Z=me();if(Z){let re=new Event(jm);Z.dispatchEvent(re)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:$.inputId,id:$.labelId,style:QI},h),Jc(e,j=>x.createElement(K_.Provider,{value:H},x.createElement(Z_.Provider,{value:$},j))))}),$I=x.forwardRef((e,n)=>{var r,i;let s=hn(),l=x.useRef(null),c=x.useContext(Y_),d=dl(),h=X_(e),m=(i=(r=h.current)==null?void 0:r.forceMount)!=null?i:c?.forceMount;bi(()=>{if(!m)return d.item(s,c?.id)},[m]);let y=J_(s,l,[e.value,e.children,l],e.keywords),g=Hp(),b=Io(q=>q.value&&q.value===y.current),S=Io(q=>m||d.filter()===!1?!0:q.search?q.filtered.items.get(s)>0:!0);x.useEffect(()=>{let q=l.current;if(!(!q||e.disabled))return q.addEventListener(jm,_),()=>q.removeEventListener(jm,_)},[S,e.onSelect,e.disabled]);function _(){var q,H;C(),(H=(q=h.current).onSelect)==null||H.call(q,y.current)}function C(){g.setState("value",y.current,!0)}if(!S)return null;let{disabled:E,value:T,onSelect:O,forceMount:A,keywords:k,...L}=e;return x.createElement(Pe.div,{ref:Aa(l,n),...L,id:s,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!b,"data-disabled":!!E,"data-selected":!!b,onPointerMove:E||d.getDisablePointerSelection()?void 0:C,onClick:E?void 0:_},e.children)}),VI=x.forwardRef((e,n)=>{let{heading:r,children:i,forceMount:s,...l}=e,c=hn(),d=x.useRef(null),h=x.useRef(null),m=hn(),y=dl(),g=Io(S=>s||y.filter()===!1?!0:S.search?S.filtered.groups.has(c):!0);bi(()=>y.group(c),[]),J_(c,d,[e.value,e.heading,h]);let b=x.useMemo(()=>({id:c,forceMount:s}),[s]);return x.createElement(Pe.div,{ref:Aa(d,n),...l,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},r&&x.createElement("div",{ref:h,"cmdk-group-heading":"","aria-hidden":!0,id:m},r),Jc(e,S=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?m:void 0},x.createElement(Y_.Provider,{value:b},S))))}),FI=x.forwardRef((e,n)=>{let{alwaysRender:r,...i}=e,s=x.useRef(null),l=Io(c=>!c.search);return!r&&!l?null:x.createElement(Pe.div,{ref:Aa(s,n),...i,"cmdk-separator":"",role:"separator"})}),PI=x.forwardRef((e,n)=>{let{onValueChange:r,...i}=e,s=e.value!=null,l=Hp(),c=Io(m=>m.search),d=Io(m=>m.selectedItemId),h=dl();return x.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),x.createElement(Pe.input,{ref:n,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":h.listId,"aria-labelledby":h.labelId,"aria-activedescendant":d,id:h.inputId,type:"text",value:s?e.value:c,onChange:m=>{s||l.setState("search",m.target.value),r?.(m.target.value)}})}),UI=x.forwardRef((e,n)=>{let{children:r,label:i="Suggestions",...s}=e,l=x.useRef(null),c=x.useRef(null),d=Io(m=>m.selectedItemId),h=dl();return x.useEffect(()=>{if(c.current&&l.current){let m=c.current,y=l.current,g,b=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let S=m.offsetHeight;y.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return b.observe(m),()=>{cancelAnimationFrame(g),b.unobserve(m)}}},[]),x.createElement(Pe.div,{ref:Aa(l,n),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":i,id:h.listId},Jc(e,m=>x.createElement("div",{ref:Aa(c,h.listInnerRef),"cmdk-list-sizer":""},m)))}),HI=x.forwardRef((e,n)=>{let{open:r,onOpenChange:i,overlayClassName:s,contentClassName:l,container:c,...d}=e;return x.createElement(Hm,{open:r,onOpenChange:i},x.createElement(qm,{container:c},x.createElement(Gm,{"cmdk-overlay":"",className:s}),x.createElement(Zm,{"aria-label":e.label,"cmdk-dialog":"",className:l},x.createElement(Q_,{ref:n,...d}))))}),BI=x.forwardRef((e,n)=>Io(r=>r.filtered.count===0)?x.createElement(Pe.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),qI=x.forwardRef((e,n)=>{let{progress:r,children:i,label:s="Loading...",...l}=e;return x.createElement(Pe.div,{ref:n,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Jc(e,c=>x.createElement("div",{"aria-hidden":!0},c)))}),Xc=Object.assign(Q_,{List:UI,Item:$I,Input:PI,Group:VI,Separator:FI,Dialog:HI,Empty:BI,Loading:qI});function GI(e,n){let r=e.nextElementSibling;for(;r;){if(r.matches(n))return r;r=r.nextElementSibling}}function ZI(e,n){let r=e.previousElementSibling;for(;r;){if(r.matches(n))return r;r=r.previousElementSibling}}function X_(e){let n=x.useRef(e);return bi(()=>{n.current=e}),n}var bi=typeof window>"u"?x.useEffect:x.useLayoutEffect;function xa(e){let n=x.useRef();return n.current===void 0&&(n.current=e()),n}function Io(e){let n=Hp(),r=()=>e(n.snapshot());return x.useSyncExternalStore(n.subscribe,r,r)}function J_(e,n,r,i=[]){let s=x.useRef(),l=dl();return bi(()=>{var c;let d=(()=>{var m;for(let y of r){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(m=y.current.textContent)==null?void 0:m.trim():s.current}})(),h=i.map(m=>m.trim());l.value(e,d,h),(c=n.current)==null||c.setAttribute(Sa,d),s.current=d}),s}var KI=()=>{let[e,n]=x.useState(),r=xa(()=>new Map);return bi(()=>{r.current.forEach(i=>i()),r.current=new Map},[e]),(i,s)=>{r.current.set(i,s),n({})}};function YI(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function Jc({asChild:e,children:n},r){return e&&x.isValidElement(n)?x.cloneElement(YI(n),{ref:n.ref},r(n.props.children)):r(n)}var QI={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function XI({className:e,...n}){return v.jsx(Xc,{"data-slot":"command",className:St("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n})}function JI({className:e,...n}){return v.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[v.jsx(A1,{className:"size-4 shrink-0 opacity-50"}),v.jsx(Xc.Input,{"data-slot":"command-input",className:St("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n})]})}function WI({className:e,...n}){return v.jsx(Xc.List,{"data-slot":"command-list",className:St("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...n})}function e$({className:e,...n}){return v.jsx(Xc.Item,{"data-slot":"command-item",className:St("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...n})}function LS(e,n){if(!e)return{score:0,hits:[]};const r=e.toLowerCase(),i=n.toLowerCase();let s=0,l=0,c=0;const d=[];for(let h=0;h3&&i.endsWith("ies")?s=i.slice(0,-3)+"y":i.length>3&&i.endsWith("es")?s=i.slice(0,-2):i.length>2&&i.endsWith("s")&&(s=i.slice(0,-1)),s?LS(s,n):null}function n$({text:e,hits:n}){const r=[];let i=0;return n.forEach((s,l)=>{s>i&&r.push(e.slice(i,s)),r.push(v.jsx("b",{children:e[s]},l)),i=s+1}),r.push(e.slice(i)),v.jsx("span",{className:"plabel",children:r})}function r$({open:e,onClose:n,candidates:r}){const[i,s]=x.useState(""),l=x.useMemo(()=>{if(!e)return[];const d=[];for(const h of r()){const m=t$(i,h.label);m&&d.push({...h,score:m.score,hits:m.hits})}return d.sort((h,m)=>m.score-h.score),d.slice(0,40)},[e,i,r]);x.useEffect(()=>{e&&s("")},[e]);const c=d=>{n(),d.run()};return v.jsx(xp,{open:e,onOpenChange:d=>!d&&n(),children:v.jsxs(wp,{id:"palette",className:"palette",showCloseButton:!1,"aria-describedby":void 0,children:[v.jsx($c,{className:"sr-only",children:"Search and quick actions"}),v.jsxs(XI,{shouldFilter:!1,loop:!0,children:[v.jsxs("div",{id:"palette-inputwrap",children:[v.jsx(Yt,{name:"search"}),v.jsx(JI,{id:"palette-input",placeholder:"Search file names, projects, actions…",autoComplete:"off",spellCheck:!1,value:i,onValueChange:s})]}),v.jsx(WI,{id:"palette-results",children:l.length===0?v.jsx("div",{className:"pempty",children:"No matches — search covers file names, projects, and actions"}):l.map(d=>v.jsxs(e$,{value:d.kind+":"+d.label,onSelect:()=>c(d),children:[v.jsx("span",{className:"picon",children:v.jsx(Yt,{name:d.icon})}),v.jsx(n$,{text:d.label,hits:d.hits}),v.jsx("span",{className:"pkind",children:d.kind})]},d.kind+":"+d.label))}),v.jsx("footer",{id:"palette-hint",children:"↑↓ navigate · ⏎ select · esc close"})]})]})})}const Is=3,wa=30;function o$(e,n){return jn({queryKey:["heatDevices",e],queryFn:()=>Fn(e+"heat?by=device&days=30"),enabled:n,retry:!1,staleTime:6e4}).data?.devices??null}function IS(e){const[n,r]=x.useState("all"),{flatFiles:i,heatMap:s,devices:l,scope:c}=e,d=b=>!c||b===c||b.startsWith(c+"/"),h=c?i.filter(b=>d(b.path)):i,m=l&&c?l.map(b=>{const S={};for(const[_,C]of Object.entries(b.folders||{}))d(_)&&(S[_]=C);return{...b,folders:S}}).filter(b=>Object.keys(b.folders).length>0):l,y=Date.now(),g=h.map(b=>{const S=s&&s[b.path]||{},_=b.time?Math.max(0,(y-new Date(b.time).getTime())/864e5):0,C=n==="all"?Ws(S):S[n]||0;return{path:b.path,reads:C,agent:S.agent||0,total:Ws(S),days:_,danger:C>=Is&&_>=wa}});return v.jsxs("div",{className:"insights",children:[v.jsxs("h1",{className:"in-title",children:["Knowledge insights",c?v.jsxs("span",{className:"in-scope",children:[" · ",c]}):null]}),v.jsx("p",{className:"dl-sub",children:c?`Reads over the last 30 days × freshness, for ${c} and everything in it.`:"Reads over the last 30 days × how long since each file changed. Hot but stale knowledge — read a lot, maintained by nobody — is the danger zone."}),v.jsx("div",{className:"in-lens",children:["all","human","agent"].map(b=>v.jsx("button",{className:"in-lens-btn"+(b===n?" active":""),onClick:()=>r(b),children:b==="all"?"All reads":b==="human"?"Human reads":"Agent reads"},b))}),v.jsx("h3",{className:"dl-h3",children:"Map — cell size = reads, color = freshness"}),v.jsx(a$,{pts:g,onOpenFile:e.onOpenFile,onOpenFolder:e.onOpenFolder,isFolder:e.isFolder}),v.jsx("h3",{className:"dl-h3",children:"Reads × freshness"}),v.jsx(s$,{pts:g,onOpenFile:e.onOpenFile}),v.jsx("h3",{className:"dl-h3",children:"Hot path — top files by reads"}),v.jsx(l$,{pts:g,lens:n,onOpenFile:e.onOpenFile}),m&&m.length>0&&v.jsxs(v.Fragment,{children:[v.jsx("h3",{className:"dl-h3",children:"Agent coverage — which agents read which areas"}),v.jsx(u$,{devices:m})]})]})}function i$(e){const n=[[76,195,138],[232,196,84],[224,93,93]],r=Math.min(1,Math.max(0,e/300))*(n.length-1),i=Math.min(n.length-2,Math.floor(r)),s=r-i,l=n[i].map((c,d)=>Math.round(c+(n[i+1][d]-c)*s));return`rgb(${l[0]},${l[1]},${l[2]})`}function $S(e,n,r,i,s){const l=e.reduce((m,y)=>m+y.value,0);if(!l||i<=0||s<=0)return[];const c=e.slice().sort((m,y)=>y.value-m.value).map(m=>({it:m,a:m.value/l*i*s})),d=(m,y)=>{const b=m.reduce((_,C)=>_+C.a,0)/y;let S=0;for(const _ of m){const C=_.a/b;S=Math.max(S,C/b,b/C)}return S},h=[];for(;c.length;){const m=i>=s,y=m?s:i,g=[c.shift()];for(;c.length&&d(g.concat(c[0]),y)<=d(g,y);)g.push(c.shift());const b=g.reduce((_,C)=>_+C.a,0)/y;let S=0;for(const _ of g){const C=_.a/b;m?h.push({item:_.it,x:n,y:r+S,w:b,h:C}):h.push({item:_.it,x:n+S,y:r,w:C,h:b}),S+=C}m?(n+=b,i-=b):(r+=b,s-=b)}return h}const Zh=15;function a$({pts:e,onOpenFile:n,onOpenFolder:r,isFolder:i}){const c=new Map;for(const h of e){const m=h.path.includes("/")?h.path.split("/")[0]:"/";let y=c.get(m);y||c.set(m,y={name:m,files:[],value:0}),y.files.push(h),y.value+=h.reads+1}const d=[];for(const h of $S([...c.values()],0,0,720,480)){const m=h.item,y=m.name==="/"?"":m.name;if(d.push(v.jsx("rect",{x:h.x+1,y:h.y+1,width:Math.max(0,h.w-2),height:Math.max(0,h.h-2),rx:3,className:"in-tm-group","data-dir":y},"g"+m.name)),h.w>46&&h.h>Zh+10){let b=m.name==="/"?"(root)":m.name;const S=Math.floor((h.w-8)/6);b.length>S&&(b=b.slice(0,Math.max(1,S-1))+"…"),d.push(v.jsx("text",{x:h.x+5,y:h.y+12,className:"in-tm-glabel","data-dir":y,children:b},"gl"+m.name))}const g=$S(m.files.map(b=>({...b,name:b.path.split("/").pop(),value:b.reads+1})),h.x+2,h.y+Zh,Math.max(0,h.w-4),Math.max(0,h.h-Zh-2));for(const b of g)if(d.push(v.jsx("rect",{x:b.x+.6,y:b.y+.6,width:Math.max(.4,b.w-1.2),height:Math.max(.4,b.h-1.2),rx:1.5,fill:i$(b.item.days),className:"in-tm-cell","data-path":b.item.path,children:v.jsx("title",{children:`${b.item.path} — ${b.item.reads} read${b.item.reads===1?"":"s"}/30d · changed ${Math.round(b.item.days)}d ago`})},b.item.path)),b.w>54&&b.h>16){const S=Math.floor((b.w-8)/6);let _=(b.item.danger?"⚠ ":"")+b.item.name;_.length>S&&(_=_.slice(0,Math.max(1,S-1))+"…"),S>=5&&d.push(v.jsx("text",{x:b.x+4.5,y:b.y+12.5,className:"in-tm-label","data-path":b.item.path,children:_},"l"+b.item.path))}}return v.jsx("svg",{viewBox:"0 0 720 480",className:"in-chart in-treemap",onClick:h=>{const m=h.target.closest("[data-path], [data-dir]");if(!m)return;const y=m.getAttribute("data-path");if(y)return n(y);const g=m.getAttribute("data-dir");g&&i(g)&&r(g)},children:d})}function s$({pts:e,onOpenFile:n}){const s={l:44,r:16,t:20,b:34},l=Math.max(wa*2,...e.map(g=>g.days)),c=Math.max(Is*2,...e.map(g=>g.reads)),d=g=>Math.log10(g+1)/Math.log10(l+1),h=g=>Math.log10(g+1)/Math.log10(c+1),m=g=>s.l+d(g)*(720-s.l-s.r),y=g=>360-s.b-h(g)*(360-s.t-s.b);return v.jsxs("svg",{viewBox:"0 0 720 360",className:"in-chart",children:[v.jsx("rect",{x:m(wa),y:s.t,width:720-s.r-m(wa),height:y(Is)-s.t,className:"in-danger-zone"}),v.jsx("line",{x1:m(wa),y1:s.t,x2:m(wa),y2:360-s.b,className:"in-threshold"}),v.jsx("line",{x1:s.l,y1:y(Is),x2:720-s.r,y2:y(Is),className:"in-threshold"}),v.jsx("line",{x1:s.l,y1:360-s.b,x2:720-s.r,y2:360-s.b,className:"in-axis"}),v.jsx("line",{x1:s.l,y1:s.t,x2:s.l,y2:360-s.b,className:"in-axis"}),v.jsx("text",{x:(s.l+720-s.r)/2,y:352,className:"in-label",children:"days since last change →"}),v.jsx("text",{x:12,y:(s.t+360-s.b)/2,className:"in-label",transform:`rotate(-90 12 ${(s.t+360-s.b)/2})`,children:"reads / 30d →"}),v.jsx("text",{x:720-s.r-6,y:s.t+14,className:"in-quad in-quad-danger",textAnchor:"end",children:"hot + stale"}),v.jsx("text",{x:s.l+6,y:s.t+14,className:"in-quad",children:"hot + fresh"}),v.jsx("text",{x:720-s.r-6,y:360-s.b-8,className:"in-quad",textAnchor:"end",children:"cold + stale"}),v.jsx("text",{x:720-s.r-6,y:s.t+28,className:"in-label",textAnchor:"end",children:"dot size = agent share of reads"}),e.map(g=>{const b=g.total?(g.agent||0)/g.total:0;return v.jsx("circle",{cx:Number(m(g.days).toFixed(1)),cy:Number(y(g.reads).toFixed(1)),r:Number((3+4*b).toFixed(1)),className:"in-pt"+(g.danger?" danger":g.reads?"":" cold"),onClick:()=>n(g.path),children:v.jsx("title",{children:`${g.path} — ${g.reads} read${g.reads===1?"":"s"} / 30d · changed ${Math.round(g.days)}d ago`})},g.path)})]})}function l$({pts:e,lens:n,onOpenFile:r}){const i=e.filter(l=>l.reads>0).sort((l,c)=>c.reads-l.reads||c.days-l.days).slice(0,20);if(!i.length)return v.jsx("div",{className:"dl-empty",children:"No reads in the window yet."});const s=i[0].reads;return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"in-hotpath",children:i.map(l=>{const c=n==="agent"?1:n==="human"?0:l.total?l.agent/l.total:0,d=l.reads/s*100;return v.jsxs("div",{className:"in-hp-row",tabIndex:0,role:"button",title:l.danger?`${l.reads} read${l.reads===1?"":"s"}/30d · unchanged ${Math.round(l.days)}d — review this file`:l.path,onClick:()=>r(l.path),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),r(l.path))},children:[v.jsx("span",{className:"in-hp-name"+(l.danger?" danger":""),children:l.path+(l.danger?" ⚠":"")}),v.jsxs("span",{className:"in-hp-bar",children:[v.jsx("span",{className:"in-hp-agent",style:{width:(d*c).toFixed(1)+"%"}}),v.jsx("span",{className:"in-hp-human",style:{width:(d*(1-c)).toFixed(1)+"%"}})]}),v.jsx("span",{className:"in-hp-count",children:l.reads})]},l.path)})}),v.jsxs("p",{className:"in-legend",children:[v.jsx("span",{className:"in-sw agent"})," agent reads ",v.jsx("span",{className:"in-sw human"})," human reads"]})]})}function u$({devices:e}){const n=new Map;for(const b of e)for(const[S,_]of Object.entries(b.folders||{}))n.set(S,(n.get(S)||0)+_);const r=[...n.entries()].sort((b,S)=>S[1]-b[1]).slice(0,12).map(b=>b[0]),i=e.slice(0,12),s=140,l=6,c=Math.min(76,Math.max(34,(720-s-8)/r.length)),d=26,h=720,m=l+i.length*d+58,y=Math.max(1,...i.flatMap(b=>r.map(S=>(b.folders||{})[S]||0))),g=b=>{const S=[23,25,31],_=[245,166,35],C=S.map((E,T)=>Math.round(E+(_[T]-E)*b));return`rgb(${C[0]},${C[1]},${C[2]})`};return v.jsxs("svg",{viewBox:`0 0 ${h} ${m}`,className:"in-chart in-matrix",children:[i.map((b,S)=>{let _=b.name||b.id||"";return _.length>20&&(_=_.slice(0,19)+"…"),v.jsxs("g",{children:[v.jsx("text",{x:s-8,y:l+S*d+17,textAnchor:"end",className:"in-label",children:_}),r.map((C,E)=>{const T=(b.folders||{})[C]||0;return v.jsx("rect",{x:s+E*c,y:l+S*d,width:c-4,height:d-4,rx:3,fill:g(Math.sqrt(T/y)),children:v.jsx("title",{children:`${b.name||b.id} × ${C||"(root)"}: ${T} read${T===1?"":"s"}/30d`})},C)})]},b.id||S)}),r.map((b,S)=>{const _=s+S*c+(c-4)/2,C=l+i.length*d+14;return v.jsx("text",{x:_,y:C,className:"in-label",textAnchor:"end",transform:`rotate(-28 ${_} ${C})`,children:b||"(root)"},b)})]})}function c$(e){const{apiBase:n,target:r,isFolder:i,onMeta:s,onRendered:l}=e,c=r?i(r)?{prefix:r+"/"}:{path:r}:{prefix:""},d="path"in c&&c.path!==void 0?"path="+encodeURIComponent(c.path):"prefix="+encodeURIComponent(c.prefix??""),{data:h,error:m}=jn({queryKey:["history",n,d,200],queryFn:()=>Fn(n+"history?"+d+"&n=200"),staleTime:15e3});if(x.useEffect(()=>{m&&s("History unavailable: "+m.message)},[m,s]),x.useEffect(()=>{h&&l?.()},[h,l]),!h)return null;const y=h.entries||[];return v.jsxs("div",{className:"history",children:[y.length===0&&v.jsx("div",{className:"empty",children:"No history yet."}),y.map((g,b)=>v.jsx(B_,{entry:g,onOpen:e.onOpen},b))]})}function d$(e,n){return e?n(e)?e+"/ (folder)":e:"all changes"}function W_(e){const{config:n,apiBase:r,route:i,hub:s,project:l}=e,c=Rp(),d=tl(),{tree:h,flatFiles:m,dirIndex:y,loaded:g}=B6(r,!s||!!l),b=q6(r,s&&!!l&&!!n.reads?.enabled),S=s&&!!l&&!i.path&&!i.view,_=!!e.canInsights&&(i.view==="insights"||S),C=o$(r,_);x.useEffect(()=>{_&&d.invalidateQueries({queryKey:["heat",r]})},[_,r,d]);const E=i.path,T=E||(i.view==="insights"||i.view==="history")&&i.viewTarget||"",O=!!E&&y.has(E),A=!!E&&g&&!O&&m.some($e=>$e.path===E),k=!!E&&g&&!O&&!A,L=O&&!i.view,[q,H]=x.useState(()=>new Set),$=x.useRef(!0);x.useEffect(()=>{if(!h||!$.current)return;$.current=!1;const $e=(h.children||[]).filter(ze=>ze.dir);$e.length===1&&H(ze=>new Set(ze).add($e[0].path))},[h]),x.useEffect(()=>{!T||!g||H($e=>{const ze=new Set($e);for(const Xe of hI(T))ze.add(Xe);return y.has(T)&&ze.add(T),ze})},[T,g,y]);const he=x.useCallback($e=>{H(ze=>{const Xe=new Set(ze);return Xe.has($e)?Xe.delete($e):Xe.add($e),Xe})},[]),ve=x.useRef(null),de=x.useRef(new Map),le=x.useRef({key:"",want:0,attempts:0});x.useEffect(()=>{le.current={key:c,want:ON()==="POP"?de.current.get(c)??0:0,attempts:0}},[c]);const ae=x.useCallback(()=>{const $e=ve.current,ze=le.current;!$e||ze.key!==c||ze.attempts>=3||(ze.attempts++,$e.scrollTo({top:ze.want,behavior:"instant"}))},[c]),me=x.useCallback(()=>{ve.current&&de.current.set(c,ve.current.scrollTop)},[c]),ye=x.useCallback($e=>{fn(TN($e,l?.id)),fr()},[l?.id]),N=x.useCallback($e=>fn(_a("history",l?.id,$e)),[l?.id]),[Y,ne]=x.useState(""),[J,W]=x.useState(null),[z,j]=x.useState(!1),[U,Q]=x.useState(!1);x.useEffect(()=>Cz(()=>Q(!0)),[]);const Z=x.useRef(null),re=e.panel??null,ee=!re&&s&&!!l&&A,ge=!re&&s&&!!l,be=!re&&A,De=!re&&(A||s&&!!l&&O),Ie=r+"download?path="+encodeURIComponent(E),Fe=x.useCallback(async()=>{try{const $e=await fetch(r+"shares",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:E})});if(!$e.ok)throw new Error(await $e.text());const ze=await $e.json(),Xe=await Js(ze.url);W({url:ze.url,copied:Xe})}catch($e){Je("Share failed: "+$e.message,!0)}},[r,E]),st=x.useCallback(()=>{if(!E)return N("");N(O?E+"/":E)},[E,O,N]);x.useEffect(()=>{const $e=ze=>{(ze.metaKey||ze.ctrlKey)&&ze.key.toLowerCase()==="k"&&(ze.preventDefault(),Q(Xe=>!Xe))};return window.addEventListener("keydown",$e),()=>window.removeEventListener("keydown",$e)},[]);const Qe=x.useCallback(()=>{const $e=[],ze=(Xe,zt,eo,or)=>$e.push({icon:Xe,label:zt,kind:eo,run:or});if(s&&l&&E&&(A&&ze("share","Share: "+E,"action",Fe),ze("hist","History: "+E,"action",st),A&&ze("download","Download: "+E,"action",()=>Z.current?.click())),s&&l&&ze("hist","History: whole project","action",()=>N("")),s)for(const Xe of e.projects||[])(!l||Xe.id!==l.id)&&ze("folder","Switch to project: "+Xe.name,"project",()=>fn("/"+Xe.id));n.auth?.enabled&&ze("power","Sign out","action",()=>window.location.href="/auth/logout");for(const Xe of y.keys())ze("folder",Xe,"folder",()=>ye(Xe));for(const Xe of m)ze("doc",Xe.path,"file",()=>ye(Xe.path));return $e},[s,l,E,A,n.auth?.enabled,y,m,e.projects,Fe,st,N,ye]);x.useEffect(()=>{if(!z)return;const $e=()=>j(!1);return document.addEventListener("click",$e),()=>document.removeEventListener("click",$e)},[z]);const Xt=x.useCallback($e=>y.has($e),[y]);let mn="app",qt,Ft;re?Ft=re.body:i.view==="insights"?Ft=e.canInsights?v.jsx(IS,{flatFiles:m,heatMap:b,devices:C,scope:i.viewTarget||"",onOpenFile:ye,onOpenFolder:ye,isFolder:Xt}):v.jsx("div",{className:"empty",children:"Insights is for hub admins and org owners."}):i.view==="history"?Ft=v.jsx(c$,{apiBase:r,target:i.viewTarget||"",isFolder:Xt,onOpen:ye,onMeta:ne,onRendered:ae}):E?g?k?Ft=v.jsxs("div",{className:"notfound",children:[v.jsx("h1",{children:"Couldn't find that"}),v.jsxs("p",{children:[v.jsx("code",{children:E})," isn't in this project right now."]}),v.jsx("p",{className:"nf-sub",children:"If it was just created, it may still be uploading or syncing from a teammate's device — this page checks again automatically every few seconds, so refresh or come back in a moment."}),v.jsx("button",{className:"pbtn",onClick:()=>d.invalidateQueries({queryKey:["tree",r]}),children:"Check again"})]}):O?Ft=v.jsx(vI,{node:y.get(E),heatMap:b,hub:s&&!!l,apiBase:r,onOpen:ye,onFullHistory:N,onRendered:ae}):(mn=D_.test(E)?"wide":"read",qt="markdown",Ft=v.jsx(bI,{apiBase:r,path:E,heatMap:b,flatFiles:m,onOpenFile:ye,onMeta:ne,onRendered:ae})):Ft=v.jsx("div",{className:"empty",children:"Loading…"}):S?Ft=v.jsxs(v.Fragment,{children:[v.jsx(U_,{project:l}),e.canInsights&&v.jsx("div",{className:"home-insights",children:v.jsx(IS,{flatFiles:m,heatMap:b,devices:C,onOpenFile:ye,onOpenFolder:ye,isFolder:Xt})})]}):Ft=v.jsx("div",{className:"empty",children:"Select a file to read it."});const Pt=re?re.crumb:E?v.jsx(mI,{path:E,onOpenFolder:ye}):i.view==="insights"?"Insights — "+(i.viewTarget||l?.name||""):i.view==="history"?"History — "+d$(i.viewTarget||"",Xt):S?l.name:null,rr=v.jsx(Ys,{crumb:Pt,meta:Y,actions:v.jsxs(v.Fragment,{children:[ee&&v.jsx(Bt,{id:"share-btn",variant:"toolbar",className:"icon-only",title:"Share","aria-label":"Share",onClick:Fe,children:v.jsx(Yt,{name:"share"})}),ge&&!E&&!i.view&&v.jsxs(Bt,{id:"history-btn",variant:"toolbar",onClick:st,children:[v.jsx(Yt,{name:"hist"})," ",v.jsx("span",{className:"lbl",children:"History"})]}),be&&v.jsx("a",{id:"download",hidden:!0,download:!0,href:Ie,ref:Z,children:"Download"}),De&&v.jsx(Bt,{id:"more-btn",variant:"toolbar",className:"icon-only",title:"More actions","aria-label":"More actions",onClick:$e=>{$e.stopPropagation(),j(!z)},children:v.jsx(Yt,{name:"dots"})}),z&&v.jsxs("div",{id:"more-menu",role:"menu",children:[ge&&v.jsx("button",{className:"more-item",onClick:st,children:"History"}),be&&v.jsx("button",{className:"more-item",onClick:()=>Z.current?.click(),children:"Download"}),e.canInsights&&v.jsx("button",{className:"more-item",onClick:()=>{e.onClosePanel?.(),fn(_a("insights",l?.id,E))},children:"Insights"})]})]})});return v.jsxs(v.Fragment,{children:[v.jsx(Ks,{vault:e.sidebar.vault,projectsNav:e.sidebar.projectsNav,orgBar:e.sidebar.orgBar,tree:v.jsx(fI,{root:h,expanded:q,onToggle:he,currentPath:T,listingShowing:L,onOpen:ye}),topbar:rr,contentRef:ve,onContentScroll:me,children:v.jsx(ic,{width:mn,className:qt,children:Ft})}),J&&v.jsx(RI,{url:J.url,copied:J.copied,onClose:()=>W(null)}),v.jsx(r$,{open:U,onClose:()=>Q(!1),candidates:Qe})]})}function f$({config:e}){const n=Rp(),r=N1(),[i,s]=x.useState(null),[l,c]=x.useState(null);x.useEffect(()=>c(null),[n]);const d=x.useMemo(()=>{const $=n.match(/^\/join\/([0-9a-f]+)\/?$/);return $?$[1]:null},[n]),{data:h}=CN(!d),{data:m}=EN(!d),y=!!e.auth.admin,{data:g}=D1(y),b=x.useMemo(()=>L1(n,"hub"),[n]),S=x.useMemo(()=>h&&(h.find($=>$.id===b.project)||i&&h.find($=>$.org===i)||h[0])||null,[h,b.project,i]);if(x.useEffect(()=>{document.title=S?S.name+" — BearDrive":e.brand||e.volume||"BearDrive"},[S,e]),d)return v.jsx(h$,{token:d,onDone:async $=>{s($),await r(),fn("/",{replace:!0})}});const _=e.brand||e.volume||"BearDrive",C=S&&m?.find($=>$.id===S.org)||null,E=y||(C?C.role==="owner":!1),T=v.jsx(Ic,{name:_,onHome:()=>fn("/"),search:!!S}),O=e.me?v.jsx(k6,{me:e.me,org:C,orgActive:!!b.org,admin:y?{pending:g?.length||0,onClick:()=>{c({kind:"hub"}),fr()}}:void 0}):void 0;if(!h||!m)return v.jsx(Ks,{vault:T,topbar:v.jsx(Ys,{}),children:v.jsx(ic,{children:v.jsx("div",{className:"empty",children:"Loading…"})})});if(!S)return v.jsx(Ks,{vault:T,projectsNav:v.jsx(OS,{projects:h}),orgBar:O,topbar:v.jsx(Ys,{}),children:v.jsx(ic,{children:v.jsx(H6,{authEnabled:e.auth.enabled,onCreate:async $=>{if(!$){Je("Give the project a name.",!0);return}try{const he=await Oa("/api/projects",{name:$});await r(),fn("/"+he.project.id),Je(`Created “${he.project.name}”.`)}catch(he){Je("Could not create the project: "+he.message,!0)}}})})});const A=l?.kind==="hub"?{crumb:"Signup & access",body:v.jsx(C6,{})}:null,k=b.org?m.find($=>$.id===b.org):null,q=b.org&&!k?{crumb:"Organization",body:v.jsxs("div",{className:"empty",children:[v.jsx("h3",{children:"Organization not found"}),v.jsx("p",{children:"This organization doesn't exist, or you're no longer a member."}),v.jsx("p",{children:v.jsxs("a",{...$1("/"+S.id),children:["Back to ",S.name]})})]})}:k?{crumb:"Organization",body:v.jsx(S6,{org:k,projects:h,myEmail:e.me?.email||"",onProjectsChanged:r})}:null,H=b.view==="settings"?{crumb:"Project settings",body:v.jsx(L6,{project:S,org:C,onDeleted:async()=>{await r(),fn("/")}})}:b.view==="install"?{crumb:"Installation",body:v.jsx(U_,{project:S})}:null;return!b.org&&b.project!==S.id?v.jsx(AN,{to:"/"+S.id}):v.jsx(W_,{config:e,apiBase:"/api/p/"+S.id+"/",route:b,hub:!0,project:S,projects:h,canInsights:E,sidebar:{vault:T,projectsNav:v.jsx(OS,{projects:h,currentId:S.id,menu:{active:l?null:b.view==="insights"&&!b.viewTarget?"dashboard":b.view==="install"?"install":b.view==="history"&&!b.viewTarget?"history":b.view==="settings"?"settings":null,onDashboard:()=>{c(null),fn(_a("insights",S.id)),fr()},onInstall:()=>{c(null),fn(_a("install",S.id)),fr()},onHistory:()=>{c(null),fn(_a("history",S.id)),fr()},onSettings:()=>{c(null),fn(_a("settings",S.id)),fr()}}}),orgBar:O},panel:A||q||H,onClosePanel:()=>c(null)},S.id)}function h$({token:e,onDone:n}){return x.useEffect(()=>{let r=!1;return Oa("/api/invites/"+e).then(i=>{r||(Je(`Welcome — you joined the “${i.org.name}” team. Opening its projects…`),n(i.org.id))}).catch(i=>{r||String(i.message).includes("signing in")||(Je("Could not accept the invite: "+i.message,!0),n(null))}),()=>{r=!0}},[e]),v.jsx(Ks,{vault:v.jsx(Ic,{name:"BearDrive"}),topbar:v.jsx(Ys,{}),children:v.jsx(ic,{children:v.jsx("div",{className:"empty",children:"Joining…"})})})}function m$({config:e}){const n=Rp(),r=e.volume||"BearDrive";x.useEffect(()=>{document.title=e.brand||r},[e,r]);const i=x.useMemo(()=>L1(n,"volume"),[n]);return v.jsx(W_,{config:e,apiBase:"/api/",route:i,hub:!1,sidebar:{vault:v.jsx(Ic,{name:r,showSignout:e.auth.enabled,search:!0})}})}function p$(){const{data:e}=aT();return v.jsxs(Sz,{delayDuration:150,children:[e?e.mode==="hub"?v.jsx(f$,{config:e}):v.jsx(m$,{config:e}):v.jsx(Ks,{vault:v.jsx(Ic,{name:"…",showSignout:!1}),topbar:v.jsx(Ys,{}),children:v.jsx("div",{className:"empty",children:"Loading…"})}),v.jsx(gN,{}),v.jsx(xN,{})]})}const g$=new GR({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});SR.createRoot(document.getElementById("root")).render(v.jsx(x.StrictMode,{children:v.jsx(ZR,{client:g$,children:v.jsx(p$,{})})}));
diff --git a/internal/webapp/static/assets/index-FkLsvBWJ.css b/internal/webapp/static/assets/index-FkLsvBWJ.css
new file mode 100644
index 0000000..3a0ab94
--- /dev/null
+++ b/internal/webapp/static/assets/index-FkLsvBWJ.css
@@ -0,0 +1 @@
+@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--tracking-widest:.1em;--radius-xs:.125rem;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--color-background:#0a0b0d;--color-foreground:#eef0f3;--color-card:#15171b;--color-card-foreground:#eef0f3;--color-popover:#15171b;--color-popover-foreground:#eef0f3;--color-primary:#f5a623;--color-primary-foreground:#1a1204;--color-secondary:#ffffff08;--color-secondary-foreground:#eef0f3;--color-muted:#ffffff0f;--color-muted-foreground:#9aa0a9;--color-accent:#ffffff0f;--color-accent-foreground:#eef0f3;--color-destructive:#f26d6d;--color-border:#ffffff12;--color-input:#ffffff1c;--color-ring:#f5a623;--radius-ctl:7px}}@layer base,components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:0}.top-4{top:calc(var(--spacing) * 4)}.top-20{top:calc(var(--spacing) * 20)}.top-\[50\%\]{top:50%}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.left-2{left:calc(var(--spacing) * 2)}.left-\[50\%\]{left:50%}.z-50{z-index:50}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.my-1{margin-block:var(--spacing)}.mt-4{margin-top:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.field-sizing-content{field-sizing:content}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.min-h-16{min-height:calc(var(--spacing) * 16)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.min-w-0{min-width:0}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.resize{resize:both}.scroll-my-1{scroll-margin-block:var(--spacing)}.scroll-py-1{scroll-padding-block:var(--spacing)}.auto-rows-min{grid-auto-rows:min-content}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded-\[2px\]{border-radius:2px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-xs{border-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-input{border-color:var(--color-input)}.bg-background{background-color:var(--color-background)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-border{background-color:var(--color-border)}.bg-card{background-color:var(--color-card)}.bg-destructive{background-color:var(--color-destructive)}.bg-foreground{background-color:var(--color-foreground)}.bg-muted\/50{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.bg-popover{background-color:var(--color-popover)}.bg-primary{background-color:var(--color-primary)}.bg-secondary{background-color:var(--color-secondary)}.bg-transparent{background-color:#0000}.fill-current{fill:currentColor}.fill-foreground{fill:var(--color-foreground)}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.align-middle{vertical-align:middle}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-background{color:var(--color-background)}.text-card-foreground{color:var(--color-card-foreground)}.text-destructive{color:var(--color-destructive)}.text-foreground{color:var(--color-foreground)}.text-muted-foreground{color:var(--color-muted-foreground)}.text-popover-foreground{color:var(--color-popover-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-secondary-foreground{color:var(--color-secondary-foreground)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--color-background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background-color\,border-color\,color\]{transition-property:background-color,border-color,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.running{animation-play-state:running}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.selection\:bg-primary ::selection{background-color:var(--color-primary)}.selection\:bg-primary::selection{background-color:var(--color-primary)}.selection\:text-primary-foreground ::selection{color:var(--color-primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--color-primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--color-foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--color-muted-foreground)}@media(hover:hover){.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-destructive\/90:hover{background-color:#f26d6de6}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--color-destructive) 90%,transparent)}}.hover\:bg-muted\/50:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.hover\:bg-primary\/90:hover{background-color:#f5a623e6}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--color-primary) 90%,transparent)}}.hover\:bg-secondary\/80:hover{background-color:#ffffff06}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--color-secondary) 80%,transparent)}}.hover\:text-accent-foreground:hover{color:var(--color-accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:bg-accent:focus{background-color:var(--color-accent)}.focus\:text-accent-foreground:focus{color:var(--color-accent-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--color-ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:border-ring:focus-visible{border-color:var(--color-ring)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:#f26d6d33}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 20%, transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:#f5a62380}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-ring) 50%, transparent)}}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-\[\>svg\]\:px-1\.5:has(>svg){padding-inline:calc(var(--spacing) * 1.5)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--color-destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:#f26d6d33}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 20%, transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[error\=true\]\:text-destructive[data-error=true]{color:var(--color-destructive)}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing) * 8)}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--color-muted-foreground)}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:var(--color-accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--color-accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing) * 9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing) * 8)}:is(.\*\*\:data-\[slot\=command-input-wrapper\]\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing) * 12)}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing) * 2)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--color-accent)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--color-accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--color-muted-foreground)}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--color-muted)}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--color-destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:#f26d6d1a}@supports (color:color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--color-destructive) 10%,transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--color-destructive)}@media(min-width:40rem){.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(prefers-color-scheme:dark){.dark\:border-input{border-color:var(--color-input)}.dark\:bg-destructive\/60{background-color:#f26d6d99}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60{background-color:color-mix(in oklab,var(--color-destructive) 60%,transparent)}}.dark\:bg-input\/30{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30{background-color:color-mix(in oklab,var(--color-input) 30%,transparent)}}@media(hover:hover){.dark\:hover\:bg-accent\/50:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:hover{background-color:color-mix(in oklab,var(--color-accent) 50%,transparent)}}.dark\:hover\:bg-input\/50:hover{background-color:#ffffff0e}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:hover{background-color:color-mix(in oklab,var(--color-input) 50%,transparent)}}}.dark\:focus-visible\:ring-destructive\/40:focus-visible{--tw-ring-color:#f26d6d66}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40[aria-invalid=true]{--tw-ring-color:#f26d6d66}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 40%, transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20[data-variant=destructive]:focus{background-color:#f26d6d33}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--color-destructive) 20%,transparent)}}}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--color-muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing) * 12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing) * 3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing) * 5)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--color-muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing) * 6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing) * 6)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:text-destructive\![data-variant=destructive]>*):is(svg){color:var(--color-destructive)!important}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}:root{--bg: #0a0b0d;--bg-side: #0c0e10;--bg-raise: #15171b;--surface: rgba(255,255,255,.03);--hover: rgba(255,255,255,.06);--border: rgba(255,255,255,.07);--border-2: rgba(255,255,255,.11);--code-bg: #0d0f12;--text: #eef0f3;--text-dim: #9aa0a9;--text-faint: #868b93;--text-ghost: #666b74;--accent: #f5a623;--accent-bright: #ffcf85;--accent-dim: #d3861a;--accent-press: #e0951a;--glow: rgba(245,166,35,.13);--add: #4cc38a;--del: #f26d6d;--mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;--ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;--r-ctl: 7px;--r-card: 10px;--r-over: 14px;--page-read: 768px;--page-app: 768px;--page-wide: 1200px;--hero-top: clamp(32px, 8vh, 88px)}@font-face{font-family:"Jersey 10";font-style:normal;font-weight:400;font-display:swap;src:url(/assets/jersey-10-COnnvJff.woff2) format("woff2")}@font-face{font-family:Logo Fallback;src:local("Helvetica Neue"),local("Arial"),local("Segoe UI"),local("Roboto");size-adjust:73%}*{box-sizing:border-box}[hidden]{display:none!important}html,body{height:100%;margin:0}#root{display:contents}body{display:flex;background:var(--bg);color:var(--text);font:13px/1.5 var(--ui);letter-spacing:-.006em;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}::selection{background:var(--glow);color:var(--accent-bright)}:focus-visible{outline:2px solid var(--accent);outline-offset:1px;border-radius:5px}:focus-visible{outline-color:var(--accent)}.admin input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}input[type=checkbox]{accent-color:var(--accent);width:20px;height:20px;color-scheme:dark}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.sprite{position:absolute}.ico{width:16px;height:16px;flex:none;stroke:currentColor;stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round}button,input,a.btn{font-family:inherit}#sidebar{width:264px;min-width:210px;background:var(--bg-side);border-right:1px solid var(--border);display:flex;flex-direction:column;overflow:hidden}#vault{display:flex;align-items:center;gap:9px;height:52px;padding:0 12px 0 14px;border-bottom:1px solid var(--border);position:relative;z-index:45}#vault-badge{flex:none;display:grid;place-items:center;color:var(--accent)}#vault-name{font-family:"Jersey 10","Logo Fallback",var(--ui);font-size:18px;font-weight:400;font-synthesis:none;letter-spacing:.01em;line-height:1;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vault-actions{display:flex;align-items:center;gap:4px}#vault #signout,.icon-btn2{width:28px;height:28px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;color:var(--text-ghost);background:transparent;border:none;cursor:pointer;text-decoration:none}#vault #signout:hover,.icon-btn2:hover{color:var(--text);background:var(--hover)}#vault #signout .ico,.icon-btn2 .ico{width:16px;height:16px}#projects{flex:none;max-height:32%;overflow-y:auto;padding:10px 8px 8px;border-bottom:1px solid var(--border)}.nav-head{display:flex;align-items:center;justify-content:space-between;padding:6px 8px;font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint)}.nav-add{display:grid;place-items:center;width:18px;height:18px;border:none;background:transparent;color:var(--text-ghost);cursor:pointer;border-radius:5px}.nav-add .ico{width:14px;height:14px}.nav-add:hover{color:var(--text);background:var(--hover)}#projects ul{list-style:none;margin:0;padding:0}#projects .row{display:flex;align-items:center;gap:9px;height:31px;padding:0 8px;border-radius:7px;color:var(--text-dim);cursor:pointer;position:relative;white-space:nowrap;overflow:hidden}.proj-mark{width:17px;height:17px;border-radius:5px;flex:none;display:grid;place-items:center;font-size:10px;font-weight:700;color:#0a0b0d;letter-spacing:-.02em;text-transform:uppercase}.proj-mark svg{width:11px;height:11px}.proj-menu [data-slot=select-item]{display:flex;align-items:center;gap:8px}#projects .row .label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}#projects .row:hover{background:var(--hover);color:var(--text)}#projects .row.active{background:var(--glow);color:var(--accent-bright)}#projects .row.active:before{content:"";position:absolute;left:0;top:6px;bottom:6px;width:2px;border-radius:2px;background:var(--accent)}#tree{flex:1;overflow-y:auto;padding:8px 8px 24px}.tguide{position:absolute;top:0;bottom:0;width:1px;background:var(--border);pointer-events:none}#tree .row{display:flex;align-items:center;gap:6px;height:28px;padding:0 8px;border-radius:7px;color:var(--text-dim);cursor:pointer;position:relative;white-space:nowrap;overflow:hidden}#tree .row:hover{background:var(--hover);color:var(--text)}#tree .row.active{background:var(--glow);color:var(--accent-bright)}#tree .row.active:before{content:"";position:absolute;left:0;top:5px;bottom:5px;width:2px;border-radius:2px;background:var(--accent)}#tree .chev{width:14px;height:14px;flex:none;color:var(--text-ghost);transition:transform .12s;display:flex;align-items:center;justify-content:center}#tree .chev .ico{width:13px;height:13px}#tree .ticon{flex:none;display:flex;color:var(--text-ghost)}#tree .ticon .ico{width:15px;height:15px}#tree .row:hover .ticon,#tree .row:hover .chev{color:var(--text-faint)}#tree .row.active .ticon,#tree .row.active .chev{color:var(--accent)}#tree .label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}#tree .file .label{font-size:12.5px}#tree .file .chev{visibility:hidden}#tree .row.collapsed .chev{transform:rotate(-90deg)}.field-err{color:var(--del);font-size:12px;margin:6px 2px 0}.modal,#palette{translate:none}.admin-card-table{padding:0}.admin-table{width:100%;border-collapse:collapse;table-layout:fixed}.admin-table td .ai-main,.admin-table td a.ai-main,.admin-table td .ai-copy,.admin-table td .ai-tag{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-table th:last-child,.admin-table td:last-child{width:186px;text-align:right}.admin-table tr:last-child td{border-bottom:none}.admin-table th{text-align:left;font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--text-faint);padding:0;border-bottom:1px solid var(--border);-webkit-user-select:none;user-select:none}.admin-table td{padding:0;border-bottom:1px solid var(--border);overflow:hidden;text-overflow:ellipsis}.admin-table tr.admin-item{display:table-row}.admin-table tr.admin-item td{padding:8px 10px}.nav-menu{list-style:none;margin:6px 0 0;padding:0}.nav-menu .row .ico{width:15px;height:15px;flex:none;color:var(--text-ghost)}.nav-menu .row.active .ico{color:var(--accent-bright)}.proj-row{display:flex;align-items:center;gap:4px;padding:0 10px 4px 12px}#project-select{flex:1;min-width:0;height:30px;padding:0 9px;display:inline-flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface);color:var(--text);font:inherit;font-size:12.5px;font-weight:500;cursor:pointer;white-space:nowrap;outline:none}#project-select>span:last-of-type{overflow:hidden;text-overflow:ellipsis}#project-select:hover{background:var(--hover);border-color:var(--border-2)}#project-select svg{color:var(--text-ghost)}.proj-menu{z-index:80;min-width:var(--radix-select-trigger-width, 200px);border:1px solid var(--border-2);border-radius:9px;padding:4px;background:var(--bg-raise);box-shadow:0 10px 32px #00000059}.proj-menu [role=option]{font-size:12.5px;color:var(--text-dim);border-radius:6px;outline:none}.proj-menu [role=option][data-highlighted]{background:var(--hover);color:var(--text)}#accountbar{position:relative;border-top:1px solid var(--border);padding:7px 10px}#account-btn{width:100%;display:flex;align-items:center;gap:9px;text-align:left;padding:6px 8px;border:none;border-radius:7px;background:transparent;color:var(--text-dim);cursor:pointer;font:inherit}#account-btn:hover{background:var(--hover);color:var(--text)}#account-btn .avatar{width:26px;height:26px;flex:none;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-size:12px;font-weight:700}#account-btn .acct{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}#account-btn .acct b{font-size:12.5px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#account-btn .acct small{font-size:11px;color:var(--text-faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#account-btn>.ico{width:14px;height:14px;color:var(--text-ghost)}#account-menu{min-width:var(--radix-dropdown-menu-trigger-width, 220px);padding:5px;border:1px solid var(--border-2);border-radius:9px;background:var(--bg-raise);box-shadow:0 10px 32px #00000059;display:flex;flex-direction:column;z-index:80;outline:none}#account-menu [role=menuitem]{outline:none}#account-menu [role=menuitem][data-highlighted]{background:var(--hover);color:var(--text)}#account-menu .menu-sec{padding:7px 9px 3px;font-size:10.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text-faint)}#account-menu [role=menuitem]{display:flex;align-items:center;gap:8px;padding:7px 9px;border:none;border-radius:6px;background:transparent;text-align:left;color:var(--text-dim);font:inherit;font-size:12.5px;cursor:pointer;text-decoration:none}#account-menu [role=menuitem]:hover{background:var(--hover);color:var(--text)}#account-menu [role=menuitem] b{font-weight:600}#account-menu [role=menuitem] .ico{width:15px;height:15px}#account-menu #signout{color:var(--del)}#account-menu #signout:hover{color:var(--del);background:var(--hover)}#main{flex:1;display:flex;flex-direction:column;min-width:0}#topbar{position:relative;display:flex;align-items:center;gap:9px;height:52px;padding:0 16px;border-bottom:1px solid var(--border)}.icon-btn{display:none;width:34px;height:34px;border:none;background:transparent;color:var(--text-dim);cursor:pointer;border-radius:7px;align-items:center;justify-content:center}.icon-btn:hover{color:var(--text);background:var(--hover)}#crumb{font-size:12.5px;color:var(--text);font-weight:500;letter-spacing:-.01em;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#crumb .crumb-seg{color:var(--text-dim);cursor:pointer}#crumb .crumb-seg:hover{color:var(--accent-bright)}#crumb .crumb-sep{color:var(--text-ghost);margin:0 5px}#meta{flex:1;min-width:0;font-size:12px;color:var(--text-faint);text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.btn{display:inline-flex;align-items:center;gap:6px;flex:none;height:30px;padding:0 11px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text-dim);font-size:12.5px;font-weight:500;cursor:pointer;text-decoration:none}.btn:hover{background:var(--hover);color:var(--text);border-color:var(--border-2)}.btn .ico{width:15px;height:15px}.btn.ghost{color:var(--text-dim)}.tipcard{display:flex;align-items:center;gap:7px;white-space:nowrap;padding:6px 9px;border-radius:8px;border:1px solid var(--border-2);background:var(--surface-solid, var(--bg-raise));color:var(--text);font-size:12.5px;font-weight:500;box-shadow:0 8px 24px #00000059;z-index:80}.tipcard kbd{font:11px var(--ui);color:var(--text-faint);background:var(--hover);border:1px solid var(--border-2);border-radius:5px;padding:1px 5px}#more-menu{position:absolute;right:12px;top:calc(100% - 4px);z-index:80;background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-card);box-shadow:0 18px 44px -14px #000000bf;padding:6px;min-width:168px}.more-item{display:block;width:100%;text-align:left;min-height:40px;padding:0 12px;background:transparent;border:none;cursor:pointer;color:var(--text);font:inherit;font-size:13.5px;border-radius:var(--r-ctl)}.more-item:hover{background:var(--hover)}#content{flex:1;overflow-y:auto;padding:44px 40px 110px;scroll-behavior:smooth}.page{width:100%;max-width:var(--page-app);margin-inline:auto;min-width:0}.page.read{max-width:var(--page-read)}.page.wide{max-width:var(--page-wide)}.empty{color:var(--text-faint);text-align:center;margin-top:var(--hero-top)}.empty-hint{display:block;margin-top:6px;font-size:12px;color:var(--text-faint)}.onboard{max-width:560px;margin:var(--hero-top) auto 0}.onboard h1{font-size:25px;font-weight:640;letter-spacing:-.02em;margin:0 0 8px;color:#f4f6f9}.onboard>p{color:var(--text-dim);margin:0 0 28px;font-size:14px}.ob-card{background:var(--bg-side);border:1px solid var(--border);border-radius:var(--r-card);padding:20px 22px;margin-bottom:14px}.ob-card h3{margin:0 0 6px;font-size:14.5px;font-weight:600}.ob-card p{margin:0 0 14px;font-size:13px;color:var(--text-dim)}.ob-row{display:flex;gap:9px}.ob-row input{flex:1;height:34px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:13px;outline:none}.ob-row input:focus{border-color:var(--accent);background:var(--hover)}.pbtn{display:inline-flex;align-items:center;gap:6px;flex:none;height:32px;padding:0 14px;border-radius:var(--r-ctl);border:none;background:var(--accent);color:#241704;font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap}.pbtn:hover{background:var(--accent-bright)}.pbtn .ico{width:15px;height:15px}.danger-btn{display:inline-flex;align-items:center;height:32px;padding:0 14px;border-radius:var(--r-ctl);border:none;background:#b3382e;color:#fff;font-size:13px;font-weight:600;cursor:pointer}.danger-btn:hover{background:#c94336}[data-slot=input],[data-slot=textarea]{font:inherit;color:var(--text)}[data-slot=input][aria-invalid=true]:focus-visible,[data-slot=textarea][aria-invalid=true]:focus-visible{border-color:var(--del)}[data-slot=card],[data-slot=dropdown-menu-content]{border-color:var(--border)}.project-settings{display:flex;flex-direction:column;gap:14px}.project-settings>h2{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.ps-form{display:flex;flex-direction:column;gap:18px}.ps-field{display:flex;flex-direction:column;gap:7px}.ps-field label{font-size:12.5px;color:var(--text-dim)}.ps-opt{color:var(--text-ghost);font-weight:400}.ps-icon-row{display:flex;align-items:center;gap:10px}.ps-icon-row .proj-mark{width:26px;height:26px;border-radius:7px}.ps-icon-row .proj-mark svg{width:15px;height:15px}.ps-meta{display:flex;align-items:baseline;justify-content:space-between;gap:12px}.ps-meta .field-err{flex:0 1 auto;margin:0}.ps-count{font-size:11.5px;color:var(--text-faint);font-variant-numeric:tabular-nums}.ps-actions{display:flex;justify-content:flex-end}.ps-icon-grid{display:grid;grid-template-columns:repeat(6,30px);gap:4px;padding:8px}.ps-icon-cell{display:grid;place-items:center;width:30px;height:30px;border-radius:7px;border:1px solid transparent;background:none;color:var(--text-dim);cursor:pointer}.ps-icon-cell svg{width:16px;height:16px}.ps-icon-cell:hover{background:var(--hover);color:var(--text)}.ps-icon-cell.active{border-color:var(--accent);color:var(--accent-bright)}.ps-danger [data-slot=card-title]{font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:#d2695e;font-weight:600}.ps-danger p{color:var(--text-dim);font-size:13px;margin:0 0 14px;max-width:52ch;line-height:1.55}.ps-facts{display:grid;grid-template-columns:auto 1fr;gap:8px 20px;margin:0;font-size:13px}.ps-facts dt{color:var(--text-faint)}.ps-facts dd{margin:0;color:var(--text-dim)}.admin h1{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 6px;color:#f4f6f9}.admin h3{font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint);font-weight:600;margin:30px 0 10px}.admin-lbl{flex:1 1 100%;margin:0 0 6px;font-size:12.5px;font-weight:600;color:var(--text-dim)}.admin-sub{color:var(--text-dim);font-size:13.5px;margin:-2px 0 16px;line-height:1.55}.admin-h{display:flex;align-items:center;justify-content:space-between;margin:30px 0 10px}.admin-h h3{margin:0}.admin-row{display:flex;gap:9px;margin-bottom:8px}.admin-row input{flex:1;height:34px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:13px;outline:none}.admin-row input:focus{border-color:var(--accent);background:var(--hover)}.admin-list{border:1px solid var(--border);border-radius:var(--r-card);overflow:hidden;background:var(--bg-side)}.admin-list.admin-card-table{overflow-x:auto;overflow-y:hidden}.admin-item{display:flex;align-items:center;gap:11px;padding:11px 14px;border-bottom:1px solid var(--border);font-size:13.5px}.modal-actions .ai-btn{height:32px}.empty a{color:var(--accent);text-decoration:none;display:inline-block;padding:6px 10px}.empty a:hover{text-decoration:underline}.empty h3{margin:0 0 8px;font-size:16px;color:var(--text)}.ai-copy{text-align:left;background:none;border:0;padding:6px 0;cursor:pointer}.ai-copy:hover{color:var(--text)}a.ai-main{color:var(--text-dim);text-decoration:none;padding:6px 0}a.ai-main:hover{color:var(--accent)}.th-sort{display:block;width:100%;text-align:left;background:none;border:0;padding:6px 10px;font:inherit;color:inherit;letter-spacing:inherit;text-transform:inherit;cursor:pointer}.th-sort:hover{color:var(--text-dim)}.proj-trigger>[data-slot=select-value]{display:block;flex:1 1 auto;min-width:0;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.role-cell{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;justify-items:start}.admin-table td .role-static{text-align:left}.role-chip-row{margin:-6px 0 12px}.role-chip{margin-left:0;padding:2px 8px;border:1px solid var(--border-2);border-radius:99px;vertical-align:middle}.ext{margin-left:4px;color:var(--text-faint);font-size:11px}.admin-item:last-child{border-bottom:none}.admin-item:hover{background:var(--hover)}.field-err{flex:1 1 100%;margin:6px 0 0}.admin-row{flex-wrap:wrap}.admin-row input[aria-invalid=true]{border-color:var(--del)}.ai-main{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}.admin-item>.ai-main{flex:1 1 55%;min-width:22ch}.admin-item>.ai-tag{flex:0 0 auto;min-width:0;max-width:45%}@media(max-width:1000px){.admin-item{flex-wrap:wrap}.admin-item>.ai-tag{flex:1 1 100%;max-width:100%}}.admin-table td .ai-main{min-width:0}.ai-main.mono{font:12px var(--mono);color:var(--text-dim);cursor:pointer}.ai-tag{font-size:11.5px;color:var(--text-faint);flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-item select{height:28px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:0 8px;font:inherit;font-size:12.5px;cursor:pointer}.admin-item select:hover{border-color:var(--border-2)}.ai-btn,.ai-del{flex:none;height:27px;padding:0 11px;border-radius:6px;border:1px solid var(--border);background:var(--surface);color:var(--text-dim);font:inherit;font-size:12px;font-weight:500;cursor:pointer}.ai-del{color:var(--del);border-color:#f26d6d47}.ai-del:hover{background:#f26d6d1f;border-color:var(--del);color:#ff8b8b}.ai-btn:hover{background:var(--hover);color:var(--text);border-color:var(--border-2)}.admin-empty{padding:14px;color:var(--text-faint);font-size:13px}.admin-item.toggle{cursor:pointer;align-items:flex-start}.admin-item.toggle .ai-main{white-space:normal}.tg-label{font-size:13.5px;font-weight:550;color:var(--text)}.tg-desc{font-size:12px;color:var(--text-faint);margin-top:3px;line-height:1.5}.admin-item.toggle input{margin-top:2px;flex:none}.dl-title{display:flex;align-items:center;gap:10px;font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.dl-title-icon{display:flex;color:var(--accent)}.dl-title-icon .ico{width:20px;height:20px}.dl-sub{color:var(--text-faint);font-size:12.5px;margin:0 0 18px}.dl-items{border:1px solid var(--border);border-radius:var(--r-card);overflow:hidden;background:var(--bg-side)}.dl-row{display:flex;align-items:center;gap:11px;padding:10px 14px;border-bottom:1px solid var(--border);cursor:pointer}.dl-row:last-child{border-bottom:none}.dl-row:hover{background:var(--hover)}.dl-row .ticon{flex:none;display:flex;color:var(--text-ghost)}.dl-row .ticon .ico{width:16px;height:16px}.dl-row:hover .ticon{color:var(--text-faint)}.dl-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13.5px;color:var(--text)}.dl-meta{flex:none;font-size:12px;color:var(--text-faint);font-variant-numeric:tabular-nums}.heatdot{flex:none;width:7px;height:7px;border-radius:50%;background:var(--accent)}.heatdot.lvl1{opacity:.3}.heatdot.lvl2{opacity:.55}.heatdot.lvl3{opacity:.8}.heatdot.lvl4{opacity:1;box-shadow:0 0 6px #f5a6238c}.dl-empty{padding:24px 14px;color:var(--text-faint);font-size:13px;border:1px dashed var(--border);border-radius:var(--r-card);text-align:center}.dl-h3{margin:28px 0 8px;font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint);font-weight:600}.dl-hlist{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);overflow:hidden;max-width:none}.dl-hlist .hentry:last-child{border-bottom:none}.hentry.clickable{cursor:pointer}.hentry.clickable:hover{background:var(--hover)}.dl-more{margin-top:10px}#vault-name.vault-link{cursor:pointer}#vault-name.vault-link:hover{color:var(--accent-bright)}.gd-tabs{display:flex;gap:2px;margin:20px 0 16px;border-bottom:1px solid var(--border);overflow-x:auto}.gd-tab{font:inherit;font-size:13px;font-weight:600;padding:7px 12px 9px;background:none;border:none;border-bottom:2px solid transparent;margin-bottom:-1px;color:var(--text-faint);cursor:pointer;white-space:nowrap}.gd-tab:hover{color:var(--text)}#account-btn.active{background:var(--glow)}#account-btn.active .acct b{color:var(--accent-bright)}.gd-tab.active{color:var(--accent-bright);border-bottom-color:var(--accent)}.gd-step{margin:0 0 18px}.gd-step-head{display:flex;align-items:center;gap:10px;margin-bottom:3px}.gd-num{flex:none;width:22px;height:22px;border-radius:50%;background:var(--glow);color:var(--accent-bright);font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center}.gd-step-title{font-weight:600;font-size:14px;color:var(--text)}.gd-desc{margin:2px 0 8px 32px;color:var(--text-faint);font-size:13px;line-height:1.5}.gd-extra{font-size:12.5px;margin-top:6px}.gd-code{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px;margin:6px 0 6px 32px;padding:10px 12px;background:var(--bg-raise);border:1px solid var(--border);border-radius:var(--r-card);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.6;color:var(--text)}.gd-code>code{display:block;min-width:0;overflow-x:auto;white-space:pre}.gd-copy{align-self:start;font:inherit;font-family:inherit;font-size:11px;font-weight:600;padding:3px 9px;border-radius:6px;border:1px solid var(--border-2);background:var(--bg-raise);color:var(--text-faint);cursor:pointer}.gd-copy:hover{color:var(--accent-bright);border-color:var(--accent-dim)}.gd-solo .gd-desc,.gd-solo .gd-code{margin-left:0}.gd-manual{margin:10px 0 0}.gd-manual>summary{display:inline-block;font-size:12.5px;font-weight:600;color:var(--text-faint);cursor:pointer;padding:4px 0}.gd-manual>summary:hover{color:var(--text)}.gd-manual .gd-desc,.gd-manual .gd-code{margin-left:0}.gd-done{margin:22px 0 8px;padding:12px 14px;border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);color:var(--text-faint);font-size:13px;line-height:1.5}.home-insights{margin-top:30px;padding-top:22px;border-top:1px solid var(--border)}.in-title{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.in-title .in-scope{color:var(--text-ghost);font-weight:500;font-size:15px}.gd-head{display:flex;align-items:center;gap:9px}.gd-head .proj-mark{width:22px;height:22px;border-radius:6px}.gd-head .proj-mark svg{width:13px;height:13px}.in-desc{color:var(--text-dim);font-size:13.5px;line-height:1.55;margin:0 0 10px;max-width:62ch}.in-lens{display:flex;gap:6px;margin:0 0 14px}.in-lens-btn{font:inherit;font-size:12px;padding:5px 12px;border-radius:999px;border:1px solid var(--border);background:none;color:var(--text-faint);cursor:pointer}.in-lens-btn:hover{color:var(--text)}.in-lens-btn.active{color:var(--accent);border-color:var(--accent)}.in-chart{width:100%;max-width:760px;height:auto;border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);margin-bottom:6px}.in-axis{stroke:var(--border);stroke-width:1}.in-threshold{stroke:var(--border);stroke-width:1;stroke-dasharray:4 4}.in-danger-zone{fill:#f26d6d0d}.in-label{fill:var(--text-ghost);font-size:11px}.in-quad{fill:var(--text-ghost);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em}.in-quad-danger{fill:#e07070}.in-pt{fill:var(--accent);opacity:.5;cursor:pointer}.in-pt:hover{opacity:1}.in-pt.cold{fill:var(--text-ghost);opacity:.25}.in-pt.danger{fill:#e05d5d;opacity:.6}.in-treemap{background:#0c0d10}.in-tm-group{fill:none;stroke:var(--border);stroke-width:1;cursor:pointer;pointer-events:all}.in-tm-glabel{fill:var(--text-faint);font-size:10px;text-transform:uppercase;letter-spacing:.05em;cursor:pointer}.in-tm-cell{cursor:pointer}.in-tm-cell:hover{stroke:#fff;stroke-width:1}.in-tm-label{fill:#0c0d10;font-size:10.5px;font-weight:620;cursor:pointer;pointer-events:none}.in-hotpath{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);overflow:hidden}.in-hp-row{display:flex;align-items:center;gap:10px;padding:6px 12px;border-bottom:1px solid var(--border);cursor:pointer}.in-hp-row:last-child{border-bottom:none}.in-hp-row:hover{background:var(--hover)}.in-hp-name{flex:0 0 300px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;color:var(--text)}.in-hp-name.danger{color:var(--accent)}.in-hp-bar{flex:1;display:flex;height:10px;border-radius:3px;overflow:hidden}.in-hp-agent{background:var(--accent)}.in-hp-human{background:#5b8def}.in-hp-count{flex:none;width:40px;text-align:right;font-size:11.5px;color:var(--text-faint);font-variant-numeric:tabular-nums}.in-legend{margin:8px 2px 0;font-size:11.5px;color:var(--text-faint)}.in-sw{display:inline-block;width:10px;height:10px;border-radius:2px;vertical-align:-1px}.in-sw.agent{background:var(--accent)}.in-sw.human{background:#5b8def}.in-matrix rect{transition:opacity .1s}.in-matrix rect:hover{opacity:.85}.hentry{padding:11px 12px;border-bottom:1px solid var(--border)}.hentry:hover{background:#ffffff04}.hline{display:flex;gap:10px;align-items:center}.hkind{display:inline-flex;color:var(--add)}.hkind .ico{width:13px;height:13px}.hentry.edit .hkind{color:var(--accent)}.hentry.delete .hkind{color:var(--del)}.htag{flex:none;font-size:10px;text-transform:uppercase;letter-spacing:.06em;font-weight:600;padding:1px 6px;border-radius:4px}.hentry.add .htag{color:var(--add);background:#4cc38a1f}.hentry.edit .htag{color:var(--accent-bright);background:var(--glow)}.hentry.delete .htag{color:#ff8b8b;background:#f26d6d1f}.hpath{font-weight:500;cursor:pointer;color:var(--text);font-size:13px}.hpath:hover{color:var(--accent-bright)}.htime{margin-left:auto;color:var(--text-faint);font-size:12px;font-variant-numeric:tabular-nums}.hmeta{display:flex;align-items:center;gap:14px;margin-top:4px;padding-left:23px;font-size:12px;color:var(--text-dim)}.hdev,.hsize{color:var(--text-faint)}.hsize{font-variant-numeric:tabular-nums;white-space:nowrap;flex:none}.hnote{margin-top:4px;padding-left:23px;font-size:12px;color:var(--text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.hnote:hover{color:var(--text)}.hnote.open{white-space:normal;overflow-wrap:anywhere}.hnote:before{content:"› ";color:var(--text-ghost)}.hnote a{color:var(--accent-bright);text-decoration:none}.hnote a:hover{text-decoration:underline}#palette{position:fixed;top:12vh;left:50%;transform:translate(-50%);z-index:151;display:block;width:min(560px,92vw);background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-over);box-shadow:0 24px 70px -18px #000c;overflow:hidden;outline:none;padding:0}#palette-inputwrap{display:flex;align-items:center;gap:11px;padding:14px 16px;border-bottom:1px solid var(--border)}#palette-inputwrap [data-slot=command-input-wrapper]{flex:1;display:flex;border-bottom:0;padding:0;height:auto}#palette-inputwrap [data-slot=command-input-wrapper]>svg:not(.ico){display:none}#palette input,#palette input:focus{border:none;background:transparent;box-shadow:none;outline:none;padding:0}#palette-inputwrap .ico{width:17px;height:17px;color:var(--text-faint)}#palette-input{flex:1;width:100%;border:none;background:transparent;color:var(--text);font:inherit;font-size:15px;letter-spacing:-.01em;outline:none;padding:0}#palette-input::placeholder{color:var(--text-ghost)}#palette-results{list-style:none;margin:0;padding:8px;max-height:46vh;overflow-y:auto}#palette-results [cmdk-item]{display:flex;align-items:center;gap:11px;height:38px;padding:0 10px;border-radius:9px;cursor:pointer;color:var(--text-dim);font-size:13.5px}#palette-results [cmdk-item][data-selected=true]{background:var(--glow)}#palette-results [cmdk-item][data-selected=true] .picon{color:var(--accent)}#palette-results [cmdk-item][data-selected=true] .plabel,#palette-results [cmdk-item][data-selected=true] .plabel b{color:var(--accent-bright)}#palette-results li{display:flex;align-items:center;gap:11px;height:38px;padding:0 10px;border-radius:9px;cursor:pointer;color:var(--text-dim);font-size:13.5px}#palette-results li.selected{background:var(--glow)}#palette-results li.selected .picon{color:var(--accent)}#palette-results li.selected .plabel,#palette-results li.selected .plabel b{color:var(--accent-bright)}#palette-results li .picon{width:18px;flex:none;display:flex;justify-content:center;color:var(--text-faint)}#palette-results li .picon .ico{width:15px;height:15px}#palette-results li .plabel{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text)}#palette-results li .plabel b{color:var(--accent-bright);font-weight:600}#palette-results li .pkind{flex:none;font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-ghost)}#palette-results .pempty{color:var(--text-faint);cursor:default;justify-content:center;height:auto;padding:14px}#palette-hint{padding:9px 16px;border-top:1px solid var(--border);font-size:11px;color:var(--text-ghost)}[data-slot=dialog-overlay]{position:fixed;inset:0;background:#06070999;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:150}.modal{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:151;display:block;background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-over);padding:22px 24px;width:min(460px,calc(100vw - 40px));box-shadow:0 24px 70px -18px #000c;outline:none}.modal h3{margin:0 0 10px;font-size:16px;font-weight:620;letter-spacing:-.01em}.modal p{margin:0 0 16px;font-size:13.5px;color:var(--text-dim);line-height:1.55}.modal p b{color:var(--text)}.modal-url{font:12px var(--mono);background:var(--surface);border:1px solid var(--border);border-radius:var(--r-ctl);padding:9px 11px;color:var(--text-dim);word-break:break-all;margin-bottom:16px}.modal-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.modal-label{display:block;font-size:12.5px;color:var(--text-dim);margin:0 0 6px}.modal-msg{margin:0 0 16px;font-size:13.5px;color:var(--text-dim);line-height:1.55}.modal-input{width:100%;height:36px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:14px;margin-bottom:16px;outline:none}.modal-input:focus{border-color:var(--accent);background:var(--hover)}[data-sonner-toast]{background:var(--bg-raise)!important;color:var(--text)!important;border:1px solid var(--border-2)!important;border-radius:10px!important;font-size:13.5px!important;box-shadow:0 18px 44px -12px #000000b3!important}[data-sonner-toast][data-type=error]{border-color:#f26d6d80!important;color:#ffb0aa!important}#sb-backdrop{display:none}@media(max-width:900px){#sidebar{position:fixed;z-index:60;top:0;left:0;height:100%;transform:translate(-100%);transition:transform .2s ease;box-shadow:0 0 40px #0009}body.sb-open #sidebar{transform:translate(0)}body.sb-open #sb-backdrop{display:block;position:fixed;inset:0;background:#0000008c;z-index:50}.icon-btn,#search-btn{display:inline-flex;width:44px;height:44px}#content{padding:24px 18px 70px}#topbar{padding:0 8px;gap:4px}.btn .lbl{display:none}#topbar .btn{min-width:44px;min-height:44px;padding:0;justify-content:center;gap:0}#topbar .btn .ico{width:18px;height:18px}#more-btn:not([hidden]){display:inline-flex}#history-btn,#upload-btn,#download{display:none!important}#meta{display:none}#crumb{flex:1}#vault{padding:0 8px 0 12px}.icon-btn2,#signout,#tree .row,#projects .row{height:44px}#account-btn,#project-select{min-height:44px}.nav-add{min-width:44px;min-height:44px}.markdown table,pre.plain{display:block;overflow-x:auto;max-width:100%}.ob-row{flex-direction:column}.ob-row input{flex:none;min-height:44px}.admin-item{flex-wrap:wrap;row-gap:8px;padding:12px 14px}.admin-item select{height:44px}.ai-btn,.ai-del{height:auto;min-height:44px;padding:0 12px}.admin-table thead{display:none}.admin-table,.admin-table tbody,.admin-table td{display:block;width:auto}.admin-table tr.admin-item{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.admin-table tr.admin-item td{padding:0;border-bottom:none}.admin-table tr.admin-item td:first-child{flex:1 1 100%;width:auto}.admin-table tr.admin-item td:last-child{width:auto;text-align:left}[data-slot=dropdown-menu-item]{min-height:44px}#projects{flex:0 1 auto;max-height:none}.admin-row{flex-wrap:wrap}.admin-row input{flex:1 1 100%;min-height:44px}.admin-row button{flex:0 0 auto;align-self:flex-start;min-height:44px}.admin-item .ai-main{flex:1 1 100%;white-space:normal;overflow-wrap:anywhere}.admin-table td{white-space:normal}.admin-table td .ai-main,.admin-table td a.ai-main,.admin-table td .ai-copy,.admin-table td .ai-tag{white-space:normal;overflow-wrap:anywhere}.admin-item .ai-tag{flex:1 1 100%;max-width:100%;white-space:normal;overflow-wrap:anywhere}.ai-copy{min-height:44px;display:block;padding:12px 0;white-space:normal;overflow-wrap:anywhere;text-overflow:clip}a.ai-main{min-height:44px;display:flex;align-items:center}.gd-code{min-height:62px;padding-top:12px;padding-bottom:12px}.gd-copy{min-height:44px;padding:0 14px}.gd-tab{min-height:44px}.in-lens-btn{min-height:44px;padding:0 14px}.modal-input{height:44px}.modal-actions button,.pbtn,#palette-results li{height:auto;min-height:44px}.more-item{min-height:44px}}.modal-actions .ai-del{margin-right:auto}@media(max-width:430px){.dl-meta{display:none}.ai-tag{font-size:11px}.htime{white-space:nowrap;font-size:12px}.hline{flex-wrap:wrap}.modal-actions .ai-del{flex:0 0 100%;justify-content:center;text-align:center}}.markdown h1,.markdown h2,.markdown h3,.markdown h4{color:#f4f6f9;line-height:1.25;letter-spacing:-.018em;margin:1.5em 0 .5em;text-wrap:balance}.markdown h1:first-child{margin-top:0}.markdown h1{font-size:1.85em;font-weight:660;letter-spacing:-.024em}.markdown h2{font-size:1.32em;font-weight:620;margin-top:1.7em}.markdown h3{font-size:1.08em;font-weight:620}.markdown p,.markdown li{color:#c6cbd3;font-size:14.5px;line-height:1.72}.markdown p{margin:0 0 1em}.markdown strong{color:var(--text);font-weight:620}.markdown a{color:var(--accent-bright);text-decoration:none;border-bottom:1px solid rgba(245,166,35,.28)}.markdown a:hover{border-bottom-color:var(--accent)}.markdown ul,.markdown ol{margin:0 0 1em;padding-left:1.4em}.markdown li{margin-bottom:.4em}.markdown li::marker{color:var(--text-ghost)}.markdown code{background:var(--hover);border:1px solid var(--border);padding:.1em .4em;border-radius:5px;font:12.5px/1.5 var(--mono);color:#e4d9c4}.markdown pre{background:var(--code-bg);border:1px solid var(--border);border-radius:var(--r-card);padding:14px 16px;overflow-x:auto;margin:1.3em 0}.markdown pre code{background:none;border:none;padding:0;color:#c6cbd3}.markdown blockquote{margin:1.3em 0;padding:.3em 1em;border-left:2px solid var(--accent);background:linear-gradient(90deg,var(--glow),transparent);border-radius:0 8px 8px 0;color:#d8cdb6}.markdown blockquote p{margin:.3em 0;color:#d8cdb6}.markdown table{border-collapse:collapse;margin:1.3em 0;font-size:13.5px}.markdown th,.markdown td{border-bottom:1px solid var(--border);padding:9px 13px;text-align:left}.markdown th{color:var(--text-faint);font-size:11px;text-transform:uppercase;letter-spacing:.05em;font-weight:600;border-bottom-color:var(--border-2)}.markdown tr:hover td{background:#ffffff05}.markdown img{max-width:100%;border-radius:8px;border:1px solid var(--border)}.markdown hr{border:none;border-top:1px solid var(--border);margin:2.2em 0}.markdown table.frontmatter{margin:0 0 1.8em;font-size:12px;background:var(--surface);border:1px solid var(--border);border-radius:8px;border-collapse:separate;border-spacing:0}.markdown table.frontmatter th{text-transform:none;letter-spacing:0;font-size:11.5px;color:var(--text-faint);font-weight:600;text-align:left;white-space:nowrap;vertical-align:top;padding:6px 14px 6px 12px;border-bottom:1px solid var(--border)}.markdown table.frontmatter td{color:var(--text-dim);padding:6px 12px 6px 0;border-bottom:1px solid var(--border)}.markdown table.frontmatter tr:last-child th,.markdown table.frontmatter tr:last-child td{border-bottom:none}.markdown table.frontmatter code{white-space:pre-wrap;font-size:11px}.markdown .admin input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.admin input[aria-invalid=true]:focus-visible{outline-color:var(--del)}[role=dialog] input[aria-invalid=true]{border-color:var(--del)}[role=dialog] input[aria-invalid=true]:focus-visible{outline-color:var(--del)}button:disabled,.btn:disabled{cursor:default}input[type=checkbox]{accent-color:var(--accent)}.htmlview{display:block;width:100%;height:calc(100vh - 150px);border:1px solid var(--border);border-radius:var(--r-card);background:#fff}.notfound{margin-top:var(--hero-top);text-align:center;color:var(--text-dim)}.notfound h1{color:var(--text);font-size:1.4em;margin-bottom:.5em}.notfound code{background:var(--hover);border:1px solid var(--border);padding:.15em .5em;border-radius:6px}.notfound .nf-sub{max-width:440px;margin:12px auto 20px;font-size:13px;color:var(--text-faint);line-height:1.6}pre.plain{background:var(--code-bg);border:1px solid var(--border);border-radius:var(--r-card);padding:14px 16px;overflow-x:auto;font:12.5px/1.6 var(--mono);color:#c6cbd3;white-space:pre-wrap;overflow-wrap:anywhere}.filecard{margin-top:var(--hero-top);text-align:center;color:var(--text-dim)}.filecard .name{font-size:1.2em;color:var(--text);margin-bottom:.3em}.filecard .btn{margin-top:14px}
diff --git a/internal/webapp/static/index.html b/internal/webapp/static/index.html
index ca7f816..9e506f0 100644
--- a/internal/webapp/static/index.html
+++ b/internal/webapp/static/index.html
@@ -5,8 +5,8 @@
BearDrive
-
-
+
+