@skybridge/devtools 0.0.0-dev.d683cdc → 0.0.0-dev.d695687
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,7 +9,7 @@ Error generating stack: `+e.message+`
|
|
|
9
9
|
`).replace(jd,``)}function Nd(e,t){return t=Md(t),Md(e)===t}function Pd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Rt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Rt(e,``+r);break;case`className`:St(e,`class`,r);break;case`tabIndex`:St(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:St(e,n,r);break;case`style`:Vt(e,r,o);break;case`data`:if(t!==`object`){St(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Gt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Pd(e,t,`name`,a.name,a,null),Pd(e,t,`formEncType`,a.formEncType,a,null),Pd(e,t,`formMethod`,a.formMethod,a,null),Pd(e,t,`formTarget`,a.formTarget,a,null)):(Pd(e,t,`encType`,a.encType,a,null),Pd(e,t,`method`,a.method,a,null),Pd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Gt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Kt);break;case`onScroll`:r!=null&&bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&bd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Gt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:bd(`beforetoggle`,e),bd(`toggle`,e),xt(e,`popover`,r);break;case`xlinkActuate`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:xt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Ut.get(n)||n,xt(e,n,r))}}function Fd(e,t,n,r,a,o){switch(n){case`style`:Vt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Rt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Rt(e,``+r);break;case`onScroll`:r!=null&&bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&bd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Kt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!mt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[et]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):xt(e,n,r)}}}function Id(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:bd(`error`,e),bd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Pd(e,t,o,s,n,null)}}a&&Pd(e,t,`srcSet`,n.srcSet,n,null),r&&Pd(e,t,`src`,n.src,n,null);return;case`input`:bd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Pd(e,t,r,d,n,null)}}Nt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in bd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Pd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ft(e,!!r,n,!0):Ft(e,!!r,t,!1);return;case`textarea`:for(s in bd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Pd(e,t,s,c,n,null)}Lt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Pd(e,t,l,r,n,null)}return;case`dialog`:bd(`beforetoggle`,e),bd(`toggle`,e),bd(`cancel`,e),bd(`close`,e);break;case`iframe`:case`object`:bd(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)bd(_d[r],e);break;case`image`:bd(`error`,e),bd(`load`,e);break;case`details`:bd(`toggle`,e);break;case`embed`:case`source`:case`link`:bd(`error`,e),bd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Pd(e,t,u,r,n,null)}return;default:if(Ht(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Fd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Pd(e,t,c,r,n,null))}function Ld(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Pd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Pd(e,t,p,m,r,f)}}Mt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Pd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Pd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ft(e,!!n,n?[]:``,!1):Ft(e,!!n,t,!0)):Ft(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Pd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Pd(e,t,s,a,r,o)}It(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Pd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Pd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Pd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Pd(e,t,u,p,r,m)}return;default:if(Ht(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Fd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Fd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Pd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Pd(e,t,f,p,r,m)}function Rd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function zd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Rd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Rd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Bd=null,Vd=null;function Hd(e){return e.nodeType===9?e:e.ownerDocument}function Ud(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Wd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Gd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Kd=null;function qd(){var e=window.event;return e&&e.type===`popstate`?e===Kd?!1:(Kd=e,!0):(Kd=null,!1)}var Jd=typeof setTimeout==`function`?setTimeout:void 0,Yd=typeof clearTimeout==`function`?clearTimeout:void 0,Xd=typeof Promise==`function`?Promise:void 0,Zd=typeof queueMicrotask==`function`?queueMicrotask:Xd===void 0?Jd:function(e){return Xd.resolve(null).then(e).catch(Qd)};function Qd(e){setTimeout(function(){throw e})}function $d(e){return e===`head`}function ef(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Fp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)hf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,hf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ot]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&hf(e.ownerDocument.body);n=i}while(n);Fp(t)}function tf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function nf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nf(n),st(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ot])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=uf(e.nextSibling),e===null)break}return null}function af(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=uf(e.nextSibling),e===null))return null;return e}function of(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=uf(e.nextSibling),e===null))return null;return e}function sf(e){return e.data===`$?`||e.data===`$~`}function cf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function uf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var df=null;function ff(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return uf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function mf(e,t,n){switch(t=Hd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function hf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);st(e)}var gf=new Map,_f=new Set;function vf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var yf=L.d;L.d={f:bf,r:xf,D:wf,C:Tf,L:Ef,m:Df,X:kf,S:Of,M:Af};function bf(){var e=yf.f(),t=Su();return e||t}function xf(e){var t=lt(e);t!==null&&t.tag===5&&t.type===`form`?Ss(t):yf.r(e)}var Sf=typeof document>`u`?null:document;function Cf(e,t,n){var r=Sf;if(r&&typeof t==`string`&&t){var i=jt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),_f.has(i)||(_f.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Id(t,`link`,e),ft(t),r.head.appendChild(t)))}}function wf(e){yf.D(e),Cf(`dns-prefetch`,e,null)}function Tf(e,t){yf.C(e,t),Cf(`preconnect`,e,t)}function Ef(e,t,n){yf.L(e,t,n);var r=Sf;if(r&&e&&t){var i=`link[rel="preload"][as="`+jt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+jt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+jt(n.imageSizes)+`"]`)):i+=`[href="`+jt(e)+`"]`;var a=i;switch(t){case`style`:a=Mf(e);break;case`script`:a=If(e)}gf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),gf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Nf(a))||t===`script`&&r.querySelector(Lf(a))||(t=r.createElement(`link`),Id(t,`link`,e),ft(t),r.head.appendChild(t)))}}function Df(e,t){yf.m(e,t);var n=Sf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+jt(r)+`"][href="`+jt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=If(e)}if(!gf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),gf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Lf(a)))return}r=n.createElement(`link`),Id(r,`link`,e),ft(r),n.head.appendChild(r)}}}function Of(e,t,n){yf.S(e,t,n);var r=Sf;if(r&&e){var i=dt(r).hoistableStyles,a=Mf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Nf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=gf.get(a))&&Bf(e,n);var c=o=r.createElement(`link`);ft(c),Id(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function kf(e,t){yf.X(e,t);var n=Sf;if(n&&e){var r=dt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=f({src:e,async:!0},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),ft(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t){yf.M(e,t);var n=Sf;if(n&&e){var r=dt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),ft(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t,n,r){var a=(a=te.current)?vf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Mf(n.href),n=dt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Mf(n.href);var o=dt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Nf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),gf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},gf.set(e,n),o||Ff(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=If(n),n=dt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Mf(e){return`href="`+jt(e)+`"`}function Nf(e){return`link[rel="stylesheet"][`+e+`]`}function Pf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Ff(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Id(t,`link`,n),ft(t),e.head.appendChild(t))}function If(e){return`[src="`+jt(e)+`"]`}function Lf(e){return`script[async]`+e}function Rf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+jt(n.href)+`"]`);if(r)return t.instance=r,ft(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ft(r),Id(r,`style`,a),zf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Mf(n.href);var o=e.querySelector(Nf(a));if(o)return t.state.loading|=4,t.instance=o,ft(o),o;r=Pf(n),(a=gf.get(a))&&Bf(r,a),o=(e.ownerDocument||e).createElement(`link`),ft(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Id(o,`link`,r),t.state.loading|=4,zf(o,n.precedence,e),t.instance=o;case`script`:return o=If(n.src),(a=e.querySelector(Lf(o)))?(t.instance=a,ft(a),a):(r=n,(a=gf.get(o))&&(r=f({},n),Vf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ft(a),Id(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,zf(r,n.precedence,e));return t.instance}function zf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Hf=null;function Uf(e,t,n){if(Hf===null){var r=new Map,i=Hf=new Map;i.set(n,r)}else i=Hf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ot]||a[$e]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Wf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Gf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Kf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function qf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Mf(r.href),a=t.querySelector(Nf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ft(a);return}a=t.ownerDocument||t,r=Pf(r),(i=gf.get(i))&&Bf(r,i),a=a.createElement(`link`),ft(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Id(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Xf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ep={$$typeof:C,Provider:null,Consumer:null,_currentValue:R,_currentValue2:R,_threadCount:0};function tp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=He(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=He(0),this.hiddenUpdates=He(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ei(3,null,null,t),e.current=a,a.stateNode=e,t=ea(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Na(a),e}function rp(e){return e?(e=Qr,e):Qr}function ip(e,t,n,r,i,a){i=rp(i),r.context===null?r.context=i:r.pendingContext=i,r=Fa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ia(e,r,t),n!==null&&(_u(n,e,t),La(n,e,t))}function ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){ap(e,t),(e=e.alternate)&&ap(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=Yr(e,67108864);t!==null&&_u(t,e,67108864),op(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=hu();t=Je(t);var n=Yr(e,t);n!==null&&_u(n,e,t),op(e,t)}}var lp=!0;function up(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,fp(e,t,n,r)}finally{L.p=a,I.T=i}}function dp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,fp(e,t,n,r)}finally{L.p=a,I.T=i}}function fp(e,t,n,r){if(lp){var i=pp(r);if(i===null)Td(e,t,r,mp,n),Tp(e,r);else if(Dp(i,e,t,n,r))r.stopPropagation();else if(Tp(e,r),t&4&&-1<wp.indexOf(e)){for(;i!==null;){var a=lt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Re(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-je(o);s.entanglements[1]|=c,o&=~c}rd(a),!(Ll&6)&&(iu=ye()+500,id(0,!1))}}break;case 31:case 13:s=Yr(a,2),s!==null&&_u(s,a,2),Su(),op(a,2)}if(a=pp(r),a===null&&Td(e,t,r,mp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Td(e,t,r,null,n)}}function pp(e){return e=Jt(e),hp(e)}var mp=null;function hp(e){if(mp=null,e=ct(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return mp=e,null}function gp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(be()){case xe:return 2;case Se:return 8;case Ce:case we:return 32;case Te:return 268435456;default:return 32}default:return 32}}var _p=!1,vp=null,yp=null,bp=null,xp=new Map,Sp=new Map,Cp=[],wp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Tp(e,t){switch(e){case`focusin`:case`focusout`:vp=null;break;case`dragenter`:case`dragleave`:yp=null;break;case`mouseover`:case`mouseout`:bp=null;break;case`pointerover`:case`pointerout`:xp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Sp.delete(t.pointerId)}}function Ep(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=lt(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dp(e,t,n,r,i){switch(t){case`focusin`:return vp=Ep(vp,e,t,n,r,i),!0;case`dragenter`:return yp=Ep(yp,e,t,n,r,i),!0;case`mouseover`:return bp=Ep(bp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return xp.set(a,Ep(xp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Sp.set(a,Ep(Sp.get(a)||null,e,t,n,r,i)),!0}return!1}function Op(e){var t=ct(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Ze(e.priority,function(){cp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ze(e.priority,function(){cp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function kp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);qt=r,n.target.dispatchEvent(r),qt=null}else return t=lt(n),t!==null&&sp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){kp(e)&&n.delete(t)}function jp(){_p=!1,vp!==null&&kp(vp)&&(vp=null),yp!==null&&kp(yp)&&(yp=null),bp!==null&&kp(bp)&&(bp=null),xp.forEach(Ap),Sp.forEach(Ap)}function Mp(e,n){e.blockedOn===n&&(e.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jp)))}var Np=null;function Pp(e){Np!==e&&(Np=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Np===e&&(Np=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(hp(r||n)===null)continue;break}var a=lt(n);a!==null&&(e.splice(t,3),t-=3,bs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Fp(e){function t(t){return Mp(t,e)}vp!==null&&Mp(vp,e),yp!==null&&Mp(yp,e),bp!==null&&Mp(bp,e),xp.forEach(t),Sp.forEach(t);for(var n=0;n<Cp.length;n++){var r=Cp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cp.length&&(n=Cp[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&Cp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[et]||null;if(typeof a==`function`)o||Pp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[et]||null)s=o.formAction;else if(hp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Pp(n)}}}function Ip(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Lp(e){this._internalRoot=e}Rp.prototype.render=Lp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ip(n,hu(),e,t,null,null)},Rp.prototype.unmount=Lp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ip(e.current,2,null,e,null,null),Su(),t[tt]=null}};function Rp(e){this._internalRoot=e}Rp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cp.length&&t!==0&&t<Cp[n].priority;n++);Cp.splice(n,0,e),n===0&&Op(e)}};var zp=n.version;if(zp!==`19.2.4`)throw Error(i(527,zp,`19.2.4`));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Bp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vp.isDisabled&&Vp.supportsFiber)try{Oe=Vp.inject(Bp),ke=Vp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Us,s=Ws,c=Gs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=np(e,1,!1,null,null,n,r,null,o,s,c,Ip),e[tt]=t.current,Cd(e),new Lp(t)}})),y=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=v()})),b=u(p(),1),x=y(),S=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(){}},C=new class extends S{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}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(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},w={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},T=new class{#e=w;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function E(e){setTimeout(e,0)}var D=typeof window>`u`||`Deno`in globalThis;function O(){}function k(e,t){return typeof e==`function`?e(t):e}function A(e){return typeof e==`number`&&e>=0&&e!==1/0}function j(e,t){return Math.max(e+(t||0)-Date.now(),0)}function M(e,t){return typeof e==`function`?e(t):e}function N(e,t){return typeof e==`function`?e(t):e}function P(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==I(o,t.options))return!1}else if(!R(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function F(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(L(t.options.mutationKey)!==L(a))return!1}else if(!R(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function I(e,t){return(t?.queryKeyHashFn||L)(e)}function L(e){return JSON.stringify(e,(e,t)=>U(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function R(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>R(e[n],t[n])):!1}var z=Object.prototype.hasOwnProperty;function B(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=H(e)&&H(t);if(!r&&!(U(e)&&U(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:z.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=B(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function V(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function H(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function U(e){if(!ee(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ee(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ee(e){return Object.prototype.toString.call(e)===`[object Object]`}function W(e){return new Promise(t=>{T.setTimeout(t,e)})}function te(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:B(e,t)}function ne(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function re(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ie=Symbol();function ae(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ie?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function oe(e,t){return typeof e==`function`?e(...t):!!e}function se(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ce=(()=>{let e=()=>D;return{isServer(){return e()},setIsServer(t){e=t}}})();function le(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ue=E;function de(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ue,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var fe=de(),pe=new class extends S{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,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(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function me(e){return Math.min(1e3*2**e,3e4)}function he(e){return(e??`online`)===`online`?pe.isOnline():!0}var ge=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function _e(e){let t=!1,n=0,r,i=le(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new ge(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>C.isFocused()&&(e.networkMode===`always`||pe.isOnline())&&e.canRun(),u=()=>he(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(ce.isServer()?0:3),o=e.retryDelay??me,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),W(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var ve=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),A(this.gcTime)&&(this.#e=T.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ce.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(T.clearTimeout(this.#e),void 0)}},ye=class extends ve{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Se(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Se(this.options);e.data!==void 0&&(this.setState(xe(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=te(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(O).catch(O):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>N(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ie||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>M(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:!j(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=ae(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=_e({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ge&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ge){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...be(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...xe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),fe.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function be(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:he(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function xe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Se(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ce=class extends S{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=le(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Te(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ee(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ee(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=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 N(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!V(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&De(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||N(this.options.enabled,this.#t)!==N(t.enabled,this.#t)||M(this.options.staleTime,this.#t)!==M(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||N(this.options.enabled,this.#t)!==N(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ke(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(O)),t}#g(){this.#b();let e=M(this.options.staleTime,this.#t);if(ce.isServer()||this.#r.isStale||!A(e))return;let t=j(this.#r.dataUpdatedAt,e)+1;this.#d=T.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(ce.isServer()||N(this.options.enabled,this.#t)===!1||!A(this.#p)||this.#p===0)&&(this.#f=T.setInterval(()=>{(this.options.refetchIntervalInBackground||C.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(T.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(T.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Te(e,t),o=i&&De(e,n,t,r);(a||o)&&(l={...l,...be(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=te(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=te(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Oe(e,t),refetch:this.refetch,promise:this.#o,isEnabled:N(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=le())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!V(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){fe.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function we(e,t){return N(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function Te(e,t){return we(e,t)||e.state.data!==void 0&&Ee(e,t,t.refetchOnMount)}function Ee(e,t,n){if(N(t.enabled,e)!==!1&&M(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Oe(e,t)}return!1}function De(e,t,n,r){return(e!==t||N(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Oe(e,n)}function Oe(e,t){return N(t.enabled,e)!==!1&&e.isStaleByTime(M(t.staleTime,e))}function ke(e,t){return!V(e.getCurrentResult(),t)}function Ae(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{se(e,()=>t.signal,()=>n=!0)},u=ae(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?re:ne;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Me:je,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:je(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function je(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Me(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ne=class extends ve{#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||Pe(),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(t=>t!==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){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=_e({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,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{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),fe.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Pe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Fe=class extends S{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Ne({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Ie(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Ie(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Ie(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Ie(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){fe.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){let t={exact:!0,...e};return this.getAll().find(e=>F(t,e))}findAll(e={}){return this.getAll().filter(t=>F(e,t))}notify(e){fe.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return fe.batch(()=>Promise.all(e.map(e=>e.continue().catch(O))))}};function Ie(e){return e.options.scope?.id}var Le=class extends S{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),V(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&L(t.mutationKey)!==L(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Pe();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){fe.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Re=class extends S{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??I(r,t),a=this.get(i);return a||(a=new ye({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){fe.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>P(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>P(e,t)):t}notify(e){fe.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){fe.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){fe.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ze=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Re,this.#t=e.mutationCache||new Fe,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=C.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=pe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(M(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=k(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return fe.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;fe.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return fe.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=fe.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(O).catch(O)}invalidateQueries(e,t={}){return fe.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=fe.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(O)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(O)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(M(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(O).catch(O)}fetchInfiniteQuery(e){return e.behavior=Ae(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(O).catch(O)}ensureInfiniteQueryData(e){return e.behavior=Ae(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return pe.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,t){this.#r.set(L(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{R(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(L(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{R(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=I(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===ie&&(t.enabled=!1),t}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()}},Be=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),G=s(((e,t)=>{t.exports=Be()}))(),Ve=b.createContext(void 0),He=e=>{let t=b.useContext(Ve);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ue=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,G.jsx)(Ve.Provider,{value:e,children:t})),We=b.createContext(!1),Ge=()=>b.useContext(We);We.Provider;function Ke(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var qe=b.createContext(Ke()),Je=()=>b.useContext(qe),Ye=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?oe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Xe=e=>{b.useEffect(()=>{e.clearReset()},[e])},Ze=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||oe(n,[e.error,r])),Qe=(e,t)=>t.state.data===void 0,$e=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},et=(e,t)=>e.isLoading&&e.isFetching&&!t,tt=(e,t)=>e?.suspense&&t.isPending,nt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function rt(e,t,n){let r=Ge(),i=Je(),a=He(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,$e(o),Ye(o,i,s),Xe(i);let c=!a.getQueryCache().get(o.queryHash),[l]=b.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(e=>{let t=d?l.subscribe(fe.batchCalls(e)):O;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setOptions(o)},[o,l]),tt(o,u))throw nt(o,l,i);if(Ze({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!ce.isServer()&&et(u,r)&&(c?nt(o,l,i):s?.promise)?.catch(O).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function it(e,t){return rt({...e,enabled:!0,suspense:!0,throwOnError:Qe,placeholderData:void 0},Ce,t)}function at(e,t){let n=He(t),[r]=b.useState(()=>new Le(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);let i=b.useSyncExternalStore(b.useCallback(e=>r.subscribe(fe.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=b.useCallback((e,t)=>{r.mutate(e,t).catch(O)},[r]);if(i.error&&oe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var ot=ut();function st(e,...t){if(!ot)return;let n=lt(e,...t);performance.mark(n);try{console.log(e,...t)}catch{console.log(n)}}function ct(e,...t){ot&&console.warn(e,...t)}function lt(e,...t){return e.replace(/%[sfdO]/g,e=>{let n=t.shift();return e===`%O`&&n?JSON.stringify(n).replace(/"([^"]+)":/g,`$1:`):String(n)})}function ut(){if(typeof window>`u`)return({}.DEBUG||``).includes(`nuqs`);try{let e=`nuqs-localStorage-test`;if(typeof localStorage>`u`)return!1;localStorage.setItem(e,e);let t=localStorage.getItem(e)===e;return localStorage.removeItem(e),t&&(localStorage.getItem(`debug`)||``).includes(`nuqs`)}catch{return!1}}var dt={303:`Multiple adapter contexts detected. This might happen in monorepos.`,404:`nuqs requires an adapter to work with your framework.`,409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:`Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.`,422:"Invalid options combination: `limitUrlUpdates: debounce` should be used in SSR scenarios, with `shallow: false`",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:`Empty search params cache. Search params can't be accessed in Layouts.`,501:"Search params cache already populated. Have you called `parse` twice?"};function ft(e){return`[nuqs] ${dt[e]}
|
|
10
10
|
See https://nuqs.dev/NUQS-${e}`}function pt(e){if(e.size===0)return``;let t=[];for(let[n,r]of e.entries()){let e=n.replace(/#/g,`%23`).replace(/&/g,`%26`).replace(/\+/g,`%2B`).replace(/=/g,`%3D`).replace(/\?/g,`%3F`);t.push(`${e}=${mt(r)}`)}return`?`+t.join(`&`)}function mt(e){return e.replace(/%/g,`%25`).replace(/\+/g,`%2B`).replace(/ /g,`+`).replace(/#/g,`%23`).replace(/&/g,`%26`).replace(/"/g,`%22`).replace(/'/g,`%27`).replace(/`/g,`%60`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/[\x00-\x1F]/g,e=>encodeURIComponent(e))}var ht=(0,b.createContext)({useAdapter(){throw Error(ft(404))}});ht.displayName=`NuqsAdapterContext`,ot&&typeof window<`u`&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==ht&&console.error(ft(303)),window.__NuqsAdapterContext=ht);function gt(e){return({children:t,defaultOptions:n,processUrlSearchParams:r,...i})=>(0,b.createElement)(ht.Provider,{...i,value:{useAdapter:e,defaultOptions:n,processUrlSearchParams:r}},t)}function _t(e){let t=(0,b.useContext)(ht);if(!(`useAdapter`in t))throw Error(ft(404));return t.useAdapter(e)}var vt=()=>(0,b.useContext)(ht).defaultOptions,yt=()=>(0,b.useContext)(ht).processUrlSearchParams;function bt(){if(typeof window>`u`||!window.GestureEvent)return 50;try{let e=navigator.userAgent?.match(/version\/([\d\.]+) safari/i);return parseFloat(e[1])>=17?120:320}catch{return 320}}function xt(e){return{method:`throttle`,timeMs:e}}var St=xt(bt());function Ct(e){return e===null||Array.isArray(e)&&e.length===0}function wt(e,t,n){if(typeof e==`string`)n.set(t,e);else{n.delete(t);for(let r of e)n.append(t,r);n.has(t)||n.set(t,``)}return n}function Tt(){let e=new Map;return{on(t,n){let r=e.get(t)||[];return r.push(n),e.set(t,r),()=>this.off(t,n)},off(t,n){let r=e.get(t);r&&e.set(t,r.filter(e=>e!==n))},emit(t,n){e.get(t)?.forEach(e=>e(n))}}}function Et(e,t,n){function r(){e(),n.removeEventListener(`abort`,a)}let i=setTimeout(r,t);function a(){clearTimeout(i),n.removeEventListener(`abort`,a)}n.addEventListener(`abort`,a)}function Dt(){let e=Promise;if(Promise.hasOwnProperty(`withResolvers`))return Promise.withResolvers();let t=()=>{},n=()=>{};return{promise:new e((e,r)=>{t=e,n=r}),resolve:t,reject:n}}function Ot(e,t){let n=t;for(let t=e.length-1;t>=0;t--){let r=e[t];if(!r)continue;let i=n;n=()=>r(i)}n()}function kt(){return new URLSearchParams(location.search)}var At=class{updateMap=new Map;options={history:`replace`,scroll:!1,shallow:!0};timeMs=St.timeMs;transitions=new Set;resolvers=null;controller=null;lastFlushedAt=0;resetQueueOnNextPush=!1;push({key:e,query:t,options:n},r=St.timeMs){this.resetQueueOnNextPush&&=(this.reset(),!1),st(`[nuqs gtq] Enqueueing %s=%s %O`,e,t,n),this.updateMap.set(e,t),n.history===`push`&&(this.options.history=`push`),n.scroll&&(this.options.scroll=!0),n.shallow===!1&&(this.options.shallow=!1),n.startTransition&&this.transitions.add(n.startTransition),(!Number.isFinite(this.timeMs)||r>this.timeMs)&&(this.timeMs=r)}getQueuedQuery(e){return this.updateMap.get(e)}getPendingPromise({getSearchParamsSnapshot:e=kt}){return this.resolvers?.promise??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=kt,rateLimitFactor:t=1,...n},r){if(this.controller??=new AbortController,!Number.isFinite(this.timeMs))return st(`[nuqs gtq] Skipping flush due to throttleMs=Infinity`),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=Dt();let i=()=>{this.lastFlushedAt=performance.now();let[t,i]=this.applyPendingUpdates({...n,autoResetQueueOnUpdate:n.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},r);i===null?(this.resolvers.resolve(t),this.resetQueueOnNextPush=!0):this.resolvers.reject(t),this.resolvers=null};return Et(()=>{let e=performance.now()-this.lastFlushedAt,n=this.timeMs,r=t*Math.max(0,n-e);st(`[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)`,r,n,t),r===0?i():Et(i,r,this.controller.signal)},0,this.controller.signal),this.resolvers.promise}abort(){return this.controller?.abort(),this.controller=new AbortController,this.resolvers?.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){let e=Array.from(this.updateMap.keys());return st(`[nuqs gtq] Resetting queue %s`,JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:`replace`,scroll:!1,shallow:!0},this.timeMs=St.timeMs,e}applyPendingUpdates(e,t){let{updateUrl:n,getSearchParamsSnapshot:r}=e,i=r();if(st(`[nuqs gtq] Applying %d pending update(s) on top of %s`,this.updateMap.size,i.toString()),this.updateMap.size===0)return[i,null];let a=Array.from(this.updateMap.entries()),o={...this.options},s=Array.from(this.transitions);e.autoResetQueueOnUpdate&&this.reset(),st(`[nuqs gtq] Flushing queue %O with options %O`,a,o);for(let[e,t]of a)t===null?i.delete(e):i=wt(t,e,i);t&&(i=t(i));try{return Ot(s,()=>{n(i,o)}),[i,null]}catch(e){return console.error(ft(429),a.map(([e])=>e).join(),e),[i,e]}}},jt=new At;function Mt(e,t,n){let r=(0,b.useCallback)(()=>{let t=Object.fromEntries(e.map(e=>[e,n(e)]));return[JSON.stringify(t),t]},[e.join(`,`),n]),i=(0,b.useRef)(null);return i.current===null&&(i.current=r()),(0,b.useSyncExternalStore)((0,b.useCallback)(n=>{let r=e.map(e=>t(e,n));return()=>r.forEach(e=>e())},[e.join(`,`),t]),()=>{let[e,t]=r();return i.current[0]===e?i.current[1]:(i.current=[e,t],t)},()=>i.current[1])}var Nt=class{callback;resolvers=Dt();controller=new AbortController;queuedValue=void 0;constructor(e){this.callback=e}abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,Et(()=>{let t=this.resolvers;try{st(`[nuqs dq] Flushing debounce queue`,e);let n=this.callback(e);st(`[nuqs dq] Reset debounce queue %O`,this.queuedValue),this.queuedValue=void 0,this.resolvers=Dt(),n.then(e=>t.resolve(e)).catch(e=>t.reject(e))}catch(e){this.queuedValue=void 0,t.reject(e)}},t,this.controller.signal),this.resolvers.promise}},Pt=new class{throttleQueue;queues=new Map;queuedQuerySync=Tt();constructor(e=new At){this.throttleQueue=e}useQueuedQueries(e){return Mt(e,(e,t)=>this.queuedQuerySync.on(e,t),e=>this.getQueuedQuery(e))}push(e,t,n,r){if(!Number.isFinite(t)){let e=n.getSearchParamsSnapshot??kt;return Promise.resolve(e())}let i=e.key;if(!this.queues.has(i)){st("[nuqs dqc] Creating debounce queue for `%s`",i);let e=new Nt(e=>(this.throttleQueue.push(e),this.throttleQueue.flush(n,r).finally(()=>{this.queues.get(e.key)?.queuedValue===void 0&&(st("[nuqs dqc] Cleaning up empty queue for `%s`",e.key),this.queues.delete(e.key)),this.queuedQuerySync.emit(e.key)})));this.queues.set(i,e)}st(`[nuqs dqc] Enqueueing debounce update %O`,e);let a=this.queues.get(i).push(e,t);return this.queuedQuerySync.emit(i),a}abort(e){let t=this.queues.get(e);return t?(st(`[nuqs dqc] Aborting debounce queue %s=%s`,e,t.queuedValue?.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),e=>(e.then(t.resolvers.resolve,t.resolvers.reject),e)):e=>e}abortAll(){for(let[e,t]of this.queues.entries())st(`[nuqs dqc] Aborting debounce queue %s=%s`,e,t.queuedValue?.query),t.abort(),t.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(e);this.queues.clear()}getQueuedQuery(e){let t=this.queues.get(e)?.queuedValue?.query;return t===void 0?this.throttleQueue.getQueuedQuery(e):t}}(jt);function Ft(e,t){return e===t?!0:e===null||t===null||typeof e==`string`||typeof t==`string`||e.length!==t.length?!1:e.every((e,n)=>e===t[n])}function It(e,t,n){return r=>{if(!(t.length===0||t.some(t=>!Ft(r.getAll(t),e.getAll(t)))))return st("[nuqs `%s`] no change, returning previous",t.join(`,`),r),r;let i=Lt(e,t,n);return st(`[nuqs \`%s\`] subbed search params change
|
|
11
11
|
from %O
|
|
12
|
-
to %O`,t.join(`,`),r,i),i}}function Lt(e,t,n){if(t.length===0)return e;let r=n?new URLSearchParams(e):e;for(let n of e.keys())t.includes(n)||r.delete(n);return r}var Rt=`__nuqs__`,zt=Tt();function Bt(e){return function(t,n){let r=new URL(location.href);r.search=pt(t),st(`[nuqs react] Updating url: %s`,r),e&&n.shallow===!1?(n.history===`push`?location.assign:location.replace).call(location,r):(n.history===`push`?history.pushState:history.replaceState).call(history,history.state,Rt,r),zt.emit(`update`,t),n.scroll===!0&&window.scrollTo({top:0})}}var Vt=(0,b.createContext)({fullPageNavigationOnShallowFalseUpdates:!1});function Ht(e){let{fullPageNavigationOnShallowFalseUpdates:t}=(0,b.useContext)(Vt),[n,r]=(0,b.useState)(()=>typeof location>`u`?new URLSearchParams:Lt(new URLSearchParams(location.search),e,!1));return(0,b.useEffect)(()=>{let t=()=>{r(It(new URLSearchParams(location.search),e,!1))},n=t=>{r(It(t,e,!0))};return zt.on(`update`,n),window.addEventListener(`popstate`,t),()=>{zt.off(`update`,n),window.removeEventListener(`popstate`,t)}},[e.join(`&`)]),{searchParams:n,updateUrl:(0,b.useMemo)(()=>Bt(t),[t])}}var Ut=gt(Ht);function Wt({children:e,fullPageNavigationOnShallowFalseUpdates:t=!1,...n}){return(0,b.createElement)(Vt.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:t}},(0,b.createElement)(Ut,{...n,children:e}))}var Gt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Kt=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),qt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Jt=e=>{let t=qt(e);return t.charAt(0).toUpperCase()+t.slice(1)},Yt={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`},Xt=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Zt=(0,b.createContext)({}),Qt=()=>(0,b.useContext)(Zt),$t=(0,b.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Qt()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,b.createElement)(`svg`,{ref:c,...Yt,width:t??l??Yt.width,height:t??l??Yt.height,stroke:e??f,strokeWidth:m,className:Gt(`lucide`,p,i),...!a&&!Xt(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,b.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),en=(e,t)=>{let n=(0,b.forwardRef)(({className:n,...r},i)=>(0,b.createElement)($t,{ref:i,iconNode:t,className:Gt(`lucide-${Kt(Jt(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Jt(e),n},tn=en(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),nn=en(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),rn=en(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),an=en(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),on=en(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),K=en(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),sn=en(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),cn=en(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ln=en(`log-out`,[[`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`}]]),un=en(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),dn=en(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),fn=en(`plug-zap`,[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]]),pn=en(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),mn=en(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),hn=en(`trash`,[[`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`}]]),gn=en(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function _n(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function vn(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function yn(e){return e/100*window.innerHeight}function bn(e){return e/100*window.innerWidth}function xn(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Sn({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=xn(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=vn(t,i);break;case`em`:r=_n(t,i);break;case`vh`:r=yn(i);break;case`vw`:r=bn(i);break}return r}function Cn(e){return parseFloat(e.toFixed(3))}function wn({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function Tn(e){let{panels:t}=e,n=wn({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=Cn(Sn({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=Cn(Sn({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=Cn(Sn({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=Cn(Sn({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function En(e,t=`Assertion error`){if(!e)throw Error(t)}function Dn(e,t){return Array.from(t).sort(e===`horizontal`?On:kn)}function On(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function kn(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function An(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function jn(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function Mn({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=jn(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return En(i,`No rect found`),i}var Nn;function Pn(){return Nn===void 0&&(Nn=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),Nn}function Fn(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=Dn(n,Array.from(t.children).filter(An).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,Mn({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=Pn()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:wn({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var In=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},Ln=new Map,Rn=new In;function zn(e){Ln=new Map(Ln),Ln.delete(e)}function Bn(e,t){for(let[t]of Ln)if(t.id===e)return t}function Vn(e,t){for(let[t,n]of Ln)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Hn(){return Ln}function Un(e,t){return Rn.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function Wn(e,t){let n=Ln.get(e);Ln=new Map(Ln),Ln.set(e,t),Rn.emit(`groupChange`,{group:e,prev:n,next:t})}function Gn(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=jn(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function Kn(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function qn(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:$n(e),b:$n(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();En(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:Qn(Zn(n.a)),b:Qn(Zn(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var Jn=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Yn(e){let t=getComputedStyle(er(e)??e).display;return t===`flex`||t===`inline-flex`}function Xn(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Yn(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||Jn.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function Zn(e){let t=e.length;for(;t--;){let n=e[t];if(En(n,`Missing node`),Xn(n))return n}return null}function Qn(e){return e&&Number(getComputedStyle(e).zIndex)||0}function $n(e){let t=[];for(;e;)t.push(e),e=er(e);return t}function er(e){let{parentNode:t}=e;return Kn(t)?t.host:t}function tr(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function nr({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!An(n)||n.contains(e)||e.contains(n))return!0;if(qn(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(tr(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function rr(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=Fn(r),a=Gn(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&nr({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function ir(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function ar(e,t,n=0){return Math.abs(Cn(e)-Cn(t))<=n}function or(e,t){return ar(e,t)?0:e>t?1:-1}function sr({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(or(r,c)<0)if(a){let e=(i+c)/2;r=or(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=Cn(r),r}function cr({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(ar(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;En(u!=null,`Invalid first pivot index`),En(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];En(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(En(n!=null,`Previous layout not found for panel index ${t}`),ar(n,i)){let t=o-n;or(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];En(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(En(n!=null,`Previous layout not found for panel index ${t}`),ar(n,o)){let t=n-i;or(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];En(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&or(i,c)<0)if(e>0){let t=c-o,n=t/2;or(i+e,c)<0&&(e=or(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;or(i-e,c)<0&&(e=or(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];En(e!=null,`Previous layout not found for panel index ${r}`);let a=sr({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];En(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=sr({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!ar(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(ir(c,l))return i;{let t=e<0?d:u,r=s[t];En(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=sr({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!ar(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];En(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=sr({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(ar(i,s)||(t-=s-i,l[r]=s),ar(t,0))break;e>0?r--:r++}}}if(!ar(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function lr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||or(e[n],t[n])!==0)return!1;return!0}function ur({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!ar(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];En(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];En(i!=null,`No layout data found for index ${e}`);let o=r[e];En(o!=null,`No layout data found for index ${e}`);let s=sr({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!ar(a,0))for(let e=0;e<t.length;e++){let n=r[e];En(n!=null,`No layout data found for index ${e}`);let i=n+a,o=sr({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,ar(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function dr({groupId:e,panelId:t}){let n=()=>{let t=Hn();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,groupSize:c,layout:l,separatorToPanels:u}=n(),d=s.panels.findIndex(e=>e.id===t),f=d===s.panels.length-1,p=ur({layout:cr({delta:f?r-e:e-r,initialLayout:l,panelConstraints:o,pivotIndices:f?[d-1,d]:[d,d+1],prevLayout:l,trigger:`imperative-api`}),panelConstraints:o});lr(l,p)||Wn(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,groupSize:c,layout:p,separatorToPanels:u})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&ar(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=wn({group:t});o(Cn(Sn({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function fr(e){e.defaultPrevented||rr(e,Hn()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=dr({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function pr(e){let t=Hn();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function mr({groupId:e}){let t=()=>{let t=Hn();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=ur({layout:e,panelConstraints:r});return n?o:(lr(o,c)||Wn(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function hr(e,t){let n=pr(e),r=Vn(n.id,!0),i=n.separators.find(t=>t.element===e);En(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);En(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=mr({groupId:n.id}).getLayout(),c=ur({layout:cr({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});lr(s,c)||Wn(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function gr(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=pr(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&hr(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&hr(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&hr(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&hr(t,-5);break;case`End`:e.preventDefault(),hr(t,100);break;case`Enter`:{e.preventDefault();let n=pr(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=Vn(n.id,!0),o=n.separators.find(e=>e.element===t);En(o,`Matching separator not found`);let s=a.get(o);En(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(En(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];hr(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=pr(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);En(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),hr(t,-100);break}}var _r={cursorFlags:0,state:`inactive`},vr=new In;function yr(){return _r}function br(e){return vr.addListener(`change`,e)}function xr(e){let t=_r,n={..._r};n.cursorFlags=e,_r=n,vr.emit(`change`,{prev:t,next:n})}function Sr(e){let t=_r;_r=e,vr.emit(`change`,{prev:t,next:e})}function Cr(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=Hn(),n=rr(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),Sr({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var wr=e=>e,Tr=()=>{},Er=1,Dr=2,Or=4,kr=8,Ar=3,jr=12,Mr;function Nr(){return Mr===void 0&&(Mr=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(Mr=!0)),Mr}function Pr({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&Nr()){let t=(e&Er)!==0,n=(e&Dr)!==0,r=(e&Or)!==0,i=(e&kr)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return Nr()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var Fr=new WeakMap;function Ir(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=Fr.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));let r=yr();switch(r.state){case`active`:case`hover`:{let e=Pr({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}Fr.set(e,{prevStyle:t,styleSheet:n})}function Lr({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=cr({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(lr(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?Er:Dr;break;case`vertical`:s|=d<0?Or:kr;break}}else Wn(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&Ar:c|=s&Ar,t.movementY===0?c|=o&jr:c|=s&jr,xr(c),Ir(e)}function Rr(e){let t=Hn(),n=yr();switch(n.state){case`active`:Lr({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function zr(e){if(e.defaultPrevented)return;let t=yr(),n=Hn();switch(t.state){case`active`:if(e.buttons===0){Sr({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=Vn(e.group.id,!0);Wn(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}Lr({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=rr(e,n);r.length===0?t.state!==`inactive`&&Sr({cursorFlags:0,state:`inactive`}):Sr({cursorFlags:0,hitRegions:r,state:`hover`}),Ir(e.currentTarget);break}}}function Br(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(yr().state){case`hover`:Sr({cursorFlags:0,state:`inactive`})}}function Vr(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=yr();switch(t.state){case`active`:Sr({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(Ir(e.currentTarget),t.hitRegions.forEach(e=>{let t=Vn(e.group.id,!0);Wn(e.group,t)}),e.preventDefault())}}function Hr(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=Cn(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=Cn((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function Ur(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=wn({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:Cn(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Wr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Gr({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=Cn(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=Cn((r[e]??0)/a*l);else{let e=Cn(l/c.length);for(let t of c)u[t]=e}return u}function Kr(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var qr=new Map;function Jr(e){let t=!0;En(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=wn({group:e});if(t===0)return;let n=Vn(e.id);if(!n)return;let r=Tn(e),i=n.defaultLayoutDeferred?Hr(r):n.layout,a=ur({layout:Gr({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&lr(n.layout,a)&&Wr(n.derivedPanelConstraints,r)&&n.groupSize===t)return;Wn(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else Ur(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{En(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=wn({group:e}),s=Tn(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(Kr(e.panels,l)||(l=void 0));let u=ur({layout:e.mutableState.layouts[c]??l??Hr(s),panelConstraints:s}),d=e.element.ownerDocument;qr.set(d,(qr.get(d)??0)+1);let f=new Map;return Fn(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),Wn(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{En(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,gr)}),qr.get(d)===1&&(d.addEventListener(`dblclick`,fr,!0),d.addEventListener(`pointerdown`,Cr,!0),d.addEventListener(`pointerleave`,Rr),d.addEventListener(`pointermove`,zr),d.addEventListener(`pointerout`,Br),d.addEventListener(`pointerup`,Vr,!0)),function(){t=!1,qr.set(d,Math.max(0,(qr.get(d)??0)-1)),zn(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,gr)}),qr.get(d)||(d.removeEventListener(`dblclick`,fr,!0),d.removeEventListener(`pointerdown`,Cr,!0),d.removeEventListener(`pointerleave`,Rr),d.removeEventListener(`pointermove`,zr),d.removeEventListener(`pointerout`,Br),d.removeEventListener(`pointerup`,Vr,!0)),a.disconnect()}}function Yr(){let[e,t]=(0,b.useState)({});return[e,(0,b.useCallback)(()=>t({}),[])]}function Xr(e){let t=(0,b.useId)();return`${e??t}`}var Zr=typeof window<`u`?b.useLayoutEffect:b.useEffect;function Qr(e){let t=(0,b.useRef)(e);return Zr(()=>{t.current=e},[e]),(0,b.useCallback)((...e)=>t.current?.(...e),[t])}function $r(...e){return Qr(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function ei(e){let t=(0,b.useRef)({...e});return Zr(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var ti=(0,b.createContext)(null);function ni(e,t){let n=(0,b.useRef)({getLayout:()=>({}),setLayout:wr});(0,b.useImperativeHandle)(t,()=>n.current,[]),Zr(()=>{Object.assign(n.current,mr({groupId:e}))})}function ri({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,b.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=Qr(e=>{lr(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=Qr(e=>{lr(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=Xr(s),v=(0,b.useRef)(null),[y,x]=Yr(),S=(0,b.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),C=$r(v,a);ni(_,o);let w=Qr((e,t)=>{let r=yr(),i=Bn(e),a=Vn(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),T=ei({defaultLayout:n,disableCursor:r}),E=(0,b.useMemo)(()=>({get disableCursor(){return!!T.disableCursor},getPanelStyles:w,id:_,orientation:u,registerPanel:e=>{let t=S.current;return t.panels=Dn(u,[...t.panels,e]),x(),()=>{t.panels=t.panels.filter(t=>t!==e),x()}},registerSeparator:e=>{let t=S.current;return t.separators=Dn(u,[...t.separators,e]),x(),()=>{t.separators=t.separators.filter(t=>t!==e),x()}},updatePanelProps:(e,{disabled:t})=>{let n=S.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=Bn(_),i=Vn(_);r&&i&&Wn(r,{...i,derivedPanelConstraints:Tn(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=S.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[w,_,x,u,T]),D=(0,b.useRef)(null);return Zr(()=>{let e=v.current;if(e===null)return;let t=S.current,n;if(T.defaultLayout!==void 0&&Object.keys(T.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=T.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!T.disableCursor,expandedPanelSizes:S.current.lastExpandedPanelSizes,layouts:S.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};D.current=r;let a=Jr(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=Vn(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=Un(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=ar(t.collapsedSize,i[t.panelId]),a=ar(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=yr().state!==`active`;h(i),o&&g(i)});return()=>{D.current=null,a(),l()}},[i,_,g,h,u,y,T]),(0,b.useEffect)(()=>{let e=D.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,G.jsx)(ti.Provider,{value:E,children:(0,G.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:C,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}ri.displayName=`Group`;function ii(e,t){return`react-resizable-panels:${[e,...t].join(`:`)}`}function ai({id:e,panelIds:t,storage:n}){let r=ii(e,[]),i=n.getItem(r);if(i)try{let e=JSON.parse(i);if(t){let n=e[t.join(`,`)];if(n&&Array.isArray(n.layout)&&t.length===n.layout.length){let e={};for(let r=0;r<t.length;r++)e[t[r]]=n.layout[r];return e}}else{let t=Object.keys(e);if(t.length===1){let n=e[t[0]];if(n&&Array.isArray(n.layout)){let e=t[0].split(`,`);if(e.length===n.layout.length){let t={};for(let r=0;r<e.length;r++)t[e[r]]=n.layout[r];return t}}}}}catch{}}function oi({debounceSaveMs:e=100,panelIds:t,storage:n=localStorage,...r}){let i=t!==void 0,a=`id`in r?r.id:r.groupId,o=ii(a,t??[]),s=(0,b.useSyncExternalStore)(si,()=>n.getItem(o),()=>n.getItem(o)),c=(0,b.useMemo)(()=>{if(s){let e=JSON.parse(s),t=Object.values(e);if(Array.from(t).every(e=>typeof e==`number`))return e}},[s]),l=(0,b.useMemo)(()=>{if(!c)return ai({id:a,panelIds:t,storage:n})},[c,a,t,n]),u=c??l,d=(0,b.useRef)(null),f=(0,b.useCallback)(()=>{let e=d.current;e&&(d.current=null,clearTimeout(e))},[]);(0,b.useLayoutEffect)(()=>()=>{f()},[f]);let p=(0,b.useCallback)(e=>{f();let t;t=i?ii(a,Object.keys(e)):ii(a,[]);try{n.setItem(t,JSON.stringify(e))}catch(e){console.error(e)}},[f,i,a,n]);return{defaultLayout:u,onLayoutChange:(0,b.useCallback)(t=>{f(),e===0?p(t):d.current=setTimeout(()=>{p(t)},e)},[f,e,p]),onLayoutChanged:p}}function si(){return function(){}}function ci(){let e=(0,b.useContext)(ti);return En(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function li(e,t){let{id:n}=ci(),r=(0,b.useRef)({collapse:Tr,expand:Tr,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Tr});(0,b.useImperativeHandle)(t,()=>r.current,[]),Zr(()=>{Object.assign(r.current,dr({groupId:n,panelId:e}))})}function ui({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=Xr(c),_=ei({disabled:a}),v=(0,b.useRef)(null),y=$r(v,o),{getPanelStyles:x,id:S,orientation:C,registerPanel:w,updatePanelProps:T}=ci(),E=d!==null,D=Qr((e,t,n)=>{d?.(e,c,n)});Zr(()=>{let e=v.current;if(e!==null)return w({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:E?D:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,E,g,h,l,u,D,w,_]),(0,b.useEffect)(()=>{T(g,{disabled:a})},[a,g,T]),li(g,f);let O=()=>{let e=x(S,g);if(e)return JSON.stringify(e)},k=(0,b.useSyncExternalStore)(e=>Un(S,e),O,O),A;return A=k?JSON.parse(k):i?{flexGrow:void 0,flexShrink:void 0,flexBasis:i}:{flexGrow:1},(0,G.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...di,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...A},children:(0,G.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:C===`horizontal`?`pan-y`:`pan-x`},children:e})})}ui.displayName=`Panel`;var di={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function fi({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=ur({layout:cr({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=ur({layout:cr({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function pi({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=Xr(a),l=ei({disabled:n,disableDoubleClick:r}),[u,d]=(0,b.useState)({}),[f,p]=(0,b.useState)(`inactive`),m=(0,b.useRef)(null),h=$r(m,i),{disableCursor:g,id:_,orientation:v,registerSeparator:y,updateSeparatorProps:x}=ci(),S=v===`horizontal`?`vertical`:`horizontal`;Zr(()=>{let e=m.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=y(t),r=br(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=Un(_,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(fi({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[_,c,y,l]),(0,b.useEffect)(()=>{x(c,{disabled:n,disableDoubleClick:r})},[n,r,c,x]);let C;return n&&!g&&(C=`not-allowed`),(0,G.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":S,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":n?`disabled`:f,"data-testid":c,id:c,ref:h,role:`separator`,style:{flexBasis:`auto`,cursor:C,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}pi.displayName=`Separator`;var mi=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},hi=(e=>e?mi(e):mi),gi=e=>e;function _i(e,t=gi){let n=b.useSyncExternalStore(e.subscribe,b.useCallback(()=>t(e.getState()),[e,t]),b.useCallback(()=>t(e.getInitialState()),[e,t]));return b.useDebugValue(n),n}var vi=e=>{let t=hi(e),n=e=>_i(t,e);return Object.assign(n,t),n},yi=(e=>e?vi(e):vi),bi=yi()(e=>({status:`idle`,requiresAuth:!1,error:null,setStatus:t=>e({status:t}),setRequiresAuth:t=>e({requiresAuth:t}),setError:t=>e({error:t}),reset:()=>e({status:`idle`,requiresAuth:!1,error:null})})),xi=globalThis.crypto;async function Si(e){return(await xi).getRandomValues(new Uint8Array(e))}async function Ci(e){let t=``;for(;t.length<e;){let n=await Si(e-t.length);for(let e of n)e<198&&(t+=`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~`[e%66])}return t}async function wi(e){return await Ci(e)}async function Ti(e){let t=await(await xi).subtle.digest(`SHA-256`,new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,`_`).replace(/\+/g,`-`).replace(/=/g,``)}async function Ei(e){if(e||=43,e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await wi(e);return{code_verifier:t,code_challenge:await Ti(t)}}var Di=Object.freeze({status:`aborted`});function q(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var Oi=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ki=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},Ai={};function ji(e){return e&&Object.assign(Ai,e),Ai}function Mi(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Ni(e,t){return typeof t==`bigint`?t.toString():t}function Pi(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Fi(e){return e==null}function Ii(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Li(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var Ri=Symbol(`evaluating`);function zi(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ri)return r===void 0&&(r=Ri,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Bi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Vi(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Hi(e){return JSON.stringify(e)}function Ui(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Wi=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Gi(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ki=Pi(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function qi(e){if(Gi(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Gi(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Ji(e){return qi(e)?{...e}:Array.isArray(e)?[...e]:e}var Yi=new Set([`string`,`number`,`symbol`]);function Xi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Zi(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Qi(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function $i(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var ea={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ta(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Zi(e,Vi(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Bi(this,`shape`,e),e},checks:[]}))}function na(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Zi(e,Vi(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Bi(this,`shape`,r),r},checks:[]}))}function ra(e,t){if(!qi(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Zi(e,Vi(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Bi(this,`shape`,n),n}}))}function ia(e,t){if(!qi(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Zi(e,Vi(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Bi(this,`shape`,n),n}}))}function aa(e,t){return Zi(e,Vi(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Bi(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function oa(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Zi(t,Vi(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Bi(this,`shape`,i),i},checks:[]}))}function sa(e,t,n){return Zi(t,Vi(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Bi(this,`shape`,i),i}}))}function ca(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function la(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ua(e){return typeof e==`string`?e:e?.message}function da(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=ua(e.inst?._zod.def?.error?.(e))??ua(t?.error?.(e))??ua(n.customError?.(e))??ua(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function fa(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function pa(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var ma=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ni,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},ha=q(`$ZodError`,ma),ga=q(`$ZodError`,ma,{Parent:Error});function _a(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function va(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var ya=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Oi;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>da(e,a,ji())));throw Wi(t,i?.callee),t}return o.value},ba=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>da(e,a,ji())));throw Wi(t,i?.callee),t}return o.value},xa=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Oi;return a.issues.length?{success:!1,error:new(e??ha)(a.issues.map(e=>da(e,i,ji())))}:{success:!0,data:a.value}},Sa=xa(ga),Ca=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>da(e,i,ji())))}:{success:!0,data:a.value}},wa=Ca(ga),Ta=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ya(e)(t,n,i)},Ea=e=>(t,n,r)=>ya(e)(t,n,r),Da=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ba(e)(t,n,i)},Oa=e=>async(t,n,r)=>ba(e)(t,n,r),ka=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return xa(e)(t,n,i)},Aa=e=>(t,n,r)=>xa(e)(t,n,r),ja=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ca(e)(t,n,i)},Ma=e=>async(t,n,r)=>Ca(e)(t,n,r),Na=/^[cC][^\s-]{8,}$/,Pa=/^[0-9a-z]+$/,Fa=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ia=/^[0-9a-vA-V]{20}$/,La=/^[A-Za-z0-9]{27}$/,Ra=/^[a-zA-Z0-9_-]{21}$/,za=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ba=/^([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})$/,Va=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ha=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ua=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Wa(){return new RegExp(Ua,`u`)}var Ga=/^(?:(?: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])$/,Ka=/^(([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}|:))$/,qa=/^((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])$/,Ja=/^(([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])$/,Ya=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xa=/^[A-Za-z0-9_-]*$/,Za=/^\+[1-9]\d{6,14}$/,Qa=`(?:(?:\\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])))`,$a=RegExp(`^${Qa}$`);function eo(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function to(e){return RegExp(`^${eo(e)}$`)}function no(e){let t=eo({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Qa}T(?:${r})$`)}var ro=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},io=/^-?\d+$/,ao=/^-?\d+(?:\.\d+)?$/,oo=/^(?:true|false)$/i,so=/^null$/i,co=/^undefined$/i,lo=/^[^A-Z]*$/,uo=/^[^a-z]*$/,fo=q(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),po={number:`number`,bigint:`bigint`,object:`date`},mo=q(`$ZodCheckLessThan`,(e,t)=>{fo.init(e,t);let n=po[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ho=q(`$ZodCheckGreaterThan`,(e,t)=>{fo.init(e,t);let n=po[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),go=q(`$ZodCheckMultipleOf`,(e,t)=>{fo.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Li(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),_o=q(`$ZodCheckNumberFormat`,(e,t)=>{fo.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ea[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=io)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),vo=q(`$ZodCheckMaxLength`,(e,t)=>{var n;fo.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Fi(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=fa(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),yo=q(`$ZodCheckMinLength`,(e,t)=>{var n;fo.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Fi(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=fa(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),bo=q(`$ZodCheckLengthEquals`,(e,t)=>{var n;fo.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Fi(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=fa(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),xo=q(`$ZodCheckStringFormat`,(e,t)=>{var n,r;fo.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),So=q(`$ZodCheckRegex`,(e,t)=>{xo.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Co=q(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=lo,xo.init(e,t)}),wo=q(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=uo,xo.init(e,t)}),To=q(`$ZodCheckIncludes`,(e,t)=>{fo.init(e,t);let n=Xi(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Eo=q(`$ZodCheckStartsWith`,(e,t)=>{fo.init(e,t);let n=RegExp(`^${Xi(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Do=q(`$ZodCheckEndsWith`,(e,t)=>{fo.init(e,t);let n=RegExp(`.*${Xi(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Oo=q(`$ZodCheckOverwrite`,(e,t)=>{fo.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),ko=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
12
|
+
to %O`,t.join(`,`),r,i),i}}function Lt(e,t,n){if(t.length===0)return e;let r=n?new URLSearchParams(e):e;for(let n of e.keys())t.includes(n)||r.delete(n);return r}var Rt=`__nuqs__`,zt=Tt();function Bt(e){return function(t,n){let r=new URL(location.href);r.search=pt(t),st(`[nuqs react] Updating url: %s`,r),e&&n.shallow===!1?(n.history===`push`?location.assign:location.replace).call(location,r):(n.history===`push`?history.pushState:history.replaceState).call(history,history.state,Rt,r),zt.emit(`update`,t),n.scroll===!0&&window.scrollTo({top:0})}}var Vt=(0,b.createContext)({fullPageNavigationOnShallowFalseUpdates:!1});function Ht(e){let{fullPageNavigationOnShallowFalseUpdates:t}=(0,b.useContext)(Vt),[n,r]=(0,b.useState)(()=>typeof location>`u`?new URLSearchParams:Lt(new URLSearchParams(location.search),e,!1));return(0,b.useEffect)(()=>{let t=()=>{r(It(new URLSearchParams(location.search),e,!1))},n=t=>{r(It(t,e,!0))};return zt.on(`update`,n),window.addEventListener(`popstate`,t),()=>{zt.off(`update`,n),window.removeEventListener(`popstate`,t)}},[e.join(`&`)]),{searchParams:n,updateUrl:(0,b.useMemo)(()=>Bt(t),[t])}}var Ut=gt(Ht);function Wt({children:e,fullPageNavigationOnShallowFalseUpdates:t=!1,...n}){return(0,b.createElement)(Vt.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:t}},(0,b.createElement)(Ut,{...n,children:e}))}var Gt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Kt=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),qt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Jt=e=>{let t=qt(e);return t.charAt(0).toUpperCase()+t.slice(1)},Yt={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`},Xt=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Zt=(0,b.createContext)({}),Qt=()=>(0,b.useContext)(Zt),$t=(0,b.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Qt()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,b.createElement)(`svg`,{ref:c,...Yt,width:t??l??Yt.width,height:t??l??Yt.height,stroke:e??f,strokeWidth:m,className:Gt(`lucide`,p,i),...!a&&!Xt(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,b.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),en=(e,t)=>{let n=(0,b.forwardRef)(({className:n,...r},i)=>(0,b.createElement)($t,{ref:i,iconNode:t,className:Gt(`lucide-${Kt(Jt(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Jt(e),n},tn=en(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),nn=en(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),rn=en(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),an=en(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),on=en(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),K=en(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),sn=en(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),cn=en(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ln=en(`log-out`,[[`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`}]]),un=en(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),dn=en(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),fn=en(`plug-zap`,[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]]),pn=en(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),mn=en(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),hn=en(`trash`,[[`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`}]]),gn=en(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function _n(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function vn(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function yn(e){return e/100*window.innerHeight}function bn(e){return e/100*window.innerWidth}function xn(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Sn({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=xn(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=vn(t,i);break;case`em`:r=_n(t,i);break;case`vh`:r=yn(i);break;case`vw`:r=bn(i);break}return r}function Cn(e){return parseFloat(e.toFixed(3))}function wn({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function Tn(e){let{panels:t}=e,n=wn({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=Cn(Sn({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=Cn(Sn({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=Cn(Sn({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=Cn(Sn({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function En(e,t=`Assertion error`){if(!e)throw Error(t)}function Dn(e,t){return Array.from(t).sort(e===`horizontal`?On:kn)}function On(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function kn(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function An(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function jn(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function Mn({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=jn(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return En(i,`No rect found`),i}var Nn;function Pn(){return Nn===void 0&&(Nn=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),Nn}function Fn(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=Dn(n,Array.from(t.children).filter(An).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,Mn({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=Pn()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:wn({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var In=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},Ln=new Map,Rn=new In;function zn(e){Ln=new Map(Ln),Ln.delete(e)}function Bn(e,t){for(let[t]of Ln)if(t.id===e)return t}function Vn(e,t){for(let[t,n]of Ln)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Hn(){return Ln}function Un(e,t){return Rn.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function Wn(e,t){let n=Ln.get(e);Ln=new Map(Ln),Ln.set(e,t),Rn.emit(`groupChange`,{group:e,prev:n,next:t})}function Gn(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=jn(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function Kn(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function qn(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:$n(e),b:$n(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();En(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:Qn(Zn(n.a)),b:Qn(Zn(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var Jn=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Yn(e){let t=getComputedStyle(er(e)??e).display;return t===`flex`||t===`inline-flex`}function Xn(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Yn(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||Jn.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function Zn(e){let t=e.length;for(;t--;){let n=e[t];if(En(n,`Missing node`),Xn(n))return n}return null}function Qn(e){return e&&Number(getComputedStyle(e).zIndex)||0}function $n(e){let t=[];for(;e;)t.push(e),e=er(e);return t}function er(e){let{parentNode:t}=e;return Kn(t)?t.host:t}function tr(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function nr({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!An(n)||n.contains(e)||e.contains(n))return!0;if(qn(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(tr(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function rr(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=Fn(r),a=Gn(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&nr({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function ir(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function ar(e,t,n=0){return Math.abs(Cn(e)-Cn(t))<=n}function or(e,t){return ar(e,t)?0:e>t?1:-1}function sr({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(or(r,c)<0)if(a){let e=(i+c)/2;r=or(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=Cn(r),r}function cr({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(ar(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;En(u!=null,`Invalid first pivot index`),En(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];En(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(En(n!=null,`Previous layout not found for panel index ${t}`),ar(n,i)){let t=o-n;or(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];En(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(En(n!=null,`Previous layout not found for panel index ${t}`),ar(n,o)){let t=n-i;or(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];En(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&or(i,c)<0)if(e>0){let t=c-o,n=t/2;or(i+e,c)<0&&(e=or(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;or(i-e,c)<0&&(e=or(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];En(e!=null,`Previous layout not found for panel index ${r}`);let a=sr({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];En(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=sr({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!ar(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(ir(c,l))return i;{let t=e<0?d:u,r=s[t];En(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=sr({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!ar(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];En(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=sr({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(ar(i,s)||(t-=s-i,l[r]=s),ar(t,0))break;e>0?r--:r++}}}if(!ar(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function lr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||or(e[n],t[n])!==0)return!1;return!0}function ur({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!ar(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];En(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];En(i!=null,`No layout data found for index ${e}`);let o=r[e];En(o!=null,`No layout data found for index ${e}`);let s=sr({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!ar(a,0))for(let e=0;e<t.length;e++){let n=r[e];En(n!=null,`No layout data found for index ${e}`);let i=n+a,o=sr({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,ar(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function dr({groupId:e,panelId:t}){let n=()=>{let t=Hn();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,groupSize:c,layout:l,separatorToPanels:u}=n(),d=s.panels.findIndex(e=>e.id===t),f=d===s.panels.length-1,p=ur({layout:cr({delta:f?r-e:e-r,initialLayout:l,panelConstraints:o,pivotIndices:f?[d-1,d]:[d,d+1],prevLayout:l,trigger:`imperative-api`}),panelConstraints:o});lr(l,p)||Wn(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,groupSize:c,layout:p,separatorToPanels:u})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&ar(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=wn({group:t});o(Cn(Sn({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function fr(e){e.defaultPrevented||rr(e,Hn()).forEach(t=>{if(t.separator){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=dr({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function pr(e){let t=Hn();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function mr({groupId:e}){let t=()=>{let t=Hn();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=ur({layout:e,panelConstraints:r});return n?o:(lr(o,c)||Wn(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function hr(e,t){let n=pr(e),r=Vn(n.id,!0),i=n.separators.find(t=>t.element===e);En(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);En(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=mr({groupId:n.id}).getLayout(),c=ur({layout:cr({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});lr(s,c)||Wn(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function gr(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=pr(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&hr(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&hr(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&hr(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&hr(t,-5);break;case`End`:e.preventDefault(),hr(t,100);break;case`Enter`:{e.preventDefault();let n=pr(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=Vn(n.id,!0),o=n.separators.find(e=>e.element===t);En(o,`Matching separator not found`);let s=a.get(o);En(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(En(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];hr(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=pr(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);En(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),hr(t,-100);break}}var _r={cursorFlags:0,state:`inactive`},vr=new In;function yr(){return _r}function br(e){return vr.addListener(`change`,e)}function xr(e){let t=_r,n={..._r};n.cursorFlags=e,_r=n,vr.emit(`change`,{prev:t,next:n})}function Sr(e){let t=_r;_r=e,vr.emit(`change`,{prev:t,next:e})}function Cr(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=Hn(),n=rr(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),Sr({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var wr=e=>e,Tr=()=>{},Er=1,Dr=2,Or=4,kr=8,Ar=3,jr=12,Mr;function Nr(){return Mr===void 0&&(Mr=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(Mr=!0)),Mr}function Pr({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&Nr()){let t=(e&Er)!==0,n=(e&Dr)!==0,r=(e&Or)!==0,i=(e&kr)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return Nr()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var Fr=new WeakMap;function Ir(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=Fr.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));let r=yr();switch(r.state){case`active`:case`hover`:{let e=Pr({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}Fr.set(e,{prevStyle:t,styleSheet:n})}function Lr({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=cr({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(lr(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?Er:Dr;break;case`vertical`:s|=d<0?Or:kr;break}}else Wn(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&Ar:c|=s&Ar,t.movementY===0?c|=o&jr:c|=s&jr,xr(c),Ir(e)}function Rr(e){let t=Hn(),n=yr();switch(n.state){case`active`:Lr({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function zr(e){if(e.defaultPrevented)return;let t=yr(),n=Hn();switch(t.state){case`active`:if(e.buttons===0){Sr({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=Vn(e.group.id,!0);Wn(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}Lr({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=rr(e,n);r.length===0?t.state!==`inactive`&&Sr({cursorFlags:0,state:`inactive`}):Sr({cursorFlags:0,hitRegions:r,state:`hover`}),Ir(e.currentTarget);break}}}function Br(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(yr().state){case`hover`:Sr({cursorFlags:0,state:`inactive`})}}function Vr(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=yr();switch(t.state){case`active`:Sr({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(Ir(e.currentTarget),t.hitRegions.forEach(e=>{let t=Vn(e.group.id,!0);Wn(e.group,t)}),e.preventDefault())}}function Hr(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=Cn(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=Cn((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function Ur(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=wn({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:Cn(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Wr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Gr({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=Cn(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=Cn((r[e]??0)/a*l);else{let e=Cn(l/c.length);for(let t of c)u[t]=e}return u}function Kr(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var qr=new Map;function Jr(e){let t=!0;En(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=wn({group:e});if(t===0)return;let n=Vn(e.id);if(!n)return;let r=Tn(e),i=n.defaultLayoutDeferred?Hr(r):n.layout,a=ur({layout:Gr({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&lr(n.layout,a)&&Wr(n.derivedPanelConstraints,r)&&n.groupSize===t)return;Wn(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else Ur(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{En(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=wn({group:e}),s=Tn(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(Kr(e.panels,l)||(l=void 0));let u=ur({layout:e.mutableState.layouts[c]??l??Hr(s),panelConstraints:s}),d=e.element.ownerDocument;qr.set(d,(qr.get(d)??0)+1);let f=new Map;return Fn(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),Wn(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{En(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,gr)}),qr.get(d)===1&&(d.addEventListener(`dblclick`,fr,!0),d.addEventListener(`pointerdown`,Cr,!0),d.addEventListener(`pointerleave`,Rr),d.addEventListener(`pointermove`,zr),d.addEventListener(`pointerout`,Br),d.addEventListener(`pointerup`,Vr,!0)),function(){t=!1,qr.set(d,Math.max(0,(qr.get(d)??0)-1)),zn(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,gr)}),qr.get(d)||(d.removeEventListener(`dblclick`,fr,!0),d.removeEventListener(`pointerdown`,Cr,!0),d.removeEventListener(`pointerleave`,Rr),d.removeEventListener(`pointermove`,zr),d.removeEventListener(`pointerout`,Br),d.removeEventListener(`pointerup`,Vr,!0)),a.disconnect()}}function Yr(){let[e,t]=(0,b.useState)({});return[e,(0,b.useCallback)(()=>t({}),[])]}function Xr(e){let t=(0,b.useId)();return`${e??t}`}var Zr=typeof window<`u`?b.useLayoutEffect:b.useEffect;function Qr(e){let t=(0,b.useRef)(e);return Zr(()=>{t.current=e},[e]),(0,b.useCallback)((...e)=>t.current?.(...e),[t])}function $r(...e){return Qr(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function ei(e){let t=(0,b.useRef)({...e});return Zr(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var ti=(0,b.createContext)(null);function ni(e,t){let n=(0,b.useRef)({getLayout:()=>({}),setLayout:wr});(0,b.useImperativeHandle)(t,()=>n.current,[]),Zr(()=>{Object.assign(n.current,mr({groupId:e}))})}function ri({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,b.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=Qr(e=>{lr(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=Qr(e=>{lr(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=Xr(s),v=(0,b.useRef)(null),[y,x]=Yr(),S=(0,b.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),C=$r(v,a);ni(_,o);let w=Qr((e,t)=>{let r=yr(),i=Bn(e),a=Vn(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),T=ei({defaultLayout:n,disableCursor:r}),E=(0,b.useMemo)(()=>({get disableCursor(){return!!T.disableCursor},getPanelStyles:w,id:_,orientation:u,registerPanel:e=>{let t=S.current;return t.panels=Dn(u,[...t.panels,e]),x(),()=>{t.panels=t.panels.filter(t=>t!==e),x()}},registerSeparator:e=>{let t=S.current;return t.separators=Dn(u,[...t.separators,e]),x(),()=>{t.separators=t.separators.filter(t=>t!==e),x()}},togglePanelDisabled:(e,t)=>{let n=S.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=Bn(_),i=Vn(_);r&&i&&Wn(r,{...i,derivedPanelConstraints:Tn(r)})},toggleSeparatorDisabled:(e,t)=>{let n=S.current.separators.find(t=>t.id===e);n&&(n.disabled=t)}}),[w,_,x,u,T]),D=(0,b.useRef)(null);return Zr(()=>{let e=v.current;if(e===null)return;let t=S.current,n;if(T.defaultLayout!==void 0&&Object.keys(T.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=T.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!T.disableCursor,expandedPanelSizes:S.current.lastExpandedPanelSizes,layouts:S.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};D.current=r;let a=Jr(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=Vn(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=Un(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=ar(t.collapsedSize,i[t.panelId]),a=ar(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=yr().state!==`active`;h(i),o&&g(i)});return()=>{D.current=null,a(),l()}},[i,_,g,h,u,y,T]),(0,b.useEffect)(()=>{let e=D.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,G.jsx)(ti.Provider,{value:E,children:(0,G.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:C,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}ri.displayName=`Group`;function ii(e,t){return`react-resizable-panels:${[e,...t].join(`:`)}`}function ai({id:e,panelIds:t,storage:n}){let r=ii(e,[]),i=n.getItem(r);if(i)try{let e=JSON.parse(i);if(t){let n=e[t.join(`,`)];if(n&&Array.isArray(n.layout)&&t.length===n.layout.length){let e={};for(let r=0;r<t.length;r++)e[t[r]]=n.layout[r];return e}}else{let t=Object.keys(e);if(t.length===1){let n=e[t[0]];if(n&&Array.isArray(n.layout)){let e=t[0].split(`,`);if(e.length===n.layout.length){let t={};for(let r=0;r<e.length;r++)t[e[r]]=n.layout[r];return t}}}}}catch{}}function oi({debounceSaveMs:e=100,panelIds:t,storage:n=localStorage,...r}){let i=t!==void 0,a=`id`in r?r.id:r.groupId,o=ii(a,t??[]),s=(0,b.useSyncExternalStore)(si,()=>n.getItem(o),()=>n.getItem(o)),c=(0,b.useMemo)(()=>{if(s){let e=JSON.parse(s),t=Object.values(e);if(Array.from(t).every(e=>typeof e==`number`))return e}},[s]),l=(0,b.useMemo)(()=>{if(!c)return ai({id:a,panelIds:t,storage:n})},[c,a,t,n]),u=c??l,d=(0,b.useRef)(null),f=(0,b.useCallback)(()=>{let e=d.current;e&&(d.current=null,clearTimeout(e))},[]);(0,b.useLayoutEffect)(()=>()=>{f()},[f]);let p=(0,b.useCallback)(e=>{f();let t;t=i?ii(a,Object.keys(e)):ii(a,[]);try{n.setItem(t,JSON.stringify(e))}catch(e){console.error(e)}},[f,i,a,n]);return{defaultLayout:u,onLayoutChange:(0,b.useCallback)(t=>{f(),e===0?p(t):d.current=setTimeout(()=>{p(t)},e)},[f,e,p]),onLayoutChanged:p}}function si(){return function(){}}function ci(){let e=(0,b.useContext)(ti);return En(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function li(e,t){let{id:n}=ci(),r=(0,b.useRef)({collapse:Tr,expand:Tr,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Tr});(0,b.useImperativeHandle)(t,()=>r.current,[]),Zr(()=>{Object.assign(r.current,dr({groupId:n,panelId:e}))})}function ui({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=Xr(c),_=ei({disabled:a}),v=(0,b.useRef)(null),y=$r(v,o),{getPanelStyles:x,id:S,orientation:C,registerPanel:w,togglePanelDisabled:T}=ci(),E=d!==null,D=Qr((e,t,n)=>{d?.(e,c,n)});Zr(()=>{let e=v.current;if(e!==null)return w({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:E?D:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,E,g,h,l,u,D,w,_]),(0,b.useEffect)(()=>{T(g,!!a)},[a,g,T]),li(g,f);let O=()=>{let e=x(S,g);if(e)return JSON.stringify(e)},k=(0,b.useSyncExternalStore)(e=>Un(S,e),O,O),A;return A=k?JSON.parse(k):i?{flexGrow:void 0,flexShrink:void 0,flexBasis:i}:{flexGrow:1},(0,G.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...di,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...A},children:(0,G.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:C===`horizontal`?`pan-y`:`pan-x`},children:e})})}ui.displayName=`Panel`;var di={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function fi({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=ur({layout:cr({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=ur({layout:cr({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function pi({children:e,className:t,disabled:n,elementRef:r,id:i,style:a,...o}){let s=Xr(i),c=ei({disabled:n}),[l,u]=(0,b.useState)({}),[d,f]=(0,b.useState)(`inactive`),p=(0,b.useRef)(null),m=$r(p,r),{disableCursor:h,id:g,orientation:_,registerSeparator:v,toggleSeparatorDisabled:y}=ci(),x=_===`horizontal`?`vertical`:`horizontal`;Zr(()=>{let e=p.current;if(e!==null){let t={disabled:c.disabled,element:e,id:s},n=v(t),r=br(e=>{f(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=Un(g,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);u(fi({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[g,s,v,c]),(0,b.useEffect)(()=>{y(s,!!n)},[n,s,y]);let S;return n&&!h&&(S=`not-allowed`),(0,G.jsx)(`div`,{...o,"aria-controls":l.valueControls,"aria-disabled":n||void 0,"aria-orientation":x,"aria-valuemax":l.valueMax,"aria-valuemin":l.valueMin,"aria-valuenow":l.valueNow,children:e,className:t,"data-separator":n?`disabled`:d,"data-testid":s,id:s,ref:m,role:`separator`,style:{flexBasis:`auto`,cursor:S,...a,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}pi.displayName=`Separator`;var mi=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},hi=(e=>e?mi(e):mi),gi=e=>e;function _i(e,t=gi){let n=b.useSyncExternalStore(e.subscribe,b.useCallback(()=>t(e.getState()),[e,t]),b.useCallback(()=>t(e.getInitialState()),[e,t]));return b.useDebugValue(n),n}var vi=e=>{let t=hi(e),n=e=>_i(t,e);return Object.assign(n,t),n},yi=(e=>e?vi(e):vi),bi=yi()(e=>({status:`idle`,requiresAuth:!1,error:null,setStatus:t=>e({status:t}),setRequiresAuth:t=>e({requiresAuth:t}),setError:t=>e({error:t}),reset:()=>e({status:`idle`,requiresAuth:!1,error:null})})),xi=globalThis.crypto;async function Si(e){return(await xi).getRandomValues(new Uint8Array(e))}async function Ci(e){let t=``;for(;t.length<e;){let n=await Si(e-t.length);for(let e of n)e<198&&(t+=`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~`[e%66])}return t}async function wi(e){return await Ci(e)}async function Ti(e){let t=await(await xi).subtle.digest(`SHA-256`,new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,`_`).replace(/\+/g,`-`).replace(/=/g,``)}async function Ei(e){if(e||=43,e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await wi(e);return{code_verifier:t,code_challenge:await Ti(t)}}var Di=Object.freeze({status:`aborted`});function q(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var Oi=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ki=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},Ai={};function ji(e){return e&&Object.assign(Ai,e),Ai}function Mi(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Ni(e,t){return typeof t==`bigint`?t.toString():t}function Pi(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Fi(e){return e==null}function Ii(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Li(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var Ri=Symbol(`evaluating`);function zi(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ri)return r===void 0&&(r=Ri,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Bi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Vi(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Hi(e){return JSON.stringify(e)}function Ui(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Wi=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Gi(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ki=Pi(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function qi(e){if(Gi(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Gi(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Ji(e){return qi(e)?{...e}:Array.isArray(e)?[...e]:e}var Yi=new Set([`string`,`number`,`symbol`]);function Xi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Zi(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Qi(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function $i(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var ea={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ta(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Zi(e,Vi(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Bi(this,`shape`,e),e},checks:[]}))}function na(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Zi(e,Vi(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Bi(this,`shape`,r),r},checks:[]}))}function ra(e,t){if(!qi(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Zi(e,Vi(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Bi(this,`shape`,n),n}}))}function ia(e,t){if(!qi(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Zi(e,Vi(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Bi(this,`shape`,n),n}}))}function aa(e,t){return Zi(e,Vi(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Bi(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function oa(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Zi(t,Vi(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Bi(this,`shape`,i),i},checks:[]}))}function sa(e,t,n){return Zi(t,Vi(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Bi(this,`shape`,i),i}}))}function ca(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function la(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ua(e){return typeof e==`string`?e:e?.message}function da(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=ua(e.inst?._zod.def?.error?.(e))??ua(t?.error?.(e))??ua(n.customError?.(e))??ua(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function fa(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function pa(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var ma=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ni,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},ha=q(`$ZodError`,ma),ga=q(`$ZodError`,ma,{Parent:Error});function _a(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function va(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var ya=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Oi;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>da(e,a,ji())));throw Wi(t,i?.callee),t}return o.value},ba=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>da(e,a,ji())));throw Wi(t,i?.callee),t}return o.value},xa=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Oi;return a.issues.length?{success:!1,error:new(e??ha)(a.issues.map(e=>da(e,i,ji())))}:{success:!0,data:a.value}},Sa=xa(ga),Ca=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>da(e,i,ji())))}:{success:!0,data:a.value}},wa=Ca(ga),Ta=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ya(e)(t,n,i)},Ea=e=>(t,n,r)=>ya(e)(t,n,r),Da=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ba(e)(t,n,i)},Oa=e=>async(t,n,r)=>ba(e)(t,n,r),ka=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return xa(e)(t,n,i)},Aa=e=>(t,n,r)=>xa(e)(t,n,r),ja=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ca(e)(t,n,i)},Ma=e=>async(t,n,r)=>Ca(e)(t,n,r),Na=/^[cC][^\s-]{8,}$/,Pa=/^[0-9a-z]+$/,Fa=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ia=/^[0-9a-vA-V]{20}$/,La=/^[A-Za-z0-9]{27}$/,Ra=/^[a-zA-Z0-9_-]{21}$/,za=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ba=/^([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})$/,Va=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ha=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ua=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Wa(){return new RegExp(Ua,`u`)}var Ga=/^(?:(?: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])$/,Ka=/^(([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}|:))$/,qa=/^((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])$/,Ja=/^(([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])$/,Ya=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xa=/^[A-Za-z0-9_-]*$/,Za=/^\+[1-9]\d{6,14}$/,Qa=`(?:(?:\\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])))`,$a=RegExp(`^${Qa}$`);function eo(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function to(e){return RegExp(`^${eo(e)}$`)}function no(e){let t=eo({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Qa}T(?:${r})$`)}var ro=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},io=/^-?\d+$/,ao=/^-?\d+(?:\.\d+)?$/,oo=/^(?:true|false)$/i,so=/^null$/i,co=/^undefined$/i,lo=/^[^A-Z]*$/,uo=/^[^a-z]*$/,fo=q(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),po={number:`number`,bigint:`bigint`,object:`date`},mo=q(`$ZodCheckLessThan`,(e,t)=>{fo.init(e,t);let n=po[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ho=q(`$ZodCheckGreaterThan`,(e,t)=>{fo.init(e,t);let n=po[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),go=q(`$ZodCheckMultipleOf`,(e,t)=>{fo.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Li(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),_o=q(`$ZodCheckNumberFormat`,(e,t)=>{fo.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ea[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=io)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),vo=q(`$ZodCheckMaxLength`,(e,t)=>{var n;fo.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Fi(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=fa(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),yo=q(`$ZodCheckMinLength`,(e,t)=>{var n;fo.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Fi(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=fa(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),bo=q(`$ZodCheckLengthEquals`,(e,t)=>{var n;fo.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Fi(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=fa(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),xo=q(`$ZodCheckStringFormat`,(e,t)=>{var n,r;fo.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),So=q(`$ZodCheckRegex`,(e,t)=>{xo.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Co=q(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=lo,xo.init(e,t)}),wo=q(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=uo,xo.init(e,t)}),To=q(`$ZodCheckIncludes`,(e,t)=>{fo.init(e,t);let n=Xi(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Eo=q(`$ZodCheckStartsWith`,(e,t)=>{fo.init(e,t);let n=RegExp(`^${Xi(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Do=q(`$ZodCheckEndsWith`,(e,t)=>{fo.init(e,t);let n=RegExp(`.*${Xi(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Oo=q(`$ZodCheckOverwrite`,(e,t)=>{fo.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),ko=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
13
13
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
14
14
|
`))}},Ao={major:4,minor:3,patch:6},jo=q(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ao;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=ca(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Oi;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=ca(e,t))});else{if(e.issues.length===t)continue;r||=ca(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(ca(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Oi;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Oi;return o.then(e=>t(e,r,a))}return t(o,r,a)}}zi(e,`~standard`,()=>({validate:t=>{try{let n=Sa(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return wa(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Mo=q(`$ZodString`,(e,t)=>{jo.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ro(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),No=q(`$ZodStringFormat`,(e,t)=>{xo.init(e,t),Mo.init(e,t)}),Po=q(`$ZodGUID`,(e,t)=>{t.pattern??=Ba,No.init(e,t)}),Fo=q(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Va(e)}else t.pattern??=Va();No.init(e,t)}),Io=q(`$ZodEmail`,(e,t)=>{t.pattern??=Ha,No.init(e,t)}),Lo=q(`$ZodURL`,(e,t)=>{No.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ro=q(`$ZodEmoji`,(e,t)=>{t.pattern??=Wa(),No.init(e,t)}),zo=q(`$ZodNanoID`,(e,t)=>{t.pattern??=Ra,No.init(e,t)}),Bo=q(`$ZodCUID`,(e,t)=>{t.pattern??=Na,No.init(e,t)}),Vo=q(`$ZodCUID2`,(e,t)=>{t.pattern??=Pa,No.init(e,t)}),Ho=q(`$ZodULID`,(e,t)=>{t.pattern??=Fa,No.init(e,t)}),Uo=q(`$ZodXID`,(e,t)=>{t.pattern??=Ia,No.init(e,t)}),Wo=q(`$ZodKSUID`,(e,t)=>{t.pattern??=La,No.init(e,t)}),Go=q(`$ZodISODateTime`,(e,t)=>{t.pattern??=no(t),No.init(e,t)}),Ko=q(`$ZodISODate`,(e,t)=>{t.pattern??=$a,No.init(e,t)}),qo=q(`$ZodISOTime`,(e,t)=>{t.pattern??=to(t),No.init(e,t)}),Jo=q(`$ZodISODuration`,(e,t)=>{t.pattern??=za,No.init(e,t)}),Yo=q(`$ZodIPv4`,(e,t)=>{t.pattern??=Ga,No.init(e,t),e._zod.bag.format=`ipv4`}),Xo=q(`$ZodIPv6`,(e,t)=>{t.pattern??=Ka,No.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Zo=q(`$ZodCIDRv4`,(e,t)=>{t.pattern??=qa,No.init(e,t)}),Qo=q(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Ja,No.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function $o(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var es=q(`$ZodBase64`,(e,t)=>{t.pattern??=Ya,No.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{$o(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function ts(e){if(!Xa.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return $o(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var ns=q(`$ZodBase64URL`,(e,t)=>{t.pattern??=Xa,No.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{ts(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),rs=q(`$ZodE164`,(e,t)=>{t.pattern??=Za,No.init(e,t)});function is(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var as=q(`$ZodJWT`,(e,t)=>{No.init(e,t),e._zod.check=n=>{is(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),os=q(`$ZodNumber`,(e,t)=>{jo.init(e,t),e._zod.pattern=e._zod.bag.pattern??ao,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),ss=q(`$ZodNumberFormat`,(e,t)=>{_o.init(e,t),os.init(e,t)}),cs=q(`$ZodBoolean`,(e,t)=>{jo.init(e,t),e._zod.pattern=oo,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),ls=q(`$ZodUndefined`,(e,t)=>{jo.init(e,t),e._zod.pattern=co,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),us=q(`$ZodNull`,(e,t)=>{jo.init(e,t),e._zod.pattern=so,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),ds=q(`$ZodAny`,(e,t)=>{jo.init(e,t),e._zod.parse=e=>e}),fs=q(`$ZodUnknown`,(e,t)=>{jo.init(e,t),e._zod.parse=e=>e}),ps=q(`$ZodNever`,(e,t)=>{jo.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function ms(e,t,n){e.issues.length&&t.issues.push(...la(n,e.issues)),t.value[n]=e.value}var hs=q(`$ZodArray`,(e,t)=>{jo.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>ms(t,n,e))):ms(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function gs(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...la(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function _s(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=$i(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function vs(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>gs(e,n,i,t,u))):gs(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var ys=q(`$ZodObject`,(e,t)=>{if(jo.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=Pi(()=>_s(t));zi(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Gi,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>gs(n,t,e,s,r))):gs(i,t,e,s,r)}return i?vs(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),bs=q(`$ZodObjectJIT`,(e,t)=>{ys.init(e,t);let n=e._zod.parse,r=Pi(()=>_s(t)),i=e=>{let t=new ko([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Hi(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Hi(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|
|
15
15
|
if (${n}.issues.length) {
|
|
@@ -149,7 +149,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
149
149
|
${e.right}px ${e.bottom}px,
|
|
150
150
|
${e.right}px ${e.top}px,
|
|
151
151
|
${e.left}px ${e.top}px
|
|
152
|
-
)`}return(0,G.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),rie=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=K3(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,G.jsx)(K5.Provider,{value:n,children:(0,G.jsxs)(R6,{ref:t,...r,children:[a&&o===!0&&(0,G.jsx)(q5,{ref:i.context.internalBackdropRef,inert:E4(!s)}),e.children]})}):null});function J5(e){let t=b.useRef(!0);t.current&&(t.current=!1,e())}var Y5={},X5={},Z5=``;function iie(e){if(typeof document>`u`)return!1;let t=U1(e);return fT(t).innerWidth-t.documentElement.clientWidth>0}function aie(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=U1(e),n=t.documentElement,r=t.body,i=vT(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function oie(e){let t=U1(e),n=t.documentElement,r=t.body,i=vT(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function sie(e){let t=U1(e),n=t.documentElement,r=t.body,i=fT(n),a=0,o=0,s=!1,c=N4.create();if(v0&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Y5={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Z5=n.style.scrollBehavior,X5={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=vT(n)?n:r;if(s=aie(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,Y5),Object.assign(r.style,X5),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Z5)}function d(){u(),c.request(l)}return l(),i.addEventListener(`resize`,d),()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var cie=new class{lockCount=0;restore=null;timeoutLock=s6.create();timeoutUnlock=s6.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=U1(e).documentElement,n=fT(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=SE;return}this.restore=y0||!iie(e)?oie(e):sie(e)}};function Q5(e=!0,t=null){$(()=>{if(e)return cie.acquire(t)},[e,t])}function lie(e){let t=b.useRef(``),n=b.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:b.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function $5(e,t){let n=b.useRef(e),r=zT(t);$(()=>{n.current!==e&&r(n.current)},[e,r]),$(()=>{n.current=e},[e])}function e7(e){let[t,n]=b.useState(null),r=zT((t,r)=>{e||n(r||(y0?`touch`:``))});$5(e,t=>{t&&!e&&n(null)});let{onClick:i,onPointerDown:a}=lie(r);return b.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:a}}),[t,i,a])}function uie(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l}=e7(i);w5(t);let{forceUnmount:u}=T5(i,t),d=zT(e=>{let n=p0(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),f=b.useCallback(()=>{t.setOpen(!1,d(d0))},[t,d]);b.useImperativeHandle(r,()=>({unmount:u,close:f}),[u,f]);let p=j5({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[m,h]=b.useState(0),g=m===0,_=B5(p),v=c8(p,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=F0(e);if(g&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||N0(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:g});Q5(i&&o===!0,s);let{getReferenceProps:y,getFloatingProps:x,getTriggerProps:S}=P5([_,v]);t.useContextCallback(`onNestedDialogOpen`,e=>{h(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{h(0)}),b.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(m),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,m]);let C=b.useMemo(()=>y(l),[y,l]),w=b.useMemo(()=>S(l),[S,l]),T=b.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:w,popupProps:T,floatingRootContext:p,nestedOpenDialogCount:m})}var die={...k5,modal:_5(e=>e.modal),nested:_5(e=>e.nested),nestedOpenDialogCount:_5(e=>e.nestedOpenDialogCount),disablePointerDismissal:_5(e=>e.disablePointerDismissal),openMethod:_5(e=>e.openMethod),descriptionElementId:_5(e=>e.descriptionElementId),titleElementId:_5(e=>e.titleElementId),viewportElement:_5(e=>e.viewportElement),role:_5(e=>e.role)},fie=class extends S5{constructor(e){super(pie(e),{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new E5,onOpenChange:void 0,onOpenChangeComplete:void 0},die)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function pie(e={}){return{...D5(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function mie(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=K3(!0),p=!!f,m=IT(()=>l?.store??new fie({open:r,openProp:n,activeTriggerId:d,triggerIdProp:u,modal:s,disablePointerDismissal:o,nested:p})).current;J5(()=>{n===void 0&&m.state.open===!1&&r===!0&&m.update({open:!0,activeTriggerId:d})}),m.useControlledProp(`openProp`,n),m.useControlledProp(`triggerIdProp`,u),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);uie({store:m,actionsRef:c,parentContext:f?.store.context,onOpenChange:i,triggerIdProp:u});let g=b.useMemo(()=>({store:m}),[m]);return(0,G.jsx)(G3.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}var hie=b.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=K3(),s=J1(i);return o.useSyncedValueWithCleanup(`titleElementId`,s),AE(`h2`,e,{ref:t,props:[{id:s},a]})});function gie({...e}){return(0,G.jsx)(mie,{"data-slot":`dialog`,...e})}function _ie({...e}){return(0,G.jsx)(rie,{"data-slot":`dialog-portal`,...e})}function vie({className:e,...t}){return(0,G.jsx)(i6,{"data-slot":`dialog-overlay`,className:cO(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50`,e),...t})}function yie({className:e,children:t,showCloseButton:n=!0,...r}){return(0,G.jsxs)(_ie,{children:[(0,G.jsx)(vie,{}),(0,G.jsxs)(nie,{"data-slot":`dialog-content`,className:cO(`bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-none p-4 text-xs/relaxed ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,e),...r,children:[t,n&&(0,G.jsxs)(a6,{"data-slot":`dialog-close`,render:(0,G.jsx)(lO,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,G.jsx)(gn,{}),(0,G.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function bie({className:e,...t}){return(0,G.jsx)(hie,{"data-slot":`dialog-title`,className:cO(`text-sm font-medium`,e),...t})}var xie=()=>{let e=cT(),[t,n]=(0,b.useState)(!1);return e._meta&&Object.keys(e._meta).length>0?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(lO,{variant:`ghost`,size:`default`,onClick:()=>n(!0),"aria-label":`View tool metadata`,title:`View tool metadata`,children:[(0,G.jsx)(sn,{className:`h-4 w-4`}),`Metadata`]}),(0,G.jsx)(gie,{open:t,onOpenChange:n,children:(0,G.jsxs)(yie,{className:`sm:max-w-2xl`,children:[(0,G.jsx)(bie,{children:`Tool Metadata`}),(0,G.jsx)(`div`,{className:`text-xs`,children:(0,G.jsx)(W3,{src:e._meta,name:null,quotesOnKeys:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!1,theme:`rjv-default`,style:{fontSize:`0.75rem`},collapsed:2,collapseStringsAfterLength:80})})]})})]}):null},Sie={"ui:submitButtonOptions":{norender:!0}},Cie=({schema:e,formData:t,setFormData:n,ref:r})=>!e||!e.properties||Object.keys(e.properties).length===0?(0,G.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This tool requires no input`})}):(0,G.jsx)(y3,{children:(0,G.jsx)(b3,{children:(0,G.jsx)(O1,{ref:r,schema:e??{},validator:AK,uiSchema:Sie,formData:t,onChange:e=>n(e.formData),showErrorList:!1,templates:{FieldTemplate:e=>{let{id:t,classNames:n,style:r,label:i,required:a,errors:o,children:s}=e;return(0,G.jsxs)(`div`,{className:cO(`flex flex-col gap-2`,n),style:r,children:[(0,G.jsxs)(`label`,{htmlFor:t,className:`text-sm text-foreground`,children:[i,a&&(0,G.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[s,o]})]})},FieldErrorTemplate:e=>e.errors&&e.errors.length>0?(0,G.jsx)(`div`,{className:`text-sm text-destructive mt-1 flex items-center gap-1`,children:(0,G.jsx)(`span`,{children:e.errors.join(`, `)})}):null}})})}),wie=({formData:e,setFormData:t})=>{let[n,r]=(0,b.useState)(JSON.stringify(e,null,2));(0,b.useEffect)(()=>{r(JSON.stringify(e,null,2))},[e]);let i=e=>{r(e);try{t(JSON.parse(e))}catch{}};return(0,G.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,G.jsx)(`textarea`,{className:`w-full h-full p-2 rounded-md border border-border`,rows:12,value:n,onChange:e=>i(e.target.value)})})},Tie=()=>{let e=(0,b.useRef)(null),t=cT(),{setToolData:n}=GS(),r=KS(t.name)?.input??{},i=e=>{n(t.name,{input:e??{}})};return(0,G.jsxs)(`div`,{className:cO(`flex flex-col h-full overflow-hidden border-r border-border`),children:[(0,G.jsxs)(`div`,{className:`shrink-0 border-b border-border px-6 py-4 flex items-center justify-between h-[72px]`,children:[(0,G.jsx)(`h2`,{className:`font-semibold text-foreground`,children:t.name}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(xie,{}),(0,G.jsx)(H3,{validateForm:async()=>e.current===null?!0:await e.current.validateForm(),formData:r})]})]}),(0,G.jsx)(`div`,{className:`flex-1 overflow-auto px-6 py-6 bg-muted/50`,children:(0,G.jsxs)(m3,{defaultValue:`form`,children:[(0,G.jsxs)(g3,{children:[(0,G.jsx)(_3,{value:`form`,children:`Form`}),(0,G.jsx)(_3,{value:`json`,children:`JSON`})]}),(0,G.jsx)(v3,{value:`form`,children:(0,G.jsx)(Cie,{schema:t.inputSchema,formData:r,setFormData:i,ref:e},t.name)}),(0,G.jsx)(v3,{value:`json`,children:(0,G.jsx)(wie,{formData:r,setFormData:i},t.name)})]})})]})},Eie=BE(`rounded-none has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-none flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0 [&>[data-slot]]:rounded-r-none`,vertical:`flex-col [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0 [&>[data-slot]]:rounded-b-none`}},defaultVariants:{orientation:`horizontal`}});function Die({className:e,orientation:t,...n}){return(0,G.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:cO(Eie({orientation:t}),e),...n})}function Oie({className:e,...t}){return(0,G.jsx)(`label`,{"data-slot":`label`,className:cO(`gap-2 text-xs leading-none group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed`,e),...t})}function kie({className:e,...t}){return(0,G.jsx)(`fieldset`,{"data-slot":`field-set`,className:cO(`gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col`,e),...t})}var Aie=BE(`data-[invalid=true]:text-destructive gap-2 group/field flex w-full`,{variants:{orientation:{vertical:`flex-col [&>*]:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function t7({className:e,orientation:t=`vertical`,...n}){return(0,G.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:cO(Aie({orientation:t}),e),...n})}function n7({className:e,...t}){return(0,G.jsx)(Oie,{"data-slot":`field-label`,className:cO(`has-data-checked:bg-primary/5 has-data-checked:border-primary dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-none has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-2 group/field-label peer/field-label flex w-fit leading-snug`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}var r7=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),jie={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},i7={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Mie={disabled:!1,...i7},a7={valid(e){return e===null?null:e?{[r7.valid]:``}:{[r7.invalid]:``}}},Nie=b.createContext({invalid:void 0,name:void 0,validityData:{state:jie,errors:[],error:``,value:``,initialValue:null},setValidityData:SE,disabled:void 0,touched:i7.touched,setTouched:SE,dirty:i7.dirty,setDirty:SE,filled:i7.filled,setFilled:SE,focused:i7.focused,setFocused:SE,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Mie,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=wE)=>e,getInputValidationProps:(e=wE)=>e,inputRef:{current:null},commit:async()=>{}}});function o7(e=!0){let t=b.useContext(Nie);if(t.setValidityData===SE&&!e)throw Error(rE(28));return t}var Pie=b.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:SE,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function s7(){return b.useContext(Pie)}var Fie=b.createContext({controlId:void 0,registerControlId:SE,labelId:void 0,setLabelId:SE,messageIds:[],setMessageIds:SE,getDescriptionProps:e=>e});function c7(){return b.useContext(Fie)}function Iie(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function l7(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=c7(),o=J1(t),s=n?i:void 0,c=IT(()=>Symbol(`labelable-control`)),l=b.useRef(!1),u=b.useRef(t!=null),d=zT(()=>{!l.current||a===SE||(l.current=!1,a(c.current,void 0))});return $(()=>{if(a===SE)return;let e;if(n){let n=r?.current;e=hT(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),b.useEffect(()=>d,[d]),i??o}function u7(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=s7(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:d}=o7(),f=zT(e.getValue);$(()=>{if(!t)return;let e=n;e===void 0&&(e=f()),u.initialValue===null&&e!==null&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),$(()=>{!t||!r||s.current.fields.set(r,{getValue:f,name:i,controlRef:a,validityData:Iie(u,c),validate(e=!0){let t=n;t===void 0&&(t=f()),l.current=!0,e?Lq.flushSync(()=>o(t)):o(t)}})},[o,a,t,s,f,r,c,l,i,u,n]),$(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}var Lie=b.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,...d}=e,{state:f,name:p,disabled:m,setTouched:h,setDirty:g,validityData:_,setFocused:v,setFilled:y,validationMode:x,validation:S}=o7(),C=m||s,w=p??a,T={...f,disabled:C},{labelId:E}=c7(),D=l7({id:i});$(()=>{let e=o!=null;S.inputRef.current?.value||e&&o!==``?y(!0):e&&o===``&&y(!1)},[S.inputRef,y,o]);let O=b.useRef(null);$(()=>{u&&O.current===M0(U1(O.current))&&v(!0)},[u,v]);let[k]=k1({controlled:o,default:l,name:`FieldControl`,state:`value`}),A=o!==void 0,j=A?k:void 0;return u7({id:D,name:w,commit:S.commit,value:j,getValue:()=>S.inputRef.current?.value,controlRef:S.inputRef}),AE(`input`,e,{ref:[t,O],state:T,props:[{id:D,disabled:C,name:w,ref:S.inputRef,"aria-labelledby":E,autoFocus:u,...A?{value:j}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,p0(t0,e.nativeEvent)),g(t!==_.initialValue),y(t!==``)},onFocus(){v(!0)},onBlur(e){h(!0),v(!1),x===`onBlur`&&S.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(h(!0),S.commit(e.currentTarget.value))}},S.getInputValidationProps(),d],stateAttributesMapping:a7})}),Rie=b.forwardRef(function(e,t){return(0,G.jsx)(Lie,{ref:t,...e})});function d7({className:e,type:t,...n}){return(0,G.jsx)(Rie,{type:t,"data-slot":`input`,className:cO(`dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-none border bg-transparent px-2.5 py-1 text-xs transition-colors file:h-6 file:text-xs file:font-medium focus-visible:ring-1 aria-invalid:ring-1 md:text-xs file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,e),...n})}var f7=b.createContext(null),p7=b.createContext(null);function m7(){let e=b.useContext(f7);if(e===null)throw Error(rE(60));return e}function h7(){let e=b.useContext(p7);if(e===null)throw Error(rE(61));return e}var zie=(e,t)=>Object.is(e,t);function g7(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Bie(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:g7(t,e,n))}function _7(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:g7(e,t,n))}function Vie(e,t,n){return e.filter(e=>!g7(t,e,n))}function v7(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function y7(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function Hie(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(y7(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function Uie(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return v7(e)}function b7(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?v7(e.value):v7(e)}function x7(e,t,n){function r(){return Uie(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=y7(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Wie(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,G.jsx)(b.Fragment,{children:x7(r,t,n)},i)),e),[])}var S7={id:_5(e=>e.id),labelId:_5(e=>e.labelId),modal:_5(e=>e.modal),multiple:_5(e=>e.multiple),items:_5(e=>e.items),itemToStringLabel:_5(e=>e.itemToStringLabel),itemToStringValue:_5(e=>e.itemToStringValue),isItemEqualToValue:_5(e=>e.isItemEqualToValue),value:_5(e=>e.value),hasSelectedValue:_5(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:b7(t,r)!==``}),hasNullItemLabel:_5((e,t)=>t?Hie(e.items):!1),open:_5(e=>e.open),mounted:_5(e=>e.mounted),forceMount:_5(e=>e.forceMount),transitionStatus:_5(e=>e.transitionStatus),openMethod:_5(e=>e.openMethod),activeIndex:_5(e=>e.activeIndex),selectedIndex:_5(e=>e.selectedIndex),isActive:_5((e,t)=>e.activeIndex===t),isSelected:_5((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>g7(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:g7(n,i,r)}),isSelectedByFocus:_5((e,t)=>e.selectedIndex===t),popupProps:_5(e=>e.popupProps),triggerProps:_5(e=>e.triggerProps),triggerElement:_5(e=>e.triggerElement),positionerElement:_5(e=>e.positionerElement),listElement:_5(e=>e.listElement),scrollUpArrowVisible:_5(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:_5(e=>e.scrollDownArrowVisible),hasScrollArrows:_5(e=>e.hasScrollArrows)};function Gie(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,autoComplete:l,disabled:u=!1,readOnly:d=!1,required:f=!1,modal:p=!0,actionsRef:m,inputRef:h,onOpenChangeComplete:g,items:_,multiple:v=!1,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:S=zie,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=s7(),{setDirty:E,setTouched:D,setFocused:O,shouldValidateOnChange:k,validityData:A,setFilled:j,name:M,disabled:N,validation:P,validationMode:F}=o7(),I=l7({id:t}),L=N||u,R=M??c,[z,B]=k1({controlled:n,default:v?r??CE:r,name:`Select`,state:`value`}),[V,H]=k1({controlled:a,default:o,name:`Select`,state:`open`}),U=b.useRef([]),ee=b.useRef([]),W=b.useRef(null),te=b.useRef(null),ne=b.useRef(0),re=b.useRef(null),ie=b.useRef([]),ae=b.useRef(!1),oe=b.useRef(!1),se=b.useRef(null),ce=b.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),le=b.useRef(!1),{mounted:ue,setMounted:de,transitionStatus:fe}=R4(V),{openMethod:pe,triggerProps:me}=e7(V),he=IT(()=>new x5({id:I,labelId:void 0,modal:p,multiple:v,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:S,value:z,open:V,mounted:ue,transitionStatus:fe,items:_,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ge=b5(he,S7.activeIndex),_e=b5(he,S7.selectedIndex),ve=b5(he,S7.triggerElement),ye=b5(he,S7.positionerElement),be=b.useMemo(()=>v&&Array.isArray(z)&&z.length===0?``:b7(z,x),[v,z,x]),xe=b.useMemo(()=>v&&Array.isArray(z)?z.map(e=>b7(e,x)):b7(z,x),[v,z,x]),Se=p6(he.state.triggerElement);u7({id:I,commit:P.commit,value:z,controlRef:Se,name:R,getValue:()=>xe});let Ce=b.useRef(z);$(()=>{z!==Ce.current&&he.set(`forceMount`,!0)},[he,z]),$(()=>{j(v?Array.isArray(z)&&z.length>0:z!=null)},[v,z,j]),$(function(){if(V)return;let e=ie.current;if(v){let t=Array.isArray(z)?z:[];if(t.length===0){he.set(`selectedIndex`,null);return}let n=t[t.length-1],r=_7(e,n,S);he.set(`selectedIndex`,r===-1?null:r);return}let t=_7(e,z,S);he.set(`selectedIndex`,t===-1?null:t)},[v,V,z,ie,S,he]),$5(z,()=>{T(R),E(z!==A.initialValue),k()?P.commit(z):P.commit(z,!0)});let we=zT((e,t)=>{if(s?.(e,t),!t.isCanceled&&(H(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(D(!0),O(!1),F===`onBlur`&&P.commit(z)),!e&&he.state.activeIndex!==null)){let e=U.current[he.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),Te=zT(()=>{de(!1),he.set(`activeIndex`,null),g?.(!1)});L4({enabled:!m,open:V,ref:W,onComplete(){V||Te()}}),b.useImperativeHandle(m,()=>({unmount:Te}),[Te]);let Ee=zT((e,t)=>{i?.(e,t),!t.isCanceled&&B(e)}),De=zT(()=>{let e=he.state.listElement||W.current;if(!e)return;let t=e.scrollTop,n=e.scrollTop+e.clientHeight,r=t>1,i=n<e.scrollHeight-1;he.state.scrollUpArrowVisible!==r&&he.set(`scrollUpArrowVisible`,r),he.state.scrollDownArrowVisible!==i&&he.set(`scrollDownArrowVisible`,i)}),Oe=A5({open:V,onOpenChange:we,elements:{reference:ve,floating:ye}}),{getReferenceProps:ke,getFloatingProps:Ae,getItemProps:je}=P5([i8(Oe,{enabled:!d&&!L,event:`mousedown`}),c8(Oe,{bubbles:!1}),Kre(Oe,{enabled:!d&&!L,listRef:U,activeIndex:ge,selectedIndex:_e,disabledIndices:CE,onNavigate(e){e===null&&!V||he.set(`activeIndex`,e)},focusItemOnHover:!1}),Jre(Oe,{enabled:!d&&!L&&(V||!v),listRef:ee,activeIndex:ge,selectedIndex:_e,onMatch(e){V?he.set(`activeIndex`,e):Ee(ie.current[e],p0(`none`))},onTypingChange(e){ae.current=e}})]),Me=b.useMemo(()=>GT(ke(),me,I?{id:I}:wE),[ke,me,I]);J5(()=>{he.update({popupProps:Ae(),triggerProps:Me})}),$(()=>{he.update({id:I,modal:p,multiple:v,value:z,open:V,mounted:ue,transitionStatus:fe,popupProps:Ae(),triggerProps:Me,items:_,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:S,openMethod:pe})},[he,I,p,v,z,V,ue,fe,Ae,Me,_,y,x,S,pe]);let Ne=b.useMemo(()=>({store:he,name:R,required:f,disabled:L,readOnly:d,multiple:v,itemToStringLabel:y,itemToStringValue:x,highlightItemOnHover:C,setValue:Ee,setOpen:we,listRef:U,popupRef:W,scrollHandlerRef:te,handleScrollArrowVisibility:De,scrollArrowsMountedCountRef:ne,getItemProps:je,events:Oe.context.events,valueRef:re,valuesRef:ie,labelsRef:ee,typingRef:ae,selectionRef:ce,selectedItemTextRef:se,validation:P,onOpenChangeComplete:g,keyboardActiveRef:oe,alignItemWithTriggerActiveRef:le,initialValueRef:Ce}),[he,R,f,L,d,v,y,x,C,Ee,we,je,Oe.context.events,P,g,De]),Pe=uE(h,P.inputRef),Fe=v&&Array.isArray(z)&&z.length>0,Ie=v?void 0:R,Le=b.useMemo(()=>!v||!Array.isArray(z)||!R?null:z.map(e=>{let t=b7(e,x);return(0,G.jsx)(`input`,{type:`hidden`,name:R,value:t},t)}),[v,z,R,x]);return(0,G.jsx)(f7.Provider,{value:Ne,children:(0,G.jsxs)(p7.Provider,{value:Oe,children:[w,(0,G.jsx)(`input`,{...P.getInputValidationProps({onFocus(){he.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.value,n=p0(t0,e.nativeEvent);function r(){if(v)return;let e=ie.current.find(e=>b7(e,x).toLowerCase()===t.toLowerCase());e!=null&&(E(e!==A.initialValue),Ee(e,n),k()&&P.commit(e))}he.set(`forceMount`,!0),queueMicrotask(r)}}),id:I&&Ie==null?`${I}-hidden-input`:void 0,name:Ie,autoComplete:l,value:be,disabled:L,required:f&&!Fe,readOnly:d,ref:Pe,style:R?_6:g6,tabIndex:-1,"aria-hidden":!0}),Le]})})}function Kie(e,t){return e??t}function qie(e){let t=e.getBoundingClientRect(),n=window.getComputedStyle(e,`::before`),r=window.getComputedStyle(e,`::after`);if(!(n.content!==`none`||r.content!==`none`))return t;let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0,o=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=Math.max(t.width,i,o),l=Math.max(t.height,a,s),u=c-t.width,d=l-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-d/2,bottom:t.bottom+d/2}}var C7=2,Jie=400,w7=200,Yie={...t6,...a7,value:()=>null},Xie=b.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{setTouched:c,setFocused:l,validationMode:u,state:d,disabled:f}=o7(),{labelId:p}=c7(),{store:m,setOpen:h,selectionRef:g,validation:_,readOnly:v,required:y,alignItemWithTriggerActiveRef:x,disabled:S,keyboardActiveRef:C}=m7(),w=f||S||a,T=b5(m,S7.open),E=b5(m,S7.value),D=b5(m,S7.triggerProps),O=b5(m,S7.positionerElement),k=b5(m,S7.listElement),A=b5(m,S7.id),j=b5(m,S7.labelId),M=b5(m,S7.hasSelectedValue),N=!M&&T,P=b5(m,S7.hasNullItemLabel,N),F=i??A,I=Kie(p,j);l7({id:F});let L=p6(O),R=b.useRef(null),{getButtonProps:z,buttonRef:B}=sE({disabled:w,native:o}),V=uE(t,R,B,zT(e=>{m.set(`triggerElement`,e)})),H=c6(),U=c6(),ee=c6(),W=c6();b.useEffect(()=>{if(T)return M||P?W.start(w7,()=>{g.current.allowUnselectedMouseUp=!0,ee.start(w7,()=>{g.current.allowSelectedMouseUp=!0})}):ee.start(Jie,()=>{g.current.allowUnselectedMouseUp=!0,g.current.allowSelectedMouseUp=!0}),()=>{ee.clear(),W.clear()};g.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},U.clear()},[T,M,P,g,U,ee,W]);let te=b.useMemo(()=>k?.id??B0(O)?.id,[k,O]),ne=GT(D,{id:F,role:`combobox`,"aria-expanded":T?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":T?te:void 0,"aria-labelledby":I,"aria-readonly":v||void 0,"aria-required":y||void 0,tabIndex:w?-1:0,ref:V,onFocus(e){l(!0),T&&x.current&&h(!1,p0(t0,e.nativeEvent)),H.start(0,()=>{m.set(`forceMount`,!0)})},onBlur(e){N0(O,e.relatedTarget)||(c(!0),l(!1),u===`onBlur`&&_.commit(E))},onPointerMove(){C.current=!1},onKeyDown(){C.current=!0},onMouseDown(e){if(T)return;let t=U1(e.currentTarget);function n(e){if(!R.current)return;let t=e.target;if(N0(R.current,t)||N0(L.current,t)||t===R.current)return;let n=qie(R.current);e.clientX>=n.left-C7&&e.clientX<=n.right+C7&&e.clientY>=n.top-C7&&e.clientY<=n.bottom+C7||h(!1,p0(u0,e))}U.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},_.getValidationProps,s,z);ne.role=`combobox`;let re={...d,open:T,disabled:w,value:E,readOnly:v,placeholder:!M};return AE(`button`,e,{ref:[t,R],state:re,stateAttributesMapping:Yie,props:ne})}),Zie={value:()=>null},Qie=b.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,...o}=e,{store:s,valueRef:c}=m7(),l=b5(s,S7.value),u=b5(s,S7.items),d=b5(s,S7.itemToStringLabel),f=b5(s,S7.hasSelectedValue),p=!f&&a!=null&&i==null,m=b5(s,S7.hasNullItemLabel,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(!f&&a!=null&&!m?a:Array.isArray(l)?Wie(l,u,d):x7(l,u,d)),AE(`span`,e,{state:h,ref:[t,c],props:[{children:g},o],stateAttributesMapping:Zie})}),$ie=b.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a}=m7();return AE(`span`,e,{state:{open:b5(a,S7.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},i],stateAttributesMapping:e6})}),eae=b.createContext(void 0),tae=b.forwardRef(function(e,t){let{store:n}=m7(),r=b5(n,S7.mounted),i=b5(n,S7.forceMount);return r||i?(0,G.jsx)(eae.Provider,{value:!0,children:(0,G.jsx)(R6,{ref:t,...e})}):null}),nae=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=r2(e,t)||{};if(l==null)return{};let f=x2(u),p={x:n,y:r},m=l2(i),h=s2(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=n2(k,j,A),N=!c.arrow&&a2(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),rae=(e,t)=>({...nae(e),options:[e,t]}),iae={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await rre().fn(e)).data?.referenceHidden||a}}}},T7={sideX:`left`,sideY:`top`},aae={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=fT(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:T7};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=U1(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=i2(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:T7.sideX,g=f===`top`?`bottom`:T7.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function E7(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function D7(e,t,n){let{rects:r,placement:i}=e;return{side:E7(t,i2(i),n),align:a2(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function O7(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:x}=e,[S,C]=b.useState(null);!m&&S!==null&&C(null);let w=h.side||`flip`,T=h.align||`flip`,E=h.fallbackAxisSide||`end`,D=typeof t==`function`?t:void 0,O=zT(D),k=D?O:t,A=p6(t),j=L1()===`rtl`,M=S||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":j?`left`:`right`,"inline-start":j?`right`:`left`}[r],N=a===`center`?M:`${M}-${a}`,P=c,F=r===`bottom`?1:0,I=r===`top`?1:0,L=r===`right`?1:0,R=r===`left`?1:0;typeof P==`number`?P={top:P+F,right:P+R,bottom:P+I,left:P+L}:P&&={top:(P.top||0)+F,right:(P.right||0)+R,bottom:(P.bottom||0)+I,left:(P.left||0)+L};let z={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:P},B=b.useRef(null),V=p6(i),H=p6(o),U=[Qne(e=>{let t=D7(e,r,j),n=typeof V.current==`function`?V.current(t):V.current,i=typeof H.current==`function`?H.current(t):H.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,j,r])],ee=T===`none`&&w!==`shift`,W=!ee&&(l||g||w===`shift`),te=w===`none`?null:tre({...z,padding:{top:P.top+1,right:P.right+1,bottom:P.bottom+1,left:P.left+1},mainAxis:!g&&w===`flip`,crossAxis:T===`flip`?`alignment`:!1,fallbackAxisSideDirection:E}),ne=ee?null:$ne(e=>{let t=U1(e.elements.floating).documentElement;return{...z,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:T!==`none`,crossAxis:W,limiter:l||g?void 0:ere(e=>{if(!B.current)return{};let{width:t,height:n}=B.current.getBoundingClientRect(),r=c2(i2(e.placement)),i=r===`y`?t:n,a=r===`y`?P.left+P.right:P.top+P.bottom;return{offset:i/2+a/2}})}},[z,l,g,P,T]);w===`shift`||T===`shift`||a===`center`?U.push(ne,te):U.push(te,ne),U.push(nre({...z,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=window.devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),rae(()=>({element:B.current||document.createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=i2(a),l=c2(c),u=B.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(D7(e,r,j)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,W&&l===`y`&&b?S:x),{}}},iae,v),$(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,p]);let re=b.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:ie,elements:ae,x:oe,y:se,middlewareData:ce,update:le,placement:ue,context:de,isPositioned:fe,floatingStyles:pe}=Fre({rootContext:p,placement:N,middleware:U,strategy:n,whileElementsMounted:f?void 0:(...e)=>Q8(...e,re),nodeId:_,externalTree:x}),{sideX:me,sideY:he}=ce.adaptiveOrigin||T7,ge=fe?n:`fixed`,_e=b.useMemo(()=>{let e=v?{position:ge,[me]:oe,[he]:se}:{position:ge,...pe};return fe||(e.opacity=0),e},[v,ge,me,oe,he,se,pe,fe]),ve=b.useRef(null);$(()=>{if(!m)return;let e=A.current,t=typeof e==`function`?e():e,n=(k7(t)?t.current:t)||null;n!==ve.current&&(ie.setPositionReference(n),ve.current=n)},[m,ie,k,A]),b.useEffect(()=>{if(!m)return;let e=A.current;typeof e!=`function`&&k7(e)&&e.current!==ve.current&&(ie.setPositionReference(e.current),ve.current=e.current)},[m,ie,k,A]),b.useEffect(()=>{if(f&&m&&ae.domReference&&ae.floating)return Q8(ae.domReference,ae.floating,le,re)},[f,m,ae,le,re]);let ye=i2(ue),be=E7(r,ye,j),xe=a2(ue)||`center`,Se=!!ce.hide?.referenceHidden;$(()=>{y&&m&&fe&&C(ye)},[y,m,fe,ye]);let Ce=b.useMemo(()=>({position:`absolute`,top:ce.arrow?.y,left:ce.arrow?.x}),[ce.arrow]),we=ce.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:_e,arrowStyles:Ce,arrowRef:B,arrowUncentered:we,side:be,align:xe,physicalSide:ye,anchorHidden:Se,refs:ie,context:de,isPositioned:fe,update:le}),[_e,Ce,B,we,be,xe,ye,Se,ie,de,fe,le])}function k7(e){return e!=null&&`current`in e}var A7=b.createContext(void 0);function j7(){let e=b.useContext(A7);if(!e)throw Error(rE(59));return e}function M7(e){return e===`starting`?TE:wE}function N7(e,t){e&&Object.assign(e.style,t)}var P7={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},oae={position:`fixed`},sae=b.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=DE,..._}=e,{store:v,listRef:y,labelsRef:x,alignItemWithTriggerActiveRef:S,selectedItemTextRef:C,valuesRef:w,initialValueRef:T,popupRef:E,setValue:D}=m7(),O=h7(),k=b5(v,S7.open),A=b5(v,S7.mounted),j=b5(v,S7.modal),M=b5(v,S7.value),N=b5(v,S7.openMethod),P=b5(v,S7.positionerElement),F=b5(v,S7.triggerElement),I=b5(v,S7.isItemEqualToValue),L=b5(v,S7.transitionStatus),R=b.useRef(null),z=b.useRef(null),[B,V]=b.useState(h),H=A&&B&&N!==`touch`;!A&&B!==h&&V(h),$(()=>{A||(S7.scrollUpArrowVisible(v.state)&&v.set(`scrollUpArrowVisible`,!1),S7.scrollDownArrowVisible(v.state)&&v.set(`scrollDownArrowVisible`,!1))},[v,A]),b.useImperativeHandle(S,()=>H),Q5((H||j)&&k&&N!==`touch`,F);let U=O7({anchor:n,floatingRootContext:O,positionMethod:r,mounted:A,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??H,collisionAvoidance:g,keepMounted:!0}),ee=H?`none`:U.side,W=H?oae:U.positionerStyles,te=b.useMemo(()=>{let e={};return k||(e.pointerEvents=`none`),{role:`presentation`,hidden:!A,style:{...W,...e}}},[k,A,W]),ne={open:k,side:ee,align:U.align,anchorHidden:U.anchorHidden},re=AE(`div`,e,{ref:[t,zT(e=>{v.set(`positionerElement`,e)})],state:ne,stateAttributesMapping:n6,props:[te,M7(L),_]}),ie=b.useRef(0),ae=zT(e=>{if(e.size===0&&ie.current===0||w.current.length===0)return;let t=ie.current;if(ie.current=e.size,e.size===t)return;let n=p0(t0);if(t!==0&&!v.state.multiple&&M!==null&&_7(w.current,M,I)===-1){let e=T.current,t=e!=null&&_7(w.current,e,I)!==-1?e:null;D(t,n),t===null&&(v.set(`selectedIndex`,null),C.current=null)}if(t!==0&&v.state.multiple&&Array.isArray(M)){let e=e=>_7(w.current,e,I)!==-1,t=M.filter(t=>e(t));(t.length!==M.length||t.some(e=>!Bie(M,e,I)))&&(D(t,n),t.length===0&&(v.set(`selectedIndex`,null),C.current=null))}if(k&&H){v.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};N7(P,e),N7(E.current,e)}}),oe=b.useMemo(()=>({...U,side:ee,alignItemWithTriggerActive:H,setControlledAlignItemWithTrigger:V,scrollUpArrowRef:R,scrollDownArrowRef:z}),[U,ee,H,V]);return(0,G.jsx)(M1,{elementsRef:y,labelsRef:x,onMapChange:ae,children:(0,G.jsxs)(A7.Provider,{value:oe,children:[A&&j&&(0,G.jsx)(q5,{inert:E4(!k),cutout:F}),re]})})});function F7(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}var I7=`base-ui-disable-scrollbar`,L7={className:I7,getElement(e){return(0,G.jsx)(`style`,{nonce:e,href:I7,precedence:`base-ui:low`,children:`.${I7}{scrollbar-width:none}.${I7}::-webkit-scrollbar{display:none}`})}},cae=b.createContext(void 0);function R7(e){let t=b.useContext(cae);if(t===void 0&&!e)throw Error(rE(69));return t}function z7(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var B7=1,lae={...n6,...A4},uae=b.forwardRef(function(e,t){let{render:n,className:r,finalFocus:i,...a}=e,{store:o,popupRef:s,onOpenChangeComplete:c,setOpen:l,valueRef:u,selectedItemTextRef:d,keyboardActiveRef:f,multiple:p,handleScrollArrowVisibility:m,scrollHandlerRef:h,highlightItemOnHover:g}=m7(),{side:_,align:v,alignItemWithTriggerActive:y,setControlledAlignItemWithTrigger:x,scrollDownArrowRef:S,scrollUpArrowRef:C}=j7(),w=R7(!0)!=null,T=h7(),{nonce:E,disableStyleElements:D}=T4(),O=c6(),k=b5(o,S7.id),A=b5(o,S7.open),j=b5(o,S7.mounted),M=b5(o,S7.popupProps),N=b5(o,S7.transitionStatus),P=b5(o,S7.triggerElement),F=b5(o,S7.positionerElement),I=b5(o,S7.listElement),L=b.useRef(0),R=b.useRef(!1),z=b.useRef(0),B=b.useRef(!1),V=b.useRef({}),H=P4(),U=zT(e=>{if(!F||!s.current||!B.current)return;if(R.current||!y){m();return}let t=F.style.top===`0px`,n=F.style.bottom===`0px`,r=F.getBoundingClientRect().height,i=U1(F),a=getComputedStyle(F),o=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),l=V7(getComputedStyle(s.current)),u=Math.min(i.documentElement.clientHeight-o-c,l),d=e.scrollTop,f=H7(e),p=0,h=null,g=!1,_=!1,v=e=>{F.style.height=`${e}px`},b=(t,n)=>{let i=z7(t,0,u-r);i>0&&v(r+i),e.scrollTop=n,u-(r+i)<=B7&&(R.current=!0),m()};if(t){let e=f-d,t=r+e,n=Math.min(t,u);if(p=n,e<=B7){b(e,f);return}u-n>B7?_=!0:g=!0}else if(n){let e=d,t=r+e,n=Math.min(t,u),i=t-u;if(p=n,e<=B7){b(e,0);return}u-n>B7?h=0:(g=!0,d<f&&(h=d-(e-i)))}if(p=Math.ceil(p),p!==0&&v(p),_||h!=null){let t=H7(e),n=_?t:z7(h,0,t);Math.abs(e.scrollTop-n)>B7&&(e.scrollTop=n)}(g||p>=u-B7)&&(R.current=!0),m()});b.useImperativeHandle(h,()=>U,[U]),L4({open:A,ref:s,onComplete(){A&&c?.(!0)}});let ee={open:A,transitionStatus:N,side:_,align:v};$(()=>{!F||!s.current||Object.keys(V.current).length||(V.current={top:F.style.top||`0`,left:F.style.left||`0`,right:F.style.right,height:F.style.height,bottom:F.style.bottom,minHeight:F.style.minHeight,maxHeight:F.style.maxHeight,marginTop:F.style.marginTop,marginBottom:F.style.marginBottom})},[s,F]),$(()=>{A||y||(B.current=!1,R.current=!1,L.current=0,z.current=0,N7(F,V.current))},[A,y,F,s]),$(()=>{let e=s.current;if(!(!A||!P||!F||!e||o.state.transitionStatus===`ending`)){if(!y){B.current=!0,H.request(m),e.style.removeProperty(`--transform-origin`);return}queueMicrotask(()=>{let t=fae(e);e.style.removeProperty(`--transform-origin`);try{let t=getComputedStyle(F),n=getComputedStyle(e),r=U1(P),i=fT(F),a=dae(P),o=U7(P.getBoundingClientRect(),a),s=U7(F.getBoundingClientRect(),a),c=o.left,l=o.height,f=I||e,p=f.scrollHeight,h=parseFloat(n.borderBottomWidth),g=parseFloat(t.marginTop)||10,_=parseFloat(t.marginBottom)||10,v=parseFloat(t.minHeight)||100,y=V7(n),b=r.documentElement.clientHeight-g-_,S=r.documentElement.clientWidth,C=b-o.bottom+l,w=d.current,T=u.current,E,D=0,O=0;if(w&&T){let e=U7(T.getBoundingClientRect(),a);E=U7(w.getBoundingClientRect(),a);let t=e.left-c,n=E.left-s.left,r=e.top-o.top+e.height/2,i=E.top-s.top+E.height/2;D=t-n,O=i-r}let k=C+O+_+h,A=Math.min(b,k),j=b-g-_,M=k-A,N=Math.max(5,c+D),z=S-5,H=Math.max(0,N+s.width-z);F.style.left=`${N-H}px`,F.style.height=`${A}px`,F.style.maxHeight=`auto`,F.style.marginTop=`${g}px`,F.style.marginBottom=`${_}px`,e.style.height=`100%`;let U=H7(f),ee=M>=U-B7;ee&&(A=Math.min(b,s.height)-(M-U));let W=o.top<20||o.bottom>b-20||Math.ceil(A)+B7<Math.min(p,v),te=(i.visualViewport?.scale??1)!==1&&v0;if(W||te){B.current=!0,N7(F,V.current),Lq.flushSync(()=>x(!1));return}if(ee){let e=Math.max(0,b-k);F.style.top=s.height>=j?`0`:`${e}px`,F.style.height=`${A}px`,f.scrollTop=H7(f),L.current=Math.max(v,A)}else F.style.bottom=`0`,L.current=Math.max(v,A),f.scrollTop=M;if(E){let t=s.top,n=s.height,r=E.top+E.height/2,i=z7(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(L.current===b||A>=y)&&(R.current=!0),m(),setTimeout(()=>{B.current=!0})}finally{t()}})}},[o,A,F,P,u,d,s,m,y,x,H,S,C,I]),b.useEffect(()=>{if(!y||!F||!A)return;let e=fT(F);function t(e){l(!1,p0(f0,e))}return e.addEventListener(`resize`,t),()=>{e.removeEventListener(`resize`,t)}},[l,y,F,A]);let W={...I?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":p||void 0,id:`${k}-list`},onKeyDown(e){f.current=!0,w&&e3.has(e.key)&&e.stopPropagation()},onMouseMove(){f.current=!1},onPointerLeave(e){if(!g||F7(e)||e.pointerType===`touch`)return;let t=e.currentTarget;O.start(0,()=>{o.set(`activeIndex`,null),t.focus({preventScroll:!0})})},onScroll(e){I||U(e.currentTarget)},...y&&{style:I?{height:`100%`}:P7}},te=AE(`div`,e,{ref:[t,s],state:ee,stateAttributesMapping:lae,props:[M,W,M7(N),{className:!I&&y?L7.className:void 0},a]});return(0,G.jsxs)(b.Fragment,{children:[!D&&L7.getElement(E),(0,G.jsx)(r8,{context:T,modal:!1,disabled:!j,returnFocus:i,restoreFocus:!0,children:te})]})});function V7(e){let t=e.maxHeight||``;return t.endsWith(`px`)&&parseFloat(t)||1/0}function H7(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function dae(e){return Y8.getScale(e)}function U7(e,t){return S2({x:e.x/t.x,y:e.y/t.y,width:e.width/t.x,height:e.height/t.y})}var W7=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function fae(e){let{style:t}=e,n={};for(let[e,r]of W7)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of W7){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var pae=b.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a,scrollHandlerRef:o}=m7(),{alignItemWithTriggerActive:s}=j7(),c=b5(a,S7.hasScrollArrows),l=b5(a,S7.openMethod),u=b5(a,S7.multiple),d={id:`${b5(a,S7.id)}-list`,role:`listbox`,"aria-multiselectable":u||void 0,onScroll(e){o.current?.(e.currentTarget)},...s&&{style:P7},className:c&&l!==`touch`?L7.className:void 0};return AE(`div`,e,{ref:[t,zT(e=>{a.set(`listElement`,e)})],props:[d,i]})}),G7=b.createContext(void 0);function K7(){let e=b.useContext(G7);if(!e)throw Error(rE(57));return e}var mae=b.memo(b.forwardRef(function(e,t){let{render:n,className:r,value:i=null,label:a,disabled:o=!1,nativeButton:s=!1,...c}=e,l=b.useRef(null),u=Z1({label:a,textRef:l,indexGuessBehavior:X1.GuessFromOrder}),{store:d,getItemProps:f,setOpen:p,setValue:m,selectionRef:h,typingRef:g,valuesRef:_,keyboardActiveRef:v,multiple:y,highlightItemOnHover:x}=m7(),S=c6(),C=b5(d,S7.isActive,u.index),w=b5(d,S7.isSelected,u.index,i),T=b5(d,S7.isSelectedByFocus,u.index),E=b5(d,S7.isItemEqualToValue),D=u.index,O=D!==-1,k=b.useRef(null),A=p6(D);$(()=>{if(!O)return;let e=_.current;return e[D]=i,()=>{delete e[D]}},[O,D,i,_]),$(()=>{if(!O)return;let e=d.state.value,t=e;y&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&g7(i,t,E)&&d.set(`selectedIndex`,D)},[O,D,y,E,d,i]);let j={disabled:o,selected:w,highlighted:C},M=f({active:C,selected:w});M.onFocus=void 0,M.id=void 0;let N=b.useRef(null),P=b.useRef(`mouse`),F=b.useRef(!1),{getButtonProps:I,buttonRef:L}=sE({disabled:o,focusableWhenDisabled:!0,native:s,composite:!0});function R(e){let t=d.state.value;if(y){let n=Array.isArray(t)?t:[];m(w?Vie(n,i,E):[...n,i],p0(a0,e))}else m(i,p0(a0,e)),p(!1,p0(a0,e))}let z={role:`option`,"aria-selected":w,tabIndex:C?0:-1,onFocus(){d.set(`activeIndex`,D)},onMouseEnter(){!v.current&&d.state.selectedIndex===null&&x&&d.set(`activeIndex`,D)},onMouseMove(){x&&d.set(`activeIndex`,D)},onMouseLeave(e){!x||v.current||F7(e)||S.start(0,()=>{d.state.activeIndex===D&&d.set(`activeIndex`,null)})},onTouchStart(){h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){N.current=e.key,d.set(`activeIndex`,D),e.key===` `&&g.current&&e.preventDefault()},onClick(e){F.current=!1,!(e.type===`keydown`&&N.current===null)&&(o||e.type===`keydown`&&N.current===` `&&g.current||P.current!==`touch`&&!C||(N.current=null,R(e.nativeEvent)))},onPointerEnter(e){P.current=e.pointerType},onPointerDown(e){P.current=e.pointerType,F.current=!0},onMouseUp(){if(o)return;if(F.current){F.current=!1;return}let e=!h.current.allowSelectedMouseUp&&w,t=!h.current.allowUnselectedMouseUp&&!w;e||t||P.current!==`touch`&&!C||k.current?.click()}},B=AE(`div`,e,{ref:[L,t,u.ref,k],state:j,props:[M,z,c,I]}),V=b.useMemo(()=>({selected:w,indexRef:A,textRef:l,selectedByFocus:T,hasRegistered:O}),[w,A,l,T,O]);return(0,G.jsx)(G7.Provider,{value:V,children:B})})),hae=b.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=K7();return n||r?(0,G.jsx)(gae,{...e,ref:t}):null}),gae=b.memo(b.forwardRef((e,t)=>{let{render:n,className:r,keepMounted:i,...a}=e,{selected:o}=K7(),s=b.useRef(null),{transitionStatus:c,setMounted:l}=R4(o),u=AE(`span`,e,{ref:[t,s],state:{selected:o,transitionStatus:c},props:[{"aria-hidden":!0,children:`✔️`},a],stateAttributesMapping:A4});return L4({open:o,ref:s,onComplete(){o||l(!1)}}),u})),_ae=b.memo(b.forwardRef(function(e,t){let{indexRef:n,textRef:r,selectedByFocus:i,hasRegistered:a}=K7(),{selectedItemTextRef:o}=m7(),{className:s,render:c,...l}=e;return AE(`div`,e,{ref:[b.useCallback(e=>{if(!e||!a)return;let t=o.current===null||!o.current.isConnected;(i||t&&n.current===0)&&(o.current=e)},[o,n,i,a]),t,r],props:l})})),q7=b.forwardRef(function(e,t){let{render:n,className:r,direction:i,keepMounted:a=!1,...o}=e,{store:s,popupRef:c,listRef:l,handleScrollArrowVisibility:u,scrollArrowsMountedCountRef:d}=m7(),{side:f,scrollDownArrowRef:p,scrollUpArrowRef:m}=j7(),h=b5(s,i===`up`?S7.scrollUpArrowVisible:S7.scrollDownArrowVisible),g=b5(s,S7.openMethod),_=h&&g!==`touch`,v=c6(),y=i===`up`?m:p,{transitionStatus:b,setMounted:x}=R4(_);$(()=>(d.current+=1,s.state.hasScrollArrows||s.set(`hasScrollArrows`,!0),()=>{d.current=Math.max(0,d.current-1),d.current===0&&s.state.hasScrollArrows&&s.set(`hasScrollArrows`,!1)}),[s,d]),L4({open:_,ref:y,onComplete(){_||x(!1)}});let S=AE(`div`,e,{ref:[t,y],state:{direction:i,visible:_,side:f,transitionStatus:b},props:[{"aria-hidden":!0,children:i===`up`?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||v.isStarted())return;s.set(`activeIndex`,null);function t(){let e=s.state.listElement??c.current;if(!e)return;s.set(`activeIndex`,null),u();let n=e.scrollTop===0,r=Math.round(e.scrollTop+e.clientHeight)>=e.scrollHeight;if(l.current.length===0&&(i===`up`?s.set(`scrollUpArrowVisible`,!n):s.set(`scrollDownArrowVisible`,!r)),i===`up`&&n||i===`down`&&r){v.clear();return}if((s.state.listElement||c.current)&&l.current&&l.current.length>0){let t=l.current,n=y.current?.offsetHeight||0;if(i===`up`){let r=0,i=e.scrollTop+n;for(let e=0;e<t.length;e+=1){let n=t[e];if(n&&n.offsetTop>=i){r=e;break}}let a=Math.max(0,r-1);if(a<r){let r=t[a];r&&(e.scrollTop=Math.max(0,r.offsetTop-n))}else e.scrollTop=0}else{let r=t.length-1,i=e.scrollTop+e.clientHeight-n;for(let e=0;e<t.length;e+=1){let n=t[e];if(n&&n.offsetTop+n.offsetHeight>i){r=Math.max(0,e-1);break}}let a=Math.min(t.length-1,r+1);if(a>r){let r=t[a];r&&(e.scrollTop=r.offsetTop+r.offsetHeight-e.clientHeight+n)}else e.scrollTop=e.scrollHeight-e.clientHeight}}v.start(40,t)}v.start(40,t)},onMouseLeave(){v.clear()}},o]});return _||a?S:null}),vae=b.forwardRef(function(e,t){return(0,G.jsx)(q7,{...e,ref:t,direction:`down`})}),yae=b.forwardRef(function(e,t){return(0,G.jsx)(q7,{...e,ref:t,direction:`up`})}),bae=b.createContext(void 0),xae=b.forwardRef(function(e,t){let{className:n,render:r,...i}=e,[a,o]=b.useState(),s=b.useMemo(()=>({labelId:a,setLabelId:o}),[a,o]),c=AE(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":a},i]});return(0,G.jsx)(bae.Provider,{value:s,children:c})}),J7=Gie;function Y7({className:e,...t}){return(0,G.jsx)(xae,{"data-slot":`select-group`,className:cO(`scroll-my-1`,e),...t})}function X7({className:e,...t}){return(0,G.jsx)(Qie,{"data-slot":`select-value`,className:cO(`flex flex-1 text-left`,e),...t})}function Z7({className:e,size:t=`default`,children:n,...r}){return(0,G.jsxs)(Xie,{"data-slot":`select-trigger`,"data-size":t,className:cO(`border-input data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-none border bg-transparent py-2 pr-2 pl-2.5 text-xs transition-colors select-none focus-visible:ring-1 aria-invalid:ring-1 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-none *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...r,children:[n,(0,G.jsx)($ie,{render:(0,G.jsx)(nn,{className:`text-muted-foreground size-4 pointer-events-none`})})]})}function Q7({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,G.jsx)(tae,{children:(0,G.jsx)(sae,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,G.jsxs)(uae,{"data-slot":`select-content`,className:cO(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open: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 ring-foreground/10 min-w-36 rounded-none shadow-md ring-1 duration-100 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto`,e),...s,children:[(0,G.jsx)(Sae,{}),(0,G.jsx)(pae,{children:t}),(0,G.jsx)(Cae,{})]})})})}function $7({className:e,children:t,...n}){return(0,G.jsxs)(mae,{"data-slot":`select-item`,className:cO(`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-none py-2 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...n,children:[(0,G.jsx)(_ae,{className:`flex flex-1 gap-2 shrink-0 whitespace-nowrap`,children:t}),(0,G.jsx)(hae,{render:(0,G.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,G.jsx)(tn,{className:`pointer-events-none`})})]})}function Sae({className:e,...t}){return(0,G.jsx)(yae,{"data-slot":`select-scroll-up-button`,className:cO(`bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full`,e),...t,children:(0,G.jsx)(rn,{})})}function Cae({className:e,...t}){return(0,G.jsx)(vae,{"data-slot":`select-scroll-down-button`,className:cO(`bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full`,e),...t,children:(0,G.jsx)(nn,{})})}var e9=b.createContext(void 0);function wae(){let e=b.useContext(e9);if(e===void 0)throw Error(rE(63));return e}var t9=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),n9={...a7,checked(e){return e?{[t9.checked]:``}:{[t9.unchecked]:``}}};function Tae(e,t,n,r=!0,i){let[a,o]=b.useState(),s=J1(i?`${i}-label`:void 0),c=e??t??a;return $(()=>{let i=e||t||!r?void 0:Eae(n.current,s);a!==i&&o(i)}),c}function Eae(e,t){let n=Dae(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function Dae(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var Oae=b.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,id:o,inputRef:s,name:c,nativeButton:l=!1,onCheckedChange:u,readOnly:d=!1,required:f=!1,disabled:p=!1,render:m,uncheckedValue:h,value:g,..._}=e,{clearErrors:v}=s7(),{state:y,setTouched:x,setDirty:S,validityData:C,setFilled:w,setFocused:T,shouldValidateOnChange:E,validationMode:D,disabled:O,name:k,validation:A}=o7(),{labelId:j}=c7(),M=O||p,N=k??c,P=zT(u),F=b.useRef(null),I=uE(F,s,A.inputRef),L=b.useRef(null),R=J1(),z=l7({id:o,implicit:!1,controlRef:L}),B=l?void 0:z,[V,H]=k1({controlled:n,default:!!i,name:`Switch`,state:`checked`});u7({id:R,commit:A.commit,value:V,controlRef:L,name:N,getValue:()=>V}),$(()=>{F.current&&w(F.current.checked)},[F,w]),$5(V,()=>{v(N),S(V!==C.initialValue),w(V),E()?A.commit(V):A.commit(V,!0)});let{getButtonProps:U,buttonRef:ee}=sE({disabled:M,native:l}),W=Tae(a,j,F,!l,B),te={id:l?z:R,role:`switch`,"aria-checked":V,"aria-readonly":d||void 0,"aria-required":f||void 0,"aria-labelledby":W,onFocus(){M||T(!0)},onBlur(){let e=F.current;!e||M||(x(!0),T(!1),D===`onBlur`&&A.commit(e.checked))},onClick(e){d||M||(e.preventDefault(),F.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},ne=b.useMemo(()=>GT({checked:V,disabled:M,id:B,name:N,required:f,style:N?_6:g6,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:I,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=p0(t0,e.nativeEvent);P?.(t,n),!n.isCanceled&&H(t)},onFocus(){L.current?.focus()}},A.getInputValidationProps,g===void 0?wE:{value:g}),[V,M,I,B,N,P,f,H,A,g]),re=b.useMemo(()=>({...y,checked:V,disabled:M,readOnly:d,required:f}),[y,V,M,d,f]),ie=AE(`span`,e,{state:re,ref:[t,L,ee],props:[te,A.getValidationProps,_,U],stateAttributesMapping:n9});return(0,G.jsxs)(e9.Provider,{value:re,children:[ie,!V&&N&&h!==void 0&&(0,G.jsx)(`input`,{type:`hidden`,name:N,value:h}),(0,G.jsx)(`input`,{...ne})]})}),kae=b.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=o7(),o=wae();return AE(`span`,e,{state:{...a,...o},ref:t,stateAttributesMapping:n9,props:i})});function r9({className:e,size:t=`default`,...n}){return(0,G.jsx)(Oae,{"data-slot":`switch`,"data-size":t,className:cO(`cursor-pointer data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-1 aria-invalid:ring-1 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,G.jsx)(kae,{"data-slot":`switch-thumb`,className:`bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform`})})}function Aae({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:cO(`border-input dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-disabled:bg-input/50 dark:has-disabled:bg-input/80 h-8 rounded-none border transition-colors has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-1 has-[[data-slot][aria-invalid=true]]:ring-1 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto`,e),...t})}var jae=BE(`text-muted-foreground h-auto gap-2 py-1.5 text-xs font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-none [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none`,{variants:{align:{"inline-start":`pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem] order-first`,"inline-end":`pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem] order-last`,"block-start":`px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start`,"block-end":`px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start`}},defaultVariants:{align:`inline-start`}});function Mae({className:e,align:t=`inline-start`,...n}){return(0,G.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:cO(jae({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}function Nae({className:e,...t}){return(0,G.jsx)(t1,{"data-slot":`command`,className:cO(`bg-popover text-popover-foreground rounded-none flex size-full flex-col overflow-hidden`,e),...t})}function Pae({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`border-b pb-0`,children:(0,G.jsxs)(Aae,{className:`bg-input/30 border-input/30 h-8 border-none shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[(0,G.jsx)(t1.Input,{"data-slot":`command-input`,className:cO(`w-full text-xs outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,G.jsx)(Mae,{children:(0,G.jsx)(pn,{className:`size-4 shrink-0 opacity-50`})})]})})}function Fae({className:e,...t}){return(0,G.jsx)(t1.List,{"data-slot":`command-list`,className:cO(`no-scrollbar max-h-72 scroll-py-0 outline-none overflow-x-hidden overflow-y-auto`,e),...t})}function Iae({className:e,...t}){return(0,G.jsx)(t1.Empty,{"data-slot":`command-empty`,className:cO(`py-6 text-center text-xs`,e),...t})}function Lae({className:e,...t}){return(0,G.jsx)(t1.Group,{"data-slot":`command-group`,className:cO(`text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs`,e),...t})}function Rae({className:e,children:t,...n}){return(0,G.jsxs)(t1.Item,{"data-slot":`command-item`,className:cO(`data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-none px-2 py-2 text-xs outline-hidden select-none [&_svg:not([class*='size-'])]:size-4 in-data-[slot=dialog-content]:rounded-none! group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...n,children:[t,(0,G.jsx)(tn,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}var i9=b.createContext(void 0);function a9(e){let t=b.useContext(i9);if(t===void 0&&!e)throw Error(rE(47));return t}function zae(){return{...D5(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var Bae={...k5,disabled:_5(e=>e.disabled),instantType:_5(e=>e.instantType),openMethod:_5(e=>e.openMethod),openChangeReason:_5(e=>e.openChangeReason),modal:_5(e=>e.modal),stickIfOpen:_5(e=>e.stickIfOpen),titleElementId:_5(e=>e.titleElementId),descriptionElementId:_5(e=>e.descriptionElementId),openOnHover:_5(e=>e.openOnHover),closeDelay:_5(e=>e.closeDelay),hasViewport:_5(e=>e.hasViewport)},Vae=class e extends S5{constructor(e){let t={...zae(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),stickIfOpenTimeout:new s6,triggerElements:new E5},Bae)}setOpen=(e,t)=>{let n=t.reason===r0,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let a={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger};this.state.floatingRootContext.context.events?.emit(`openchange`,a);let o=()=>{let n={open:e,openChangeReason:t.reason},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),Lq.flushSync(o)):o(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let r=IT(()=>new e(n)).current,i=t??r;return S4(r.disposeEffect),i}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function o9({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=Vae.useStore(s?.store,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});J5(()=>{n===void 0&&u.state.open===!1&&r===!0&&u.update({open:!0,activeTriggerId:l})}),u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`positionerElement`),p=u.useState(`payload`),m=u.useState(`openChangeReason`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a);let{openMethod:h,triggerProps:g}=e7(d);w5(u);let{forceUnmount:_}=T5(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});Q5(d&&o===!0&&m!==`trigger-hover`&&h!==`touch`,f),b.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let v=b.useCallback(e=>{let t=p0(e);return t.preventUnmountOnClose=()=>{u.set(`preventUnmountingOnClose`,!0)},t},[u]),y=b.useCallback(()=>{u.setOpen(!1,v(d0))},[u,v]);b.useImperativeHandle(e.actionsRef,()=>({unmount:_,close:y}),[_,y]);let x=j5({popupStore:u,onOpenChange:u.setOpen}),{getReferenceProps:S,getFloatingProps:C,getTriggerProps:w}=P5([c8(x,{outsidePressEvent:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),B5(x)]),T=b.useMemo(()=>S(g),[S,g]),E=b.useMemo(()=>w(g),[w,g]),D=b.useMemo(()=>C(),[C]);u.useSyncedValues({modal:o,openMethod:h,activeTriggerProps:T,inactiveTriggerProps:E,popupProps:D,floatingRootContext:x,nested:U6()!=null});let O=b.useMemo(()=>({store:u}),[u]);return(0,G.jsx)(i9.Provider,{value:O,children:typeof t==`function`?t({payload:p}):t})}function Hae(e){return a9(!0)?(0,G.jsx)(o9,{props:e}):(0,G.jsx)(q6,{children:(0,G.jsx)(o9,{props:e})})}var Uae=b.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,handle:o,payload:s,openOnHover:c=!1,delay:l=300,closeDelay:u=0,id:d,...f}=e,p=a9(!0),m=o?.store??p?.store;if(!m)throw Error(rE(74));let h=J1(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`floatingRootContext`),v=m.useState(`isOpenedByTrigger`,h),y=b.useRef(null),{registerTrigger:x,isMountedByThisTrigger:S}=Nre(h,y,m,{payload:s,disabled:i,openOnHover:c,closeDelay:u}),C=m.useState(`openChangeReason`),w=m.useState(`stickIfOpen`),T=m.useState(`openMethod`),E=Hre(_,{enabled:_!=null&&c&&(T!==`touch`||C!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:Zre(),restMs:l,delay:{close:u},triggerElementRef:y,isActiveTrigger:g}),D=P5([i8(_,{enabled:_!=null,stickIfOpen:w})]),O=m.useState(`triggerProps`,S),k={disabled:i,open:v},{getButtonProps:A,buttonRef:j}=sE({disabled:i,native:a}),M=b.useMemo(()=>({open(e){return e&&C===`trigger-press`?t6.open(e):e6.open(e)}}),[C]),N=AE(`button`,e,{state:k,ref:[j,t,x,y],props:[D.getReferenceProps(),E,O,{[EE]:``,id:h},f,A],stateAttributesMapping:M}),P=b.useRef(null),F=zT(e=>{Lq.flushSync(()=>{m.setOpen(!1,p0(s0,e.nativeEvent,e.currentTarget))}),g4(P.current)?.focus()}),I=zT(e=>{let t=m.select(`positionerElement`);if(t&&_4(e,t))m.context.beforeContentFocusGuardRef.current?.focus();else{Lq.flushSync(()=>{m.setOpen(!1,p0(s0,e.nativeEvent,e.currentTarget))});let n=h4(m.context.triggerFocusTargetRef.current||y.current);for(;n!==null&&N0(t,n);){let e=n;if(n=f4(n),n===e)break}n?.focus()}});return g?(0,G.jsxs)(b.Fragment,{children:[(0,G.jsx)(v6,{ref:P,onFocus:F}),(0,G.jsx)(b.Fragment,{children:N},h),(0,G.jsx)(v6,{ref:m.context.triggerFocusTargetRef,onFocus:I})]}):(0,G.jsx)(b.Fragment,{children:N},h)}),s9=b.createContext(void 0);function Wae(){let e=b.useContext(s9);if(e===void 0)throw Error(rE(45));return e}var Gae=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=a9();return i.useState(`mounted`)||n?(0,G.jsx)(s9.Provider,{value:n,children:(0,G.jsx)(R6,{ref:t,...r})}):null}),c9=b.createContext(void 0);function Kae(){let e=b.useContext(c9);if(!e)throw Error(rE(46));return e}var qae=b.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=OE,...g}=e,{store:_}=a9(),v=Wae(),y=G6(),x=_.useState(`floatingRootContext`),S=_.useState(`mounted`),C=_.useState(`open`),w=_.useState(`openChangeReason`),T=_.useState(`activeTriggerElement`),E=_.useState(`modal`),D=_.useState(`positionerElement`),O=_.useState(`instantType`),k=_.useState(`transitionStatus`),A=_.useState(`hasViewport`),j=b.useRef(null),M=I4(D,!1,!1),N=O7({anchor:i,floatingRootContext:x,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:v,nodeId:y,collisionAvoidance:h,adaptiveOrigin:A?aae:void 0}),P=b.useMemo(()=>{let e={};return C||(e.pointerEvents=`none`),{role:`presentation`,hidden:!S,style:{...N.positionerStyles,...e}}},[C,S,N.positionerStyles]),F=b.useMemo(()=>({props:P,...N}),[P,N]),I=x.useState(`domReferenceElement`);$(()=>{let e=I,t=j.current;if(e&&(j.current=e),t&&e&&e!==t){_.set(`instantType`,void 0);let e=new AbortController;return M(()=>{_.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,M,_]);let L={open:C,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:O},R=b.useCallback(e=>{_.set(`positionerElement`,e)},[_]),z=AE(`div`,e,{state:L,props:[F.props,M7(k),g],ref:[t,R],stateAttributesMapping:n6});return(0,G.jsxs)(c9.Provider,{value:F,children:[S&&E===!0&&w!==`trigger-hover`&&(0,G.jsx)(q5,{ref:_.context.internalBackdropRef,inert:E4(!C),cutout:T}),(0,G.jsx)(K6,{id:y,children:z})]})}),Jae=b.createContext(void 0);function Yae(){let[e,t]=b.useState(0),n=zT(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:b.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function Xae(e){let{value:t,children:n}=e;return(0,G.jsx)(Jae.Provider,{value:t,children:n})}var Zae={...n6,...A4},Qae=b.forwardRef(function(e,t){let{className:n,render:r,initialFocus:i,finalFocus:a,...o}=e,{store:s}=a9(),c=Kae(),l=R7(!0)!=null,{context:u,hasClosePart:d}=Yae(),f=s.useState(`open`),p=s.useState(`openMethod`),m=s.useState(`instantType`),h=s.useState(`transitionStatus`),g=s.useState(`popupProps`),_=s.useState(`titleElementId`),v=s.useState(`descriptionElementId`),y=s.useState(`modal`),x=s.useState(`mounted`),S=s.useState(`openChangeReason`),C=s.useState(`activeTriggerElement`),w=s.useState(`floatingRootContext`);L4({open:f,ref:s.context.popupRef,onComplete(){f&&s.context.onOpenChangeComplete?.(!0)}});let T=s.useState(`disabled`),E=s.useState(`openOnHover`),D=s.useState(`closeDelay`);Bre(w,{enabled:E&&!T,closeDelay:D});function O(e){return e===`touch`?s.context.popupRef.current:!0}let k=i===void 0?O:i,A={open:f,side:c.side,align:c.align,instant:m,transitionStatus:h},j=y!==!1&&d,M=b.useCallback(e=>{s.set(`popupElement`,e)},[s]),N=AE(`div`,e,{state:A,ref:[t,s.context.popupRef,M],props:[g,{"aria-labelledby":_,"aria-describedby":v,onKeyDown(e){l&&e3.has(e.key)&&e.stopPropagation()}},M7(h),o],stateAttributesMapping:Zae});return(0,G.jsx)(r8,{context:w,openInteractionType:p,modal:j,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:a,restoreFocus:`popup`,previousFocusableElement:gT(C)?C:void 0,nextFocusableElement:s.context.triggerFocusTargetRef,beforeContentFocusGuardRef:s.context.beforeContentFocusGuardRef,children:(0,G.jsx)(Xae,{value:u,children:N})})});function $ae({...e}){return(0,G.jsx)(Hae,{"data-slot":`popover`,...e})}function eoe({...e}){return(0,G.jsx)(Uae,{"data-slot":`popover-trigger`,...e})}function toe({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,G.jsx)(Gae,{children:(0,G.jsx)(qae,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,G.jsx)(Qae,{"data-slot":`popover-content`,className:cO(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open: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 ring-foreground/10 flex flex-col gap-2.5 rounded-none p-2.5 text-xs shadow-md ring-1 duration-100 z-50 w-72 origin-(--transform-origin) outline-hidden`,e),...a})})})}var l9=[{value:`en-US`,label:`English (US)`},{value:`es-ES`,label:`español (España)`},{value:`fr-FR`,label:`français (France)`},{value:`de-DE`,label:`Deutsch`},{value:`it-IT`,label:`italiano`},{value:`am-ET`,label:`አማርኛ`},{value:`ar`,label:`العربية`},{value:`bg-BG`,label:`български`},{value:`bn-BD`,label:`বাংলা`},{value:`bs-BA`,label:`bosanski`},{value:`ca-ES`,label:`català`},{value:`cs-CZ`,label:`čeština`},{value:`da-DK`,label:`dansk`},{value:`el-GR`,label:`Ελληνικά`},{value:`es-419`,label:`español (Latinoamérica)`},{value:`et-EE`,label:`eesti`},{value:`fi-FI`,label:`suomi`},{value:`fr-CA`,label:`français (Canada)`},{value:`gu-IN`,label:`ગુજરાતી`},{value:`hi-IN`,label:`हिन्दी`},{value:`hr-HR`,label:`hrvatski`},{value:`hu-HU`,label:`magyar`},{value:`hy-AM`,label:`հայերեն`},{value:`id-ID`,label:`Indonesia`},{value:`is-IS`,label:`íslenska`},{value:`ja-JP`,label:`日本語`},{value:`ka-GE`,label:`ქართული`},{value:`kk-KZ`,label:`қазақ тілі`},{value:`kn-IN`,label:`ಕನ್ನಡ`},{value:`ko-KR`,label:`한국어`},{value:`lt-LT`,label:`lietuvių`},{value:`lv-LV`,label:`latviešu`},{value:`mk-MK`,label:`македонски`},{value:`ml-IN`,label:`മലയാളം`},{value:`mn-MN`,label:`монгол`},{value:`mr-IN`,label:`मराठी`},{value:`ms-MY`,label:`Bahasa Melayu`},{value:`my-MM`,label:`မြန်မာ`},{value:`nb-NO`,label:`norsk bokmål`},{value:`nl-NL`,label:`Nederlands`},{value:`pa-IN`,label:`ਪੰਜਾਬੀ`},{value:`pl-PL`,label:`polski`},{value:`pt-BR`,label:`português (Brasil)`},{value:`pt-PT`,label:`português (Portugal)`},{value:`ro-RO`,label:`română`},{value:`ru-RU`,label:`русский`},{value:`sk-SK`,label:`slovenčina`},{value:`sl-SI`,label:`slovenščina`},{value:`so-SO`,label:`Soomaali`},{value:`sq-AL`,label:`shqip`},{value:`sr-RS`,label:`српски`},{value:`sv-SE`,label:`svenska`},{value:`sw-KE`,label:`Kiswahili`},{value:`ta-IN`,label:`தமிழ்`},{value:`te-IN`,label:`తెలుగు`},{value:`th-TH`,label:`ไทย`},{value:`tl-PH`,label:`Tagalog`},{value:`tr-TR`,label:`Türkçe`},{value:`uk-UA`,label:`українська`},{value:`ur-PK`,label:`اردو`},{value:`vi-VN`,label:`Tiếng Việt`},{value:`zh-Hans`,label:`简体中文`},{value:`zh-Hant-HK`,label:`繁體中文(香港)`},{value:`zh-Hant-TW`,label:`繁體中文(台灣)`}],noe=({value:e,onValueChange:t})=>{let[n,r]=(0,b.useState)(!1),i=l9.find(t=>t.value===e);return(0,G.jsxs)($ae,{open:n,onOpenChange:r,children:[(0,G.jsx)(eoe,{children:(0,G.jsxs)(lO,{variant:`outline`,role:`combobox`,"aria-expanded":n,className:`w-full justify-between`,children:[i?(0,G.jsxs)(`span`,{children:[i.value,(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`- `,i.label]})]}):`Select locale...`,(0,G.jsx)(an,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,G.jsx)(toe,{className:`w-full p-0`,children:(0,G.jsxs)(Nae,{children:[(0,G.jsx)(Pae,{placeholder:`Search locale...`}),(0,G.jsxs)(Fae,{children:[(0,G.jsx)(Iae,{children:`No locale found.`}),(0,G.jsx)(Lae,{children:l9.map(n=>(0,G.jsxs)(Rae,{value:n.value,onSelect:n=>{t(n===e?``:n),r(!1)},children:[(0,G.jsxs)(`span`,{children:[n.label,` `,(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,n.value,`)`]})]}),(0,G.jsx)(tn,{className:cO(`ml-auto h-4 w-4`,e===n.value?`opacity-100`:`opacity-0`)})]},n.value))})]})]})})]})};function roe({resourceUri:e}){let{data:t}=lT(e);return t?(0,G.jsx)(`div`,{className:`text-xs`,children:(0,G.jsx)(W3,{src:t.contents[0],name:null,quotesOnKeys:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!1,theme:`rjv-default`,style:{fontSize:`0.75rem`},collapsed:4,collapseStringsAfterLength:80})}):null}var ioe=()=>{let e=cT(),{openaiRef:t,openaiObject:n,openInAppUrl:r}=KS(e.name),{setToolData:i}=GS(),a=e._meta?.[`openai/outputTemplate`],o=(r,a)=>{let o=t?.current?.contentWindow?.openai;o&&n&&(o[r]=a,i(e.name,{openaiObject:{...n,[r]:a}}))};return n?(0,G.jsx)(`div`,{className:`overflow-auto max-h-full min-h-0`,children:(0,G.jsxs)(m3,{defaultValue:`widget-state`,className:`gap-0`,children:[(0,G.jsxs)(g3,{className:`border-b border-border w-full`,children:[(0,G.jsx)(_3,{value:`properties`,children:`Properties`}),(0,G.jsx)(_3,{value:`widget-state`,children:`Widget State`}),a&&(0,G.jsx)(_3,{value:`resource`,children:`Resource`})]}),(0,G.jsx)(v3,{value:`properties`,className:`p-4`,children:(0,G.jsxs)(kie,{children:[(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Display Mode`}),(0,G.jsxs)(J7,{value:n.displayMode,onValueChange:e=>o(`displayMode`,e),"aria-label":`Select framework`,items:[{label:`Inline`,value:`inline`},{label:`Fullscreen`,value:`fullscreen`},{label:`Pip`,value:`pip`},{label:`Modal`,value:`modal`}],name:`displayMode`,required:!0,children:[(0,G.jsx)(Z7,{children:(0,G.jsx)(X7,{})}),(0,G.jsx)(Q7,{children:(0,G.jsxs)(Y7,{children:[(0,G.jsx)($7,{value:`inline`,children:`Inline`}),(0,G.jsx)($7,{value:`fullscreen`,children:`Fullscreen`}),(0,G.jsx)($7,{value:`pip`,children:`Pip`}),(0,G.jsx)($7,{value:`modal`,children:`Modal`})]})})]})]}),(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Theme`}),(0,G.jsxs)(Die,{children:[(0,G.jsx)(lO,{variant:n.theme===`light`?`default`:`outline`,onClick:()=>o(`theme`,`light`),children:(0,G.jsx)(mn,{})}),(0,G.jsx)(lO,{variant:n.theme===`dark`?`default`:`outline`,onClick:()=>o(`theme`,`dark`),children:(0,G.jsx)(un,{})})]})]}),(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Locale`}),(0,G.jsx)(noe,{value:n.locale,onValueChange:e=>o(`locale`,e)})]}),(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Max Height`}),(0,G.jsx)(d7,{type:`number`,value:n.maxHeight===void 0?``:String(n.maxHeight),onChange:e=>{let t=e.target.value.trim();o(`maxHeight`,t===``?void 0:Number(t))}})]}),(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Safe Area Insets`}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-4`,children:[`top`,`bottom`,`left`,`right`].map(e=>{let t=e.charAt(0).toUpperCase()+e.slice(1);return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`safeArea-${e}`,className:`text-xs text-muted-foreground block mb-1`,children:t}),(0,G.jsx)(d7,{id:`safeArea-${e}`,type:`number`,value:n.safeArea?.insets?.[e]===void 0?`0`:String(n.safeArea.insets[e]),onChange:t=>{let r=t.target.value.trim();o(`safeArea`,{...n.safeArea,insets:{...n.safeArea?.insets,[e]:r===``?0:Number(r)}})}})]},e)})})]}),(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Device Type`}),(0,G.jsxs)(J7,{value:n.userAgent?.device?.type??`desktop`,onValueChange:e=>o(`userAgent`,{...n.userAgent,device:{...n.userAgent?.device,type:e}}),"aria-label":`Select device type`,items:[{label:`Mobile`,value:`mobile`},{label:`Desktop`,value:`desktop`}],name:`deviceType`,required:!0,children:[(0,G.jsx)(Z7,{children:(0,G.jsx)(X7,{})}),(0,G.jsx)(Q7,{children:(0,G.jsxs)(Y7,{children:[(0,G.jsx)($7,{value:`mobile`,children:`Mobile`}),(0,G.jsx)($7,{value:`desktop`,children:`Desktop`})]})})]})]}),(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Capabilities`}),(0,G.jsxs)(`div`,{className:`flex gap-8`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`label`,{htmlFor:`hover`,className:`text-xs text-muted-foreground cursor-pointer`,children:`Hover`}),(0,G.jsx)(r9,{id:`hover`,checked:n.userAgent?.capabilities?.hover??!1,onCheckedChange:e=>o(`userAgent`,{...n.userAgent,capabilities:{...n.userAgent?.capabilities,hover:e}})})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`label`,{htmlFor:`touch`,className:`text-xs text-muted-foreground cursor-pointer`,children:`Touch`}),(0,G.jsx)(r9,{id:`touch`,checked:n.userAgent?.capabilities?.touch??!1,onCheckedChange:e=>o(`userAgent`,{...n.userAgent,capabilities:{...n.userAgent?.capabilities,touch:e}})})]})]})]}),(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Open in App URL`}),(0,G.jsx)(d7,{type:`text`,value:r??``,readOnly:!0,placeholder:`Not set`,className:`font-mono text-xs`})]})]})}),(0,G.jsx)(v3,{value:`widget-state`,className:`p-4`,children:(0,G.jsx)(W3,{src:n.widgetState??{},name:null,quotesOnKeys:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!1,theme:`rjv-default`,collapsed:3,collapseStringsAfterLength:80})}),a&&(0,G.jsx)(v3,{value:`resource`,className:`p-4`,children:(0,G.jsx)(b.Suspense,{fallback:(0,G.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Loading resource...`}),children:(0,G.jsx)(roe,{resourceUri:a})})})]})}):null};function u9(e){return new Date(e).toLocaleTimeString(`en-US`,{hour12:!1,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,fractionalSecondDigits:3})}function aoe(e,t=60){let n=JSON.stringify(e);return n.length>t?`${n.slice(0,t)}…`:n}function ooe({log:e}){let[t,n]=(0,b.useState)(!1),r=Object.keys(e.args).length>0,i=r?aoe(e.args):null;return(0,G.jsxs)(G.Fragment,{children:[r?(0,G.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex items-center gap-2 py-1.5 px-2 text-xs font-mono border-b border-gray-200 dark:border-gray-800/50 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800/30 w-full text-left`,children:[(0,G.jsx)(`span`,{className:`text-gray-600 dark:text-gray-500 shrink-0 min-w-[80px]`,children:u9(e.timestamp)}),(0,G.jsx)(`span`,{className:cO(`font-semibold shrink-0 min-w-[120px]`,e.type===`response`?`text-green-600 dark:text-green-400`:`text-blue-600 dark:text-blue-400`),children:e.command}),(0,G.jsx)(`span`,{className:`text-gray-500 dark:text-gray-600 mr-1`,children:t?`▼`:`▶`}),(0,G.jsx)(`span`,{className:`text-gray-600 dark:text-gray-400 truncate flex-1 min-w-0`,children:i})]}):(0,G.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5 px-2 text-xs font-mono border-b border-gray-200 dark:border-gray-800/50`,children:[(0,G.jsx)(`span`,{className:`text-gray-600 dark:text-gray-500 shrink-0 min-w-[80px]`,children:u9(e.timestamp)}),(0,G.jsx)(`span`,{className:`text-blue-600 dark:text-blue-400 font-semibold shrink-0 min-w-[120px]`,children:e.command})]}),t&&r&&(0,G.jsx)(`div`,{className:`px-2 py-2 bg-gray-50 dark:bg-gray-900/30 border-b border-gray-200 dark:border-gray-800/50`,children:(0,G.jsx)(`pre`,{className:`text-xs font-mono text-gray-800 dark:text-gray-200 whitespace-pre-wrap overflow-x-auto`,children:JSON.stringify(e.args,null,2)})})]})}function soe(){let e=cT(),{setToolData:t}=GS(),{openaiLogs:n}=KS(e.name),r=(0,b.useRef)(null);return(0,b.useEffect)(()=>{let e=r.current;e&&(e.scrollTop=e.scrollHeight)},[]),(0,G.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden min-h-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between mb-3 h-8 flex-none`,children:[(0,G.jsx)(`h3`,{className:`text-sm font-semibold text-gray-900 dark:text-gray-200`,children:`MCP client logs`}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:n.length>0&&(0,G.jsxs)(lO,{variant:`ghost`,size:`sm`,onClick:()=>{t(e.name,{openaiLogs:[]})},children:[(0,G.jsx)(hn,{className:`w-3 h-3`}),`Clear`]})})]}),(0,G.jsx)(`div`,{ref:r,className:`overflow-auto flex-1 bg-gray-50 rounded-lg border border-gray-200 min-h-0`,children:n.map(e=>(0,G.jsx)(ooe,{log:e},e.id))})]})}var coe=BE(`relative grid w-full items-start gap-x-2 gap-y-0.5 rounded-xl border px-3.5 py-3 text-card-foreground text-sm has-[>svg]:has-data-[slot=alert-action]:grid-cols-[calc(var(--spacing)*4)_1fr_auto] has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-data-[slot=alert-action]:grid-cols-[1fr_auto] has-[>svg]:gap-x-2 [&>svg]:h-[1lh] [&>svg]:w-4`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-transparent dark:bg-input/32 [&>svg]:text-muted-foreground`,error:`border-destructive/32 bg-destructive/4 [&>svg]:text-destructive`,info:`border-info/32 bg-info/4 [&>svg]:text-info`,success:`border-success/32 bg-success/4 [&>svg]:text-success`,warning:`border-warning/32 bg-warning/4 [&>svg]:text-warning`}}});function loe({className:e,variant:t,...n}){return(0,G.jsx)(`div`,{className:cO(coe({variant:t}),e),"data-slot":`alert`,role:`alert`,...n})}function uoe({className:e,...t}){return(0,G.jsx)(`div`,{className:cO(`font-medium [svg~&]:col-start-2`,e),"data-slot":`alert-title`,...t})}function doe({className:e,...t}){return(0,G.jsx)(`div`,{className:cO(`flex flex-col gap-2.5 text-muted-foreground [svg~&]:col-start-2`,e),"data-slot":`alert-description`,...t})}var foe=()=>{let e=KS(cT().name);return e?(0,G.jsx)(`div`,{className:`flex flex-col h-full overflow-hidden bg-card`,children:(0,G.jsx)(`div`,{className:`p-4 overflow-auto`,children:e.response?e.response.isError?(0,G.jsxs)(loe,{variant:`error`,children:[(0,G.jsx)(on,{}),(0,G.jsx)(uoe,{children:`Error`}),(0,G.jsx)(doe,{children:(()=>{let t=[];return e.response.content.forEach(e=>{e.type===`text`&&t.push(e.text)}),t.join(`
|
|
152
|
+
)`}return(0,G.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),rie=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=K3(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,G.jsx)(K5.Provider,{value:n,children:(0,G.jsxs)(R6,{ref:t,...r,children:[a&&o===!0&&(0,G.jsx)(q5,{ref:i.context.internalBackdropRef,inert:E4(!s)}),e.children]})}):null});function J5(e){let t=b.useRef(!0);t.current&&(t.current=!1,e())}var Y5={},X5={},Z5=``;function iie(e){if(typeof document>`u`)return!1;let t=U1(e);return fT(t).innerWidth-t.documentElement.clientWidth>0}function aie(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=U1(e),n=t.documentElement,r=t.body,i=vT(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function oie(e){let t=U1(e),n=t.documentElement,r=t.body,i=vT(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function sie(e){let t=U1(e),n=t.documentElement,r=t.body,i=fT(n),a=0,o=0,s=!1,c=N4.create();if(v0&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Y5={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Z5=n.style.scrollBehavior,X5={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=vT(n)?n:r;if(s=aie(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,Y5),Object.assign(r.style,X5),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Z5)}function d(){u(),c.request(l)}return l(),i.addEventListener(`resize`,d),()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var cie=new class{lockCount=0;restore=null;timeoutLock=s6.create();timeoutUnlock=s6.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=U1(e).documentElement,n=fT(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=SE;return}this.restore=y0||!iie(e)?oie(e):sie(e)}};function Q5(e=!0,t=null){$(()=>{if(e)return cie.acquire(t)},[e,t])}function lie(e){let t=b.useRef(``),n=b.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:b.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function $5(e,t){let n=b.useRef(e),r=zT(t);$(()=>{n.current!==e&&r(n.current)},[e,r]),$(()=>{n.current=e},[e])}function e7(e){let[t,n]=b.useState(null),r=zT((t,r)=>{e||n(r||(y0?`touch`:``))});$5(e,t=>{t&&!e&&n(null)});let{onClick:i,onPointerDown:a}=lie(r);return b.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:a}}),[t,i,a])}function uie(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l}=e7(i);w5(t);let{forceUnmount:u}=T5(i,t),d=zT(e=>{let n=p0(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),f=b.useCallback(()=>{t.setOpen(!1,d(d0))},[t,d]);b.useImperativeHandle(r,()=>({unmount:u,close:f}),[u,f]);let p=j5({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[m,h]=b.useState(0),g=m===0,_=B5(p),v=c8(p,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=F0(e);if(g&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||N0(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:g});Q5(i&&o===!0,s);let{getReferenceProps:y,getFloatingProps:x,getTriggerProps:S}=P5([_,v]);t.useContextCallback(`onNestedDialogOpen`,e=>{h(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{h(0)}),b.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(m),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,m]);let C=b.useMemo(()=>y(l),[y,l]),w=b.useMemo(()=>S(l),[S,l]),T=b.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:w,popupProps:T,floatingRootContext:p,nestedOpenDialogCount:m})}var die={...k5,modal:_5(e=>e.modal),nested:_5(e=>e.nested),nestedOpenDialogCount:_5(e=>e.nestedOpenDialogCount),disablePointerDismissal:_5(e=>e.disablePointerDismissal),openMethod:_5(e=>e.openMethod),descriptionElementId:_5(e=>e.descriptionElementId),titleElementId:_5(e=>e.titleElementId),viewportElement:_5(e=>e.viewportElement),role:_5(e=>e.role)},fie=class extends S5{constructor(e){super(pie(e),{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new E5,onOpenChange:void 0,onOpenChangeComplete:void 0},die)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function pie(e={}){return{...D5(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function mie(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=K3(!0),p=!!f,m=IT(()=>l?.store??new fie({open:r,openProp:n,activeTriggerId:d,triggerIdProp:u,modal:s,disablePointerDismissal:o,nested:p})).current;J5(()=>{n===void 0&&m.state.open===!1&&r===!0&&m.update({open:!0,activeTriggerId:d})}),m.useControlledProp(`openProp`,n),m.useControlledProp(`triggerIdProp`,u),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);uie({store:m,actionsRef:c,parentContext:f?.store.context,onOpenChange:i,triggerIdProp:u});let g=b.useMemo(()=>({store:m}),[m]);return(0,G.jsx)(G3.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}var hie=b.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=K3(),s=J1(i);return o.useSyncedValueWithCleanup(`titleElementId`,s),AE(`h2`,e,{ref:t,props:[{id:s},a]})});function gie({...e}){return(0,G.jsx)(mie,{"data-slot":`dialog`,...e})}function _ie({...e}){return(0,G.jsx)(rie,{"data-slot":`dialog-portal`,...e})}function vie({className:e,...t}){return(0,G.jsx)(i6,{"data-slot":`dialog-overlay`,className:cO(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50`,e),...t})}function yie({className:e,children:t,showCloseButton:n=!0,...r}){return(0,G.jsxs)(_ie,{children:[(0,G.jsx)(vie,{}),(0,G.jsxs)(nie,{"data-slot":`dialog-content`,className:cO(`bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-none p-4 text-xs/relaxed ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,e),...r,children:[t,n&&(0,G.jsxs)(a6,{"data-slot":`dialog-close`,render:(0,G.jsx)(lO,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,G.jsx)(gn,{}),(0,G.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function bie({className:e,...t}){return(0,G.jsx)(hie,{"data-slot":`dialog-title`,className:cO(`text-sm font-medium`,e),...t})}var xie=()=>{let e=cT(),[t,n]=(0,b.useState)(!1);return e._meta&&Object.keys(e._meta).length>0?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(lO,{variant:`ghost`,size:`default`,onClick:()=>n(!0),"aria-label":`View tool metadata`,title:`View tool metadata`,children:[(0,G.jsx)(sn,{className:`h-4 w-4`}),`Metadata`]}),(0,G.jsx)(gie,{open:t,onOpenChange:n,children:(0,G.jsxs)(yie,{className:`sm:max-w-2xl`,children:[(0,G.jsx)(bie,{children:`Tool Metadata`}),(0,G.jsx)(`div`,{className:`text-xs`,children:(0,G.jsx)(W3,{src:e._meta,name:null,quotesOnKeys:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!1,theme:`rjv-default`,style:{fontSize:`0.75rem`},collapsed:2,collapseStringsAfterLength:80})})]})})]}):null},Sie={"ui:submitButtonOptions":{norender:!0}},Cie=({schema:e,formData:t,setFormData:n,ref:r})=>!e?.properties||Object.keys(e.properties).length===0?(0,G.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This tool requires no input`})}):(0,G.jsx)(y3,{children:(0,G.jsx)(b3,{children:(0,G.jsx)(O1,{ref:r,schema:e??{},validator:AK,uiSchema:Sie,formData:t,onChange:e=>n(e.formData),showErrorList:!1,templates:{FieldTemplate:e=>{let{id:t,classNames:n,style:r,label:i,required:a,errors:o,children:s}=e;return(0,G.jsxs)(`div`,{className:cO(`flex flex-col gap-2`,n),style:r,children:[(0,G.jsxs)(`label`,{htmlFor:t,className:`text-sm text-foreground`,children:[i,a&&(0,G.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[s,o]})]})},FieldErrorTemplate:e=>e.errors&&e.errors.length>0?(0,G.jsx)(`div`,{className:`text-sm text-destructive mt-1 flex items-center gap-1`,children:(0,G.jsx)(`span`,{children:e.errors.join(`, `)})}):null}})})}),wie=({formData:e,setFormData:t})=>{let[n,r]=(0,b.useState)(JSON.stringify(e,null,2));(0,b.useEffect)(()=>{r(JSON.stringify(e,null,2))},[e]);let i=e=>{r(e);try{t(JSON.parse(e))}catch{}};return(0,G.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,G.jsx)(`textarea`,{className:`w-full h-full p-2 rounded-md border border-border`,rows:12,value:n,onChange:e=>i(e.target.value)})})},Tie=()=>{let e=(0,b.useRef)(null),t=cT(),{setToolData:n}=GS(),r=KS(t.name)?.input??{},i=e=>{n(t.name,{input:e??{}})};return(0,G.jsxs)(`div`,{className:cO(`flex flex-col h-full overflow-hidden border-r border-border`),children:[(0,G.jsxs)(`div`,{className:`shrink-0 border-b border-border px-6 py-4 flex items-center justify-between h-[72px]`,children:[(0,G.jsx)(`h2`,{className:`font-semibold text-foreground`,children:t.name}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(xie,{}),(0,G.jsx)(H3,{validateForm:async()=>e.current===null?!0:await e.current.validateForm(),formData:r})]})]}),(0,G.jsx)(`div`,{className:`flex-1 overflow-auto px-6 py-6 bg-muted/50`,children:(0,G.jsxs)(m3,{defaultValue:`form`,children:[(0,G.jsxs)(g3,{children:[(0,G.jsx)(_3,{value:`form`,children:`Form`}),(0,G.jsx)(_3,{value:`json`,children:`JSON`})]}),(0,G.jsx)(v3,{value:`form`,children:(0,G.jsx)(Cie,{schema:t.inputSchema,formData:r,setFormData:i,ref:e},t.name)}),(0,G.jsx)(v3,{value:`json`,children:(0,G.jsx)(wie,{formData:r,setFormData:i},t.name)})]})})]})},Eie=BE(`rounded-none has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-none flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0 [&>[data-slot]]:rounded-r-none`,vertical:`flex-col [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0 [&>[data-slot]]:rounded-b-none`}},defaultVariants:{orientation:`horizontal`}});function Die({className:e,orientation:t,...n}){return(0,G.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:cO(Eie({orientation:t}),e),...n})}function Oie({className:e,...t}){return(0,G.jsx)(`label`,{"data-slot":`label`,className:cO(`gap-2 text-xs leading-none group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed`,e),...t})}function kie({className:e,...t}){return(0,G.jsx)(`fieldset`,{"data-slot":`field-set`,className:cO(`gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col`,e),...t})}var Aie=BE(`data-[invalid=true]:text-destructive gap-2 group/field flex w-full`,{variants:{orientation:{vertical:`flex-col [&>*]:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function t7({className:e,orientation:t=`vertical`,...n}){return(0,G.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:cO(Aie({orientation:t}),e),...n})}function n7({className:e,...t}){return(0,G.jsx)(Oie,{"data-slot":`field-label`,className:cO(`has-data-checked:bg-primary/5 has-data-checked:border-primary dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-none has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-2 group/field-label peer/field-label flex w-fit leading-snug`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}var r7=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),jie={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},i7={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Mie={disabled:!1,...i7},a7={valid(e){return e===null?null:e?{[r7.valid]:``}:{[r7.invalid]:``}}},Nie=b.createContext({invalid:void 0,name:void 0,validityData:{state:jie,errors:[],error:``,value:``,initialValue:null},setValidityData:SE,disabled:void 0,touched:i7.touched,setTouched:SE,dirty:i7.dirty,setDirty:SE,filled:i7.filled,setFilled:SE,focused:i7.focused,setFocused:SE,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Mie,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=wE)=>e,getInputValidationProps:(e=wE)=>e,inputRef:{current:null},commit:async()=>{}}});function o7(e=!0){let t=b.useContext(Nie);if(t.setValidityData===SE&&!e)throw Error(rE(28));return t}var Pie=b.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:SE,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function s7(){return b.useContext(Pie)}var Fie=b.createContext({controlId:void 0,registerControlId:SE,labelId:void 0,setLabelId:SE,messageIds:[],setMessageIds:SE,getDescriptionProps:e=>e});function c7(){return b.useContext(Fie)}function Iie(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function l7(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=c7(),o=J1(t),s=n?i:void 0,c=IT(()=>Symbol(`labelable-control`)),l=b.useRef(!1),u=b.useRef(t!=null),d=zT(()=>{!l.current||a===SE||(l.current=!1,a(c.current,void 0))});return $(()=>{if(a===SE)return;let e;if(n){let n=r?.current;e=hT(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),b.useEffect(()=>d,[d]),i??o}function u7(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=s7(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:d}=o7(),f=zT(e.getValue);$(()=>{if(!t)return;let e=n;e===void 0&&(e=f()),u.initialValue===null&&e!==null&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),$(()=>{!t||!r||s.current.fields.set(r,{getValue:f,name:i,controlRef:a,validityData:Iie(u,c),validate(e=!0){let t=n;t===void 0&&(t=f()),l.current=!0,e?Lq.flushSync(()=>o(t)):o(t)}})},[o,a,t,s,f,r,c,l,i,u,n]),$(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}var Lie=b.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,...d}=e,{state:f,name:p,disabled:m,setTouched:h,setDirty:g,validityData:_,setFocused:v,setFilled:y,validationMode:x,validation:S}=o7(),C=m||s,w=p??a,T={...f,disabled:C},{labelId:E}=c7(),D=l7({id:i});$(()=>{let e=o!=null;S.inputRef.current?.value||e&&o!==``?y(!0):e&&o===``&&y(!1)},[S.inputRef,y,o]);let O=b.useRef(null);$(()=>{u&&O.current===M0(U1(O.current))&&v(!0)},[u,v]);let[k]=k1({controlled:o,default:l,name:`FieldControl`,state:`value`}),A=o!==void 0,j=A?k:void 0;return u7({id:D,name:w,commit:S.commit,value:j,getValue:()=>S.inputRef.current?.value,controlRef:S.inputRef}),AE(`input`,e,{ref:[t,O],state:T,props:[{id:D,disabled:C,name:w,ref:S.inputRef,"aria-labelledby":E,autoFocus:u,...A?{value:j}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,p0(t0,e.nativeEvent)),g(t!==_.initialValue),y(t!==``)},onFocus(){v(!0)},onBlur(e){h(!0),v(!1),x===`onBlur`&&S.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(h(!0),S.commit(e.currentTarget.value))}},S.getInputValidationProps(),d],stateAttributesMapping:a7})}),Rie=b.forwardRef(function(e,t){return(0,G.jsx)(Lie,{ref:t,...e})});function d7({className:e,type:t,...n}){return(0,G.jsx)(Rie,{type:t,"data-slot":`input`,className:cO(`dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-none border bg-transparent px-2.5 py-1 text-xs transition-colors file:h-6 file:text-xs file:font-medium focus-visible:ring-1 aria-invalid:ring-1 md:text-xs file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,e),...n})}var f7=b.createContext(null),p7=b.createContext(null);function m7(){let e=b.useContext(f7);if(e===null)throw Error(rE(60));return e}function h7(){let e=b.useContext(p7);if(e===null)throw Error(rE(61));return e}var zie=(e,t)=>Object.is(e,t);function g7(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Bie(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:g7(t,e,n))}function _7(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:g7(e,t,n))}function Vie(e,t,n){return e.filter(e=>!g7(t,e,n))}function v7(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function y7(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function Hie(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(y7(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function Uie(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return v7(e)}function b7(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?v7(e.value):v7(e)}function x7(e,t,n){function r(){return Uie(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=y7(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Wie(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,G.jsx)(b.Fragment,{children:x7(r,t,n)},i)),e),[])}var S7={id:_5(e=>e.id),labelId:_5(e=>e.labelId),modal:_5(e=>e.modal),multiple:_5(e=>e.multiple),items:_5(e=>e.items),itemToStringLabel:_5(e=>e.itemToStringLabel),itemToStringValue:_5(e=>e.itemToStringValue),isItemEqualToValue:_5(e=>e.isItemEqualToValue),value:_5(e=>e.value),hasSelectedValue:_5(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:b7(t,r)!==``}),hasNullItemLabel:_5((e,t)=>t?Hie(e.items):!1),open:_5(e=>e.open),mounted:_5(e=>e.mounted),forceMount:_5(e=>e.forceMount),transitionStatus:_5(e=>e.transitionStatus),openMethod:_5(e=>e.openMethod),activeIndex:_5(e=>e.activeIndex),selectedIndex:_5(e=>e.selectedIndex),isActive:_5((e,t)=>e.activeIndex===t),isSelected:_5((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>g7(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:g7(n,i,r)}),isSelectedByFocus:_5((e,t)=>e.selectedIndex===t),popupProps:_5(e=>e.popupProps),triggerProps:_5(e=>e.triggerProps),triggerElement:_5(e=>e.triggerElement),positionerElement:_5(e=>e.positionerElement),listElement:_5(e=>e.listElement),scrollUpArrowVisible:_5(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:_5(e=>e.scrollDownArrowVisible),hasScrollArrows:_5(e=>e.hasScrollArrows)};function Gie(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,autoComplete:l,disabled:u=!1,readOnly:d=!1,required:f=!1,modal:p=!0,actionsRef:m,inputRef:h,onOpenChangeComplete:g,items:_,multiple:v=!1,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:S=zie,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=s7(),{setDirty:E,setTouched:D,setFocused:O,shouldValidateOnChange:k,validityData:A,setFilled:j,name:M,disabled:N,validation:P,validationMode:F}=o7(),I=l7({id:t}),L=N||u,R=M??c,[z,B]=k1({controlled:n,default:v?r??CE:r,name:`Select`,state:`value`}),[V,H]=k1({controlled:a,default:o,name:`Select`,state:`open`}),U=b.useRef([]),ee=b.useRef([]),W=b.useRef(null),te=b.useRef(null),ne=b.useRef(0),re=b.useRef(null),ie=b.useRef([]),ae=b.useRef(!1),oe=b.useRef(!1),se=b.useRef(null),ce=b.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),le=b.useRef(!1),{mounted:ue,setMounted:de,transitionStatus:fe}=R4(V),{openMethod:pe,triggerProps:me}=e7(V),he=IT(()=>new x5({id:I,labelId:void 0,modal:p,multiple:v,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:S,value:z,open:V,mounted:ue,transitionStatus:fe,items:_,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ge=b5(he,S7.activeIndex),_e=b5(he,S7.selectedIndex),ve=b5(he,S7.triggerElement),ye=b5(he,S7.positionerElement),be=b.useMemo(()=>v&&Array.isArray(z)&&z.length===0?``:b7(z,x),[v,z,x]),xe=b.useMemo(()=>v&&Array.isArray(z)?z.map(e=>b7(e,x)):b7(z,x),[v,z,x]),Se=p6(he.state.triggerElement);u7({id:I,commit:P.commit,value:z,controlRef:Se,name:R,getValue:()=>xe});let Ce=b.useRef(z);$(()=>{z!==Ce.current&&he.set(`forceMount`,!0)},[he,z]),$(()=>{j(v?Array.isArray(z)&&z.length>0:z!=null)},[v,z,j]),$(function(){if(V)return;let e=ie.current;if(v){let t=Array.isArray(z)?z:[];if(t.length===0){he.set(`selectedIndex`,null);return}let n=t[t.length-1],r=_7(e,n,S);he.set(`selectedIndex`,r===-1?null:r);return}let t=_7(e,z,S);he.set(`selectedIndex`,t===-1?null:t)},[v,V,z,ie,S,he]),$5(z,()=>{T(R),E(z!==A.initialValue),k()?P.commit(z):P.commit(z,!0)});let we=zT((e,t)=>{if(s?.(e,t),!t.isCanceled&&(H(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(D(!0),O(!1),F===`onBlur`&&P.commit(z)),!e&&he.state.activeIndex!==null)){let e=U.current[he.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),Te=zT(()=>{de(!1),he.set(`activeIndex`,null),g?.(!1)});L4({enabled:!m,open:V,ref:W,onComplete(){V||Te()}}),b.useImperativeHandle(m,()=>({unmount:Te}),[Te]);let Ee=zT((e,t)=>{i?.(e,t),!t.isCanceled&&B(e)}),De=zT(()=>{let e=he.state.listElement||W.current;if(!e)return;let t=e.scrollTop,n=e.scrollTop+e.clientHeight,r=t>1,i=n<e.scrollHeight-1;he.state.scrollUpArrowVisible!==r&&he.set(`scrollUpArrowVisible`,r),he.state.scrollDownArrowVisible!==i&&he.set(`scrollDownArrowVisible`,i)}),Oe=A5({open:V,onOpenChange:we,elements:{reference:ve,floating:ye}}),{getReferenceProps:ke,getFloatingProps:Ae,getItemProps:je}=P5([i8(Oe,{enabled:!d&&!L,event:`mousedown`}),c8(Oe,{bubbles:!1}),Kre(Oe,{enabled:!d&&!L,listRef:U,activeIndex:ge,selectedIndex:_e,disabledIndices:CE,onNavigate(e){e===null&&!V||he.set(`activeIndex`,e)},focusItemOnHover:!1}),Jre(Oe,{enabled:!d&&!L&&(V||!v),listRef:ee,activeIndex:ge,selectedIndex:_e,onMatch(e){V?he.set(`activeIndex`,e):Ee(ie.current[e],p0(`none`))},onTypingChange(e){ae.current=e}})]),Me=b.useMemo(()=>GT(ke(),me,I?{id:I}:wE),[ke,me,I]);J5(()=>{he.update({popupProps:Ae(),triggerProps:Me})}),$(()=>{he.update({id:I,modal:p,multiple:v,value:z,open:V,mounted:ue,transitionStatus:fe,popupProps:Ae(),triggerProps:Me,items:_,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:S,openMethod:pe})},[he,I,p,v,z,V,ue,fe,Ae,Me,_,y,x,S,pe]);let Ne=b.useMemo(()=>({store:he,name:R,required:f,disabled:L,readOnly:d,multiple:v,itemToStringLabel:y,itemToStringValue:x,highlightItemOnHover:C,setValue:Ee,setOpen:we,listRef:U,popupRef:W,scrollHandlerRef:te,handleScrollArrowVisibility:De,scrollArrowsMountedCountRef:ne,getItemProps:je,events:Oe.context.events,valueRef:re,valuesRef:ie,labelsRef:ee,typingRef:ae,selectionRef:ce,selectedItemTextRef:se,validation:P,onOpenChangeComplete:g,keyboardActiveRef:oe,alignItemWithTriggerActiveRef:le,initialValueRef:Ce}),[he,R,f,L,d,v,y,x,C,Ee,we,je,Oe.context.events,P,g,De]),Pe=uE(h,P.inputRef),Fe=v&&Array.isArray(z)&&z.length>0,Ie=v?void 0:R,Le=b.useMemo(()=>!v||!Array.isArray(z)||!R?null:z.map(e=>{let t=b7(e,x);return(0,G.jsx)(`input`,{type:`hidden`,name:R,value:t},t)}),[v,z,R,x]);return(0,G.jsx)(f7.Provider,{value:Ne,children:(0,G.jsxs)(p7.Provider,{value:Oe,children:[w,(0,G.jsx)(`input`,{...P.getInputValidationProps({onFocus(){he.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.value,n=p0(t0,e.nativeEvent);function r(){if(v)return;let e=ie.current.find(e=>b7(e,x).toLowerCase()===t.toLowerCase());e!=null&&(E(e!==A.initialValue),Ee(e,n),k()&&P.commit(e))}he.set(`forceMount`,!0),queueMicrotask(r)}}),id:I&&Ie==null?`${I}-hidden-input`:void 0,name:Ie,autoComplete:l,value:be,disabled:L,required:f&&!Fe,readOnly:d,ref:Pe,style:R?_6:g6,tabIndex:-1,"aria-hidden":!0}),Le]})})}function Kie(e,t){return e??t}function qie(e){let t=e.getBoundingClientRect(),n=window.getComputedStyle(e,`::before`),r=window.getComputedStyle(e,`::after`);if(!(n.content!==`none`||r.content!==`none`))return t;let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0,o=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=Math.max(t.width,i,o),l=Math.max(t.height,a,s),u=c-t.width,d=l-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-d/2,bottom:t.bottom+d/2}}var C7=2,Jie=400,w7=200,Yie={...t6,...a7,value:()=>null},Xie=b.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{setTouched:c,setFocused:l,validationMode:u,state:d,disabled:f}=o7(),{labelId:p}=c7(),{store:m,setOpen:h,selectionRef:g,validation:_,readOnly:v,required:y,alignItemWithTriggerActiveRef:x,disabled:S,keyboardActiveRef:C}=m7(),w=f||S||a,T=b5(m,S7.open),E=b5(m,S7.value),D=b5(m,S7.triggerProps),O=b5(m,S7.positionerElement),k=b5(m,S7.listElement),A=b5(m,S7.id),j=b5(m,S7.labelId),M=b5(m,S7.hasSelectedValue),N=!M&&T,P=b5(m,S7.hasNullItemLabel,N),F=i??A,I=Kie(p,j);l7({id:F});let L=p6(O),R=b.useRef(null),{getButtonProps:z,buttonRef:B}=sE({disabled:w,native:o}),V=uE(t,R,B,zT(e=>{m.set(`triggerElement`,e)})),H=c6(),U=c6(),ee=c6(),W=c6();b.useEffect(()=>{if(T)return M||P?W.start(w7,()=>{g.current.allowUnselectedMouseUp=!0,ee.start(w7,()=>{g.current.allowSelectedMouseUp=!0})}):ee.start(Jie,()=>{g.current.allowUnselectedMouseUp=!0,g.current.allowSelectedMouseUp=!0}),()=>{ee.clear(),W.clear()};g.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},U.clear()},[T,M,P,g,U,ee,W]);let te=b.useMemo(()=>k?.id??B0(O)?.id,[k,O]),ne=GT(D,{id:F,role:`combobox`,"aria-expanded":T?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":T?te:void 0,"aria-labelledby":I,"aria-readonly":v||void 0,"aria-required":y||void 0,tabIndex:w?-1:0,ref:V,onFocus(e){l(!0),T&&x.current&&h(!1,p0(t0,e.nativeEvent)),H.start(0,()=>{m.set(`forceMount`,!0)})},onBlur(e){N0(O,e.relatedTarget)||(c(!0),l(!1),u===`onBlur`&&_.commit(E))},onPointerMove(){C.current=!1},onKeyDown(){C.current=!0},onMouseDown(e){if(T)return;let t=U1(e.currentTarget);function n(e){if(!R.current)return;let t=e.target;if(N0(R.current,t)||N0(L.current,t)||t===R.current)return;let n=qie(R.current);e.clientX>=n.left-C7&&e.clientX<=n.right+C7&&e.clientY>=n.top-C7&&e.clientY<=n.bottom+C7||h(!1,p0(u0,e))}U.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},_.getValidationProps,s,z);ne.role=`combobox`;let re={...d,open:T,disabled:w,value:E,readOnly:v,placeholder:!M};return AE(`button`,e,{ref:[t,R],state:re,stateAttributesMapping:Yie,props:ne})}),Zie={value:()=>null},Qie=b.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,...o}=e,{store:s,valueRef:c}=m7(),l=b5(s,S7.value),u=b5(s,S7.items),d=b5(s,S7.itemToStringLabel),f=b5(s,S7.hasSelectedValue),p=!f&&a!=null&&i==null,m=b5(s,S7.hasNullItemLabel,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(!f&&a!=null&&!m?a:Array.isArray(l)?Wie(l,u,d):x7(l,u,d)),AE(`span`,e,{state:h,ref:[t,c],props:[{children:g},o],stateAttributesMapping:Zie})}),$ie=b.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a}=m7();return AE(`span`,e,{state:{open:b5(a,S7.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},i],stateAttributesMapping:e6})}),eae=b.createContext(void 0),tae=b.forwardRef(function(e,t){let{store:n}=m7(),r=b5(n,S7.mounted),i=b5(n,S7.forceMount);return r||i?(0,G.jsx)(eae.Provider,{value:!0,children:(0,G.jsx)(R6,{ref:t,...e})}):null}),nae=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=r2(e,t)||{};if(l==null)return{};let f=x2(u),p={x:n,y:r},m=l2(i),h=s2(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=n2(k,j,A),N=!c.arrow&&a2(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),rae=(e,t)=>({...nae(e),options:[e,t]}),iae={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await rre().fn(e)).data?.referenceHidden||a}}}},T7={sideX:`left`,sideY:`top`},aae={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=fT(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:T7};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=U1(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=i2(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:T7.sideX,g=f===`top`?`bottom`:T7.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function E7(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function D7(e,t,n){let{rects:r,placement:i}=e;return{side:E7(t,i2(i),n),align:a2(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function O7(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:x}=e,[S,C]=b.useState(null);!m&&S!==null&&C(null);let w=h.side||`flip`,T=h.align||`flip`,E=h.fallbackAxisSide||`end`,D=typeof t==`function`?t:void 0,O=zT(D),k=D?O:t,A=p6(t),j=L1()===`rtl`,M=S||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":j?`left`:`right`,"inline-start":j?`right`:`left`}[r],N=a===`center`?M:`${M}-${a}`,P=c,F=r===`bottom`?1:0,I=r===`top`?1:0,L=r===`right`?1:0,R=r===`left`?1:0;typeof P==`number`?P={top:P+F,right:P+R,bottom:P+I,left:P+L}:P&&={top:(P.top||0)+F,right:(P.right||0)+R,bottom:(P.bottom||0)+I,left:(P.left||0)+L};let z={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:P},B=b.useRef(null),V=p6(i),H=p6(o),U=[Qne(e=>{let t=D7(e,r,j),n=typeof V.current==`function`?V.current(t):V.current,i=typeof H.current==`function`?H.current(t):H.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,j,r])],ee=T===`none`&&w!==`shift`,W=!ee&&(l||g||w===`shift`),te=w===`none`?null:tre({...z,padding:{top:P.top+1,right:P.right+1,bottom:P.bottom+1,left:P.left+1},mainAxis:!g&&w===`flip`,crossAxis:T===`flip`?`alignment`:!1,fallbackAxisSideDirection:E}),ne=ee?null:$ne(e=>{let t=U1(e.elements.floating).documentElement;return{...z,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:T!==`none`,crossAxis:W,limiter:l||g?void 0:ere(e=>{if(!B.current)return{};let{width:t,height:n}=B.current.getBoundingClientRect(),r=c2(i2(e.placement)),i=r===`y`?t:n,a=r===`y`?P.left+P.right:P.top+P.bottom;return{offset:i/2+a/2}})}},[z,l,g,P,T]);w===`shift`||T===`shift`||a===`center`?U.push(ne,te):U.push(te,ne),U.push(nre({...z,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=window.devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),rae(()=>({element:B.current||document.createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=i2(a),l=c2(c),u=B.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(D7(e,r,j)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,W&&l===`y`&&b?S:x),{}}},iae,v),$(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,p]);let re=b.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:ie,elements:ae,x:oe,y:se,middlewareData:ce,update:le,placement:ue,context:de,isPositioned:fe,floatingStyles:pe}=Fre({rootContext:p,placement:N,middleware:U,strategy:n,whileElementsMounted:f?void 0:(...e)=>Q8(...e,re),nodeId:_,externalTree:x}),{sideX:me,sideY:he}=ce.adaptiveOrigin||T7,ge=fe?n:`fixed`,_e=b.useMemo(()=>{let e=v?{position:ge,[me]:oe,[he]:se}:{position:ge,...pe};return fe||(e.opacity=0),e},[v,ge,me,oe,he,se,pe,fe]),ve=b.useRef(null);$(()=>{if(!m)return;let e=A.current,t=typeof e==`function`?e():e,n=(k7(t)?t.current:t)||null;n!==ve.current&&(ie.setPositionReference(n),ve.current=n)},[m,ie,k,A]),b.useEffect(()=>{if(!m)return;let e=A.current;typeof e!=`function`&&k7(e)&&e.current!==ve.current&&(ie.setPositionReference(e.current),ve.current=e.current)},[m,ie,k,A]),b.useEffect(()=>{if(f&&m&&ae.domReference&&ae.floating)return Q8(ae.domReference,ae.floating,le,re)},[f,m,ae,le,re]);let ye=i2(ue),be=E7(r,ye,j),xe=a2(ue)||`center`,Se=!!ce.hide?.referenceHidden;$(()=>{y&&m&&fe&&C(ye)},[y,m,fe,ye]);let Ce=b.useMemo(()=>({position:`absolute`,top:ce.arrow?.y,left:ce.arrow?.x}),[ce.arrow]),we=ce.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:_e,arrowStyles:Ce,arrowRef:B,arrowUncentered:we,side:be,align:xe,physicalSide:ye,anchorHidden:Se,refs:ie,context:de,isPositioned:fe,update:le}),[_e,Ce,B,we,be,xe,ye,Se,ie,de,fe,le])}function k7(e){return e!=null&&`current`in e}var A7=b.createContext(void 0);function j7(){let e=b.useContext(A7);if(!e)throw Error(rE(59));return e}function M7(e){return e===`starting`?TE:wE}function N7(e,t){e&&Object.assign(e.style,t)}var P7={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},oae={position:`fixed`},sae=b.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=DE,..._}=e,{store:v,listRef:y,labelsRef:x,alignItemWithTriggerActiveRef:S,selectedItemTextRef:C,valuesRef:w,initialValueRef:T,popupRef:E,setValue:D}=m7(),O=h7(),k=b5(v,S7.open),A=b5(v,S7.mounted),j=b5(v,S7.modal),M=b5(v,S7.value),N=b5(v,S7.openMethod),P=b5(v,S7.positionerElement),F=b5(v,S7.triggerElement),I=b5(v,S7.isItemEqualToValue),L=b5(v,S7.transitionStatus),R=b.useRef(null),z=b.useRef(null),[B,V]=b.useState(h),H=A&&B&&N!==`touch`;!A&&B!==h&&V(h),$(()=>{A||(S7.scrollUpArrowVisible(v.state)&&v.set(`scrollUpArrowVisible`,!1),S7.scrollDownArrowVisible(v.state)&&v.set(`scrollDownArrowVisible`,!1))},[v,A]),b.useImperativeHandle(S,()=>H),Q5((H||j)&&k&&N!==`touch`,F);let U=O7({anchor:n,floatingRootContext:O,positionMethod:r,mounted:A,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??H,collisionAvoidance:g,keepMounted:!0}),ee=H?`none`:U.side,W=H?oae:U.positionerStyles,te=b.useMemo(()=>{let e={};return k||(e.pointerEvents=`none`),{role:`presentation`,hidden:!A,style:{...W,...e}}},[k,A,W]),ne={open:k,side:ee,align:U.align,anchorHidden:U.anchorHidden},re=AE(`div`,e,{ref:[t,zT(e=>{v.set(`positionerElement`,e)})],state:ne,stateAttributesMapping:n6,props:[te,M7(L),_]}),ie=b.useRef(0),ae=zT(e=>{if(e.size===0&&ie.current===0||w.current.length===0)return;let t=ie.current;if(ie.current=e.size,e.size===t)return;let n=p0(t0);if(t!==0&&!v.state.multiple&&M!==null&&_7(w.current,M,I)===-1){let e=T.current,t=e!=null&&_7(w.current,e,I)!==-1?e:null;D(t,n),t===null&&(v.set(`selectedIndex`,null),C.current=null)}if(t!==0&&v.state.multiple&&Array.isArray(M)){let e=e=>_7(w.current,e,I)!==-1,t=M.filter(t=>e(t));(t.length!==M.length||t.some(e=>!Bie(M,e,I)))&&(D(t,n),t.length===0&&(v.set(`selectedIndex`,null),C.current=null))}if(k&&H){v.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};N7(P,e),N7(E.current,e)}}),oe=b.useMemo(()=>({...U,side:ee,alignItemWithTriggerActive:H,setControlledAlignItemWithTrigger:V,scrollUpArrowRef:R,scrollDownArrowRef:z}),[U,ee,H,V]);return(0,G.jsx)(M1,{elementsRef:y,labelsRef:x,onMapChange:ae,children:(0,G.jsxs)(A7.Provider,{value:oe,children:[A&&j&&(0,G.jsx)(q5,{inert:E4(!k),cutout:F}),re]})})});function F7(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}var I7=`base-ui-disable-scrollbar`,L7={className:I7,getElement(e){return(0,G.jsx)(`style`,{nonce:e,href:I7,precedence:`base-ui:low`,children:`.${I7}{scrollbar-width:none}.${I7}::-webkit-scrollbar{display:none}`})}},cae=b.createContext(void 0);function R7(e){let t=b.useContext(cae);if(t===void 0&&!e)throw Error(rE(69));return t}function z7(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var B7=1,lae={...n6,...A4},uae=b.forwardRef(function(e,t){let{render:n,className:r,finalFocus:i,...a}=e,{store:o,popupRef:s,onOpenChangeComplete:c,setOpen:l,valueRef:u,selectedItemTextRef:d,keyboardActiveRef:f,multiple:p,handleScrollArrowVisibility:m,scrollHandlerRef:h,highlightItemOnHover:g}=m7(),{side:_,align:v,alignItemWithTriggerActive:y,setControlledAlignItemWithTrigger:x,scrollDownArrowRef:S,scrollUpArrowRef:C}=j7(),w=R7(!0)!=null,T=h7(),{nonce:E,disableStyleElements:D}=T4(),O=c6(),k=b5(o,S7.id),A=b5(o,S7.open),j=b5(o,S7.mounted),M=b5(o,S7.popupProps),N=b5(o,S7.transitionStatus),P=b5(o,S7.triggerElement),F=b5(o,S7.positionerElement),I=b5(o,S7.listElement),L=b.useRef(0),R=b.useRef(!1),z=b.useRef(0),B=b.useRef(!1),V=b.useRef({}),H=P4(),U=zT(e=>{if(!F||!s.current||!B.current)return;if(R.current||!y){m();return}let t=F.style.top===`0px`,n=F.style.bottom===`0px`,r=F.getBoundingClientRect().height,i=U1(F),a=getComputedStyle(F),o=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),l=V7(getComputedStyle(s.current)),u=Math.min(i.documentElement.clientHeight-o-c,l),d=e.scrollTop,f=H7(e),p=0,h=null,g=!1,_=!1,v=e=>{F.style.height=`${e}px`},b=(t,n)=>{let i=z7(t,0,u-r);i>0&&v(r+i),e.scrollTop=n,u-(r+i)<=B7&&(R.current=!0),m()};if(t){let e=f-d,t=r+e,n=Math.min(t,u);if(p=n,e<=B7){b(e,f);return}u-n>B7?_=!0:g=!0}else if(n){let e=d,t=r+e,n=Math.min(t,u),i=t-u;if(p=n,e<=B7){b(e,0);return}u-n>B7?h=0:(g=!0,d<f&&(h=d-(e-i)))}if(p=Math.ceil(p),p!==0&&v(p),_||h!=null){let t=H7(e),n=_?t:z7(h,0,t);Math.abs(e.scrollTop-n)>B7&&(e.scrollTop=n)}(g||p>=u-B7)&&(R.current=!0),m()});b.useImperativeHandle(h,()=>U,[U]),L4({open:A,ref:s,onComplete(){A&&c?.(!0)}});let ee={open:A,transitionStatus:N,side:_,align:v};$(()=>{!F||!s.current||Object.keys(V.current).length||(V.current={top:F.style.top||`0`,left:F.style.left||`0`,right:F.style.right,height:F.style.height,bottom:F.style.bottom,minHeight:F.style.minHeight,maxHeight:F.style.maxHeight,marginTop:F.style.marginTop,marginBottom:F.style.marginBottom})},[s,F]),$(()=>{A||y||(B.current=!1,R.current=!1,L.current=0,z.current=0,N7(F,V.current))},[A,y,F,s]),$(()=>{let e=s.current;if(!(!A||!P||!F||!e||o.state.transitionStatus===`ending`)){if(!y){B.current=!0,H.request(m),e.style.removeProperty(`--transform-origin`);return}queueMicrotask(()=>{let t=fae(e);e.style.removeProperty(`--transform-origin`);try{let t=getComputedStyle(F),n=getComputedStyle(e),r=U1(P),i=fT(F),a=dae(P),o=U7(P.getBoundingClientRect(),a),s=U7(F.getBoundingClientRect(),a),c=o.left,l=o.height,f=I||e,p=f.scrollHeight,h=parseFloat(n.borderBottomWidth),g=parseFloat(t.marginTop)||10,_=parseFloat(t.marginBottom)||10,v=parseFloat(t.minHeight)||100,y=V7(n),b=r.documentElement.clientHeight-g-_,S=r.documentElement.clientWidth,C=b-o.bottom+l,w=d.current,T=u.current,E,D=0,O=0;if(w&&T){let e=U7(T.getBoundingClientRect(),a);E=U7(w.getBoundingClientRect(),a);let t=e.left-c,n=E.left-s.left,r=e.top-o.top+e.height/2,i=E.top-s.top+E.height/2;D=t-n,O=i-r}let k=C+O+_+h,A=Math.min(b,k),j=b-g-_,M=k-A,N=Math.max(5,c+D),z=S-5,H=Math.max(0,N+s.width-z);F.style.left=`${N-H}px`,F.style.height=`${A}px`,F.style.maxHeight=`auto`,F.style.marginTop=`${g}px`,F.style.marginBottom=`${_}px`,e.style.height=`100%`;let U=H7(f),ee=M>=U-B7;ee&&(A=Math.min(b,s.height)-(M-U));let W=o.top<20||o.bottom>b-20||Math.ceil(A)+B7<Math.min(p,v),te=(i.visualViewport?.scale??1)!==1&&v0;if(W||te){B.current=!0,N7(F,V.current),Lq.flushSync(()=>x(!1));return}if(ee){let e=Math.max(0,b-k);F.style.top=s.height>=j?`0`:`${e}px`,F.style.height=`${A}px`,f.scrollTop=H7(f),L.current=Math.max(v,A)}else F.style.bottom=`0`,L.current=Math.max(v,A),f.scrollTop=M;if(E){let t=s.top,n=s.height,r=E.top+E.height/2,i=z7(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(L.current===b||A>=y)&&(R.current=!0),m(),setTimeout(()=>{B.current=!0})}finally{t()}})}},[o,A,F,P,u,d,s,m,y,x,H,S,C,I]),b.useEffect(()=>{if(!y||!F||!A)return;let e=fT(F);function t(e){l(!1,p0(f0,e))}return e.addEventListener(`resize`,t),()=>{e.removeEventListener(`resize`,t)}},[l,y,F,A]);let W={...I?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":p||void 0,id:`${k}-list`},onKeyDown(e){f.current=!0,w&&e3.has(e.key)&&e.stopPropagation()},onMouseMove(){f.current=!1},onPointerLeave(e){if(!g||F7(e)||e.pointerType===`touch`)return;let t=e.currentTarget;O.start(0,()=>{o.set(`activeIndex`,null),t.focus({preventScroll:!0})})},onScroll(e){I||U(e.currentTarget)},...y&&{style:I?{height:`100%`}:P7}},te=AE(`div`,e,{ref:[t,s],state:ee,stateAttributesMapping:lae,props:[M,W,M7(N),{className:!I&&y?L7.className:void 0},a]});return(0,G.jsxs)(b.Fragment,{children:[!D&&L7.getElement(E),(0,G.jsx)(r8,{context:T,modal:!1,disabled:!j,returnFocus:i,restoreFocus:!0,children:te})]})});function V7(e){let t=e.maxHeight||``;return t.endsWith(`px`)&&parseFloat(t)||1/0}function H7(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function dae(e){return Y8.getScale(e)}function U7(e,t){return S2({x:e.x/t.x,y:e.y/t.y,width:e.width/t.x,height:e.height/t.y})}var W7=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function fae(e){let{style:t}=e,n={};for(let[e,r]of W7)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of W7){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var pae=b.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a,scrollHandlerRef:o}=m7(),{alignItemWithTriggerActive:s}=j7(),c=b5(a,S7.hasScrollArrows),l=b5(a,S7.openMethod),u=b5(a,S7.multiple),d={id:`${b5(a,S7.id)}-list`,role:`listbox`,"aria-multiselectable":u||void 0,onScroll(e){o.current?.(e.currentTarget)},...s&&{style:P7},className:c&&l!==`touch`?L7.className:void 0};return AE(`div`,e,{ref:[t,zT(e=>{a.set(`listElement`,e)})],props:[d,i]})}),G7=b.createContext(void 0);function K7(){let e=b.useContext(G7);if(!e)throw Error(rE(57));return e}var mae=b.memo(b.forwardRef(function(e,t){let{render:n,className:r,value:i=null,label:a,disabled:o=!1,nativeButton:s=!1,...c}=e,l=b.useRef(null),u=Z1({label:a,textRef:l,indexGuessBehavior:X1.GuessFromOrder}),{store:d,getItemProps:f,setOpen:p,setValue:m,selectionRef:h,typingRef:g,valuesRef:_,keyboardActiveRef:v,multiple:y,highlightItemOnHover:x}=m7(),S=c6(),C=b5(d,S7.isActive,u.index),w=b5(d,S7.isSelected,u.index,i),T=b5(d,S7.isSelectedByFocus,u.index),E=b5(d,S7.isItemEqualToValue),D=u.index,O=D!==-1,k=b.useRef(null),A=p6(D);$(()=>{if(!O)return;let e=_.current;return e[D]=i,()=>{delete e[D]}},[O,D,i,_]),$(()=>{if(!O)return;let e=d.state.value,t=e;y&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&g7(i,t,E)&&d.set(`selectedIndex`,D)},[O,D,y,E,d,i]);let j={disabled:o,selected:w,highlighted:C},M=f({active:C,selected:w});M.onFocus=void 0,M.id=void 0;let N=b.useRef(null),P=b.useRef(`mouse`),F=b.useRef(!1),{getButtonProps:I,buttonRef:L}=sE({disabled:o,focusableWhenDisabled:!0,native:s,composite:!0});function R(e){let t=d.state.value;if(y){let n=Array.isArray(t)?t:[];m(w?Vie(n,i,E):[...n,i],p0(a0,e))}else m(i,p0(a0,e)),p(!1,p0(a0,e))}let z={role:`option`,"aria-selected":w,tabIndex:C?0:-1,onFocus(){d.set(`activeIndex`,D)},onMouseEnter(){!v.current&&d.state.selectedIndex===null&&x&&d.set(`activeIndex`,D)},onMouseMove(){x&&d.set(`activeIndex`,D)},onMouseLeave(e){!x||v.current||F7(e)||S.start(0,()=>{d.state.activeIndex===D&&d.set(`activeIndex`,null)})},onTouchStart(){h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){N.current=e.key,d.set(`activeIndex`,D),e.key===` `&&g.current&&e.preventDefault()},onClick(e){F.current=!1,!(e.type===`keydown`&&N.current===null)&&(o||e.type===`keydown`&&N.current===` `&&g.current||P.current!==`touch`&&!C||(N.current=null,R(e.nativeEvent)))},onPointerEnter(e){P.current=e.pointerType},onPointerDown(e){P.current=e.pointerType,F.current=!0},onMouseUp(){if(o)return;if(F.current){F.current=!1;return}let e=!h.current.allowSelectedMouseUp&&w,t=!h.current.allowUnselectedMouseUp&&!w;e||t||P.current!==`touch`&&!C||k.current?.click()}},B=AE(`div`,e,{ref:[L,t,u.ref,k],state:j,props:[M,z,c,I]}),V=b.useMemo(()=>({selected:w,indexRef:A,textRef:l,selectedByFocus:T,hasRegistered:O}),[w,A,l,T,O]);return(0,G.jsx)(G7.Provider,{value:V,children:B})})),hae=b.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=K7();return n||r?(0,G.jsx)(gae,{...e,ref:t}):null}),gae=b.memo(b.forwardRef((e,t)=>{let{render:n,className:r,keepMounted:i,...a}=e,{selected:o}=K7(),s=b.useRef(null),{transitionStatus:c,setMounted:l}=R4(o),u=AE(`span`,e,{ref:[t,s],state:{selected:o,transitionStatus:c},props:[{"aria-hidden":!0,children:`✔️`},a],stateAttributesMapping:A4});return L4({open:o,ref:s,onComplete(){o||l(!1)}}),u})),_ae=b.memo(b.forwardRef(function(e,t){let{indexRef:n,textRef:r,selectedByFocus:i,hasRegistered:a}=K7(),{selectedItemTextRef:o}=m7(),{className:s,render:c,...l}=e;return AE(`div`,e,{ref:[b.useCallback(e=>{if(!e||!a)return;let t=o.current===null||!o.current.isConnected;(i||t&&n.current===0)&&(o.current=e)},[o,n,i,a]),t,r],props:l})})),q7=b.forwardRef(function(e,t){let{render:n,className:r,direction:i,keepMounted:a=!1,...o}=e,{store:s,popupRef:c,listRef:l,handleScrollArrowVisibility:u,scrollArrowsMountedCountRef:d}=m7(),{side:f,scrollDownArrowRef:p,scrollUpArrowRef:m}=j7(),h=b5(s,i===`up`?S7.scrollUpArrowVisible:S7.scrollDownArrowVisible),g=b5(s,S7.openMethod),_=h&&g!==`touch`,v=c6(),y=i===`up`?m:p,{transitionStatus:b,setMounted:x}=R4(_);$(()=>(d.current+=1,s.state.hasScrollArrows||s.set(`hasScrollArrows`,!0),()=>{d.current=Math.max(0,d.current-1),d.current===0&&s.state.hasScrollArrows&&s.set(`hasScrollArrows`,!1)}),[s,d]),L4({open:_,ref:y,onComplete(){_||x(!1)}});let S=AE(`div`,e,{ref:[t,y],state:{direction:i,visible:_,side:f,transitionStatus:b},props:[{"aria-hidden":!0,children:i===`up`?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||v.isStarted())return;s.set(`activeIndex`,null);function t(){let e=s.state.listElement??c.current;if(!e)return;s.set(`activeIndex`,null),u();let n=e.scrollTop===0,r=Math.round(e.scrollTop+e.clientHeight)>=e.scrollHeight;if(l.current.length===0&&(i===`up`?s.set(`scrollUpArrowVisible`,!n):s.set(`scrollDownArrowVisible`,!r)),i===`up`&&n||i===`down`&&r){v.clear();return}if((s.state.listElement||c.current)&&l.current&&l.current.length>0){let t=l.current,n=y.current?.offsetHeight||0;if(i===`up`){let r=0,i=e.scrollTop+n;for(let e=0;e<t.length;e+=1){let n=t[e];if(n&&n.offsetTop>=i){r=e;break}}let a=Math.max(0,r-1);if(a<r){let r=t[a];r&&(e.scrollTop=Math.max(0,r.offsetTop-n))}else e.scrollTop=0}else{let r=t.length-1,i=e.scrollTop+e.clientHeight-n;for(let e=0;e<t.length;e+=1){let n=t[e];if(n&&n.offsetTop+n.offsetHeight>i){r=Math.max(0,e-1);break}}let a=Math.min(t.length-1,r+1);if(a>r){let r=t[a];r&&(e.scrollTop=r.offsetTop+r.offsetHeight-e.clientHeight+n)}else e.scrollTop=e.scrollHeight-e.clientHeight}}v.start(40,t)}v.start(40,t)},onMouseLeave(){v.clear()}},o]});return _||a?S:null}),vae=b.forwardRef(function(e,t){return(0,G.jsx)(q7,{...e,ref:t,direction:`down`})}),yae=b.forwardRef(function(e,t){return(0,G.jsx)(q7,{...e,ref:t,direction:`up`})}),bae=b.createContext(void 0),xae=b.forwardRef(function(e,t){let{className:n,render:r,...i}=e,[a,o]=b.useState(),s=b.useMemo(()=>({labelId:a,setLabelId:o}),[a,o]),c=AE(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":a},i]});return(0,G.jsx)(bae.Provider,{value:s,children:c})}),J7=Gie;function Y7({className:e,...t}){return(0,G.jsx)(xae,{"data-slot":`select-group`,className:cO(`scroll-my-1`,e),...t})}function X7({className:e,...t}){return(0,G.jsx)(Qie,{"data-slot":`select-value`,className:cO(`flex flex-1 text-left`,e),...t})}function Z7({className:e,size:t=`default`,children:n,...r}){return(0,G.jsxs)(Xie,{"data-slot":`select-trigger`,"data-size":t,className:cO(`border-input data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-none border bg-transparent py-2 pr-2 pl-2.5 text-xs transition-colors select-none focus-visible:ring-1 aria-invalid:ring-1 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-none *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...r,children:[n,(0,G.jsx)($ie,{render:(0,G.jsx)(nn,{className:`text-muted-foreground size-4 pointer-events-none`})})]})}function Q7({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,G.jsx)(tae,{children:(0,G.jsx)(sae,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,G.jsxs)(uae,{"data-slot":`select-content`,className:cO(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open: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 ring-foreground/10 min-w-36 rounded-none shadow-md ring-1 duration-100 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto`,e),...s,children:[(0,G.jsx)(Sae,{}),(0,G.jsx)(pae,{children:t}),(0,G.jsx)(Cae,{})]})})})}function $7({className:e,children:t,...n}){return(0,G.jsxs)(mae,{"data-slot":`select-item`,className:cO(`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-none py-2 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...n,children:[(0,G.jsx)(_ae,{className:`flex flex-1 gap-2 shrink-0 whitespace-nowrap`,children:t}),(0,G.jsx)(hae,{render:(0,G.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,G.jsx)(tn,{className:`pointer-events-none`})})]})}function Sae({className:e,...t}){return(0,G.jsx)(yae,{"data-slot":`select-scroll-up-button`,className:cO(`bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full`,e),...t,children:(0,G.jsx)(rn,{})})}function Cae({className:e,...t}){return(0,G.jsx)(vae,{"data-slot":`select-scroll-down-button`,className:cO(`bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full`,e),...t,children:(0,G.jsx)(nn,{})})}var e9=b.createContext(void 0);function wae(){let e=b.useContext(e9);if(e===void 0)throw Error(rE(63));return e}var t9=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),n9={...a7,checked(e){return e?{[t9.checked]:``}:{[t9.unchecked]:``}}};function Tae(e,t,n,r=!0,i){let[a,o]=b.useState(),s=J1(i?`${i}-label`:void 0),c=e??t??a;return $(()=>{let i=e||t||!r?void 0:Eae(n.current,s);a!==i&&o(i)}),c}function Eae(e,t){let n=Dae(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function Dae(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var Oae=b.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,id:o,inputRef:s,name:c,nativeButton:l=!1,onCheckedChange:u,readOnly:d=!1,required:f=!1,disabled:p=!1,render:m,uncheckedValue:h,value:g,..._}=e,{clearErrors:v}=s7(),{state:y,setTouched:x,setDirty:S,validityData:C,setFilled:w,setFocused:T,shouldValidateOnChange:E,validationMode:D,disabled:O,name:k,validation:A}=o7(),{labelId:j}=c7(),M=O||p,N=k??c,P=zT(u),F=b.useRef(null),I=uE(F,s,A.inputRef),L=b.useRef(null),R=J1(),z=l7({id:o,implicit:!1,controlRef:L}),B=l?void 0:z,[V,H]=k1({controlled:n,default:!!i,name:`Switch`,state:`checked`});u7({id:R,commit:A.commit,value:V,controlRef:L,name:N,getValue:()=>V}),$(()=>{F.current&&w(F.current.checked)},[F,w]),$5(V,()=>{v(N),S(V!==C.initialValue),w(V),E()?A.commit(V):A.commit(V,!0)});let{getButtonProps:U,buttonRef:ee}=sE({disabled:M,native:l}),W=Tae(a,j,F,!l,B),te={id:l?z:R,role:`switch`,"aria-checked":V,"aria-readonly":d||void 0,"aria-required":f||void 0,"aria-labelledby":W,onFocus(){M||T(!0)},onBlur(){let e=F.current;!e||M||(x(!0),T(!1),D===`onBlur`&&A.commit(e.checked))},onClick(e){d||M||(e.preventDefault(),F.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},ne=b.useMemo(()=>GT({checked:V,disabled:M,id:B,name:N,required:f,style:N?_6:g6,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:I,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=p0(t0,e.nativeEvent);P?.(t,n),!n.isCanceled&&H(t)},onFocus(){L.current?.focus()}},A.getInputValidationProps,g===void 0?wE:{value:g}),[V,M,I,B,N,P,f,H,A,g]),re=b.useMemo(()=>({...y,checked:V,disabled:M,readOnly:d,required:f}),[y,V,M,d,f]),ie=AE(`span`,e,{state:re,ref:[t,L,ee],props:[te,A.getValidationProps,_,U],stateAttributesMapping:n9});return(0,G.jsxs)(e9.Provider,{value:re,children:[ie,!V&&N&&h!==void 0&&(0,G.jsx)(`input`,{type:`hidden`,name:N,value:h}),(0,G.jsx)(`input`,{...ne})]})}),kae=b.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=o7(),o=wae();return AE(`span`,e,{state:{...a,...o},ref:t,stateAttributesMapping:n9,props:i})});function r9({className:e,size:t=`default`,...n}){return(0,G.jsx)(Oae,{"data-slot":`switch`,"data-size":t,className:cO(`cursor-pointer data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-1 aria-invalid:ring-1 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,G.jsx)(kae,{"data-slot":`switch-thumb`,className:`bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform`})})}function Aae({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:cO(`border-input dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-disabled:bg-input/50 dark:has-disabled:bg-input/80 h-8 rounded-none border transition-colors has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-1 has-[[data-slot][aria-invalid=true]]:ring-1 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto`,e),...t})}var jae=BE(`text-muted-foreground h-auto gap-2 py-1.5 text-xs font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-none [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none`,{variants:{align:{"inline-start":`pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem] order-first`,"inline-end":`pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem] order-last`,"block-start":`px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start`,"block-end":`px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start`}},defaultVariants:{align:`inline-start`}});function Mae({className:e,align:t=`inline-start`,...n}){return(0,G.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:cO(jae({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}function Nae({className:e,...t}){return(0,G.jsx)(t1,{"data-slot":`command`,className:cO(`bg-popover text-popover-foreground rounded-none flex size-full flex-col overflow-hidden`,e),...t})}function Pae({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`border-b pb-0`,children:(0,G.jsxs)(Aae,{className:`bg-input/30 border-input/30 h-8 border-none shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[(0,G.jsx)(t1.Input,{"data-slot":`command-input`,className:cO(`w-full text-xs outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,G.jsx)(Mae,{children:(0,G.jsx)(pn,{className:`size-4 shrink-0 opacity-50`})})]})})}function Fae({className:e,...t}){return(0,G.jsx)(t1.List,{"data-slot":`command-list`,className:cO(`no-scrollbar max-h-72 scroll-py-0 outline-none overflow-x-hidden overflow-y-auto`,e),...t})}function Iae({className:e,...t}){return(0,G.jsx)(t1.Empty,{"data-slot":`command-empty`,className:cO(`py-6 text-center text-xs`,e),...t})}function Lae({className:e,...t}){return(0,G.jsx)(t1.Group,{"data-slot":`command-group`,className:cO(`text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs`,e),...t})}function Rae({className:e,children:t,...n}){return(0,G.jsxs)(t1.Item,{"data-slot":`command-item`,className:cO(`data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-none px-2 py-2 text-xs outline-hidden select-none [&_svg:not([class*='size-'])]:size-4 in-data-[slot=dialog-content]:rounded-none! group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...n,children:[t,(0,G.jsx)(tn,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}var i9=b.createContext(void 0);function a9(e){let t=b.useContext(i9);if(t===void 0&&!e)throw Error(rE(47));return t}function zae(){return{...D5(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var Bae={...k5,disabled:_5(e=>e.disabled),instantType:_5(e=>e.instantType),openMethod:_5(e=>e.openMethod),openChangeReason:_5(e=>e.openChangeReason),modal:_5(e=>e.modal),stickIfOpen:_5(e=>e.stickIfOpen),titleElementId:_5(e=>e.titleElementId),descriptionElementId:_5(e=>e.descriptionElementId),openOnHover:_5(e=>e.openOnHover),closeDelay:_5(e=>e.closeDelay),hasViewport:_5(e=>e.hasViewport)},Vae=class e extends S5{constructor(e){let t={...zae(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),stickIfOpenTimeout:new s6,triggerElements:new E5},Bae)}setOpen=(e,t)=>{let n=t.reason===r0,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let a={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger};this.state.floatingRootContext.context.events?.emit(`openchange`,a);let o=()=>{let n={open:e,openChangeReason:t.reason},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),Lq.flushSync(o)):o(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let r=IT(()=>new e(n)).current,i=t??r;return S4(r.disposeEffect),i}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function o9({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=Vae.useStore(s?.store,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});J5(()=>{n===void 0&&u.state.open===!1&&r===!0&&u.update({open:!0,activeTriggerId:l})}),u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`positionerElement`),p=u.useState(`payload`),m=u.useState(`openChangeReason`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a);let{openMethod:h,triggerProps:g}=e7(d);w5(u);let{forceUnmount:_}=T5(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});Q5(d&&o===!0&&m!==`trigger-hover`&&h!==`touch`,f),b.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let v=b.useCallback(e=>{let t=p0(e);return t.preventUnmountOnClose=()=>{u.set(`preventUnmountingOnClose`,!0)},t},[u]),y=b.useCallback(()=>{u.setOpen(!1,v(d0))},[u,v]);b.useImperativeHandle(e.actionsRef,()=>({unmount:_,close:y}),[_,y]);let x=j5({popupStore:u,onOpenChange:u.setOpen}),{getReferenceProps:S,getFloatingProps:C,getTriggerProps:w}=P5([c8(x,{outsidePressEvent:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),B5(x)]),T=b.useMemo(()=>S(g),[S,g]),E=b.useMemo(()=>w(g),[w,g]),D=b.useMemo(()=>C(),[C]);u.useSyncedValues({modal:o,openMethod:h,activeTriggerProps:T,inactiveTriggerProps:E,popupProps:D,floatingRootContext:x,nested:U6()!=null});let O=b.useMemo(()=>({store:u}),[u]);return(0,G.jsx)(i9.Provider,{value:O,children:typeof t==`function`?t({payload:p}):t})}function Hae(e){return a9(!0)?(0,G.jsx)(o9,{props:e}):(0,G.jsx)(q6,{children:(0,G.jsx)(o9,{props:e})})}var Uae=b.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,handle:o,payload:s,openOnHover:c=!1,delay:l=300,closeDelay:u=0,id:d,...f}=e,p=a9(!0),m=o?.store??p?.store;if(!m)throw Error(rE(74));let h=J1(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`floatingRootContext`),v=m.useState(`isOpenedByTrigger`,h),y=b.useRef(null),{registerTrigger:x,isMountedByThisTrigger:S}=Nre(h,y,m,{payload:s,disabled:i,openOnHover:c,closeDelay:u}),C=m.useState(`openChangeReason`),w=m.useState(`stickIfOpen`),T=m.useState(`openMethod`),E=Hre(_,{enabled:_!=null&&c&&(T!==`touch`||C!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:Zre(),restMs:l,delay:{close:u},triggerElementRef:y,isActiveTrigger:g}),D=P5([i8(_,{enabled:_!=null,stickIfOpen:w})]),O=m.useState(`triggerProps`,S),k={disabled:i,open:v},{getButtonProps:A,buttonRef:j}=sE({disabled:i,native:a}),M=b.useMemo(()=>({open(e){return e&&C===`trigger-press`?t6.open(e):e6.open(e)}}),[C]),N=AE(`button`,e,{state:k,ref:[j,t,x,y],props:[D.getReferenceProps(),E,O,{[EE]:``,id:h},f,A],stateAttributesMapping:M}),P=b.useRef(null),F=zT(e=>{Lq.flushSync(()=>{m.setOpen(!1,p0(s0,e.nativeEvent,e.currentTarget))}),g4(P.current)?.focus()}),I=zT(e=>{let t=m.select(`positionerElement`);if(t&&_4(e,t))m.context.beforeContentFocusGuardRef.current?.focus();else{Lq.flushSync(()=>{m.setOpen(!1,p0(s0,e.nativeEvent,e.currentTarget))});let n=h4(m.context.triggerFocusTargetRef.current||y.current);for(;n!==null&&N0(t,n);){let e=n;if(n=f4(n),n===e)break}n?.focus()}});return g?(0,G.jsxs)(b.Fragment,{children:[(0,G.jsx)(v6,{ref:P,onFocus:F}),(0,G.jsx)(b.Fragment,{children:N},h),(0,G.jsx)(v6,{ref:m.context.triggerFocusTargetRef,onFocus:I})]}):(0,G.jsx)(b.Fragment,{children:N},h)}),s9=b.createContext(void 0);function Wae(){let e=b.useContext(s9);if(e===void 0)throw Error(rE(45));return e}var Gae=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=a9();return i.useState(`mounted`)||n?(0,G.jsx)(s9.Provider,{value:n,children:(0,G.jsx)(R6,{ref:t,...r})}):null}),c9=b.createContext(void 0);function Kae(){let e=b.useContext(c9);if(!e)throw Error(rE(46));return e}var qae=b.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=OE,...g}=e,{store:_}=a9(),v=Wae(),y=G6(),x=_.useState(`floatingRootContext`),S=_.useState(`mounted`),C=_.useState(`open`),w=_.useState(`openChangeReason`),T=_.useState(`activeTriggerElement`),E=_.useState(`modal`),D=_.useState(`positionerElement`),O=_.useState(`instantType`),k=_.useState(`transitionStatus`),A=_.useState(`hasViewport`),j=b.useRef(null),M=I4(D,!1,!1),N=O7({anchor:i,floatingRootContext:x,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:v,nodeId:y,collisionAvoidance:h,adaptiveOrigin:A?aae:void 0}),P=b.useMemo(()=>{let e={};return C||(e.pointerEvents=`none`),{role:`presentation`,hidden:!S,style:{...N.positionerStyles,...e}}},[C,S,N.positionerStyles]),F=b.useMemo(()=>({props:P,...N}),[P,N]),I=x.useState(`domReferenceElement`);$(()=>{let e=I,t=j.current;if(e&&(j.current=e),t&&e&&e!==t){_.set(`instantType`,void 0);let e=new AbortController;return M(()=>{_.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,M,_]);let L={open:C,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:O},R=b.useCallback(e=>{_.set(`positionerElement`,e)},[_]),z=AE(`div`,e,{state:L,props:[F.props,M7(k),g],ref:[t,R],stateAttributesMapping:n6});return(0,G.jsxs)(c9.Provider,{value:F,children:[S&&E===!0&&w!==`trigger-hover`&&(0,G.jsx)(q5,{ref:_.context.internalBackdropRef,inert:E4(!C),cutout:T}),(0,G.jsx)(K6,{id:y,children:z})]})}),Jae=b.createContext(void 0);function Yae(){let[e,t]=b.useState(0),n=zT(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:b.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function Xae(e){let{value:t,children:n}=e;return(0,G.jsx)(Jae.Provider,{value:t,children:n})}var Zae={...n6,...A4},Qae=b.forwardRef(function(e,t){let{className:n,render:r,initialFocus:i,finalFocus:a,...o}=e,{store:s}=a9(),c=Kae(),l=R7(!0)!=null,{context:u,hasClosePart:d}=Yae(),f=s.useState(`open`),p=s.useState(`openMethod`),m=s.useState(`instantType`),h=s.useState(`transitionStatus`),g=s.useState(`popupProps`),_=s.useState(`titleElementId`),v=s.useState(`descriptionElementId`),y=s.useState(`modal`),x=s.useState(`mounted`),S=s.useState(`openChangeReason`),C=s.useState(`activeTriggerElement`),w=s.useState(`floatingRootContext`);L4({open:f,ref:s.context.popupRef,onComplete(){f&&s.context.onOpenChangeComplete?.(!0)}});let T=s.useState(`disabled`),E=s.useState(`openOnHover`),D=s.useState(`closeDelay`);Bre(w,{enabled:E&&!T,closeDelay:D});function O(e){return e===`touch`?s.context.popupRef.current:!0}let k=i===void 0?O:i,A={open:f,side:c.side,align:c.align,instant:m,transitionStatus:h},j=y!==!1&&d,M=b.useCallback(e=>{s.set(`popupElement`,e)},[s]),N=AE(`div`,e,{state:A,ref:[t,s.context.popupRef,M],props:[g,{"aria-labelledby":_,"aria-describedby":v,onKeyDown(e){l&&e3.has(e.key)&&e.stopPropagation()}},M7(h),o],stateAttributesMapping:Zae});return(0,G.jsx)(r8,{context:w,openInteractionType:p,modal:j,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:a,restoreFocus:`popup`,previousFocusableElement:gT(C)?C:void 0,nextFocusableElement:s.context.triggerFocusTargetRef,beforeContentFocusGuardRef:s.context.beforeContentFocusGuardRef,children:(0,G.jsx)(Xae,{value:u,children:N})})});function $ae({...e}){return(0,G.jsx)(Hae,{"data-slot":`popover`,...e})}function eoe({...e}){return(0,G.jsx)(Uae,{"data-slot":`popover-trigger`,...e})}function toe({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,G.jsx)(Gae,{children:(0,G.jsx)(qae,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,G.jsx)(Qae,{"data-slot":`popover-content`,className:cO(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open: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 ring-foreground/10 flex flex-col gap-2.5 rounded-none p-2.5 text-xs shadow-md ring-1 duration-100 z-50 w-72 origin-(--transform-origin) outline-hidden`,e),...a})})})}var l9=[{value:`en-US`,label:`English (US)`},{value:`es-ES`,label:`español (España)`},{value:`fr-FR`,label:`français (France)`},{value:`de-DE`,label:`Deutsch`},{value:`it-IT`,label:`italiano`},{value:`am-ET`,label:`አማርኛ`},{value:`ar`,label:`العربية`},{value:`bg-BG`,label:`български`},{value:`bn-BD`,label:`বাংলা`},{value:`bs-BA`,label:`bosanski`},{value:`ca-ES`,label:`català`},{value:`cs-CZ`,label:`čeština`},{value:`da-DK`,label:`dansk`},{value:`el-GR`,label:`Ελληνικά`},{value:`es-419`,label:`español (Latinoamérica)`},{value:`et-EE`,label:`eesti`},{value:`fi-FI`,label:`suomi`},{value:`fr-CA`,label:`français (Canada)`},{value:`gu-IN`,label:`ગુજરાતી`},{value:`hi-IN`,label:`हिन्दी`},{value:`hr-HR`,label:`hrvatski`},{value:`hu-HU`,label:`magyar`},{value:`hy-AM`,label:`հայերեն`},{value:`id-ID`,label:`Indonesia`},{value:`is-IS`,label:`íslenska`},{value:`ja-JP`,label:`日本語`},{value:`ka-GE`,label:`ქართული`},{value:`kk-KZ`,label:`қазақ тілі`},{value:`kn-IN`,label:`ಕನ್ನಡ`},{value:`ko-KR`,label:`한국어`},{value:`lt-LT`,label:`lietuvių`},{value:`lv-LV`,label:`latviešu`},{value:`mk-MK`,label:`македонски`},{value:`ml-IN`,label:`മലയാളം`},{value:`mn-MN`,label:`монгол`},{value:`mr-IN`,label:`मराठी`},{value:`ms-MY`,label:`Bahasa Melayu`},{value:`my-MM`,label:`မြန်မာ`},{value:`nb-NO`,label:`norsk bokmål`},{value:`nl-NL`,label:`Nederlands`},{value:`pa-IN`,label:`ਪੰਜਾਬੀ`},{value:`pl-PL`,label:`polski`},{value:`pt-BR`,label:`português (Brasil)`},{value:`pt-PT`,label:`português (Portugal)`},{value:`ro-RO`,label:`română`},{value:`ru-RU`,label:`русский`},{value:`sk-SK`,label:`slovenčina`},{value:`sl-SI`,label:`slovenščina`},{value:`so-SO`,label:`Soomaali`},{value:`sq-AL`,label:`shqip`},{value:`sr-RS`,label:`српски`},{value:`sv-SE`,label:`svenska`},{value:`sw-KE`,label:`Kiswahili`},{value:`ta-IN`,label:`தமிழ்`},{value:`te-IN`,label:`తెలుగు`},{value:`th-TH`,label:`ไทย`},{value:`tl-PH`,label:`Tagalog`},{value:`tr-TR`,label:`Türkçe`},{value:`uk-UA`,label:`українська`},{value:`ur-PK`,label:`اردو`},{value:`vi-VN`,label:`Tiếng Việt`},{value:`zh-Hans`,label:`简体中文`},{value:`zh-Hant-HK`,label:`繁體中文(香港)`},{value:`zh-Hant-TW`,label:`繁體中文(台灣)`}],noe=({value:e,onValueChange:t})=>{let[n,r]=(0,b.useState)(!1),i=l9.find(t=>t.value===e);return(0,G.jsxs)($ae,{open:n,onOpenChange:r,children:[(0,G.jsx)(eoe,{children:(0,G.jsxs)(lO,{variant:`outline`,role:`combobox`,"aria-expanded":n,className:`w-full justify-between`,children:[i?(0,G.jsxs)(`span`,{children:[i.value,(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`- `,i.label]})]}):`Select locale...`,(0,G.jsx)(an,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,G.jsx)(toe,{className:`w-full p-0`,children:(0,G.jsxs)(Nae,{children:[(0,G.jsx)(Pae,{placeholder:`Search locale...`}),(0,G.jsxs)(Fae,{children:[(0,G.jsx)(Iae,{children:`No locale found.`}),(0,G.jsx)(Lae,{children:l9.map(n=>(0,G.jsxs)(Rae,{value:n.value,onSelect:n=>{t(n===e?``:n),r(!1)},children:[(0,G.jsxs)(`span`,{children:[n.label,` `,(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,n.value,`)`]})]}),(0,G.jsx)(tn,{className:cO(`ml-auto h-4 w-4`,e===n.value?`opacity-100`:`opacity-0`)})]},n.value))})]})]})})]})};function roe({resourceUri:e}){let{data:t}=lT(e);return t?(0,G.jsx)(`div`,{className:`text-xs`,children:(0,G.jsx)(W3,{src:t.contents[0],name:null,quotesOnKeys:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!1,theme:`rjv-default`,style:{fontSize:`0.75rem`},collapsed:4,collapseStringsAfterLength:80})}):null}var ioe=()=>{let e=cT(),{openaiRef:t,openaiObject:n,openInAppUrl:r}=KS(e.name),{setToolData:i}=GS(),a=e._meta?.[`openai/outputTemplate`],o=(r,a)=>{let o=t?.current?.contentWindow?.openai;o&&n&&(o[r]=a,i(e.name,{openaiObject:{...n,[r]:a}}))};return n?(0,G.jsx)(`div`,{className:`overflow-auto max-h-full min-h-0`,children:(0,G.jsxs)(m3,{defaultValue:`widget-state`,className:`gap-0`,children:[(0,G.jsxs)(g3,{className:`border-b border-border w-full`,children:[(0,G.jsx)(_3,{value:`properties`,children:`Properties`}),(0,G.jsx)(_3,{value:`widget-state`,children:`Widget State`}),a&&(0,G.jsx)(_3,{value:`resource`,children:`Resource`})]}),(0,G.jsx)(v3,{value:`properties`,className:`p-4`,children:(0,G.jsxs)(kie,{children:[(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Display Mode`}),(0,G.jsxs)(J7,{value:n.displayMode,onValueChange:e=>o(`displayMode`,e),"aria-label":`Select framework`,items:[{label:`Inline`,value:`inline`},{label:`Fullscreen`,value:`fullscreen`},{label:`Pip`,value:`pip`},{label:`Modal`,value:`modal`}],name:`displayMode`,required:!0,children:[(0,G.jsx)(Z7,{children:(0,G.jsx)(X7,{})}),(0,G.jsx)(Q7,{children:(0,G.jsxs)(Y7,{children:[(0,G.jsx)($7,{value:`inline`,children:`Inline`}),(0,G.jsx)($7,{value:`fullscreen`,children:`Fullscreen`}),(0,G.jsx)($7,{value:`pip`,children:`Pip`}),(0,G.jsx)($7,{value:`modal`,children:`Modal`})]})})]})]}),(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Theme`}),(0,G.jsxs)(Die,{children:[(0,G.jsx)(lO,{variant:n.theme===`light`?`default`:`outline`,onClick:()=>o(`theme`,`light`),children:(0,G.jsx)(mn,{})}),(0,G.jsx)(lO,{variant:n.theme===`dark`?`default`:`outline`,onClick:()=>o(`theme`,`dark`),children:(0,G.jsx)(un,{})})]})]}),(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Locale`}),(0,G.jsx)(noe,{value:n.locale,onValueChange:e=>o(`locale`,e)})]}),(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Max Height`}),(0,G.jsx)(d7,{type:`number`,value:n.maxHeight===void 0?``:String(n.maxHeight),onChange:e=>{let t=e.target.value.trim();o(`maxHeight`,t===``?void 0:Number(t))}})]}),(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Safe Area Insets`}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-4`,children:[`top`,`bottom`,`left`,`right`].map(e=>{let t=e.charAt(0).toUpperCase()+e.slice(1);return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`safeArea-${e}`,className:`text-xs text-muted-foreground block mb-1`,children:t}),(0,G.jsx)(d7,{id:`safeArea-${e}`,type:`number`,value:n.safeArea?.insets?.[e]===void 0?`0`:String(n.safeArea.insets[e]),onChange:t=>{let r=t.target.value.trim();o(`safeArea`,{...n.safeArea,insets:{...n.safeArea?.insets,[e]:r===``?0:Number(r)}})}})]},e)})})]}),(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Device Type`}),(0,G.jsxs)(J7,{value:n.userAgent?.device?.type??`desktop`,onValueChange:e=>o(`userAgent`,{...n.userAgent,device:{...n.userAgent?.device,type:e}}),"aria-label":`Select device type`,items:[{label:`Mobile`,value:`mobile`},{label:`Desktop`,value:`desktop`}],name:`deviceType`,required:!0,children:[(0,G.jsx)(Z7,{children:(0,G.jsx)(X7,{})}),(0,G.jsx)(Q7,{children:(0,G.jsxs)(Y7,{children:[(0,G.jsx)($7,{value:`mobile`,children:`Mobile`}),(0,G.jsx)($7,{value:`desktop`,children:`Desktop`})]})})]})]}),(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Capabilities`}),(0,G.jsxs)(`div`,{className:`flex gap-8`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`label`,{htmlFor:`hover`,className:`text-xs text-muted-foreground cursor-pointer`,children:`Hover`}),(0,G.jsx)(r9,{id:`hover`,checked:n.userAgent?.capabilities?.hover??!1,onCheckedChange:e=>o(`userAgent`,{...n.userAgent,capabilities:{...n.userAgent?.capabilities,hover:e}})})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`label`,{htmlFor:`touch`,className:`text-xs text-muted-foreground cursor-pointer`,children:`Touch`}),(0,G.jsx)(r9,{id:`touch`,checked:n.userAgent?.capabilities?.touch??!1,onCheckedChange:e=>o(`userAgent`,{...n.userAgent,capabilities:{...n.userAgent?.capabilities,touch:e}})})]})]})]}),(0,G.jsxs)(t7,{children:[(0,G.jsx)(n7,{children:`Open in App URL`}),(0,G.jsx)(d7,{type:`text`,value:r??``,readOnly:!0,placeholder:`Not set`,className:`font-mono text-xs`})]})]})}),(0,G.jsx)(v3,{value:`widget-state`,className:`p-4`,children:(0,G.jsx)(W3,{src:n.widgetState??{},name:null,quotesOnKeys:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!1,theme:`rjv-default`,collapsed:3,collapseStringsAfterLength:80})}),a&&(0,G.jsx)(v3,{value:`resource`,className:`p-4`,children:(0,G.jsx)(b.Suspense,{fallback:(0,G.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Loading resource...`}),children:(0,G.jsx)(roe,{resourceUri:a})})})]})}):null};function u9(e){return new Date(e).toLocaleTimeString(`en-US`,{hour12:!1,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,fractionalSecondDigits:3})}function aoe(e,t=60){let n=JSON.stringify(e);return n.length>t?`${n.slice(0,t)}…`:n}function ooe({log:e}){let[t,n]=(0,b.useState)(!1),r=Object.keys(e.args).length>0,i=r?aoe(e.args):null;return(0,G.jsxs)(G.Fragment,{children:[r?(0,G.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex items-center gap-2 py-1.5 px-2 text-xs font-mono border-b border-gray-200 dark:border-gray-800/50 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800/30 w-full text-left`,children:[(0,G.jsx)(`span`,{className:`text-gray-600 dark:text-gray-500 shrink-0 min-w-[80px]`,children:u9(e.timestamp)}),(0,G.jsx)(`span`,{className:cO(`font-semibold shrink-0 min-w-[120px]`,e.type===`response`?`text-green-600 dark:text-green-400`:`text-blue-600 dark:text-blue-400`),children:e.command}),(0,G.jsx)(`span`,{className:`text-gray-500 dark:text-gray-600 mr-1`,children:t?`▼`:`▶`}),(0,G.jsx)(`span`,{className:`text-gray-600 dark:text-gray-400 truncate flex-1 min-w-0`,children:i})]}):(0,G.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5 px-2 text-xs font-mono border-b border-gray-200 dark:border-gray-800/50`,children:[(0,G.jsx)(`span`,{className:`text-gray-600 dark:text-gray-500 shrink-0 min-w-[80px]`,children:u9(e.timestamp)}),(0,G.jsx)(`span`,{className:`text-blue-600 dark:text-blue-400 font-semibold shrink-0 min-w-[120px]`,children:e.command})]}),t&&r&&(0,G.jsx)(`div`,{className:`px-2 py-2 bg-gray-50 dark:bg-gray-900/30 border-b border-gray-200 dark:border-gray-800/50`,children:(0,G.jsx)(`pre`,{className:`text-xs font-mono text-gray-800 dark:text-gray-200 whitespace-pre-wrap overflow-x-auto`,children:JSON.stringify(e.args,null,2)})})]})}function soe(){let e=cT(),{setToolData:t}=GS(),{openaiLogs:n}=KS(e.name),r=(0,b.useRef)(null);return(0,b.useEffect)(()=>{let e=r.current;e&&(e.scrollTop=e.scrollHeight)},[]),(0,G.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden min-h-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between mb-3 h-8 flex-none`,children:[(0,G.jsx)(`h3`,{className:`text-sm font-semibold text-gray-900 dark:text-gray-200`,children:`MCP client logs`}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:n.length>0&&(0,G.jsxs)(lO,{variant:`ghost`,size:`sm`,onClick:()=>{t(e.name,{openaiLogs:[]})},children:[(0,G.jsx)(hn,{className:`w-3 h-3`}),`Clear`]})})]}),(0,G.jsx)(`div`,{ref:r,className:`overflow-auto flex-1 bg-gray-50 rounded-lg border border-gray-200 min-h-0`,children:n.map(e=>(0,G.jsx)(ooe,{log:e},e.id))})]})}var coe=BE(`relative grid w-full items-start gap-x-2 gap-y-0.5 rounded-xl border px-3.5 py-3 text-card-foreground text-sm has-[>svg]:has-data-[slot=alert-action]:grid-cols-[calc(var(--spacing)*4)_1fr_auto] has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-data-[slot=alert-action]:grid-cols-[1fr_auto] has-[>svg]:gap-x-2 [&>svg]:h-[1lh] [&>svg]:w-4`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-transparent dark:bg-input/32 [&>svg]:text-muted-foreground`,error:`border-destructive/32 bg-destructive/4 [&>svg]:text-destructive`,info:`border-info/32 bg-info/4 [&>svg]:text-info`,success:`border-success/32 bg-success/4 [&>svg]:text-success`,warning:`border-warning/32 bg-warning/4 [&>svg]:text-warning`}}});function loe({className:e,variant:t,...n}){return(0,G.jsx)(`div`,{className:cO(coe({variant:t}),e),"data-slot":`alert`,role:`alert`,...n})}function uoe({className:e,...t}){return(0,G.jsx)(`div`,{className:cO(`font-medium [svg~&]:col-start-2`,e),"data-slot":`alert-title`,...t})}function doe({className:e,...t}){return(0,G.jsx)(`div`,{className:cO(`flex flex-col gap-2.5 text-muted-foreground [svg~&]:col-start-2`,e),"data-slot":`alert-description`,...t})}var foe=()=>{let e=KS(cT().name);return e?(0,G.jsx)(`div`,{className:`flex flex-col h-full overflow-hidden bg-card`,children:(0,G.jsx)(`div`,{className:`p-4 overflow-auto`,children:e.response?e.response.isError?(0,G.jsxs)(loe,{variant:`error`,children:[(0,G.jsx)(on,{}),(0,G.jsx)(uoe,{children:`Error`}),(0,G.jsx)(doe,{children:(()=>{let t=[];return e.response.content.forEach(e=>{e.type===`text`&&t.push(e.text)}),t.join(`
|
|
153
153
|
`)})()})]}):(0,G.jsx)(`div`,{className:`text-xs`,children:(0,G.jsx)(W3,{src:e.response??{},name:null,quotesOnKeys:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!1,theme:`rjv-default`,style:{fontSize:`0.75rem`},collapsed:3,collapseStringsAfterLength:80})}):null})}):null},d9=`openai:set_globals`,poe=class extends CustomEvent{type=d9},moe=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.3`})),f9=s(((e,t)=>{t.exports=moe()})),hoe=u(f9(),1),goe=qu([Z(`light`),Z(`dark`)]).describe(`Color theme preference for the host environment.`),p9=qu([Z(`inline`),Z(`fullscreen`),Z(`pip`)]).describe(`Display mode for UI presentation.`),_oe=$u(qu([Z(`--color-background-primary`),Z(`--color-background-secondary`),Z(`--color-background-tertiary`),Z(`--color-background-inverse`),Z(`--color-background-ghost`),Z(`--color-background-info`),Z(`--color-background-danger`),Z(`--color-background-success`),Z(`--color-background-warning`),Z(`--color-background-disabled`),Z(`--color-text-primary`),Z(`--color-text-secondary`),Z(`--color-text-tertiary`),Z(`--color-text-inverse`),Z(`--color-text-ghost`),Z(`--color-text-info`),Z(`--color-text-danger`),Z(`--color-text-success`),Z(`--color-text-warning`),Z(`--color-text-disabled`),Z(`--color-border-primary`),Z(`--color-border-secondary`),Z(`--color-border-tertiary`),Z(`--color-border-inverse`),Z(`--color-border-ghost`),Z(`--color-border-info`),Z(`--color-border-danger`),Z(`--color-border-success`),Z(`--color-border-warning`),Z(`--color-border-disabled`),Z(`--color-ring-primary`),Z(`--color-ring-secondary`),Z(`--color-ring-inverse`),Z(`--color-ring-info`),Z(`--color-ring-danger`),Z(`--color-ring-success`),Z(`--color-ring-warning`),Z(`--font-sans`),Z(`--font-mono`),Z(`--font-weight-normal`),Z(`--font-weight-medium`),Z(`--font-weight-semibold`),Z(`--font-weight-bold`),Z(`--font-text-xs-size`),Z(`--font-text-sm-size`),Z(`--font-text-md-size`),Z(`--font-text-lg-size`),Z(`--font-heading-xs-size`),Z(`--font-heading-sm-size`),Z(`--font-heading-md-size`),Z(`--font-heading-lg-size`),Z(`--font-heading-xl-size`),Z(`--font-heading-2xl-size`),Z(`--font-heading-3xl-size`),Z(`--font-text-xs-line-height`),Z(`--font-text-sm-line-height`),Z(`--font-text-md-line-height`),Z(`--font-text-lg-line-height`),Z(`--font-heading-xs-line-height`),Z(`--font-heading-sm-line-height`),Z(`--font-heading-md-line-height`),Z(`--font-heading-lg-line-height`),Z(`--font-heading-xl-line-height`),Z(`--font-heading-2xl-line-height`),Z(`--font-heading-3xl-line-height`),Z(`--border-radius-xs`),Z(`--border-radius-sm`),Z(`--border-radius-md`),Z(`--border-radius-lg`),Z(`--border-radius-xl`),Z(`--border-radius-full`),Z(`--border-width-regular`),Z(`--shadow-hairline`),Z(`--shadow-sm`),Z(`--shadow-md`),Z(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
|
|
154
154
|
|
|
155
155
|
Individual style keys are optional - hosts may provide any subset of these values.
|
|
@@ -227,4 +227,4 @@ Error generating stack: `+e.message+`
|
|
|
227
227
|
|
|
228
228
|
await waitForOpenAI();
|
|
229
229
|
${n.textContent}
|
|
230
|
-
`,t.head.innerHTML+t.body.innerHTML}var ase=()=>{let e=cT(),{openaiObject:t}=KS(e.name)??{},{data:n}=lT(e._meta?.[`openai/outputTemplate`]),{setToolData:r,pushOpenAiLog:i,updateOpenaiObject:a,setOpenInAppUrl:o}=GS(),s=(0,b.useRef)(null),c=(0,b.useRef)(null),l=(0,b.useRef)(!1),u=n.contents[0].text,d=(0,b.useCallback)(()=>{if(l.current)return;let c=s.current;if(!c
|
|
230
|
+
`,t.head.innerHTML+t.body.innerHTML}var ase=()=>{let e=cT(),{openaiObject:t}=KS(e.name)??{},{data:n}=lT(e._meta?.[`openai/outputTemplate`]),{setToolData:r,pushOpenAiLog:i,updateOpenaiObject:a,setOpenInAppUrl:o}=GS(),s=(0,b.useRef)(null),c=(0,b.useRef)(null),l=(0,b.useRef)(!1),u=n.contents[0].text,d=(0,b.useCallback)(()=>{if(l.current)return;let c=s.current;if(!c?.contentWindow||!c.contentDocument)return;l.current=!0;let d=n.contents[0]._meta?.[`openai/widgetDomain`];d&&typeof d==`string`&&o(e.name,d),rse(c.contentWindow,t,(t,n,r=`default`)=>{i(e.name,{timestamp:Date.now(),command:t,args:n,type:r})},(t,n)=>{a(e.name,t,n)},(e,t)=>Zw.callTool(e,t),t=>{o(e.name,t)}),c.contentDocument.open(),c.contentDocument.write(ise(u)),c.contentDocument.close(),r(e.name,{openaiRef:s})},[t,i,r,a,o,e.name,u,n]);return(0,b.useEffect)(()=>{d()},[d]),(0,G.jsx)(`div`,{ref:c,className:`relative overflow-auto`,style:{width:`100%`,height:`100%`},children:(0,G.jsx)(`iframe`,{ref:s,src:`about:blank`,onLoad:d,style:{width:`100%`,height:`100%`,border:`none`,display:`block`},sandbox:`allow-scripts allow-same-origin allow-forms`,title:`html-preview`})})},ose=()=>{let e=cT(),t=KS(e.name),{defaultLayout:n,onLayoutChange:r}=oi({id:`skybridge-devtools-input-column`,storage:localStorage}),{defaultLayout:i,onLayoutChange:a}=oi({id:`skybridge-devtools-widget-section`,storage:localStorage}),{defaultLayout:o,onLayoutChange:s}=oi({id:`skybridge-devtools-inspector-section`,storage:localStorage}),{defaultLayout:c,onLayoutChange:l}=oi({id:`skybridge-devtools-main-section`,storage:localStorage}),u=!!(e._meta?.[`openai/outputTemplate`]&&t?.response&&!t.response.isError);return(0,G.jsx)(`div`,{className:`flex-1 flex flex-col overflow-hidden relative z-10`,children:(0,G.jsxs)(ri,{orientation:`vertical`,className:`flex-1 overflow-hidden`,defaultLayout:c,onLayoutChange:l,children:[(0,G.jsx)(ui,{id:`top-section`,minSize:`30`,children:(0,G.jsxs)(ri,{orientation:`horizontal`,className:`flex-1 overflow-hidden`,defaultLayout:n,onLayoutChange:r,children:[(0,G.jsx)(ui,{id:`input-column`,minSize:`20`,maxSize:`60`,children:(0,G.jsx)(`div`,{className:`flex flex-col overflow-hidden h-full`,children:(0,G.jsx)(Tie,{})})}),(0,G.jsx)(pi,{className:`w-px bg-border`}),(0,G.jsx)(ui,{id:`output-column`,minSize:`30`,children:(0,G.jsx)(`div`,{className:`flex flex-col overflow-hidden h-full`,children:(0,G.jsx)(foe,{})})})]})}),u&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(pi,{className:`h-px bg-border`}),(0,G.jsx)(ui,{id:`widget-section`,minSize:`20`,children:(0,G.jsxs)(ri,{orientation:`horizontal`,className:`flex-1 overflow-hidden bg-card`,defaultLayout:o,onLayoutChange:s,children:[(0,G.jsx)(ui,{id:`widget-logs-panel`,minSize:`30`,children:(0,G.jsx)(`div`,{className:`flex flex-col h-full overflow-hidden`,children:(0,G.jsxs)(ri,{orientation:`vertical`,className:`flex-1 overflow-hidden`,defaultLayout:i,onLayoutChange:a,children:[(0,G.jsx)(ui,{id:`widget-panel`,minSize:`20`,maxSize:`80`,children:(0,G.jsx)(`div`,{className:`h-full overflow-hidden`,children:(0,G.jsx)(b.Suspense,{children:(0,G.jsx)(ase,{})})})}),(0,G.jsx)(pi,{className:`h-px bg-border`}),(0,G.jsx)(ui,{id:`logs-panel`,minSize:`20`,children:(0,G.jsx)(`div`,{className:`p-4 flex flex-col h-full min-h-0`,children:(0,G.jsx)(soe,{})})})]})})}),(0,G.jsx)(pi,{className:`w-px bg-border`}),(0,G.jsx)(ui,{id:`inspector-panel`,minSize:`20`,maxSize:`50`,defaultSize:30,children:(0,G.jsx)(`div`,{className:`flex flex-col overflow-hidden h-full min-h-0`,children:(0,G.jsx)(`div`,{className:`overflow-auto`,children:(0,G.jsx)(ioe,{})})})})]})})]})]})})};function sse(){let e=iT(),[,t]=iC(),n=sT();return(0,G.jsx)(`div`,{className:`h-full border-r border-border bg-card flex flex-col`,children:(0,G.jsxs)(`aside`,{className:`h-full flex flex-col`,children:[(0,G.jsxs)(`div`,{className:`p-4 border-b border-border h-[72px] flex flex-col justify-center`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Tools`}),(0,G.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e?.length,` `,e?.length===1?`tool`:`tools`]})]}),(0,G.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,G.jsx)(`div`,{className:`p-2`,children:e?.length===0?(0,G.jsx)(`div`,{className:`p-4 text-center text-sm text-muted-foreground`,children:`No tools registered yet.`}):(0,G.jsx)(`div`,{className:`space-y-1`,children:e?.map(e=>{let r=e.name===n?.name;return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t(e.name),className:cO(`w-full text-left px-3 py-3 rounded-md transition-colors cursor-pointer relative`,`hover:bg-accent hover:text-accent-foreground`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1`,r&&`bg-accent text-accent-foreground`),children:[(0,G.jsxs)(`div`,{className:`pr-6 flex flex-col gap-1`,children:[(0,G.jsx)(`div`,{className:cO(`font-semibold text-sm leading-tight truncate`,r&&`text-accent-foreground`),children:e.name}),e.description&&(0,G.jsx)(`div`,{className:cO(`text-xs leading-snug text-muted-foreground`,`line-clamp-2`,r&&`text-accent-foreground/80`),children:e.description})]}),r&&(0,G.jsx)(`div`,{className:`absolute top-3 right-3 w-1.5 h-1.5 rounded-full bg-primary`})]},e.name)})})})})]})})}function cse(){let e=sT(),{status:t,requiresAuth:n}=bi(),{defaultLayout:r,onLayoutChange:i}=oi({id:`skybridge-devtools-tools-list`,storage:localStorage});return(0,G.jsxs)(`div`,{className:`flex h-screen w-full flex-col overflow-hidden bg-background`,children:[(0,G.jsx)(Fte,{}),t===`authenticated`?(0,G.jsxs)(ri,{orientation:`horizontal`,className:`flex-1 overflow-hidden`,defaultLayout:r,onLayoutChange:i,children:[(0,G.jsx)(ui,{id:`tools-list`,minSize:`15`,maxSize:`40`,children:(0,G.jsx)(sse,{})}),(0,G.jsx)(pi,{className:`w-px bg-border`}),(0,G.jsx)(ui,{id:`main-content`,minSize:`30`,children:(0,G.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden relative h-full`,children:e?(0,G.jsx)(ose,{}):(0,G.jsx)(Rne,{})})})]}):(0,G.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,G.jsxs)(`div`,{className:`text-center space-y-4`,children:[(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t===`connecting`?`Connecting to server...`:n?`Authentication required to access this server.`:`Not connected to a server.`}),t!==`connecting`&&(0,G.jsxs)(lO,{variant:`outline`,size:`sm`,onClick:eT,children:[(0,G.jsx)(fn,{className:`h-3.5 w-3.5`}),`Connect`]})]})})]})}function lse(){return(0,G.jsx)(Ue,{client:aC,children:(0,G.jsx)(Wt,{children:(0,G.jsx)(cse,{})})})}async function use(){let e=new URLSearchParams(window.location.search);if(e.get(`oauth_callback`)===`true`){let t=e.get(`code`),n=new URL(window.location.href);if(n.searchParams.delete(`oauth_callback`),n.searchParams.delete(`code`),n.searchParams.delete(`state`),window.history.replaceState({},``,n.toString()),t)try{await tT(t)}catch(e){console.error(`OAuth callback failed:`,e),bi.getState().setStatus(`error`),bi.getState().setError(e instanceof Error?e.message:`OAuth callback failed`)}else bi.getState().setStatus(`error`),bi.getState().setError(`OAuth callback missing authorization code`)}else eT().catch(e=>{console.error(`Connection failed:`,e)})}use(),(0,x.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(b.StrictMode,{children:(0,G.jsx)(lse,{})}));
|
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Skybridge MCP devtools</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DMcBS4Ng.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-9JaNXWM9.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skybridge/devtools",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.d695687",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@base-ui/react": "^1.3.0",
|
|
24
24
|
"@fontsource-variable/jetbrains-mono": "^5.2.8",
|
|
25
|
-
"@microlink/react-json-view": "^1.31.
|
|
25
|
+
"@microlink/react-json-view": "^1.31.15",
|
|
26
26
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
27
27
|
"@rjsf/core": "^6.4.2",
|
|
28
28
|
"@rjsf/shadcn": "^6.4.2",
|
|
29
29
|
"@rjsf/utils": "^6.4.2",
|
|
30
30
|
"@rjsf/validator-ajv8": "^6.4.2",
|
|
31
31
|
"@tailwindcss/vite": "^4.2.2",
|
|
32
|
-
"@tanstack/react-query": "^5.
|
|
32
|
+
"@tanstack/react-query": "^5.95.2",
|
|
33
33
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
34
34
|
"@types/cors": "^2.8.19",
|
|
35
35
|
"@types/express": "^5.0.6",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"lucide-react": "^1.7.0",
|
|
48
48
|
"motion": "^12.38.0",
|
|
49
49
|
"nuqs": "^2.8.9",
|
|
50
|
-
"postcss": "^8.5.
|
|
50
|
+
"postcss": "^8.5.8",
|
|
51
51
|
"react": "^19.2.4",
|
|
52
52
|
"react-dom": "^19.2.4",
|
|
53
|
-
"react-resizable-panels": "^4.
|
|
54
|
-
"shadcn": "^4.
|
|
53
|
+
"react-resizable-panels": "^4.8.0",
|
|
54
|
+
"shadcn": "^4.1.1",
|
|
55
55
|
"shiki": "^4.0.2",
|
|
56
56
|
"tailwind-merge": "^3.5.0",
|
|
57
57
|
"tailwindcss": "^4.2.2",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"typescript": "~6.0.2",
|
|
61
61
|
"vite": "^8.0.3",
|
|
62
62
|
"zustand": "^5.0.12",
|
|
63
|
-
"skybridge": "0.0.0-dev.
|
|
63
|
+
"skybridge": "0.0.0-dev.d695687"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"dev": "vite",
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"build:server": "tsc -p tsconfig.server.json",
|
|
69
69
|
"test": "pnpm run test:type && pnpm run test:format",
|
|
70
70
|
"test:type": "tsc --noEmit",
|
|
71
|
+
"format": "biome check --write --error-on-warnings",
|
|
71
72
|
"test:format": "biome ci",
|
|
72
73
|
"preview": "vite preview"
|
|
73
74
|
}
|