@snagset/server 0.1.64 → 0.1.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/package.json +1 -1
  2. package/static/dashboard/assets/{CompositeItem-CNlNRLwm.js → CompositeItem-DUU2dBBI.js} +1 -1
  3. package/static/dashboard/assets/{CompositeList-CDfO6SCy.js → CompositeList-nzDbuttJ.js} +1 -1
  4. package/static/dashboard/assets/{ConfirmDialog-B5-FUf01.js → ConfirmDialog-CHFBH7e-.js} +1 -1
  5. package/static/dashboard/assets/{CopyButton-CDVY09FZ.js → CopyButton-U3SFd-HD.js} +1 -1
  6. package/static/dashboard/assets/{FieldItemContext-D_hbvXzX.js → FieldItemContext-Ctu8Sx36.js} +1 -1
  7. package/static/dashboard/assets/{InstallTag-DutQruP1.js → InstallTag-Dv3gaL4O.js} +1 -1
  8. package/static/dashboard/assets/{InstanceRows-BrXrOXxa.js → InstanceRows-DPIpELtc.js} +1 -1
  9. package/static/dashboard/assets/{McpTokens-BnhNB_C0.js → McpTokens-yimU884S.js} +1 -1
  10. package/static/dashboard/assets/{Picker-BvdKGeU8.js → Picker-CCAp0603.js} +1 -1
  11. package/static/dashboard/assets/{SaveState-DrWU77oO.js → SaveState-zj94ZTUn.js} +1 -1
  12. package/static/dashboard/assets/_-C2HgkYw_.js +1 -0
  13. package/static/dashboard/assets/{_app-MqqZ5rHF.js → _app-Boi8G11t.js} +1 -1
  14. package/static/dashboard/assets/{_app-DalVfhNg.js → _app-CPD7sbIv.js} +1 -1
  15. package/static/dashboard/assets/_app-Cy8QntP-.js +1 -0
  16. package/static/dashboard/assets/{activity-B1fOkSrs.js → activity-BXgHGBG-.js} +1 -1
  17. package/static/dashboard/assets/{arrow-left-B4-bJVcO.js → arrow-left-BWxLUUtR.js} +1 -1
  18. package/static/dashboard/assets/{avatar-B-4Lv0hf.js → avatar-C272UWe3.js} +1 -1
  19. package/static/dashboard/assets/{badge-Cwf-GPv8.js → badge-CYPTl0cy.js} +1 -1
  20. package/static/dashboard/assets/{check-26YOtWVN.js → check-2F6z9BBy.js} +1 -1
  21. package/static/dashboard/assets/{chevron-down-OinKSKsq.js → chevron-down-Co3oKci1.js} +1 -1
  22. package/static/dashboard/assets/{chevron-right-Dh7TD2kW.js → chevron-right-DMXTfy_h.js} +1 -1
  23. package/static/dashboard/assets/{copy-DqhiNOHN.js → copy-B-mCACcx.js} +1 -1
  24. package/static/dashboard/assets/{createBaseUIEventDetails-BlUeVOHL.js → createBaseUIEventDetails-67bayC1B.js} +1 -1
  25. package/static/dashboard/assets/{dialog-CjX41K4h.js → dialog-l22OkYXh.js} +1 -1
  26. package/static/dashboard/assets/{dropdown-menu-BejmUTVa.js → dropdown-menu-CIJhCtDQ.js} +1 -1
  27. package/static/dashboard/assets/{forgot-Cv_EPbZy.js → forgot-ykPZ1Kdg.js} +1 -1
  28. package/static/dashboard/assets/{getPseudoElementBounds-087ogDm1.js → getPseudoElementBounds-D9YqITSR.js} +1 -1
  29. package/static/dashboard/assets/{image-off-BsOmKpjU.js → image-off-BkVnePLU.js} +1 -1
  30. package/static/dashboard/assets/{index-CUBD0DcL.js → index-BC1mWQy8.js} +12 -12
  31. package/static/dashboard/assets/{inertValue-BxLh7N1J.js → inertValue-Dy4HJtbg.js} +1 -1
  32. package/static/dashboard/assets/{invite-DrxWT0UW.js → invite-DDvCZ3v_.js} +1 -1
  33. package/static/dashboard/assets/{label-BoGrNcZ0.js → label-Des6lF0o.js} +1 -1
  34. package/static/dashboard/assets/{layout-grid-D1FcD4G3.js → layout-grid-ojTM11RH.js} +1 -1
  35. package/static/dashboard/assets/me-DWKKjc2l.js +1 -0
  36. package/static/dashboard/assets/{plus-ChodljzA.js → plus-CqHIH0K8.js} +1 -1
  37. package/static/dashboard/assets/{reset-DoB5fAkF.js → reset-GkTsanrN.js} +1 -1
  38. package/static/dashboard/assets/{s._site-Xu1MbYF_.js → s._site-DuFqROtI.js} +1 -1
  39. package/static/dashboard/assets/{s._site.comments-63OF736E.js → s._site.comments-DwPDdi_u.js} +1 -1
  40. package/static/dashboard/assets/{s._site.reviewers-BZ6tbe9V.js → s._site.reviewers-BdujL59q.js} +1 -1
  41. package/static/dashboard/assets/{s._site.settings-Bx21kvsO.js → s._site.settings-0uXBXAn-.js} +1 -1
  42. package/static/dashboard/assets/{setup-AHjI1DnF.js → setup-CGKTYRhS.js} +1 -1
  43. package/static/dashboard/assets/{sign-in-D-Y_lran.js → sign-in-BFx4q3Vl.js} +1 -1
  44. package/static/dashboard/assets/{sign-up-B8RiXKrs.js → sign-up-BeS3OqBr.js} +1 -1
  45. package/static/dashboard/assets/{sites-BcEIT4Tw.js → sites-DWQtdLHK.js} +1 -1
  46. package/static/dashboard/assets/{studio-Dg6dFTZ5.js → studio-DxClsYRz.js} +1 -1
  47. package/static/dashboard/assets/studio-gXJp7MI3.js +1 -0
  48. package/static/dashboard/assets/{studio.index-N5sIdor3.js → studio.index-BKeRxtvS.js} +1 -1
  49. package/static/dashboard/assets/{studio.integrations-ZAlVFGVw.js → studio.integrations-BDKRHU8R.js} +1 -1
  50. package/static/dashboard/assets/{studio.members-r1I_P9vv.js → studio.members-Dnw8MvSM.js} +1 -1
  51. package/static/dashboard/assets/{studio.plan-B5CWlvB1.js → studio.plan-CV9lR0OF.js} +1 -1
  52. package/static/dashboard/assets/{sun-B2KoVsUv.js → sun-BDbnQON-.js} +1 -1
  53. package/static/dashboard/assets/{switch-DmO3bJxP.js → switch-BQZZEckg.js} +1 -1
  54. package/static/dashboard/assets/{table-D3lWzaas.js → table-B41i9RfM.js} +1 -1
  55. package/static/dashboard/assets/{useAriaLabelledBy-BVVmb5Zj.js → useAriaLabelledBy-hDZ_Qzgg.js} +1 -1
  56. package/static/dashboard/assets/{useBaseQuery-BBU42uTr.js → useBaseQuery-Di_lHTAg.js} +1 -1
  57. package/static/dashboard/assets/{useCompositeItem-BZX9S0sx.js → useCompositeItem-R43gS2Zb.js} +1 -1
  58. package/static/dashboard/assets/useQuery-B1QbR4lk.js +1 -0
  59. package/static/dashboard/assets/useRender-bF5mRtl9.js +1 -0
  60. package/static/dashboard/assets/{useScrollLock-DV4rQnvf.js → useScrollLock-DV1FkBvY.js} +1 -1
  61. package/static/dashboard/assets/{useValueChanged-BcwdNwDJ.js → useValueChanged-CxAXjLUw.js} +1 -1
  62. package/static/dashboard/assets/{users-BxyUqa0S.js → users-jxEArjZq.js} +1 -1
  63. package/static/dashboard/assets/{welcome-9qfwvdaq.js → welcome-D7cMtm0u.js} +1 -1
  64. package/static/dashboard/assets/{widget-signin-x6glMrne.js → widget-signin-BtBII7zp.js} +1 -1
  65. package/static/dashboard/assets/{you-C3HTpoDt.js → you-DcgRgPxz.js} +1 -1
  66. package/static/dashboard/assets/{zod-qyf6R6J-.js → zod-DxcG0x06.js} +1 -1
  67. package/static/dashboard/index.html +1 -1
  68. package/static/widget/build.json +2 -2
  69. package/static/widget/snag.js +1 -1
  70. package/static/widget/snag.runtime.js +1 -1
  71. package/static/dashboard/assets/_-DwwKoA7B.js +0 -1
  72. package/static/dashboard/assets/_app-CYfFCBBL.js +0 -1
  73. package/static/dashboard/assets/me-DeblO6Os.js +0 -1
  74. package/static/dashboard/assets/studio-BxUhJp0u.js +0 -1
  75. package/static/dashboard/assets/useQuery-CGx36E5q.js +0 -1
  76. package/static/dashboard/assets/useRender-CNreHlDo.js +0 -1
