@snagset/server 0.1.41 → 0.1.43
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.
- package/dist/app.js +35 -2
- package/dist/app.js.map +1 -1
- package/dist/db/migrations/0015_site_archive.sql +15 -0
- package/dist/holds.js +29 -0
- package/dist/holds.js.map +1 -0
- package/dist/mail/smtp.js +17 -7
- package/dist/mail/smtp.js.map +1 -1
- package/dist/plan.js +2 -2
- package/dist/plan.js.map +1 -1
- package/dist/projectCache.js +1 -1
- package/dist/projectCache.js.map +1 -1
- package/dist/routes/bodyLimit.js +13 -11
- package/dist/routes/bodyLimit.js.map +1 -1
- package/dist/routes/comments.js +7 -0
- package/dist/routes/comments.js.map +1 -1
- package/dist/routes/invites.js +19 -7
- package/dist/routes/invites.js.map +1 -1
- package/dist/routes/owner.js +8 -4
- package/dist/routes/owner.js.map +1 -1
- package/dist/routes/sites.js +46 -0
- package/dist/routes/sites.js.map +1 -1
- package/dist/routes/threads.js +6 -3
- package/dist/routes/threads.js.map +1 -1
- package/package.json +1 -1
- package/static/dashboard/assets/{CompositeItem-B_Ebe9qQ.js → CompositeItem-DqkA27tC.js} +1 -1
- package/static/dashboard/assets/{CompositeList-CDAPQTbv.js → CompositeList-DrnyFTB0.js} +1 -1
- package/static/dashboard/assets/{ConfirmDialog-D1II2uNE.js → ConfirmDialog-CLal40kk.js} +1 -1
- package/static/dashboard/assets/{CopyButton-qbA2ZHWn.js → CopyButton-D_EAOrl1.js} +1 -1
- package/static/dashboard/assets/{FieldItemContext-BM_KzVUj.js → FieldItemContext-Dvh77l6C.js} +1 -1
- package/static/dashboard/assets/{InstallTag-DTpNoMn9.js → InstallTag-Cld-E0Bc.js} +1 -1
- package/static/dashboard/assets/InstanceRows-DexbQngM.js +1 -0
- package/static/dashboard/assets/{McpTokens-DE2t0iiS.js → McpTokens-CIjBwfT0.js} +1 -1
- package/static/dashboard/assets/{SaveState-QQHqDSgx.js → SaveState-BiYh2KgZ.js} +1 -1
- package/static/dashboard/assets/_app-BSxQmm69.js +61 -0
- package/static/dashboard/assets/{_app-CaDt6CPJ.js → _app-CrFQJNrf.js} +1 -1
- package/static/dashboard/assets/activity-BUIv_tqh.js +1 -0
- package/static/dashboard/assets/{arrow-left-RqdORgcq.js → arrow-left-B6jSSfnu.js} +1 -1
- package/static/dashboard/assets/{avatar-D8S5EME4.js → avatar-CPcL_-iV.js} +1 -1
- package/static/dashboard/assets/{badge-anHWhPFa.js → badge-DBzqpvfR.js} +1 -1
- package/static/dashboard/assets/{card-C01exIzZ.js → card-B5svGaqA.js} +1 -1
- package/static/dashboard/assets/{check-Gm9Xu4rH.js → check-C21x2mpF.js} +1 -1
- package/static/dashboard/assets/{chevron-down-C-pVPOKU.js → chevron-down-qCyXHfGI.js} +1 -1
- package/static/dashboard/assets/{chevron-right-BQmYcugl.js → chevron-right-ZLZCd12m.js} +1 -1
- package/static/dashboard/assets/{copy-Ckk__4oN.js → copy-Bik19B-3.js} +1 -1
- package/static/dashboard/assets/{dialog-D5G50pSW.js → dialog-qbXy4GE2.js} +1 -1
- package/static/dashboard/assets/{dropdown-menu-Bm_opJ2p.js → dropdown-menu-_DGLxfga.js} +1 -1
- package/static/dashboard/assets/{forgot-R7JqXxs5.js → forgot-BJwCHsE9.js} +1 -1
- package/static/dashboard/assets/{image-off-BtbHLgOM.js → image-off-DkzQHm8a.js} +1 -1
- package/static/dashboard/assets/{index-p-qD6BlY.js → index-CHi2CcHb.js} +20 -20
- package/static/dashboard/assets/index-Ie8QH3El.css +1 -0
- package/static/dashboard/assets/invite-BRZIE9ij.js +1 -0
- package/static/dashboard/assets/{label-CuvYMIVd.js → label-Dff2Zjcb.js} +1 -1
- package/static/dashboard/assets/labels--UUyt9uB.js +1 -0
- package/static/dashboard/assets/{layout-grid-D5ek58h7.js → layout-grid-C3Koxvvp.js} +1 -1
- package/static/dashboard/assets/me-XTwFHhR6.js +1 -0
- package/static/dashboard/assets/{parts-CN1uQywE.js → parts-CK9SS76R.js} +1 -1
- package/static/dashboard/assets/{plus-BsxOLtMA.js → plus-4APMJ4TC.js} +1 -1
- package/static/dashboard/assets/reset-BakGFWJY.js +1 -0
- package/static/dashboard/assets/s._site-z1oyWNQY.js +1 -0
- package/static/dashboard/assets/{s._site.comments-DmrtKLHb.js → s._site.comments-C3V2hEnX.js} +2 -2
- package/static/dashboard/assets/s._site.reviewers-BWO0DRhU.js +1 -0
- package/static/dashboard/assets/s._site.settings-Brm50esb.js +1 -0
- package/static/dashboard/assets/{setup-BDZJmgIB.js → setup-B1bevXbJ.js} +1 -1
- package/static/dashboard/assets/{sign-in-BmweKwDv.js → sign-in-DxO2Kh8j.js} +1 -1
- package/static/dashboard/assets/{sign-up-C06mQl-c.js → sign-up-B8c2f4uf.js} +1 -1
- package/static/dashboard/assets/sites-BzBdEUAz.js +1 -0
- package/static/dashboard/assets/{studio-BHpeuJSq.js → studio-BtXg0XzE.js} +1 -1
- package/static/dashboard/assets/studio-CD5SiuzI.js +1 -0
- package/static/dashboard/assets/studio.index-r91Elth-.js +1 -0
- package/static/dashboard/assets/studio.integrations-Df0aQQaP.js +1 -0
- package/static/dashboard/assets/{studio.members-CEKrbJHp.js → studio.members-BAJ3beQC.js} +2 -2
- package/static/dashboard/assets/studio.plan-CcdSeq5g.js +1 -0
- package/static/dashboard/assets/{sun-DXwtJyi5.js → sun-BwWiB8wj.js} +1 -1
- package/static/dashboard/assets/{switch-cgJL6ATv.js → switch-b0ERMUSk.js} +1 -1
- package/static/dashboard/assets/{table-B8VTYpZO.js → table-HuNaCQBJ.js} +1 -1
- package/static/dashboard/assets/{useAriaLabelledBy-BT5NtL2E.js → useAriaLabelledBy-B3107P7l.js} +1 -1
- package/static/dashboard/assets/{useBaseQuery-DaFWLbWu.js → useBaseQuery-DI4GfUK8.js} +1 -1
- package/static/dashboard/assets/useQuery-U2FOgJPB.js +1 -0
- package/static/dashboard/assets/useRender-B8Yivtih.js +1 -0
- package/static/dashboard/assets/{useValueChanged-cwqHWzY1.js → useValueChanged-RTamjQR3.js} +1 -1
- package/static/dashboard/assets/{users-CGY0g3mg.js → users--4QPa7AS.js} +1 -1
- package/static/dashboard/assets/{welcome-CNtwDQMd.js → welcome-UZyMZNzL.js} +3 -3
- package/static/dashboard/assets/{widget-signin-BOUMPGXt.js → widget-signin-DXyh_-_V.js} +1 -1
- package/static/dashboard/assets/you-DSHNqgeU.js +1 -0
- package/static/dashboard/assets/{zod-DfHlfdUJ.js → zod-dogyqr67.js} +1 -1
- package/static/dashboard/index.html +2 -2
- package/static/widget/build.json +2 -2
- package/static/widget/snag.js +1 -1
- package/static/widget/snag.runtime.js +2 -2
- package/static/dashboard/assets/InstanceRows-B1z-L92-.js +0 -1
- package/static/dashboard/assets/_app-B_DiSFIt.js +0 -61
- package/static/dashboard/assets/activity-CzEy_J8-.js +0 -1
- package/static/dashboard/assets/index-CoiIx5MR.css +0 -1
- package/static/dashboard/assets/invite-9eotNL9V.js +0 -1
- package/static/dashboard/assets/labels-DLMjYGNJ.js +0 -1
- package/static/dashboard/assets/reset-8K76tpdp.js +0 -1
- package/static/dashboard/assets/s._site-egkPDOj9.js +0 -1
- package/static/dashboard/assets/s._site.reviewers-CGKj-NQo.js +0 -1
- package/static/dashboard/assets/s._site.settings-DvWbfMac.js +0 -1
- package/static/dashboard/assets/sites-CkGgns1o.js +0 -1
- package/static/dashboard/assets/studio-CG1QMBSK.js +0 -1
- package/static/dashboard/assets/studio.index-BOkmM7I5.js +0 -1
- package/static/dashboard/assets/studio.integrations-BBik3DdK.js +0 -1
- package/static/dashboard/assets/studio.plan-CkOzUaJM.js +0 -1
- package/static/dashboard/assets/useQuery-D-9vXtOo.js +0 -1
- package/static/dashboard/assets/useRender-BBzDGtxq.js +0 -1
- package/static/dashboard/assets/you-DH4QMiND.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bb as N,bc as h,bd as O,be as U,bf as k,bg as B,bh as A,bi as y,bj as H,bk as V,bl as M,bm as x,r as p,bn as F,d as j}from"./index-CHi2CcHb.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.#m())}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.#S(),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.#S();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))}#m(){this.#R(),this.#y(this.#v())}#S(){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 m=n.fetchStatus==="fetching",S=b==="pending",g=b==="error",T=S&&m,w=o!==void 0;return{status:b,fetchStatus:n.fetchStatus,isPending:S,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:m,isRefetching:m&&!S,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.#m()}};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),z=()=>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=z(),r=J(),c=j(),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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as r,Q as u}from"./useBaseQuery-DI4GfUK8.js";function a(e,s){return r(e,u)}export{a as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as n}from"./index-CHi2CcHb.js";function u(e){return n(e.defaultTagName??"div",e,e)}export{u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,f as c,e as n}from"./index-
|
|
1
|
+
import{r as s,f as c,e as n}from"./index-CHi2CcHb.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,11 +1,11 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as z,V as E,p as F,d as B,r as l,j as e,G as L,h as k,B as n,s as w,A as x,C as S}from"./index-CHi2CcHb.js";import{C as f}from"./card-B5svGaqA.js";import{L as C,I as q}from"./label-Dff2Zjcb.js";import{I as P}from"./InstallTag-Cld-E0Bc.js";import{C as R}from"./check-C21x2mpF.js";import{A}from"./arrow-left-B6jSSfnu.js";import"./copy-Bik19B-3.js";/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const T=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],j=
|
|
6
|
+
*/const T=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],j=z("arrow-right",T);/**
|
|
7
7
|
* @license lucide-react v1.39.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const _=[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]],G=
|
|
11
|
+
*/const _=[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]],G=z("party-popper",_),I=["Site","Address","Install"];function J(){const{me:D,site:r}=E.useRouteContext(),b=F(),o=B(),[a,c]=l.useState(0),[d,K]=l.useState(r.name==="First project"?"":r.name),[h,M]=l.useState(""),[i,u]=l.useState(!1),[m,y]=l.useState(!1),[v,p]=l.useState(""),Q=async()=>{u(!0),y(!0),p("");try{await w.deleteSite(r.uid),o.removeQueries({queryKey:["origins",r.uid]}),await o.invalidateQueries({queryKey:x.me().queryKey}),await o.fetchQuery(x.me()),b({to:"/sites",replace:!0})}catch(t){p(t instanceof S?t.message:"Something went wrong. Try again."),u(!1),y(!1)}},N=async(t,s)=>{u(!0),p("");try{await w.editSite(r.uid,t),t.domain&&o.setQueryData(x.origins(r.uid).queryKey,{domain:t.domain,origins:[]}),await o.invalidateQueries({queryKey:x.me().queryKey}),await o.fetchQuery(x.me()),s()}catch(g){p(g instanceof S?g.message:"Could not reach the server.")}finally{u(!1)}};return e.jsx("div",{className:"relative min-h-dvh bg-background",children:e.jsxs(L,{width:600,children:[e.jsxs("div",{className:"absolute right-6 top-5 text-[12.5px] text-muted-foreground",children:["Signed in as ",D.user.email]}),a<3&&e.jsx("ol",{className:"m-0 mb-6 flex list-none items-center gap-3.5 p-0","aria-label":"Steps",children:I.map((t,s)=>e.jsxs("li",{className:"flex items-center gap-2.5 text-[13.5px] font-medium",children:[e.jsx("span",{className:k("flex size-7 items-center justify-center rounded-full border-[1.5px] text-[12.5px]",s<a&&"border-brand bg-brand text-brand-foreground",s===a&&"border-brand text-brand ring-[3px] ring-brand-soft",s>a&&"border-line-strong text-muted-foreground"),"aria-current":s===a?"step":void 0,children:s<a?e.jsx(R,{className:"size-3.5"}):s+1}),e.jsx("span",{className:s===a?"text-foreground":"text-muted-foreground",children:t}),s<I.length-1&&e.jsx("span",{className:k("h-px w-[90px]",s<a?"bg-brand":"bg-border")})]},t))}),v&&e.jsx("p",{role:"alert",className:"m-0 mb-4 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:v}),a===0&&e.jsx(f,{className:"gap-4 p-7",children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:t=>{t.preventDefault(),!(!d.trim()||i)&&N({name:d.trim()},()=>c(1))},children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[21px] font-semibold leading-tight tracking-tight",children:"What is the site called?"}),e.jsx("p",{className:"m-0 mt-2 text-muted-foreground",children:"One client website. You can add more from Sites later."})]}),e.jsxs("fieldset",{disabled:i,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"first-name",children:"Name"}),e.jsx(q,{id:"first-name",placeholder:"Kilnwork",value:d,onChange:t=>K(t.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(n,{type:"button",variant:"ghost",loading:m,disabled:i&&!m,onClick:()=>void Q(),children:"Skip for now"}),e.jsxs(n,{type:"submit",loading:i&&!m,disabled:!d.trim()||m,children:[i&&!m?"Saving…":"Continue",e.jsx(j,{})]})]})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"No site yet? Skip, and add one from Sites when it is ready."})]})}),a===1&&e.jsx(f,{className:"gap-4 p-7",children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:t=>{t.preventDefault(),!(!h.trim()||i)&&N({domain:h.trim()},()=>c(2))},children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"m-0 text-[21px] font-semibold leading-tight tracking-tight",children:["Where does ",d||r.name," live?"]}),e.jsx("p",{className:"m-0 mt-2 text-muted-foreground",children:"Its domain. Every subdomain, scheme and port of it may run the widget — staging, previews, and localhost while you build. Exact addresses elsewhere can be added in the site's settings."})]}),e.jsxs("fieldset",{disabled:i,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"first-domain",children:"Domain"}),e.jsx(q,{id:"first-domain",placeholder:"kilnwork.studio",value:h,onChange:t=>M(t.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsxs(n,{type:"button",variant:"ghost",onClick:()=>c(0),children:[e.jsx(A,{}),"Back"]}),e.jsx("div",{className:"flex-1"}),e.jsxs(n,{type:"submit",loading:i,disabled:!h.trim(),children:[i?"Saving…":"Continue",e.jsx(j,{})]})]})]})]})}),a===2&&e.jsxs(f,{className:"gap-4 p-7",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[21px] font-semibold leading-tight tracking-tight",children:"Install the widget"}),e.jsxs("p",{className:"m-0 mt-2 text-muted-foreground",children:["Paste this before ",e.jsx("code",{className:"font-mono",children:"</body>"})," on every page you want reviewed, and deploy."]})]}),e.jsx(P,{uid:r.uid}),e.jsxs("div",{className:"flex items-center",children:[e.jsxs(n,{type:"button",variant:"ghost",onClick:()=>c(1),children:[e.jsx(A,{}),"Back"]}),e.jsx("div",{className:"flex-1"}),e.jsxs(n,{type:"button",onClick:()=>c(3),children:["Done",e.jsx(j,{})]})]})]}),a===3&&e.jsxs(f,{className:"items-center gap-4 p-8 text-center",children:[e.jsx("span",{className:"flex size-11 items-center justify-center rounded-[10px] bg-brand-soft text-brand",children:e.jsx(G,{className:"size-5"})}),e.jsxs("h1",{className:"m-0 text-[21px] font-semibold leading-tight tracking-tight",children:[d||r.name," is set up"]}),e.jsx("p",{className:"m-0 text-muted-foreground",children:"Three things left, in this order."}),e.jsx("ol",{className:"m-0 flex w-full list-none flex-col gap-2 p-0 text-left",children:[["Deploy the site with the tag on every page","Comments start arriving here the moment a page loads it."],["Add a reviewer and send them their link","Your client gets their own link; you can revoke it without touching the site."],["Start the first round","A round is one pass of feedback. Starting the next one closes the last."]].map(([t,s],g)=>e.jsxs("li",{className:"flex gap-3 rounded-md border border-border px-3 py-2.5",children:[e.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-full border border-line-strong text-[11px] text-muted-foreground",children:g+1}),e.jsxs("span",{children:[e.jsx("span",{className:"block text-[13px] font-medium",children:t}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:s})]})]},t))}),e.jsxs(n,{size:"lg",className:"mt-2 w-full",onClick:()=>void b({to:"/s/$site/comments",params:{site:r.uid},replace:!0}),children:["Go to Comments",e.jsx(j,{})]})]})]})})}export{J as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{W as h,r as x,j as e,B as a,G as N,s as y,X as b}from"./index-CHi2CcHb.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,x as b,j as e,h as y,y as N,B as j,q as f,a2 as S}from"./index-CHi2CcHb.js";import{L as c,I as d}from"./label-Dff2Zjcb.js";import{P as C,a as h}from"./parts-CK9SS76R.js";import{S as P}from"./SaveState-BiYh2KgZ.js";import{M as A}from"./McpTokens-CIjBwfT0.js";import{u as k}from"./me-XTwFHhR6.js";import{u as M,a as F}from"./studio-BtXg0XzE.js";import{M as E,S as T,a as D}from"./sun-BwWiB8wj.js";import"./card-B5svGaqA.js";import"./labels--UUyt9uB.js";import"./useQuery-U2FOgJPB.js";import"./useBaseQuery-DI4GfUK8.js";import"./badge-DBzqpvfR.js";import"./useRender-B8Yivtih.js";import"./dialog-qbXy4GE2.js";import"./switch-b0ERMUSk.js";import"./useAriaLabelledBy-B3107P7l.js";import"./useValueChanged-RTamjQR3.js";import"./ConfirmDialog-CLal40kk.js";import"./CopyButton-D_EAOrl1.js";import"./check-C21x2mpF.js";import"./copy-Bik19B-3.js";function z({items:t}){const[a,n]=r.useState(b);return e.jsx("div",{className:"flex gap-2",role:"radiogroup","aria-label":"Theme",children:t.map(s=>e.jsxs("button",{type:"button",role:"radio","aria-checked":a===s.value,onClick:()=>{N(s.value),n(s.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===s.value&&"border-line-strong bg-muted text-foreground"),children:[s.icon,s.label]},s.value))})}function re(){const t=k(),a=M(),[n,s]=r.useState(t.user.name),[u,i]=r.useState(null);r.useEffect(()=>s(t.user.name),[t.user.name]);const m=n.trim()!==t.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(P,{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(n.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:n,onChange:l=>s(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:t.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(H,{})}),!f(t.user.role,"settings")&&f(t.user.role,"review")&&e.jsx(A,{owner:!0,mine:!0,instanceOwner:!1,sites:t.projects}),e.jsx(h,{title:"Appearance",description:"Also in your menu at the bottom of the sidebar.",children:e.jsx(z,{items:[{value:"system",label:"System",icon:e.jsx(E,{className:"size-3.5"})},{value:"light",label:"Light",icon:e.jsx(T,{className:"size-3.5"})},{value:"dark",label:"Dark",icon:e.jsx(D,{className:"size-3.5"})}]})})]})}function H(){const t=F(),[a,n]=r.useState(""),[s,u]=r.useState(""),[i,m]=r.useState(""),[l,g]=r.useState(""),[v,p]=r.useState(!1),x=a.length>0&&s.length>=12&&s===i;return e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:async o=>{if(o.preventDefault(),!(!x||t.isPending)){g("");try{await t.mutateAsync({current:a,next:s}),n(""),u(""),m(""),p(!0)}catch(w){g(S(w))}}},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:o=>{n(o.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:s,onChange:o=>{u(o.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:o=>{m(o.target.value),p(!1)}}),i.length>0&&s!==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:t.isPending,disabled:!x,children:t.isPending?"Changing…":v&&!x?"Changed":"Change password"})})]})}export{re as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aW as I}from"./index-p-qD6BlY.js";var me=e=>e.type==="checkbox",Se=e=>e.type==="file",te=e=>e instanceof Date,p=e=>e==null;const He=e=>typeof e=="object";var N=e=>!p(e)&&!Array.isArray(e)&&He(e)&&!te(e),Gr=e=>N(e)&&e.target?me(e.target)?e.target.checked:Se(e.target)?e.target.files:e.target.value:e;const Kr=/[.[\]'"]/;var ue=e=>e.split(Kr).filter(Boolean),Zr=(e,s)=>s.split(".").some((r,i,l)=>!isNaN(Number(r))&&e.has(l.slice(0,i).join("."))),Te=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function C(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(Te&&(e instanceof Blob||s))return e;const r=Array.isArray(e);if(!r&&e.constructor!==Object)return e;const i=r?[]:Object.create(Object.getPrototypeOf(e));for(const l in e)Object.prototype.hasOwnProperty.call(e,l)&&(i[l]=C(e[l]));return i}const oe={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},X={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},J={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Dr="root",je=["__proto__","constructor","prototype"],Jr=/^\w*$/;var ne=e=>Jr.test(e),O=e=>e===void 0,v=(e,s,r)=>{if(!s||!N(e))return r;const i=ne(s)?[s]:ue(s);if(i.some(u=>je.includes(u)))return r;const l=i.reduce((u,o)=>p(u)?void 0:u[o],e);return O(l)||l===e?O(e[s])?r:e[s]:l},re=e=>typeof e=="boolean",G=e=>typeof e=="function",k=(e,s,r)=>{let i=-1;const l=ne(s)?[s]:ue(s),u=l.length,o=u-1;for(;++i<u;){const c=l[i];let m=r;if(i!==o){const E=e[c];m=N(E)||Array.isArray(E)?E:isNaN(+l[i+1])?{}:[]}if(je.includes(c))return;e[c]=m,e=e[c]}};const Qr=I.createContext(null);Qr.displayName="HookFormControlContext";var Xr=(e,s,r,i=!0)=>{const l={};for(const u in e)Object.defineProperty(l,u,{get:()=>{const o=u;return s._proxyFormState[o]!==X.all&&(s._proxyFormState[o]=!i||X.all),e[o]}});return l};const et=Te?I.useLayoutEffect:I.useEffect;var rt=e=>{const s=e.constructor&&e.constructor.prototype;return N(s)&&s.hasOwnProperty("isPrototypeOf")},Me=e=>p(e)||!He(e);const lr=(e,s)=>s.length===0&&!Array.isArray(e)&&!rt(e);function Q(e,s,r=new WeakMap){if(e===s)return!0;if(Me(e)||Me(s))return Object.is(e,s);if(te(e)&&te(s))return Object.is(e.getTime(),s.getTime());const i=Object.keys(e),l=Object.keys(s);if(i.length!==l.length)return!1;if(lr(e,i)||lr(s,l))return Object.is(e,s);if(!i.length&&Array.isArray(e)!==Array.isArray(s))return!1;const u=r.get(e);if(u&&u.has(s))return!0;if(u)u.add(s);else{const o=new WeakSet;o.add(s),r.set(e,o)}for(const o of i){const c=e[o];if(!(o in s))return!1;if(o!=="ref"){const m=s[o];if(te(c)&&te(m)||(N(c)||Array.isArray(c))&&(N(m)||Array.isArray(m))?!Q(c,m,r):!Object.is(c,m))return!1}}return!0}function tt(e){const s=I.useRef(!1),r=I.useRef(!1),i=I.useRef(void 0),l=I.useRef(0);l.current++,r.current;const u=I.useCallback((c,m,E)=>{if(c&&(s.current||r.current&&l.current>1)){const T=m();Q(i.current,T)||E(T)}s.current=!0},[]),o=I.useCallback((c,m)=>{c&&(i.current=C(m()))},[]);return{resyncIfNeeded:u,snapshot:o}}var M=e=>typeof e=="string",st=(e,s,r,i,l)=>M(e)?(i&&s.watch.add(e),v(r,e,l)):Array.isArray(e)?e.map(u=>(i&&s.watch.add(u),v(r,u,v(l,u)))):(i&&(s.watchAll=!0),r),De=e=>({isOnSubmit:!e||e===X.onSubmit,isOnBlur:e===X.onBlur,isOnChange:e===X.onChange,isOnAll:e===X.all,isOnTouch:e===X.onTouched}),Ue=(e,s,r)=>{if(r)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 Ve=(e,s,r,i)=>{for(const l of r||Object.keys(e)){if(l==="_f")continue;const u=r?v(e,l):e[l];if(u){const{_f:o}=u;if(o){if(o.refs&&o.refs[0]&&s(o.refs[0],l)&&!i)return!0;if(o.ref&&s(o.ref,o.name)&&!i)return!0;if(Ve(u,s))break}else if((N(u)||Array.isArray(u))&&Ve(u,s))break}}};var ur=(e,s,r)=>{const i=v(e,r),l=Array.isArray(i)?i:[];return k(l,Dr,s[r]),k(e,r,l),e},B=e=>N(e)&&!Object.keys(e).length,ke=e=>{if(!Te)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},ze=e=>e.type==="radio",Oe=e=>e instanceof RegExp,Ye=(e,s,r,i,l)=>s?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[i]:l||!0}}:{};const fr={value:!1,isValid:!1},cr={value:!0,isValid:!0};var xr=e=>{if(!Array.isArray(e))return fr;if(e.length>1){const r=e.filter(i=>i&&i.checked&&!i.disabled).map(i=>i.value);return{value:r,isValid:!!r.length}}const s=e[0];return!s||!s.checked||s.disabled?fr:!s.attributes||!("value"in s.attributes)||O(s.value)||s.value===""?cr:{value:s.value,isValid:!0}};const dr={isValid:!1,value:null};var kr=e=>Array.isArray(e)?e.reduce((s,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:s,dr):dr;function yr(e,s,r="validate"){if(M(e)||Array.isArray(e)&&e.every(M)||re(e)&&!e)return{type:r,message:M(e)?e:"",ref:s}}var le=e=>N(e)&&!Oe(e)?e:{value:e,message:""},hr=async(e,s,r,i,l,u)=>{const{ref:o,refs:c,required:m,maxLength:E,minLength:T,min:H,max:j,pattern:$,validate:A,name:F,valueAsNumber:b,mount:fe}=e._f,w=v(r,F);if(!fe||s.has(F))return{};const ee=c?c[0]:o,P=D=>{if(l&&ee.reportValidity){const x=re(D)?"":D||"";c?c.forEach(R=>R.setCustomValidity(x)):ee.setCustomValidity(x),ee.reportValidity()}},S={},ce=ze(o),be=me(o),Ae=ce||be,ae=(b||Se(o))&&O(o.value)&&O(w)||ke(o)&&o.value===""||w===""||Array.isArray(w)&&!w.length,se=Ye.bind(null,F,i,S),Fe=(D,x,R,W=J.maxLength,K=J.minLength)=>{const q=D?x:R;S[F]={type:D?W:K,message:q,ref:o,...se(D?W:K,q)}};if(u?!Array.isArray(w)||!w.length:m&&(!Ae&&(ae||p(w))||re(w)&&!w||be&&!xr(c).isValid||ce&&!kr(c).isValid)){const{value:D,message:x}=M(m)?{value:!!m,message:m}:le(m);if(D&&(S[F]={type:J.required,message:x,ref:ee,...se(J.required,x)},!i))return P(x),S}if(!ae&&(!p(H)||!p(j))){let D,x;const R=le(j),W=le(H);if(!p(w)&&!te(w)&&!isNaN(w)){const K=o.valueAsNumber||w&&+w;p(R.value)||(D=K>R.value),p(W.value)||(x=K<W.value)}else{const K=o.valueAsDate||new Date(w),q=ye=>new Date(new Date().toDateString()+" "+ye),we=o.type=="time",Y=o.type=="week";M(R.value)&&w&&(D=we?q(w)>q(R.value):Y?w>R.value:K>new Date(R.value)),M(W.value)&&w&&(x=we?q(w)<q(W.value):Y?w<W.value:K<new Date(W.value))}if((D||x)&&(Fe(!!D,R.message,W.message,J.max,J.min),!i))return P(S[F].message),S}if((E||T)&&!ae&&(M(w)||u&&Array.isArray(w))){const D=le(E),x=le(T),R=!p(D.value)&&w.length>+D.value,W=!p(x.value)&&w.length<+x.value;if((R||W)&&(Fe(R,D.message,x.message),!i))return P(S[F].message),S}if($&&!ae&&M(w)){const{value:D,message:x}=le($);if(Oe(D)&&!w.match(D)&&(S[F]={type:J.pattern,message:x,ref:o,...se(J.pattern,x)},!i))return P(x),S}if(A){if(G(A)){const D=await A(w,r),x=yr(D,ee);if(x&&(S[F]={...x,...se(J.validate,x.message)},!i))return P(x.message),S}else if(N(A)){let D={};for(const x in A){if(!B(D)&&!i)break;const R=yr(await A[x](w,r),ee,x);R&&(D={...R,...se(x,R.message)},P(R.message),i&&(S[F]=D))}if(!B(D)&&(S[F]={ref:ee,...D},!i))return S}}const de=S[F];return P(de?de.message:!0),S},xe=e=>Array.isArray(e)?e:[e],Or=e=>Array.isArray(e)?e.filter(Boolean):[];function it(e,s){const r=s.length-1;let i=0;for(;i<r;){if(p(e)){e=void 0;break}e=e[s[i]],i++}return e}function nt(e){for(const s in e)if(e.hasOwnProperty(s)&&!O(e[s]))return!1;return!0}function U(e,s){if(M(s)&&Object.prototype.hasOwnProperty.call(e,s))return delete e[s],e;const r=Array.isArray(s)?s:ne(s)?[s]:ue(s);if(r.some(o=>je.includes(String(o))))return e;const i=r.length===1?e:it(e,r),l=r.length-1,u=r[l];return i&&delete i[u],l!==0&&(N(i)&&B(i)||Array.isArray(i)&&nt(i))&&U(e,r.slice(0,-1)),e}const at=I.createContext(null);at.displayName="HookFormContext";var gr=()=>{let e=[];return{get observers(){return e},next:l=>{for(const u of e)u.next&&u.next(l)},subscribe:l=>(e.push(l),{unsubscribe:()=>{e=e.filter(u=>u!==l)}}),unsubscribe:()=>{e=[]}}};function Sr(e,s){const r={};for(const i in e)if(e.hasOwnProperty(i)){const l=e[i],u=s[i];if(l&&N(l)&&u){const o=Sr(l,u);N(o)&&(r[i]=o)}else e[i]&&(r[i]=u)}return r}const vr=(e,s)=>e!==null&&He(e)&&Object.prototype.hasOwnProperty.call(e,s);var ot=(e,s)=>{if(!s)return!1;let r=e;for(const i of ne(s)?[s]:ue(s)){if(!vr(r,i))return vr(e,s);r=r[i]}return!0},Tr=e=>e.type==="select-multiple",lt=e=>ze(e)||me(e),Pe=e=>ke(e)&&e.isConnected;function _r(e){return Array.isArray(e)||N(e)}function Rr(e,s,r="",i=[]){for(const l in e){const u=r?`${r}.${l}`:l,o=e[l];_r(o)&&_r(v(s,u))?Rr(o,s,u,i):i.push(u)}return i}var ut=e=>{for(const s in e)if(G(e[s]))return!0;return!1};function Cr(e){return Array.isArray(e)||N(e)&&!ut(e)}function Lr(e){return!!(e&&"_f"in e)}function Ir(e){return Array.isArray(e)?!e.some(s=>!O(s)):!Object.keys(e).length}function Be(e,s){Array.isArray(e)?e[s]=void 0:delete e[s]}function $e(e,s={},r){for(const i in e){const l=e[i],u=r&&r[i];Cr(l)&&(!Array.isArray(l)||!Lr(u))?(s[i]=Array.isArray(l)?[]:{},$e(l,s[i],u),Ir(s[i])&&Be(s,i)):O(l)||(s[i]=!0)}return s}function ie(e,s,r,i){r||(r=$e(s,{},i));for(const l in e){const u=e[l],o=i&&i[l];Cr(u)&&(!Array.isArray(u)||!Lr(o))?(O(s)||Me(r[l])?r[l]=$e(u,Array.isArray(u)?[]:{},o):ie(u,p(s)?{}:s[l],r[l],o),Ir(r[l])&&Be(r,l)):Q(u,s[l])?Be(r,l):r[l]=!0}return r}var ft=(e,s)=>{const r=s.split("."),i=[];let l=r[0];for(let u=1;u<r.length;l+="."+r[u++])!isNaN(+r[u])&&e.has(l)&&i.push(`${l}.${r[u]}`);return i},Nr=(e,{valueAsNumber:s,valueAsDate:r,setValueAs:i})=>O(e)?e:s?e===""?NaN:e&&+e:r&&M(e)?new Date(e):i?i(e):e;function Vr(e){const s=e.ref;return Se(s)?s.files:ze(s)?kr(e.refs).value:Tr(s)?[...s.selectedOptions].map(({value:r})=>r):me(s)?xr(e.refs).value:Nr(s.value,e)}var ct=(e,s,r,i)=>{const l={};for(const u of e){const o=v(s,u);o&&k(l,u,o._f)}return{criteriaMode:r,names:[...e],fields:l,shouldUseNativeValidation:i}},_e=e=>O(e)?e:Oe(e)?e.source:N(e)?Oe(e.value)?e.value.source:e.value:e;const mr="AsyncFunction";var dt=e=>{if(!e||!e.validate)return!1;if(G(e.validate))return e.validate.constructor.name===mr;if(N(e.validate)){for(const s in e.validate)if(e.validate[s].constructor.name===mr)return!0}return!1},yt=e=>e.mount&&(e.required||!O(e.required)&&e.required!==!1||!O(e.min)||!O(e.max)||!O(e.maxLength)||!O(e.minLength)||e.pattern||e.validate);function br(e,s,r){const i=v(e,r);if(i||ne(r))return{error:i,name:r};const l=r.split(".");for(;l.length;){const u=l.join("."),o=v(s,u),c=v(e,u);if(o&&!Array.isArray(o)&&r!==u)return{name:r};if(c&&c.type)return{name:u,error:c};if(c&&c.root&&c.root.type)return{name:`${u}.root`,error:c.root};l.pop()}return{name:r}}var ht=(e,s,r,i)=>{r(e);const l=Object.keys(e).filter(u=>u!=="name");return!l.length||i&&l.length>=Object.keys(s).length||l.find(u=>s[u]===(!i||X.all))},gt=(e,s,r)=>!e||!s||e===s||xe(e).some(i=>i&&(r?i===s||i.startsWith(s+"."):i.startsWith(s)||s.startsWith(i))),vt=(e,s,r,i,l)=>l.isOnAll?!1:!r&&l.isOnTouch?!(s||e):(r?i.isOnBlur:l.isOnBlur)?!e:(r?i.isOnChange:l.isOnChange)?e:!0,_t=(e,s)=>{const r=v(e,s);!Or(r).length&&!r?.root&&U(e,s)};const Vt={mode:X.onSubmit,reValidateMode:X.onChange,shouldFocusError:!0},pe="form",mt=(e,s)=>{for(const r in e)r in s||delete e[r];Object.assign(e,s)},Ur={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function bt(e={}){let s={...Vt,...e},r={...C(Ur),isLoading:G(s.defaultValues),errors:s.errors||{},disabled:s.disabled||!1},i={},l=N(s.defaultValues)||N(s.values)?C(s.defaultValues||s.values)||{}:{},u=s.shouldUnregister?{}:C(l),o={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const m={},E={};let T=0,H=De(s.mode),j=De(s.reValidateMode);const $={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},A={...$};let F={...A};const b={array:gr(),state:gr()};let fe=0;const w=s.criteriaMode===X.all,ee=(t,a)=>n=>{clearTimeout(E[t]),E[t]=setTimeout(a,n)},P=async t=>{if(!o.keepIsValid&&!s.disabled&&(A.isValid||F.isValid||t)){const a=++fe;let n;s.resolver?(n=B((await R()).errors),a===fe&&S()):n=await q({fields:i,onlyCheckValid:!0,eventType:oe.VALID}),a===fe&&n!==r.isValid&&b.state.next({isValid:n})}},S=(t,a)=>{!s.disabled&&(A.isValidating||A.validatingFields||F.isValidating||F.validatingFields)&&((t||c.mount).forEach(n=>{n&&(a?k(r.validatingFields,n,a):U(r.validatingFields,n))}),b.state.next({validatingFields:r.validatingFields,isValidating:!B(r.validatingFields)}))},ce=()=>{r.dirtyFields=ie(l,u,void 0,i)},be=(t,a=[],n,f,d=!0,y=!0)=>{if(f&&n&&!s.disabled){o.action=!0;const h=v(i,t);if(o.actionArrayLengths.has(t)||o.actionArrayLengths.set(t,Array.isArray(h)?h.length:0),y&&Array.isArray(h)){const V=n(h,f.argA,f.argB);d&&k(i,t,V)}const g=v(r.errors,t);if(y&&Array.isArray(g)){const V=g.root,L=n(g,f.argA,f.argB)||g;V&&(L.root=V),d&&k(r.errors,t,L),_t(r.errors,t)}const _=v(r.touchedFields,t);if((A.touchedFields||F.touchedFields)&&y&&Array.isArray(_)){const V=n(_,f.argA,f.argB);d&&k(r.touchedFields,t,V)}(A.dirtyFields||F.dirtyFields)&&ce(),b.state.next({name:t,isDirty:Y(t,a),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else k(u,t,a)},Ae=(t,a)=>{k(r.errors,t,a),r.errors={...r.errors},b.state.next({errors:r.errors})},ae=t=>{r.errors=t,b.state.next({errors:r.errors,isValid:!1})},se=t=>{const a=ne(t)?[t]:ue(t);let n=u,f=l;for(let d=0;d<a.length-1;d++){const y=a[d];if(n=p(n)?n:n[y],f=p(f)?f:f[y],n===null&&f!==null)return!0}return!1},Fe=t=>{if(!o.actionArrayLengths.size)return!1;const a=ne(t)?[t]:ue(t);let n=u,f="",d=-1,y=0;for(let h=0;h<a.length;h++){if(p(n))return!1;const g=a[h];if(f=f?`${f}.${g}`:g,Array.isArray(n)&&+g>=n.length)return d===-1?!1:h===d?+g<y:!0;o.actionArrayLengths.has(f)&&(d=h+1,y=o.actionArrayLengths.get(f)),n=n[g]}return!1},de=(t,a,n,f)=>{const d=v(i,t);if(d){if(se(t)||Fe(t))return;const y=O(v(u,t)),h=v(u,t,O(n)?v(l,t):n);O(h)||f&&f.defaultChecked||a?k(u,t,a?h:Vr(d._f)):Re(t,h),o.mount&&!o.action&&(P(),y&&r.isDirty&&(A.isDirty||F.isDirty)&&(Y()||(r.isDirty=!1,b.state.next({...r}))),e.shouldUnregister&&y&&!O(v(u,t))&&Ue(t,c)&&(o.watch=!0))}},D=(t,a,n,f,d)=>{let y=!1,h=!1;const g={name:t};if(!s.disabled||f===!0){if(!n||f){const _=Q(v(l,t),a);(A.isDirty||F.isDirty)&&(h=r.isDirty,r.isDirty=g.isDirty=!_||Y(),y=h!==g.isDirty),h=!!v(r.dirtyFields,t),_!==r.isDirty?mt(r.dirtyFields,ie(l,u,void 0,i)):_?U(r.dirtyFields,t):k(r.dirtyFields,t,!0),g.dirtyFields=r.dirtyFields,y=y||(A.dirtyFields||F.dirtyFields)&&h!==!_}if(n){const _=v(r.touchedFields,t);_||(k(r.touchedFields,t,n),g.touchedFields=r.touchedFields,y=y||(A.touchedFields||F.touchedFields)&&_!==n)}y&&d&&b.state.next(g)}return y?g:{}},x=(t,a,n,f)=>{const d=v(r.errors,t),y=(A.isValid||F.isValid)&&re(a)&&r.isValid!==a;if(s.delayError&&n?(m[t]=ee(t,()=>Ae(t,n)),m[t](s.delayError)):(clearTimeout(E[t]),delete m[t],n?k(r.errors,t,n):U(r.errors,t),r.errors={...r.errors}),(n?!Q(d,n):d)||!B(f)||y){const h={...f,...y&&re(a)?{isValid:a}:{},errors:r.errors,name:t};b.state.next(h)}},R=async t=>(S(t,!0),await s.resolver(u,s.context,ct(t||c.mount,i,s.criteriaMode,s.shouldUseNativeValidation))),W=async t=>{const{errors:a}=await R(t);if(S(t),t){for(const n of t){const f=v(a,n);f?c.array.has(n)&&N(f)&&!Object.keys(f).some(d=>!Number.isNaN(Number(d)))?ur(r.errors,{[n]:f},n):k(r.errors,n,f):U(r.errors,n)}r.errors={...r.errors}}else r.errors=a;return a},K=async({name:t,eventType:a})=>{if(e.validate){const n=await e.validate({formValues:u,formState:r,name:t,eventType:a});if(N(n))for(const f in n){const d=n[f];d&&Ee(`${pe}.${f}`,{message:M(d.message)?d.message:"",type:d.type||J.validate})}else M(n)||!n?Ee(pe,{message:n||"",type:J.validate}):Xe(pe);return n}return!0},q=async({fields:t,onlyCheckValid:a,name:n,eventType:f,context:d={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(d.runRootValidation=!0,!await K({name:n,eventType:f})&&(d.valid=!1,a)))return d.valid;for(const y in t){const h=t[y];if(h){const{_f:g,..._}=h;if(g){const V=c.array.has(g.name),L=h._f&&dt(h._f),z=A.validatingFields||A.isValidating||F.validatingFields||F.isValidating;L&&z&&S([g.name],!0);const Z=await hr(h,c.disabled,u,w,s.shouldUseNativeValidation&&!a,V);if(L&&z&&S([g.name]),Z[g.name]&&(d.valid=!1,a)||(!a&&(v(Z,g.name)?V?ur(r.errors,Z,g.name):k(r.errors,g.name,Z[g.name]):U(r.errors,g.name)),e.shouldUseNativeValidation&&Z[g.name]))break}!B(_)&&await q({context:d,onlyCheckValid:a,fields:_,name:y,eventType:f})}}return d.valid},we=()=>{for(const t of c.unMount){const a=v(i,t);a&&(a._f.refs?a._f.refs.every(n=>!Pe(n)):!Pe(a._f.ref))&&Le(t)}c.unMount=new Set},Y=(t,a)=>(t&&a&&k(u,t,a),!Q(o.mount?u:l,l)),ye=(t,a,n)=>st(t,c,{...o.mount?u:O(a)||M(t)?l:a},n,a),Pr=t=>Or(v(o.mount?u:l,t,s.shouldUnregister?v(l,t,[]):[])),Re=(t,a,n={},f=!1,d=!1,y=!1)=>{const h=v(i,t);let g=a;if(h){const _=h._f;_&&(!_.disabled&&k(u,t,Nr(a,_)),g=ke(_.ref)&&p(a)?"":a,Tr(_.ref)?[..._.ref.options].forEach(V=>V.selected=g.includes(V.value)):_.refs?me(_.ref)?_.refs.forEach(V=>{(!V.defaultChecked||!V.disabled)&&(Array.isArray(g)?V.checked=!!g.find(L=>L===V.value):V.checked=g===V.value||!!g)}):_.refs.forEach(V=>V.checked=V.value===g):Se(_.ref)?_.ref.value="":(_.ref.value=g,!_.ref.type&&!d&&!y&&b.state.next({name:t,values:f?u:C(u)})))}(n.shouldDirty||n.shouldTouch)&&D(t,g,n.shouldTouch,n.shouldDirty,!d),n.shouldValidate&&Ce(t,{delayError:n.delayError})},Ge=(t,a,n,f=!1,d=!1,y=!1)=>{c.array.has(t)&&b.array.next({name:t,values:f?u:C(u)});for(const h in a){if(!a.hasOwnProperty(h))continue;const g=a[h],_=t+"."+h,V=v(i,_);(c.array.has(t)||N(g)||V&&!V._f)&&!te(g)?Ge(_,g,n,f,d,y):Re(_,g,n,f,d,y)}},Ke=(t,a,n,f,d=!1)=>{const y=v(i,t),h=c.array.has(t),g=f?a:C(a),_=v(u,t),V=Q(_,g);if(V||k(u,t,g),h)b.array.next({name:t,values:f?u:C(u)}),(A.isDirty||A.dirtyFields||F.isDirty||F.dirtyFields)&&n.shouldDirty&&(ce(),d||b.state.next({name:t,dirtyFields:r.dirtyFields,isDirty:Y(t,g)}));else{const L=Array.isArray(g)&&!g.length||B(g),z=!V&&!d;!y||y._f||p(g)||L?Re(t,g,n,f,d,z):Ge(t,g,n,f,d,z)}if(!V&&!d){const L=Ue(t,c),z=f?u:C(u);if(b.state.next({...L&&r,name:o.mount||L?t:void 0,values:z}),!h)for(const Z of ft(c.array,t))b.state.next({name:Z,values:z})}},he=(t,a,n={})=>Ke(t,a,n,!1),pr=(t,a={})=>{const n=G(t)?t(u):t;if(!Q(u,n)){u={...u,...n};for(const f of c.mount)ot(n,f)&&Ke(f,v(n,f),a,!0,!0);b.state.next({...r,name:void 0,type:void 0,...T?{values:u}:{}}),a.shouldValidate&&P()}},Ze=async t=>{o.mount=!0;const a=t.target;let n=a.name,f=!0;const d=v(i,n),y=h=>{f=Number.isNaN(h)||te(h)&&isNaN(h.getTime())||Q(h,v(u,n,h))};if(d){let h,g;const _=a.type?Vr(d._f):Gr(t),V=t.type===oe.BLUR||t.type===oe.FOCUS_OUT,L=!yt(d._f)&&!e.validate&&!s.resolver&&!v(r.errors,n)&&!d._f.deps,z=L||vt(V,v(r.touchedFields,n),r.isSubmitted,j,H),Z=Ue(n,c,V);if(k(u,n,C(_)),V){if(!a||!a.readOnly){d._f.onBlur&&d._f.onBlur(t);const ve=m[n];ve&&ve(0)}}else d._f.onChange&&d._f.onChange(t);const ge=D(n,_,V),zr=!B(ge)||Z;if(!V&&b.state.next({name:n,type:t.type,...T?{values:C(u)}:{}}),z)return(!L||!r.isValid)&&(A.isValid||F.isValid)&&(s.mode==="onBlur"?V&&P():V||P()),zr&&b.state.next({name:n,...Z?{}:ge});if(!s.resolver&&e.validate&&await K({name:n,eventType:t.type}),!V&&Z&&b.state.next({...r}),s.resolver){const{errors:ve}=await R([n]);if(S([n]),y(_),!f){!B(ge)&&b.state.next(ge);return}const Yr=br(r.errors,i,n),or=br(ve,i,Yr.name||n);h=or.error,n=or.name,g=B(ve)}else S([n],!0),h=(await hr(d,c.disabled,u,w,s.shouldUseNativeValidation))[n],S([n]),y(_),f&&(h?g=!1:(A.isValid||F.isValid)&&(g=await q({fields:i,onlyCheckValid:!0,name:n,eventType:t.type})));f&&(d._f.deps&&(!Array.isArray(d._f.deps)||d._f.deps.length>0)&&Ce(d._f.deps),x(n,g,h,ge))}},Je=(t,a)=>{if(v(r.errors,a)&&t.focus)return t.focus(),1},Ce=async(t,a={})=>{let n,f;const d=xe(t);if(s.resolver){const y=await W(O(t)?t:d);n=B(y),f=t?!d.some(h=>v(y,h)):n}else t?(f=(await Promise.all(d.map(async y=>{const h=v(i,y);return await q({fields:h&&h._f?{[y]:h}:h,eventType:oe.TRIGGER})}))).every(Boolean),!(!f&&!r.isValid)&&P()):f=n=await q({fields:i,name:t,eventType:oe.TRIGGER});if(a.delayError&&s.delayError&&M(t)){const y=v(r.errors,t);y?(U(r.errors,t),m[t]=ee(t,()=>Ae(t,y)),m[t](s.delayError)):(clearTimeout(E[t]),delete m[t])}if(a.shouldTouch)for(const y of t?d:c.mount)!c.array.has(y)&&k(r.touchedFields,y,!0);return b.state.next({...!M(t)||(A.isValid||F.isValid)&&n!==r.isValid?{}:{name:t},...s.resolver||!t?{isValid:n}:{},...a.shouldTouch&&(A.touchedFields||F.touchedFields)?{touchedFields:r.touchedFields}:{},errors:r.errors}),a.shouldFocus&&!f&&Ve(i,Je,t?d:c.mount),f},Mr=(t,a)=>{let n={...o.mount?u:l};return a&&(n=Sr(a.dirtyFields?r.dirtyFields:r.touchedFields,n)),O(t)?n:M(t)?v(n,t):t.map(f=>v(n,f))},Br=t=>O(t)?{...r.errors}:M(t)?v(r.errors,t):t.map(a=>v(r.errors,a)),Qe=(t,a)=>{const n=a||r,f=v(n.errors,t);return{invalid:!!f,isDirty:!!v(n.dirtyFields,t),error:f,isValidating:!!v(r.validatingFields,t),isTouched:!!v(n.touchedFields,t)}},Xe=t=>{const a=t?xe(t):void 0;a?.forEach(n=>U(r.errors,n)),a?a.forEach(n=>{b.state.next({name:n,errors:r.errors})}):(r.errors={},b.state.next({errors:r.errors}))},Ee=(t,a,n)=>{const f=(v(i,t,{_f:{}})._f||{}).ref,d=v(r.errors,t)||{},{ref:y,message:h,type:g,..._}=d;k(r.errors,t,{..._,...a,ref:f}),b.state.next({name:t,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&f&&f.focus&&f.focus()},$r=(t,a)=>{if(G(t)){T++;const{unsubscribe:n}=b.state.subscribe({next:d=>"values"in d&&t(d.values||ye(void 0,a),d)});let f=!1;return{unsubscribe:()=>{f||(f=!0,T--,n())}}}return ye(t,a,!0)},er=t=>{var a;const n=!!(!((a=t.formState)===null||a===void 0)&&a.values);n&&T++;const{unsubscribe:f}=b.state.subscribe({next:y=>{if(gt(t.name,y.name,t.exact)&&ht(y,t.formState||A,nr,t.reRenderRoot)){const h={...u};t.callback({values:h,...r,...y,defaultValues:l})}}});if(!n)return f;let d=!1;return()=>{d||(d=!0,T--,f())}},Wr=t=>(o.mount=!0,F={...F,...t.formState},er({...t,formState:{...$,...t.formState}})),Le=(t,a={})=>{for(const n of t?xe(t):c.mount)c.mount.delete(n),c.array.delete(n),a.keepValue||(U(i,n),U(u,n)),!a.keepError&&U(r.errors,n),!a.keepDirty&&U(r.dirtyFields,n),!a.keepTouched&&U(r.touchedFields,n),!a.keepIsValidating&&U(r.validatingFields,n),!s.shouldUnregister&&!a.keepDefaultValue&&U(l,n);T&&b.state.next({values:C(u)}),b.state.next({...r,...a.keepDirty?{}:{isDirty:Y()}}),!a.keepIsValid&&P()},rr=({disabled:t,name:a})=>{if(re(t)&&o.mount||t||c.disabled.has(a)){const d=c.disabled.has(a)!==!!t;t?c.disabled.add(a):c.disabled.delete(a),d&&o.mount&&!o.action&&P()}},Ie=(t,a={})=>{let n=v(i,t);const f=re(a.disabled)||re(s.disabled),d=!c.registerName.has(t)&&n&&n._f&&!n._f.mount;return k(i,t,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:t}},name:t,mount:!0,...a}}),c.mount.add(t),n&&!d?rr({disabled:re(a.disabled)?a.disabled:s.disabled,name:t}):de(t,!0,a.value),{...f?{disabled:a.disabled||s.disabled}:{},...s.progressive?{required:!!a.required,min:_e(a.min),max:_e(a.max),minLength:_e(a.minLength),maxLength:_e(a.maxLength),pattern:_e(a.pattern)}:{},name:t,onChange:Ze,onBlur:Ze,ref:y=>{if(y){c.registerName.add(t),Ie(t,a),c.registerName.delete(t),n=v(i,t);const h=O(y.value)&&y.querySelectorAll&&y.querySelectorAll("input,select,textarea")[0]||y,g=lt(h),_=n._f.refs||[];if(g?_.find(L=>L===h):h===n._f.ref)return;const V={...n._f};g?(V.refs=[..._.filter(Pe),h,...Array.isArray(v(l,t))?[{}]:[]],V.ref={type:h.type,name:t}):(V.ref=h,delete V.refs),k(i,t,{_f:V}),de(t,!1,void 0,h)}else n=v(i,t,{}),n._f&&(n._f.mount=!1),(s.shouldUnregister||a.shouldUnregister)&&!(Zr(c.array,t)&&o.action)&&c.unMount.add(t)}}},Ne=()=>s.shouldFocusError&&!s.shouldUseNativeValidation&&Ve(i,Je,c.mount),qr=t=>{re(t)&&(b.state.next({disabled:t}),Ve(i,(a,n)=>{const f=v(i,n);f&&(a.disabled=f._f.disabled||t,Array.isArray(f._f.refs)&&f._f.refs.forEach(d=>{d.disabled=f._f.disabled||t}))},0,!1))},tr=(t,a)=>async n=>{let f,d;n&&(n.preventDefault&&n.preventDefault(),n.persist&&n.persist());let y=C(u);if(b.state.next({isSubmitting:!0}),s.resolver){const{errors:h,values:g}=await R();S(),r.errors=h,y=C(g)}else await q({fields:i,eventType:oe.SUBMIT});if(c.disabled.size)for(const h of c.disabled)U(y,h);if(U(r.errors,Dr),B(r.errors)){b.state.next({errors:{}});try{f=await t(y,n)}catch(h){d=h}}else a&&await a({...r.errors},n),Ne(),setTimeout(Ne);if(b.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:B(r.errors)&&!d,submitCount:r.submitCount+1,errors:r.errors}),d)throw d;return f},Hr=(t,a={})=>{v(i,t)&&(O(a.defaultValue)?he(t,C(v(l,t))):(he(t,a.defaultValue),k(l,t,C(a.defaultValue))),a.keepTouched||U(r.touchedFields,t),a.keepDirty||(U(r.dirtyFields,t),r.isDirty=a.defaultValue?Y(t,C(v(l,t))):Y()),a.keepError||(U(r.errors,t),P()),b.state.next({...r}))},sr=(t,a={})=>{const n=t?C(t):l,f=C(n),d=B(t),y=f,h=i;if(a.keepDefaultValues||(l=n),!a.keepValues){if(a.keepDirtyValues){const g=new Set([...c.mount,...Rr(ie(l,u,void 0,h),r.dirtyFields)]);for(const _ of g){const V=v(r.dirtyFields,_),L=v(u,_),z=v(y,_);V&&!O(L)?k(y,_,L):!V&&!O(z)&&he(_,z)}}else{if(Te&&O(t))for(const g of c.mount){const _=v(i,g);if(_&&_._f){const V=Array.isArray(_._f.refs)?_._f.refs[0]:_._f.ref;if(ke(V)){const L=V.closest("form");if(L){L.reset();break}}}}if(a.keepFieldsRef)for(const g of c.mount)he(g,v(y,g));else i={}}if(s.shouldUnregister){if(u=a.keepDefaultValues?C(l):{},a.keepFieldsRef)for(const g of c.mount)k(u,g,v(y,g))}else u=C(y);b.array.next({values:{...y}}),b.state.next({name:void 0,type:void 0,values:{...y}})}c={mount:a.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!A.isValid||!!a.keepIsValid||!!a.keepDirtyValues||!s.shouldUnregister&&!B(y),o.watch=!!s.shouldUnregister,o.keepIsValid=!!a.keepIsValid,o.action=!1,o.actionArrayLengths.clear(),a.keepErrors||(r.errors={}),b.state.next({submitCount:a.keepSubmitCount?r.submitCount:0,isDirty:d?!1:a.keepDirty?r.isDirty:a.keepValues?Y():!!(a.keepDefaultValues&&!Q(t,l)),isSubmitted:a.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:d?{}:a.keepDirtyValues?a.keepDefaultValues&&u?ie(l,u,void 0,h):r.dirtyFields:a.keepDefaultValues&&t?ie(l,t,void 0,h):a.keepDirty?r.dirtyFields:{},touchedFields:a.keepTouched?r.touchedFields:{},errors:a.keepErrors?r.errors:{},isSubmitSuccessful:a.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:l})},ir=(t,a)=>sr(G(t)?t(u):t,{...s.resetOptions,...a}),jr=(t,a={})=>{const n=v(i,t),f=n&&n._f;if(f){const d=f.refs?f.refs[0]:f.ref;d.focus&&setTimeout(()=>{d.focus(),a.shouldSelect&&G(d.select)&&d.select()})}},nr=t=>{const{name:a,type:n,values:f,...d}=t;r={...r,...d}};b.state.subscribe({next:nr});const ar={control:{register:Ie,unregister:Le,getFieldState:Qe,handleSubmit:tr,setError:Ee,_subscribe:er,_runSchema:R,_updateIsValidating:S,_focusError:Ne,_getWatch:ye,_getDirty:Y,_setValid:P,_setFieldArray:be,_setDisabledField:rr,_setErrors:ae,_getFieldArray:Pr,_reset:sr,_resetDefaultValues:()=>G(s.defaultValues)&&s.defaultValues().then(t=>{ir(t,s.resetOptions),b.state.next({isLoading:!1})}),_removeUnmounted:we,_disableForm:qr,_subjects:b,_proxyFormState:A,get _fields(){return i},get _formValues(){return u},get _state(){return o},set _state(t){o=t},get _defaultValues(){return l},get _names(){return c},set _names(t){c=t},get _formState(){return r},get _options(){return s},set _options(t){s={...s,...t},H=De(s.mode),j=De(s.reValidateMode)}},subscribe:Wr,trigger:Ce,register:Ie,handleSubmit:tr,watch:$r,setValue:he,setValues:pr,getValues:Mr,getErrors:Br,reset:ir,resetField:Hr,resetDefaultValues:(t,a={})=>{if(l=C(t),!a.keepDirty){const n=ie(l,u,void 0,i);r.dirtyFields=n,r.isDirty=!B(n)}a.keepIsValid||P(),b.state.next({...r,defaultValues:l})},clearErrors:Xe,unregister:Le,setError:Ee,setFocus:jr,getFieldState:Qe};return{...ar,formControl:ar}}function kt(e={}){const s=I.useRef(void 0),r=I.useRef(void 0),i=I.useRef(e.formControl),[l,u]=I.useState(()=>({...C(Ur),isLoading:G(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:G(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:l},e.defaultValues&&!G(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:E,...T}=bt(e);s.current={...T,formState:l}}const o=s.current.control;o._options=e;const{resyncIfNeeded:c,snapshot:m}=tt();return et(()=>{const E=()=>({...o._formState,defaultValues:o._defaultValues});c(!0,E,u);const T=o._subscribe({formState:o._proxyFormState,callback:()=>u({...o._formState,defaultValues:o._defaultValues}),reRenderRoot:!0});return u(H=>({...H,isReady:!0})),o._formState.isReady=!0,()=>{T(),m(!0,E)}},[o,c,m]),I.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),I.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),I.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),I.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),I.useEffect(()=>{if(o._proxyFormState.isDirty){const E=o._getDirty();E!==l.isDirty&&o._subjects.state.next({isDirty:E})}},[o,l.isDirty]),I.useEffect(()=>{var E;e.values&&!Q(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((E=o._options.resetOptions)===null||E===void 0)&&E.keepIsValid||o._setValid(),r.current=e.values,u(T=>({...T}))):o._resetDefaultValues()},[o,e.values]),I.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),s.current.formState=I.useMemo(()=>Xr(l,o),[o,l]),s.current}const Ar=(e,s,r)=>{if(e&&"reportValidity"in e){const i=v(r,s);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},We=(e,s)=>{for(const r in s.fields){const i=s.fields[r];i&&i.ref&&"reportValidity"in i.ref?Ar(i.ref,r,e):i&&i.refs&&i.refs.forEach(l=>Ar(l,r,e))}},Fr=(e,s)=>{s.shouldUseNativeValidation&&We(e,s);const r={};for(const i in e){const l=v(s.fields,i),u=Object.assign(e[i]||{},{ref:l&&l.refs?l.refs[0]:l&&l.ref});if(At(s.names||Object.keys(e),i)){const o=Object.assign({},v(r,i));k(o,"root",u),k(r,i,o)}else k(r,i,u)}return r},At=(e,s)=>{const r=wr(s).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(i=>wr(i).match(`^${r}\\.\\d+`))};function wr(e){return e.replace(/\[(\d+)]/g,".$1").replace(/[[\]]/g,"")}function qe(){return qe=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var r=arguments[s];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},qe.apply(null,arguments)}function Er(e,s){try{var r=e()}catch(i){return s(i)}return r&&r.then?r.then(void 0,s):r}function Ft(e,s){for(var r=Object.create(null);e.length;){var i=e[0],l=i.code,u=i.message,o=i.path.join(".");if(!r[o])if("unionErrors"in i){var c,m,E=i.unionErrors.reduce(function(j,$){return $.errors.length<j.errors.length?$:j}).errors[0];r[o]={message:(c=E?.message)!=null?c:u,type:(m=E?.code)!=null?m:l}}else r[o]={message:u,type:l};if("unionErrors"in i&&i.unionErrors.forEach(function(j){return j.errors.forEach(function($){return e.push($)})}),s){var T=r[o].types,H=T&&T[i.code];r[o]=Ye(o,s,r,l,H?[].concat(H,i.message):i.message)}e.shift()}return r}function wt(e,s){for(var r=Object.create(null),i=function(){var l=e[0],u=l.code,o=l.message,c=l.path.join(".");if(!r[c])if(l.code==="invalid_union"&&l.errors.length>0){var m,E,T=l.errors.reduce(function($,A){return A.length<$.length?A:$})[0];r[c]={message:(m=T?.message)!=null?m:o,type:(E=T?.code)!=null?E:u}}else r[c]={message:o,type:u};if(l.code==="invalid_union"&&l.errors.forEach(function($){return $.forEach(function(A){return e.push(qe({},A,{path:[].concat(l.path,A.path)}))})}),s){var H=r[c].types,j=H&&H[l.code];r[c]=Ye(c,s,r,u,j?[].concat(j,l.message):l.message)}e.shift()};e.length;)i();return r}function Ot(e,s,r){if(r===void 0&&(r={}),(function(i){return"_zod"in i&&typeof i._zod=="object"})(e))return function(i,l,u){try{return Promise.resolve(Er(function(){function o(m){return u.shouldUseNativeValidation&&We({},u),{errors:{},values:r.raw?Object.assign({},i):m}}var c=e;return r.mode==="sync"?o(c.parse(i,s)):Promise.resolve(c.parseAsync(i,s)).then(o)},function(o){if((function(c){var m;return!(c==null||(m=c._zod)==null||(m=m.traits)==null||!m.has("$ZodError"))})(o))return{values:{},errors:Fr(wt(o.issues,!u.shouldUseNativeValidation&&u.criteriaMode==="all"),u)};throw o}))}catch(o){return Promise.reject(o)}};if((function(i){return"_def"in i&&typeof i._def=="object"})(e))return function(i,l,u){try{return Promise.resolve(Er(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](i,s)).then(function(o){return u.shouldUseNativeValidation&&We({},u),{errors:{},values:r.raw?Object.assign({},i):o}})},function(o){if((function(c){return Array.isArray(c?.issues)})(o))return{values:{},errors:Fr(Ft(o.errors,!u.shouldUseNativeValidation&&u.criteriaMode==="all"),u)};throw o}))}catch(o){return Promise.reject(o)}};throw new Error("Invalid input: not a Zod schema")}export{Ot as a,kt as u};
|
|
1
|
+
import{aX as I}from"./index-CHi2CcHb.js";var me=e=>e.type==="checkbox",Se=e=>e.type==="file",te=e=>e instanceof Date,p=e=>e==null;const He=e=>typeof e=="object";var N=e=>!p(e)&&!Array.isArray(e)&&He(e)&&!te(e),Gr=e=>N(e)&&e.target?me(e.target)?e.target.checked:Se(e.target)?e.target.files:e.target.value:e;const Kr=/[.[\]'"]/;var ue=e=>e.split(Kr).filter(Boolean),Zr=(e,s)=>s.split(".").some((r,i,l)=>!isNaN(Number(r))&&e.has(l.slice(0,i).join("."))),Te=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function C(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(Te&&(e instanceof Blob||s))return e;const r=Array.isArray(e);if(!r&&e.constructor!==Object)return e;const i=r?[]:Object.create(Object.getPrototypeOf(e));for(const l in e)Object.prototype.hasOwnProperty.call(e,l)&&(i[l]=C(e[l]));return i}const oe={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Q={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},X={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Dr="root",je=["__proto__","constructor","prototype"],Xr=/^\w*$/;var ne=e=>Xr.test(e),O=e=>e===void 0,v=(e,s,r)=>{if(!s||!N(e))return r;const i=ne(s)?[s]:ue(s);if(i.some(u=>je.includes(u)))return r;const l=i.reduce((u,o)=>p(u)?void 0:u[o],e);return O(l)||l===e?O(e[s])?r:e[s]:l},re=e=>typeof e=="boolean",G=e=>typeof e=="function",k=(e,s,r)=>{let i=-1;const l=ne(s)?[s]:ue(s),u=l.length,o=u-1;for(;++i<u;){const c=l[i];let m=r;if(i!==o){const E=e[c];m=N(E)||Array.isArray(E)?E:isNaN(+l[i+1])?{}:[]}if(je.includes(c))return;e[c]=m,e=e[c]}};const Jr=I.createContext(null);Jr.displayName="HookFormControlContext";var Qr=(e,s,r,i=!0)=>{const l={};for(const u in e)Object.defineProperty(l,u,{get:()=>{const o=u;return s._proxyFormState[o]!==Q.all&&(s._proxyFormState[o]=!i||Q.all),e[o]}});return l};const et=Te?I.useLayoutEffect:I.useEffect;var rt=e=>{const s=e.constructor&&e.constructor.prototype;return N(s)&&s.hasOwnProperty("isPrototypeOf")},Me=e=>p(e)||!He(e);const lr=(e,s)=>s.length===0&&!Array.isArray(e)&&!rt(e);function J(e,s,r=new WeakMap){if(e===s)return!0;if(Me(e)||Me(s))return Object.is(e,s);if(te(e)&&te(s))return Object.is(e.getTime(),s.getTime());const i=Object.keys(e),l=Object.keys(s);if(i.length!==l.length)return!1;if(lr(e,i)||lr(s,l))return Object.is(e,s);if(!i.length&&Array.isArray(e)!==Array.isArray(s))return!1;const u=r.get(e);if(u&&u.has(s))return!0;if(u)u.add(s);else{const o=new WeakSet;o.add(s),r.set(e,o)}for(const o of i){const c=e[o];if(!(o in s))return!1;if(o!=="ref"){const m=s[o];if(te(c)&&te(m)||(N(c)||Array.isArray(c))&&(N(m)||Array.isArray(m))?!J(c,m,r):!Object.is(c,m))return!1}}return!0}function tt(e){const s=I.useRef(!1),r=I.useRef(!1),i=I.useRef(void 0),l=I.useRef(0);l.current++,r.current;const u=I.useCallback((c,m,E)=>{if(c&&(s.current||r.current&&l.current>1)){const T=m();J(i.current,T)||E(T)}s.current=!0},[]),o=I.useCallback((c,m)=>{c&&(i.current=C(m()))},[]);return{resyncIfNeeded:u,snapshot:o}}var M=e=>typeof e=="string",st=(e,s,r,i,l)=>M(e)?(i&&s.watch.add(e),v(r,e,l)):Array.isArray(e)?e.map(u=>(i&&s.watch.add(u),v(r,u,v(l,u)))):(i&&(s.watchAll=!0),r),De=e=>({isOnSubmit:!e||e===Q.onSubmit,isOnBlur:e===Q.onBlur,isOnChange:e===Q.onChange,isOnAll:e===Q.all,isOnTouch:e===Q.onTouched}),Ue=(e,s,r)=>{if(r)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 Ve=(e,s,r,i)=>{for(const l of r||Object.keys(e)){if(l==="_f")continue;const u=r?v(e,l):e[l];if(u){const{_f:o}=u;if(o){if(o.refs&&o.refs[0]&&s(o.refs[0],l)&&!i)return!0;if(o.ref&&s(o.ref,o.name)&&!i)return!0;if(Ve(u,s))break}else if((N(u)||Array.isArray(u))&&Ve(u,s))break}}};var ur=(e,s,r)=>{const i=v(e,r),l=Array.isArray(i)?i:[];return k(l,Dr,s[r]),k(e,r,l),e},B=e=>N(e)&&!Object.keys(e).length,ke=e=>{if(!Te)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},ze=e=>e.type==="radio",Oe=e=>e instanceof RegExp,Ye=(e,s,r,i,l)=>s?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[i]:l||!0}}:{};const fr={value:!1,isValid:!1},cr={value:!0,isValid:!0};var xr=e=>{if(!Array.isArray(e))return fr;if(e.length>1){const r=e.filter(i=>i&&i.checked&&!i.disabled).map(i=>i.value);return{value:r,isValid:!!r.length}}const s=e[0];return!s||!s.checked||s.disabled?fr:!s.attributes||!("value"in s.attributes)||O(s.value)||s.value===""?cr:{value:s.value,isValid:!0}};const dr={isValid:!1,value:null};var kr=e=>Array.isArray(e)?e.reduce((s,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:s,dr):dr;function yr(e,s,r="validate"){if(M(e)||Array.isArray(e)&&e.every(M)||re(e)&&!e)return{type:r,message:M(e)?e:"",ref:s}}var le=e=>N(e)&&!Oe(e)?e:{value:e,message:""},hr=async(e,s,r,i,l,u)=>{const{ref:o,refs:c,required:m,maxLength:E,minLength:T,min:H,max:j,pattern:$,validate:A,name:F,valueAsNumber:b,mount:fe}=e._f,w=v(r,F);if(!fe||s.has(F))return{};const ee=c?c[0]:o,P=D=>{if(l&&ee.reportValidity){const x=re(D)?"":D||"";c?c.forEach(R=>R.setCustomValidity(x)):ee.setCustomValidity(x),ee.reportValidity()}},S={},ce=ze(o),be=me(o),Ae=ce||be,ae=(b||Se(o))&&O(o.value)&&O(w)||ke(o)&&o.value===""||w===""||Array.isArray(w)&&!w.length,se=Ye.bind(null,F,i,S),Fe=(D,x,R,W=X.maxLength,K=X.minLength)=>{const q=D?x:R;S[F]={type:D?W:K,message:q,ref:o,...se(D?W:K,q)}};if(u?!Array.isArray(w)||!w.length:m&&(!Ae&&(ae||p(w))||re(w)&&!w||be&&!xr(c).isValid||ce&&!kr(c).isValid)){const{value:D,message:x}=M(m)?{value:!!m,message:m}:le(m);if(D&&(S[F]={type:X.required,message:x,ref:ee,...se(X.required,x)},!i))return P(x),S}if(!ae&&(!p(H)||!p(j))){let D,x;const R=le(j),W=le(H);if(!p(w)&&!te(w)&&!isNaN(w)){const K=o.valueAsNumber||w&&+w;p(R.value)||(D=K>R.value),p(W.value)||(x=K<W.value)}else{const K=o.valueAsDate||new Date(w),q=ye=>new Date(new Date().toDateString()+" "+ye),we=o.type=="time",Y=o.type=="week";M(R.value)&&w&&(D=we?q(w)>q(R.value):Y?w>R.value:K>new Date(R.value)),M(W.value)&&w&&(x=we?q(w)<q(W.value):Y?w<W.value:K<new Date(W.value))}if((D||x)&&(Fe(!!D,R.message,W.message,X.max,X.min),!i))return P(S[F].message),S}if((E||T)&&!ae&&(M(w)||u&&Array.isArray(w))){const D=le(E),x=le(T),R=!p(D.value)&&w.length>+D.value,W=!p(x.value)&&w.length<+x.value;if((R||W)&&(Fe(R,D.message,x.message),!i))return P(S[F].message),S}if($&&!ae&&M(w)){const{value:D,message:x}=le($);if(Oe(D)&&!w.match(D)&&(S[F]={type:X.pattern,message:x,ref:o,...se(X.pattern,x)},!i))return P(x),S}if(A){if(G(A)){const D=await A(w,r),x=yr(D,ee);if(x&&(S[F]={...x,...se(X.validate,x.message)},!i))return P(x.message),S}else if(N(A)){let D={};for(const x in A){if(!B(D)&&!i)break;const R=yr(await A[x](w,r),ee,x);R&&(D={...R,...se(x,R.message)},P(R.message),i&&(S[F]=D))}if(!B(D)&&(S[F]={ref:ee,...D},!i))return S}}const de=S[F];return P(de?de.message:!0),S},xe=e=>Array.isArray(e)?e:[e],Or=e=>Array.isArray(e)?e.filter(Boolean):[];function it(e,s){const r=s.length-1;let i=0;for(;i<r;){if(p(e)){e=void 0;break}e=e[s[i]],i++}return e}function nt(e){for(const s in e)if(e.hasOwnProperty(s)&&!O(e[s]))return!1;return!0}function U(e,s){if(M(s)&&Object.prototype.hasOwnProperty.call(e,s))return delete e[s],e;const r=Array.isArray(s)?s:ne(s)?[s]:ue(s);if(r.some(o=>je.includes(String(o))))return e;const i=r.length===1?e:it(e,r),l=r.length-1,u=r[l];return i&&delete i[u],l!==0&&(N(i)&&B(i)||Array.isArray(i)&&nt(i))&&U(e,r.slice(0,-1)),e}const at=I.createContext(null);at.displayName="HookFormContext";var gr=()=>{let e=[];return{get observers(){return e},next:l=>{for(const u of e)u.next&&u.next(l)},subscribe:l=>(e.push(l),{unsubscribe:()=>{e=e.filter(u=>u!==l)}}),unsubscribe:()=>{e=[]}}};function Sr(e,s){const r={};for(const i in e)if(e.hasOwnProperty(i)){const l=e[i],u=s[i];if(l&&N(l)&&u){const o=Sr(l,u);N(o)&&(r[i]=o)}else e[i]&&(r[i]=u)}return r}const vr=(e,s)=>e!==null&&He(e)&&Object.prototype.hasOwnProperty.call(e,s);var ot=(e,s)=>{if(!s)return!1;let r=e;for(const i of ne(s)?[s]:ue(s)){if(!vr(r,i))return vr(e,s);r=r[i]}return!0},Tr=e=>e.type==="select-multiple",lt=e=>ze(e)||me(e),Pe=e=>ke(e)&&e.isConnected;function _r(e){return Array.isArray(e)||N(e)}function Rr(e,s,r="",i=[]){for(const l in e){const u=r?`${r}.${l}`:l,o=e[l];_r(o)&&_r(v(s,u))?Rr(o,s,u,i):i.push(u)}return i}var ut=e=>{for(const s in e)if(G(e[s]))return!0;return!1};function Cr(e){return Array.isArray(e)||N(e)&&!ut(e)}function Lr(e){return!!(e&&"_f"in e)}function Ir(e){return Array.isArray(e)?!e.some(s=>!O(s)):!Object.keys(e).length}function Be(e,s){Array.isArray(e)?e[s]=void 0:delete e[s]}function $e(e,s={},r){for(const i in e){const l=e[i],u=r&&r[i];Cr(l)&&(!Array.isArray(l)||!Lr(u))?(s[i]=Array.isArray(l)?[]:{},$e(l,s[i],u),Ir(s[i])&&Be(s,i)):O(l)||(s[i]=!0)}return s}function ie(e,s,r,i){r||(r=$e(s,{},i));for(const l in e){const u=e[l],o=i&&i[l];Cr(u)&&(!Array.isArray(u)||!Lr(o))?(O(s)||Me(r[l])?r[l]=$e(u,Array.isArray(u)?[]:{},o):ie(u,p(s)?{}:s[l],r[l],o),Ir(r[l])&&Be(r,l)):J(u,s[l])?Be(r,l):r[l]=!0}return r}var ft=(e,s)=>{const r=s.split("."),i=[];let l=r[0];for(let u=1;u<r.length;l+="."+r[u++])!isNaN(+r[u])&&e.has(l)&&i.push(`${l}.${r[u]}`);return i},Nr=(e,{valueAsNumber:s,valueAsDate:r,setValueAs:i})=>O(e)?e:s?e===""?NaN:e&&+e:r&&M(e)?new Date(e):i?i(e):e;function Vr(e){const s=e.ref;return Se(s)?s.files:ze(s)?kr(e.refs).value:Tr(s)?[...s.selectedOptions].map(({value:r})=>r):me(s)?xr(e.refs).value:Nr(s.value,e)}var ct=(e,s,r,i)=>{const l={};for(const u of e){const o=v(s,u);o&&k(l,u,o._f)}return{criteriaMode:r,names:[...e],fields:l,shouldUseNativeValidation:i}},_e=e=>O(e)?e:Oe(e)?e.source:N(e)?Oe(e.value)?e.value.source:e.value:e;const mr="AsyncFunction";var dt=e=>{if(!e||!e.validate)return!1;if(G(e.validate))return e.validate.constructor.name===mr;if(N(e.validate)){for(const s in e.validate)if(e.validate[s].constructor.name===mr)return!0}return!1},yt=e=>e.mount&&(e.required||!O(e.required)&&e.required!==!1||!O(e.min)||!O(e.max)||!O(e.maxLength)||!O(e.minLength)||e.pattern||e.validate);function br(e,s,r){const i=v(e,r);if(i||ne(r))return{error:i,name:r};const l=r.split(".");for(;l.length;){const u=l.join("."),o=v(s,u),c=v(e,u);if(o&&!Array.isArray(o)&&r!==u)return{name:r};if(c&&c.type)return{name:u,error:c};if(c&&c.root&&c.root.type)return{name:`${u}.root`,error:c.root};l.pop()}return{name:r}}var ht=(e,s,r,i)=>{r(e);const l=Object.keys(e).filter(u=>u!=="name");return!l.length||i&&l.length>=Object.keys(s).length||l.find(u=>s[u]===(!i||Q.all))},gt=(e,s,r)=>!e||!s||e===s||xe(e).some(i=>i&&(r?i===s||i.startsWith(s+"."):i.startsWith(s)||s.startsWith(i))),vt=(e,s,r,i,l)=>l.isOnAll?!1:!r&&l.isOnTouch?!(s||e):(r?i.isOnBlur:l.isOnBlur)?!e:(r?i.isOnChange:l.isOnChange)?e:!0,_t=(e,s)=>{const r=v(e,s);!Or(r).length&&!r?.root&&U(e,s)};const Vt={mode:Q.onSubmit,reValidateMode:Q.onChange,shouldFocusError:!0},pe="form",mt=(e,s)=>{for(const r in e)r in s||delete e[r];Object.assign(e,s)},Ur={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function bt(e={}){let s={...Vt,...e},r={...C(Ur),isLoading:G(s.defaultValues),errors:s.errors||{},disabled:s.disabled||!1},i={},l=N(s.defaultValues)||N(s.values)?C(s.defaultValues||s.values)||{}:{},u=s.shouldUnregister?{}:C(l),o={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const m={},E={};let T=0,H=De(s.mode),j=De(s.reValidateMode);const $={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},A={...$};let F={...A};const b={array:gr(),state:gr()};let fe=0;const w=s.criteriaMode===Q.all,ee=(t,a)=>n=>{clearTimeout(E[t]),E[t]=setTimeout(a,n)},P=async t=>{if(!o.keepIsValid&&!s.disabled&&(A.isValid||F.isValid||t)){const a=++fe;let n;s.resolver?(n=B((await R()).errors),a===fe&&S()):n=await q({fields:i,onlyCheckValid:!0,eventType:oe.VALID}),a===fe&&n!==r.isValid&&b.state.next({isValid:n})}},S=(t,a)=>{!s.disabled&&(A.isValidating||A.validatingFields||F.isValidating||F.validatingFields)&&((t||c.mount).forEach(n=>{n&&(a?k(r.validatingFields,n,a):U(r.validatingFields,n))}),b.state.next({validatingFields:r.validatingFields,isValidating:!B(r.validatingFields)}))},ce=()=>{r.dirtyFields=ie(l,u,void 0,i)},be=(t,a=[],n,f,d=!0,y=!0)=>{if(f&&n&&!s.disabled){o.action=!0;const h=v(i,t);if(o.actionArrayLengths.has(t)||o.actionArrayLengths.set(t,Array.isArray(h)?h.length:0),y&&Array.isArray(h)){const V=n(h,f.argA,f.argB);d&&k(i,t,V)}const g=v(r.errors,t);if(y&&Array.isArray(g)){const V=g.root,L=n(g,f.argA,f.argB)||g;V&&(L.root=V),d&&k(r.errors,t,L),_t(r.errors,t)}const _=v(r.touchedFields,t);if((A.touchedFields||F.touchedFields)&&y&&Array.isArray(_)){const V=n(_,f.argA,f.argB);d&&k(r.touchedFields,t,V)}(A.dirtyFields||F.dirtyFields)&&ce(),b.state.next({name:t,isDirty:Y(t,a),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else k(u,t,a)},Ae=(t,a)=>{k(r.errors,t,a),r.errors={...r.errors},b.state.next({errors:r.errors})},ae=t=>{r.errors=t,b.state.next({errors:r.errors,isValid:!1})},se=t=>{const a=ne(t)?[t]:ue(t);let n=u,f=l;for(let d=0;d<a.length-1;d++){const y=a[d];if(n=p(n)?n:n[y],f=p(f)?f:f[y],n===null&&f!==null)return!0}return!1},Fe=t=>{if(!o.actionArrayLengths.size)return!1;const a=ne(t)?[t]:ue(t);let n=u,f="",d=-1,y=0;for(let h=0;h<a.length;h++){if(p(n))return!1;const g=a[h];if(f=f?`${f}.${g}`:g,Array.isArray(n)&&+g>=n.length)return d===-1?!1:h===d?+g<y:!0;o.actionArrayLengths.has(f)&&(d=h+1,y=o.actionArrayLengths.get(f)),n=n[g]}return!1},de=(t,a,n,f)=>{const d=v(i,t);if(d){if(se(t)||Fe(t))return;const y=O(v(u,t)),h=v(u,t,O(n)?v(l,t):n);O(h)||f&&f.defaultChecked||a?k(u,t,a?h:Vr(d._f)):Re(t,h),o.mount&&!o.action&&(P(),y&&r.isDirty&&(A.isDirty||F.isDirty)&&(Y()||(r.isDirty=!1,b.state.next({...r}))),e.shouldUnregister&&y&&!O(v(u,t))&&Ue(t,c)&&(o.watch=!0))}},D=(t,a,n,f,d)=>{let y=!1,h=!1;const g={name:t};if(!s.disabled||f===!0){if(!n||f){const _=J(v(l,t),a);(A.isDirty||F.isDirty)&&(h=r.isDirty,r.isDirty=g.isDirty=!_||Y(),y=h!==g.isDirty),h=!!v(r.dirtyFields,t),_!==r.isDirty?mt(r.dirtyFields,ie(l,u,void 0,i)):_?U(r.dirtyFields,t):k(r.dirtyFields,t,!0),g.dirtyFields=r.dirtyFields,y=y||(A.dirtyFields||F.dirtyFields)&&h!==!_}if(n){const _=v(r.touchedFields,t);_||(k(r.touchedFields,t,n),g.touchedFields=r.touchedFields,y=y||(A.touchedFields||F.touchedFields)&&_!==n)}y&&d&&b.state.next(g)}return y?g:{}},x=(t,a,n,f)=>{const d=v(r.errors,t),y=(A.isValid||F.isValid)&&re(a)&&r.isValid!==a;if(s.delayError&&n?(m[t]=ee(t,()=>Ae(t,n)),m[t](s.delayError)):(clearTimeout(E[t]),delete m[t],n?k(r.errors,t,n):U(r.errors,t),r.errors={...r.errors}),(n?!J(d,n):d)||!B(f)||y){const h={...f,...y&&re(a)?{isValid:a}:{},errors:r.errors,name:t};b.state.next(h)}},R=async t=>(S(t,!0),await s.resolver(u,s.context,ct(t||c.mount,i,s.criteriaMode,s.shouldUseNativeValidation))),W=async t=>{const{errors:a}=await R(t);if(S(t),t){for(const n of t){const f=v(a,n);f?c.array.has(n)&&N(f)&&!Object.keys(f).some(d=>!Number.isNaN(Number(d)))?ur(r.errors,{[n]:f},n):k(r.errors,n,f):U(r.errors,n)}r.errors={...r.errors}}else r.errors=a;return a},K=async({name:t,eventType:a})=>{if(e.validate){const n=await e.validate({formValues:u,formState:r,name:t,eventType:a});if(N(n))for(const f in n){const d=n[f];d&&Ee(`${pe}.${f}`,{message:M(d.message)?d.message:"",type:d.type||X.validate})}else M(n)||!n?Ee(pe,{message:n||"",type:X.validate}):Qe(pe);return n}return!0},q=async({fields:t,onlyCheckValid:a,name:n,eventType:f,context:d={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(d.runRootValidation=!0,!await K({name:n,eventType:f})&&(d.valid=!1,a)))return d.valid;for(const y in t){const h=t[y];if(h){const{_f:g,..._}=h;if(g){const V=c.array.has(g.name),L=h._f&&dt(h._f),z=A.validatingFields||A.isValidating||F.validatingFields||F.isValidating;L&&z&&S([g.name],!0);const Z=await hr(h,c.disabled,u,w,s.shouldUseNativeValidation&&!a,V);if(L&&z&&S([g.name]),Z[g.name]&&(d.valid=!1,a)||(!a&&(v(Z,g.name)?V?ur(r.errors,Z,g.name):k(r.errors,g.name,Z[g.name]):U(r.errors,g.name)),e.shouldUseNativeValidation&&Z[g.name]))break}!B(_)&&await q({context:d,onlyCheckValid:a,fields:_,name:y,eventType:f})}}return d.valid},we=()=>{for(const t of c.unMount){const a=v(i,t);a&&(a._f.refs?a._f.refs.every(n=>!Pe(n)):!Pe(a._f.ref))&&Le(t)}c.unMount=new Set},Y=(t,a)=>(t&&a&&k(u,t,a),!J(o.mount?u:l,l)),ye=(t,a,n)=>st(t,c,{...o.mount?u:O(a)||M(t)?l:a},n,a),Pr=t=>Or(v(o.mount?u:l,t,s.shouldUnregister?v(l,t,[]):[])),Re=(t,a,n={},f=!1,d=!1,y=!1)=>{const h=v(i,t);let g=a;if(h){const _=h._f;_&&(!_.disabled&&k(u,t,Nr(a,_)),g=ke(_.ref)&&p(a)?"":a,Tr(_.ref)?[..._.ref.options].forEach(V=>V.selected=g.includes(V.value)):_.refs?me(_.ref)?_.refs.forEach(V=>{(!V.defaultChecked||!V.disabled)&&(Array.isArray(g)?V.checked=!!g.find(L=>L===V.value):V.checked=g===V.value||!!g)}):_.refs.forEach(V=>V.checked=V.value===g):Se(_.ref)?_.ref.value="":(_.ref.value=g,!_.ref.type&&!d&&!y&&b.state.next({name:t,values:f?u:C(u)})))}(n.shouldDirty||n.shouldTouch)&&D(t,g,n.shouldTouch,n.shouldDirty,!d),n.shouldValidate&&Ce(t,{delayError:n.delayError})},Ge=(t,a,n,f=!1,d=!1,y=!1)=>{c.array.has(t)&&b.array.next({name:t,values:f?u:C(u)});for(const h in a){if(!a.hasOwnProperty(h))continue;const g=a[h],_=t+"."+h,V=v(i,_);(c.array.has(t)||N(g)||V&&!V._f)&&!te(g)?Ge(_,g,n,f,d,y):Re(_,g,n,f,d,y)}},Ke=(t,a,n,f,d=!1)=>{const y=v(i,t),h=c.array.has(t),g=f?a:C(a),_=v(u,t),V=J(_,g);if(V||k(u,t,g),h)b.array.next({name:t,values:f?u:C(u)}),(A.isDirty||A.dirtyFields||F.isDirty||F.dirtyFields)&&n.shouldDirty&&(ce(),d||b.state.next({name:t,dirtyFields:r.dirtyFields,isDirty:Y(t,g)}));else{const L=Array.isArray(g)&&!g.length||B(g),z=!V&&!d;!y||y._f||p(g)||L?Re(t,g,n,f,d,z):Ge(t,g,n,f,d,z)}if(!V&&!d){const L=Ue(t,c),z=f?u:C(u);if(b.state.next({...L&&r,name:o.mount||L?t:void 0,values:z}),!h)for(const Z of ft(c.array,t))b.state.next({name:Z,values:z})}},he=(t,a,n={})=>Ke(t,a,n,!1),pr=(t,a={})=>{const n=G(t)?t(u):t;if(!J(u,n)){u={...u,...n};for(const f of c.mount)ot(n,f)&&Ke(f,v(n,f),a,!0,!0);b.state.next({...r,name:void 0,type:void 0,...T?{values:u}:{}}),a.shouldValidate&&P()}},Ze=async t=>{o.mount=!0;const a=t.target;let n=a.name,f=!0;const d=v(i,n),y=h=>{f=Number.isNaN(h)||te(h)&&isNaN(h.getTime())||J(h,v(u,n,h))};if(d){let h,g;const _=a.type?Vr(d._f):Gr(t),V=t.type===oe.BLUR||t.type===oe.FOCUS_OUT,L=!yt(d._f)&&!e.validate&&!s.resolver&&!v(r.errors,n)&&!d._f.deps,z=L||vt(V,v(r.touchedFields,n),r.isSubmitted,j,H),Z=Ue(n,c,V);if(k(u,n,C(_)),V){if(!a||!a.readOnly){d._f.onBlur&&d._f.onBlur(t);const ve=m[n];ve&&ve(0)}}else d._f.onChange&&d._f.onChange(t);const ge=D(n,_,V),zr=!B(ge)||Z;if(!V&&b.state.next({name:n,type:t.type,...T?{values:C(u)}:{}}),z)return(!L||!r.isValid)&&(A.isValid||F.isValid)&&(s.mode==="onBlur"?V&&P():V||P()),zr&&b.state.next({name:n,...Z?{}:ge});if(!s.resolver&&e.validate&&await K({name:n,eventType:t.type}),!V&&Z&&b.state.next({...r}),s.resolver){const{errors:ve}=await R([n]);if(S([n]),y(_),!f){!B(ge)&&b.state.next(ge);return}const Yr=br(r.errors,i,n),or=br(ve,i,Yr.name||n);h=or.error,n=or.name,g=B(ve)}else S([n],!0),h=(await hr(d,c.disabled,u,w,s.shouldUseNativeValidation))[n],S([n]),y(_),f&&(h?g=!1:(A.isValid||F.isValid)&&(g=await q({fields:i,onlyCheckValid:!0,name:n,eventType:t.type})));f&&(d._f.deps&&(!Array.isArray(d._f.deps)||d._f.deps.length>0)&&Ce(d._f.deps),x(n,g,h,ge))}},Xe=(t,a)=>{if(v(r.errors,a)&&t.focus)return t.focus(),1},Ce=async(t,a={})=>{let n,f;const d=xe(t);if(s.resolver){const y=await W(O(t)?t:d);n=B(y),f=t?!d.some(h=>v(y,h)):n}else t?(f=(await Promise.all(d.map(async y=>{const h=v(i,y);return await q({fields:h&&h._f?{[y]:h}:h,eventType:oe.TRIGGER})}))).every(Boolean),!(!f&&!r.isValid)&&P()):f=n=await q({fields:i,name:t,eventType:oe.TRIGGER});if(a.delayError&&s.delayError&&M(t)){const y=v(r.errors,t);y?(U(r.errors,t),m[t]=ee(t,()=>Ae(t,y)),m[t](s.delayError)):(clearTimeout(E[t]),delete m[t])}if(a.shouldTouch)for(const y of t?d:c.mount)!c.array.has(y)&&k(r.touchedFields,y,!0);return b.state.next({...!M(t)||(A.isValid||F.isValid)&&n!==r.isValid?{}:{name:t},...s.resolver||!t?{isValid:n}:{},...a.shouldTouch&&(A.touchedFields||F.touchedFields)?{touchedFields:r.touchedFields}:{},errors:r.errors}),a.shouldFocus&&!f&&Ve(i,Xe,t?d:c.mount),f},Mr=(t,a)=>{let n={...o.mount?u:l};return a&&(n=Sr(a.dirtyFields?r.dirtyFields:r.touchedFields,n)),O(t)?n:M(t)?v(n,t):t.map(f=>v(n,f))},Br=t=>O(t)?{...r.errors}:M(t)?v(r.errors,t):t.map(a=>v(r.errors,a)),Je=(t,a)=>{const n=a||r,f=v(n.errors,t);return{invalid:!!f,isDirty:!!v(n.dirtyFields,t),error:f,isValidating:!!v(r.validatingFields,t),isTouched:!!v(n.touchedFields,t)}},Qe=t=>{const a=t?xe(t):void 0;a?.forEach(n=>U(r.errors,n)),a?a.forEach(n=>{b.state.next({name:n,errors:r.errors})}):(r.errors={},b.state.next({errors:r.errors}))},Ee=(t,a,n)=>{const f=(v(i,t,{_f:{}})._f||{}).ref,d=v(r.errors,t)||{},{ref:y,message:h,type:g,..._}=d;k(r.errors,t,{..._,...a,ref:f}),b.state.next({name:t,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&f&&f.focus&&f.focus()},$r=(t,a)=>{if(G(t)){T++;const{unsubscribe:n}=b.state.subscribe({next:d=>"values"in d&&t(d.values||ye(void 0,a),d)});let f=!1;return{unsubscribe:()=>{f||(f=!0,T--,n())}}}return ye(t,a,!0)},er=t=>{var a;const n=!!(!((a=t.formState)===null||a===void 0)&&a.values);n&&T++;const{unsubscribe:f}=b.state.subscribe({next:y=>{if(gt(t.name,y.name,t.exact)&&ht(y,t.formState||A,nr,t.reRenderRoot)){const h={...u};t.callback({values:h,...r,...y,defaultValues:l})}}});if(!n)return f;let d=!1;return()=>{d||(d=!0,T--,f())}},Wr=t=>(o.mount=!0,F={...F,...t.formState},er({...t,formState:{...$,...t.formState}})),Le=(t,a={})=>{for(const n of t?xe(t):c.mount)c.mount.delete(n),c.array.delete(n),a.keepValue||(U(i,n),U(u,n)),!a.keepError&&U(r.errors,n),!a.keepDirty&&U(r.dirtyFields,n),!a.keepTouched&&U(r.touchedFields,n),!a.keepIsValidating&&U(r.validatingFields,n),!s.shouldUnregister&&!a.keepDefaultValue&&U(l,n);T&&b.state.next({values:C(u)}),b.state.next({...r,...a.keepDirty?{}:{isDirty:Y()}}),!a.keepIsValid&&P()},rr=({disabled:t,name:a})=>{if(re(t)&&o.mount||t||c.disabled.has(a)){const d=c.disabled.has(a)!==!!t;t?c.disabled.add(a):c.disabled.delete(a),d&&o.mount&&!o.action&&P()}},Ie=(t,a={})=>{let n=v(i,t);const f=re(a.disabled)||re(s.disabled),d=!c.registerName.has(t)&&n&&n._f&&!n._f.mount;return k(i,t,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:t}},name:t,mount:!0,...a}}),c.mount.add(t),n&&!d?rr({disabled:re(a.disabled)?a.disabled:s.disabled,name:t}):de(t,!0,a.value),{...f?{disabled:a.disabled||s.disabled}:{},...s.progressive?{required:!!a.required,min:_e(a.min),max:_e(a.max),minLength:_e(a.minLength),maxLength:_e(a.maxLength),pattern:_e(a.pattern)}:{},name:t,onChange:Ze,onBlur:Ze,ref:y=>{if(y){c.registerName.add(t),Ie(t,a),c.registerName.delete(t),n=v(i,t);const h=O(y.value)&&y.querySelectorAll&&y.querySelectorAll("input,select,textarea")[0]||y,g=lt(h),_=n._f.refs||[];if(g?_.find(L=>L===h):h===n._f.ref)return;const V={...n._f};g?(V.refs=[..._.filter(Pe),h,...Array.isArray(v(l,t))?[{}]:[]],V.ref={type:h.type,name:t}):(V.ref=h,delete V.refs),k(i,t,{_f:V}),de(t,!1,void 0,h)}else n=v(i,t,{}),n._f&&(n._f.mount=!1),(s.shouldUnregister||a.shouldUnregister)&&!(Zr(c.array,t)&&o.action)&&c.unMount.add(t)}}},Ne=()=>s.shouldFocusError&&!s.shouldUseNativeValidation&&Ve(i,Xe,c.mount),qr=t=>{re(t)&&(b.state.next({disabled:t}),Ve(i,(a,n)=>{const f=v(i,n);f&&(a.disabled=f._f.disabled||t,Array.isArray(f._f.refs)&&f._f.refs.forEach(d=>{d.disabled=f._f.disabled||t}))},0,!1))},tr=(t,a)=>async n=>{let f,d;n&&(n.preventDefault&&n.preventDefault(),n.persist&&n.persist());let y=C(u);if(b.state.next({isSubmitting:!0}),s.resolver){const{errors:h,values:g}=await R();S(),r.errors=h,y=C(g)}else await q({fields:i,eventType:oe.SUBMIT});if(c.disabled.size)for(const h of c.disabled)U(y,h);if(U(r.errors,Dr),B(r.errors)){b.state.next({errors:{}});try{f=await t(y,n)}catch(h){d=h}}else a&&await a({...r.errors},n),Ne(),setTimeout(Ne);if(b.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:B(r.errors)&&!d,submitCount:r.submitCount+1,errors:r.errors}),d)throw d;return f},Hr=(t,a={})=>{v(i,t)&&(O(a.defaultValue)?he(t,C(v(l,t))):(he(t,a.defaultValue),k(l,t,C(a.defaultValue))),a.keepTouched||U(r.touchedFields,t),a.keepDirty||(U(r.dirtyFields,t),r.isDirty=a.defaultValue?Y(t,C(v(l,t))):Y()),a.keepError||(U(r.errors,t),P()),b.state.next({...r}))},sr=(t,a={})=>{const n=t?C(t):l,f=C(n),d=B(t),y=f,h=i;if(a.keepDefaultValues||(l=n),!a.keepValues){if(a.keepDirtyValues){const g=new Set([...c.mount,...Rr(ie(l,u,void 0,h),r.dirtyFields)]);for(const _ of g){const V=v(r.dirtyFields,_),L=v(u,_),z=v(y,_);V&&!O(L)?k(y,_,L):!V&&!O(z)&&he(_,z)}}else{if(Te&&O(t))for(const g of c.mount){const _=v(i,g);if(_&&_._f){const V=Array.isArray(_._f.refs)?_._f.refs[0]:_._f.ref;if(ke(V)){const L=V.closest("form");if(L){L.reset();break}}}}if(a.keepFieldsRef)for(const g of c.mount)he(g,v(y,g));else i={}}if(s.shouldUnregister){if(u=a.keepDefaultValues?C(l):{},a.keepFieldsRef)for(const g of c.mount)k(u,g,v(y,g))}else u=C(y);b.array.next({values:{...y}}),b.state.next({name:void 0,type:void 0,values:{...y}})}c={mount:a.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!A.isValid||!!a.keepIsValid||!!a.keepDirtyValues||!s.shouldUnregister&&!B(y),o.watch=!!s.shouldUnregister,o.keepIsValid=!!a.keepIsValid,o.action=!1,o.actionArrayLengths.clear(),a.keepErrors||(r.errors={}),b.state.next({submitCount:a.keepSubmitCount?r.submitCount:0,isDirty:d?!1:a.keepDirty?r.isDirty:a.keepValues?Y():!!(a.keepDefaultValues&&!J(t,l)),isSubmitted:a.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:d?{}:a.keepDirtyValues?a.keepDefaultValues&&u?ie(l,u,void 0,h):r.dirtyFields:a.keepDefaultValues&&t?ie(l,t,void 0,h):a.keepDirty?r.dirtyFields:{},touchedFields:a.keepTouched?r.touchedFields:{},errors:a.keepErrors?r.errors:{},isSubmitSuccessful:a.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:l})},ir=(t,a)=>sr(G(t)?t(u):t,{...s.resetOptions,...a}),jr=(t,a={})=>{const n=v(i,t),f=n&&n._f;if(f){const d=f.refs?f.refs[0]:f.ref;d.focus&&setTimeout(()=>{d.focus(),a.shouldSelect&&G(d.select)&&d.select()})}},nr=t=>{const{name:a,type:n,values:f,...d}=t;r={...r,...d}};b.state.subscribe({next:nr});const ar={control:{register:Ie,unregister:Le,getFieldState:Je,handleSubmit:tr,setError:Ee,_subscribe:er,_runSchema:R,_updateIsValidating:S,_focusError:Ne,_getWatch:ye,_getDirty:Y,_setValid:P,_setFieldArray:be,_setDisabledField:rr,_setErrors:ae,_getFieldArray:Pr,_reset:sr,_resetDefaultValues:()=>G(s.defaultValues)&&s.defaultValues().then(t=>{ir(t,s.resetOptions),b.state.next({isLoading:!1})}),_removeUnmounted:we,_disableForm:qr,_subjects:b,_proxyFormState:A,get _fields(){return i},get _formValues(){return u},get _state(){return o},set _state(t){o=t},get _defaultValues(){return l},get _names(){return c},set _names(t){c=t},get _formState(){return r},get _options(){return s},set _options(t){s={...s,...t},H=De(s.mode),j=De(s.reValidateMode)}},subscribe:Wr,trigger:Ce,register:Ie,handleSubmit:tr,watch:$r,setValue:he,setValues:pr,getValues:Mr,getErrors:Br,reset:ir,resetField:Hr,resetDefaultValues:(t,a={})=>{if(l=C(t),!a.keepDirty){const n=ie(l,u,void 0,i);r.dirtyFields=n,r.isDirty=!B(n)}a.keepIsValid||P(),b.state.next({...r,defaultValues:l})},clearErrors:Qe,unregister:Le,setError:Ee,setFocus:jr,getFieldState:Je};return{...ar,formControl:ar}}function kt(e={}){const s=I.useRef(void 0),r=I.useRef(void 0),i=I.useRef(e.formControl),[l,u]=I.useState(()=>({...C(Ur),isLoading:G(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:G(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:l},e.defaultValues&&!G(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:E,...T}=bt(e);s.current={...T,formState:l}}const o=s.current.control;o._options=e;const{resyncIfNeeded:c,snapshot:m}=tt();return et(()=>{const E=()=>({...o._formState,defaultValues:o._defaultValues});c(!0,E,u);const T=o._subscribe({formState:o._proxyFormState,callback:()=>u({...o._formState,defaultValues:o._defaultValues}),reRenderRoot:!0});return u(H=>({...H,isReady:!0})),o._formState.isReady=!0,()=>{T(),m(!0,E)}},[o,c,m]),I.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),I.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),I.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),I.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),I.useEffect(()=>{if(o._proxyFormState.isDirty){const E=o._getDirty();E!==l.isDirty&&o._subjects.state.next({isDirty:E})}},[o,l.isDirty]),I.useEffect(()=>{var E;e.values&&!J(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((E=o._options.resetOptions)===null||E===void 0)&&E.keepIsValid||o._setValid(),r.current=e.values,u(T=>({...T}))):o._resetDefaultValues()},[o,e.values]),I.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),s.current.formState=I.useMemo(()=>Qr(l,o),[o,l]),s.current}const Ar=(e,s,r)=>{if(e&&"reportValidity"in e){const i=v(r,s);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},We=(e,s)=>{for(const r in s.fields){const i=s.fields[r];i&&i.ref&&"reportValidity"in i.ref?Ar(i.ref,r,e):i&&i.refs&&i.refs.forEach(l=>Ar(l,r,e))}},Fr=(e,s)=>{s.shouldUseNativeValidation&&We(e,s);const r={};for(const i in e){const l=v(s.fields,i),u=Object.assign(e[i]||{},{ref:l&&l.refs?l.refs[0]:l&&l.ref});if(At(s.names||Object.keys(e),i)){const o=Object.assign({},v(r,i));k(o,"root",u),k(r,i,o)}else k(r,i,u)}return r},At=(e,s)=>{const r=wr(s).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(i=>wr(i).match(`^${r}\\.\\d+`))};function wr(e){return e.replace(/\[(\d+)]/g,".$1").replace(/[[\]]/g,"")}function qe(){return qe=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var r=arguments[s];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},qe.apply(null,arguments)}function Er(e,s){try{var r=e()}catch(i){return s(i)}return r&&r.then?r.then(void 0,s):r}function Ft(e,s){for(var r=Object.create(null);e.length;){var i=e[0],l=i.code,u=i.message,o=i.path.join(".");if(!r[o])if("unionErrors"in i){var c,m,E=i.unionErrors.reduce(function(j,$){return $.errors.length<j.errors.length?$:j}).errors[0];r[o]={message:(c=E?.message)!=null?c:u,type:(m=E?.code)!=null?m:l}}else r[o]={message:u,type:l};if("unionErrors"in i&&i.unionErrors.forEach(function(j){return j.errors.forEach(function($){return e.push($)})}),s){var T=r[o].types,H=T&&T[i.code];r[o]=Ye(o,s,r,l,H?[].concat(H,i.message):i.message)}e.shift()}return r}function wt(e,s){for(var r=Object.create(null),i=function(){var l=e[0],u=l.code,o=l.message,c=l.path.join(".");if(!r[c])if(l.code==="invalid_union"&&l.errors.length>0){var m,E,T=l.errors.reduce(function($,A){return A.length<$.length?A:$})[0];r[c]={message:(m=T?.message)!=null?m:o,type:(E=T?.code)!=null?E:u}}else r[c]={message:o,type:u};if(l.code==="invalid_union"&&l.errors.forEach(function($){return $.forEach(function(A){return e.push(qe({},A,{path:[].concat(l.path,A.path)}))})}),s){var H=r[c].types,j=H&&H[l.code];r[c]=Ye(c,s,r,u,j?[].concat(j,l.message):l.message)}e.shift()};e.length;)i();return r}function Ot(e,s,r){if(r===void 0&&(r={}),(function(i){return"_zod"in i&&typeof i._zod=="object"})(e))return function(i,l,u){try{return Promise.resolve(Er(function(){function o(m){return u.shouldUseNativeValidation&&We({},u),{errors:{},values:r.raw?Object.assign({},i):m}}var c=e;return r.mode==="sync"?o(c.parse(i,s)):Promise.resolve(c.parseAsync(i,s)).then(o)},function(o){if((function(c){var m;return!(c==null||(m=c._zod)==null||(m=m.traits)==null||!m.has("$ZodError"))})(o))return{values:{},errors:Fr(wt(o.issues,!u.shouldUseNativeValidation&&u.criteriaMode==="all"),u)};throw o}))}catch(o){return Promise.reject(o)}};if((function(i){return"_def"in i&&typeof i._def=="object"})(e))return function(i,l,u){try{return Promise.resolve(Er(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](i,s)).then(function(o){return u.shouldUseNativeValidation&&We({},u),{errors:{},values:r.raw?Object.assign({},i):o}})},function(o){if((function(c){return Array.isArray(c?.issues)})(o))return{values:{},errors:Fr(Ft(o.errors,!u.shouldUseNativeValidation&&u.criteriaMode==="all"),u)};throw o}))}catch(o){return Promise.reject(o)}};throw new Error("Invalid input: not a Zod schema")}export{Ot as a,kt as u};
|
|
@@ -21,8 +21,8 @@
|
|
|
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-
|
|
25
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
24
|
+
<script type="module" crossorigin src="/assets/index-CHi2CcHb.js"></script>
|
|
25
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Ie8QH3El.css">
|
|
26
26
|
</head>
|
|
27
27
|
<body>
|
|
28
28
|
<div id="app"></div>
|
package/static/widget/build.json
CHANGED
package/static/widget/snag.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
`).slice(0,10).join(`
|
|
3
3
|
`):"";return(o?`${r}
|
|
4
4
|
${o}`:r).slice(0,1024)}return t.nodeType!==void 0?typeof t.tagName=="string"?`<${t.tagName.toLowerCase()}>`:"[Node]":Array.isArray(e)?`[Array(${e.length})]`:`[${Object.prototype.toString.call(e).slice(8,-1)}]`}catch{return"[unreadable]"}}function K(e,t,r){const o=[];let n=0,c=0,i=0,a=0,s=null,d=0;const m=(f,p,u)=>{if(!(d>=3))try{const w=Date.now();if(w-c>250&&(a&&(o.push([w,"system","info",`${a} records suppressed (flood guard)`]),a=0),c=w,i=0),++i>50){a++;return}const h=[w,f,p,u];if(s){s(h);return}for(o.push(h);o.length>100;)o.shift(),n++;d=0}catch{d++}};m("navigation","info",e.location.href),e.addEventListener("error",f=>{try{const p=f.target;if(p&&p!==e&&typeof p.tagName=="string"){m("error","error",`Failed to load <${p.tagName.toLowerCase()}> ${p.src??p.href??""}`);return}const u=f,w=`${u.message??"Script error"} (${u.filename??""}:${u.lineno??0}:${u.colno??0})`,h=u.error?`
|
|
5
|
-
${E(u.error)}`:"";m("error","error",`${w}${h}`)}catch{d++}},{capture:!0,signal:r}),e.addEventListener("unhandledrejection",f=>{try{m("error","error",`Unhandled rejection: ${E(f.reason)}`)}catch{d++}},{signal:r});const l=[];if(t.early){let f=!1;for(const p of["error","warn"])l.push(D(e.console,p,u=>function(...w){const h=u.apply(this,w);return f||(f=!0,m("console",p,w.map(E).join(" ").slice(0,4096)),f=!1),h}))}const b=()=>{for(const f of l)f();l.length=0,s=null,o.length=0};return r.addEventListener("abort",b,{once:!0}),{drain(f){const u={records:o.slice(),dropped:n};return o.length=0,n=0,s=f,u},destroy:b}}const S="0.1.
|
|
5
|
+
${E(u.error)}`:"";m("error","error",`${w}${h}`)}catch{d++}},{capture:!0,signal:r}),e.addEventListener("unhandledrejection",f=>{try{m("error","error",`Unhandled rejection: ${E(f.reason)}`)}catch{d++}},{signal:r});const l=[];if(t.early){let f=!1;for(const p of["error","warn"])l.push(D(e.console,p,u=>function(...w){const h=u.apply(this,w);return f||(f=!0,m("console",p,w.map(E).join(" ").slice(0,4096)),f=!1),h}))}const b=()=>{for(const f of l)f();l.length=0,s=null,o.length=0};return r.addEventListener("abort",b,{once:!0}),{drain(f){const u={records:o.slice(),dropped:n};return o.length=0,n=0,s=f,u},destroy:b}}const S="0.1.43+21f0bc",A=Y();function Y(){try{const e=location.hash.slice(1);if(!e.includes($("k")))return;const t=new URLSearchParams(e),r=t.get($("k"))??void 0;if(!r)return;t.delete($("k"));const o=t.toString(),n=location.pathname+location.search+(o?`#${o}`:"");return history.replaceState(history.state,"",n),r}catch{return}}const q=["site","host","disabled","env","mode","hotkey","allowAutomation","assetBase","theme","autoMount","storage"];function W(e){const t=e[g.config];return t&&typeof t=="object"?t:void 0}function V(e,t){const r={};for(const o of q){const n=t?.[o];(typeof n=="string"||typeof n=="number")&&(r[o]=String(n));const c=e?.getAttribute(y(o));c!=null&&(r[o]=c)}return r}function H(e,t){const r=new URL(e,t);return r.searchParams.set("cv",S),r.href}function J(e,t){const r=e.assetBase??window[g.assetBase];if(r)return new URL(r,location.href).href.replace(/\/?$/,"/");const o=t?.src;return o?new URL(".",o).href:new URL(".",location.href).href}function P(){const e=new Map,t=(r,o)=>void e.get(r)?.delete(o);return{on(r,o){let n=e.get(r);return n||e.set(r,n=new Set),n.add(o),()=>t(r,o)},off:t,emit(r,o){const n=e.get(r);if(n)for(const c of[...n])try{c(o)}catch(i){console.error(`[${v}] listener for "${r}" threw`,i)}document.dispatchEvent(new CustomEvent(`${O}${r}`,{detail:o,bubbles:!1,composed:!1}))}}}function X(e,t,r){let o=!1;const n=()=>{o||(o=!0,console.info(`[${v}] not activated: ${r}`))},c=P(),i={version:S,config:e,assetBase:t,state:"inert",pointerMode:"browse",activated:!1,init:()=>(n(),Promise.resolve(i)),activate:()=>(n(),Promise.resolve(null)),deactivate:()=>{},destroy:()=>{},setMode:n,setRoute:n,open:()=>(n(),Promise.resolve({ok:!1,reason:"inert"})),resync:()=>{},close:()=>{},on:c.on,off:c.off};return i}function C(e){const t=window.requestIdleCallback;typeof t=="function"?t(e,{timeout:2e3}):setTimeout(e,1)}function j(e){if(document.readyState==="complete"){C(e);return}window.addEventListener("load",()=>requestAnimationFrame(()=>requestAnimationFrame(()=>C(e))),{once:!0})}function z(e,t,r){t.hotkey!=="off"&&document.addEventListener("keydown",o=>{if(!(!o.altKey||o.ctrlKey||o.metaKey)&&o.code==="KeyC"){if(o.preventDefault(),e.state==="active"){e.setMode(e.pointerMode==="add"?"comments":"add");return}e.activate().catch(()=>{})}},{capture:!0,signal:r})}function Q(e,t,r,o){let n=null,c,i="dormant",a=null,s=0;const d=P(),m={version:S,config:e,assetBase:t,get state(){return i},get pointerMode(){return i==="active"&&a?a.getState():"browse"},activated:!1,init(l){return l&&Object.assign(e,l),n?n.then(()=>m,()=>m):Promise.resolve(m)},activate(l){if(i==="destroyed")return Promise.resolve(null);if(a&&i!=="active"&&(i="active",d.emit("activated",{mode:a.getState()})),!n){const b=H(T.runtime,t);n=import(b).then(f=>i==="destroyed"?null:(m.activated=!0,i="active",a=f.mount(void 0,{assetBase:t,config:e,emit:d.emit,...o?{early:o}:{},...A?{reviewToken:A}:{}}),c!==void 0&&a.setRoute(c),d.emit("ready",{version:S,state:i}),d.emit("activated",{mode:a.getState()}),a)).catch(f=>{throw n=null,console.error(`[${v}] runtime failed to load from ${b}`,f),d.emit("error",{code:"runtime-load-failed",message:b,cause:f}),f})}return l?.mode?n.then(b=>(a?.setState(l.mode),b)):n},deactivate(){i!=="active"||!a||(a.closePanel(),a.setState("browse"),i="dormant",d.emit("deactivated",{}))},destroy(){if(i!=="destroyed"){r.abort(),s&&cancelAnimationFrame(s),s=0;try{a?.destroy()}catch(l){console.error(`[${v}] destroy failed`,l)}a=null,n=null,i="destroyed",m.activated=!1,d.emit("destroyed",{})}},setMode(l){if(i!=="destroyed"){if(i==="active"&&a){a.setState(l);return}m.activate({mode:l}).catch(()=>{})}},setRoute(l){c=l,a?.setRoute(l)},async open(l){return i==="destroyed"?{ok:!1,reason:"inert"}:await m.activate()?a.open(l):{ok:!1,reason:"inert"}},resync(){i!=="active"||s||(s=requestAnimationFrame(()=>{s=0,a?.refresh()}))},close(){a?.closePanel()},on:d.on,off:d.off};return Object.assign(m,{signal:r.signal})}const Z=`${O}stub-init`;function ee(){if(typeof document>"u"||typeof window>"u")return;const e=performance.now(),t=document.currentScript,r=window,o=W(r),n=V(t,o),c=J(n,t);F(n,t?.src);let i="";try{i=document.cookie}catch{}const a=n.site?!!x(n.site):!1,s=I({config:n,search:location.search,cookie:i,webdriver:navigator.webdriver,globals:r,inReview:!!A||a,...o?{configGlobal:o}:{},origin:location.origin}),d=Symbol.for(R.instance),m=r[g.api];if(m?.[d]){(m.__duplicates??=[]).push({version:S,src:t?.src??""}),console.warn(`[${v}] a second copy of the script is on this page and was ignored; the first one is running. See window.${g.api}.__duplicates.`);return}const l=m===void 0?g.api:g.collisionFallback;if(l===g.collisionFallback&&console.warn(`[${v}] window.${g.api} is taken; installing at window.${g.collisionFallback}.`),s){const h=X(n,c,s.gate);h[d]=!0,r[l]=h,s.silent||console.info(`[${v}] not activated: ${s.gate} \u2014 ${s.fix}`);return}const b=new AbortController,f=o?.breadcrumbs,p=f===!1?void 0:K(window,{early:f?.early!==!1},b.signal),u=Q(n,c,b,p);u[d]=!0,r[l]=u,te(e),z(u,n,u.signal);const w=new URLSearchParams(location.search).has($("t"));(n.mode==="on"||w||A||a)&&n.autoMount!=="false"?j(()=>void u.activate().catch(()=>{})):n.site&&n.host&&n.mode!=="off"&&n.autoMount!=="false"&&fetch(`${n.host.replace(/\/+$/,"")}/api/v1/projects/${n.site}/config`).then(h=>h.ok?h.json():null).then(h=>{h?.writeMode==="open"&&h.writable!==!1&&j(()=>void u.activate().catch(()=>{}))}).catch(()=>{})}function te(e){try{performance.measure(Z,{start:e})}catch{}}ee()})();
|