@@ -1 +1 @@
1
- import{r as i,i as ae,ay as re,e as se,aw as ie,E as ne,k as j,j as f,az as oe,h as de}from"./index-CUBD0DcL.js";import{f as ce,e as le,h as ue,j as fe,u as pe,A as he,k as be,l as ge,c as me,n as ve}from"./createBaseUIEventDetails-BlUeVOHL.js";import{v as ke,r as xe}from"./useScrollLock-DV4rQnvf.js";import{u as we}from"./useAriaLabelledBy-BVVmb5Zj.js";import{u as ye}from"./useValueChanged-BcwdNwDJ.js";const M=i.createContext(void 0);function Ce(){const r=i.useContext(M);if(r===void 0)throw new Error(ae(63));return r}const D={...ce,checked(r){return r?{"data-checked":""}:{"data-unchecked":""}}},Re=i.forwardRef(function(s,o){const{checked:k,className:F,defaultChecked:x,"aria-labelledby":m,form:p,id:L,inputRef:T,name:w,nativeButton:h=!1,onCheckedChange:V,readOnly:d=!1,required:b=!1,disabled:N=!1,render:Pe,uncheckedValue:y,value:C,style:Ee,...A}=s,{clearErrors:H}=le(),{state:R,setTouched:q,setDirty:O,validityData:W,setFilled:v,setFocused:z,validationMode:J,disabled:U,name:Y,validation:c}=ue(),{labelId:_}=fe(),t=U||N,l=Y??w,n=i.useRef(null),G=re(n,T,c.inputRef),g=i.useRef(null),P=pe(),E=he({id:L,implicit:!1,controlRef:g}),B=h?void 0:E,[a,K]=be({controlled:k,default:!!x,name:"Switch",state:"checked"});ge(g,P,a,void 0,!t,w),se(()=>{n.current&&v(n.current.checked)},[v]),ye(a,()=>{H(l),O(a!==W.initialValue),v(a),c.change(a)});const{getButtonProps:Q,buttonRef:X}=ie({disabled:t,native:h}),Z=we(m,_,n,!h,B),$={id:h?E:P,role:"switch","aria-checked":a,"aria-readonly":d||void 0,"aria-required":b||void 0,"aria-labelledby":Z,onFocus(){t||z(!0)},onBlur(){const e=n.current;!e||t||(q(!0),z(!1),J==="onBlur"&&c.commit(e.checked))},onClick(e){if(d||t)return;e.preventDefault();const u=n.current;u&&oe(u,e)}},ee={...c.getValidationProps(t),checked:a,disabled:t,form:p,id:B,name:l,required:b,style:l?ke:xe,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:G,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(d){e.preventDefault();return}const u=e.currentTarget.checked,S=me(ve,e.nativeEvent);V?.(u,S),!S.isCanceled&&K(u)},onClick(e){e.stopPropagation()},onFocus(){g.current?.focus()},...C!==void 0?{value:C}:ne},I=i.useMemo(()=>({...R,checked:a,disabled:t,readOnly:d,required:b}),[R,a,t,d,b]),te=j("span",s,{state:I,ref:[o,g,X],props:[$,A,Q,e=>c.getValidationProps(t,e)],stateAttributesMapping:D});return f.jsxs(M.Provider,{value:I,children:[te,!a&&l&&y!==void 0&&f.jsx("input",{type:"hidden",form:p,name:l,value:y,disabled:t}),f.jsx("input",{...ee,suppressHydrationWarning:!0})]})}),ze=i.forwardRef(function(s,o){const{render:k,className:F,style:x,...m}=s,p=Ce();return j("span",s,{state:p,ref:o,stateAttributesMapping:D,props:m})});function De({className:r,size:s="default",...o}){return f.jsx(Re,{"data-slot":"switch","data-size":s,className:de("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",r),...o,children:f.jsx(ze,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform 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)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}export{De as S};
1
+ import{r as i,i as ae,ay as re,e as se,aw as ie,E as ne,k as j,j as f,az as oe,h as de}from"./index-BC1mWQy8.js";import{f as ce,e as le,h as ue,j as fe,u as pe,A as he,k as be,l as ge,c as me,n as ve}from"./createBaseUIEventDetails-67bayC1B.js";import{v as ke,r as xe}from"./useScrollLock-DV1FkBvY.js";import{u as we}from"./useAriaLabelledBy-hDZ_Qzgg.js";import{u as ye}from"./useValueChanged-CxAXjLUw.js";const M=i.createContext(void 0);function Ce(){const r=i.useContext(M);if(r===void 0)throw new Error(ae(63));return r}const D={...ce,checked(r){return r?{"data-checked":""}:{"data-unchecked":""}}},Re=i.forwardRef(function(s,o){const{checked:k,className:F,defaultChecked:x,"aria-labelledby":m,form:p,id:L,inputRef:T,name:w,nativeButton:h=!1,onCheckedChange:V,readOnly:d=!1,required:b=!1,disabled:N=!1,render:Pe,uncheckedValue:y,value:C,style:Ee,...A}=s,{clearErrors:H}=le(),{state:R,setTouched:q,setDirty:O,validityData:W,setFilled:v,setFocused:z,validationMode:J,disabled:U,name:Y,validation:c}=ue(),{labelId:_}=fe(),t=U||N,l=Y??w,n=i.useRef(null),G=re(n,T,c.inputRef),g=i.useRef(null),P=pe(),E=he({id:L,implicit:!1,controlRef:g}),B=h?void 0:E,[a,K]=be({controlled:k,default:!!x,name:"Switch",state:"checked"});ge(g,P,a,void 0,!t,w),se(()=>{n.current&&v(n.current.checked)},[v]),ye(a,()=>{H(l),O(a!==W.initialValue),v(a),c.change(a)});const{getButtonProps:Q,buttonRef:X}=ie({disabled:t,native:h}),Z=we(m,_,n,!h,B),$={id:h?E:P,role:"switch","aria-checked":a,"aria-readonly":d||void 0,"aria-required":b||void 0,"aria-labelledby":Z,onFocus(){t||z(!0)},onBlur(){const e=n.current;!e||t||(q(!0),z(!1),J==="onBlur"&&c.commit(e.checked))},onClick(e){if(d||t)return;e.preventDefault();const u=n.current;u&&oe(u,e)}},ee={...c.getValidationProps(t),checked:a,disabled:t,form:p,id:B,name:l,required:b,style:l?ke:xe,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:G,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(d){e.preventDefault();return}const u=e.currentTarget.checked,S=me(ve,e.nativeEvent);V?.(u,S),!S.isCanceled&&K(u)},onClick(e){e.stopPropagation()},onFocus(){g.current?.focus()},...C!==void 0?{value:C}:ne},I=i.useMemo(()=>({...R,checked:a,disabled:t,readOnly:d,required:b}),[R,a,t,d,b]),te=j("span",s,{state:I,ref:[o,g,X],props:[$,A,Q,e=>c.getValidationProps(t,e)],stateAttributesMapping:D});return f.jsxs(M.Provider,{value:I,children:[te,!a&&l&&y!==void 0&&f.jsx("input",{type:"hidden",form:p,name:l,value:y,disabled:t}),f.jsx("input",{...ee,suppressHydrationWarning:!0})]})}),ze=i.forwardRef(function(s,o){const{render:k,className:F,style:x,...m}=s,p=Ce();return j("span",s,{state:p,ref:o,stateAttributesMapping:D,props:m})});function De({className:r,size:s="default",...o}){return f.jsx(Re,{"data-slot":"switch","data-size":s,className:de("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",r),...o,children:f.jsx(ze,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform 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)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}export{De as S};
@@ -1 +1 @@
1
- import{j as t,h as l}from"./index-CUBD0DcL.js";function o({className:a,...e}){return t.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",a),...e})})}function r({className:a,...e}){return t.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",a),...e})}function d({className:a,...e}){return t.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",a),...e})}function n({className:a,...e}){return t.jsx("tr",{"data-slot":"table-row",className:l("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",a),...e})}function b({className:a,...e}){return t.jsx("th",{"data-slot":"table-head",className:l("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",a),...e})}function c({className:a,...e}){return t.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",a),...e})}export{o as T,r as a,n as b,b as c,d,c as e};
1
+ import{j as t,h as l}from"./index-BC1mWQy8.js";function o({className:a,...e}){return t.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",a),...e})})}function r({className:a,...e}){return t.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",a),...e})}function d({className:a,...e}){return t.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",a),...e})}function n({className:a,...e}){return t.jsx("tr",{"data-slot":"table-row",className:l("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",a),...e})}function b({className:a,...e}){return t.jsx("th",{"data-slot":"table-head",className:l("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",a),...e})}function c({className:a,...e}){return t.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",a),...e})}export{o as T,r as a,n as b,b as c,d,c as e};
@@ -1 +1 @@
1
- import{r as u,e as l}from"./index-CUBD0DcL.js";import{u as c}from"./createBaseUIEventDetails-BlUeVOHL.js";function y(e,n,t,r=!0,i){const[a,d]=u.useState(),f=c(i?`${i}-label`:void 0),o=e??n??a;return l(()=>{const s=e||n||!r?void 0:L(t.current,f);a!==s&&d(s)}),o}function L(e,n){const t=b(e);if(t)return!t.id&&n&&(t.id=n),t.id||void 0}function b(e){if(!e)return;const n=e.parentElement;if(n&&n.tagName==="LABEL")return n;const t=e.id;if(t){const i=e.nextElementSibling;if(i&&i.htmlFor===t)return i}const r=e.labels;return r&&r[0]}export{y as u};
1
+ import{r as u,e as l}from"./index-BC1mWQy8.js";import{u as c}from"./createBaseUIEventDetails-67bayC1B.js";function y(e,n,t,r=!0,i){const[a,d]=u.useState(),f=c(i?`${i}-label`:void 0),o=e??n??a;return l(()=>{const s=e||n||!r?void 0:L(t.current,f);a!==s&&d(s)}),o}function L(e,n){const t=b(e);if(t)return!t.id&&n&&(t.id=n),t.id||void 0}function b(e){if(!e)return;const n=e.parentElement;if(n&&n.tagName==="LABEL")return n;const t=e.id;if(t){const i=e.nextElementSibling;if(i&&i.htmlFor===t)return i}const r=e.labels;return r&&r[0]}export{y as u};
@@ -1 +1 @@
1
- import{bp as N,bq as h,br as O,bs as U,bt as k,bu as B,bv as A,bw as y,bx as H,by as V,bz as M,bA as x,r as p,bB as F,d as z}from"./index-CUBD0DcL.js";var st=class extends N{#e;#t=void 0;#f=void 0;#s=void 0;#n;#c;#i;#p;#u;#l;#a;#o;#r;#d=new Set;constructor(t,e){super(),this.options=e,this.#e=t,this.#i=null,this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Q(this.#t,this.options)?this.#h():this.updateResult(),this.#S())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return E(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return E(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#m(),this.#g(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof h(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#O(),this.#t.setOptions(this.options),e._defaulted&&!O(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&P(this.#t,s,this.options,e)&&this.#h(),this.updateResult(),i&&(this.#t!==s||h(this.options.enabled,this.#t)!==h(e.enabled,this.#t)||h(this.options.staleTime,this.#t)!==h(e.staleTime,this.#t))&&this.#R();const r=this.#v();i&&(this.#t!==s||h(this.options.enabled,this.#t)!==h(e.enabled,this.#t)||r!==this.#r)&&this.#y(r)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),s=this.createResult(e,t);return O(this.getCurrentResult(),s)||(this.#s=s,this.#c=this.options,this.#n=this.#t.state),s}getCurrentResult(){return this.#s}trackResult(t,e){return new Proxy(t,{get:(s,i)=>(this.trackProp(i),e?.(i),Reflect.get(s,i))})}trackProp(t){this.#d.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),s=this.#e.getQueryCache().build(this.#e,e);let i=()=>{},r;const c=new Promise(a=>{r=a,i=this.#e.getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===s.queryHash&&s.state.data!==void 0&&(i(),a(this.createResult(s,e)))})});return Promise.race([s.fetch().then(()=>{const a=this.createResult(s,e);return r?.(a),a}).finally(()=>{i()}),c])}fetch(t){return this.#h({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#h(t){this.#O();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(U)),e}#b(t){return!k()&&h(this.options.enabled,this.#t)!==!1&&B(t)}#R(){this.#m();const t=h(this.options.staleTime,this.#t);if(this.#s.isStale||!this.#b(t))return;const e=A(this.#s.dataUpdatedAt,t)+1;this.#a=y.setTimeout(()=>{this.#s.isStale||this.updateResult()},e)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(t){this.#g(),this.#r=t,!(this.#r===0||!this.#b(this.#r))&&(this.#o=y.setInterval(()=>{(this.options.refetchIntervalInBackground||H.isFocused())&&this.#h()},this.#r))}#S(){this.#R(),this.#y(this.#v())}#m(){this.#a!==void 0&&(y.clearTimeout(this.#a),this.#a=void 0)}#g(){this.#o!==void 0&&(y.clearInterval(this.#o),this.#o=void 0)}createResult(t,e){const s=this.#t,i=this.options,r=this.#s,c=this.#n,a=this.#c,u=t!==s?t.state:this.#f,{state:l}=t;let n={...l},d=!1,o;if(e._optimisticResults){const f=this.hasListeners(),D=!f&&Q(t,e),L=f&&P(t,s,e,i);(D||L)&&(n={...n,...V(l.data,t.options)}),e._optimisticResults==="isRestoring"&&(n.fetchStatus="idle")}let{error:R,errorUpdatedAt:v,status:b}=n;o=n.data;let I=!1;if(e.placeholderData!==void 0&&o===void 0&&b==="pending"){let f;r?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(f=r.data,I=!0):f=typeof e.placeholderData=="function"?e.placeholderData(this.#l?.state.data,this.#l):e.placeholderData,f!==void 0&&(b="success",o=M(r?.data,f,e),d=!0)}if(e.select&&o!==void 0&&!I)if(r&&o===c?.data&&e.select===this.#p)o=this.#u;else try{this.#p=e.select,o=e.select(o),o=M(r?.data,o,e),this.#u=o,this.#i=null}catch(f){this.#i=f}else o===void 0&&(this.#i=null);this.#i&&(R=this.#i,o=this.#u,v=Date.now(),b="error",d=!1);const S=n.fetchStatus==="fetching",m=b==="pending",g=b==="error",T=m&&S,w=o!==void 0;return{status:b,fetchStatus:n.fetchStatus,isPending:m,isSuccess:b==="success",isError:g,isInitialLoading:T,isLoading:T,data:o,dataUpdatedAt:n.dataUpdatedAt,error:R,errorUpdatedAt:v,failureCount:n.fetchFailureCount,failureReason:n.fetchFailureReason,errorUpdateCount:n.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:n.dataUpdateCount>u.dataUpdateCount||n.errorUpdateCount>u.errorUpdateCount,isFetching:S,isRefetching:S&&!m,isLoadingError:g&&!w,isPaused:n.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:g&&w,isStale:C(t,e),refetch:this.refetch,isEnabled:h(e.enabled,t)!==!1}}updateResult(){const t=this.#s,e=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#c=this.options,this.#n.data!==void 0&&(this.#l=this.#t),O(e,t))return;this.#s=e;const i=(()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,c=typeof r=="function"?r():r;if(c==="all"||!c&&!this.#d.size)return!0;const a=new Set(c??this.#d);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(u=>{const l=u;return this.#s[l]!==t[l]&&a.has(l)})})();x.batch(()=>{i&&this.listeners.forEach(r=>{r(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#O(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#f=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#S()}};function W(t,e){return h(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&h(e.retryOnMount,t)===!1)}function Q(t,e){return W(t,e)||t.state.data!==void 0&&E(t,e,e.refetchOnMount)}function E(t,e,s){if(h(e.enabled,t)!==!1&&h(e.staleTime,t)!=="static"){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&C(t,e)}return!1}function P(t,e,s,i){return(t!==e||h(i.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&C(t,s)}function C(t,e){return h(e.enabled,t)!==!1&&t.isStaleByTime(h(e.staleTime,t))}const _=p.createContext(!1),j=()=>p.useContext(_);_.Provider;function K(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const G=p.createContext(K()),J=()=>p.useContext(G),X=(t,e,s)=>{const i=s?.state.error&&typeof t.throwOnError=="function"?F(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||i)&&(e.isReset()||(t.retryOnMount=!1))},Y=t=>{p.useEffect(()=>{t.clearReset()},[t])},Z=({result:t,errorResetBoundary:e,throwOnError:s,query:i,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(r&&t.data===void 0||F(s,[t.error,i])),it=(t,e)=>e.state.data===void 0,$=t=>{if(t.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),i=t.staleTime;t.staleTime=typeof i=="function"?(...r)=>s(i(...r)):s(i),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},q=(t,e)=>t?.suspense&&e.isPending,tt=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function rt(t,e,s){const i=j(),r=J(),c=z(),a=c.defaultQueryOptions(t),u=c.getQueryCache().get(a.queryHash),l=t.subscribed!==!1;a._optimisticResults=i?"isRestoring":l?"optimistic":void 0,$(a),X(a,r,u),Y(r);const[n]=p.useState(()=>new e(c,a)),d=n.getOptimisticResult(a),o=!i&&l;if(p.useSyncExternalStore(p.useCallback(R=>{const v=o?n.subscribe(x.batchCalls(R)):U;return n.updateResult(),v},[n,o]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),p.useEffect(()=>{n.setOptions(a)},[a,n]),q(a,d))throw tt(a,n,r);if(Z({result:d,errorResetBoundary:r,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw d.error;return a.notifyOnChangeProps?d:n.trackResult(d)}export{st as Q,it as d,rt as u};
1
+ import{bp as N,bq as h,br as O,bs as U,bt as k,bu as B,bv as A,bw as y,bx as H,by as V,bz as M,bA as x,r as p,bB as F,d as z}from"./index-BC1mWQy8.js";var st=class extends N{#e;#t=void 0;#f=void 0;#s=void 0;#n;#c;#i;#p;#u;#l;#a;#o;#r;#d=new Set;constructor(t,e){super(),this.options=e,this.#e=t,this.#i=null,this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Q(this.#t,this.options)?this.#h():this.updateResult(),this.#S())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return E(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return E(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#m(),this.#g(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof h(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#O(),this.#t.setOptions(this.options),e._defaulted&&!O(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&P(this.#t,s,this.options,e)&&this.#h(),this.updateResult(),i&&(this.#t!==s||h(this.options.enabled,this.#t)!==h(e.enabled,this.#t)||h(this.options.staleTime,this.#t)!==h(e.staleTime,this.#t))&&this.#R();const r=this.#v();i&&(this.#t!==s||h(this.options.enabled,this.#t)!==h(e.enabled,this.#t)||r!==this.#r)&&this.#y(r)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),s=this.createResult(e,t);return O(this.getCurrentResult(),s)||(this.#s=s,this.#c=this.options,this.#n=this.#t.state),s}getCurrentResult(){return this.#s}trackResult(t,e){return new Proxy(t,{get:(s,i)=>(this.trackProp(i),e?.(i),Reflect.get(s,i))})}trackProp(t){this.#d.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),s=this.#e.getQueryCache().build(this.#e,e);let i=()=>{},r;const c=new Promise(a=>{r=a,i=this.#e.getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===s.queryHash&&s.state.data!==void 0&&(i(),a(this.createResult(s,e)))})});return Promise.race([s.fetch().then(()=>{const a=this.createResult(s,e);return r?.(a),a}).finally(()=>{i()}),c])}fetch(t){return this.#h({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#h(t){this.#O();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(U)),e}#b(t){return!k()&&h(this.options.enabled,this.#t)!==!1&&B(t)}#R(){this.#m();const t=h(this.options.staleTime,this.#t);if(this.#s.isStale||!this.#b(t))return;const e=A(this.#s.dataUpdatedAt,t)+1;this.#a=y.setTimeout(()=>{this.#s.isStale||this.updateResult()},e)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(t){this.#g(),this.#r=t,!(this.#r===0||!this.#b(this.#r))&&(this.#o=y.setInterval(()=>{(this.options.refetchIntervalInBackground||H.isFocused())&&this.#h()},this.#r))}#S(){this.#R(),this.#y(this.#v())}#m(){this.#a!==void 0&&(y.clearTimeout(this.#a),this.#a=void 0)}#g(){this.#o!==void 0&&(y.clearInterval(this.#o),this.#o=void 0)}createResult(t,e){const s=this.#t,i=this.options,r=this.#s,c=this.#n,a=this.#c,u=t!==s?t.state:this.#f,{state:l}=t;let n={...l},d=!1,o;if(e._optimisticResults){const f=this.hasListeners(),D=!f&&Q(t,e),L=f&&P(t,s,e,i);(D||L)&&(n={...n,...V(l.data,t.options)}),e._optimisticResults==="isRestoring"&&(n.fetchStatus="idle")}let{error:R,errorUpdatedAt:v,status:b}=n;o=n.data;let I=!1;if(e.placeholderData!==void 0&&o===void 0&&b==="pending"){let f;r?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(f=r.data,I=!0):f=typeof e.placeholderData=="function"?e.placeholderData(this.#l?.state.data,this.#l):e.placeholderData,f!==void 0&&(b="success",o=M(r?.data,f,e),d=!0)}if(e.select&&o!==void 0&&!I)if(r&&o===c?.data&&e.select===this.#p)o=this.#u;else try{this.#p=e.select,o=e.select(o),o=M(r?.data,o,e),this.#u=o,this.#i=null}catch(f){this.#i=f}else o===void 0&&(this.#i=null);this.#i&&(R=this.#i,o=this.#u,v=Date.now(),b="error",d=!1);const S=n.fetchStatus==="fetching",m=b==="pending",g=b==="error",T=m&&S,w=o!==void 0;return{status:b,fetchStatus:n.fetchStatus,isPending:m,isSuccess:b==="success",isError:g,isInitialLoading:T,isLoading:T,data:o,dataUpdatedAt:n.dataUpdatedAt,error:R,errorUpdatedAt:v,failureCount:n.fetchFailureCount,failureReason:n.fetchFailureReason,errorUpdateCount:n.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:n.dataUpdateCount>u.dataUpdateCount||n.errorUpdateCount>u.errorUpdateCount,isFetching:S,isRefetching:S&&!m,isLoadingError:g&&!w,isPaused:n.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:g&&w,isStale:C(t,e),refetch:this.refetch,isEnabled:h(e.enabled,t)!==!1}}updateResult(){const t=this.#s,e=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#c=this.options,this.#n.data!==void 0&&(this.#l=this.#t),O(e,t))return;this.#s=e;const i=(()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,c=typeof r=="function"?r():r;if(c==="all"||!c&&!this.#d.size)return!0;const a=new Set(c??this.#d);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(u=>{const l=u;return this.#s[l]!==t[l]&&a.has(l)})})();x.batch(()=>{i&&this.listeners.forEach(r=>{r(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#O(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#f=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#S()}};function W(t,e){return h(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&h(e.retryOnMount,t)===!1)}function Q(t,e){return W(t,e)||t.state.data!==void 0&&E(t,e,e.refetchOnMount)}function E(t,e,s){if(h(e.enabled,t)!==!1&&h(e.staleTime,t)!=="static"){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&C(t,e)}return!1}function P(t,e,s,i){return(t!==e||h(i.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&C(t,s)}function C(t,e){return h(e.enabled,t)!==!1&&t.isStaleByTime(h(e.staleTime,t))}const _=p.createContext(!1),j=()=>p.useContext(_);_.Provider;function K(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const G=p.createContext(K()),J=()=>p.useContext(G),X=(t,e,s)=>{const i=s?.state.error&&typeof t.throwOnError=="function"?F(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||i)&&(e.isReset()||(t.retryOnMount=!1))},Y=t=>{p.useEffect(()=>{t.clearReset()},[t])},Z=({result:t,errorResetBoundary:e,throwOnError:s,query:i,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(r&&t.data===void 0||F(s,[t.error,i])),it=(t,e)=>e.state.data===void 0,$=t=>{if(t.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),i=t.staleTime;t.staleTime=typeof i=="function"?(...r)=>s(i(...r)):s(i),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},q=(t,e)=>t?.suspense&&e.isPending,tt=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function rt(t,e,s){const i=j(),r=J(),c=z(),a=c.defaultQueryOptions(t),u=c.getQueryCache().get(a.queryHash),l=t.subscribed!==!1;a._optimisticResults=i?"isRestoring":l?"optimistic":void 0,$(a),X(a,r,u),Y(r);const[n]=p.useState(()=>new e(c,a)),d=n.getOptimisticResult(a),o=!i&&l;if(p.useSyncExternalStore(p.useCallback(R=>{const v=o?n.subscribe(x.batchCalls(R)):U;return n.updateResult(),v},[n,o]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),p.useEffect(()=>{n.setOptions(a)},[a,n]),q(a,d))throw tt(a,n,r);if(Z({result:d,errorResetBoundary:r,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw d.error;return a.notifyOnChangeProps?d:n.trackResult(d)}export{st as Q,it as d,rt as u};
@@ -1 +1 @@
1
- import{aW as d,r as f,ay as h}from"./index-CUBD0DcL.js";import{u as p}from"./CompositeList-CDfO6SCy.js";function I(i={}){const{highlightItemOnHover:n,highlightedIndex:r,onHighlightedIndexChange:u}=d(),{ref:a,index:t}=p(i),o=r===t,s=f.useRef(null),c=h(a,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){u(t)},onMouseMove(){const e=s.current;if(!n||!e)return;const m=e.hasAttribute("disabled")||e.ariaDisabled==="true";!o&&!m&&e.focus()}},compositeRef:c,index:t}}export{I as u};
1
+ import{aW as d,r as f,ay as h}from"./index-BC1mWQy8.js";import{u as p}from"./CompositeList-nzDbuttJ.js";function I(i={}){const{highlightItemOnHover:n,highlightedIndex:r,onHighlightedIndexChange:u}=d(),{ref:a,index:t}=p(i),o=r===t,s=f.useRef(null),c=h(a,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){u(t)},onMouseMove(){const e=s.current;if(!n||!e)return;const m=e.hasAttribute("disabled")||e.ariaDisabled==="true";!o&&!m&&e.focus()}},compositeRef:c,index:t}}export{I as u};
@@ -0,0 +1 @@
1
+ import{u as r,Q as u}from"./useBaseQuery-Di_lHTAg.js";function a(e,s){return r(e,u)}export{a as u};
@@ -0,0 +1 @@
1
+ import{k as n}from"./index-BC1mWQy8.js";function u(e){return n(e.defaultTagName??"div",e,e)}export{u};
@@ -1 +1 @@
1
- import{j as Dt,b as Tn,T as bt,t as Rn,d as vn,r as he,a as xn,u as Cn,p as In}from"./inertValue-BxLh7N1J.js";import{aS as te,l as ve,b5 as se,bj as ct,b0 as Ht,av as De,e as D,r as a,j as ne,ax as Vt,n as ut,E as Be,f as U,bk as On,k as wn,ay as mt,g as Ue,aU as qe,aV as Pn,bl as kn,bm as Fn,bn as An,b6 as Mn}from"./index-CUBD0DcL.js";import{a as w,o as W,m as pe,c as xe,x as Wt,w as at,b as _t,s as Bt,g as Se,t as jt,q as Yt,n as Nn,p as Ln}from"./createBaseUIEventDetails-BlUeVOHL.js";function Dn(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Hn,platform:Vn,maxTouchPoints:Wn}=Dn(),Xe=Hn.toLowerCase(),Ne=Vn.toLowerCase(),lt=/^i(os$|p)/.test(Ne)||Ne==="macintel"&&Wn>1,yt="android",tt=Ne===yt||Xe.includes(yt),_n=!lt&&Ne.startsWith("mac");Ne.startsWith("win");const Bn=_n||lt,Ie=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Ie&&Xe.includes("firefox");!Ie&&Xe.includes("chrom");const jn=Bn,Gt=/jsdom|happydom/.test(Xe),nt="data-base-ui-focusable",Ut="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Xr="ArrowLeft",Kr="ArrowRight",$r="ArrowUp",qr="ArrowDown";function zr(e,t){if(!ve(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(w(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function ze(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Yn(e){return e.matches("html,body")}function Xt(e){return te(e)&&e.matches(Ut)}function Jr(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ut}`)!=null}function Et(e){return e?e.getAttribute("role")==="combobox"&&Xt(e):!1}function Qr(e){if(!e||Gt)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function St(e){return e?e.hasAttribute(nt)?e:e.querySelector(`[${nt}]`)||e:null}function Le(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>[...!n||s.context?.open?[s]:[],...Le(e,s.id,n)])}function Tt(e,t){let n=[],r=e.find(s=>s.id===t)?.parentId;for(;r;){const s=e.find(o=>o.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function Gn(e){e.preventDefault(),e.stopPropagation()}function Un(e){return"nativeEvent"in e}function Xn(e){return e.pointerType===""&&e.isTrusted?!0:tt&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Kn(e){return Gt?!1:!tt&&e.width===0&&e.height===0||tt&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Zr(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function $n(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const qn='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function zn(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return ct(n)?n.host:null}function rt(e){for(const t of Array.from(e.children))if(se(t)==="summary")return t;return null}function Jn(e,t){const n=rt(t);return!!n&&(e===n||w(n,e))}function Kt(e){const t=e?se(e):"";return e!=null&&e.matches(qn)&&(t!=="summary"||e.parentElement!=null&&se(e.parentElement)==="details"&&rt(e.parentElement)===e)&&(t!=="details"||rt(e)==null)&&(t!=="input"||e.type!=="hidden")}function $t(e){if(!Kt(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=zn(t)){const n=t!==e,r=se(t)==="slot";if(t.hasAttribute("inert")||n&&se(t)==="details"&&!t.open&&!Jn(e,t)||t.hasAttribute("hidden")||!r&&!Qn(t,n))return!1}return!0}function Qn(e,t){const n=Ht(e);return t?n.display!=="none":Dt(e,n)}function qt(e){const t=e.tabIndex;if(t<0){const n=se(e);if(n==="details"||n==="audio"||n==="video"||te(e)&&e.isContentEditable)return 0}return t}function Je(e){if(se(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function Zn(e,t){const n=Je(e);if(!n)return!0;const r=t.find(s=>{const o=Je(s);return o?.name===n.name&&o.form===n.form&&o.checked});return r?r===n:t.find(s=>{const o=Je(s);return o?.name===n.name&&o.form===n.form})===n}function zt(e){if(te(e)&&se(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return te(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Jt(e,t){zt(e).forEach(n=>{Kt(n)&&t.push(n),Jt(n,t)})}function Qt(e,t,n){zt(e).forEach(r=>{te(r)&&r.matches(t)&&n.push(r),Qt(r,t,n)})}function ft(e){return $t(e)&&qt(e)>=0}function Zt(e){const t=[];return Jt(e,t),t.filter($t)}function He(e){const t=Zt(e);return t.filter(n=>qt(n)>=0&&Zn(n,t))}function en(e,t){const n=He(e),r=n.length;if(r===0)return;const s=pe(W(e)),o=n.indexOf(s),i=o===-1?t===1?0:r-1:o+t;return n[i]}function tn(e){return en(W(e).body,1)||e}function nn(e){return en(W(e).body,-1)||e}function rn(e,t){if(!e)return null;const n=He(W(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const o=(s+t+r)%r;return n[o]}function es(e){return rn(e,1)}function ts(e){return rn(e,-1)}function Me(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!w(n,r)}function er(e){He(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Rt(e){const t=[];Qt(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Fe=0;class Te{static create(){return new Te}currentId=Fe;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Fe,n()},t)}isStarted(){return this.currentId!==Fe}clear=()=>{this.currentId!==Fe&&(clearTimeout(this.currentId),this.currentId=Fe)};disposeEffect=()=>this.clear}function je(){const e=De(Te.create).current;return Tn(e.disposeEffect),e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=bt.startingStyle]="startingStyle",e[e.endingStyle=bt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const tr={"data-popup-open":""},nr={"data-popup-open":"","data-pressed":""},rr={"data-open":""},sr={"data-closed":""},or={"data-anchor-hidden":""},ns={open(e){return e?tr:null}},rs={open(e){return e?nr:null}},ir={open(e){return e?rr:sr},anchorHidden(e){return e?or:null}},ss={...ir,...Rn};function P(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ce(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function We(e){const t=De(cr,e).current;return t.next=e,D(t.effect),t}function cr(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const sn={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ur={...sn,position:"fixed",top:0,left:0},os={...sn,position:"absolute"},Ye=a.forwardRef(function(t,n){const[r,s]=a.useState();D(()=>{jn&&Ie&&s("button")},[]);const o={tabIndex:0,role:r};return ne.jsx("span",{...t,ref:n,style:ur,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})});function Ge(e){return`data-base-ui-${e}`}let _e=0;function Qe(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(_e);function o(){s&&!s()||e?.focus({preventScroll:n})}if(r)return o(),Vt;const i=requestAnimationFrame(o);return _e=i,()=>{_e===i&&(cancelAnimationFrame(i),_e=0)}}const Ze={inert:new WeakMap,"aria-hidden":new WeakMap},vt="data-base-ui-inert",st={inert:new WeakSet,"aria-hidden":new WeakSet};let Ae=new WeakMap,et=0;function ar(e){return st[e]}function on(e){return e?ct(e)?e.host:on(e.parentNode):null}const xt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=on(n);return e.contains(r)?r:null}).filter(n=>n!=null),Ct=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},It=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{se(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function lr(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,u=null;const p=xt(t,e),c=s?It(t,Ct(p),new Set(p)):[],y=[],C=[];if(o){const d=Ze[o],g=ar(o);u=g,i=d;const v=xt(t,Array.from(t.querySelectorAll("[aria-live]"))),k=p.concat(v);It(t,Ct(k),new Set(k)).forEach(R=>{const b=R.getAttribute(o),q=b!==null&&b!=="false",V=(d.get(R)||0)+1;d.set(R,V),y.push(R),V===1&&q&&g.add(R),q||R.setAttribute(o,o==="inert"?"":"true")})}return s&&c.forEach(d=>{const g=(Ae.get(d)||0)+1;Ae.set(d,g),C.push(d),g===1&&d.setAttribute(vt,"")}),et+=1,()=>{i&&y.forEach(d=>{const v=(i.get(d)||0)-1;i.set(d,v),v||(!u?.has(d)&&o&&d.removeAttribute(o),u?.delete(d))}),s&&C.forEach(d=>{const g=(Ae.get(d)||0)-1;Ae.set(d,g),g||d.removeAttribute(vt)}),et-=1,et||(Ze.inert=new WeakMap,Ze["aria-hidden"]=new WeakMap,st.inert=new WeakSet,st["aria-hidden"]=new WeakSet,Ae=new WeakMap)}}function Ot(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=W(e[0]).body;return lr(e,o,n,r,{mark:s})}const is=500,cs=500,us={style:{transition:"none"}},fr="data-base-ui-click-trigger",as={fallbackAxisSide:"none"},ls={fallbackAxisSide:"end"},dr={clipPath:"inset(50%)",position:"fixed",top:0,left:0},cn=a.createContext(null),un=()=>a.useContext(cn),pr=Ge("portal");function gr(e={}){const{ref:t,container:n,componentProps:r=Be,elementProps:s}=e,o=at(),u=un()?.portalNode,[p,c]=a.useState(null),[y,C]=a.useState(null),d=U(S=>{S!==null&&C(S)}),g=a.useRef(null);D(()=>{if(n===null){g.current&&(g.current=null,C(null),c(null));return}const S=(n&&(On(n)?n:n.current))??u??document.body;if(S==null){g.current&&(g.current=null,C(null),c(null));return}g.current!==S&&(g.current=S,C(null),c(S))},[n,u]);const v=wn("div",r,{ref:[t,d],props:[{id:o,[pr]:""},s]}),k=p&&v?ut.createPortal(v,p):null;return{node:y,nodeId:a.isValidElement(v)?v.props.id:void 0,subtree:k}}const fs=a.forwardRef(function(t,n){const{render:r,className:s,style:o,children:i,container:u,...p}=t,{node:c,nodeId:y,subtree:C}=gr({container:u,ref:n,componentProps:t,elementProps:p}),d=a.useRef(null),g=a.useRef(null),v=a.useRef(null),k=a.useRef(null),[S,R]=a.useState(null),b=a.useRef(!1),q=S?.modal,V=S?.open,Y=!!S&&!S.modal&&S.open&&!!c;a.useEffect(()=>{if(!c||q)return;function F(G){c&&G.relatedTarget&&Me(G)&&(G.type==="focusin"?b.current&&(Rt(c),b.current=!1):(er(c),b.current=!0))}return Ce(P(c,"focusin",F,!0),P(c,"focusout",F,!0))},[c,q]),D(()=>{!c||V!==!0||!b.current||(Rt(c),b.current=!1)},[V,c]);const z=a.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:g,beforeInsideRef:v,afterInsideRef:k,portalNode:c,setFocusManagerState:R}),[c]);return ne.jsxs(a.Fragment,{children:[C,ne.jsxs(cn.Provider,{value:z,children:[Y&&c&&ne.jsx(Ye,{"data-type":"outside",ref:d,onFocus:F=>{if(Me(F,c))v.current?.focus();else{const G=S?S.domReference:null;nn(G)?.focus()}}}),Y&&c&&ne.jsx("span",{"aria-owns":y,style:dr}),c&&ut.createPortal(i,c),Y&&c&&ne.jsx(Ye,{"data-type":"outside",ref:g,onFocus:F=>{if(Me(F,c))k.current?.focus();else{const G=S?S.domReference:null;tn(G)?.focus(),S?.closeOnFocusOut&&S?.onOpenChange(!1,xe(Wt,F.nativeEvent))}}})]})]})});function an(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class hr{nodesRef={current:[]};events=an();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const ln=a.createContext(null),fn=a.createContext(null),dt=()=>a.useContext(ln)?.id||null,pt=e=>{const t=a.useContext(fn);return e??t};function ds(e){const t=at(),n=pt(e),r=dt();return D(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function ps(e){const{children:t,id:n}=e,r=dt();return ne.jsx(ln.Provider,{value:a.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function gs(e){const{children:t,externalTree:n}=e,r=De(()=>n??new hr).current;return ne.jsx(fn.Provider,{value:r,children:t})}function br(e,t){const n=Ue(Se(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const wt=20;let be=[];function gt(){be=be.filter(e=>e.deref()?.isConnected)}function Pt(e){gt(),e&&se(e)!=="body"&&(be.push(new WeakRef(e)),be.length>wt&&(be=be.slice(-wt)))}function kt(){return gt(),be[be.length-1]?.deref()}function mr(e){return e?ft(e)?e:He(e)[0]||e:null}function Ft(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=Zt(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return ft(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function hs(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:i=!1,modal:u=!0,closeOnFocusOut:p=!0,openInteractionType:c="",nextFocusableElement:y,previousFocusableElement:C,beforeContentFocusGuardRef:d,externalTree:g,getInsideElements:v}=e,k="rootStore"in t?t.rootStore:t,S=k.useState("open"),R=k.useState("domReferenceElement"),b=k.useState("floatingElement"),{events:q,dataRef:V}=k.context,Y=U(()=>V.current.floatingContext?.nodeId),z=s===!1,F=Et(R)&&z,G=We(s),M=We(o),J=We(c),Oe=We(S),_=pt(g),x=un(),j=a.useRef(!1),ae=a.useRef(!1),oe=a.useRef(!1),ie=a.useRef(null),me=a.useRef(""),ge=a.useRef(""),ye=a.useRef(null),Re=a.useRef(null),I=mt(ye,d,x?.beforeInsideRef),Q=mt(Re,x?.afterInsideRef),le=je(),fe=je(),we=vn(),Ve=x!=null,E=St(b),ce=U((T=E)=>T?He(T):[]),re=U(()=>v?.().filter(T=>T!=null)??[]);a.useEffect(()=>{if(r||!u)return;function T(B){B.key==="Tab"&&w(E,pe(W(E)))&&ce().length===0&&!F&&Gn(B)}const L=W(E);return P(L,"keydown",T)},[r,E,u,F,ce]),a.useEffect(()=>{if(r||!S)return;const T=W(E);function L(){oe.current=!1}function B(Z){const m=Se(Z),A=re(),h=w(b,m)||w(R,m)||w(x?.portalNode,m)||A.some(H=>H===m||w(H,m));oe.current=!h,ge.current=Z.pointerType||"keyboard",m?.closest(`[${fr}]`)&&(ae.current=!0,fe.start(0,()=>{ae.current=!1}))}function X(){ge.current="keyboard"}return Ce(P(T,"pointerdown",B,!0),P(T,"pointerup",L,!0),P(T,"pointercancel",L,!0),P(T,"keydown",X,!0),L)},[r,b,R,E,S,x,fe,re]),a.useEffect(()=>{if(r||!p)return;const T=W(E);function L(){ae.current=!0,fe.start(0,()=>{ae.current=!1})}function B(A){const h=Se(A);ft(h)&&(ie.current=h)}function X(A){const h=A.relatedTarget,H=A.currentTarget,K=Se(A);u&&h==null&&K!=null&&w(b,K)&&Pt(K),queueMicrotask(()=>{const N=Y(),ee=k.context.triggerElements,l=re(),f=h?.hasAttribute(Ge("focus-guard"))&&[ye.current,Re.current,x?.beforeInsideRef.current,x?.afterInsideRef.current,x?.beforeOutsideRef.current,x?.afterOutsideRef.current,he(C),he(y)].includes(h),$=!(w(R,h)||w(b,h)||w(h,b)||w(x?.portalNode,h)||l.some(O=>O===h||w(O,h))||ee.hasMatchingElement(O=>w(O,h))||f||_&&(Le(_.nodesRef.current,N).find(O=>w(O.context?.elements.floating,h)||w(O.context?.elements.domReference,h))||Tt(_.nodesRef.current,N).find(O=>[O.context?.elements.floating,St(O.context?.elements.floating)].includes(h)||O.context?.elements.domReference===h)));if(H===R&&E&&Ft(E),i&&H!==R&&!Dt(K)&&pe(T)===T.body){if(te(E)&&(E.focus(),i==="popup")){we.request(()=>{E.focus()});return}const O=ce(),de=ie.current,Pe=(de&&O.includes(de)?de:null)||O[O.length-1]||E;te(Pe)&&Pe.focus()}if(V.current.insideReactTree){V.current.insideReactTree=!1;return}(F||!u)&&h&&$&&!ae.current&&(F||h!==kt())&&(j.current=!0,k.setOpen(!1,xe(Wt,A)))})}function Z(){oe.current||(V.current.insideReactTree=!0,le.start(0,()=>{V.current.insideReactTree=!1}))}const m=te(R)?R:null;if(!(!b&&!m))return Ce(m&&P(m,"focusout",X),m&&P(m,"pointerdown",L),b&&P(b,"focusin",B),b&&P(b,"focusout",X),b&&x&&P(b,"focusout",Z,!0))},[r,R,b,E,u,_,x,k,p,i,ce,F,Y,V,le,fe,we,y,C,re]),a.useEffect(()=>{if(r||!b||!S)return;const T=Array.from(x?.portalNode?.querySelectorAll(`[${Ge("portal")}]`)||[]),B=(_?Tt(_.nodesRef.current,Y()):[]).find(H=>Et(H.context?.elements.domReference||null))?.context?.elements.domReference,Z=[...[b,...T,ye.current,Re.current,x?.beforeOutsideRef.current,x?.afterOutsideRef.current,...re()],B,he(C),he(y),F?R:null].filter(H=>H!=null),m=Ot(Z,{ariaHidden:u||F,mark:!1}),A=[b,...T].filter(H=>H!=null),h=Ot(A);return()=>{h(),m()}},[S,r,R,b,u,x,F,_,Y,y,C,re]),D(()=>{if(!S||r||!te(E))return;me.current="",ge.current="";const T=W(E),L=pe(T);queueMicrotask(()=>{const B=G.current,X=typeof B=="function"?B(J.current||""):B;if(X===void 0||X===!1||w(E,L))return;let m=null;const A=()=>(m==null&&(m=ce(E)),m[0]||E);let h;X===!0||X===null?h=A():h=he(X),h=h||A();const H=w(E,pe(T));Qe(h,{preventScroll:h===E,shouldFocus(){if(!Oe.current)return!1;if(H)return!0;const K=pe(T);return!(K!==h&&w(E,K))}})})},[r,S,E,ce,G,J,Oe]),D(()=>{if(r||!E)return;const T=W(E),L=pe(T),B=J.current==null;Pt(L);function X(m){if(m.open||(me.current=br(m.nativeEvent,ge.current)),m.reason===_t&&m.nativeEvent.type==="mouseleave"&&(j.current=!0),m.reason===Bt)if(m.nested)j.current=!1;else if(Xn(m.nativeEvent)||Kn(m.nativeEvent))j.current=!1;else{let A=!1;W(E).createElement("div").focus({get preventScroll(){return A=!0,!1}}),A?j.current=!1:j.current=!0}}q.on("openchange",X);function Z(m){const A=M.current;let h=typeof A=="function"?A(m):A;if(h===void 0||h===!1)return null;h===null&&(h=!0);const H=R?.isConnected?R:null,K=L?.isConnected&&se(L)!=="body"?L:null;let N=B?K||H:H||K;return N||(N=kt()||null),typeof h=="boolean"?N:he(h)||N||null}return()=>{q.off("openchange",X);const m=pe(T),A=re(),h=w(b,m)||A.some(ee=>ee===m||w(ee,m))||_&&Le(_.nodesRef.current,Y(),!1).some(ee=>w(ee.context?.elements.floating,m)),H=M.current,K=me.current,N=Z(K);queueMicrotask(()=>{const ee=mr(N),l=typeof H!="boolean";if(H&&!j.current&&te(ee)&&(!(!l&&ee!==m&&m!==T.body)||h)){const f={preventScroll:!0};K==="keyboard"&&(f.focusVisible=!0),ee.focus(f)}j.current=!1})}},[r,b,E,M,J,q,_,R,Y,re]),D(()=>{if(!Ie||S||!b)return;const T=pe(W(b));!te(T)||!Xt(T)||w(b,T)&&T.blur()},[S,b]),D(()=>{if(!(r||!x))return x.setFocusManagerState({modal:u,closeOnFocusOut:p,open:S,onOpenChange:k.setOpen,domReference:R}),()=>{x.setFocusManagerState(null)}},[r,x,u,S,k,p,R]),D(()=>{if(!(r||!E))return Ft(E),()=>{queueMicrotask(gt)}},[r,E]);const Ee=!r&&(u?!F:!0)&&(Ve||u);return ne.jsxs(a.Fragment,{children:[Ee&&ne.jsx(Ye,{"data-type":"inside",ref:I,onFocus:T=>{if(u){const L=ce();Qe(L[L.length-1])}else x?.portalNode&&(j.current=!1,Me(T,x.portalNode)?tn(R)?.focus():he(C??x.beforeOutsideRef)?.focus())}}),n,Ee&&ne.jsx(Ye,{"data-type":"inside",ref:Q,onFocus:T=>{u?Qe(ce()[0]):x?.portalNode&&(p&&(j.current=!0),Me(T,x.portalNode)?nn(R)?.focus():he(y??x.afterOutsideRef)?.focus())}})]})}function yr(){return!1}function Er(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function bs(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=yr,bubbles:u,externalTree:p}=t,c="rootStore"in e?e.rootStore:e,y=c.useState("open"),C=c.useState("floatingElement"),{dataRef:d}=c.context,g=pt(p),v=U(typeof s=="function"?s:()=>!1),k=typeof s=="function"?v:s,S=k!==!1,R=U(()=>o),{escapeKey:b,outsidePress:q}=Er(u),V=a.useRef(!1),Y=a.useRef(!1),z=a.useRef(!1),F=a.useRef(!1),G=a.useRef(""),M=a.useRef(null),J=je(),Oe=je(),_=U(()=>{Oe.clear(),d.current.insideReactTree=!1}),x=U(I=>{const Q=d.current.floatingContext?.nodeId;return(g?Le(g.nodesRef.current,Q):[]).some(fe=>fe.context?.open&&!fe.context.dataRef.current[I])}),j=U(I=>ze(I,c.select("floatingElement"))||ze(I,c.select("domReferenceElement"))),ae=U(I=>{i()&&c.setOpen(!1,xe(jt,I.nativeEvent))}),oe=U(I=>{if(!y||!n||!r||I.key!=="Escape"||F.current||!b&&x("__escapeKeyBubbles"))return;const Q=Un(I)?I.nativeEvent:I,le=xe(Yt,Q);c.setOpen(!1,le),le.isCanceled||I.preventDefault(),!b&&!le.isPropagationAllowed&&I.stopPropagation()}),ie=U(()=>{d.current.insideReactTree=!0,Oe.start(0,_)}),me=U(I=>{if(!y||!n||I.button!==0)return;const Q=Se(I.nativeEvent);w(c.select("floatingElement"),Q)&&(V.current||(V.current=!0,Y.current=!1))}),ge=U(I=>{!y||!n||(I.defaultPrevented||I.nativeEvent.defaultPrevented)&&V.current&&(Y.current=!0)});a.useEffect(()=>{if(!y||!n)return _;d.current.__escapeKeyBubbles=b,d.current.__outsidePressBubbles=q;const I=new Te,Q=new Te;function le(){I.clear(),F.current=!0}function fe(){I.start(Ie?5:0,()=>{F.current=!1})}function we(){z.current=!0,Q.start(0,()=>{z.current=!1})}function Ve(){V.current=!1,Y.current=!1}function E(){const l=G.current,f=l==="pen"||!l?"mouse":l,$=R(),O=typeof $=="function"?$():$;return typeof O=="string"?O:O[f]}function ce(l){const f=E();return f==="intentional"&&l.type!=="click"||f==="sloppy"&&l.type==="click"}function re(l){const f=d.current.floatingContext?.nodeId,$=g&&Le(g.nodesRef.current,f).some(O=>ze(l,O.context?.elements.floating));return j(l)||$}function Ee(l){if(ce(l)){l.type!=="click"&&!j(l)&&(Q.clear(),z.current=!1),_();return}if(d.current.insideReactTree){_();return}const f=Se(l),$=`[${Ge("inert")}]`,O=ve(f)?f.getRootNode():null,de=Array.from((ct(O)?O:W(c.select("floatingElement"))).querySelectorAll($)),Pe=c.context.triggerElements;if(f&&(Pe.hasElement(f)||Pe.hasMatchingElement(ue=>w(ue,f))))return;let ke=ve(f)?f:null;for(;ke&&!qe(ke);){const ue=Pn(ke);if(qe(ue)||!ve(ue))break;ke=ue}if(!(de.length&&ve(f)&&!Yn(f)&&!w(f,c.select("floatingElement"))&&de.every(ue=>!w(ke,ue)))){if(te(f)&&!("touches"in l)){const ue=qe(f),$e=Ht(f),ht=/auto|scroll/,gn=ue||ht.test($e.overflowX),hn=ue||ht.test($e.overflowY),bn=gn&&f.clientWidth>0&&f.scrollWidth>f.clientWidth,mn=hn&&f.clientHeight>0&&f.scrollHeight>f.clientHeight,yn=$e.direction==="rtl",En=mn&&(yn?l.offsetX<=f.offsetWidth-f.clientWidth:l.offsetX>f.clientWidth),Sn=bn&&l.offsetY>f.clientHeight;if(En||Sn)return}if(!re(l)){if(E()==="intentional"&&z.current){Q.clear(),z.current=!1;return}typeof k=="function"&&!k(l)||x("__outsidePressBubbles")||(c.setOpen(!1,xe(Bt,l)),_())}}}function T(l){E()!=="sloppy"||l.pointerType==="touch"||!c.select("open")||!n||j(l)||Ee(l)}function L(l){if(E()!=="sloppy"||!c.select("open")||!n||j(l))return;const f=l.touches[0];f&&(M.current={startTime:Date.now(),startX:f.clientX,startY:f.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},J.start(1e3,()=>{M.current&&(M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1)}))}function B(l,f){const $=Se(l);if(!$)return;const O=P($,l.type,()=>{f(l),O()})}function X(l){G.current="touch",B(l,L)}function Z(l){J.clear(),l.type==="pointerdown"&&(G.current=l.pointerType),!(l.type==="mousedown"&&M.current&&!M.current.dismissOnMouseDown)&&B(l,f=>{f.type==="pointerdown"?T(f):Ee(f)})}function m(l){if(!V.current)return;const f=Y.current;if(Ve(),E()==="intentional"){if(l.type==="pointercancel"){f&&we();return}if(!re(l)){if(f){we();return}typeof k=="function"&&!k(l)||(Q.clear(),z.current=!0,_())}}}function A(l){if(E()!=="sloppy"||!M.current||j(l))return;const f=l.touches[0];if(!f)return;const $=Math.abs(f.clientX-M.current.startX),O=Math.abs(f.clientY-M.current.startY),de=Math.sqrt($*$+O*O);de>5&&(M.current.dismissOnTouchEnd=!0),de>10&&(Ee(l),J.clear(),M.current=null)}function h(l){B(l,A)}function H(l){E()!=="sloppy"||!M.current||j(l)||(M.current.dismissOnTouchEnd&&Ee(l),J.clear(),M.current=null)}function K(l){B(l,H)}const N=W(C),ee=Ce(r&&Ce(P(N,"keydown",oe),P(N,"compositionstart",le),P(N,"compositionend",fe)),S&&Ce(P(N,"click",Z,!0),P(N,"pointerdown",Z,!0),P(N,"pointerup",m,!0),P(N,"pointercancel",m,!0),P(N,"mousedown",Z,!0),P(N,"mouseup",m,!0),P(N,"touchstart",X,!0),P(N,"touchmove",h,!0),P(N,"touchend",K,!0)));return()=>{ee(),I.clear(),Q.clear(),Ve(),z.current=!1,_()}},[d,C,r,S,k,y,n,b,q,oe,_,R,x,j,g,c,J]);const ye=a.useMemo(()=>({onKeyDown:oe,onPointerDown:ae,onClick:ae}),[oe,ae]),Re=a.useMemo(()=>({onKeyDown:oe,onPointerDown:ge,onMouseDown:ge,onClickCapture:ie,onMouseDownCapture(I){ie(),me(I)},onPointerDownCapture(I){ie(),me(I)},onMouseUpCapture:ie,onTouchEndCapture:ie,onTouchMoveCapture:ie}),[oe,ie,me,ge]);return a.useMemo(()=>n?{reference:ye,floating:Re,trigger:ye}:{},[n,ye,Re])}var dn=kn();const ot=[];let it;function Sr(){return it}function Tr(e){ot.push(e)}function Rr(e){const t=(n,r)=>{const s=De(vr).current;let o;try{it=s;for(const i of ot)i.before(s);o=e(n,r);for(const i of ot)i.after(s);s.didInitialize=!0}finally{it=void 0}return o};return t.displayName=e.displayName||e.name,t}function ms(e){return a.forwardRef(Rr(e))}function vr(){return{didInitialize:!1}}const xr=Fn(19),Cr=xr?Or:wr;function pn(e,t,n,r,s){return Cr(e,t,n,r,s)}function Ir(e,t,n,r,s){const o=a.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return dn.useSyncExternalStore(e.subscribe,o,o)}Tr({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),dn.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Or(e,t,n,r,s){const o=Sr();if(!o)return Ir(e,t,n,r,s);const i=o.syncIndex;o.syncIndex+=1;let u;return o.didInitialize?(u=o.syncHooks[i],(u.store!==e||u.selector!==t||!Object.is(u.a1,n)||!Object.is(u.a2,r)||!Object.is(u.a3,s))&&(u.store!==e&&(o.didChangeStore=!0),u.store=e,u.selector=t,u.a1=n,u.a2=r,u.a3=s,u.value=t(e.getSnapshot(),n,r,s))):(u={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},o.syncHooks.push(u)),u.value}function wr(e,t,n,r,s){return An.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,s))}class Pr{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return pn(this,t,n,r,s)}}class kr extends Pr{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){a.useDebugValue(t);const r=this;D(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;D(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);D(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){a.useDebugValue(t);const r=this,s=n!==void 0;D(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const o=this.selectors[t];return o(this.state,n,r,s)}useState(t,n,r,s){return a.useDebugValue(t),pn(this,this.selectors[t],n,r,s)}useContextCallback(t,n){a.useDebugValue(t);const r=U(n??Vt);this.context[t]=r}useStateSetter(t){const n=a.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(o=>{const i=r(o);if(!Object.is(s,i)){const u=s;s=i,n(i,u,this)}})}}const Fr={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class Ar extends kr{constructor(t){const{syncOnly:n,nested:r,onOpenChange:s,triggerElements:o,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:an(),nested:r,triggerElements:o},Fr),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&$n(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function Mr(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:o,onOpenChange:i}=e,u=t.useState("open"),p=t.useState("activeTriggerElement"),c=t.useState(n?"popupElement":"positionerElement"),y=t.context.triggerElements,C=i,d=a.useRef(null);r===void 0&&d.current===null&&(d.current=new Ar({open:u,transitionStatus:void 0,referenceElement:p,floatingElement:c,triggerElements:y,onOpenChange:C,floatingId:s,syncOnly:!0,nested:o}));const g=r??d.current;return t.useSyncedValue("floatingId",s),D(()=>{const v={open:u,floatingId:s,referenceElement:p,floatingElement:c};ve(p)&&(v.domReferenceElement=p),g.state.positionReference===g.state.referenceElement&&(v.positionReference=p),g.update(v)},[u,s,p,c,g]),g.context.onOpenChange=C,g.context.nested=o,g}const ys={tabIndex:-1,[nt]:""};function Es(e){return t=>t==="touch"?e.current:!0}function Ss(e,t=!1){const n=at(),r=dt()!=null,s=De(()=>e(n,r)).current;return Mr({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function Ts({handle:e,store:t}){return D(()=>e.attachStore(t),[e,t]),null}function Nr(e,t){const n=a.useRef(null),r=a.useRef(null);return a.useCallback(s=>{if(e===void 0)return;let o=!1;if(n.current!==null){const i=n.current,u=r.current,p=t.context.triggerElements.getById(i);u&&p===u&&(t.context.triggerElements.delete(i),o=!0),n.current=null,r.current=null}if(s!==null&&(n.current=e,r.current=s,t.context.triggerElements.add(e,s),o=!0),o){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function Lr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const s=n?.id??null;(s||t)&&(e.activeTriggerId=s,e.activeTriggerElement=n??null)}function Dr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Rs(e,t,n,r={}){const s=n.reason,o=s===_t,i=t&&s===Ln,u=!t&&(s===jt||s===Yt),p=Dr(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const c=()=>{const y={...r.extraState,open:t};i?y.instantType="focus":u?y.instantType="dismiss":o&&(y.instantType=void 0),Lr(y,t,n.trigger,p()),e.update(y)};o?ut.flushSync(c):c()}function vs(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=Nr(e,n),i=U(p=>{const c=n.select("open"),y=n.select("activeTriggerId");if(y===e){n.update({activeTriggerElement:p,...c?r:null});return}y==null&&c&&n.update({activeTriggerId:e,activeTriggerElement:p,...r})}),u=a.useCallback(p=>{o(p),p&&i(p)},[o,i]);return D(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:u,isMountedByThisTrigger:s}}function xs(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=a.useRef(null),s=e.useState("open"),o=e.useState("triggerCount"),i=e.useState("activeTriggerId"),u=e.useState("activeTriggerElement");D(()=>{if(!s){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const p=e.context.triggerElements.size,c={};e.state.triggerCount!==p&&(c.triggerCount=p);const y=e.select("activeTriggerId");let C=null;if(y){const d=e.context.triggerElements.getById(y);if(d)r.current=y,d!==e.state.activeTriggerElement&&(c.activeTriggerElement=d);else{for(const[g,v]of e.context.triggerElements.entries())if(v===e.state.activeTriggerElement){c.activeTriggerId=g,c.activeTriggerElement=v,r.current=g;break}c.activeTriggerId===void 0&&(r.current===y?C=y:r.current=null)}}else r.current=null;if(!C&&!y&&p===1){const d=e.context.triggerElements.entries().next();if(!d.done){const[g,v]=d.value;c.activeTriggerId=g,c.activeTriggerElement=v,r.current=g}}(c.triggerCount!==void 0||c.activeTriggerId!==void 0||c.activeTriggerElement!==void 0)&&e.update(c),C&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===C&&!e.context.triggerElements.getById(C)){const d=xe(Nn);e.setOpen(!1,d),d.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,o,i,u,n])}function Cs(e,t,n){const{mounted:r,setMounted:s,transitionStatus:o}=xn(e),i=t.useState("preventUnmountingOnClose"),u=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:o,preventUnmountingOnClose:u});const p=U(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Cn({enabled:r&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||p()}}),{forceUnmount:p,transitionStatus:o}}function Is(e,t){e.useSyncedValues(t),D(()=>()=>{e.update({activeTriggerProps:Be,inactiveTriggerProps:Be,popupProps:Be})},[e])}function Os(e,t){D(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),D(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class ws{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}const Ps=a.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const i=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return ne.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});let At={},Mt={},Nt="";function Ke(e,t){return Mn(e)?e:t}function Lt(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Ke(t,n)).overflowY)}function Hr(e){if(typeof document>"u")return!1;const t=W(e);return Ue(t).innerWidth-t.documentElement.clientWidth>0}function Vr(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=W(e),r=n.documentElement,s=n.body,o=Ke(r,s),i=o.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const p=o.offsetWidth;o.style.overflowY="hidden";const c=o.offsetWidth;return o.style.overflowY=i,r.style.scrollbarGutter=u,p===c}function Wr(e){const t=W(e),n=t.documentElement,r=t.body,s=Ke(n,r),o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function _r(e){const t=W(e),n=t.documentElement,r=t.body,s=Ue(n);let o=0,i=0,u=!1;const p=In.create();if(Ie&&(s.visualViewport?.scale??1)!==1)return()=>{};function c(){const g=s.getComputedStyle(n),v=s.getComputedStyle(r),R=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,At={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Nt=n.style.scrollBehavior,Mt={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};const b=n.scrollHeight>n.clientHeight,q=n.scrollWidth>n.clientWidth,V=g.overflowY==="scroll"||v.overflowY==="scroll",Y=g.overflowX==="scroll"||v.overflowX==="scroll",z=Math.max(0,s.innerWidth-r.clientWidth),F=Math.max(0,s.innerHeight-r.clientHeight),G=parseFloat(v.marginTop)+parseFloat(v.marginBottom),M=parseFloat(v.marginLeft)+parseFloat(v.marginRight),J=Ke(n,r);if(u=Vr(e),u){n.style.scrollbarGutter=R,J.style.overflowY="hidden",J.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:R,overflowY:"hidden",overflowX:"hidden"}),(b||V)&&(n.style.overflowY="scroll"),(q||Y)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:G||F?`calc(100dvh - ${G+F}px)`:"100dvh",width:M||z?`calc(100vw - ${M+z}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function y(){Object.assign(n.style,At),Object.assign(r.style,Mt),u||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Nt)}function C(){y(),p.request(c)}c();const d=P(s,"resize",C);return()=>{p.cancel(),y(),typeof s.removeEventListener=="function"&&d()}}class Br{lockCount=0;restore=null;timeoutLock=Te.create();timeoutUnlock=Te.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=W(t),r=n.documentElement,s=n.body,o=Ue(r);if(Lt(o,r,s)){const u=new o.MutationObserver(()=>{Lt(o,r,s)||(u.disconnect(),this.restore=null,this.lock(t))}),p={attributes:!0};u.observe(r,p),u.observe(s,p),this.restore=()=>u.disconnect();return}const i=lt||!Hr(t);this.restore=i?Wr(t):_r(t)}}const jr=new Br;function ks(e=!0,t=null){D(()=>{if(e)return jr.acquire(t)},[e,t])}export{rs as $,zr as A,Xt as B,Qr as C,pt as D,dt as E,ys as F,Jr as G,Le as H,hs as I,fs as J,as as K,Ps as L,ps as M,hr as N,ds as O,ws as P,Dr as Q,kr as R,Lr as S,Te as T,Mr as U,is as V,gs as W,Me as X,es as Y,tn as Z,ts as _,P as a,Ye as a0,cs as a1,Ar as a2,pn as a3,St as a4,Xn as a5,Kn as a6,Et as a7,Qe as a8,Gn as a9,Xr as aa,Kr as ab,$r as ac,qr as ad,lt as ae,us as af,ks as ag,Gt as ah,Es as ai,Os as aj,Rs as b,xs as c,Cs as d,Ts as e,Rr as f,bs as g,Is as h,Zr as i,ms as j,vs as k,We as l,je as m,gr as n,ls as o,ss as p,ir as q,ur as r,dn as s,ns as t,Ss as u,os as v,Ce as w,_n as x,Ie as y,Ge as z};
1
+ import{j as Dt,b as Tn,T as bt,t as Rn,d as vn,r as he,a as xn,u as Cn,p as In}from"./inertValue-Dy4HJtbg.js";import{aS as te,l as ve,b5 as se,bj as ct,b0 as Ht,av as De,e as D,r as a,j as ne,ax as Vt,n as ut,E as Be,f as U,bk as On,k as wn,ay as mt,g as Ue,aU as qe,aV as Pn,bl as kn,bm as Fn,bn as An,b6 as Mn}from"./index-BC1mWQy8.js";import{a as w,o as W,m as pe,c as xe,x as Wt,w as at,b as _t,s as Bt,g as Se,t as jt,q as Yt,n as Nn,p as Ln}from"./createBaseUIEventDetails-67bayC1B.js";function Dn(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Hn,platform:Vn,maxTouchPoints:Wn}=Dn(),Xe=Hn.toLowerCase(),Ne=Vn.toLowerCase(),lt=/^i(os$|p)/.test(Ne)||Ne==="macintel"&&Wn>1,yt="android",tt=Ne===yt||Xe.includes(yt),_n=!lt&&Ne.startsWith("mac");Ne.startsWith("win");const Bn=_n||lt,Ie=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Ie&&Xe.includes("firefox");!Ie&&Xe.includes("chrom");const jn=Bn,Gt=/jsdom|happydom/.test(Xe),nt="data-base-ui-focusable",Ut="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Xr="ArrowLeft",Kr="ArrowRight",$r="ArrowUp",qr="ArrowDown";function zr(e,t){if(!ve(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(w(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function ze(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Yn(e){return e.matches("html,body")}function Xt(e){return te(e)&&e.matches(Ut)}function Jr(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ut}`)!=null}function Et(e){return e?e.getAttribute("role")==="combobox"&&Xt(e):!1}function Qr(e){if(!e||Gt)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function St(e){return e?e.hasAttribute(nt)?e:e.querySelector(`[${nt}]`)||e:null}function Le(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>[...!n||s.context?.open?[s]:[],...Le(e,s.id,n)])}function Tt(e,t){let n=[],r=e.find(s=>s.id===t)?.parentId;for(;r;){const s=e.find(o=>o.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function Gn(e){e.preventDefault(),e.stopPropagation()}function Un(e){return"nativeEvent"in e}function Xn(e){return e.pointerType===""&&e.isTrusted?!0:tt&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Kn(e){return Gt?!1:!tt&&e.width===0&&e.height===0||tt&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Zr(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function $n(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const qn='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function zn(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return ct(n)?n.host:null}function rt(e){for(const t of Array.from(e.children))if(se(t)==="summary")return t;return null}function Jn(e,t){const n=rt(t);return!!n&&(e===n||w(n,e))}function Kt(e){const t=e?se(e):"";return e!=null&&e.matches(qn)&&(t!=="summary"||e.parentElement!=null&&se(e.parentElement)==="details"&&rt(e.parentElement)===e)&&(t!=="details"||rt(e)==null)&&(t!=="input"||e.type!=="hidden")}function $t(e){if(!Kt(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=zn(t)){const n=t!==e,r=se(t)==="slot";if(t.hasAttribute("inert")||n&&se(t)==="details"&&!t.open&&!Jn(e,t)||t.hasAttribute("hidden")||!r&&!Qn(t,n))return!1}return!0}function Qn(e,t){const n=Ht(e);return t?n.display!=="none":Dt(e,n)}function qt(e){const t=e.tabIndex;if(t<0){const n=se(e);if(n==="details"||n==="audio"||n==="video"||te(e)&&e.isContentEditable)return 0}return t}function Je(e){if(se(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function Zn(e,t){const n=Je(e);if(!n)return!0;const r=t.find(s=>{const o=Je(s);return o?.name===n.name&&o.form===n.form&&o.checked});return r?r===n:t.find(s=>{const o=Je(s);return o?.name===n.name&&o.form===n.form})===n}function zt(e){if(te(e)&&se(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return te(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Jt(e,t){zt(e).forEach(n=>{Kt(n)&&t.push(n),Jt(n,t)})}function Qt(e,t,n){zt(e).forEach(r=>{te(r)&&r.matches(t)&&n.push(r),Qt(r,t,n)})}function ft(e){return $t(e)&&qt(e)>=0}function Zt(e){const t=[];return Jt(e,t),t.filter($t)}function He(e){const t=Zt(e);return t.filter(n=>qt(n)>=0&&Zn(n,t))}function en(e,t){const n=He(e),r=n.length;if(r===0)return;const s=pe(W(e)),o=n.indexOf(s),i=o===-1?t===1?0:r-1:o+t;return n[i]}function tn(e){return en(W(e).body,1)||e}function nn(e){return en(W(e).body,-1)||e}function rn(e,t){if(!e)return null;const n=He(W(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const o=(s+t+r)%r;return n[o]}function es(e){return rn(e,1)}function ts(e){return rn(e,-1)}function Me(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!w(n,r)}function er(e){He(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Rt(e){const t=[];Qt(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Fe=0;class Te{static create(){return new Te}currentId=Fe;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Fe,n()},t)}isStarted(){return this.currentId!==Fe}clear=()=>{this.currentId!==Fe&&(clearTimeout(this.currentId),this.currentId=Fe)};disposeEffect=()=>this.clear}function je(){const e=De(Te.create).current;return Tn(e.disposeEffect),e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=bt.startingStyle]="startingStyle",e[e.endingStyle=bt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const tr={"data-popup-open":""},nr={"data-popup-open":"","data-pressed":""},rr={"data-open":""},sr={"data-closed":""},or={"data-anchor-hidden":""},ns={open(e){return e?tr:null}},rs={open(e){return e?nr:null}},ir={open(e){return e?rr:sr},anchorHidden(e){return e?or:null}},ss={...ir,...Rn};function P(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ce(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function We(e){const t=De(cr,e).current;return t.next=e,D(t.effect),t}function cr(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const sn={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ur={...sn,position:"fixed",top:0,left:0},os={...sn,position:"absolute"},Ye=a.forwardRef(function(t,n){const[r,s]=a.useState();D(()=>{jn&&Ie&&s("button")},[]);const o={tabIndex:0,role:r};return ne.jsx("span",{...t,ref:n,style:ur,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})});function Ge(e){return`data-base-ui-${e}`}let _e=0;function Qe(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(_e);function o(){s&&!s()||e?.focus({preventScroll:n})}if(r)return o(),Vt;const i=requestAnimationFrame(o);return _e=i,()=>{_e===i&&(cancelAnimationFrame(i),_e=0)}}const Ze={inert:new WeakMap,"aria-hidden":new WeakMap},vt="data-base-ui-inert",st={inert:new WeakSet,"aria-hidden":new WeakSet};let Ae=new WeakMap,et=0;function ar(e){return st[e]}function on(e){return e?ct(e)?e.host:on(e.parentNode):null}const xt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=on(n);return e.contains(r)?r:null}).filter(n=>n!=null),Ct=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},It=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{se(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function lr(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,u=null;const p=xt(t,e),c=s?It(t,Ct(p),new Set(p)):[],y=[],C=[];if(o){const d=Ze[o],g=ar(o);u=g,i=d;const v=xt(t,Array.from(t.querySelectorAll("[aria-live]"))),k=p.concat(v);It(t,Ct(k),new Set(k)).forEach(R=>{const b=R.getAttribute(o),q=b!==null&&b!=="false",V=(d.get(R)||0)+1;d.set(R,V),y.push(R),V===1&&q&&g.add(R),q||R.setAttribute(o,o==="inert"?"":"true")})}return s&&c.forEach(d=>{const g=(Ae.get(d)||0)+1;Ae.set(d,g),C.push(d),g===1&&d.setAttribute(vt,"")}),et+=1,()=>{i&&y.forEach(d=>{const v=(i.get(d)||0)-1;i.set(d,v),v||(!u?.has(d)&&o&&d.removeAttribute(o),u?.delete(d))}),s&&C.forEach(d=>{const g=(Ae.get(d)||0)-1;Ae.set(d,g),g||d.removeAttribute(vt)}),et-=1,et||(Ze.inert=new WeakMap,Ze["aria-hidden"]=new WeakMap,st.inert=new WeakSet,st["aria-hidden"]=new WeakSet,Ae=new WeakMap)}}function Ot(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=W(e[0]).body;return lr(e,o,n,r,{mark:s})}const is=500,cs=500,us={style:{transition:"none"}},fr="data-base-ui-click-trigger",as={fallbackAxisSide:"none"},ls={fallbackAxisSide:"end"},dr={clipPath:"inset(50%)",position:"fixed",top:0,left:0},cn=a.createContext(null),un=()=>a.useContext(cn),pr=Ge("portal");function gr(e={}){const{ref:t,container:n,componentProps:r=Be,elementProps:s}=e,o=at(),u=un()?.portalNode,[p,c]=a.useState(null),[y,C]=a.useState(null),d=U(S=>{S!==null&&C(S)}),g=a.useRef(null);D(()=>{if(n===null){g.current&&(g.current=null,C(null),c(null));return}const S=(n&&(On(n)?n:n.current))??u??document.body;if(S==null){g.current&&(g.current=null,C(null),c(null));return}g.current!==S&&(g.current=S,C(null),c(S))},[n,u]);const v=wn("div",r,{ref:[t,d],props:[{id:o,[pr]:""},s]}),k=p&&v?ut.createPortal(v,p):null;return{node:y,nodeId:a.isValidElement(v)?v.props.id:void 0,subtree:k}}const fs=a.forwardRef(function(t,n){const{render:r,className:s,style:o,children:i,container:u,...p}=t,{node:c,nodeId:y,subtree:C}=gr({container:u,ref:n,componentProps:t,elementProps:p}),d=a.useRef(null),g=a.useRef(null),v=a.useRef(null),k=a.useRef(null),[S,R]=a.useState(null),b=a.useRef(!1),q=S?.modal,V=S?.open,Y=!!S&&!S.modal&&S.open&&!!c;a.useEffect(()=>{if(!c||q)return;function F(G){c&&G.relatedTarget&&Me(G)&&(G.type==="focusin"?b.current&&(Rt(c),b.current=!1):(er(c),b.current=!0))}return Ce(P(c,"focusin",F,!0),P(c,"focusout",F,!0))},[c,q]),D(()=>{!c||V!==!0||!b.current||(Rt(c),b.current=!1)},[V,c]);const z=a.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:g,beforeInsideRef:v,afterInsideRef:k,portalNode:c,setFocusManagerState:R}),[c]);return ne.jsxs(a.Fragment,{children:[C,ne.jsxs(cn.Provider,{value:z,children:[Y&&c&&ne.jsx(Ye,{"data-type":"outside",ref:d,onFocus:F=>{if(Me(F,c))v.current?.focus();else{const G=S?S.domReference:null;nn(G)?.focus()}}}),Y&&c&&ne.jsx("span",{"aria-owns":y,style:dr}),c&&ut.createPortal(i,c),Y&&c&&ne.jsx(Ye,{"data-type":"outside",ref:g,onFocus:F=>{if(Me(F,c))k.current?.focus();else{const G=S?S.domReference:null;tn(G)?.focus(),S?.closeOnFocusOut&&S?.onOpenChange(!1,xe(Wt,F.nativeEvent))}}})]})]})});function an(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class hr{nodesRef={current:[]};events=an();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const ln=a.createContext(null),fn=a.createContext(null),dt=()=>a.useContext(ln)?.id||null,pt=e=>{const t=a.useContext(fn);return e??t};function ds(e){const t=at(),n=pt(e),r=dt();return D(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function ps(e){const{children:t,id:n}=e,r=dt();return ne.jsx(ln.Provider,{value:a.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function gs(e){const{children:t,externalTree:n}=e,r=De(()=>n??new hr).current;return ne.jsx(fn.Provider,{value:r,children:t})}function br(e,t){const n=Ue(Se(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const wt=20;let be=[];function gt(){be=be.filter(e=>e.deref()?.isConnected)}function Pt(e){gt(),e&&se(e)!=="body"&&(be.push(new WeakRef(e)),be.length>wt&&(be=be.slice(-wt)))}function kt(){return gt(),be[be.length-1]?.deref()}function mr(e){return e?ft(e)?e:He(e)[0]||e:null}function Ft(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=Zt(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return ft(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function hs(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:i=!1,modal:u=!0,closeOnFocusOut:p=!0,openInteractionType:c="",nextFocusableElement:y,previousFocusableElement:C,beforeContentFocusGuardRef:d,externalTree:g,getInsideElements:v}=e,k="rootStore"in t?t.rootStore:t,S=k.useState("open"),R=k.useState("domReferenceElement"),b=k.useState("floatingElement"),{events:q,dataRef:V}=k.context,Y=U(()=>V.current.floatingContext?.nodeId),z=s===!1,F=Et(R)&&z,G=We(s),M=We(o),J=We(c),Oe=We(S),_=pt(g),x=un(),j=a.useRef(!1),ae=a.useRef(!1),oe=a.useRef(!1),ie=a.useRef(null),me=a.useRef(""),ge=a.useRef(""),ye=a.useRef(null),Re=a.useRef(null),I=mt(ye,d,x?.beforeInsideRef),Q=mt(Re,x?.afterInsideRef),le=je(),fe=je(),we=vn(),Ve=x!=null,E=St(b),ce=U((T=E)=>T?He(T):[]),re=U(()=>v?.().filter(T=>T!=null)??[]);a.useEffect(()=>{if(r||!u)return;function T(B){B.key==="Tab"&&w(E,pe(W(E)))&&ce().length===0&&!F&&Gn(B)}const L=W(E);return P(L,"keydown",T)},[r,E,u,F,ce]),a.useEffect(()=>{if(r||!S)return;const T=W(E);function L(){oe.current=!1}function B(Z){const m=Se(Z),A=re(),h=w(b,m)||w(R,m)||w(x?.portalNode,m)||A.some(H=>H===m||w(H,m));oe.current=!h,ge.current=Z.pointerType||"keyboard",m?.closest(`[${fr}]`)&&(ae.current=!0,fe.start(0,()=>{ae.current=!1}))}function X(){ge.current="keyboard"}return Ce(P(T,"pointerdown",B,!0),P(T,"pointerup",L,!0),P(T,"pointercancel",L,!0),P(T,"keydown",X,!0),L)},[r,b,R,E,S,x,fe,re]),a.useEffect(()=>{if(r||!p)return;const T=W(E);function L(){ae.current=!0,fe.start(0,()=>{ae.current=!1})}function B(A){const h=Se(A);ft(h)&&(ie.current=h)}function X(A){const h=A.relatedTarget,H=A.currentTarget,K=Se(A);u&&h==null&&K!=null&&w(b,K)&&Pt(K),queueMicrotask(()=>{const N=Y(),ee=k.context.triggerElements,l=re(),f=h?.hasAttribute(Ge("focus-guard"))&&[ye.current,Re.current,x?.beforeInsideRef.current,x?.afterInsideRef.current,x?.beforeOutsideRef.current,x?.afterOutsideRef.current,he(C),he(y)].includes(h),$=!(w(R,h)||w(b,h)||w(h,b)||w(x?.portalNode,h)||l.some(O=>O===h||w(O,h))||ee.hasMatchingElement(O=>w(O,h))||f||_&&(Le(_.nodesRef.current,N).find(O=>w(O.context?.elements.floating,h)||w(O.context?.elements.domReference,h))||Tt(_.nodesRef.current,N).find(O=>[O.context?.elements.floating,St(O.context?.elements.floating)].includes(h)||O.context?.elements.domReference===h)));if(H===R&&E&&Ft(E),i&&H!==R&&!Dt(K)&&pe(T)===T.body){if(te(E)&&(E.focus(),i==="popup")){we.request(()=>{E.focus()});return}const O=ce(),de=ie.current,Pe=(de&&O.includes(de)?de:null)||O[O.length-1]||E;te(Pe)&&Pe.focus()}if(V.current.insideReactTree){V.current.insideReactTree=!1;return}(F||!u)&&h&&$&&!ae.current&&(F||h!==kt())&&(j.current=!0,k.setOpen(!1,xe(Wt,A)))})}function Z(){oe.current||(V.current.insideReactTree=!0,le.start(0,()=>{V.current.insideReactTree=!1}))}const m=te(R)?R:null;if(!(!b&&!m))return Ce(m&&P(m,"focusout",X),m&&P(m,"pointerdown",L),b&&P(b,"focusin",B),b&&P(b,"focusout",X),b&&x&&P(b,"focusout",Z,!0))},[r,R,b,E,u,_,x,k,p,i,ce,F,Y,V,le,fe,we,y,C,re]),a.useEffect(()=>{if(r||!b||!S)return;const T=Array.from(x?.portalNode?.querySelectorAll(`[${Ge("portal")}]`)||[]),B=(_?Tt(_.nodesRef.current,Y()):[]).find(H=>Et(H.context?.elements.domReference||null))?.context?.elements.domReference,Z=[...[b,...T,ye.current,Re.current,x?.beforeOutsideRef.current,x?.afterOutsideRef.current,...re()],B,he(C),he(y),F?R:null].filter(H=>H!=null),m=Ot(Z,{ariaHidden:u||F,mark:!1}),A=[b,...T].filter(H=>H!=null),h=Ot(A);return()=>{h(),m()}},[S,r,R,b,u,x,F,_,Y,y,C,re]),D(()=>{if(!S||r||!te(E))return;me.current="",ge.current="";const T=W(E),L=pe(T);queueMicrotask(()=>{const B=G.current,X=typeof B=="function"?B(J.current||""):B;if(X===void 0||X===!1||w(E,L))return;let m=null;const A=()=>(m==null&&(m=ce(E)),m[0]||E);let h;X===!0||X===null?h=A():h=he(X),h=h||A();const H=w(E,pe(T));Qe(h,{preventScroll:h===E,shouldFocus(){if(!Oe.current)return!1;if(H)return!0;const K=pe(T);return!(K!==h&&w(E,K))}})})},[r,S,E,ce,G,J,Oe]),D(()=>{if(r||!E)return;const T=W(E),L=pe(T),B=J.current==null;Pt(L);function X(m){if(m.open||(me.current=br(m.nativeEvent,ge.current)),m.reason===_t&&m.nativeEvent.type==="mouseleave"&&(j.current=!0),m.reason===Bt)if(m.nested)j.current=!1;else if(Xn(m.nativeEvent)||Kn(m.nativeEvent))j.current=!1;else{let A=!1;W(E).createElement("div").focus({get preventScroll(){return A=!0,!1}}),A?j.current=!1:j.current=!0}}q.on("openchange",X);function Z(m){const A=M.current;let h=typeof A=="function"?A(m):A;if(h===void 0||h===!1)return null;h===null&&(h=!0);const H=R?.isConnected?R:null,K=L?.isConnected&&se(L)!=="body"?L:null;let N=B?K||H:H||K;return N||(N=kt()||null),typeof h=="boolean"?N:he(h)||N||null}return()=>{q.off("openchange",X);const m=pe(T),A=re(),h=w(b,m)||A.some(ee=>ee===m||w(ee,m))||_&&Le(_.nodesRef.current,Y(),!1).some(ee=>w(ee.context?.elements.floating,m)),H=M.current,K=me.current,N=Z(K);queueMicrotask(()=>{const ee=mr(N),l=typeof H!="boolean";if(H&&!j.current&&te(ee)&&(!(!l&&ee!==m&&m!==T.body)||h)){const f={preventScroll:!0};K==="keyboard"&&(f.focusVisible=!0),ee.focus(f)}j.current=!1})}},[r,b,E,M,J,q,_,R,Y,re]),D(()=>{if(!Ie||S||!b)return;const T=pe(W(b));!te(T)||!Xt(T)||w(b,T)&&T.blur()},[S,b]),D(()=>{if(!(r||!x))return x.setFocusManagerState({modal:u,closeOnFocusOut:p,open:S,onOpenChange:k.setOpen,domReference:R}),()=>{x.setFocusManagerState(null)}},[r,x,u,S,k,p,R]),D(()=>{if(!(r||!E))return Ft(E),()=>{queueMicrotask(gt)}},[r,E]);const Ee=!r&&(u?!F:!0)&&(Ve||u);return ne.jsxs(a.Fragment,{children:[Ee&&ne.jsx(Ye,{"data-type":"inside",ref:I,onFocus:T=>{if(u){const L=ce();Qe(L[L.length-1])}else x?.portalNode&&(j.current=!1,Me(T,x.portalNode)?tn(R)?.focus():he(C??x.beforeOutsideRef)?.focus())}}),n,Ee&&ne.jsx(Ye,{"data-type":"inside",ref:Q,onFocus:T=>{u?Qe(ce()[0]):x?.portalNode&&(p&&(j.current=!0),Me(T,x.portalNode)?nn(R)?.focus():he(y??x.afterOutsideRef)?.focus())}})]})}function yr(){return!1}function Er(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function bs(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=yr,bubbles:u,externalTree:p}=t,c="rootStore"in e?e.rootStore:e,y=c.useState("open"),C=c.useState("floatingElement"),{dataRef:d}=c.context,g=pt(p),v=U(typeof s=="function"?s:()=>!1),k=typeof s=="function"?v:s,S=k!==!1,R=U(()=>o),{escapeKey:b,outsidePress:q}=Er(u),V=a.useRef(!1),Y=a.useRef(!1),z=a.useRef(!1),F=a.useRef(!1),G=a.useRef(""),M=a.useRef(null),J=je(),Oe=je(),_=U(()=>{Oe.clear(),d.current.insideReactTree=!1}),x=U(I=>{const Q=d.current.floatingContext?.nodeId;return(g?Le(g.nodesRef.current,Q):[]).some(fe=>fe.context?.open&&!fe.context.dataRef.current[I])}),j=U(I=>ze(I,c.select("floatingElement"))||ze(I,c.select("domReferenceElement"))),ae=U(I=>{i()&&c.setOpen(!1,xe(jt,I.nativeEvent))}),oe=U(I=>{if(!y||!n||!r||I.key!=="Escape"||F.current||!b&&x("__escapeKeyBubbles"))return;const Q=Un(I)?I.nativeEvent:I,le=xe(Yt,Q);c.setOpen(!1,le),le.isCanceled||I.preventDefault(),!b&&!le.isPropagationAllowed&&I.stopPropagation()}),ie=U(()=>{d.current.insideReactTree=!0,Oe.start(0,_)}),me=U(I=>{if(!y||!n||I.button!==0)return;const Q=Se(I.nativeEvent);w(c.select("floatingElement"),Q)&&(V.current||(V.current=!0,Y.current=!1))}),ge=U(I=>{!y||!n||(I.defaultPrevented||I.nativeEvent.defaultPrevented)&&V.current&&(Y.current=!0)});a.useEffect(()=>{if(!y||!n)return _;d.current.__escapeKeyBubbles=b,d.current.__outsidePressBubbles=q;const I=new Te,Q=new Te;function le(){I.clear(),F.current=!0}function fe(){I.start(Ie?5:0,()=>{F.current=!1})}function we(){z.current=!0,Q.start(0,()=>{z.current=!1})}function Ve(){V.current=!1,Y.current=!1}function E(){const l=G.current,f=l==="pen"||!l?"mouse":l,$=R(),O=typeof $=="function"?$():$;return typeof O=="string"?O:O[f]}function ce(l){const f=E();return f==="intentional"&&l.type!=="click"||f==="sloppy"&&l.type==="click"}function re(l){const f=d.current.floatingContext?.nodeId,$=g&&Le(g.nodesRef.current,f).some(O=>ze(l,O.context?.elements.floating));return j(l)||$}function Ee(l){if(ce(l)){l.type!=="click"&&!j(l)&&(Q.clear(),z.current=!1),_();return}if(d.current.insideReactTree){_();return}const f=Se(l),$=`[${Ge("inert")}]`,O=ve(f)?f.getRootNode():null,de=Array.from((ct(O)?O:W(c.select("floatingElement"))).querySelectorAll($)),Pe=c.context.triggerElements;if(f&&(Pe.hasElement(f)||Pe.hasMatchingElement(ue=>w(ue,f))))return;let ke=ve(f)?f:null;for(;ke&&!qe(ke);){const ue=Pn(ke);if(qe(ue)||!ve(ue))break;ke=ue}if(!(de.length&&ve(f)&&!Yn(f)&&!w(f,c.select("floatingElement"))&&de.every(ue=>!w(ke,ue)))){if(te(f)&&!("touches"in l)){const ue=qe(f),$e=Ht(f),ht=/auto|scroll/,gn=ue||ht.test($e.overflowX),hn=ue||ht.test($e.overflowY),bn=gn&&f.clientWidth>0&&f.scrollWidth>f.clientWidth,mn=hn&&f.clientHeight>0&&f.scrollHeight>f.clientHeight,yn=$e.direction==="rtl",En=mn&&(yn?l.offsetX<=f.offsetWidth-f.clientWidth:l.offsetX>f.clientWidth),Sn=bn&&l.offsetY>f.clientHeight;if(En||Sn)return}if(!re(l)){if(E()==="intentional"&&z.current){Q.clear(),z.current=!1;return}typeof k=="function"&&!k(l)||x("__outsidePressBubbles")||(c.setOpen(!1,xe(Bt,l)),_())}}}function T(l){E()!=="sloppy"||l.pointerType==="touch"||!c.select("open")||!n||j(l)||Ee(l)}function L(l){if(E()!=="sloppy"||!c.select("open")||!n||j(l))return;const f=l.touches[0];f&&(M.current={startTime:Date.now(),startX:f.clientX,startY:f.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},J.start(1e3,()=>{M.current&&(M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1)}))}function B(l,f){const $=Se(l);if(!$)return;const O=P($,l.type,()=>{f(l),O()})}function X(l){G.current="touch",B(l,L)}function Z(l){J.clear(),l.type==="pointerdown"&&(G.current=l.pointerType),!(l.type==="mousedown"&&M.current&&!M.current.dismissOnMouseDown)&&B(l,f=>{f.type==="pointerdown"?T(f):Ee(f)})}function m(l){if(!V.current)return;const f=Y.current;if(Ve(),E()==="intentional"){if(l.type==="pointercancel"){f&&we();return}if(!re(l)){if(f){we();return}typeof k=="function"&&!k(l)||(Q.clear(),z.current=!0,_())}}}function A(l){if(E()!=="sloppy"||!M.current||j(l))return;const f=l.touches[0];if(!f)return;const $=Math.abs(f.clientX-M.current.startX),O=Math.abs(f.clientY-M.current.startY),de=Math.sqrt($*$+O*O);de>5&&(M.current.dismissOnTouchEnd=!0),de>10&&(Ee(l),J.clear(),M.current=null)}function h(l){B(l,A)}function H(l){E()!=="sloppy"||!M.current||j(l)||(M.current.dismissOnTouchEnd&&Ee(l),J.clear(),M.current=null)}function K(l){B(l,H)}const N=W(C),ee=Ce(r&&Ce(P(N,"keydown",oe),P(N,"compositionstart",le),P(N,"compositionend",fe)),S&&Ce(P(N,"click",Z,!0),P(N,"pointerdown",Z,!0),P(N,"pointerup",m,!0),P(N,"pointercancel",m,!0),P(N,"mousedown",Z,!0),P(N,"mouseup",m,!0),P(N,"touchstart",X,!0),P(N,"touchmove",h,!0),P(N,"touchend",K,!0)));return()=>{ee(),I.clear(),Q.clear(),Ve(),z.current=!1,_()}},[d,C,r,S,k,y,n,b,q,oe,_,R,x,j,g,c,J]);const ye=a.useMemo(()=>({onKeyDown:oe,onPointerDown:ae,onClick:ae}),[oe,ae]),Re=a.useMemo(()=>({onKeyDown:oe,onPointerDown:ge,onMouseDown:ge,onClickCapture:ie,onMouseDownCapture(I){ie(),me(I)},onPointerDownCapture(I){ie(),me(I)},onMouseUpCapture:ie,onTouchEndCapture:ie,onTouchMoveCapture:ie}),[oe,ie,me,ge]);return a.useMemo(()=>n?{reference:ye,floating:Re,trigger:ye}:{},[n,ye,Re])}var dn=kn();const ot=[];let it;function Sr(){return it}function Tr(e){ot.push(e)}function Rr(e){const t=(n,r)=>{const s=De(vr).current;let o;try{it=s;for(const i of ot)i.before(s);o=e(n,r);for(const i of ot)i.after(s);s.didInitialize=!0}finally{it=void 0}return o};return t.displayName=e.displayName||e.name,t}function ms(e){return a.forwardRef(Rr(e))}function vr(){return{didInitialize:!1}}const xr=Fn(19),Cr=xr?Or:wr;function pn(e,t,n,r,s){return Cr(e,t,n,r,s)}function Ir(e,t,n,r,s){const o=a.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return dn.useSyncExternalStore(e.subscribe,o,o)}Tr({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),dn.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Or(e,t,n,r,s){const o=Sr();if(!o)return Ir(e,t,n,r,s);const i=o.syncIndex;o.syncIndex+=1;let u;return o.didInitialize?(u=o.syncHooks[i],(u.store!==e||u.selector!==t||!Object.is(u.a1,n)||!Object.is(u.a2,r)||!Object.is(u.a3,s))&&(u.store!==e&&(o.didChangeStore=!0),u.store=e,u.selector=t,u.a1=n,u.a2=r,u.a3=s,u.value=t(e.getSnapshot(),n,r,s))):(u={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},o.syncHooks.push(u)),u.value}function wr(e,t,n,r,s){return An.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,s))}class Pr{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return pn(this,t,n,r,s)}}class kr extends Pr{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){a.useDebugValue(t);const r=this;D(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;D(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);D(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){a.useDebugValue(t);const r=this,s=n!==void 0;D(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const o=this.selectors[t];return o(this.state,n,r,s)}useState(t,n,r,s){return a.useDebugValue(t),pn(this,this.selectors[t],n,r,s)}useContextCallback(t,n){a.useDebugValue(t);const r=U(n??Vt);this.context[t]=r}useStateSetter(t){const n=a.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(o=>{const i=r(o);if(!Object.is(s,i)){const u=s;s=i,n(i,u,this)}})}}const Fr={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class Ar extends kr{constructor(t){const{syncOnly:n,nested:r,onOpenChange:s,triggerElements:o,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:an(),nested:r,triggerElements:o},Fr),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&$n(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function Mr(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:o,onOpenChange:i}=e,u=t.useState("open"),p=t.useState("activeTriggerElement"),c=t.useState(n?"popupElement":"positionerElement"),y=t.context.triggerElements,C=i,d=a.useRef(null);r===void 0&&d.current===null&&(d.current=new Ar({open:u,transitionStatus:void 0,referenceElement:p,floatingElement:c,triggerElements:y,onOpenChange:C,floatingId:s,syncOnly:!0,nested:o}));const g=r??d.current;return t.useSyncedValue("floatingId",s),D(()=>{const v={open:u,floatingId:s,referenceElement:p,floatingElement:c};ve(p)&&(v.domReferenceElement=p),g.state.positionReference===g.state.referenceElement&&(v.positionReference=p),g.update(v)},[u,s,p,c,g]),g.context.onOpenChange=C,g.context.nested=o,g}const ys={tabIndex:-1,[nt]:""};function Es(e){return t=>t==="touch"?e.current:!0}function Ss(e,t=!1){const n=at(),r=dt()!=null,s=De(()=>e(n,r)).current;return Mr({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function Ts({handle:e,store:t}){return D(()=>e.attachStore(t),[e,t]),null}function Nr(e,t){const n=a.useRef(null),r=a.useRef(null);return a.useCallback(s=>{if(e===void 0)return;let o=!1;if(n.current!==null){const i=n.current,u=r.current,p=t.context.triggerElements.getById(i);u&&p===u&&(t.context.triggerElements.delete(i),o=!0),n.current=null,r.current=null}if(s!==null&&(n.current=e,r.current=s,t.context.triggerElements.add(e,s),o=!0),o){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function Lr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const s=n?.id??null;(s||t)&&(e.activeTriggerId=s,e.activeTriggerElement=n??null)}function Dr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Rs(e,t,n,r={}){const s=n.reason,o=s===_t,i=t&&s===Ln,u=!t&&(s===jt||s===Yt),p=Dr(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const c=()=>{const y={...r.extraState,open:t};i?y.instantType="focus":u?y.instantType="dismiss":o&&(y.instantType=void 0),Lr(y,t,n.trigger,p()),e.update(y)};o?ut.flushSync(c):c()}function vs(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=Nr(e,n),i=U(p=>{const c=n.select("open"),y=n.select("activeTriggerId");if(y===e){n.update({activeTriggerElement:p,...c?r:null});return}y==null&&c&&n.update({activeTriggerId:e,activeTriggerElement:p,...r})}),u=a.useCallback(p=>{o(p),p&&i(p)},[o,i]);return D(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:u,isMountedByThisTrigger:s}}function xs(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=a.useRef(null),s=e.useState("open"),o=e.useState("triggerCount"),i=e.useState("activeTriggerId"),u=e.useState("activeTriggerElement");D(()=>{if(!s){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const p=e.context.triggerElements.size,c={};e.state.triggerCount!==p&&(c.triggerCount=p);const y=e.select("activeTriggerId");let C=null;if(y){const d=e.context.triggerElements.getById(y);if(d)r.current=y,d!==e.state.activeTriggerElement&&(c.activeTriggerElement=d);else{for(const[g,v]of e.context.triggerElements.entries())if(v===e.state.activeTriggerElement){c.activeTriggerId=g,c.activeTriggerElement=v,r.current=g;break}c.activeTriggerId===void 0&&(r.current===y?C=y:r.current=null)}}else r.current=null;if(!C&&!y&&p===1){const d=e.context.triggerElements.entries().next();if(!d.done){const[g,v]=d.value;c.activeTriggerId=g,c.activeTriggerElement=v,r.current=g}}(c.triggerCount!==void 0||c.activeTriggerId!==void 0||c.activeTriggerElement!==void 0)&&e.update(c),C&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===C&&!e.context.triggerElements.getById(C)){const d=xe(Nn);e.setOpen(!1,d),d.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,o,i,u,n])}function Cs(e,t,n){const{mounted:r,setMounted:s,transitionStatus:o}=xn(e),i=t.useState("preventUnmountingOnClose"),u=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:o,preventUnmountingOnClose:u});const p=U(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Cn({enabled:r&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||p()}}),{forceUnmount:p,transitionStatus:o}}function Is(e,t){e.useSyncedValues(t),D(()=>()=>{e.update({activeTriggerProps:Be,inactiveTriggerProps:Be,popupProps:Be})},[e])}function Os(e,t){D(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),D(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class ws{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}const Ps=a.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const i=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return ne.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});let At={},Mt={},Nt="";function Ke(e,t){return Mn(e)?e:t}function Lt(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Ke(t,n)).overflowY)}function Hr(e){if(typeof document>"u")return!1;const t=W(e);return Ue(t).innerWidth-t.documentElement.clientWidth>0}function Vr(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=W(e),r=n.documentElement,s=n.body,o=Ke(r,s),i=o.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const p=o.offsetWidth;o.style.overflowY="hidden";const c=o.offsetWidth;return o.style.overflowY=i,r.style.scrollbarGutter=u,p===c}function Wr(e){const t=W(e),n=t.documentElement,r=t.body,s=Ke(n,r),o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function _r(e){const t=W(e),n=t.documentElement,r=t.body,s=Ue(n);let o=0,i=0,u=!1;const p=In.create();if(Ie&&(s.visualViewport?.scale??1)!==1)return()=>{};function c(){const g=s.getComputedStyle(n),v=s.getComputedStyle(r),R=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,At={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Nt=n.style.scrollBehavior,Mt={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};const b=n.scrollHeight>n.clientHeight,q=n.scrollWidth>n.clientWidth,V=g.overflowY==="scroll"||v.overflowY==="scroll",Y=g.overflowX==="scroll"||v.overflowX==="scroll",z=Math.max(0,s.innerWidth-r.clientWidth),F=Math.max(0,s.innerHeight-r.clientHeight),G=parseFloat(v.marginTop)+parseFloat(v.marginBottom),M=parseFloat(v.marginLeft)+parseFloat(v.marginRight),J=Ke(n,r);if(u=Vr(e),u){n.style.scrollbarGutter=R,J.style.overflowY="hidden",J.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:R,overflowY:"hidden",overflowX:"hidden"}),(b||V)&&(n.style.overflowY="scroll"),(q||Y)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:G||F?`calc(100dvh - ${G+F}px)`:"100dvh",width:M||z?`calc(100vw - ${M+z}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function y(){Object.assign(n.style,At),Object.assign(r.style,Mt),u||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Nt)}function C(){y(),p.request(c)}c();const d=P(s,"resize",C);return()=>{p.cancel(),y(),typeof s.removeEventListener=="function"&&d()}}class Br{lockCount=0;restore=null;timeoutLock=Te.create();timeoutUnlock=Te.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=W(t),r=n.documentElement,s=n.body,o=Ue(r);if(Lt(o,r,s)){const u=new o.MutationObserver(()=>{Lt(o,r,s)||(u.disconnect(),this.restore=null,this.lock(t))}),p={attributes:!0};u.observe(r,p),u.observe(s,p),this.restore=()=>u.disconnect();return}const i=lt||!Hr(t);this.restore=i?Wr(t):_r(t)}}const jr=new Br;function ks(e=!0,t=null){D(()=>{if(e)return jr.acquire(t)},[e,t])}export{rs as $,zr as A,Xt as B,Qr as C,pt as D,dt as E,ys as F,Jr as G,Le as H,hs as I,fs as J,as as K,Ps as L,ps as M,hr as N,ds as O,ws as P,Dr as Q,kr as R,Lr as S,Te as T,Mr as U,is as V,gs as W,Me as X,es as Y,tn as Z,ts as _,P as a,Ye as a0,cs as a1,Ar as a2,pn as a3,St as a4,Xn as a5,Kn as a6,Et as a7,Qe as a8,Gn as a9,Xr as aa,Kr as ab,$r as ac,qr as ad,lt as ae,us as af,ks as ag,Gt as ah,Es as ai,Os as aj,Rs as b,xs as c,Cs as d,Ts as e,Rr as f,bs as g,Is as h,Zr as i,ms as j,vs as k,We as l,je as m,gr as n,ls as o,ss as p,ir as q,ur as r,dn as s,ns as t,Ss as u,os as v,Ce as w,_n as x,Ie as y,Ge as z};
@@ -1 +1 @@
1
- import{r as s,f as c,e as n}from"./index-CUBD0DcL.js";function u(e,r){const t=s.useRef(e),a=c(r);n(()=>{t.current!==e&&a(t.current),t.current=e},[e,a])}export{u};
1
+ import{r as s,f as c,e as n}from"./index-BC1mWQy8.js";function u(e,r){const t=s.useRef(e),a=c(r);n(()=>{t.current!==e&&a(t.current),t.current=e},[e,a])}export{u};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-CUBD0DcL.js";/**
1
+ import{c as e}from"./index-BC1mWQy8.js";/**
2
2
  * @license lucide-react v1.39.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as A,Z as Q,p as E,d as B,r as l,j as e,G as L,h as k,_ as f,B as n,v as w,F as x,H as S}from"./index-CUBD0DcL.js";import{L as C,I as q}from"./label-BoGrNcZ0.js";import{I as _}from"./InstallTag-DutQruP1.js";import{C as P}from"./check-26YOtWVN.js";import{A as I}from"./arrow-left-B4-bJVcO.js";import"./createBaseUIEventDetails-BlUeVOHL.js";import"./CompositeList-CDfO6SCy.js";import"./isElementDisabled-CwHw_lZC.js";import"./inertValue-BxLh7N1J.js";import"./useCompositeItem-BZX9S0sx.js";import"./copy-DqhiNOHN.js";/**
1
+ import{c as A,Z as Q,p as E,d as B,r as l,j as e,G as L,h as k,_ as f,B as n,v as w,F as x,H as S}from"./index-BC1mWQy8.js";import{L as C,I as q}from"./label-Des6lF0o.js";import{I as _}from"./InstallTag-Dv3gaL4O.js";import{C as P}from"./check-2F6z9BBy.js";import{A as I}from"./arrow-left-BWxLUUtR.js";import"./createBaseUIEventDetails-67bayC1B.js";import"./CompositeList-nzDbuttJ.js";import"./isElementDisabled-CwHw_lZC.js";import"./inertValue-Dy4HJtbg.js";import"./useCompositeItem-R43gS2Zb.js";import"./copy-B-mCACcx.js";/**
2
2
  * @license lucide-react v1.39.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{$ as h,r as x,j as e,B as a,G as N,v as y,a0 as b}from"./index-CUBD0DcL.js";const S=`${b}session`;function E(){const{project:o,origin:t,env:g}=h.useSearch(),{me:n}=h.useRouteContext(),[l,d]=x.useState(""),[f,u]=x.useState(!1),i=n.projects.find(s=>s.uid===o),m=typeof window<"u"?window.opener:null,r=()=>window.close();if(!o||!t||!m)return e.jsx(c,{title:"Nothing to sign in to",children:e.jsxs("p",{className:"m-0 text-muted-foreground",children:["This window is opened by the comment box on a site you are reviewing. Open it from there — choose"," ",e.jsx("em",{children:"Studio member? Sign in"})," — and it will ask you here."]})});if(!i)return e.jsxs(c,{title:"Not one of this studio's sites",children:[e.jsxs("p",{className:"m-0 text-muted-foreground",children:["You are signed in to ",n.org.name,", and that site is not one of its sites. If it belongs to another studio you are in, switch to it in the dashboard and try again."]}),e.jsx(a,{variant:"outline",onClick:r,children:"Close"})]});const p=async()=>{d(""),u(!0);try{const s=await y.memberSession(i.uid,t,g);if(s.origin!==t)throw new Error("The address changed while signing in. Try again from the site.");const{origin:j,...w}=s;m.postMessage({type:S,session:w},j),r()}catch(s){d(s instanceof Error?s.message:"Could not reach the server."),u(!1)}};return e.jsxs(c,{title:`Sign in to ${i.name}`,children:[e.jsxs("p",{className:"m-0 text-muted-foreground",children:["Comment on ",e.jsx("span",{className:"font-medium text-foreground",children:t})," as"," ",e.jsx("span",{className:"font-medium text-foreground",children:n.user.name||n.user.email}),", from ",n.org.name,". Your comments there and your replies here will be one author."]}),l&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:l}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(a,{size:"lg",className:"flex-1",loading:f,onClick:()=>void p(),children:"Continue"}),e.jsx(a,{size:"lg",variant:"outline",onClick:r,children:"Cancel"})]})]})}function c({title:o,children:t}){return e.jsx(N,{children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:o}),t]})})}export{E as component};
1
+ import{$ as h,r as x,j as e,B as a,G as N,v as y,a0 as b}from"./index-BC1mWQy8.js";const S=`${b}session`;function E(){const{project:o,origin:t,env:g}=h.useSearch(),{me:n}=h.useRouteContext(),[l,d]=x.useState(""),[f,u]=x.useState(!1),i=n.projects.find(s=>s.uid===o),m=typeof window<"u"?window.opener:null,r=()=>window.close();if(!o||!t||!m)return e.jsx(c,{title:"Nothing to sign in to",children:e.jsxs("p",{className:"m-0 text-muted-foreground",children:["This window is opened by the comment box on a site you are reviewing. Open it from there — choose"," ",e.jsx("em",{children:"Studio member? Sign in"})," — and it will ask you here."]})});if(!i)return e.jsxs(c,{title:"Not one of this studio's sites",children:[e.jsxs("p",{className:"m-0 text-muted-foreground",children:["You are signed in to ",n.org.name,", and that site is not one of its sites. If it belongs to another studio you are in, switch to it in the dashboard and try again."]}),e.jsx(a,{variant:"outline",onClick:r,children:"Close"})]});const p=async()=>{d(""),u(!0);try{const s=await y.memberSession(i.uid,t,g);if(s.origin!==t)throw new Error("The address changed while signing in. Try again from the site.");const{origin:j,...w}=s;m.postMessage({type:S,session:w},j),r()}catch(s){d(s instanceof Error?s.message:"Could not reach the server."),u(!1)}};return e.jsxs(c,{title:`Sign in to ${i.name}`,children:[e.jsxs("p",{className:"m-0 text-muted-foreground",children:["Comment on ",e.jsx("span",{className:"font-medium text-foreground",children:t})," as"," ",e.jsx("span",{className:"font-medium text-foreground",children:n.user.name||n.user.email}),", from ",n.org.name,". Your comments there and your replies here will be one author."]}),l&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:l}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(a,{size:"lg",className:"flex-1",loading:f,onClick:()=>void p(),children:"Continue"}),e.jsx(a,{size:"lg",variant:"outline",onClick:r,children:"Cancel"})]})]})}function c({title:o,children:t}){return e.jsx(N,{children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:o}),t]})})}export{E as component};
@@ -1 +1 @@
1
- import{r,z as b,j as e,h as y,C as N,a4 as C,ac as h,B as j,q as f,w as S,ad as P}from"./index-CUBD0DcL.js";import{L as c,I as d}from"./label-BoGrNcZ0.js";import{S as A}from"./SaveState-DrWU77oO.js";import{M as k}from"./McpTokens-BnhNB_C0.js";import{u as M}from"./me-DeblO6Os.js";import{u as F,a as E}from"./studio-Dg6dFTZ5.js";import{M as T,S as z,a as D}from"./sun-B2KoVsUv.js";import"./createBaseUIEventDetails-BlUeVOHL.js";import"./Picker-BvdKGeU8.js";import"./chevron-down-OinKSKsq.js";import"./check-26YOtWVN.js";import"./useScrollLock-DV4rQnvf.js";import"./inertValue-BxLh7N1J.js";import"./isElementDisabled-CwHw_lZC.js";import"./serializeValue-B8e3iXO-.js";import"./useValueChanged-BcwdNwDJ.js";import"./getPseudoElementBounds-087ogDm1.js";import"./CompositeList-CDfO6SCy.js";import"./useQuery-CGx36E5q.js";import"./useBaseQuery-BBU42uTr.js";import"./badge-Cwf-GPv8.js";import"./useRender-CNreHlDo.js";import"./dialog-CjX41K4h.js";import"./switch-DmO3bJxP.js";import"./useAriaLabelledBy-BVVmb5Zj.js";import"./ConfirmDialog-B5-FUf01.js";import"./copy-DqhiNOHN.js";import"./CopyButton-CDVY09FZ.js";function H({items:s}){const[a,o]=r.useState(b);return e.jsx("div",{className:"flex gap-2",role:"radiogroup","aria-label":"Theme",children:s.map(t=>e.jsxs("button",{type:"button",role:"radio","aria-checked":a===t.value,onClick:()=>{N(t.value),o(t.value)},className:y("inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12.5px] font-medium text-ink-soft",a===t.value&&"border-line-strong bg-muted text-foreground"),children:[t.icon,t.label]},t.value))})}function de(){const s=M(),a=F(),[o,t]=r.useState(s.user.name),[u,i]=r.useState(null);r.useEffect(()=>t(s.user.name),[s.user.name]);const m=o.trim()!==s.user.name;return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(C,{title:"You",sub:"Your own account on this studio",actions:e.jsx(A,{saving:a.isPending,savedAt:u})}),e.jsxs(h,{title:"Profile",description:"How you appear on replies and in the members list.",children:[e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:l=>{l.preventDefault(),m&&a.mutate(o.trim(),{onSuccess:()=>i(Date.now())})},children:[e.jsx(c,{htmlFor:"your-name",children:"Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{id:"your-name",value:o,onChange:l=>t(l.target.value)}),m&&e.jsx(j,{type:"submit",variant:"outline",children:"Save"})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"your-email",children:"Email"}),e.jsx(d,{id:"your-email",value:s.user.email,readOnly:!0,className:"bg-muted text-ink-soft"}),e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:["How you sign in, and how the server finds you. An owner changes it with"," ",e.jsx("code",{className:"font-mono",children:"snagset passwd"}),"."]})]})]}),e.jsx(h,{title:"Password",description:"Changing it keeps this session and ends every other one.",children:e.jsx(L,{})}),!f(s.user.role,"settings")&&f(s.user.role,"review")&&e.jsx(k,{owner:!0,mine:!0,instanceOwner:!1,operator:S(s),sites:s.projects}),e.jsx(h,{title:"Appearance",description:"Also in your menu at the bottom of the sidebar.",children:e.jsx(H,{items:[{value:"system",label:"System",icon:e.jsx(T,{className:"size-3.5"})},{value:"light",label:"Light",icon:e.jsx(z,{className:"size-3.5"})},{value:"dark",label:"Dark",icon:e.jsx(D,{className:"size-3.5"})}]})})]})}function L(){const s=E(),[a,o]=r.useState(""),[t,u]=r.useState(""),[i,m]=r.useState(""),[l,g]=r.useState(""),[w,p]=r.useState(!1),x=a.length>0&&t.length>=12&&t===i;return e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:async n=>{if(n.preventDefault(),!(!x||s.isPending)){g("");try{await s.mutateAsync({current:a,next:t}),o(""),u(""),m(""),p(!0)}catch(v){g(P(v))}}},children:[l&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:l}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"pw-current",children:"Current password"}),e.jsx(d,{id:"pw-current",type:"password",autoComplete:"current-password",value:a,onChange:n=>{o(n.target.value),p(!1)}})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"pw-next",children:"New password"}),e.jsx(d,{id:"pw-next",type:"password",autoComplete:"new-password",value:t,onChange:n=>{u(n.target.value),p(!1)}}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. No composition rules — length is what matters."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"pw-again",children:"Confirm new password"}),e.jsx(d,{id:"pw-again",type:"password",autoComplete:"new-password",value:i,onChange:n=>{m(n.target.value),p(!1)}}),i.length>0&&t!==i&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Those do not match yet."})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(j,{type:"submit",loading:s.isPending,disabled:!x,children:s.isPending?"Changing…":w&&!x?"Changed":"Change password"})})]})}export{de as component};
1
+ import{r,z as b,j as e,h as y,C as N,a4 as C,ac as h,B as j,q as f,w as S,ad as P}from"./index-BC1mWQy8.js";import{L as c,I as d}from"./label-Des6lF0o.js";import{S as A}from"./SaveState-zj94ZTUn.js";import{M as k}from"./McpTokens-yimU884S.js";import{u as M}from"./me-DWKKjc2l.js";import{u as F,a as E}from"./studio-DxClsYRz.js";import{M as T,S as z,a as D}from"./sun-BDbnQON-.js";import"./createBaseUIEventDetails-67bayC1B.js";import"./Picker-CCAp0603.js";import"./chevron-down-Co3oKci1.js";import"./check-2F6z9BBy.js";import"./useScrollLock-DV1FkBvY.js";import"./inertValue-Dy4HJtbg.js";import"./isElementDisabled-CwHw_lZC.js";import"./serializeValue-B8e3iXO-.js";import"./useValueChanged-CxAXjLUw.js";import"./getPseudoElementBounds-D9YqITSR.js";import"./CompositeList-nzDbuttJ.js";import"./useQuery-B1QbR4lk.js";import"./useBaseQuery-Di_lHTAg.js";import"./badge-CYPTl0cy.js";import"./useRender-bF5mRtl9.js";import"./dialog-l22OkYXh.js";import"./switch-BQZZEckg.js";import"./useAriaLabelledBy-hDZ_Qzgg.js";import"./ConfirmDialog-CHFBH7e-.js";import"./copy-B-mCACcx.js";import"./CopyButton-U3SFd-HD.js";function H({items:s}){const[a,o]=r.useState(b);return e.jsx("div",{className:"flex gap-2",role:"radiogroup","aria-label":"Theme",children:s.map(t=>e.jsxs("button",{type:"button",role:"radio","aria-checked":a===t.value,onClick:()=>{N(t.value),o(t.value)},className:y("inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12.5px] font-medium text-ink-soft",a===t.value&&"border-line-strong bg-muted text-foreground"),children:[t.icon,t.label]},t.value))})}function de(){const s=M(),a=F(),[o,t]=r.useState(s.user.name),[u,i]=r.useState(null);r.useEffect(()=>t(s.user.name),[s.user.name]);const m=o.trim()!==s.user.name;return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(C,{title:"You",sub:"Your own account on this studio",actions:e.jsx(A,{saving:a.isPending,savedAt:u})}),e.jsxs(h,{title:"Profile",description:"How you appear on replies and in the members list.",children:[e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:l=>{l.preventDefault(),m&&a.mutate(o.trim(),{onSuccess:()=>i(Date.now())})},children:[e.jsx(c,{htmlFor:"your-name",children:"Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{id:"your-name",value:o,onChange:l=>t(l.target.value)}),m&&e.jsx(j,{type:"submit",variant:"outline",children:"Save"})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"your-email",children:"Email"}),e.jsx(d,{id:"your-email",value:s.user.email,readOnly:!0,className:"bg-muted text-ink-soft"}),e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:["How you sign in, and how the server finds you. An owner changes it with"," ",e.jsx("code",{className:"font-mono",children:"snagset passwd"}),"."]})]})]}),e.jsx(h,{title:"Password",description:"Changing it keeps this session and ends every other one.",children:e.jsx(L,{})}),!f(s.user.role,"settings")&&f(s.user.role,"review")&&e.jsx(k,{owner:!0,mine:!0,instanceOwner:!1,operator:S(s),sites:s.projects}),e.jsx(h,{title:"Appearance",description:"Also in your menu at the bottom of the sidebar.",children:e.jsx(H,{items:[{value:"system",label:"System",icon:e.jsx(T,{className:"size-3.5"})},{value:"light",label:"Light",icon:e.jsx(z,{className:"size-3.5"})},{value:"dark",label:"Dark",icon:e.jsx(D,{className:"size-3.5"})}]})})]})}function L(){const s=E(),[a,o]=r.useState(""),[t,u]=r.useState(""),[i,m]=r.useState(""),[l,g]=r.useState(""),[w,p]=r.useState(!1),x=a.length>0&&t.length>=12&&t===i;return e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:async n=>{if(n.preventDefault(),!(!x||s.isPending)){g("");try{await s.mutateAsync({current:a,next:t}),o(""),u(""),m(""),p(!0)}catch(v){g(P(v))}}},children:[l&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:l}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"pw-current",children:"Current password"}),e.jsx(d,{id:"pw-current",type:"password",autoComplete:"current-password",value:a,onChange:n=>{o(n.target.value),p(!1)}})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"pw-next",children:"New password"}),e.jsx(d,{id:"pw-next",type:"password",autoComplete:"new-password",value:t,onChange:n=>{u(n.target.value),p(!1)}}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. No composition rules — length is what matters."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"pw-again",children:"Confirm new password"}),e.jsx(d,{id:"pw-again",type:"password",autoComplete:"new-password",value:i,onChange:n=>{m(n.target.value),p(!1)}}),i.length>0&&t!==i&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Those do not match yet."})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(j,{type:"submit",loading:s.isPending,disabled:!x,children:s.isPending?"Changing…":w&&!x?"Changed":"Change password"})})]})}export{de as component};
@@ -1 +1 @@
1
- import{a_ as V}from"./index-CUBD0DcL.js";var Fe=e=>e.type==="checkbox",Oe=e=>e.type==="file",fe=e=>e instanceof Date,q=e=>e==null;const Ge=e=>typeof e=="object";var P=e=>!q(e)&&!Array.isArray(e)&&Ge(e)&&!fe(e),Pe=e=>P(e)&&e.target?Fe(e.target)?e.target.checked:Oe(e.target)?e.target.files:e.target.value:e;const rr=/[.[\]'"]/;var de=e=>e.split(rr).filter(Boolean);function sr(e,s){const t=de(s);let i=e._formValues,n=e._defaultValues;for(let o=0;o<t.length-1;o++){const l=t[o];if(i=i==null?i:i[l],n=n==null?n:n[l],i===null||n===null)return null}}var St=(e,s)=>s.split(".").some((t,i,n)=>!isNaN(Number(t))&&e.has(n.slice(0,i).join("."))),Se=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function I(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);const s=typeof FileList<"u"&&e instanceof FileList;if(Se&&(e instanceof Blob||s))return e;const t=Array.isArray(e);if(!t&&e.constructor!==Object)return e;const i=t?[]:Object.create(Object.getPrototypeOf(e));for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=I(e[n]));return i}const le={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},ne={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ie={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Rt="root",ze=["__proto__","constructor","prototype"],ir=/^\w*$/;var ye=e=>ir.test(e),p=e=>e===void 0,y=(e,s,t)=>{if(!s||!P(e))return t;const i=ye(s)?[s]:de(s);if(i.some(o=>ze.includes(o)))return t;const n=i.reduce((o,l)=>q(o)?void 0:o[l],e);return p(n)||n===e?p(e[s])?t:e[s]:n},X=e=>typeof e=="boolean",Y=e=>typeof e=="function",T=(e,s,t)=>{let i=-1;const n=ye(s)?[s]:de(s),o=n.length,l=o-1;for(;++i<o;){const f=n[i];let m=t;if(i!==l){const F=e[f];m=P(F)||Array.isArray(F)?F:isNaN(+n[i+1])?{}:[]}if(ze.includes(f))return;e[f]=m,e=e[f]}};const Tt=V.createContext(null);Tt.displayName="HookFormControlContext";const Ye=()=>V.useContext(Tt);var pt=(e,s,t,i=!0)=>{const n={};for(const o in e)Object.defineProperty(n,o,{get:()=>{const l=o;return s._proxyFormState[l]!==ne.all&&(s._proxyFormState[l]=!i||ne.all),t&&(t[l]=!0),e[l]}});return n};const Ke=Se?V.useLayoutEffect:V.useEffect;var nr=e=>{const s=e.constructor&&e.constructor.prototype;return P(s)&&s.hasOwnProperty("isPrototypeOf")},Be=e=>q(e)||!Ge(e);const yt=(e,s)=>s.length===0&&!Array.isArray(e)&&!nr(e);function J(e,s,t=new WeakMap){if(e===s)return!0;if(Be(e)||Be(s))return Object.is(e,s);if(fe(e)&&fe(s))return Object.is(e.getTime(),s.getTime());const i=Object.keys(e),n=Object.keys(s);if(i.length!==n.length)return!1;if(yt(e,i)||yt(s,n))return Object.is(e,s);if(!i.length&&Array.isArray(e)!==Array.isArray(s))return!1;const o=t.get(e);if(o&&o.has(s))return!0;if(o)o.add(s);else{const l=new WeakSet;l.add(s),t.set(e,l)}for(const l of i){const f=e[l];if(!(l in s))return!1;if(l!=="ref"){const m=s[l];if(fe(f)&&fe(m)||(P(f)||Array.isArray(f))&&(P(m)||Array.isArray(m))?!J(f,m,t):!Object.is(f,m))return!1}}return!0}function Ze(e){const s=V.useRef(!1),t=V.useRef(!1),i=V.useRef(void 0),n=V.useRef(0);n.current++,!t.current&&e&&(t.current=!0,i.current=I(e()));const o=V.useCallback((f,m,F)=>{if(f&&(s.current||t.current&&n.current>1)){const C=m();J(i.current,C)||F(C)}s.current=!0},[]),l=V.useCallback((f,m)=>{f&&(i.current=I(m()))},[]);return{resyncIfNeeded:o,snapshot:l}}function ar(e){const s=Ye(),{control:t=s,disabled:i,name:n,exact:o}=e||{},l=()=>({...t._formState,defaultValues:t._defaultValues}),[f,m]=V.useState(l),F=V.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:C,snapshot:O}=Ze(l);return Ke(()=>{C(!i,l,m);const N=t._subscribe({name:n,formState:F.current,exact:o,callback:L=>{!i&&m({...t._formState,...L,defaultValues:t._defaultValues})}});return()=>{N(),O(!i,l)}},[n,i,o,C,O]),V.useEffect(()=>{F.current.isValid&&t._setValid(!0)},[t]),V.useMemo(()=>pt(f,t,F.current,!1),[f,t])}var H=e=>typeof e=="string",$e=(e,s,t,i,n)=>H(e)?(i&&s.watch.add(e),y(t,e,n)):Array.isArray(e)?e.map(o=>(i&&s.watch.add(o),y(t,o,y(n,o)))):(i&&(s.watchAll=!0),t);function ur(e){const s=Ye(),{control:t=s,name:i,defaultValue:n,disabled:o,exact:l,compute:f}=e||{},m=V.useRef(n),F=V.useRef(f),C=V.useRef(void 0),O=V.useRef(t),N=V.useRef(i);F.current=f;const L=()=>{const j=t._getWatch(i,m.current);return F.current?F.current(j):j},[w,x]=V.useState(L),A=V.useCallback(j=>{const W=$e(i,t._names,j||t._formValues,!1,m.current);return F.current?F.current(W):W},[t._formValues,t._names,i]),te=V.useCallback(j=>{if(!o){const W=$e(i,t._names,j||t._formValues,!1,m.current);if(F.current){const oe=F.current(W);J(oe,C.current)||(x(oe),C.current=oe)}else x(W)}},[t._formValues,t._names,o,i]),{resyncIfNeeded:k,snapshot:z}=Ze(L),E=V.useRef(te);E.current=te;const D=V.useRef(A);D.current=A,Ke(()=>{O.current!==t||!J(N.current,i)?(O.current=t,N.current=i,E.current()):k(!o,()=>D.current(),W=>{x(W),C.current=W});const j=t._subscribe({name:i,formState:{values:!0},exact:l,callback:W=>{E.current(W.values)}});return()=>{j(),z(!o,()=>D.current())}},[t,l,i,o,k,z]),V.useEffect(()=>t._removeUnmounted());const $=O.current!==t,ae=N.current;return V.useMemo(()=>{if(o)return!1;const j=!$&&!J(ae,i);return $||j},[o,$,i,ae])?A():w}function or(e){const s=Ye(),{name:t,disabled:i,control:n=s,shouldUnregister:o,defaultValue:l,exact:f=!0}=e,m=St(n._names.array,t),F=V.useMemo(()=>{const E=y(n._formValues,t,y(n._defaultValues,t,l));return p(E)?sr(n,t):E},[n,t,l]),C=ur({control:n,name:t,defaultValue:F,exact:f}),O=ar({control:n,name:t,exact:f}),N=V.useRef(e),L=V.useRef(null),w=V.useRef(n.register(t,{...e.rules,value:C,...X(e.disabled)?{disabled:e.disabled}:{}}));N.current=e;const x=V.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!y(O.errors,t)},isDirty:{enumerable:!0,get:()=>!!y(O.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!y(O.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!y(O.validatingFields,t)},error:{enumerable:!0,get:()=>y(O.errors,t)}}),[O,t]),A=V.useCallback(E=>{const D=Pe(E);return y(n._fields,t)||(w.current=n.register(t,{...N.current.rules,value:D})),w.current.onChange({target:{value:Pe(E),name:t},type:le.CHANGE})},[t,n]),te=V.useCallback(()=>w.current.onBlur({target:{value:y(n._formValues,t),name:t},type:le.BLUR}),[t,n._formValues]),k=V.useCallback(E=>{E&&(L.current={focus:()=>Y(E.focus)&&E.focus(),select:()=>Y(E.select)&&E.select(),setCustomValidity:$=>Y(E.setCustomValidity)&&E.setCustomValidity($),reportValidity:()=>Y(E.reportValidity)&&E.reportValidity()});const D=y(n._fields,t);D&&D._f&&E&&(D._f.ref=L.current)},[n._fields,t]),z=V.useMemo(()=>({name:t,value:C,...X(i)||O.disabled?{disabled:O.disabled||i}:{},onChange:A,onBlur:te,ref:k}),[t,i,O.disabled,A,te,k,C]);return V.useEffect(()=>{const E=n._options.shouldUnregister||o;w.current=n.register(t,{...N.current.rules,...X(N.current.disabled)?{disabled:N.current.disabled}:{}});const D=($,ae)=>{const ue=y(n._fields,$);ue&&ue._f&&(ue._f.mount=ae)};if(D(t,!0),E){const $=I(y(o?n._defaultValues:n._options.values||n._defaultValues,t,y(n._options.defaultValues,t,N.current.defaultValue)));T(n._defaultValues,t,$),p(y(n._formValues,t))&&T(n._formValues,t,$)}if(!m&&n.register(t),L.current){const $=y(n._fields,t);$&&$._f&&($._f.ref=L.current)}return()=>{(m?E&&!n._state.action:E)?n.unregister(t):D(t,!1)}},[t,n,m,o]),V.useEffect(()=>{n._setDisabledField({disabled:i,name:t})},[i,t,n]),V.useMemo(()=>({field:z,formState:O,fieldState:x}),[z,O,x])}const Tr=e=>e.render(or(e));var De=e=>({isOnSubmit:!e||e===ne.onSubmit,isOnBlur:e===ne.onBlur,isOnChange:e===ne.onChange,isOnAll:e===ne.all,isOnTouch:e===ne.onTouched}),Le=(e,s,t)=>{if(t)return!1;if(s.watchAll||s.watch.has(e))return!0;for(const i of s.watch)if(e.startsWith(i)&&e.charAt(i.length)===".")return!0;return!1};const Ae=(e,s,t,i)=>{for(const n of t||Object.keys(e)){if(n==="_f")continue;const o=t?y(e,n):e[n];if(o){const{_f:l}=o;if(l){if(l.refs&&l.refs[0]&&s(l.refs[0],n)&&!i)return!0;if(l.ref&&s(l.ref,l.name)&&!i)return!0;if(Ae(o,s))break}else if((P(o)||Array.isArray(o))&&Ae(o,s))break}}};var ht=(e,s,t)=>{const i=y(e,t),n=Array.isArray(i)?i:[];return T(n,Rt,s[t]),T(e,t,n),e},G=e=>P(e)&&!Object.keys(e).length,ke=e=>{if(!Se)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},Je=e=>e.type==="radio",Ce=e=>e instanceof RegExp,Qe=(e,s,t,i,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[i]:n||!0}}:{};const gt={value:!1,isValid:!1},vt={value:!0,isValid:!0};var Nt=e=>{if(!Array.isArray(e))return gt;if(e.length>1){const t=e.filter(i=>i&&i.checked&&!i.disabled).map(i=>i.value);return{value:t,isValid:!!t.length}}const s=e[0];return!s||!s.checked||s.disabled?gt:!s.attributes||!("value"in s.attributes)||p(s.value)||s.value===""?vt:{value:s.value,isValid:!0}};const _t={isValid:!1,value:null};var It=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,_t):_t;function mt(e,s,t="validate"){if(H(e)||Array.isArray(e)&&e.every(H)||X(e)&&!e)return{type:t,message:H(e)?e:"",ref:s}}var he=e=>P(e)&&!Ce(e)?e:{value:e,message:""},Vt=async(e,s,t,i,n,o)=>{const{ref:l,refs:f,required:m,maxLength:F,minLength:C,min:O,max:N,pattern:L,validate:w,name:x,valueAsNumber:A,mount:te}=e._f,k=y(t,x);if(!te||s.has(x))return{};const z=f?f[0]:l,E=S=>{if(n&&z.reportValidity){const R=X(S)?"":S||"";f?f.forEach(U=>U.setCustomValidity(R)):z.setCustomValidity(R),z.reportValidity()}},D={},$=Je(l),ae=Fe(l),ue=$||ae,j=(A||Oe(l))&&p(l.value)&&p(k)||ke(l)&&l.value===""||k===""||Array.isArray(k)&&!k.length,W=Qe.bind(null,x,i,D),oe=(S,R,U,K=ie.maxLength,re=ie.minLength)=>{const Z=S?R:U;D[x]={type:S?K:re,message:Z,ref:l,...W(S?K:re,Z)}};if(o?!Array.isArray(k)||!k.length:m&&(!ue&&(j||q(k))||X(k)&&!k||ae&&!Nt(f).isValid||$&&!It(f).isValid)){const{value:S,message:R}=H(m)?{value:!!m,message:m}:he(m);if(S&&(D[x]={type:ie.required,message:R,ref:z,...W(ie.required,R)},!i))return E(R),D}if(!j&&(!q(O)||!q(N))){let S,R;const U=he(N),K=he(O);if(!q(k)&&!fe(k)&&!isNaN(k)){const re=l.valueAsNumber||k&&+k;q(U.value)||(S=re>U.value),q(K.value)||(R=re<K.value)}else{const re=l.valueAsDate||new Date(k),Z=ve=>new Date(new Date().toDateString()+" "+ve),Ee=l.type=="time",ee=l.type=="week";H(U.value)&&k&&(S=Ee?Z(k)>Z(U.value):ee?k>U.value:re>new Date(U.value)),H(K.value)&&k&&(R=Ee?Z(k)<Z(K.value):ee?k<K.value:re<new Date(K.value))}if((S||R)&&(oe(!!S,U.message,K.message,ie.max,ie.min),!i))return E(D[x].message),D}if((F||C)&&!j&&(H(k)||o&&Array.isArray(k))){const S=he(F),R=he(C),U=!q(S.value)&&k.length>+S.value,K=!q(R.value)&&k.length<+R.value;if((U||K)&&(oe(U,S.message,R.message),!i))return E(D[x].message),D}if(L&&!j&&H(k)){const{value:S,message:R}=he(L);if(Ce(S)&&!k.match(S)&&(D[x]={type:ie.pattern,message:R,ref:l,...W(ie.pattern,R)},!i))return E(R),D}if(w){if(Y(w)){const S=await w(k,t),R=mt(S,z);if(R&&(D[x]={...R,...W(ie.validate,R.message)},!i))return E(R.message),D}else if(P(w)){let S={};for(const R in w){if(!G(S)&&!i)break;const U=mt(await w[R](k,t),z,R);U&&(S={...U,...W(R,U.message)},E(U.message),i&&(D[x]=S))}if(!G(S)&&(D[x]={ref:z,...S},!i))return D}}const ge=D[x];return E(ge?ge.message:!0),D},xe=e=>Array.isArray(e)?e:[e],Lt=e=>Array.isArray(e)?e.filter(Boolean):[];function lr(e,s){const t=s.length-1;let i=0;for(;i<t;){if(q(e)){e=void 0;break}e=e[s[i]],i++}return e}function fr(e){for(const s in e)if(e.hasOwnProperty(s)&&!p(e[s]))return!1;return!0}function B(e,s){if(H(s)&&Object.prototype.hasOwnProperty.call(e,s))return delete e[s],e;const t=Array.isArray(s)?s:ye(s)?[s]:de(s);if(t.some(l=>ze.includes(String(l))))return e;const i=t.length===1?e:lr(e,t),n=t.length-1,o=t[n];return i&&delete i[o],n!==0&&(P(i)&&G(i)||Array.isArray(i)&&fr(i))&&B(e,t.slice(0,-1)),e}const cr=V.createContext(null);cr.displayName="HookFormContext";var bt=()=>{let e=[];return{get observers(){return e},next:n=>{for(const o of e)o.next&&o.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(o=>o!==n)}}),unsubscribe:()=>{e=[]}}};function Ut(e,s){const t={};for(const i in e)if(e.hasOwnProperty(i)){const n=e[i],o=s[i];if(n&&P(n)&&o){const l=Ut(n,o);P(l)&&(t[i]=l)}else e[i]&&(t[i]=o)}return t}const At=(e,s)=>e!==null&&Ge(e)&&Object.prototype.hasOwnProperty.call(e,s);var dr=(e,s)=>{if(!s)return!1;let t=e;for(const i of ye(s)?[s]:de(s)){if(!At(t,i))return At(e,s);t=t[i]}return!0},Mt=e=>e.type==="select-multiple",yr=e=>Je(e)||Fe(e),Ue=e=>ke(e)&&e.isConnected;function Ft(e){return Array.isArray(e)||P(e)}function Pt(e,s,t="",i=[]){for(const n in e){const o=t?`${t}.${n}`:n,l=e[n];Ft(l)&&Ft(y(s,o))?Pt(l,s,o,i):i.push(o)}return i}var hr=e=>{for(const s in e)if(Y(e[s]))return!0;return!1};function Bt(e){return Array.isArray(e)||P(e)&&!hr(e)}function $t(e){return!!(e&&"_f"in e)}function Wt(e){return Array.isArray(e)?!e.some(s=>!p(s)):!Object.keys(e).length}function We(e,s){Array.isArray(e)?e[s]=void 0:delete e[s]}function qe(e,s={},t){for(const i in e){const n=e[i],o=t&&t[i];Bt(n)&&(!Array.isArray(n)||!$t(o))?(s[i]=Array.isArray(n)?[]:{},qe(n,s[i],o),Wt(s[i])&&We(s,i)):p(n)||(s[i]=!0)}return s}function ce(e,s,t,i){t||(t=qe(s,{},i));for(const n in e){const o=e[n],l=i&&i[n];Bt(o)&&(!Array.isArray(o)||!$t(l))?(p(s)||Be(t[n])?t[n]=qe(o,Array.isArray(o)?[]:{},l):ce(o,q(s)?{}:s[n],t[n],l),Wt(t[n])&&We(t,n)):J(o,s[n])?We(t,n):t[n]=!0}return t}var gr=(e,s)=>{const t=s.split("."),i=[];let n=t[0];for(let o=1;o<t.length;n+="."+t[o++])!isNaN(+t[o])&&e.has(n)&&i.push(`${n}.${t[o]}`);return i},qt=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:i})=>p(e)?e:s?e===""?NaN:e&&+e:t&&H(e)?new Date(e):i?i(e):e;function Et(e){const s=e.ref;return Oe(s)?s.files:Je(s)?It(e.refs).value:Mt(s)?[...s.selectedOptions].map(({value:t})=>t):Fe(s)?Nt(e.refs).value:qt(s.value,e)}var vr=(e,s,t,i)=>{const n={};for(const o of e){const l=y(s,o);l&&T(n,o,l._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:i}},be=e=>p(e)?e:Ce(e)?e.source:P(e)?Ce(e.value)?e.value.source:e.value:e;const wt="AsyncFunction";var _r=e=>{if(!e||!e.validate)return!1;if(Y(e.validate))return e.validate.constructor.name===wt;if(P(e.validate)){for(const s in e.validate)if(e.validate[s].constructor.name===wt)return!0}return!1},mr=e=>e.mount&&(e.required||!p(e.required)&&e.required!==!1||!p(e.min)||!p(e.max)||!p(e.maxLength)||!p(e.minLength)||e.pattern||e.validate);function Dt(e,s,t){const i=y(e,t);if(i||ye(t))return{error:i,name:t};const n=t.split(".");for(;n.length;){const o=n.join("."),l=y(s,o),f=y(e,o);if(l&&!Array.isArray(l)&&t!==o)return{name:t};if(f&&f.type)return{name:o,error:f};if(f&&f.root&&f.root.type)return{name:`${o}.root`,error:f.root};n.pop()}return{name:t}}var Vr=(e,s,t,i)=>{t(e);const n=Object.keys(e).filter(o=>o!=="name");return!n.length||i&&n.length>=Object.keys(s).length||n.find(o=>s[o]===(!i||ne.all))},br=(e,s,t)=>!e||!s||e===s||xe(e).some(i=>i&&(t?i===s||i.startsWith(s+"."):i.startsWith(s)||s.startsWith(i))),Ar=(e,s,t,i,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(s||e):(t?i.isOnBlur:n.isOnBlur)?!e:(t?i.isOnChange:n.isOnChange)?e:!0,Fr=(e,s)=>{const t=y(e,s);!Lt(t).length&&!t?.root&&B(e,s)};const Er={mode:ne.onSubmit,reValidateMode:ne.onChange,shouldFocusError:!0},Me="form",wr=(e,s)=>{for(const t in e)t in s||delete e[t];Object.assign(e,s)},Ht={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Dr(e={}){let s={...Er,...e},t={...I(Ht),isLoading:Y(s.defaultValues),errors:s.errors||{},disabled:s.disabled||!1},i={},n=P(s.defaultValues)||P(s.values)?I(s.defaultValues||s.values)||{}:{},o=s.shouldUnregister?{}:I(n),l={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},f={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const m={},F={};let C=0,O=De(s.mode),N=De(s.reValidateMode);const L={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},w={...L};let x={...w};const A={array:bt(),state:bt()};let te=0;const k=s.criteriaMode===ne.all,z=(r,u)=>a=>{clearTimeout(F[r]),F[r]=setTimeout(u,a)},E=async r=>{if(!l.keepIsValid&&!s.disabled&&(w.isValid||x.isValid||r)){const u=++te;let a;s.resolver?(a=G((await U()).errors),u===te&&D()):a=await Z({fields:i,onlyCheckValid:!0,eventType:le.VALID}),u===te&&a!==t.isValid&&A.state.next({isValid:a})}},D=(r,u)=>{!s.disabled&&(w.isValidating||w.validatingFields||x.isValidating||x.validatingFields)&&((r||f.mount).forEach(a=>{a&&(u?T(t.validatingFields,a,u):B(t.validatingFields,a))}),A.state.next({validatingFields:t.validatingFields,isValidating:!G(t.validatingFields)}))},$=()=>{t.dirtyFields=ce(n,o,void 0,i)},ae=(r,u=[],a,c,d=!0,h=!0)=>{if(c&&a&&!s.disabled){l.action=!0;const g=y(i,r);if(l.actionArrayLengths.has(r)||l.actionArrayLengths.set(r,Array.isArray(g)?g.length:0),h&&Array.isArray(g)){const b=a(g,c.argA,c.argB);d&&T(i,r,b)}const v=y(t.errors,r);if(h&&Array.isArray(v)){const b=v.root,M=a(v,c.argA,c.argB)||v;b&&(M.root=b),d&&T(t.errors,r,M),Fr(t.errors,r)}const _=y(t.touchedFields,r);if((w.touchedFields||x.touchedFields)&&h&&Array.isArray(_)){const b=a(_,c.argA,c.argB);d&&T(t.touchedFields,r,b)}(w.dirtyFields||x.dirtyFields)&&$(),A.state.next({name:r,isDirty:ee(r,u),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else T(o,r,u)},ue=(r,u)=>{T(t.errors,r,u),t.errors={...t.errors},A.state.next({errors:t.errors})},j=r=>{t.errors=r,A.state.next({errors:t.errors,isValid:!1})},W=r=>{const u=ye(r)?[r]:de(r);let a=o,c=n;for(let d=0;d<u.length-1;d++){const h=u[d];if(a=q(a)?a:a[h],c=q(c)?c:c[h],a===null&&c!==null)return!0}return!1},oe=r=>{if(!l.actionArrayLengths.size)return!1;const u=ye(r)?[r]:de(r);let a=o,c="",d=-1,h=0;for(let g=0;g<u.length;g++){if(q(a))return!1;const v=u[g];if(c=c?`${c}.${v}`:v,Array.isArray(a)&&+v>=a.length)return d===-1?!1:g===d?+v<h:!0;l.actionArrayLengths.has(c)&&(d=g+1,h=l.actionArrayLengths.get(c)),a=a[v]}return!1},ge=(r,u,a,c)=>{const d=y(i,r);if(d){if(W(r)||oe(r))return;const h=p(y(o,r)),g=y(o,r,p(a)?y(n,r):a);p(g)||c&&c.defaultChecked||u?T(o,r,u?g:Et(d._f)):Re(r,g),l.mount&&!l.action&&(E(),h&&t.isDirty&&(w.isDirty||x.isDirty)&&(ee()||(t.isDirty=!1,A.state.next({...t}))),e.shouldUnregister&&h&&!p(y(o,r))&&Le(r,f)&&(l.watch=!0))}},S=(r,u,a,c,d)=>{let h=!1,g=!1;const v={name:r};if(!s.disabled||c===!0){if(!a||c){const _=J(y(n,r),u);(w.isDirty||x.isDirty)&&(g=t.isDirty,t.isDirty=v.isDirty=!_||ee(),h=g!==v.isDirty),g=!!y(t.dirtyFields,r),_!==t.isDirty?wr(t.dirtyFields,ce(n,o,void 0,i)):_?B(t.dirtyFields,r):T(t.dirtyFields,r,!0),v.dirtyFields=t.dirtyFields,h=h||(w.dirtyFields||x.dirtyFields)&&g!==!_}if(a){const _=y(t.touchedFields,r);_||(T(t.touchedFields,r,a),v.touchedFields=t.touchedFields,h=h||(w.touchedFields||x.touchedFields)&&_!==a)}h&&d&&A.state.next(v)}return h?v:{}},R=(r,u,a,c)=>{const d=y(t.errors,r),h=(w.isValid||x.isValid)&&X(u)&&t.isValid!==u;if(s.delayError&&a?(m[r]=z(r,()=>ue(r,a)),m[r](s.delayError)):(clearTimeout(F[r]),delete m[r],a?T(t.errors,r,a):B(t.errors,r),t.errors={...t.errors}),(a?!J(d,a):d)||!G(c)||h){const g={...c,...h&&X(u)?{isValid:u}:{},errors:t.errors,name:r};A.state.next(g)}},U=async r=>(D(r,!0),await s.resolver(o,s.context,vr(r||f.mount,i,s.criteriaMode,s.shouldUseNativeValidation))),K=async r=>{const{errors:u}=await U(r);if(D(r),r){for(const a of r){const c=y(u,a);c?f.array.has(a)&&P(c)&&!Object.keys(c).some(d=>!Number.isNaN(Number(d)))?ht(t.errors,{[a]:c},a):T(t.errors,a,c):B(t.errors,a)}t.errors={...t.errors}}else t.errors=u;return u},re=async({name:r,eventType:u})=>{if(e.validate){const a=await e.validate({formValues:o,formState:t,name:r,eventType:u});if(P(a))for(const c in a){const d=a[c];d&&we(`${Me}.${c}`,{message:H(d.message)?d.message:"",type:d.type||ie.validate})}else H(a)||!a?we(Me,{message:a||"",type:ie.validate}):it(Me);return a}return!0},Z=async({fields:r,onlyCheckValid:u,name:a,eventType:c,context:d={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(d.runRootValidation=!0,!await re({name:a,eventType:c})&&(d.valid=!1,u)))return d.valid;for(const h in r){const g=r[h];if(g){const{_f:v,..._}=g;if(v){const b=f.array.has(v.name),M=g._f&&_r(g._f),Q=w.validatingFields||w.isValidating||x.validatingFields||x.isValidating;M&&Q&&D([v.name],!0);const se=await Vt(g,f.disabled,o,k,s.shouldUseNativeValidation&&!u,b);if(M&&Q&&D([v.name]),se[v.name]&&(d.valid=!1,u)||(!u&&(y(se,v.name)?b?ht(t.errors,se,v.name):T(t.errors,v.name,se[v.name]):B(t.errors,v.name)),e.shouldUseNativeValidation&&se[v.name]))break}!G(_)&&await Z({context:d,onlyCheckValid:u,fields:_,name:h,eventType:c})}}return d.valid},Ee=()=>{for(const r of f.unMount){const u=y(i,r);u&&(u._f.refs?u._f.refs.every(a=>!Ue(a)):!Ue(u._f.ref))&&pe(r)}f.unMount=new Set},ee=(r,u)=>(r&&u&&T(o,r,u),!J(l.mount?o:n,n)),ve=(r,u,a)=>$e(r,f,{...l.mount?o:p(u)||H(r)?n:u},a,u),jt=r=>Lt(y(l.mount?o:n,r,s.shouldUnregister?y(n,r,[]):[])),Re=(r,u,a={},c=!1,d=!1,h=!1)=>{const g=y(i,r);let v=u;if(g){const _=g._f;_&&(!_.disabled&&T(o,r,qt(u,_)),v=ke(_.ref)&&q(u)?"":u,Mt(_.ref)?[..._.ref.options].forEach(b=>b.selected=v.includes(b.value)):_.refs?Fe(_.ref)?_.refs.forEach(b=>{(!b.defaultChecked||!b.disabled)&&(Array.isArray(v)?b.checked=!!v.find(M=>M===b.value):b.checked=v===b.value||!!v)}):_.refs.forEach(b=>b.checked=b.value===v):Oe(_.ref)?_.ref.value="":(_.ref.value=v,!_.ref.type&&!d&&!h&&A.state.next({name:r,values:c?o:I(o)})))}(a.shouldDirty||a.shouldTouch)&&S(r,v,a.shouldTouch,a.shouldDirty,!d),a.shouldValidate&&Te(r,{delayError:a.delayError})},Xe=(r,u,a,c=!1,d=!1,h=!1)=>{f.array.has(r)&&A.array.next({name:r,values:c?o:I(o)});for(const g in u){if(!u.hasOwnProperty(g))continue;const v=u[g],_=r+"."+g,b=y(i,_);(f.array.has(r)||P(v)||b&&!b._f)&&!fe(v)?Xe(_,v,a,c,d,h):Re(_,v,a,c,d,h)}},et=(r,u,a,c,d=!1)=>{const h=y(i,r),g=f.array.has(r),v=c?u:I(u),_=y(o,r),b=J(_,v);if(b||T(o,r,v),g)A.array.next({name:r,values:c?o:I(o)}),(w.isDirty||w.dirtyFields||x.isDirty||x.dirtyFields)&&a.shouldDirty&&($(),d||A.state.next({name:r,dirtyFields:t.dirtyFields,isDirty:ee(r,v)}));else{const M=Array.isArray(v)&&!v.length||G(v),Q=!b&&!d;!h||h._f||q(v)||M?Re(r,v,a,c,d,Q):Xe(r,v,a,c,d,Q)}if(!b&&!d){const M=Le(r,f),Q=c?o:I(o);if(A.state.next({...M&&t,name:l.mount||M?r:void 0,values:Q}),!g)for(const se of gr(f.array,r))A.state.next({name:se,values:Q})}},_e=(r,u,a={})=>et(r,u,a,!1),Gt=(r,u={})=>{const a=Y(r)?r(o):r;if(!J(o,a)){o={...o,...a};for(const c of f.mount)dr(a,c)&&et(c,y(a,c),u,!0,!0);A.state.next({...t,name:void 0,type:void 0,...C?{values:o}:{}}),u.shouldValidate&&E()}},tt=async r=>{l.mount=!0;const u=r.target;let a=u.name,c=!0;const d=y(i,a),h=g=>{c=Number.isNaN(g)||fe(g)&&isNaN(g.getTime())||J(g,y(o,a,g))};if(d){let g,v;const _=u.type?Et(d._f):Pe(r),b=r.type===le.BLUR||r.type===le.FOCUS_OUT,M=!mr(d._f)&&!e.validate&&!s.resolver&&!y(t.errors,a)&&!d._f.deps,Q=M||Ar(b,y(t.touchedFields,a),t.isSubmitted,N,O),se=Le(a,f,b);if(T(o,a,I(_)),b){if(!u||!u.readOnly){d._f.onBlur&&d._f.onBlur(r);const Ve=m[a];Ve&&Ve(0)}}else d._f.onChange&&d._f.onChange(r);const me=S(a,_,b),er=!G(me)||se;if(!b&&A.state.next({name:a,type:r.type,...C?{values:I(o)}:{}}),Q)return(!M||!t.isValid)&&(w.isValid||x.isValid)&&(s.mode==="onBlur"?b&&E():b||E()),er&&A.state.next({name:a,...se?{}:me});if(!s.resolver&&e.validate&&await re({name:a,eventType:r.type}),!b&&se&&A.state.next({...t}),s.resolver){const{errors:Ve}=await U([a]);if(D([a]),h(_),!c){!G(me)&&A.state.next(me);return}const tr=Dt(t.errors,i,a),dt=Dt(Ve,i,tr.name||a);g=dt.error,a=dt.name,v=G(Ve)}else D([a],!0),g=(await Vt(d,f.disabled,o,k,s.shouldUseNativeValidation))[a],D([a]),h(_),c&&(g?v=!1:(w.isValid||x.isValid)&&(v=await Z({fields:i,onlyCheckValid:!0,name:a,eventType:r.type})));c&&(d._f.deps&&(!Array.isArray(d._f.deps)||d._f.deps.length>0)&&Te(d._f.deps),R(a,v,g,me))}},rt=(r,u)=>{if(y(t.errors,u)&&r.focus)return r.focus(),1},Te=async(r,u={})=>{let a,c;const d=xe(r);if(s.resolver){const h=await K(p(r)?r:d);a=G(h),c=r?!d.some(g=>y(h,g)):a}else r?(c=(await Promise.all(d.map(async h=>{const g=y(i,h);return await Z({fields:g&&g._f?{[h]:g}:g,eventType:le.TRIGGER})}))).every(Boolean),!(!c&&!t.isValid)&&E()):c=a=await Z({fields:i,name:r,eventType:le.TRIGGER});if(u.delayError&&s.delayError&&H(r)){const h=y(t.errors,r);h?(B(t.errors,r),m[r]=z(r,()=>ue(r,h)),m[r](s.delayError)):(clearTimeout(F[r]),delete m[r])}if(u.shouldTouch)for(const h of r?d:f.mount)!f.array.has(h)&&T(t.touchedFields,h,!0);return A.state.next({...!H(r)||(w.isValid||x.isValid)&&a!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:a}:{},...u.shouldTouch&&(w.touchedFields||x.touchedFields)?{touchedFields:t.touchedFields}:{},errors:t.errors}),u.shouldFocus&&!c&&Ae(i,rt,r?d:f.mount),c},zt=(r,u)=>{let a={...l.mount?o:n};return u&&(a=Ut(u.dirtyFields?t.dirtyFields:t.touchedFields,a)),p(r)?a:H(r)?y(a,r):r.map(c=>y(a,c))},Yt=r=>p(r)?{...t.errors}:H(r)?y(t.errors,r):r.map(u=>y(t.errors,u)),st=(r,u)=>{const a=u||t,c=y(a.errors,r);return{invalid:!!c,isDirty:!!y(a.dirtyFields,r),error:c,isValidating:!!y(t.validatingFields,r),isTouched:!!y(a.touchedFields,r)}},it=r=>{const u=r?xe(r):void 0;u?.forEach(a=>B(t.errors,a)),u?u.forEach(a=>{A.state.next({name:a,errors:t.errors})}):(t.errors={},A.state.next({errors:t.errors}))},we=(r,u,a)=>{const c=(y(i,r,{_f:{}})._f||{}).ref,d=y(t.errors,r)||{},{ref:h,message:g,type:v,..._}=d;T(t.errors,r,{..._,...u,ref:c}),A.state.next({name:r,errors:t.errors,isValid:!1}),a&&a.shouldFocus&&c&&c.focus&&c.focus()},Kt=(r,u)=>{if(Y(r)){C++;const{unsubscribe:a}=A.state.subscribe({next:d=>"values"in d&&r(d.values||ve(void 0,u),d)});let c=!1;return{unsubscribe:()=>{c||(c=!0,C--,a())}}}return ve(r,u,!0)},nt=r=>{var u;const a=!!(!((u=r.formState)===null||u===void 0)&&u.values);a&&C++;const{unsubscribe:c}=A.state.subscribe({next:h=>{if(br(r.name,h.name,r.exact)&&Vr(h,r.formState||w,ft,r.reRenderRoot)){const g={...o};r.callback({values:g,...t,...h,defaultValues:n})}}});if(!a)return c;let d=!1;return()=>{d||(d=!0,C--,c())}},Zt=r=>(l.mount=!0,x={...x,...r.formState},nt({...r,formState:{...L,...r.formState}})),pe=(r,u={})=>{for(const a of r?xe(r):f.mount)f.mount.delete(a),f.array.delete(a),u.keepValue||(B(i,a),B(o,a)),!u.keepError&&B(t.errors,a),!u.keepDirty&&B(t.dirtyFields,a),!u.keepTouched&&B(t.touchedFields,a),!u.keepIsValidating&&B(t.validatingFields,a),!s.shouldUnregister&&!u.keepDefaultValue&&B(n,a);C&&A.state.next({values:I(o)}),A.state.next({...t,...u.keepDirty?{}:{isDirty:ee()}}),!u.keepIsValid&&E()},at=({disabled:r,name:u})=>{if(X(r)&&l.mount||r||f.disabled.has(u)){const d=f.disabled.has(u)!==!!r;r?f.disabled.add(u):f.disabled.delete(u),d&&l.mount&&!l.action&&E()}},Ne=(r,u={})=>{let a=y(i,r);const c=X(u.disabled)||X(s.disabled),d=!f.registerName.has(r)&&a&&a._f&&!a._f.mount;return T(i,r,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:r}},name:r,mount:!0,...u}}),f.mount.add(r),a&&!d?at({disabled:X(u.disabled)?u.disabled:s.disabled,name:r}):ge(r,!0,u.value),{...c?{disabled:u.disabled||s.disabled}:{},...s.progressive?{required:!!u.required,min:be(u.min),max:be(u.max),minLength:be(u.minLength),maxLength:be(u.maxLength),pattern:be(u.pattern)}:{},name:r,onChange:tt,onBlur:tt,ref:h=>{if(h){f.registerName.add(r),Ne(r,u),f.registerName.delete(r),a=y(i,r);const g=p(h.value)&&h.querySelectorAll&&h.querySelectorAll("input,select,textarea")[0]||h,v=yr(g),_=a._f.refs||[];if(v?_.find(M=>M===g):g===a._f.ref)return;const b={...a._f};v?(b.refs=[..._.filter(Ue),g,...Array.isArray(y(n,r))?[{}]:[]],b.ref={type:g.type,name:r}):(b.ref=g,delete b.refs),T(i,r,{_f:b}),ge(r,!1,void 0,g)}else a=y(i,r,{}),a._f&&(a._f.mount=!1),(s.shouldUnregister||u.shouldUnregister)&&!(St(f.array,r)&&l.action)&&f.unMount.add(r)}}},Ie=()=>s.shouldFocusError&&!s.shouldUseNativeValidation&&Ae(i,rt,f.mount),Jt=r=>{X(r)&&(A.state.next({disabled:r}),Ae(i,(u,a)=>{const c=y(i,a);c&&(u.disabled=c._f.disabled||r,Array.isArray(c._f.refs)&&c._f.refs.forEach(d=>{d.disabled=c._f.disabled||r}))},0,!1))},ut=(r,u)=>async a=>{let c,d;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let h=I(o);if(A.state.next({isSubmitting:!0}),s.resolver){const{errors:g,values:v}=await U();D(),t.errors=g,h=I(v)}else await Z({fields:i,eventType:le.SUBMIT});if(f.disabled.size)for(const g of f.disabled)B(h,g);if(B(t.errors,Rt),G(t.errors)){A.state.next({errors:{}});try{c=await r(h,a)}catch(g){d=g}}else u&&await u({...t.errors},a),Ie(),setTimeout(Ie);if(A.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:G(t.errors)&&!d,submitCount:t.submitCount+1,errors:t.errors}),d)throw d;return c},Qt=(r,u={})=>{y(i,r)&&(p(u.defaultValue)?_e(r,I(y(n,r))):(_e(r,u.defaultValue),T(n,r,I(u.defaultValue))),u.keepTouched||B(t.touchedFields,r),u.keepDirty||(B(t.dirtyFields,r),t.isDirty=u.defaultValue?ee(r,I(y(n,r))):ee()),u.keepError||(B(t.errors,r),E()),A.state.next({...t}))},ot=(r,u={})=>{const a=r?I(r):n,c=I(a),d=G(r),h=c,g=i;if(u.keepDefaultValues||(n=a),!u.keepValues){if(u.keepDirtyValues){const v=new Set([...f.mount,...Pt(ce(n,o,void 0,g),t.dirtyFields)]);for(const _ of v){const b=y(t.dirtyFields,_),M=y(o,_),Q=y(h,_);b&&!p(M)?T(h,_,M):!b&&!p(Q)&&_e(_,Q)}}else{if(Se&&p(r))for(const v of f.mount){const _=y(i,v);if(_&&_._f){const b=Array.isArray(_._f.refs)?_._f.refs[0]:_._f.ref;if(ke(b)){const M=b.closest("form");if(M){M.reset();break}}}}if(u.keepFieldsRef)for(const v of f.mount)_e(v,y(h,v));else i={}}if(s.shouldUnregister){if(o=u.keepDefaultValues?I(n):{},u.keepFieldsRef)for(const v of f.mount)T(o,v,y(h,v))}else o=I(h);A.array.next({values:{...h}}),A.state.next({name:void 0,type:void 0,values:{...h}})}f={mount:u.keepDirtyValues?f.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!w.isValid||!!u.keepIsValid||!!u.keepDirtyValues||!s.shouldUnregister&&!G(h),l.watch=!!s.shouldUnregister,l.keepIsValid=!!u.keepIsValid,l.action=!1,l.actionArrayLengths.clear(),u.keepErrors||(t.errors={}),A.state.next({submitCount:u.keepSubmitCount?t.submitCount:0,isDirty:d?!1:u.keepDirty?t.isDirty:u.keepValues?ee():!!(u.keepDefaultValues&&!J(r,n)),isSubmitted:u.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:d?{}:u.keepDirtyValues?u.keepDefaultValues&&o?ce(n,o,void 0,g):t.dirtyFields:u.keepDefaultValues&&r?ce(n,r,void 0,g):u.keepDirty?t.dirtyFields:{},touchedFields:u.keepTouched?t.touchedFields:{},errors:u.keepErrors?t.errors:{},isSubmitSuccessful:u.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:n})},lt=(r,u)=>ot(Y(r)?r(o):r,{...s.resetOptions,...u}),Xt=(r,u={})=>{const a=y(i,r),c=a&&a._f;if(c){const d=c.refs?c.refs[0]:c.ref;d.focus&&setTimeout(()=>{d.focus(),u.shouldSelect&&Y(d.select)&&d.select()})}},ft=r=>{const{name:u,type:a,values:c,...d}=r;t={...t,...d}};A.state.subscribe({next:ft});const ct={control:{register:Ne,unregister:pe,getFieldState:st,handleSubmit:ut,setError:we,_subscribe:nt,_runSchema:U,_updateIsValidating:D,_focusError:Ie,_getWatch:ve,_getDirty:ee,_setValid:E,_setFieldArray:ae,_setDisabledField:at,_setErrors:j,_getFieldArray:jt,_reset:ot,_resetDefaultValues:()=>Y(s.defaultValues)&&s.defaultValues().then(r=>{lt(r,s.resetOptions),A.state.next({isLoading:!1})}),_removeUnmounted:Ee,_disableForm:Jt,_subjects:A,_proxyFormState:w,get _fields(){return i},get _formValues(){return o},get _state(){return l},set _state(r){l=r},get _defaultValues(){return n},get _names(){return f},set _names(r){f=r},get _formState(){return t},get _options(){return s},set _options(r){s={...s,...r},O=De(s.mode),N=De(s.reValidateMode)}},subscribe:Zt,trigger:Te,register:Ne,handleSubmit:ut,watch:Kt,setValue:_e,setValues:Gt,getValues:zt,getErrors:Yt,reset:lt,resetField:Qt,resetDefaultValues:(r,u={})=>{if(n=I(r),!u.keepDirty){const a=ce(n,o,void 0,i);t.dirtyFields=a,t.isDirty=!G(a)}u.keepIsValid||E(),A.state.next({...t,defaultValues:n})},clearErrors:it,unregister:pe,setError:we,setFocus:Xt,getFieldState:st};return{...ct,formControl:ct}}function pr(e={}){const s=V.useRef(void 0),t=V.useRef(void 0),i=V.useRef(e.formControl),[n,o]=V.useState(()=>({...I(Ht),isLoading:Y(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Y(e.defaultValues)?void 0:e.defaultValues}));if(!s.current||e.formControl&&i.current!==e.formControl)if(i.current=e.formControl,e.formControl)s.current={...e.formControl,formState:n},e.defaultValues&&!Y(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:F,...C}=Dr(e);s.current={...C,formState:n}}const l=s.current.control;l._options=e;const{resyncIfNeeded:f,snapshot:m}=Ze();return Ke(()=>{const F=()=>({...l._formState,defaultValues:l._defaultValues});f(!0,F,o);const C=l._subscribe({formState:l._proxyFormState,callback:()=>o({...l._formState,defaultValues:l._defaultValues}),reRenderRoot:!0});return o(O=>({...O,isReady:!0})),l._formState.isReady=!0,()=>{C(),m(!0,F)}},[l,f,m]),V.useEffect(()=>l._disableForm(e.disabled),[l,e.disabled]),V.useEffect(()=>{e.mode&&(l._options.mode=e.mode),e.reValidateMode&&(l._options.reValidateMode=e.reValidateMode)},[l,e.mode,e.reValidateMode]),V.useEffect(()=>{e.errors&&(l._setErrors(e.errors),l._focusError())},[l,e.errors]),V.useEffect(()=>{e.shouldUnregister&&l._subjects.state.next({values:l._getWatch()})},[l,e.shouldUnregister]),V.useEffect(()=>{if(l._proxyFormState.isDirty){const F=l._getDirty();F!==n.isDirty&&l._subjects.state.next({isDirty:F})}},[l,n.isDirty]),V.useEffect(()=>{var F;e.values&&!J(e.values,t.current)?(l._reset(e.values,{keepFieldsRef:!0,...l._options.resetOptions}),!((F=l._options.resetOptions)===null||F===void 0)&&F.keepIsValid||l._setValid(),t.current=e.values,o(C=>({...C}))):l._resetDefaultValues()},[l,e.values]),V.useEffect(()=>{l._state.mount||(l._setValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),s.current.formState=V.useMemo(()=>pt(n,l),[l,n]),s.current}const xt=(e,s,t)=>{if(e&&"reportValidity"in e){const i=y(t,s);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},He=(e,s)=>{for(const t in s.fields){const i=s.fields[t];i&&i.ref&&"reportValidity"in i.ref?xt(i.ref,t,e):i&&i.refs&&i.refs.forEach(n=>xt(n,t,e))}},kt=(e,s)=>{s.shouldUseNativeValidation&&He(e,s);const t={};for(const i in e){const n=y(s.fields,i),o=Object.assign(e[i]||{},{ref:n&&n.refs?n.refs[0]:n&&n.ref});if(xr(s.names||Object.keys(e),i)){const l=Object.assign({},y(t,i));T(l,"root",o),T(t,i,l)}else T(t,i,o)}return t},xr=(e,s)=>{const t=Ct(s).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(i=>Ct(i).match(`^${t}\\.\\d+`))};function Ct(e){return e.replace(/\[(\d+)]/g,".$1").replace(/[[\]]/g,"")}function je(){return je=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},je.apply(null,arguments)}function Ot(e,s){try{var t=e()}catch(i){return s(i)}return t&&t.then?t.then(void 0,s):t}function kr(e,s){for(var t=Object.create(null);e.length;){var i=e[0],n=i.code,o=i.message,l=i.path.join(".");if(!t[l])if("unionErrors"in i){var f,m,F=i.unionErrors.reduce(function(N,L){return L.errors.length<N.errors.length?L:N}).errors[0];t[l]={message:(f=F?.message)!=null?f:o,type:(m=F?.code)!=null?m:n}}else t[l]={message:o,type:n};if("unionErrors"in i&&i.unionErrors.forEach(function(N){return N.errors.forEach(function(L){return e.push(L)})}),s){var C=t[l].types,O=C&&C[i.code];t[l]=Qe(l,s,t,n,O?[].concat(O,i.message):i.message)}e.shift()}return t}function Cr(e,s){for(var t=Object.create(null),i=function(){var n=e[0],o=n.code,l=n.message,f=n.path.join(".");if(!t[f])if(n.code==="invalid_union"&&n.errors.length>0){var m,F,C=n.errors.reduce(function(L,w){return w.length<L.length?w:L})[0];t[f]={message:(m=C?.message)!=null?m:l,type:(F=C?.code)!=null?F:o}}else t[f]={message:l,type:o};if(n.code==="invalid_union"&&n.errors.forEach(function(L){return L.forEach(function(w){return e.push(je({},w,{path:[].concat(n.path,w.path)}))})}),s){var O=t[f].types,N=O&&O[n.code];t[f]=Qe(f,s,t,o,N?[].concat(N,n.message):n.message)}e.shift()};e.length;)i();return t}function Nr(e,s,t){if(t===void 0&&(t={}),(function(i){return"_zod"in i&&typeof i._zod=="object"})(e))return function(i,n,o){try{return Promise.resolve(Ot(function(){function l(m){return o.shouldUseNativeValidation&&He({},o),{errors:{},values:t.raw?Object.assign({},i):m}}var f=e;return t.mode==="sync"?l(f.parse(i,s)):Promise.resolve(f.parseAsync(i,s)).then(l)},function(l){if((function(f){var m;return!(f==null||(m=f._zod)==null||(m=m.traits)==null||!m.has("$ZodError"))})(l))return{values:{},errors:kt(Cr(l.issues,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw l}))}catch(l){return Promise.reject(l)}};if((function(i){return"_def"in i&&typeof i._def=="object"})(e))return function(i,n,o){try{return Promise.resolve(Ot(function(){return Promise.resolve(e[t.mode==="sync"?"parse":"parseAsync"](i,s)).then(function(l){return o.shouldUseNativeValidation&&He({},o),{errors:{},values:t.raw?Object.assign({},i):l}})},function(l){if((function(f){return Array.isArray(f?.issues)})(l))return{values:{},errors:kt(kr(l.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw l}))}catch(l){return Promise.reject(l)}};throw new Error("Invalid input: not a Zod schema")}export{Tr as C,Nr as a,pr as u};
1
+ import{a_ as V}from"./index-BC1mWQy8.js";var Fe=e=>e.type==="checkbox",Oe=e=>e.type==="file",fe=e=>e instanceof Date,q=e=>e==null;const Ge=e=>typeof e=="object";var P=e=>!q(e)&&!Array.isArray(e)&&Ge(e)&&!fe(e),Pe=e=>P(e)&&e.target?Fe(e.target)?e.target.checked:Oe(e.target)?e.target.files:e.target.value:e;const rr=/[.[\]'"]/;var de=e=>e.split(rr).filter(Boolean);function sr(e,s){const t=de(s);let i=e._formValues,n=e._defaultValues;for(let o=0;o<t.length-1;o++){const l=t[o];if(i=i==null?i:i[l],n=n==null?n:n[l],i===null||n===null)return null}}var St=(e,s)=>s.split(".").some((t,i,n)=>!isNaN(Number(t))&&e.has(n.slice(0,i).join("."))),Se=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function I(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);const s=typeof FileList<"u"&&e instanceof FileList;if(Se&&(e instanceof Blob||s))return e;const t=Array.isArray(e);if(!t&&e.constructor!==Object)return e;const i=t?[]:Object.create(Object.getPrototypeOf(e));for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=I(e[n]));return i}const le={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},ne={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ie={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Rt="root",ze=["__proto__","constructor","prototype"],ir=/^\w*$/;var ye=e=>ir.test(e),p=e=>e===void 0,y=(e,s,t)=>{if(!s||!P(e))return t;const i=ye(s)?[s]:de(s);if(i.some(o=>ze.includes(o)))return t;const n=i.reduce((o,l)=>q(o)?void 0:o[l],e);return p(n)||n===e?p(e[s])?t:e[s]:n},X=e=>typeof e=="boolean",Y=e=>typeof e=="function",T=(e,s,t)=>{let i=-1;const n=ye(s)?[s]:de(s),o=n.length,l=o-1;for(;++i<o;){const f=n[i];let m=t;if(i!==l){const F=e[f];m=P(F)||Array.isArray(F)?F:isNaN(+n[i+1])?{}:[]}if(ze.includes(f))return;e[f]=m,e=e[f]}};const Tt=V.createContext(null);Tt.displayName="HookFormControlContext";const Ye=()=>V.useContext(Tt);var pt=(e,s,t,i=!0)=>{const n={};for(const o in e)Object.defineProperty(n,o,{get:()=>{const l=o;return s._proxyFormState[l]!==ne.all&&(s._proxyFormState[l]=!i||ne.all),t&&(t[l]=!0),e[l]}});return n};const Ke=Se?V.useLayoutEffect:V.useEffect;var nr=e=>{const s=e.constructor&&e.constructor.prototype;return P(s)&&s.hasOwnProperty("isPrototypeOf")},Be=e=>q(e)||!Ge(e);const yt=(e,s)=>s.length===0&&!Array.isArray(e)&&!nr(e);function J(e,s,t=new WeakMap){if(e===s)return!0;if(Be(e)||Be(s))return Object.is(e,s);if(fe(e)&&fe(s))return Object.is(e.getTime(),s.getTime());const i=Object.keys(e),n=Object.keys(s);if(i.length!==n.length)return!1;if(yt(e,i)||yt(s,n))return Object.is(e,s);if(!i.length&&Array.isArray(e)!==Array.isArray(s))return!1;const o=t.get(e);if(o&&o.has(s))return!0;if(o)o.add(s);else{const l=new WeakSet;l.add(s),t.set(e,l)}for(const l of i){const f=e[l];if(!(l in s))return!1;if(l!=="ref"){const m=s[l];if(fe(f)&&fe(m)||(P(f)||Array.isArray(f))&&(P(m)||Array.isArray(m))?!J(f,m,t):!Object.is(f,m))return!1}}return!0}function Ze(e){const s=V.useRef(!1),t=V.useRef(!1),i=V.useRef(void 0),n=V.useRef(0);n.current++,!t.current&&e&&(t.current=!0,i.current=I(e()));const o=V.useCallback((f,m,F)=>{if(f&&(s.current||t.current&&n.current>1)){const C=m();J(i.current,C)||F(C)}s.current=!0},[]),l=V.useCallback((f,m)=>{f&&(i.current=I(m()))},[]);return{resyncIfNeeded:o,snapshot:l}}function ar(e){const s=Ye(),{control:t=s,disabled:i,name:n,exact:o}=e||{},l=()=>({...t._formState,defaultValues:t._defaultValues}),[f,m]=V.useState(l),F=V.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:C,snapshot:O}=Ze(l);return Ke(()=>{C(!i,l,m);const N=t._subscribe({name:n,formState:F.current,exact:o,callback:L=>{!i&&m({...t._formState,...L,defaultValues:t._defaultValues})}});return()=>{N(),O(!i,l)}},[n,i,o,C,O]),V.useEffect(()=>{F.current.isValid&&t._setValid(!0)},[t]),V.useMemo(()=>pt(f,t,F.current,!1),[f,t])}var H=e=>typeof e=="string",$e=(e,s,t,i,n)=>H(e)?(i&&s.watch.add(e),y(t,e,n)):Array.isArray(e)?e.map(o=>(i&&s.watch.add(o),y(t,o,y(n,o)))):(i&&(s.watchAll=!0),t);function ur(e){const s=Ye(),{control:t=s,name:i,defaultValue:n,disabled:o,exact:l,compute:f}=e||{},m=V.useRef(n),F=V.useRef(f),C=V.useRef(void 0),O=V.useRef(t),N=V.useRef(i);F.current=f;const L=()=>{const j=t._getWatch(i,m.current);return F.current?F.current(j):j},[w,x]=V.useState(L),A=V.useCallback(j=>{const W=$e(i,t._names,j||t._formValues,!1,m.current);return F.current?F.current(W):W},[t._formValues,t._names,i]),te=V.useCallback(j=>{if(!o){const W=$e(i,t._names,j||t._formValues,!1,m.current);if(F.current){const oe=F.current(W);J(oe,C.current)||(x(oe),C.current=oe)}else x(W)}},[t._formValues,t._names,o,i]),{resyncIfNeeded:k,snapshot:z}=Ze(L),E=V.useRef(te);E.current=te;const D=V.useRef(A);D.current=A,Ke(()=>{O.current!==t||!J(N.current,i)?(O.current=t,N.current=i,E.current()):k(!o,()=>D.current(),W=>{x(W),C.current=W});const j=t._subscribe({name:i,formState:{values:!0},exact:l,callback:W=>{E.current(W.values)}});return()=>{j(),z(!o,()=>D.current())}},[t,l,i,o,k,z]),V.useEffect(()=>t._removeUnmounted());const $=O.current!==t,ae=N.current;return V.useMemo(()=>{if(o)return!1;const j=!$&&!J(ae,i);return $||j},[o,$,i,ae])?A():w}function or(e){const s=Ye(),{name:t,disabled:i,control:n=s,shouldUnregister:o,defaultValue:l,exact:f=!0}=e,m=St(n._names.array,t),F=V.useMemo(()=>{const E=y(n._formValues,t,y(n._defaultValues,t,l));return p(E)?sr(n,t):E},[n,t,l]),C=ur({control:n,name:t,defaultValue:F,exact:f}),O=ar({control:n,name:t,exact:f}),N=V.useRef(e),L=V.useRef(null),w=V.useRef(n.register(t,{...e.rules,value:C,...X(e.disabled)?{disabled:e.disabled}:{}}));N.current=e;const x=V.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!y(O.errors,t)},isDirty:{enumerable:!0,get:()=>!!y(O.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!y(O.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!y(O.validatingFields,t)},error:{enumerable:!0,get:()=>y(O.errors,t)}}),[O,t]),A=V.useCallback(E=>{const D=Pe(E);return y(n._fields,t)||(w.current=n.register(t,{...N.current.rules,value:D})),w.current.onChange({target:{value:Pe(E),name:t},type:le.CHANGE})},[t,n]),te=V.useCallback(()=>w.current.onBlur({target:{value:y(n._formValues,t),name:t},type:le.BLUR}),[t,n._formValues]),k=V.useCallback(E=>{E&&(L.current={focus:()=>Y(E.focus)&&E.focus(),select:()=>Y(E.select)&&E.select(),setCustomValidity:$=>Y(E.setCustomValidity)&&E.setCustomValidity($),reportValidity:()=>Y(E.reportValidity)&&E.reportValidity()});const D=y(n._fields,t);D&&D._f&&E&&(D._f.ref=L.current)},[n._fields,t]),z=V.useMemo(()=>({name:t,value:C,...X(i)||O.disabled?{disabled:O.disabled||i}:{},onChange:A,onBlur:te,ref:k}),[t,i,O.disabled,A,te,k,C]);return V.useEffect(()=>{const E=n._options.shouldUnregister||o;w.current=n.register(t,{...N.current.rules,...X(N.current.disabled)?{disabled:N.current.disabled}:{}});const D=($,ae)=>{const ue=y(n._fields,$);ue&&ue._f&&(ue._f.mount=ae)};if(D(t,!0),E){const $=I(y(o?n._defaultValues:n._options.values||n._defaultValues,t,y(n._options.defaultValues,t,N.current.defaultValue)));T(n._defaultValues,t,$),p(y(n._formValues,t))&&T(n._formValues,t,$)}if(!m&&n.register(t),L.current){const $=y(n._fields,t);$&&$._f&&($._f.ref=L.current)}return()=>{(m?E&&!n._state.action:E)?n.unregister(t):D(t,!1)}},[t,n,m,o]),V.useEffect(()=>{n._setDisabledField({disabled:i,name:t})},[i,t,n]),V.useMemo(()=>({field:z,formState:O,fieldState:x}),[z,O,x])}const Tr=e=>e.render(or(e));var De=e=>({isOnSubmit:!e||e===ne.onSubmit,isOnBlur:e===ne.onBlur,isOnChange:e===ne.onChange,isOnAll:e===ne.all,isOnTouch:e===ne.onTouched}),Le=(e,s,t)=>{if(t)return!1;if(s.watchAll||s.watch.has(e))return!0;for(const i of s.watch)if(e.startsWith(i)&&e.charAt(i.length)===".")return!0;return!1};const Ae=(e,s,t,i)=>{for(const n of t||Object.keys(e)){if(n==="_f")continue;const o=t?y(e,n):e[n];if(o){const{_f:l}=o;if(l){if(l.refs&&l.refs[0]&&s(l.refs[0],n)&&!i)return!0;if(l.ref&&s(l.ref,l.name)&&!i)return!0;if(Ae(o,s))break}else if((P(o)||Array.isArray(o))&&Ae(o,s))break}}};var ht=(e,s,t)=>{const i=y(e,t),n=Array.isArray(i)?i:[];return T(n,Rt,s[t]),T(e,t,n),e},G=e=>P(e)&&!Object.keys(e).length,ke=e=>{if(!Se)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},Je=e=>e.type==="radio",Ce=e=>e instanceof RegExp,Qe=(e,s,t,i,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[i]:n||!0}}:{};const gt={value:!1,isValid:!1},vt={value:!0,isValid:!0};var Nt=e=>{if(!Array.isArray(e))return gt;if(e.length>1){const t=e.filter(i=>i&&i.checked&&!i.disabled).map(i=>i.value);return{value:t,isValid:!!t.length}}const s=e[0];return!s||!s.checked||s.disabled?gt:!s.attributes||!("value"in s.attributes)||p(s.value)||s.value===""?vt:{value:s.value,isValid:!0}};const _t={isValid:!1,value:null};var It=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,_t):_t;function mt(e,s,t="validate"){if(H(e)||Array.isArray(e)&&e.every(H)||X(e)&&!e)return{type:t,message:H(e)?e:"",ref:s}}var he=e=>P(e)&&!Ce(e)?e:{value:e,message:""},Vt=async(e,s,t,i,n,o)=>{const{ref:l,refs:f,required:m,maxLength:F,minLength:C,min:O,max:N,pattern:L,validate:w,name:x,valueAsNumber:A,mount:te}=e._f,k=y(t,x);if(!te||s.has(x))return{};const z=f?f[0]:l,E=S=>{if(n&&z.reportValidity){const R=X(S)?"":S||"";f?f.forEach(U=>U.setCustomValidity(R)):z.setCustomValidity(R),z.reportValidity()}},D={},$=Je(l),ae=Fe(l),ue=$||ae,j=(A||Oe(l))&&p(l.value)&&p(k)||ke(l)&&l.value===""||k===""||Array.isArray(k)&&!k.length,W=Qe.bind(null,x,i,D),oe=(S,R,U,K=ie.maxLength,re=ie.minLength)=>{const Z=S?R:U;D[x]={type:S?K:re,message:Z,ref:l,...W(S?K:re,Z)}};if(o?!Array.isArray(k)||!k.length:m&&(!ue&&(j||q(k))||X(k)&&!k||ae&&!Nt(f).isValid||$&&!It(f).isValid)){const{value:S,message:R}=H(m)?{value:!!m,message:m}:he(m);if(S&&(D[x]={type:ie.required,message:R,ref:z,...W(ie.required,R)},!i))return E(R),D}if(!j&&(!q(O)||!q(N))){let S,R;const U=he(N),K=he(O);if(!q(k)&&!fe(k)&&!isNaN(k)){const re=l.valueAsNumber||k&&+k;q(U.value)||(S=re>U.value),q(K.value)||(R=re<K.value)}else{const re=l.valueAsDate||new Date(k),Z=ve=>new Date(new Date().toDateString()+" "+ve),Ee=l.type=="time",ee=l.type=="week";H(U.value)&&k&&(S=Ee?Z(k)>Z(U.value):ee?k>U.value:re>new Date(U.value)),H(K.value)&&k&&(R=Ee?Z(k)<Z(K.value):ee?k<K.value:re<new Date(K.value))}if((S||R)&&(oe(!!S,U.message,K.message,ie.max,ie.min),!i))return E(D[x].message),D}if((F||C)&&!j&&(H(k)||o&&Array.isArray(k))){const S=he(F),R=he(C),U=!q(S.value)&&k.length>+S.value,K=!q(R.value)&&k.length<+R.value;if((U||K)&&(oe(U,S.message,R.message),!i))return E(D[x].message),D}if(L&&!j&&H(k)){const{value:S,message:R}=he(L);if(Ce(S)&&!k.match(S)&&(D[x]={type:ie.pattern,message:R,ref:l,...W(ie.pattern,R)},!i))return E(R),D}if(w){if(Y(w)){const S=await w(k,t),R=mt(S,z);if(R&&(D[x]={...R,...W(ie.validate,R.message)},!i))return E(R.message),D}else if(P(w)){let S={};for(const R in w){if(!G(S)&&!i)break;const U=mt(await w[R](k,t),z,R);U&&(S={...U,...W(R,U.message)},E(U.message),i&&(D[x]=S))}if(!G(S)&&(D[x]={ref:z,...S},!i))return D}}const ge=D[x];return E(ge?ge.message:!0),D},xe=e=>Array.isArray(e)?e:[e],Lt=e=>Array.isArray(e)?e.filter(Boolean):[];function lr(e,s){const t=s.length-1;let i=0;for(;i<t;){if(q(e)){e=void 0;break}e=e[s[i]],i++}return e}function fr(e){for(const s in e)if(e.hasOwnProperty(s)&&!p(e[s]))return!1;return!0}function B(e,s){if(H(s)&&Object.prototype.hasOwnProperty.call(e,s))return delete e[s],e;const t=Array.isArray(s)?s:ye(s)?[s]:de(s);if(t.some(l=>ze.includes(String(l))))return e;const i=t.length===1?e:lr(e,t),n=t.length-1,o=t[n];return i&&delete i[o],n!==0&&(P(i)&&G(i)||Array.isArray(i)&&fr(i))&&B(e,t.slice(0,-1)),e}const cr=V.createContext(null);cr.displayName="HookFormContext";var bt=()=>{let e=[];return{get observers(){return e},next:n=>{for(const o of e)o.next&&o.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(o=>o!==n)}}),unsubscribe:()=>{e=[]}}};function Ut(e,s){const t={};for(const i in e)if(e.hasOwnProperty(i)){const n=e[i],o=s[i];if(n&&P(n)&&o){const l=Ut(n,o);P(l)&&(t[i]=l)}else e[i]&&(t[i]=o)}return t}const At=(e,s)=>e!==null&&Ge(e)&&Object.prototype.hasOwnProperty.call(e,s);var dr=(e,s)=>{if(!s)return!1;let t=e;for(const i of ye(s)?[s]:de(s)){if(!At(t,i))return At(e,s);t=t[i]}return!0},Mt=e=>e.type==="select-multiple",yr=e=>Je(e)||Fe(e),Ue=e=>ke(e)&&e.isConnected;function Ft(e){return Array.isArray(e)||P(e)}function Pt(e,s,t="",i=[]){for(const n in e){const o=t?`${t}.${n}`:n,l=e[n];Ft(l)&&Ft(y(s,o))?Pt(l,s,o,i):i.push(o)}return i}var hr=e=>{for(const s in e)if(Y(e[s]))return!0;return!1};function Bt(e){return Array.isArray(e)||P(e)&&!hr(e)}function $t(e){return!!(e&&"_f"in e)}function Wt(e){return Array.isArray(e)?!e.some(s=>!p(s)):!Object.keys(e).length}function We(e,s){Array.isArray(e)?e[s]=void 0:delete e[s]}function qe(e,s={},t){for(const i in e){const n=e[i],o=t&&t[i];Bt(n)&&(!Array.isArray(n)||!$t(o))?(s[i]=Array.isArray(n)?[]:{},qe(n,s[i],o),Wt(s[i])&&We(s,i)):p(n)||(s[i]=!0)}return s}function ce(e,s,t,i){t||(t=qe(s,{},i));for(const n in e){const o=e[n],l=i&&i[n];Bt(o)&&(!Array.isArray(o)||!$t(l))?(p(s)||Be(t[n])?t[n]=qe(o,Array.isArray(o)?[]:{},l):ce(o,q(s)?{}:s[n],t[n],l),Wt(t[n])&&We(t,n)):J(o,s[n])?We(t,n):t[n]=!0}return t}var gr=(e,s)=>{const t=s.split("."),i=[];let n=t[0];for(let o=1;o<t.length;n+="."+t[o++])!isNaN(+t[o])&&e.has(n)&&i.push(`${n}.${t[o]}`);return i},qt=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:i})=>p(e)?e:s?e===""?NaN:e&&+e:t&&H(e)?new Date(e):i?i(e):e;function Et(e){const s=e.ref;return Oe(s)?s.files:Je(s)?It(e.refs).value:Mt(s)?[...s.selectedOptions].map(({value:t})=>t):Fe(s)?Nt(e.refs).value:qt(s.value,e)}var vr=(e,s,t,i)=>{const n={};for(const o of e){const l=y(s,o);l&&T(n,o,l._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:i}},be=e=>p(e)?e:Ce(e)?e.source:P(e)?Ce(e.value)?e.value.source:e.value:e;const wt="AsyncFunction";var _r=e=>{if(!e||!e.validate)return!1;if(Y(e.validate))return e.validate.constructor.name===wt;if(P(e.validate)){for(const s in e.validate)if(e.validate[s].constructor.name===wt)return!0}return!1},mr=e=>e.mount&&(e.required||!p(e.required)&&e.required!==!1||!p(e.min)||!p(e.max)||!p(e.maxLength)||!p(e.minLength)||e.pattern||e.validate);function Dt(e,s,t){const i=y(e,t);if(i||ye(t))return{error:i,name:t};const n=t.split(".");for(;n.length;){const o=n.join("."),l=y(s,o),f=y(e,o);if(l&&!Array.isArray(l)&&t!==o)return{name:t};if(f&&f.type)return{name:o,error:f};if(f&&f.root&&f.root.type)return{name:`${o}.root`,error:f.root};n.pop()}return{name:t}}var Vr=(e,s,t,i)=>{t(e);const n=Object.keys(e).filter(o=>o!=="name");return!n.length||i&&n.length>=Object.keys(s).length||n.find(o=>s[o]===(!i||ne.all))},br=(e,s,t)=>!e||!s||e===s||xe(e).some(i=>i&&(t?i===s||i.startsWith(s+"."):i.startsWith(s)||s.startsWith(i))),Ar=(e,s,t,i,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(s||e):(t?i.isOnBlur:n.isOnBlur)?!e:(t?i.isOnChange:n.isOnChange)?e:!0,Fr=(e,s)=>{const t=y(e,s);!Lt(t).length&&!t?.root&&B(e,s)};const Er={mode:ne.onSubmit,reValidateMode:ne.onChange,shouldFocusError:!0},Me="form",wr=(e,s)=>{for(const t in e)t in s||delete e[t];Object.assign(e,s)},Ht={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Dr(e={}){let s={...Er,...e},t={...I(Ht),isLoading:Y(s.defaultValues),errors:s.errors||{},disabled:s.disabled||!1},i={},n=P(s.defaultValues)||P(s.values)?I(s.defaultValues||s.values)||{}:{},o=s.shouldUnregister?{}:I(n),l={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},f={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const m={},F={};let C=0,O=De(s.mode),N=De(s.reValidateMode);const L={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},w={...L};let x={...w};const A={array:bt(),state:bt()};let te=0;const k=s.criteriaMode===ne.all,z=(r,u)=>a=>{clearTimeout(F[r]),F[r]=setTimeout(u,a)},E=async r=>{if(!l.keepIsValid&&!s.disabled&&(w.isValid||x.isValid||r)){const u=++te;let a;s.resolver?(a=G((await U()).errors),u===te&&D()):a=await Z({fields:i,onlyCheckValid:!0,eventType:le.VALID}),u===te&&a!==t.isValid&&A.state.next({isValid:a})}},D=(r,u)=>{!s.disabled&&(w.isValidating||w.validatingFields||x.isValidating||x.validatingFields)&&((r||f.mount).forEach(a=>{a&&(u?T(t.validatingFields,a,u):B(t.validatingFields,a))}),A.state.next({validatingFields:t.validatingFields,isValidating:!G(t.validatingFields)}))},$=()=>{t.dirtyFields=ce(n,o,void 0,i)},ae=(r,u=[],a,c,d=!0,h=!0)=>{if(c&&a&&!s.disabled){l.action=!0;const g=y(i,r);if(l.actionArrayLengths.has(r)||l.actionArrayLengths.set(r,Array.isArray(g)?g.length:0),h&&Array.isArray(g)){const b=a(g,c.argA,c.argB);d&&T(i,r,b)}const v=y(t.errors,r);if(h&&Array.isArray(v)){const b=v.root,M=a(v,c.argA,c.argB)||v;b&&(M.root=b),d&&T(t.errors,r,M),Fr(t.errors,r)}const _=y(t.touchedFields,r);if((w.touchedFields||x.touchedFields)&&h&&Array.isArray(_)){const b=a(_,c.argA,c.argB);d&&T(t.touchedFields,r,b)}(w.dirtyFields||x.dirtyFields)&&$(),A.state.next({name:r,isDirty:ee(r,u),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else T(o,r,u)},ue=(r,u)=>{T(t.errors,r,u),t.errors={...t.errors},A.state.next({errors:t.errors})},j=r=>{t.errors=r,A.state.next({errors:t.errors,isValid:!1})},W=r=>{const u=ye(r)?[r]:de(r);let a=o,c=n;for(let d=0;d<u.length-1;d++){const h=u[d];if(a=q(a)?a:a[h],c=q(c)?c:c[h],a===null&&c!==null)return!0}return!1},oe=r=>{if(!l.actionArrayLengths.size)return!1;const u=ye(r)?[r]:de(r);let a=o,c="",d=-1,h=0;for(let g=0;g<u.length;g++){if(q(a))return!1;const v=u[g];if(c=c?`${c}.${v}`:v,Array.isArray(a)&&+v>=a.length)return d===-1?!1:g===d?+v<h:!0;l.actionArrayLengths.has(c)&&(d=g+1,h=l.actionArrayLengths.get(c)),a=a[v]}return!1},ge=(r,u,a,c)=>{const d=y(i,r);if(d){if(W(r)||oe(r))return;const h=p(y(o,r)),g=y(o,r,p(a)?y(n,r):a);p(g)||c&&c.defaultChecked||u?T(o,r,u?g:Et(d._f)):Re(r,g),l.mount&&!l.action&&(E(),h&&t.isDirty&&(w.isDirty||x.isDirty)&&(ee()||(t.isDirty=!1,A.state.next({...t}))),e.shouldUnregister&&h&&!p(y(o,r))&&Le(r,f)&&(l.watch=!0))}},S=(r,u,a,c,d)=>{let h=!1,g=!1;const v={name:r};if(!s.disabled||c===!0){if(!a||c){const _=J(y(n,r),u);(w.isDirty||x.isDirty)&&(g=t.isDirty,t.isDirty=v.isDirty=!_||ee(),h=g!==v.isDirty),g=!!y(t.dirtyFields,r),_!==t.isDirty?wr(t.dirtyFields,ce(n,o,void 0,i)):_?B(t.dirtyFields,r):T(t.dirtyFields,r,!0),v.dirtyFields=t.dirtyFields,h=h||(w.dirtyFields||x.dirtyFields)&&g!==!_}if(a){const _=y(t.touchedFields,r);_||(T(t.touchedFields,r,a),v.touchedFields=t.touchedFields,h=h||(w.touchedFields||x.touchedFields)&&_!==a)}h&&d&&A.state.next(v)}return h?v:{}},R=(r,u,a,c)=>{const d=y(t.errors,r),h=(w.isValid||x.isValid)&&X(u)&&t.isValid!==u;if(s.delayError&&a?(m[r]=z(r,()=>ue(r,a)),m[r](s.delayError)):(clearTimeout(F[r]),delete m[r],a?T(t.errors,r,a):B(t.errors,r),t.errors={...t.errors}),(a?!J(d,a):d)||!G(c)||h){const g={...c,...h&&X(u)?{isValid:u}:{},errors:t.errors,name:r};A.state.next(g)}},U=async r=>(D(r,!0),await s.resolver(o,s.context,vr(r||f.mount,i,s.criteriaMode,s.shouldUseNativeValidation))),K=async r=>{const{errors:u}=await U(r);if(D(r),r){for(const a of r){const c=y(u,a);c?f.array.has(a)&&P(c)&&!Object.keys(c).some(d=>!Number.isNaN(Number(d)))?ht(t.errors,{[a]:c},a):T(t.errors,a,c):B(t.errors,a)}t.errors={...t.errors}}else t.errors=u;return u},re=async({name:r,eventType:u})=>{if(e.validate){const a=await e.validate({formValues:o,formState:t,name:r,eventType:u});if(P(a))for(const c in a){const d=a[c];d&&we(`${Me}.${c}`,{message:H(d.message)?d.message:"",type:d.type||ie.validate})}else H(a)||!a?we(Me,{message:a||"",type:ie.validate}):it(Me);return a}return!0},Z=async({fields:r,onlyCheckValid:u,name:a,eventType:c,context:d={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(d.runRootValidation=!0,!await re({name:a,eventType:c})&&(d.valid=!1,u)))return d.valid;for(const h in r){const g=r[h];if(g){const{_f:v,..._}=g;if(v){const b=f.array.has(v.name),M=g._f&&_r(g._f),Q=w.validatingFields||w.isValidating||x.validatingFields||x.isValidating;M&&Q&&D([v.name],!0);const se=await Vt(g,f.disabled,o,k,s.shouldUseNativeValidation&&!u,b);if(M&&Q&&D([v.name]),se[v.name]&&(d.valid=!1,u)||(!u&&(y(se,v.name)?b?ht(t.errors,se,v.name):T(t.errors,v.name,se[v.name]):B(t.errors,v.name)),e.shouldUseNativeValidation&&se[v.name]))break}!G(_)&&await Z({context:d,onlyCheckValid:u,fields:_,name:h,eventType:c})}}return d.valid},Ee=()=>{for(const r of f.unMount){const u=y(i,r);u&&(u._f.refs?u._f.refs.every(a=>!Ue(a)):!Ue(u._f.ref))&&pe(r)}f.unMount=new Set},ee=(r,u)=>(r&&u&&T(o,r,u),!J(l.mount?o:n,n)),ve=(r,u,a)=>$e(r,f,{...l.mount?o:p(u)||H(r)?n:u},a,u),jt=r=>Lt(y(l.mount?o:n,r,s.shouldUnregister?y(n,r,[]):[])),Re=(r,u,a={},c=!1,d=!1,h=!1)=>{const g=y(i,r);let v=u;if(g){const _=g._f;_&&(!_.disabled&&T(o,r,qt(u,_)),v=ke(_.ref)&&q(u)?"":u,Mt(_.ref)?[..._.ref.options].forEach(b=>b.selected=v.includes(b.value)):_.refs?Fe(_.ref)?_.refs.forEach(b=>{(!b.defaultChecked||!b.disabled)&&(Array.isArray(v)?b.checked=!!v.find(M=>M===b.value):b.checked=v===b.value||!!v)}):_.refs.forEach(b=>b.checked=b.value===v):Oe(_.ref)?_.ref.value="":(_.ref.value=v,!_.ref.type&&!d&&!h&&A.state.next({name:r,values:c?o:I(o)})))}(a.shouldDirty||a.shouldTouch)&&S(r,v,a.shouldTouch,a.shouldDirty,!d),a.shouldValidate&&Te(r,{delayError:a.delayError})},Xe=(r,u,a,c=!1,d=!1,h=!1)=>{f.array.has(r)&&A.array.next({name:r,values:c?o:I(o)});for(const g in u){if(!u.hasOwnProperty(g))continue;const v=u[g],_=r+"."+g,b=y(i,_);(f.array.has(r)||P(v)||b&&!b._f)&&!fe(v)?Xe(_,v,a,c,d,h):Re(_,v,a,c,d,h)}},et=(r,u,a,c,d=!1)=>{const h=y(i,r),g=f.array.has(r),v=c?u:I(u),_=y(o,r),b=J(_,v);if(b||T(o,r,v),g)A.array.next({name:r,values:c?o:I(o)}),(w.isDirty||w.dirtyFields||x.isDirty||x.dirtyFields)&&a.shouldDirty&&($(),d||A.state.next({name:r,dirtyFields:t.dirtyFields,isDirty:ee(r,v)}));else{const M=Array.isArray(v)&&!v.length||G(v),Q=!b&&!d;!h||h._f||q(v)||M?Re(r,v,a,c,d,Q):Xe(r,v,a,c,d,Q)}if(!b&&!d){const M=Le(r,f),Q=c?o:I(o);if(A.state.next({...M&&t,name:l.mount||M?r:void 0,values:Q}),!g)for(const se of gr(f.array,r))A.state.next({name:se,values:Q})}},_e=(r,u,a={})=>et(r,u,a,!1),Gt=(r,u={})=>{const a=Y(r)?r(o):r;if(!J(o,a)){o={...o,...a};for(const c of f.mount)dr(a,c)&&et(c,y(a,c),u,!0,!0);A.state.next({...t,name:void 0,type:void 0,...C?{values:o}:{}}),u.shouldValidate&&E()}},tt=async r=>{l.mount=!0;const u=r.target;let a=u.name,c=!0;const d=y(i,a),h=g=>{c=Number.isNaN(g)||fe(g)&&isNaN(g.getTime())||J(g,y(o,a,g))};if(d){let g,v;const _=u.type?Et(d._f):Pe(r),b=r.type===le.BLUR||r.type===le.FOCUS_OUT,M=!mr(d._f)&&!e.validate&&!s.resolver&&!y(t.errors,a)&&!d._f.deps,Q=M||Ar(b,y(t.touchedFields,a),t.isSubmitted,N,O),se=Le(a,f,b);if(T(o,a,I(_)),b){if(!u||!u.readOnly){d._f.onBlur&&d._f.onBlur(r);const Ve=m[a];Ve&&Ve(0)}}else d._f.onChange&&d._f.onChange(r);const me=S(a,_,b),er=!G(me)||se;if(!b&&A.state.next({name:a,type:r.type,...C?{values:I(o)}:{}}),Q)return(!M||!t.isValid)&&(w.isValid||x.isValid)&&(s.mode==="onBlur"?b&&E():b||E()),er&&A.state.next({name:a,...se?{}:me});if(!s.resolver&&e.validate&&await re({name:a,eventType:r.type}),!b&&se&&A.state.next({...t}),s.resolver){const{errors:Ve}=await U([a]);if(D([a]),h(_),!c){!G(me)&&A.state.next(me);return}const tr=Dt(t.errors,i,a),dt=Dt(Ve,i,tr.name||a);g=dt.error,a=dt.name,v=G(Ve)}else D([a],!0),g=(await Vt(d,f.disabled,o,k,s.shouldUseNativeValidation))[a],D([a]),h(_),c&&(g?v=!1:(w.isValid||x.isValid)&&(v=await Z({fields:i,onlyCheckValid:!0,name:a,eventType:r.type})));c&&(d._f.deps&&(!Array.isArray(d._f.deps)||d._f.deps.length>0)&&Te(d._f.deps),R(a,v,g,me))}},rt=(r,u)=>{if(y(t.errors,u)&&r.focus)return r.focus(),1},Te=async(r,u={})=>{let a,c;const d=xe(r);if(s.resolver){const h=await K(p(r)?r:d);a=G(h),c=r?!d.some(g=>y(h,g)):a}else r?(c=(await Promise.all(d.map(async h=>{const g=y(i,h);return await Z({fields:g&&g._f?{[h]:g}:g,eventType:le.TRIGGER})}))).every(Boolean),!(!c&&!t.isValid)&&E()):c=a=await Z({fields:i,name:r,eventType:le.TRIGGER});if(u.delayError&&s.delayError&&H(r)){const h=y(t.errors,r);h?(B(t.errors,r),m[r]=z(r,()=>ue(r,h)),m[r](s.delayError)):(clearTimeout(F[r]),delete m[r])}if(u.shouldTouch)for(const h of r?d:f.mount)!f.array.has(h)&&T(t.touchedFields,h,!0);return A.state.next({...!H(r)||(w.isValid||x.isValid)&&a!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:a}:{},...u.shouldTouch&&(w.touchedFields||x.touchedFields)?{touchedFields:t.touchedFields}:{},errors:t.errors}),u.shouldFocus&&!c&&Ae(i,rt,r?d:f.mount),c},zt=(r,u)=>{let a={...l.mount?o:n};return u&&(a=Ut(u.dirtyFields?t.dirtyFields:t.touchedFields,a)),p(r)?a:H(r)?y(a,r):r.map(c=>y(a,c))},Yt=r=>p(r)?{...t.errors}:H(r)?y(t.errors,r):r.map(u=>y(t.errors,u)),st=(r,u)=>{const a=u||t,c=y(a.errors,r);return{invalid:!!c,isDirty:!!y(a.dirtyFields,r),error:c,isValidating:!!y(t.validatingFields,r),isTouched:!!y(a.touchedFields,r)}},it=r=>{const u=r?xe(r):void 0;u?.forEach(a=>B(t.errors,a)),u?u.forEach(a=>{A.state.next({name:a,errors:t.errors})}):(t.errors={},A.state.next({errors:t.errors}))},we=(r,u,a)=>{const c=(y(i,r,{_f:{}})._f||{}).ref,d=y(t.errors,r)||{},{ref:h,message:g,type:v,..._}=d;T(t.errors,r,{..._,...u,ref:c}),A.state.next({name:r,errors:t.errors,isValid:!1}),a&&a.shouldFocus&&c&&c.focus&&c.focus()},Kt=(r,u)=>{if(Y(r)){C++;const{unsubscribe:a}=A.state.subscribe({next:d=>"values"in d&&r(d.values||ve(void 0,u),d)});let c=!1;return{unsubscribe:()=>{c||(c=!0,C--,a())}}}return ve(r,u,!0)},nt=r=>{var u;const a=!!(!((u=r.formState)===null||u===void 0)&&u.values);a&&C++;const{unsubscribe:c}=A.state.subscribe({next:h=>{if(br(r.name,h.name,r.exact)&&Vr(h,r.formState||w,ft,r.reRenderRoot)){const g={...o};r.callback({values:g,...t,...h,defaultValues:n})}}});if(!a)return c;let d=!1;return()=>{d||(d=!0,C--,c())}},Zt=r=>(l.mount=!0,x={...x,...r.formState},nt({...r,formState:{...L,...r.formState}})),pe=(r,u={})=>{for(const a of r?xe(r):f.mount)f.mount.delete(a),f.array.delete(a),u.keepValue||(B(i,a),B(o,a)),!u.keepError&&B(t.errors,a),!u.keepDirty&&B(t.dirtyFields,a),!u.keepTouched&&B(t.touchedFields,a),!u.keepIsValidating&&B(t.validatingFields,a),!s.shouldUnregister&&!u.keepDefaultValue&&B(n,a);C&&A.state.next({values:I(o)}),A.state.next({...t,...u.keepDirty?{}:{isDirty:ee()}}),!u.keepIsValid&&E()},at=({disabled:r,name:u})=>{if(X(r)&&l.mount||r||f.disabled.has(u)){const d=f.disabled.has(u)!==!!r;r?f.disabled.add(u):f.disabled.delete(u),d&&l.mount&&!l.action&&E()}},Ne=(r,u={})=>{let a=y(i,r);const c=X(u.disabled)||X(s.disabled),d=!f.registerName.has(r)&&a&&a._f&&!a._f.mount;return T(i,r,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:r}},name:r,mount:!0,...u}}),f.mount.add(r),a&&!d?at({disabled:X(u.disabled)?u.disabled:s.disabled,name:r}):ge(r,!0,u.value),{...c?{disabled:u.disabled||s.disabled}:{},...s.progressive?{required:!!u.required,min:be(u.min),max:be(u.max),minLength:be(u.minLength),maxLength:be(u.maxLength),pattern:be(u.pattern)}:{},name:r,onChange:tt,onBlur:tt,ref:h=>{if(h){f.registerName.add(r),Ne(r,u),f.registerName.delete(r),a=y(i,r);const g=p(h.value)&&h.querySelectorAll&&h.querySelectorAll("input,select,textarea")[0]||h,v=yr(g),_=a._f.refs||[];if(v?_.find(M=>M===g):g===a._f.ref)return;const b={...a._f};v?(b.refs=[..._.filter(Ue),g,...Array.isArray(y(n,r))?[{}]:[]],b.ref={type:g.type,name:r}):(b.ref=g,delete b.refs),T(i,r,{_f:b}),ge(r,!1,void 0,g)}else a=y(i,r,{}),a._f&&(a._f.mount=!1),(s.shouldUnregister||u.shouldUnregister)&&!(St(f.array,r)&&l.action)&&f.unMount.add(r)}}},Ie=()=>s.shouldFocusError&&!s.shouldUseNativeValidation&&Ae(i,rt,f.mount),Jt=r=>{X(r)&&(A.state.next({disabled:r}),Ae(i,(u,a)=>{const c=y(i,a);c&&(u.disabled=c._f.disabled||r,Array.isArray(c._f.refs)&&c._f.refs.forEach(d=>{d.disabled=c._f.disabled||r}))},0,!1))},ut=(r,u)=>async a=>{let c,d;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let h=I(o);if(A.state.next({isSubmitting:!0}),s.resolver){const{errors:g,values:v}=await U();D(),t.errors=g,h=I(v)}else await Z({fields:i,eventType:le.SUBMIT});if(f.disabled.size)for(const g of f.disabled)B(h,g);if(B(t.errors,Rt),G(t.errors)){A.state.next({errors:{}});try{c=await r(h,a)}catch(g){d=g}}else u&&await u({...t.errors},a),Ie(),setTimeout(Ie);if(A.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:G(t.errors)&&!d,submitCount:t.submitCount+1,errors:t.errors}),d)throw d;return c},Qt=(r,u={})=>{y(i,r)&&(p(u.defaultValue)?_e(r,I(y(n,r))):(_e(r,u.defaultValue),T(n,r,I(u.defaultValue))),u.keepTouched||B(t.touchedFields,r),u.keepDirty||(B(t.dirtyFields,r),t.isDirty=u.defaultValue?ee(r,I(y(n,r))):ee()),u.keepError||(B(t.errors,r),E()),A.state.next({...t}))},ot=(r,u={})=>{const a=r?I(r):n,c=I(a),d=G(r),h=c,g=i;if(u.keepDefaultValues||(n=a),!u.keepValues){if(u.keepDirtyValues){const v=new Set([...f.mount,...Pt(ce(n,o,void 0,g),t.dirtyFields)]);for(const _ of v){const b=y(t.dirtyFields,_),M=y(o,_),Q=y(h,_);b&&!p(M)?T(h,_,M):!b&&!p(Q)&&_e(_,Q)}}else{if(Se&&p(r))for(const v of f.mount){const _=y(i,v);if(_&&_._f){const b=Array.isArray(_._f.refs)?_._f.refs[0]:_._f.ref;if(ke(b)){const M=b.closest("form");if(M){M.reset();break}}}}if(u.keepFieldsRef)for(const v of f.mount)_e(v,y(h,v));else i={}}if(s.shouldUnregister){if(o=u.keepDefaultValues?I(n):{},u.keepFieldsRef)for(const v of f.mount)T(o,v,y(h,v))}else o=I(h);A.array.next({values:{...h}}),A.state.next({name:void 0,type:void 0,values:{...h}})}f={mount:u.keepDirtyValues?f.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!w.isValid||!!u.keepIsValid||!!u.keepDirtyValues||!s.shouldUnregister&&!G(h),l.watch=!!s.shouldUnregister,l.keepIsValid=!!u.keepIsValid,l.action=!1,l.actionArrayLengths.clear(),u.keepErrors||(t.errors={}),A.state.next({submitCount:u.keepSubmitCount?t.submitCount:0,isDirty:d?!1:u.keepDirty?t.isDirty:u.keepValues?ee():!!(u.keepDefaultValues&&!J(r,n)),isSubmitted:u.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:d?{}:u.keepDirtyValues?u.keepDefaultValues&&o?ce(n,o,void 0,g):t.dirtyFields:u.keepDefaultValues&&r?ce(n,r,void 0,g):u.keepDirty?t.dirtyFields:{},touchedFields:u.keepTouched?t.touchedFields:{},errors:u.keepErrors?t.errors:{},isSubmitSuccessful:u.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:n})},lt=(r,u)=>ot(Y(r)?r(o):r,{...s.resetOptions,...u}),Xt=(r,u={})=>{const a=y(i,r),c=a&&a._f;if(c){const d=c.refs?c.refs[0]:c.ref;d.focus&&setTimeout(()=>{d.focus(),u.shouldSelect&&Y(d.select)&&d.select()})}},ft=r=>{const{name:u,type:a,values:c,...d}=r;t={...t,...d}};A.state.subscribe({next:ft});const ct={control:{register:Ne,unregister:pe,getFieldState:st,handleSubmit:ut,setError:we,_subscribe:nt,_runSchema:U,_updateIsValidating:D,_focusError:Ie,_getWatch:ve,_getDirty:ee,_setValid:E,_setFieldArray:ae,_setDisabledField:at,_setErrors:j,_getFieldArray:jt,_reset:ot,_resetDefaultValues:()=>Y(s.defaultValues)&&s.defaultValues().then(r=>{lt(r,s.resetOptions),A.state.next({isLoading:!1})}),_removeUnmounted:Ee,_disableForm:Jt,_subjects:A,_proxyFormState:w,get _fields(){return i},get _formValues(){return o},get _state(){return l},set _state(r){l=r},get _defaultValues(){return n},get _names(){return f},set _names(r){f=r},get _formState(){return t},get _options(){return s},set _options(r){s={...s,...r},O=De(s.mode),N=De(s.reValidateMode)}},subscribe:Zt,trigger:Te,register:Ne,handleSubmit:ut,watch:Kt,setValue:_e,setValues:Gt,getValues:zt,getErrors:Yt,reset:lt,resetField:Qt,resetDefaultValues:(r,u={})=>{if(n=I(r),!u.keepDirty){const a=ce(n,o,void 0,i);t.dirtyFields=a,t.isDirty=!G(a)}u.keepIsValid||E(),A.state.next({...t,defaultValues:n})},clearErrors:it,unregister:pe,setError:we,setFocus:Xt,getFieldState:st};return{...ct,formControl:ct}}function pr(e={}){const s=V.useRef(void 0),t=V.useRef(void 0),i=V.useRef(e.formControl),[n,o]=V.useState(()=>({...I(Ht),isLoading:Y(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Y(e.defaultValues)?void 0:e.defaultValues}));if(!s.current||e.formControl&&i.current!==e.formControl)if(i.current=e.formControl,e.formControl)s.current={...e.formControl,formState:n},e.defaultValues&&!Y(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:F,...C}=Dr(e);s.current={...C,formState:n}}const l=s.current.control;l._options=e;const{resyncIfNeeded:f,snapshot:m}=Ze();return Ke(()=>{const F=()=>({...l._formState,defaultValues:l._defaultValues});f(!0,F,o);const C=l._subscribe({formState:l._proxyFormState,callback:()=>o({...l._formState,defaultValues:l._defaultValues}),reRenderRoot:!0});return o(O=>({...O,isReady:!0})),l._formState.isReady=!0,()=>{C(),m(!0,F)}},[l,f,m]),V.useEffect(()=>l._disableForm(e.disabled),[l,e.disabled]),V.useEffect(()=>{e.mode&&(l._options.mode=e.mode),e.reValidateMode&&(l._options.reValidateMode=e.reValidateMode)},[l,e.mode,e.reValidateMode]),V.useEffect(()=>{e.errors&&(l._setErrors(e.errors),l._focusError())},[l,e.errors]),V.useEffect(()=>{e.shouldUnregister&&l._subjects.state.next({values:l._getWatch()})},[l,e.shouldUnregister]),V.useEffect(()=>{if(l._proxyFormState.isDirty){const F=l._getDirty();F!==n.isDirty&&l._subjects.state.next({isDirty:F})}},[l,n.isDirty]),V.useEffect(()=>{var F;e.values&&!J(e.values,t.current)?(l._reset(e.values,{keepFieldsRef:!0,...l._options.resetOptions}),!((F=l._options.resetOptions)===null||F===void 0)&&F.keepIsValid||l._setValid(),t.current=e.values,o(C=>({...C}))):l._resetDefaultValues()},[l,e.values]),V.useEffect(()=>{l._state.mount||(l._setValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),s.current.formState=V.useMemo(()=>pt(n,l),[l,n]),s.current}const xt=(e,s,t)=>{if(e&&"reportValidity"in e){const i=y(t,s);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},He=(e,s)=>{for(const t in s.fields){const i=s.fields[t];i&&i.ref&&"reportValidity"in i.ref?xt(i.ref,t,e):i&&i.refs&&i.refs.forEach(n=>xt(n,t,e))}},kt=(e,s)=>{s.shouldUseNativeValidation&&He(e,s);const t={};for(const i in e){const n=y(s.fields,i),o=Object.assign(e[i]||{},{ref:n&&n.refs?n.refs[0]:n&&n.ref});if(xr(s.names||Object.keys(e),i)){const l=Object.assign({},y(t,i));T(l,"root",o),T(t,i,l)}else T(t,i,o)}return t},xr=(e,s)=>{const t=Ct(s).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(i=>Ct(i).match(`^${t}\\.\\d+`))};function Ct(e){return e.replace(/\[(\d+)]/g,".$1").replace(/[[\]]/g,"")}function je(){return je=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},je.apply(null,arguments)}function Ot(e,s){try{var t=e()}catch(i){return s(i)}return t&&t.then?t.then(void 0,s):t}function kr(e,s){for(var t=Object.create(null);e.length;){var i=e[0],n=i.code,o=i.message,l=i.path.join(".");if(!t[l])if("unionErrors"in i){var f,m,F=i.unionErrors.reduce(function(N,L){return L.errors.length<N.errors.length?L:N}).errors[0];t[l]={message:(f=F?.message)!=null?f:o,type:(m=F?.code)!=null?m:n}}else t[l]={message:o,type:n};if("unionErrors"in i&&i.unionErrors.forEach(function(N){return N.errors.forEach(function(L){return e.push(L)})}),s){var C=t[l].types,O=C&&C[i.code];t[l]=Qe(l,s,t,n,O?[].concat(O,i.message):i.message)}e.shift()}return t}function Cr(e,s){for(var t=Object.create(null),i=function(){var n=e[0],o=n.code,l=n.message,f=n.path.join(".");if(!t[f])if(n.code==="invalid_union"&&n.errors.length>0){var m,F,C=n.errors.reduce(function(L,w){return w.length<L.length?w:L})[0];t[f]={message:(m=C?.message)!=null?m:l,type:(F=C?.code)!=null?F:o}}else t[f]={message:l,type:o};if(n.code==="invalid_union"&&n.errors.forEach(function(L){return L.forEach(function(w){return e.push(je({},w,{path:[].concat(n.path,w.path)}))})}),s){var O=t[f].types,N=O&&O[n.code];t[f]=Qe(f,s,t,o,N?[].concat(N,n.message):n.message)}e.shift()};e.length;)i();return t}function Nr(e,s,t){if(t===void 0&&(t={}),(function(i){return"_zod"in i&&typeof i._zod=="object"})(e))return function(i,n,o){try{return Promise.resolve(Ot(function(){function l(m){return o.shouldUseNativeValidation&&He({},o),{errors:{},values:t.raw?Object.assign({},i):m}}var f=e;return t.mode==="sync"?l(f.parse(i,s)):Promise.resolve(f.parseAsync(i,s)).then(l)},function(l){if((function(f){var m;return!(f==null||(m=f._zod)==null||(m=m.traits)==null||!m.has("$ZodError"))})(l))return{values:{},errors:kt(Cr(l.issues,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw l}))}catch(l){return Promise.reject(l)}};if((function(i){return"_def"in i&&typeof i._def=="object"})(e))return function(i,n,o){try{return Promise.resolve(Ot(function(){return Promise.resolve(e[t.mode==="sync"?"parse":"parseAsync"](i,s)).then(function(l){return o.shouldUseNativeValidation&&He({},o),{errors:{},values:t.raw?Object.assign({},i):l}})},function(l){if((function(f){return Array.isArray(f?.issues)})(l))return{values:{},errors:kt(kr(l.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw l}))}catch(l){return Promise.reject(l)}};throw new Error("Invalid input: not a Zod schema")}export{Tr as C,Nr as a,pr as u};
@@ -21,7 +21,7 @@
21
21
  </script>
22
22
  <link rel="icon" href="/mark.svg" type="image/svg+xml" />
23
23
  <title>Snagset</title>
24
- <script type="module" crossorigin src="/assets/index-CUBD0DcL.js"></script>
24
+ <script type="module" crossorigin src="/assets/index-BC1mWQy8.js"></script>
25
25
  <link rel="stylesheet" crossorigin href="/assets/index-BQBdFBZG.css">
26
26
  </head>
27
27
  <body>