@qratilabs/qrati-connect 2.5.0 → 2.5.2
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/CHANGELOG.md +19 -0
- package/element/{AuthLayout-EC2U3nsK.js → AuthLayout-IGFGeMq5.js} +1 -1
- package/element/{ContentsPage-BGtOyWxg.js → ContentsPage-Bu42OF-F.js} +1 -1
- package/element/{CuratePage-BLa771HN.js → CuratePage-CBMluidb.js} +1 -1
- package/element/{Dialog-D3m_eBiJ.js → Dialog-DVSvxBn8.js} +1 -1
- package/element/{DotLottiePlayer-FgGW1IR7.js → DotLottiePlayer-DHVhIw5H.js} +1 -1
- package/element/{EventHeaderAdminButtons-CW2SupWX.js → EventHeaderAdminButtons-zE3NbEUA.js} +1 -1
- package/element/{FolderBreadcrumb-CUpIfUTx.js → FolderBreadcrumb-1w72I1FP.js} +1 -1
- package/element/{ForgotPasswordPage-Cd0Oj-RE.js → ForgotPasswordPage-CIw8RrkZ.js} +1 -1
- package/element/{InputField-B_y35j-5.js → InputField-XP30segE.js} +1 -1
- package/element/{LazyLoadImage-CQL8-B3z.js → LazyLoadImage-n94OUygV.js} +1 -1
- package/element/{LeaderboardPage-BRBrFWpp.js → LeaderboardPage-CGuP207i.js} +1 -1
- package/element/{LoginPage-Ba9HTjV1.js → LoginPage-B15CMpYe.js} +1 -1
- package/element/{NCMVHL6D-CCAMoHuQ.js → NCMVHL6D-D_O5jdHL.js} +1 -1
- package/element/{PublicEvents-CddoYNW6.js → PublicEvents-DOp9N4xU.js} +1 -1
- package/element/{RegisterPage-DZGdPdu_.js → RegisterPage-D-6uVKjj.js} +1 -1
- package/element/{SocialLoginButton-BSK0uHQy.js → SocialLoginButton-BuZ03WV-.js} +1 -1
- package/element/{UploadPage-6k9f8u8c.js → UploadPage-Dhjmh06j.js} +1 -1
- package/element/{VideoPlayer-B6NcsNiP.js → VideoPlayer-cWSLl4fO.js} +1 -1
- package/element/element.es.js +1 -1
- package/element/{heic2any-JTWseCtt.js → heic2any-Dui1sz1X.js} +1 -1
- package/element/{index-Dq8XMn-B.js → index-DsN-W6V_.js} +1 -1
- package/element/{index-jVkC2DYJ.js → index-jzNVBihK.js} +1 -1
- package/element/{index.esm-mRBXJrk0.js → index.esm-CsbPHPGO.js} +1 -1
- package/element/{photoswipe-BdJR2C9a.js → photoswipe-5mcef1lI.js} +1 -1
- package/element/styles.css +1 -1
- package/element/{tslib.es6-CT89L4O4.js → tslib.es6-Dp_1P0Dk.js} +1 -1
- package/element/{useOrgAccess-DHToEbG_.js → useOrgAccess-B1cbGHT_.js} +1 -1
- package/element/web.es.js +1 -1
- package/package.json +1 -1
- package/react/{DPgWGmoG.js → 6xRxF6pz.js} +1 -1
- package/react/{BEzP8sbl.js → BZvhXg2G.js} +1 -1
- package/react/{BDeLdfbp.js → BaA7RHRf.js} +1 -1
- package/react/{CImTSnHg.js → Bebe5T7J.js} +1 -1
- package/react/{B5w5BP6w.js → C565I04Q.js} +1 -1
- package/react/{DPeVo4aL.js → CE-MbwCB.js} +1 -1
- package/react/{DH_wlDkr.js → CIlaT7eJ.js} +1 -1
- package/react/{JfRXqbqu.js → CS7icy9d.js} +1 -1
- package/react/{BUZq1uY0.js → Cp86U6va.js} +1 -1
- package/react/{LF1Cet66.js → Cv7EiFQU.js} +1 -1
- package/react/{eUvYQTPt.js → D1emifDo.js} +1 -1
- package/react/{BwHqpHe9.js → DPtqYlwJ.js} +1 -1
- package/react/{DcQdnYr8.js → DS2UD7gV.js} +1 -1
- package/react/{CYoLgOTC.js → DZitaH5o.js} +1 -1
- package/react/{CQHQocew.js → DjmC7CGh.js} +1 -1
- package/react/{BYYb8zAx.js → DwNWOPAY.js} +1 -1
- package/react/{6z8qI7He.js → Dyk2_V8r.js} +1 -1
- package/react/{CldWPPzn.js → LMErjmPc.js} +1 -1
- package/react/{BeDQQM0T.js → VOx0knsi.js} +1 -1
- package/react/{C-Ri1Eh9.js → W8TabW9M.js} +1 -1
- package/react/{CtX-oYOP.js → cWB0y40v.js} +1 -1
- package/react/index.es.js +1 -1
- package/react/{U9LCogz5.js → jM4FWKDA.js} +1 -1
- package/react/styles.css +1 -1
- package/react/{D464cx8y.js → vmkon26e.js} +1 -1
- package/umd/web.umd.js +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Z as e,L as t}from"./index-Dq8XMn-B.js";var r=e=>"checkbox"===e.type,s=e=>e instanceof Date,n=e=>null==e;const i=e=>"object"==typeof e;var a=e=>!n(e)&&!Array.isArray(e)&&i(e)&&!s(e),o=e=>a(e)&&e.target?r(e.target)?e.target.checked:e.target.value:e,u=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),l=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function c(e){let t;const r=Array.isArray(e),s=typeof FileList<"u"&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(l&&(e instanceof Blob||s)||!r&&!a(e))return e;if(t=r?[]:Object.create(Object.getPrototypeOf(e)),r||(e=>{const t=e.constructor&&e.constructor.prototype;return a(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=c(e[r]));else t=e}return t}var d=e=>/^\w*$/.test(e),f=e=>void 0===e,h=e=>Array.isArray(e)?e.filter(Boolean):[],p=e=>h(e.replace(/["|']|\]/g,"").split(/\.|\[/)),m=(e,t,r)=>{if(!t||!a(e))return r;const s=(d(t)?[t]:p(t)).reduce((e,t)=>n(e)?e:e[t],e);return f(s)||s===e?f(e[t])?r:e[t]:s},y=e=>"boolean"==typeof e,g=(e,t,r)=>{let s=-1;const n=d(t)?[t]:p(t),i=n.length,o=i-1;for(;++s<i;){const t=n[s];let i=r;if(s!==o){const r=e[t];i=a(r)||Array.isArray(r)?r:isNaN(+n[s+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=i,e=e[t]}};const v="blur",b="focusout",x="change",_="onBlur",F="onChange",w="onSubmit",k="onTouched",V="all",S="max",O="min",E="maxLength",A="minLength",D="pattern",$="required",T="validate",j=e.createContext(null);j.displayName="HookFormContext";const C=()=>e.useContext(j);var N=(e,t,r,s=!0)=>{const n={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(n,i,{get:()=>{const n=i;return t._proxyFormState[n]!==V&&(t._proxyFormState[n]=!s||V),r&&(r[n]=!0),e[n]}});return n};const M=typeof window<"u"?e.useLayoutEffect:e.useEffect;var U=e=>"string"==typeof e,P=(e,t,r,s,n)=>U(e)?(s&&t.watch.add(e),m(r,e,n)):Array.isArray(e)?e.map(e=>(s&&t.watch.add(e),m(r,e))):(s&&(t.watchAll=!0),r),R=e=>n(e)||!i(e);function z(e,t,r=new WeakSet){if(R(e)||R(t))return e===t;if(s(e)&&s(t))return e.getTime()===t.getTime();const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const n=e[o];if(!i.includes(o))return!1;if("ref"!==o){const e=t[o];if(s(n)&&s(e)||a(n)&&a(e)||Array.isArray(n)&&Array.isArray(e)?!z(n,e,r):n!==e)return!1}}return!0}function L(t){const r=C(),{name:s,disabled:n,control:i=r.control,shouldUnregister:a,defaultValue:l}=t,d=u(i._names.array,s),h=e.useMemo(()=>m(i._formValues,s,m(i._defaultValues,s,l)),[i,s,l]),p=function(t){const r=C(),{control:s=r.control,name:n,defaultValue:i,disabled:a,exact:o,compute:u}=t||{},l=e.useRef(i),c=e.useRef(u),d=e.useRef(void 0),f=e.useRef(s),h=e.useRef(n);c.current=u;const[p,m]=e.useState(()=>{const e=s._getWatch(n,l.current);return c.current?c.current(e):e}),y=e.useCallback(e=>{const t=P(n,s._names,e||s._formValues,!1,l.current);return c.current?c.current(t):t},[s._formValues,s._names,n]),g=e.useCallback(e=>{if(!a){const t=P(n,s._names,e||s._formValues,!1,l.current);if(c.current){const e=c.current(t);z(e,d.current)||(m(e),d.current=e)}else m(t)}},[s._formValues,s._names,a,n]);M(()=>((f.current!==s||!z(h.current,n))&&(f.current=s,h.current=n,g()),s._subscribe({name:n,formState:{values:!0},exact:o,callback:e=>{g(e.values)}})),[s,o,n,g]),e.useEffect(()=>s._removeUnmounted());const v=f.current!==s,b=h.current,x=e.useMemo(()=>{if(a)return null;const e=!v&&!z(b,n);return v||e?y():null},[a,v,n,b,y]);return null!==x?x:p}({control:i,name:s,defaultValue:h,exact:!0}),b=function(t){const r=C(),{control:s=r.control,disabled:n,name:i,exact:a}=t||{},[o,u]=e.useState(s._formState),l=e.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return M(()=>s._subscribe({name:i,formState:l.current,exact:a,callback:e=>{!n&&u({...s._formState,...e})}}),[i,n,a]),e.useEffect(()=>{l.current.isValid&&s._setValid(!0)},[s]),e.useMemo(()=>N(o,s,l.current,!1),[o,s])}({control:i,name:s,exact:!0}),_=e.useRef(t),F=e.useRef(void 0),w=e.useRef(i.register(s,{...t.rules,value:p,...y(t.disabled)?{disabled:t.disabled}:{}}));_.current=t;const k=e.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!m(b.errors,s)},isDirty:{enumerable:!0,get:()=>!!m(b.dirtyFields,s)},isTouched:{enumerable:!0,get:()=>!!m(b.touchedFields,s)},isValidating:{enumerable:!0,get:()=>!!m(b.validatingFields,s)},error:{enumerable:!0,get:()=>m(b.errors,s)}}),[b,s]),V=e.useCallback(e=>w.current.onChange({target:{value:o(e),name:s},type:x}),[s]),S=e.useCallback(()=>w.current.onBlur({target:{value:m(i._formValues,s),name:s},type:v}),[s,i._formValues]),O=e.useCallback(e=>{const t=m(i._fields,s);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[i._fields,s]),E=e.useMemo(()=>({name:s,value:p,...y(n)||b.disabled?{disabled:b.disabled||n}:{},onChange:V,onBlur:S,ref:O}),[s,n,b.disabled,V,S,O,p]);return e.useEffect(()=>{const e=i._options.shouldUnregister||a,t=F.current;t&&t!==s&&!d&&i.unregister(t),i.register(s,{..._.current.rules,...y(_.current.disabled)?{disabled:_.current.disabled}:{}});const r=(e,t)=>{const r=m(i._fields,e);r&&r._f&&(r._f.mount=t)};if(r(s,!0),e){const e=c(m(i._options.defaultValues,s,_.current.defaultValue));g(i._defaultValues,s,e),f(m(i._formValues,s))&&g(i._formValues,s,e)}return!d&&i.register(s),F.current=s,()=>{(d?e&&!i._state.action:e)?i.unregister(s):r(s,!1)}},[s,i,d,a]),e.useEffect(()=>{i._setDisabledField({disabled:n,name:s})},[n,s,i]),e.useMemo(()=>({field:E,formState:b,fieldState:k}),[E,b,k])}const I=e=>e.render(L(e));var q=(e,t,r,s,n)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[s]:n||!0}}:{},Z=e=>Array.isArray(e)?e:[e],B=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function Y(e,t){const r={};for(const s in e)if(e.hasOwnProperty(s)){const n=e[s],i=t[s];if(n&&a(n)&&i){const e=Y(n,i);a(e)&&(r[s]=e)}else e[s]&&(r[s]=i)}return r}var W=e=>a(e)&&!Object.keys(e).length,H=e=>"file"===e.type,J=e=>"function"==typeof e,K=e=>{if(!l)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},G=e=>"select-multiple"===e.type,Q=e=>"radio"===e.type,X=e=>K(e)&&e.isConnected;function ee(e,t){const r=Array.isArray(t)?t:d(t)?[t]:p(t),s=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let s=0;for(;s<r;)e=f(e)?s++:e[t[s++]];return e}(e,r),n=r.length-1,i=r[n];return s&&delete s[i],0!==n&&(a(s)&&W(s)||Array.isArray(s)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!f(e[t]))return!1;return!0}(s))&&ee(e,r.slice(0,-1)),e}function te(e){return Array.isArray(e)||a(e)&&!(e=>{for(const t in e)if(J(e[t]))return!0;return!1})(e)}function re(e,t={}){for(const r in e)te(e[r])?(t[r]=Array.isArray(e[r])?[]:{},re(e[r],t[r])):f(e[r])||(t[r]=!0);return t}function se(e,t,r){r||(r=re(t));for(const s in e)te(e[s])?f(t)||R(r[s])?r[s]=re(e[s],Array.isArray(e[s])?[]:{}):se(e[s],n(t)?{}:t[s],r[s]):r[s]=!z(e[s],t[s]);return r}const ne={value:!1,isValid:!1},ie={value:!0,isValid:!0};var ae=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!f(e[0].attributes.value)?f(e[0].value)||""===e[0].value?ie:{value:e[0].value,isValid:!0}:ie:ne}return ne},oe=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:s})=>f(e)?e:t?""===e?NaN:e&&+e:r&&U(e)?new Date(e):s?s(e):e;const ue={isValid:!1,value:null};var le=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,ue):ue;function ce(e){const t=e.ref;return H(t)?t.files:Q(t)?le(e.refs).value:G(t)?[...t.selectedOptions].map(({value:e})=>e):r(t)?ae(e.refs).value:oe(f(t.value)?e.ref.value:t.value,e)}var de=e=>e instanceof RegExp,fe=e=>f(e)?e:de(e)?e.source:a(e)?de(e.value)?e.value.source:e.value:e,he=e=>({isOnSubmit:!e||e===w,isOnBlur:e===_,isOnChange:e===F,isOnAll:e===V,isOnTouch:e===k});const pe="AsyncFunction";var me=e=>!!e&&!!e.validate&&!!(J(e.validate)&&e.validate.constructor.name===pe||a(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===pe)),ye=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const ge=(e,t,r,s)=>{for(const n of r||Object.keys(e)){const r=m(e,n);if(r){const{_f:e,...i}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],n)&&!s)return!0;if(e.ref&&t(e.ref,e.name)&&!s)return!0;if(ge(i,t))break}else if(a(i)&&ge(i,t))break}}};function ve(e,t,r){const s=m(e,r);if(s||d(r))return{error:s,name:r};const n=r.split(".");for(;n.length;){const s=n.join("."),i=m(t,s),a=m(e,s);if(i&&!Array.isArray(i)&&r!==s)return{name:r};if(a&&a.type)return{name:s,error:a};if(a&&a.root&&a.root.type)return{name:`${s}.root`,error:a.root};n.pop()}return{name:r}}var be=(e,t,r)=>{const s=Z(m(e,r));return g(s,"root",t[r]),g(e,r,s),e};function xe(e,t,r="validate"){if(U(e)||Array.isArray(e)&&e.every(U)||y(e)&&!e)return{type:r,message:U(e)?e:"",ref:t}}var _e=e=>a(e)&&!de(e)?e:{value:e,message:""},Fe=async(e,t,s,i,o,u)=>{const{ref:l,refs:c,required:d,maxLength:h,minLength:p,min:g,max:v,pattern:b,validate:x,name:_,valueAsNumber:F,mount:w}=e._f,k=m(s,_);if(!w||t.has(_))return{};const V=c?c[0]:l,j=e=>{o&&V.reportValidity&&(V.setCustomValidity(y(e)?"":e||""),V.reportValidity())},C={},N=Q(l),M=r(l),P=N||M,R=(F||H(l))&&f(l.value)&&f(k)||K(l)&&""===l.value||""===k||Array.isArray(k)&&!k.length,z=q.bind(null,_,i,C),L=(e,t,r,s=E,n=A)=>{const i=e?t:r;C[_]={type:e?s:n,message:i,ref:l,...z(e?s:n,i)}};if(u?!Array.isArray(k)||!k.length:d&&(!P&&(R||n(k))||y(k)&&!k||M&&!ae(c).isValid||N&&!le(c).isValid)){const{value:e,message:t}=U(d)?{value:!!d,message:d}:_e(d);if(e&&(C[_]={type:$,message:t,ref:V,...z($,t)},!i))return j(t),C}if(!(R||n(g)&&n(v))){let e,t;const r=_e(v),s=_e(g);if(n(k)||isNaN(k)){const n=l.valueAsDate||new Date(k),i=e=>new Date((new Date).toDateString()+" "+e),a="time"==l.type,o="week"==l.type;U(r.value)&&k&&(e=a?i(k)>i(r.value):o?k>r.value:n>new Date(r.value)),U(s.value)&&k&&(t=a?i(k)<i(s.value):o?k<s.value:n<new Date(s.value))}else{const i=l.valueAsNumber||k&&+k;n(r.value)||(e=i>r.value),n(s.value)||(t=i<s.value)}if((e||t)&&(L(!!e,r.message,s.message,S,O),!i))return j(C[_].message),C}if((h||p)&&!R&&(U(k)||u&&Array.isArray(k))){const e=_e(h),t=_e(p),r=!n(e.value)&&k.length>+e.value,s=!n(t.value)&&k.length<+t.value;if((r||s)&&(L(r,e.message,t.message),!i))return j(C[_].message),C}if(b&&!R&&U(k)){const{value:e,message:t}=_e(b);if(de(e)&&!k.match(e)&&(C[_]={type:D,message:t,ref:l,...z(D,t)},!i))return j(t),C}if(x)if(J(x)){const e=xe(await x(k,s),V);if(e&&(C[_]={...e,...z(T,e.message)},!i))return j(e.message),C}else if(a(x)){let e={};for(const t in x){if(!W(e)&&!i)break;const r=xe(await x[t](k,s),V,t);r&&(e={...r,...z(t,r.message)},j(r.message),i&&(C[_]=e))}if(!W(e)&&(C[_]={ref:V,...e},!i))return C}return j(!0),C};const we={mode:w,reValidateMode:F,shouldFocusError:!0};function ke(e={}){let t,i={...we,...e},d={submitCount:0,isDirty:!1,isReady:!1,isLoading:J(i.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:i.errors||{},disabled:i.disabled||!1},p={},x=(a(i.defaultValues)||a(i.values))&&c(i.defaultValues||i.values)||{},_=i.shouldUnregister?{}:c(x),F={action:!1,mount:!1,watch:!1},w={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},k=0;const S={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let O={...S};const E={array:B(),state:B()},A=i.criteriaMode===V,D=async e=>{if(!i.disabled&&(S.isValid||O.isValid||e)){const e=i.resolver?W((await N()).errors):await M(p,!0);e!==d.isValid&&E.state.next({isValid:e})}},$=(e,t)=>{!i.disabled&&(S.isValidating||S.validatingFields||O.isValidating||O.validatingFields)&&((e||Array.from(w.mount)).forEach(e=>{e&&(t?g(d.validatingFields,e,t):ee(d.validatingFields,e))}),E.state.next({validatingFields:d.validatingFields,isValidating:!W(d.validatingFields)}))},T=(e,t,r,s)=>{const n=m(p,e);if(n){const i=m(_,e,f(r)?m(x,e):r);f(i)||s&&s.defaultChecked||t?g(_,e,t?i:ce(n._f)):I(e,i),F.mount&&D()}},j=(e,t,r,s,n)=>{let a=!1,o=!1;const u={name:e};if(!i.disabled){if(!r||s){(S.isDirty||O.isDirty)&&(o=d.isDirty,d.isDirty=u.isDirty=R(),a=o!==u.isDirty);const r=z(m(x,e),t);o=!!m(d.dirtyFields,e),r?ee(d.dirtyFields,e):g(d.dirtyFields,e,!0),u.dirtyFields=d.dirtyFields,a=a||(S.dirtyFields||O.dirtyFields)&&o!==!r}if(r){const t=m(d.touchedFields,e);t||(g(d.touchedFields,e,r),u.touchedFields=d.touchedFields,a=a||(S.touchedFields||O.touchedFields)&&t!==r)}a&&n&&E.state.next(u)}return a?u:{}},C=(e,r,s,n)=>{const a=m(d.errors,e),o=(S.isValid||O.isValid)&&y(r)&&d.isValid!==r;if(i.delayError&&s?(t=(e=>t=>{clearTimeout(k),k=setTimeout(e,t)})(()=>((e,t)=>{g(d.errors,e,t),E.state.next({errors:d.errors})})(e,s)),t(i.delayError)):(clearTimeout(k),t=null,s?g(d.errors,e,s):ee(d.errors,e)),(s?!z(a,s):a)||!W(n)||o){const t={...n,...o&&y(r)?{isValid:r}:{},errors:d.errors,name:e};d={...d,...t},E.state.next(t)}},N=async e=>{$(e,!0);const t=await i.resolver(_,i.context,((e,t,r,s)=>{const n={};for(const r of e){const e=m(t,r);e&&g(n,r,e._f)}return{criteriaMode:r,names:[...e],fields:n,shouldUseNativeValidation:s}})(e||w.mount,p,i.criteriaMode,i.shouldUseNativeValidation));return $(e),t},M=async(e,t,r={valid:!0})=>{for(const s in e){const n=e[s];if(n){const{_f:e,...s}=n;if(e){const s=w.array.has(e.name),a=n._f&&me(n._f);a&&S.validatingFields&&$([e.name],!0);const o=await Fe(n,w.disabled,_,A,i.shouldUseNativeValidation&&!t,s);if(a&&S.validatingFields&&$([e.name]),o[e.name]&&(r.valid=!1,t))break;!t&&(m(o,e.name)?s?be(d.errors,o,e.name):g(d.errors,e.name,o[e.name]):ee(d.errors,e.name))}!W(s)&&await M(s,t,r)}}return r.valid},R=(e,t)=>!i.disabled&&(e&&t&&g(_,e,t),!z(ae(),x)),L=(e,t,r)=>P(e,w,{...F.mount?_:f(t)?x:U(e)?{[e]:t}:t},r,t),I=(e,t,s={})=>{const i=m(p,e);let a=t;if(i){const s=i._f;s&&(!s.disabled&&g(_,e,oe(t,s)),a=K(s.ref)&&n(t)?"":t,G(s.ref)?[...s.ref.options].forEach(e=>e.selected=a.includes(e.value)):s.refs?r(s.ref)?s.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(Array.isArray(a)?e.checked=!!a.find(t=>t===e.value):e.checked=a===e.value||!!a)}):s.refs.forEach(e=>e.checked=e.value===a):H(s.ref)?s.ref.value="":(s.ref.value=a,s.ref.type||E.state.next({name:e,values:c(_)})))}(s.shouldDirty||s.shouldTouch)&&j(e,a,s.shouldTouch,s.shouldDirty,!0),s.shouldValidate&&ie(e)},q=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const i=t[n],o=e+"."+n,u=m(p,o);(w.array.has(e)||a(i)||u&&!u._f)&&!s(i)?q(o,i,r):I(o,i,r)}},te=(e,t,r={})=>{const s=m(p,e),i=w.array.has(e),a=c(t);g(_,e,a),i?(E.array.next({name:e,values:c(_)}),(S.isDirty||S.dirtyFields||O.isDirty||O.dirtyFields)&&r.shouldDirty&&E.state.next({name:e,dirtyFields:se(x,_),isDirty:R(e,a)})):!s||s._f||n(a)?I(e,a,r):q(e,a,r),ye(e,w)&&E.state.next({...d,name:e}),E.state.next({name:F.mount?e:void 0,values:c(_)})},re=async e=>{F.mount=!0;const r=e.target;let n=r.name,a=!0;const u=m(p,n),l=e=>{a=Number.isNaN(e)||s(e)&&isNaN(e.getTime())||z(e,m(_,n,e))},f=he(i.mode),h=he(i.reValidateMode);if(u){let s,y;const x=r.type?ce(u._f):o(e),F=e.type===v||e.type===b,k=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(u._f)&&!i.resolver&&!m(d.errors,n)&&!u._f.deps||((e,t,r,s,n)=>!n.isOnAll&&(!r&&n.isOnTouch?!(t||e):(r?s.isOnBlur:n.isOnBlur)?!e:!(r?s.isOnChange:n.isOnChange)||e))(F,m(d.touchedFields,n),d.isSubmitted,h,f),V=ye(n,w,F);g(_,n,x),F?(!r||!r.readOnly)&&(u._f.onBlur&&u._f.onBlur(e),t&&t(0)):u._f.onChange&&u._f.onChange(e);const T=j(n,x,F),U=!W(T)||V;if(!F&&E.state.next({name:n,type:e.type,values:c(_)}),k)return(S.isValid||O.isValid)&&("onBlur"===i.mode?F&&D():F||D()),U&&E.state.next({name:n,...V?{}:T});if(!F&&V&&E.state.next({...d}),i.resolver){const{errors:e}=await N([n]);if(l(x),a){const t=ve(d.errors,p,n),r=ve(e,p,t.name||n);s=r.error,n=r.name,y=W(e)}}else $([n],!0),s=(await Fe(u,w.disabled,_,A,i.shouldUseNativeValidation))[n],$([n]),l(x),a&&(s?y=!1:(S.isValid||O.isValid)&&(y=await M(p,!0)));a&&(u._f.deps&&(!Array.isArray(u._f.deps)||u._f.deps.length>0)&&ie(u._f.deps),C(n,y,s,T))}},ne=(e,t)=>{if(m(d.errors,t)&&e.focus)return e.focus(),1},ie=async(e,t={})=>{let r,s;const n=Z(e);if(i.resolver){const t=await(async e=>{const{errors:t}=await N(e);if(e)for(const r of e){const e=m(t,r);e?g(d.errors,r,e):ee(d.errors,r)}else d.errors=t;return t})(f(e)?e:n);r=W(t),s=e?!n.some(e=>m(t,e)):r}else e?(s=(await Promise.all(n.map(async e=>{const t=m(p,e);return await M(t&&t._f?{[e]:t}:t)}))).every(Boolean),(s||d.isValid)&&D()):s=r=await M(p);return E.state.next({...!U(e)||(S.isValid||O.isValid)&&r!==d.isValid?{}:{name:e},...i.resolver||!e?{isValid:r}:{},errors:d.errors}),t.shouldFocus&&!s&&ge(p,ne,e?n:w.mount),s},ae=(e,t)=>{let r={...F.mount?_:x};return t&&(r=Y(t.dirtyFields?d.dirtyFields:d.touchedFields,r)),f(e)?r:U(e)?m(r,e):e.map(e=>m(r,e))},ue=(e,t)=>({invalid:!!m((t||d).errors,e),isDirty:!!m((t||d).dirtyFields,e),error:m((t||d).errors,e),isValidating:!!m(d.validatingFields,e),isTouched:!!m((t||d).touchedFields,e)}),le=(e,t,r)=>{const s=(m(p,e,{_f:{}})._f||{}).ref,n=m(d.errors,e)||{},{ref:i,message:a,type:o,...u}=n;g(d.errors,e,{...u,...t,ref:s}),E.state.next({name:e,errors:d.errors,isValid:!1}),r&&r.shouldFocus&&s&&s.focus&&s.focus()},de=e=>E.state.subscribe({next:t=>{((e,t,r)=>!e||!t||e===t||Z(e).some(e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e))))(e.name,t.name,e.exact)&&((e,t,r,s)=>{r(e);const{name:n,...i}=e;return W(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(e=>t[e]===(!s||V))})(t,e.formState||S,Ee,e.reRenderRoot)&&e.callback({values:{..._},...d,...t,defaultValues:x})}}).unsubscribe,pe=(e,t={})=>{for(const r of e?Z(e):w.mount)w.mount.delete(r),w.array.delete(r),t.keepValue||(ee(p,r),ee(_,r)),!t.keepError&&ee(d.errors,r),!t.keepDirty&&ee(d.dirtyFields,r),!t.keepTouched&&ee(d.touchedFields,r),!t.keepIsValidating&&ee(d.validatingFields,r),!i.shouldUnregister&&!t.keepDefaultValue&&ee(x,r);E.state.next({values:c(_)}),E.state.next({...d,...t.keepDirty?{isDirty:R()}:{}}),!t.keepIsValid&&D()},xe=({disabled:e,name:t})=>{(y(e)&&F.mount||e||w.disabled.has(t))&&(e?w.disabled.add(t):w.disabled.delete(t))},_e=(e,t={})=>{let s=m(p,e);const n=y(t.disabled)||y(i.disabled);return g(p,e,{...s||{},_f:{...s&&s._f?s._f:{ref:{name:e}},name:e,mount:!0,...t}}),w.mount.add(e),s?xe({disabled:y(t.disabled)?t.disabled:i.disabled,name:e}):T(e,!0,t.value),{...n?{disabled:t.disabled||i.disabled}:{},...i.progressive?{required:!!t.required,min:fe(t.min),max:fe(t.max),minLength:fe(t.minLength),maxLength:fe(t.maxLength),pattern:fe(t.pattern)}:{},name:e,onChange:re,onBlur:re,ref:n=>{if(n){_e(e,t),s=m(p,e);const i=f(n.value)&&n.querySelectorAll&&n.querySelectorAll("input,select,textarea")[0]||n,a=(e=>Q(e)||r(e))(i),o=s._f.refs||[];if(a?o.find(e=>e===i):i===s._f.ref)return;g(p,e,{_f:{...s._f,...a?{refs:[...o.filter(X),i,...Array.isArray(m(x,e))?[{}]:[]],ref:{type:i.type,name:e}}:{ref:i}}}),T(e,!1,void 0,i)}else s=m(p,e,{}),s._f&&(s._f.mount=!1),(i.shouldUnregister||t.shouldUnregister)&&(!u(w.array,e)||!F.action)&&w.unMount.add(e)}}},ke=()=>i.shouldFocusError&&ge(p,ne,w.mount),Ve=(e,t)=>async r=>{let s;r&&(r.preventDefault&&r.preventDefault(),r.persist&&r.persist());let n=c(_);if(E.state.next({isSubmitting:!0}),i.resolver){const{errors:e,values:t}=await N();d.errors=e,n=c(t)}else await M(p);if(w.disabled.size)for(const e of w.disabled)ee(n,e);if(ee(d.errors,"root"),W(d.errors)){E.state.next({errors:{}});try{await e(n,r)}catch(e){s=e}}else t&&await t({...d.errors},r),ke(),setTimeout(ke);if(E.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:W(d.errors)&&!s,submitCount:d.submitCount+1,errors:d.errors}),s)throw s},Se=(e,t={})=>{const r=e?c(e):x,s=c(r),n=W(e),a=n?x:s;if(t.keepDefaultValues||(x=r),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...w.mount,...Object.keys(se(x,_))]);for(const t of Array.from(e))m(d.dirtyFields,t)?g(a,t,m(_,t)):te(t,m(a,t))}else{if(l&&f(e))for(const e of w.mount){const t=m(p,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(K(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of w.mount)te(e,m(a,e));else p={}}_=i.shouldUnregister?t.keepDefaultValues?c(x):{}:c(a),E.array.next({values:{...a}}),E.state.next({values:{...a}})}w={mount:t.keepDirtyValues?w.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},F.mount=!S.isValid||!!t.keepIsValid||!!t.keepDirtyValues||!i.shouldUnregister&&!W(a),F.watch=!!i.shouldUnregister,E.state.next({submitCount:t.keepSubmitCount?d.submitCount:0,isDirty:!n&&(t.keepDirty?d.isDirty:!(!t.keepDefaultValues||z(e,x))),isSubmitted:!!t.keepIsSubmitted&&d.isSubmitted,dirtyFields:n?{}:t.keepDirtyValues?t.keepDefaultValues&&_?se(x,_):d.dirtyFields:t.keepDefaultValues&&e?se(x,e):t.keepDirty?d.dirtyFields:{},touchedFields:t.keepTouched?d.touchedFields:{},errors:t.keepErrors?d.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&d.isSubmitSuccessful,isSubmitting:!1,defaultValues:x})},Oe=(e,t)=>Se(J(e)?e(_):e,t),Ee=e=>{d={...d,...e}},Ae={control:{register:_e,unregister:pe,getFieldState:ue,handleSubmit:Ve,setError:le,_subscribe:de,_runSchema:N,_focusError:ke,_getWatch:L,_getDirty:R,_setValid:D,_setFieldArray:(e,t=[],r,s,n=!0,a=!0)=>{if(s&&r&&!i.disabled){if(F.action=!0,a&&Array.isArray(m(p,e))){const t=r(m(p,e),s.argA,s.argB);n&&g(p,e,t)}if(a&&Array.isArray(m(d.errors,e))){const t=r(m(d.errors,e),s.argA,s.argB);n&&g(d.errors,e,t),((e,t)=>{!h(m(e,t)).length&&ee(e,t)})(d.errors,e)}if((S.touchedFields||O.touchedFields)&&a&&Array.isArray(m(d.touchedFields,e))){const t=r(m(d.touchedFields,e),s.argA,s.argB);n&&g(d.touchedFields,e,t)}(S.dirtyFields||O.dirtyFields)&&(d.dirtyFields=se(x,_)),E.state.next({name:e,isDirty:R(e,t),dirtyFields:d.dirtyFields,errors:d.errors,isValid:d.isValid})}else g(_,e,t)},_setDisabledField:xe,_setErrors:e=>{d.errors=e,E.state.next({errors:d.errors,isValid:!1})},_getFieldArray:e=>h(m(F.mount?_:x,e,i.shouldUnregister?m(x,e,[]):[])),_reset:Se,_resetDefaultValues:()=>J(i.defaultValues)&&i.defaultValues().then(e=>{Oe(e,i.resetOptions),E.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of w.unMount){const t=m(p,e);t&&(t._f.refs?t._f.refs.every(e=>!X(e)):!X(t._f.ref))&&pe(e)}w.unMount=new Set},_disableForm:e=>{y(e)&&(E.state.next({disabled:e}),ge(p,(t,r)=>{const s=m(p,r);s&&(t.disabled=s._f.disabled||e,Array.isArray(s._f.refs)&&s._f.refs.forEach(t=>{t.disabled=s._f.disabled||e}))},0,!1))},_subjects:E,_proxyFormState:S,get _fields(){return p},get _formValues(){return _},get _state(){return F},set _state(e){F=e},get _defaultValues(){return x},get _names(){return w},set _names(e){w=e},get _formState(){return d},get _options(){return i},set _options(e){i={...i,...e}}},subscribe:e=>(F.mount=!0,O={...O,...e.formState},de({...e,formState:O})),trigger:ie,register:_e,handleSubmit:Ve,watch:(e,t)=>J(e)?E.state.subscribe({next:r=>"values"in r&&e(L(void 0,t),r)}):L(e,t,!0),setValue:te,getValues:ae,reset:Oe,resetField:(e,t={})=>{m(p,e)&&(f(t.defaultValue)?te(e,c(m(x,e))):(te(e,t.defaultValue),g(x,e,c(t.defaultValue))),t.keepTouched||ee(d.touchedFields,e),t.keepDirty||(ee(d.dirtyFields,e),d.isDirty=t.defaultValue?R(e,c(m(x,e))):R()),t.keepError||(ee(d.errors,e),S.isValid&&D()),E.state.next({...d}))},clearErrors:e=>{e&&Z(e).forEach(e=>ee(d.errors,e)),E.state.next({errors:e?d.errors:{}})},unregister:pe,setError:le,setFocus:(e,t={})=>{const r=m(p,e),s=r&&r._f;if(s){const e=s.refs?s.refs[0]:s.ref;e.focus&&(e.focus(),t.shouldSelect&&J(e.select)&&e.select())}},getFieldState:ue};return{...Ae,formControl:Ae}}function Ve(t={}){const r=e.useRef(void 0),s=e.useRef(void 0),[n,i]=e.useState({isDirty:!1,isValidating:!1,isLoading:J(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:J(t.defaultValues)?void 0:t.defaultValues});if(!r.current)if(t.formControl)r.current={...t.formControl,formState:n},t.defaultValues&&!J(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:e,...s}=ke(t);r.current={...s,formState:n}}const a=r.current.control;return a._options=t,M(()=>{const e=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState}),reRenderRoot:!0});return i(e=>({...e,isReady:!0})),a._formState.isReady=!0,e},[a]),e.useEffect(()=>a._disableForm(t.disabled),[a,t.disabled]),e.useEffect(()=>{t.mode&&(a._options.mode=t.mode),t.reValidateMode&&(a._options.reValidateMode=t.reValidateMode)},[a,t.mode,t.reValidateMode]),e.useEffect(()=>{t.errors&&(a._setErrors(t.errors),a._focusError())},[a,t.errors]),e.useEffect(()=>{t.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,t.shouldUnregister]),e.useEffect(()=>{if(a._proxyFormState.isDirty){const e=a._getDirty();e!==n.isDirty&&a._subjects.state.next({isDirty:e})}},[a,n.isDirty]),e.useEffect(()=>{t.values&&!z(t.values,s.current)?(a._reset(t.values,{keepFieldsRef:!0,...a._options.resetOptions}),s.current=t.values,i(e=>({...e}))):a._resetDefaultValues()},[a,t.values]),e.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),r.current.formState=N(n,a),r.current}const Se=(e,t,r)=>{if(e&&"reportValidity"in e){const s=m(r,t);e.setCustomValidity(s&&s.message||""),e.reportValidity()}},Oe=(e,t)=>{for(const r in t.fields){const s=t.fields[r];s&&s.ref&&"reportValidity"in s.ref?Se(s.ref,r,e):s&&s.refs&&s.refs.forEach(t=>Se(t,r,e))}},Ee=(e,t)=>{t.shouldUseNativeValidation&&Oe(e,t);const r={};for(const s in e){const n=m(t.fields,s),i=Object.assign(e[s]||{},{ref:n&&n.ref});if(Ae(t.names||Object.keys(e),s)){const e=Object.assign({},m(r,s));g(e,"root",i),g(r,s,e)}else g(r,s,i)}return r},Ae=(e,t)=>{const r=De(t);return e.some(e=>De(e).match(`^${r}\\.\\d+`))};function De(e){return e.replace(/\]|\[/g,"")}var $e,Te,je={};function Ce(e,t,r){return void 0===r&&(r={}),function(s,n,i){try{return Promise.resolve(function(a,o){try{var u=(null!=t&&t.context&&"development"===je.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e["sync"===r.mode?"validateSync":"validate"](s,Object.assign({abortEarly:!1},t,{context:n}))).then(function(e){return i.shouldUseNativeValidation&&Oe({},i),{values:r.raw?Object.assign({},s):e,errors:{}}}))}catch(e){return o(e)}return u&&u.then?u.then(void 0,o):u}(0,function(e){if(!e.inner)throw e;return{values:{},errors:Ee((t=e,r=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,(t.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),r){var s=e[t.path].types,n=s&&s[t.type];e[t.path]=q(t.path,r,e,t.type,n?[].concat(n,t.message):t.message)}return e},{})),i)};var t,r}))}catch(e){return Promise.reject(e)}}}var Ne,Me,Ue=function(){if(Te)return $e;function e(e){this._maxSize=e,this.clear()}Te=1,e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(e){return this._values[e]},e.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,r=/^\d+$/,s=/^\d/,n=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,i=/^\s*(['"]?)(.*?)(\1)\s*$/,a=new e(512),o=new e(512),u=new e(512);function l(e){return a.get(e)||a.set(e,c(e).map(function(e){return e.replace(i,"$2")}))}function c(e){return e.match(t)||[""]}function d(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function f(e){return!d(e)&&(function(e){return e.match(s)&&!e.match(r)}(e)||function(e){return n.test(e)}(e))}return $e={Cache:e,split:c,normalizePath:l,setter:function(e){var t=l(e);return o.get(e)||o.set(e,function(e,r){for(var s=0,n=t.length,i=e;s<n-1;){var a=t[s];if("__proto__"===a||"constructor"===a||"prototype"===a)return e;i=i[t[s++]]}i[t[s]]=r})},getter:function(e,t){var r=l(e);return u.get(e)||u.set(e,function(e){for(var s=0,n=r.length;s<n;){if(null==e&&t)return;e=e[r[s++]]}return e})},join:function(e){return e.reduce(function(e,t){return e+(d(t)||r.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(e,t,r){!function(e,t,r){var s,n,i,a,o=e.length;for(n=0;n<o;n++)(s=e[n])&&(f(s)&&(s='"'+s+'"'),a=d(s),i=!a&&/^\d+$/.test(s),t.call(r,s,a,i,n,e))}(Array.isArray(e)?e:c(e),t,r)}}}();var Pe,Re=function(){if(Me)return Ne;Me=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=t=>t.match(e)||[],r=e=>e[0].toUpperCase()+e.slice(1),s=(e,r)=>t(e).join(r).toLowerCase(),n=e=>t(e).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,"");return Ne={words:t,upperFirst:r,camelCase:n,pascalCase:e=>r(n(e)),snakeCase:e=>s(e,"_"),kebabCase:e=>s(e,"-"),sentenceCase:e=>r(s(e," ")),titleCase:e=>t(e).map(r).join(" ")}}(),ze={exports:{}};const Le=t(function(){if(Pe)return ze.exports;function e(e,t){var r=e.length,s=new Array(r),n={},i=r,a=function(e){for(var t=new Map,r=0,s=e.length;r<s;r++){var n=e[r];t.has(n[0])||t.set(n[0],new Set),t.has(n[1])||t.set(n[1],new Set),t.get(n[0]).add(n[1])}return t}(t),o=function(e){for(var t=new Map,r=0,s=e.length;r<s;r++)t.set(e[r],r);return t}(e);for(t.forEach(function(e){if(!o.has(e[0])||!o.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)n[i]||u(e[i],i,new Set);return s;function u(e,t,i){if(i.has(e)){var l;try{l=", node was:"+JSON.stringify(e)}catch{l=""}throw new Error("Cyclic dependency"+l)}if(!o.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!n[t]){n[t]=!0;var c=a.get(e)||new Set;if(t=(c=Array.from(c)).length){i.add(e);do{var d=c[--t];u(d,o.get(d),i)}while(t);i.delete(e)}s[--r]=e}}}return Pe=1,ze.exports=function(t){return e(function(e){for(var t=new Set,r=0,s=e.length;r<s;r++){var n=e[r];t.add(n[0]),t.add(n[1])}return Array.from(t)}(t),t)},ze.exports.array=e,ze.exports}()),Ie=Object.prototype.toString,qe=Error.prototype.toString,Ze=RegExp.prototype.toString,Be=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Ye=/^Symbol\((.*)\)(.*)$/;function We(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const r=typeof e;if("number"===r)return function(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}(e);if("string"===r)return t?`"${e}"`:e;if("function"===r)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===r)return Be.call(e).replace(Ye,"Symbol($1)");const s=Ie.call(e).slice(8,-1);return"Date"===s?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===s||e instanceof Error?"["+qe.call(e)+"]":"RegExp"===s?Ze.call(e):null}function He(e,t){let r=We(e,t);return null!==r?r:JSON.stringify(e,function(e,r){let s=We(this[e],t);return null!==s?s:r},2)}function Je(e){return null==e?[]:[].concat(e)}let Ke,Ge,Qe,Xe=/\$\{\s*(\w+)\s*\}/g;Ke=Symbol.toStringTag;class et{constructor(e,t,r,s){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Ke]="Error",this.name="ValidationError",this.value=t,this.path=r,this.type=s,this.errors=[],this.inner=[],Je(e).forEach(e=>{if(tt.isError(e)){this.errors.push(...e.errors);const t=e.inner.length?e.inner:[e];this.inner.push(...t)}else this.errors.push(e)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Ge=Symbol.hasInstance,Qe=Symbol.toStringTag;class tt extends Error{static formatError(e,t){const r=t.label||t.path||"this";return t=Object.assign({},t,{path:r,originalPath:t.path}),"string"==typeof e?e.replace(Xe,(e,r)=>He(t[r])):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,r,s,n){const i=new et(e,t,r,s);if(n)return i;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Qe]="Error",this.name=i.name,this.message=i.message,this.type=i.type,this.value=i.value,this.path=i.path,this.errors=i.errors,this.inner=i.inner,Error.captureStackTrace&&Error.captureStackTrace(this,tt)}static[Ge](e){return et[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let rt={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:s})=>{const n=null!=s&&s!==r?` (cast from the value \`${He(s,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${He(r,!0)}\``+n:`${e} must match the configured type. The validated value was: \`${He(r,!0)}\``+n}},st={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},nt={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},it={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},at={notType:e=>{const{path:t,value:r,spec:s}=e,n=s.types.length;if(Array.isArray(r)){if(r.length<n)return`${t} tuple value has too few items, expected a length of ${n} but got ${r.length} for value: \`${He(r,!0)}\``;if(r.length>n)return`${t} tuple value has too many items, expected a length of ${n} but got ${r.length} for value: \`${He(r,!0)}\``}return tt.formatError(rt.notType,e)}};Object.assign(Object.create(null),{mixed:rt,string:st,number:{min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date:nt,object:it,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:{isValue:"${path} field must be ${value}"},tuple:at});const ot=e=>e&&e.__isYupSchema__;class ut{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:s,otherwise:n}=t,i="function"==typeof r?r:(...e)=>e.every(e=>e===r);return new ut(e,(e,t)=>{var r;let a=i(...e)?s:n;return null!=(r=a?.(t))?r:t})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let r=this.refs.map(e=>e.getValue(t?.value,t?.parent,t?.context)),s=this.fn(r,e,t);if(void 0===s||s===e)return e;if(!ot(s))throw new TypeError("conditions must return a schema object");return s.resolve(t)}}const lt="$",ct=".";function dt(e,t){return new ft(e,t)}class ft{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===lt,this.isValue=this.key[0]===ct,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?lt:this.isValue?ct:"";this.path=this.key.slice(r.length),this.getter=this.path&&Ue.getter(this.path,!0),this.map=t.map}getValue(e,t,r){let s=this.isContext?r:this.isValue?e:t;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(e,t){return this.getValue(e,t?.parent,t?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}ft.prototype.__isYupRef=!0;const ht=e=>null==e;function pt(e){function t({value:t,path:r="",options:s,originalValue:n,schema:i},a,o){const{name:u,test:l,params:c,message:d,skipAbsent:f}=e;let{parent:h,context:p,abortEarly:m=i.spec.abortEarly,disableStackTrace:y=i.spec.disableStackTrace}=s;const g={value:t,parent:h,context:p};function v(e={}){const s=mt(Object.assign({value:t,originalValue:n,label:i.spec.label,path:e.path||r,spec:i.spec,disableStackTrace:e.disableStackTrace||y},c,e.params),g),a=new tt(tt.formatError(e.message||d,s),t,s.path,e.type||u,s.disableStackTrace);return a.params=s,a}const b=m?a:o;let x={path:r,parent:h,type:u,from:s.from,createError:v,resolve:e=>yt(e,g),options:s,originalValue:n,schema:i};const _=e=>{tt.isError(e)?b(e):e?o(null):b(v())},F=e=>{tt.isError(e)?b(e):a(e)};if(f&&ht(t))return _(!0);let w;try{var k;if(w=l.call(x,t,x),"function"==typeof(null==(k=w)?void 0:k.then)){if(s.sync)throw new Error(`Validation test of type: "${x.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(w).then(_,F)}}catch(e){return void F(e)}_(w)}return t.OPTIONS=e,t}function mt(e,t){if(!e)return e;for(const r of Object.keys(e))e[r]=yt(e[r],t);return e}function yt(e,t){return ft.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function gt(e,t,r,s=r){let n,i,a;return t?(Ue.forEach(t,(o,u,l)=>{let c=u?o.slice(1,o.length-1):o,d="tuple"===(e=e.resolve({context:s,parent:n,value:r})).type,f=l?parseInt(c,10):0;if(e.innerType||d){if(d&&!l)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(r&&f>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${o}, in the path: ${t}. because there is no value at that index. `);n=r,r=r&&r[f],e=d?e.spec.types[f]:e.innerType}if(!l){if(!e.fields||!e.fields[c])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);n=r,r=r&&r[c],e=e.fields[c]}i=c,a=u?"["+o+"]":"."+o}),{schema:e,parent:n,parentPath:i}):{parent:n,parentPath:t,schema:e}}class vt extends Set{describe(){const e=[];for(const t of this.values())e.push(ft.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const r of this.values())t.push(e(r));return t}clone(){return new vt(this.values())}merge(e,t){const r=this.clone();return e.forEach(e=>r.add(e)),t.forEach(e=>r.delete(e)),r}}function bt(e,t=new Map){if(ot(e)||!e||"object"!=typeof e)return e;if(t.has(e))return t.get(e);let r;if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=new Array(e.length),t.set(e,r);for(let s=0;s<e.length;s++)r[s]=bt(e[s],t)}else if(e instanceof Map){r=new Map,t.set(e,r);for(const[s,n]of e.entries())r.set(s,bt(n,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const s of e)r.add(bt(s,t))}else{if(!(e instanceof Object))throw Error(`Unable to clone ${e}`);r={},t.set(e,r);for(const[s,n]of Object.entries(e))r[s]=bt(n,t)}return r}function xt(e){if(null==e||!e.length)return;const t=[];let r="",s=!1,n=!1;for(let i=0;i<e.length;i++){const a=e[i];"["!==a||n?"]"!==a||n?'"'!==a?"."!==a||s||n?r+=a:r&&(t.push(r),r=""):n=!n:(r&&(/^\d+$/.test(r)?t.push(r):t.push(r.replace(/^"|"$/g,"")),r=""),s=!1):(r&&(t.push(...r.split(".").filter(Boolean)),r=""),s=!0)}return r&&t.push(...r.split(".").filter(Boolean)),t}function _t(e,t){var r;if((null==(r=e.inner)||!r.length)&&e.errors.length)return function(e,t){const r=t?`${t}.${e.path}`:e.path;return e.errors.map(e=>({message:e,path:xt(r)}))}(e,t);const s=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(e=>_t(e,s))}class Ft{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new vt,this._blacklist=new vt,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(rt.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e?.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=bt(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let r=e(this);return this._mutate=t,r}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,r=e.clone();const s=Object.assign({},t.spec,r.spec);return r.spec=s,r.internalTests=Object.assign({},t.internalTests,r.internalTests),r._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),r._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),r.tests=t.tests,r.exclusiveTests=t.exclusiveTests,r.withMutation(t=>{e.tests.forEach(e=>{t.test(e.OPTIONS)})}),r.transforms=[...t.transforms,...r.transforms],r}isType(e){return null==e?!!(this.spec.nullable&&null===e||this.spec.optional&&void 0===e):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let r=t.conditions;t=t.clone(),t.conditions=[],t=r.reduce((t,r)=>r.resolve(t,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,r,s,n;return Object.assign({},e,{from:e.from||[],strict:null!=(t=e.strict)?t:this.spec.strict,abortEarly:null!=(r=e.abortEarly)?r:this.spec.abortEarly,recursive:null!=(s=e.recursive)?s:this.spec.recursive,disableStackTrace:null!=(n=e.disableStackTrace)?n:this.spec.disableStackTrace})}cast(e,t={}){let r=this.resolve(Object.assign({},t,{value:e})),s="ignore-optionality"===t.assert,n=r._cast(e,t);if(!1!==t.assert&&!r.isType(n)){if(s&&ht(n))return n;let i=He(e),a=He(n);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}". \n\nattempted value: ${i} \n`+(a!==i?`result of cast: ${a}`:""))}return n}_cast(e,t){let r=void 0===e?e:this.transforms.reduce((r,s)=>s.call(this,r,e,this,t),e);return void 0===r&&(r=this.getDefault(t)),r}_validate(e,t={},r,s){let{path:n,originalValue:i=e,strict:a=this.spec.strict}=t,o=e;a||(o=this._cast(o,Object.assign({assert:!1},t)));let u=[];for(let e of Object.values(this.internalTests))e&&u.push(e);this.runTests({path:n,value:o,originalValue:i,options:t,tests:u},r,e=>{if(e.length)return s(e,o);this.runTests({path:n,value:o,originalValue:i,options:t,tests:this.tests},r,s)})}runTests(e,t,r){let s=!1,{tests:n,value:i,originalValue:a,path:o,options:u}=e,l=e=>{s||(s=!0,t(e,i))},c=e=>{s||(s=!0,r(e,i))},d=n.length,f=[];if(!d)return c([]);let h={value:i,originalValue:a,path:o,options:u,schema:this};for(let e=0;e<n.length;e++){(0,n[e])(h,l,function(e){e&&(Array.isArray(e)?f.push(...e):f.push(e)),--d<=0&&c(f)})}}asNestedTest({key:e,index:t,parent:r,parentPath:s,originalParent:n,options:i}){const a=e??t;if(null==a)throw TypeError("Must include `key` or `index` for nested validations");const o="number"==typeof a;let u=r[a];const l=Object.assign({},i,{strict:!0,parent:r,value:u,originalValue:n[a],key:void 0,[o?"index":"key"]:a,path:o||a.includes(".")?`${s||""}[${o?a:`"${a}"`}]`:(s?`${s}.`:"")+e});return(e,t,r)=>this.resolve(l)._validate(u,l,t,r)}validate(e,t){var r;let s=this.resolve(Object.assign({},t,{value:e})),n=null!=(r=t?.disableStackTrace)?r:s.spec.disableStackTrace;return new Promise((r,i)=>s._validate(e,t,(e,t)=>{tt.isError(e)&&(e.value=t),i(e)},(e,t)=>{e.length?i(new tt(e,t,void 0,void 0,n)):r(t)}))}validateSync(e,t){var r;let s,n=this.resolve(Object.assign({},t,{value:e})),i=null!=(r=t?.disableStackTrace)?r:n.spec.disableStackTrace;return n._validate(e,Object.assign({},t,{sync:!0}),(e,t)=>{throw tt.isError(e)&&(e.value=t),e},(t,r)=>{if(t.length)throw new tt(t,e,void 0,void 0,i);s=r}),s}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(tt.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(tt.isError(e))return!1;throw e}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this,e):bt(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return 0===arguments.length?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const r=this.clone({nullable:e});return r.internalTests.nullable=pt({message:t,name:"nullable",test(e){return null!==e||this.schema.spec.nullable}}),r}optionality(e,t){const r=this.clone({optional:e});return r.internalTests.optionality=pt({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),r}optional(){return this.optionality(!0)}defined(e=rt.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=rt.notNull){return this.nullability(!1,e)}required(e=rt.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=rt.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let r=this.clone(),s=pt(t),n=t.exclusive||t.name&&!0===r.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(r.exclusiveTests[t.name]=!!t.exclusive),r.tests=r.tests.filter(e=>!(e.OPTIONS.name===t.name&&(n||e.OPTIONS.test===s.OPTIONS.test))),r.tests.push(s),r}when(e,t){!Array.isArray(e)&&"string"!=typeof e&&(t=e,e=".");let r=this.clone(),s=Je(e).map(e=>new ft(e));return s.forEach(e=>{e.isSibling&&r.deps.push(e.key)}),r.conditions.push("function"==typeof t?new ut(s,t):ut.fromOptions(s,t)),r}typeError(e){let t=this.clone();return t.internalTests.typeError=pt({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=rt.oneOf){let r=this.clone();return e.forEach(e=>{r._whitelist.add(e),r._blacklist.delete(e)}),r.internalTests.whiteList=pt({message:t,name:"oneOf",skipAbsent:!0,test(e){let t=this.schema._whitelist,r=t.resolveAll(this.resolve);return!!r.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:r}})}}),r}notOneOf(e,t=rt.notOneOf){let r=this.clone();return e.forEach(e=>{r._blacklist.add(e),r._whitelist.delete(e)}),r.internalTests.blacklist=pt({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,r=t.resolveAll(this.resolve);return!r.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:r}})}}),r}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:r,meta:s,optional:n,nullable:i}=t.spec;return{meta:s,label:r,optional:n,nullable:i,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.filter((e,t,r)=>r.findIndex(t=>t.OPTIONS.name===e.OPTIONS.name)===t).map(t=>{const r=t.OPTIONS.params&&e?mt(Object.assign({},t.OPTIONS.params),e):t.OPTIONS.params;return{name:t.OPTIONS.name,params:r}})}}get"~standard"(){const e=this;return{version:1,vendor:"yup",async validate(t){try{return{value:await e.validate(t,{abortEarly:!1})}}catch(e){if(e instanceof tt)return{issues:_t(e)};throw e}}}}}Ft.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Ft.prototype[`${e}At`]=function(t,r,s={}){const{parent:n,parentPath:i,schema:a}=gt(this,t,r,s.context);return a[e](n&&n[i],Object.assign({},s,{parent:n,path:t}))};for(const e of["equals","is"])Ft.prototype[e]=Ft.prototype.oneOf;for(const e of["not","nope"])Ft.prototype[e]=Ft.prototype.notOneOf;const wt=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function kt(e){var t,r;const s=wt.exec(e);return s?{year:Vt(s[1]),month:Vt(s[2],1)-1,day:Vt(s[3],1),hour:Vt(s[4]),minute:Vt(s[5]),second:Vt(s[6]),millisecond:s[7]?Vt(s[7].substring(0,3)):0,precision:null!=(t=null==(r=s[7])?void 0:r.length)?t:void 0,z:s[8]||void 0,plusMinus:s[9]||void 0,hourOffset:Vt(s[10]),minuteOffset:Vt(s[11])}:null}function Vt(e,t=0){return Number(e)||t}let St=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ot=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Et=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,At=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"),Dt=e=>ht(e)||e===e.trim(),$t={}.toString();function Tt(){return new jt}class jt extends Ft{constructor(){super({type:"string",check:e=>(e instanceof String&&(e=e.valueOf()),"string"==typeof e)}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce||this.isType(e)||Array.isArray(e))return e;const r=null!=e&&e.toString?e.toString():e;return r===$t?e:r})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||rt.required,name:"required",skipAbsent:!0,test:e=>!!e.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(e=>"required"!==e.OPTIONS.name),e))}length(e,t=st.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t=st.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t=st.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}matches(e,t){let r,s,n=!1;return t&&("object"==typeof t?({excludeEmptyString:n=!1,message:r,name:s}=t):r=t),this.test({name:s||"matches",message:r||st.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&n||-1!==t.search(e)})}email(e=st.email){return this.matches(St,{name:"email",message:e,excludeEmptyString:!0})}url(e=st.url){return this.matches(Ot,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=st.uuid){return this.matches(Et,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t,r,s="";return e&&("object"==typeof e?({message:s="",allowOffset:t=!1,precision:r}=e):s=e),this.matches(At,{name:"datetime",message:s||st.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:s||st.datetime_offset,params:{allowOffset:t},skipAbsent:!0,test:e=>{if(!e||t)return!0;const r=kt(e);return!!r&&!!r.z}}).test({name:"datetime_precision",message:s||st.datetime_precision,params:{precision:r},skipAbsent:!0,test:e=>{if(!e||null==r)return!0;const t=kt(e);return!!t&&t.precision===r}})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=st.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:Dt})}lowercase(e=st.lowercase){return this.transform(e=>ht(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>ht(e)||e===e.toLowerCase()})}uppercase(e=st.uppercase){return this.transform(e=>ht(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>ht(e)||e===e.toUpperCase()})}}Tt.prototype=jt.prototype;let Ct=new Date("");class Nt extends Ft{constructor(){super({type:"date",check(e){return t=e,"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(e.getTime());var t}}),this.withMutation(()=>{this.transform((e,t)=>!this.spec.coerce||this.isType(e)||null===e?e:(e=function(e){const t=kt(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(void 0===t.z&&void 0===t.plusMinus)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return"Z"!==t.z&&void 0!==t.plusMinus&&(r=60*t.hourOffset+t.minuteOffset,"+"===t.plusMinus&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}(e),isNaN(e)?Nt.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let r;if(ft.isRef(e))r=e;else{let s=this.cast(e);if(!this._typeCheck(s))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);r=s}return r}min(e,t=nt.min){let r=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(e){return e>=this.resolve(r)}})}max(e,t=nt.max){let r=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(e){return e<=this.resolve(r)}})}}function Mt(e,t){let r=1/0;return e.some((e,s)=>{var n;if(null!=(n=t.path)&&n.includes(e))return r=s,!0}),r}function Ut(e){return(t,r)=>Mt(e,t)-Mt(e,r)}Nt.INVALID_DATE=Ct;const Pt=(e,t,r)=>{if("string"!=typeof e)return e;let s=e;try{s=JSON.parse(e)}catch{}return r.isType(s)?s:e};function Rt(e){if("fields"in e){const t={};for(const[r,s]of Object.entries(e.fields))t[r]=Rt(s);return e.setFields(t)}if("array"===e.type){const t=e.optional();return t.innerType&&(t.innerType=Rt(t.innerType)),t}return"tuple"===e.type?e.optional().clone({types:e.spec.types.map(Rt)}):"optional"in e?e.optional():e}let zt=e=>"[object Object]"===Object.prototype.toString.call(e);function Lt(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(e=>-1===r.indexOf(e))}const It=Ut([]);function qt(e){return new Zt(e)}class Zt extends Ft{constructor(e){super({type:"object",check:e=>zt(e)||"function"==typeof e}),this.fields=Object.create(null),this._sortErrors=It,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var r;let s=super._cast(e,t);if(void 0===s)return this.getDefault(t);if(!this._typeCheck(s))return s;let n=this.fields,i=null!=(r=t.stripUnknown)?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(s).filter(e=>!this._nodes.includes(e))),o={},u=Object.assign({},t,{parent:o,__validating:t.__validating||!1}),l=!1;for(const e of a){let r=n[e],a=e in s,c=s[e];if(r){let n;u.path=(t.path?`${t.path}.`:"")+e,r=r.resolve({value:c,context:t.context,parent:o});let i=r instanceof Ft?r.spec:void 0,a=i?.strict;if(null!=i&&i.strip){l=l||e in s;continue}n=t.__validating&&a?c:r.cast(c,u),void 0!==n&&(o[e]=n)}else a&&!i&&(o[e]=c);(a!==e in o||o[e]!==c)&&(l=!0)}return l?o:s}_validate(e,t={},r,s){let{from:n=[],originalValue:i=e,recursive:a=this.spec.recursive}=t;t.from=[{schema:this,value:i},...n],t.__validating=!0,t.originalValue=i,super._validate(e,t,r,(e,n)=>{if(!a||!zt(n))return void s(e,n);i=i||n;let o=[];for(let e of this._nodes){let r=this.fields[e];!r||ft.isRef(r)||o.push(r.asNestedTest({options:t,key:e,parent:n,parentPath:t.path,originalParent:i}))}this.runTests({tests:o,value:n,originalValue:i,options:t},r,t=>{s(t.sort(this._sortErrors).concat(e),n)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),r=t.fields;for(let[e,t]of Object.entries(this.fields)){const s=r[e];r[e]=void 0===s?t:s}return t.withMutation(t=>t.setFields(r,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(r=>{var s;const n=this.fields[r];let i=e;null!=(s=i)&&s.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[r]})),t[r]=n&&"getDefault"in n?n.getDefault(i):void 0}),t}setFields(e,t){let r=this.clone();return r.fields=e,r._nodes=function(e,t=[]){let r=[],s=new Set,n=new Set(t.map(([e,t])=>`${e}-${t}`));function i(e,t){let i=Ue.split(e)[0];s.add(i),n.has(`${t}-${i}`)||r.push([t,i])}for(const t of Object.keys(e)){let r=e[t];s.add(t),ft.isRef(r)&&r.isSibling?i(r.path,t):ot(r)&&"deps"in r&&r.deps.forEach(e=>i(e,t))}return Le.array(Array.from(s),r).reverse()}(e,t),r._sortErrors=Ut(Object.keys(e)),t&&(r._excludedEdges=t),r}shape(e,t=[]){return this.clone().withMutation(r=>{let s=r._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),s=[...r._excludedEdges,...t]),r.setFields(Object.assign(r.fields,e),s)})}partial(){const e={};for(const[t,r]of Object.entries(this.fields))e[t]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(e)}deepPartial(){return Rt(this)}pick(e){const t={};for(const r of e)this.fields[r]&&(t[r]=this.fields[r]);return this.setFields(t,this._excludedEdges.filter(([t,r])=>e.includes(t)&&e.includes(r)))}omit(e){const t=[];for(const r of Object.keys(this.fields))e.includes(r)||t.push(r);return this.pick(t)}from(e,t,r){let s=Ue.getter(e,!0);return this.transform(n=>{if(!n)return n;let i=n;return((e,t)=>{const r=[...Ue.normalizePath(t)];if(1===r.length)return r[0]in e;let s=r.pop(),n=Ue.getter(Ue.join(r),!0)(e);return!(!n||!(s in n))})(n,e)&&(i=Object.assign({},n),r||delete i[e],i[t]=s(n)),i})}json(){return this.transform(Pt)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||it.exact,test(e){if(null==e)return!0;const t=Lt(this.schema,e);return 0===t.length||this.createError({params:{properties:t.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=it.noUnknown){"boolean"!=typeof e&&(t=e,e=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const r=Lt(this.schema,t);return!e||0===r.length||this.createError({params:{unknown:r.join(", ")}})}});return r.spec.noUnknown=e,r}unknown(e=!0,t=it.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const r={};for(const s of Object.keys(t))r[e(s)]=t[s];return r})}camelCase(){return this.transformKeys(Re.camelCase)}snakeCase(){return this.transformKeys(Re.snakeCase)}constantCase(){return this.transformKeys(e=>Re.snakeCase(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),r=super.describe(e);r.fields={};for(const[n,i]of Object.entries(t.fields)){var s;let t=e;null!=(s=t)&&s.value&&(t=Object.assign({},t,{parent:t.value,value:t.value[n]})),r.fields[n]=i.describe(t)}return r}}qt.prototype=Zt.prototype;export{I as C,Tt as a,dt as b,qt as c,Ce as o,Ve as u};
|
|
1
|
+
import{Z as e,L as t}from"./index-DsN-W6V_.js";var r=e=>"checkbox"===e.type,s=e=>e instanceof Date,n=e=>null==e;const i=e=>"object"==typeof e;var a=e=>!n(e)&&!Array.isArray(e)&&i(e)&&!s(e),o=e=>a(e)&&e.target?r(e.target)?e.target.checked:e.target.value:e,u=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),l=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function c(e){let t;const r=Array.isArray(e),s=typeof FileList<"u"&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(l&&(e instanceof Blob||s)||!r&&!a(e))return e;if(t=r?[]:Object.create(Object.getPrototypeOf(e)),r||(e=>{const t=e.constructor&&e.constructor.prototype;return a(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=c(e[r]));else t=e}return t}var d=e=>/^\w*$/.test(e),f=e=>void 0===e,h=e=>Array.isArray(e)?e.filter(Boolean):[],p=e=>h(e.replace(/["|']|\]/g,"").split(/\.|\[/)),m=(e,t,r)=>{if(!t||!a(e))return r;const s=(d(t)?[t]:p(t)).reduce((e,t)=>n(e)?e:e[t],e);return f(s)||s===e?f(e[t])?r:e[t]:s},y=e=>"boolean"==typeof e,g=(e,t,r)=>{let s=-1;const n=d(t)?[t]:p(t),i=n.length,o=i-1;for(;++s<i;){const t=n[s];let i=r;if(s!==o){const r=e[t];i=a(r)||Array.isArray(r)?r:isNaN(+n[s+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=i,e=e[t]}};const v="blur",b="focusout",x="change",_="onBlur",F="onChange",w="onSubmit",k="onTouched",V="all",S="max",O="min",E="maxLength",A="minLength",D="pattern",$="required",T="validate",j=e.createContext(null);j.displayName="HookFormContext";const C=()=>e.useContext(j);var N=(e,t,r,s=!0)=>{const n={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(n,i,{get:()=>{const n=i;return t._proxyFormState[n]!==V&&(t._proxyFormState[n]=!s||V),r&&(r[n]=!0),e[n]}});return n};const M=typeof window<"u"?e.useLayoutEffect:e.useEffect;var U=e=>"string"==typeof e,P=(e,t,r,s,n)=>U(e)?(s&&t.watch.add(e),m(r,e,n)):Array.isArray(e)?e.map(e=>(s&&t.watch.add(e),m(r,e))):(s&&(t.watchAll=!0),r),R=e=>n(e)||!i(e);function z(e,t,r=new WeakSet){if(R(e)||R(t))return e===t;if(s(e)&&s(t))return e.getTime()===t.getTime();const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const n=e[o];if(!i.includes(o))return!1;if("ref"!==o){const e=t[o];if(s(n)&&s(e)||a(n)&&a(e)||Array.isArray(n)&&Array.isArray(e)?!z(n,e,r):n!==e)return!1}}return!0}function L(t){const r=C(),{name:s,disabled:n,control:i=r.control,shouldUnregister:a,defaultValue:l}=t,d=u(i._names.array,s),h=e.useMemo(()=>m(i._formValues,s,m(i._defaultValues,s,l)),[i,s,l]),p=function(t){const r=C(),{control:s=r.control,name:n,defaultValue:i,disabled:a,exact:o,compute:u}=t||{},l=e.useRef(i),c=e.useRef(u),d=e.useRef(void 0),f=e.useRef(s),h=e.useRef(n);c.current=u;const[p,m]=e.useState(()=>{const e=s._getWatch(n,l.current);return c.current?c.current(e):e}),y=e.useCallback(e=>{const t=P(n,s._names,e||s._formValues,!1,l.current);return c.current?c.current(t):t},[s._formValues,s._names,n]),g=e.useCallback(e=>{if(!a){const t=P(n,s._names,e||s._formValues,!1,l.current);if(c.current){const e=c.current(t);z(e,d.current)||(m(e),d.current=e)}else m(t)}},[s._formValues,s._names,a,n]);M(()=>((f.current!==s||!z(h.current,n))&&(f.current=s,h.current=n,g()),s._subscribe({name:n,formState:{values:!0},exact:o,callback:e=>{g(e.values)}})),[s,o,n,g]),e.useEffect(()=>s._removeUnmounted());const v=f.current!==s,b=h.current,x=e.useMemo(()=>{if(a)return null;const e=!v&&!z(b,n);return v||e?y():null},[a,v,n,b,y]);return null!==x?x:p}({control:i,name:s,defaultValue:h,exact:!0}),b=function(t){const r=C(),{control:s=r.control,disabled:n,name:i,exact:a}=t||{},[o,u]=e.useState(s._formState),l=e.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return M(()=>s._subscribe({name:i,formState:l.current,exact:a,callback:e=>{!n&&u({...s._formState,...e})}}),[i,n,a]),e.useEffect(()=>{l.current.isValid&&s._setValid(!0)},[s]),e.useMemo(()=>N(o,s,l.current,!1),[o,s])}({control:i,name:s,exact:!0}),_=e.useRef(t),F=e.useRef(void 0),w=e.useRef(i.register(s,{...t.rules,value:p,...y(t.disabled)?{disabled:t.disabled}:{}}));_.current=t;const k=e.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!m(b.errors,s)},isDirty:{enumerable:!0,get:()=>!!m(b.dirtyFields,s)},isTouched:{enumerable:!0,get:()=>!!m(b.touchedFields,s)},isValidating:{enumerable:!0,get:()=>!!m(b.validatingFields,s)},error:{enumerable:!0,get:()=>m(b.errors,s)}}),[b,s]),V=e.useCallback(e=>w.current.onChange({target:{value:o(e),name:s},type:x}),[s]),S=e.useCallback(()=>w.current.onBlur({target:{value:m(i._formValues,s),name:s},type:v}),[s,i._formValues]),O=e.useCallback(e=>{const t=m(i._fields,s);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[i._fields,s]),E=e.useMemo(()=>({name:s,value:p,...y(n)||b.disabled?{disabled:b.disabled||n}:{},onChange:V,onBlur:S,ref:O}),[s,n,b.disabled,V,S,O,p]);return e.useEffect(()=>{const e=i._options.shouldUnregister||a,t=F.current;t&&t!==s&&!d&&i.unregister(t),i.register(s,{..._.current.rules,...y(_.current.disabled)?{disabled:_.current.disabled}:{}});const r=(e,t)=>{const r=m(i._fields,e);r&&r._f&&(r._f.mount=t)};if(r(s,!0),e){const e=c(m(i._options.defaultValues,s,_.current.defaultValue));g(i._defaultValues,s,e),f(m(i._formValues,s))&&g(i._formValues,s,e)}return!d&&i.register(s),F.current=s,()=>{(d?e&&!i._state.action:e)?i.unregister(s):r(s,!1)}},[s,i,d,a]),e.useEffect(()=>{i._setDisabledField({disabled:n,name:s})},[n,s,i]),e.useMemo(()=>({field:E,formState:b,fieldState:k}),[E,b,k])}const I=e=>e.render(L(e));var q=(e,t,r,s,n)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[s]:n||!0}}:{},Z=e=>Array.isArray(e)?e:[e],B=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function Y(e,t){const r={};for(const s in e)if(e.hasOwnProperty(s)){const n=e[s],i=t[s];if(n&&a(n)&&i){const e=Y(n,i);a(e)&&(r[s]=e)}else e[s]&&(r[s]=i)}return r}var W=e=>a(e)&&!Object.keys(e).length,H=e=>"file"===e.type,J=e=>"function"==typeof e,K=e=>{if(!l)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},G=e=>"select-multiple"===e.type,Q=e=>"radio"===e.type,X=e=>K(e)&&e.isConnected;function ee(e,t){const r=Array.isArray(t)?t:d(t)?[t]:p(t),s=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let s=0;for(;s<r;)e=f(e)?s++:e[t[s++]];return e}(e,r),n=r.length-1,i=r[n];return s&&delete s[i],0!==n&&(a(s)&&W(s)||Array.isArray(s)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!f(e[t]))return!1;return!0}(s))&&ee(e,r.slice(0,-1)),e}function te(e){return Array.isArray(e)||a(e)&&!(e=>{for(const t in e)if(J(e[t]))return!0;return!1})(e)}function re(e,t={}){for(const r in e)te(e[r])?(t[r]=Array.isArray(e[r])?[]:{},re(e[r],t[r])):f(e[r])||(t[r]=!0);return t}function se(e,t,r){r||(r=re(t));for(const s in e)te(e[s])?f(t)||R(r[s])?r[s]=re(e[s],Array.isArray(e[s])?[]:{}):se(e[s],n(t)?{}:t[s],r[s]):r[s]=!z(e[s],t[s]);return r}const ne={value:!1,isValid:!1},ie={value:!0,isValid:!0};var ae=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!f(e[0].attributes.value)?f(e[0].value)||""===e[0].value?ie:{value:e[0].value,isValid:!0}:ie:ne}return ne},oe=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:s})=>f(e)?e:t?""===e?NaN:e&&+e:r&&U(e)?new Date(e):s?s(e):e;const ue={isValid:!1,value:null};var le=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,ue):ue;function ce(e){const t=e.ref;return H(t)?t.files:Q(t)?le(e.refs).value:G(t)?[...t.selectedOptions].map(({value:e})=>e):r(t)?ae(e.refs).value:oe(f(t.value)?e.ref.value:t.value,e)}var de=e=>e instanceof RegExp,fe=e=>f(e)?e:de(e)?e.source:a(e)?de(e.value)?e.value.source:e.value:e,he=e=>({isOnSubmit:!e||e===w,isOnBlur:e===_,isOnChange:e===F,isOnAll:e===V,isOnTouch:e===k});const pe="AsyncFunction";var me=e=>!!e&&!!e.validate&&!!(J(e.validate)&&e.validate.constructor.name===pe||a(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===pe)),ye=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const ge=(e,t,r,s)=>{for(const n of r||Object.keys(e)){const r=m(e,n);if(r){const{_f:e,...i}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],n)&&!s)return!0;if(e.ref&&t(e.ref,e.name)&&!s)return!0;if(ge(i,t))break}else if(a(i)&&ge(i,t))break}}};function ve(e,t,r){const s=m(e,r);if(s||d(r))return{error:s,name:r};const n=r.split(".");for(;n.length;){const s=n.join("."),i=m(t,s),a=m(e,s);if(i&&!Array.isArray(i)&&r!==s)return{name:r};if(a&&a.type)return{name:s,error:a};if(a&&a.root&&a.root.type)return{name:`${s}.root`,error:a.root};n.pop()}return{name:r}}var be=(e,t,r)=>{const s=Z(m(e,r));return g(s,"root",t[r]),g(e,r,s),e};function xe(e,t,r="validate"){if(U(e)||Array.isArray(e)&&e.every(U)||y(e)&&!e)return{type:r,message:U(e)?e:"",ref:t}}var _e=e=>a(e)&&!de(e)?e:{value:e,message:""},Fe=async(e,t,s,i,o,u)=>{const{ref:l,refs:c,required:d,maxLength:h,minLength:p,min:g,max:v,pattern:b,validate:x,name:_,valueAsNumber:F,mount:w}=e._f,k=m(s,_);if(!w||t.has(_))return{};const V=c?c[0]:l,j=e=>{o&&V.reportValidity&&(V.setCustomValidity(y(e)?"":e||""),V.reportValidity())},C={},N=Q(l),M=r(l),P=N||M,R=(F||H(l))&&f(l.value)&&f(k)||K(l)&&""===l.value||""===k||Array.isArray(k)&&!k.length,z=q.bind(null,_,i,C),L=(e,t,r,s=E,n=A)=>{const i=e?t:r;C[_]={type:e?s:n,message:i,ref:l,...z(e?s:n,i)}};if(u?!Array.isArray(k)||!k.length:d&&(!P&&(R||n(k))||y(k)&&!k||M&&!ae(c).isValid||N&&!le(c).isValid)){const{value:e,message:t}=U(d)?{value:!!d,message:d}:_e(d);if(e&&(C[_]={type:$,message:t,ref:V,...z($,t)},!i))return j(t),C}if(!(R||n(g)&&n(v))){let e,t;const r=_e(v),s=_e(g);if(n(k)||isNaN(k)){const n=l.valueAsDate||new Date(k),i=e=>new Date((new Date).toDateString()+" "+e),a="time"==l.type,o="week"==l.type;U(r.value)&&k&&(e=a?i(k)>i(r.value):o?k>r.value:n>new Date(r.value)),U(s.value)&&k&&(t=a?i(k)<i(s.value):o?k<s.value:n<new Date(s.value))}else{const i=l.valueAsNumber||k&&+k;n(r.value)||(e=i>r.value),n(s.value)||(t=i<s.value)}if((e||t)&&(L(!!e,r.message,s.message,S,O),!i))return j(C[_].message),C}if((h||p)&&!R&&(U(k)||u&&Array.isArray(k))){const e=_e(h),t=_e(p),r=!n(e.value)&&k.length>+e.value,s=!n(t.value)&&k.length<+t.value;if((r||s)&&(L(r,e.message,t.message),!i))return j(C[_].message),C}if(b&&!R&&U(k)){const{value:e,message:t}=_e(b);if(de(e)&&!k.match(e)&&(C[_]={type:D,message:t,ref:l,...z(D,t)},!i))return j(t),C}if(x)if(J(x)){const e=xe(await x(k,s),V);if(e&&(C[_]={...e,...z(T,e.message)},!i))return j(e.message),C}else if(a(x)){let e={};for(const t in x){if(!W(e)&&!i)break;const r=xe(await x[t](k,s),V,t);r&&(e={...r,...z(t,r.message)},j(r.message),i&&(C[_]=e))}if(!W(e)&&(C[_]={ref:V,...e},!i))return C}return j(!0),C};const we={mode:w,reValidateMode:F,shouldFocusError:!0};function ke(e={}){let t,i={...we,...e},d={submitCount:0,isDirty:!1,isReady:!1,isLoading:J(i.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:i.errors||{},disabled:i.disabled||!1},p={},x=(a(i.defaultValues)||a(i.values))&&c(i.defaultValues||i.values)||{},_=i.shouldUnregister?{}:c(x),F={action:!1,mount:!1,watch:!1},w={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},k=0;const S={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let O={...S};const E={array:B(),state:B()},A=i.criteriaMode===V,D=async e=>{if(!i.disabled&&(S.isValid||O.isValid||e)){const e=i.resolver?W((await N()).errors):await M(p,!0);e!==d.isValid&&E.state.next({isValid:e})}},$=(e,t)=>{!i.disabled&&(S.isValidating||S.validatingFields||O.isValidating||O.validatingFields)&&((e||Array.from(w.mount)).forEach(e=>{e&&(t?g(d.validatingFields,e,t):ee(d.validatingFields,e))}),E.state.next({validatingFields:d.validatingFields,isValidating:!W(d.validatingFields)}))},T=(e,t,r,s)=>{const n=m(p,e);if(n){const i=m(_,e,f(r)?m(x,e):r);f(i)||s&&s.defaultChecked||t?g(_,e,t?i:ce(n._f)):I(e,i),F.mount&&D()}},j=(e,t,r,s,n)=>{let a=!1,o=!1;const u={name:e};if(!i.disabled){if(!r||s){(S.isDirty||O.isDirty)&&(o=d.isDirty,d.isDirty=u.isDirty=R(),a=o!==u.isDirty);const r=z(m(x,e),t);o=!!m(d.dirtyFields,e),r?ee(d.dirtyFields,e):g(d.dirtyFields,e,!0),u.dirtyFields=d.dirtyFields,a=a||(S.dirtyFields||O.dirtyFields)&&o!==!r}if(r){const t=m(d.touchedFields,e);t||(g(d.touchedFields,e,r),u.touchedFields=d.touchedFields,a=a||(S.touchedFields||O.touchedFields)&&t!==r)}a&&n&&E.state.next(u)}return a?u:{}},C=(e,r,s,n)=>{const a=m(d.errors,e),o=(S.isValid||O.isValid)&&y(r)&&d.isValid!==r;if(i.delayError&&s?(t=(e=>t=>{clearTimeout(k),k=setTimeout(e,t)})(()=>((e,t)=>{g(d.errors,e,t),E.state.next({errors:d.errors})})(e,s)),t(i.delayError)):(clearTimeout(k),t=null,s?g(d.errors,e,s):ee(d.errors,e)),(s?!z(a,s):a)||!W(n)||o){const t={...n,...o&&y(r)?{isValid:r}:{},errors:d.errors,name:e};d={...d,...t},E.state.next(t)}},N=async e=>{$(e,!0);const t=await i.resolver(_,i.context,((e,t,r,s)=>{const n={};for(const r of e){const e=m(t,r);e&&g(n,r,e._f)}return{criteriaMode:r,names:[...e],fields:n,shouldUseNativeValidation:s}})(e||w.mount,p,i.criteriaMode,i.shouldUseNativeValidation));return $(e),t},M=async(e,t,r={valid:!0})=>{for(const s in e){const n=e[s];if(n){const{_f:e,...s}=n;if(e){const s=w.array.has(e.name),a=n._f&&me(n._f);a&&S.validatingFields&&$([e.name],!0);const o=await Fe(n,w.disabled,_,A,i.shouldUseNativeValidation&&!t,s);if(a&&S.validatingFields&&$([e.name]),o[e.name]&&(r.valid=!1,t))break;!t&&(m(o,e.name)?s?be(d.errors,o,e.name):g(d.errors,e.name,o[e.name]):ee(d.errors,e.name))}!W(s)&&await M(s,t,r)}}return r.valid},R=(e,t)=>!i.disabled&&(e&&t&&g(_,e,t),!z(ae(),x)),L=(e,t,r)=>P(e,w,{...F.mount?_:f(t)?x:U(e)?{[e]:t}:t},r,t),I=(e,t,s={})=>{const i=m(p,e);let a=t;if(i){const s=i._f;s&&(!s.disabled&&g(_,e,oe(t,s)),a=K(s.ref)&&n(t)?"":t,G(s.ref)?[...s.ref.options].forEach(e=>e.selected=a.includes(e.value)):s.refs?r(s.ref)?s.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(Array.isArray(a)?e.checked=!!a.find(t=>t===e.value):e.checked=a===e.value||!!a)}):s.refs.forEach(e=>e.checked=e.value===a):H(s.ref)?s.ref.value="":(s.ref.value=a,s.ref.type||E.state.next({name:e,values:c(_)})))}(s.shouldDirty||s.shouldTouch)&&j(e,a,s.shouldTouch,s.shouldDirty,!0),s.shouldValidate&&ie(e)},q=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const i=t[n],o=e+"."+n,u=m(p,o);(w.array.has(e)||a(i)||u&&!u._f)&&!s(i)?q(o,i,r):I(o,i,r)}},te=(e,t,r={})=>{const s=m(p,e),i=w.array.has(e),a=c(t);g(_,e,a),i?(E.array.next({name:e,values:c(_)}),(S.isDirty||S.dirtyFields||O.isDirty||O.dirtyFields)&&r.shouldDirty&&E.state.next({name:e,dirtyFields:se(x,_),isDirty:R(e,a)})):!s||s._f||n(a)?I(e,a,r):q(e,a,r),ye(e,w)&&E.state.next({...d,name:e}),E.state.next({name:F.mount?e:void 0,values:c(_)})},re=async e=>{F.mount=!0;const r=e.target;let n=r.name,a=!0;const u=m(p,n),l=e=>{a=Number.isNaN(e)||s(e)&&isNaN(e.getTime())||z(e,m(_,n,e))},f=he(i.mode),h=he(i.reValidateMode);if(u){let s,y;const x=r.type?ce(u._f):o(e),F=e.type===v||e.type===b,k=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(u._f)&&!i.resolver&&!m(d.errors,n)&&!u._f.deps||((e,t,r,s,n)=>!n.isOnAll&&(!r&&n.isOnTouch?!(t||e):(r?s.isOnBlur:n.isOnBlur)?!e:!(r?s.isOnChange:n.isOnChange)||e))(F,m(d.touchedFields,n),d.isSubmitted,h,f),V=ye(n,w,F);g(_,n,x),F?(!r||!r.readOnly)&&(u._f.onBlur&&u._f.onBlur(e),t&&t(0)):u._f.onChange&&u._f.onChange(e);const T=j(n,x,F),U=!W(T)||V;if(!F&&E.state.next({name:n,type:e.type,values:c(_)}),k)return(S.isValid||O.isValid)&&("onBlur"===i.mode?F&&D():F||D()),U&&E.state.next({name:n,...V?{}:T});if(!F&&V&&E.state.next({...d}),i.resolver){const{errors:e}=await N([n]);if(l(x),a){const t=ve(d.errors,p,n),r=ve(e,p,t.name||n);s=r.error,n=r.name,y=W(e)}}else $([n],!0),s=(await Fe(u,w.disabled,_,A,i.shouldUseNativeValidation))[n],$([n]),l(x),a&&(s?y=!1:(S.isValid||O.isValid)&&(y=await M(p,!0)));a&&(u._f.deps&&(!Array.isArray(u._f.deps)||u._f.deps.length>0)&&ie(u._f.deps),C(n,y,s,T))}},ne=(e,t)=>{if(m(d.errors,t)&&e.focus)return e.focus(),1},ie=async(e,t={})=>{let r,s;const n=Z(e);if(i.resolver){const t=await(async e=>{const{errors:t}=await N(e);if(e)for(const r of e){const e=m(t,r);e?g(d.errors,r,e):ee(d.errors,r)}else d.errors=t;return t})(f(e)?e:n);r=W(t),s=e?!n.some(e=>m(t,e)):r}else e?(s=(await Promise.all(n.map(async e=>{const t=m(p,e);return await M(t&&t._f?{[e]:t}:t)}))).every(Boolean),(s||d.isValid)&&D()):s=r=await M(p);return E.state.next({...!U(e)||(S.isValid||O.isValid)&&r!==d.isValid?{}:{name:e},...i.resolver||!e?{isValid:r}:{},errors:d.errors}),t.shouldFocus&&!s&&ge(p,ne,e?n:w.mount),s},ae=(e,t)=>{let r={...F.mount?_:x};return t&&(r=Y(t.dirtyFields?d.dirtyFields:d.touchedFields,r)),f(e)?r:U(e)?m(r,e):e.map(e=>m(r,e))},ue=(e,t)=>({invalid:!!m((t||d).errors,e),isDirty:!!m((t||d).dirtyFields,e),error:m((t||d).errors,e),isValidating:!!m(d.validatingFields,e),isTouched:!!m((t||d).touchedFields,e)}),le=(e,t,r)=>{const s=(m(p,e,{_f:{}})._f||{}).ref,n=m(d.errors,e)||{},{ref:i,message:a,type:o,...u}=n;g(d.errors,e,{...u,...t,ref:s}),E.state.next({name:e,errors:d.errors,isValid:!1}),r&&r.shouldFocus&&s&&s.focus&&s.focus()},de=e=>E.state.subscribe({next:t=>{((e,t,r)=>!e||!t||e===t||Z(e).some(e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e))))(e.name,t.name,e.exact)&&((e,t,r,s)=>{r(e);const{name:n,...i}=e;return W(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(e=>t[e]===(!s||V))})(t,e.formState||S,Ee,e.reRenderRoot)&&e.callback({values:{..._},...d,...t,defaultValues:x})}}).unsubscribe,pe=(e,t={})=>{for(const r of e?Z(e):w.mount)w.mount.delete(r),w.array.delete(r),t.keepValue||(ee(p,r),ee(_,r)),!t.keepError&&ee(d.errors,r),!t.keepDirty&&ee(d.dirtyFields,r),!t.keepTouched&&ee(d.touchedFields,r),!t.keepIsValidating&&ee(d.validatingFields,r),!i.shouldUnregister&&!t.keepDefaultValue&&ee(x,r);E.state.next({values:c(_)}),E.state.next({...d,...t.keepDirty?{isDirty:R()}:{}}),!t.keepIsValid&&D()},xe=({disabled:e,name:t})=>{(y(e)&&F.mount||e||w.disabled.has(t))&&(e?w.disabled.add(t):w.disabled.delete(t))},_e=(e,t={})=>{let s=m(p,e);const n=y(t.disabled)||y(i.disabled);return g(p,e,{...s||{},_f:{...s&&s._f?s._f:{ref:{name:e}},name:e,mount:!0,...t}}),w.mount.add(e),s?xe({disabled:y(t.disabled)?t.disabled:i.disabled,name:e}):T(e,!0,t.value),{...n?{disabled:t.disabled||i.disabled}:{},...i.progressive?{required:!!t.required,min:fe(t.min),max:fe(t.max),minLength:fe(t.minLength),maxLength:fe(t.maxLength),pattern:fe(t.pattern)}:{},name:e,onChange:re,onBlur:re,ref:n=>{if(n){_e(e,t),s=m(p,e);const i=f(n.value)&&n.querySelectorAll&&n.querySelectorAll("input,select,textarea")[0]||n,a=(e=>Q(e)||r(e))(i),o=s._f.refs||[];if(a?o.find(e=>e===i):i===s._f.ref)return;g(p,e,{_f:{...s._f,...a?{refs:[...o.filter(X),i,...Array.isArray(m(x,e))?[{}]:[]],ref:{type:i.type,name:e}}:{ref:i}}}),T(e,!1,void 0,i)}else s=m(p,e,{}),s._f&&(s._f.mount=!1),(i.shouldUnregister||t.shouldUnregister)&&(!u(w.array,e)||!F.action)&&w.unMount.add(e)}}},ke=()=>i.shouldFocusError&&ge(p,ne,w.mount),Ve=(e,t)=>async r=>{let s;r&&(r.preventDefault&&r.preventDefault(),r.persist&&r.persist());let n=c(_);if(E.state.next({isSubmitting:!0}),i.resolver){const{errors:e,values:t}=await N();d.errors=e,n=c(t)}else await M(p);if(w.disabled.size)for(const e of w.disabled)ee(n,e);if(ee(d.errors,"root"),W(d.errors)){E.state.next({errors:{}});try{await e(n,r)}catch(e){s=e}}else t&&await t({...d.errors},r),ke(),setTimeout(ke);if(E.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:W(d.errors)&&!s,submitCount:d.submitCount+1,errors:d.errors}),s)throw s},Se=(e,t={})=>{const r=e?c(e):x,s=c(r),n=W(e),a=n?x:s;if(t.keepDefaultValues||(x=r),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...w.mount,...Object.keys(se(x,_))]);for(const t of Array.from(e))m(d.dirtyFields,t)?g(a,t,m(_,t)):te(t,m(a,t))}else{if(l&&f(e))for(const e of w.mount){const t=m(p,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(K(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of w.mount)te(e,m(a,e));else p={}}_=i.shouldUnregister?t.keepDefaultValues?c(x):{}:c(a),E.array.next({values:{...a}}),E.state.next({values:{...a}})}w={mount:t.keepDirtyValues?w.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},F.mount=!S.isValid||!!t.keepIsValid||!!t.keepDirtyValues||!i.shouldUnregister&&!W(a),F.watch=!!i.shouldUnregister,E.state.next({submitCount:t.keepSubmitCount?d.submitCount:0,isDirty:!n&&(t.keepDirty?d.isDirty:!(!t.keepDefaultValues||z(e,x))),isSubmitted:!!t.keepIsSubmitted&&d.isSubmitted,dirtyFields:n?{}:t.keepDirtyValues?t.keepDefaultValues&&_?se(x,_):d.dirtyFields:t.keepDefaultValues&&e?se(x,e):t.keepDirty?d.dirtyFields:{},touchedFields:t.keepTouched?d.touchedFields:{},errors:t.keepErrors?d.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&d.isSubmitSuccessful,isSubmitting:!1,defaultValues:x})},Oe=(e,t)=>Se(J(e)?e(_):e,t),Ee=e=>{d={...d,...e}},Ae={control:{register:_e,unregister:pe,getFieldState:ue,handleSubmit:Ve,setError:le,_subscribe:de,_runSchema:N,_focusError:ke,_getWatch:L,_getDirty:R,_setValid:D,_setFieldArray:(e,t=[],r,s,n=!0,a=!0)=>{if(s&&r&&!i.disabled){if(F.action=!0,a&&Array.isArray(m(p,e))){const t=r(m(p,e),s.argA,s.argB);n&&g(p,e,t)}if(a&&Array.isArray(m(d.errors,e))){const t=r(m(d.errors,e),s.argA,s.argB);n&&g(d.errors,e,t),((e,t)=>{!h(m(e,t)).length&&ee(e,t)})(d.errors,e)}if((S.touchedFields||O.touchedFields)&&a&&Array.isArray(m(d.touchedFields,e))){const t=r(m(d.touchedFields,e),s.argA,s.argB);n&&g(d.touchedFields,e,t)}(S.dirtyFields||O.dirtyFields)&&(d.dirtyFields=se(x,_)),E.state.next({name:e,isDirty:R(e,t),dirtyFields:d.dirtyFields,errors:d.errors,isValid:d.isValid})}else g(_,e,t)},_setDisabledField:xe,_setErrors:e=>{d.errors=e,E.state.next({errors:d.errors,isValid:!1})},_getFieldArray:e=>h(m(F.mount?_:x,e,i.shouldUnregister?m(x,e,[]):[])),_reset:Se,_resetDefaultValues:()=>J(i.defaultValues)&&i.defaultValues().then(e=>{Oe(e,i.resetOptions),E.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of w.unMount){const t=m(p,e);t&&(t._f.refs?t._f.refs.every(e=>!X(e)):!X(t._f.ref))&&pe(e)}w.unMount=new Set},_disableForm:e=>{y(e)&&(E.state.next({disabled:e}),ge(p,(t,r)=>{const s=m(p,r);s&&(t.disabled=s._f.disabled||e,Array.isArray(s._f.refs)&&s._f.refs.forEach(t=>{t.disabled=s._f.disabled||e}))},0,!1))},_subjects:E,_proxyFormState:S,get _fields(){return p},get _formValues(){return _},get _state(){return F},set _state(e){F=e},get _defaultValues(){return x},get _names(){return w},set _names(e){w=e},get _formState(){return d},get _options(){return i},set _options(e){i={...i,...e}}},subscribe:e=>(F.mount=!0,O={...O,...e.formState},de({...e,formState:O})),trigger:ie,register:_e,handleSubmit:Ve,watch:(e,t)=>J(e)?E.state.subscribe({next:r=>"values"in r&&e(L(void 0,t),r)}):L(e,t,!0),setValue:te,getValues:ae,reset:Oe,resetField:(e,t={})=>{m(p,e)&&(f(t.defaultValue)?te(e,c(m(x,e))):(te(e,t.defaultValue),g(x,e,c(t.defaultValue))),t.keepTouched||ee(d.touchedFields,e),t.keepDirty||(ee(d.dirtyFields,e),d.isDirty=t.defaultValue?R(e,c(m(x,e))):R()),t.keepError||(ee(d.errors,e),S.isValid&&D()),E.state.next({...d}))},clearErrors:e=>{e&&Z(e).forEach(e=>ee(d.errors,e)),E.state.next({errors:e?d.errors:{}})},unregister:pe,setError:le,setFocus:(e,t={})=>{const r=m(p,e),s=r&&r._f;if(s){const e=s.refs?s.refs[0]:s.ref;e.focus&&(e.focus(),t.shouldSelect&&J(e.select)&&e.select())}},getFieldState:ue};return{...Ae,formControl:Ae}}function Ve(t={}){const r=e.useRef(void 0),s=e.useRef(void 0),[n,i]=e.useState({isDirty:!1,isValidating:!1,isLoading:J(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:J(t.defaultValues)?void 0:t.defaultValues});if(!r.current)if(t.formControl)r.current={...t.formControl,formState:n},t.defaultValues&&!J(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:e,...s}=ke(t);r.current={...s,formState:n}}const a=r.current.control;return a._options=t,M(()=>{const e=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState}),reRenderRoot:!0});return i(e=>({...e,isReady:!0})),a._formState.isReady=!0,e},[a]),e.useEffect(()=>a._disableForm(t.disabled),[a,t.disabled]),e.useEffect(()=>{t.mode&&(a._options.mode=t.mode),t.reValidateMode&&(a._options.reValidateMode=t.reValidateMode)},[a,t.mode,t.reValidateMode]),e.useEffect(()=>{t.errors&&(a._setErrors(t.errors),a._focusError())},[a,t.errors]),e.useEffect(()=>{t.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,t.shouldUnregister]),e.useEffect(()=>{if(a._proxyFormState.isDirty){const e=a._getDirty();e!==n.isDirty&&a._subjects.state.next({isDirty:e})}},[a,n.isDirty]),e.useEffect(()=>{t.values&&!z(t.values,s.current)?(a._reset(t.values,{keepFieldsRef:!0,...a._options.resetOptions}),s.current=t.values,i(e=>({...e}))):a._resetDefaultValues()},[a,t.values]),e.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),r.current.formState=N(n,a),r.current}const Se=(e,t,r)=>{if(e&&"reportValidity"in e){const s=m(r,t);e.setCustomValidity(s&&s.message||""),e.reportValidity()}},Oe=(e,t)=>{for(const r in t.fields){const s=t.fields[r];s&&s.ref&&"reportValidity"in s.ref?Se(s.ref,r,e):s&&s.refs&&s.refs.forEach(t=>Se(t,r,e))}},Ee=(e,t)=>{t.shouldUseNativeValidation&&Oe(e,t);const r={};for(const s in e){const n=m(t.fields,s),i=Object.assign(e[s]||{},{ref:n&&n.ref});if(Ae(t.names||Object.keys(e),s)){const e=Object.assign({},m(r,s));g(e,"root",i),g(r,s,e)}else g(r,s,i)}return r},Ae=(e,t)=>{const r=De(t);return e.some(e=>De(e).match(`^${r}\\.\\d+`))};function De(e){return e.replace(/\]|\[/g,"")}var $e,Te,je={};function Ce(e,t,r){return void 0===r&&(r={}),function(s,n,i){try{return Promise.resolve(function(a,o){try{var u=(null!=t&&t.context&&"development"===je.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e["sync"===r.mode?"validateSync":"validate"](s,Object.assign({abortEarly:!1},t,{context:n}))).then(function(e){return i.shouldUseNativeValidation&&Oe({},i),{values:r.raw?Object.assign({},s):e,errors:{}}}))}catch(e){return o(e)}return u&&u.then?u.then(void 0,o):u}(0,function(e){if(!e.inner)throw e;return{values:{},errors:Ee((t=e,r=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,(t.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),r){var s=e[t.path].types,n=s&&s[t.type];e[t.path]=q(t.path,r,e,t.type,n?[].concat(n,t.message):t.message)}return e},{})),i)};var t,r}))}catch(e){return Promise.reject(e)}}}var Ne,Me,Ue=function(){if(Te)return $e;function e(e){this._maxSize=e,this.clear()}Te=1,e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(e){return this._values[e]},e.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,r=/^\d+$/,s=/^\d/,n=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,i=/^\s*(['"]?)(.*?)(\1)\s*$/,a=new e(512),o=new e(512),u=new e(512);function l(e){return a.get(e)||a.set(e,c(e).map(function(e){return e.replace(i,"$2")}))}function c(e){return e.match(t)||[""]}function d(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function f(e){return!d(e)&&(function(e){return e.match(s)&&!e.match(r)}(e)||function(e){return n.test(e)}(e))}return $e={Cache:e,split:c,normalizePath:l,setter:function(e){var t=l(e);return o.get(e)||o.set(e,function(e,r){for(var s=0,n=t.length,i=e;s<n-1;){var a=t[s];if("__proto__"===a||"constructor"===a||"prototype"===a)return e;i=i[t[s++]]}i[t[s]]=r})},getter:function(e,t){var r=l(e);return u.get(e)||u.set(e,function(e){for(var s=0,n=r.length;s<n;){if(null==e&&t)return;e=e[r[s++]]}return e})},join:function(e){return e.reduce(function(e,t){return e+(d(t)||r.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(e,t,r){!function(e,t,r){var s,n,i,a,o=e.length;for(n=0;n<o;n++)(s=e[n])&&(f(s)&&(s='"'+s+'"'),a=d(s),i=!a&&/^\d+$/.test(s),t.call(r,s,a,i,n,e))}(Array.isArray(e)?e:c(e),t,r)}}}();var Pe,Re=function(){if(Me)return Ne;Me=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=t=>t.match(e)||[],r=e=>e[0].toUpperCase()+e.slice(1),s=(e,r)=>t(e).join(r).toLowerCase(),n=e=>t(e).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,"");return Ne={words:t,upperFirst:r,camelCase:n,pascalCase:e=>r(n(e)),snakeCase:e=>s(e,"_"),kebabCase:e=>s(e,"-"),sentenceCase:e=>r(s(e," ")),titleCase:e=>t(e).map(r).join(" ")}}(),ze={exports:{}};const Le=t(function(){if(Pe)return ze.exports;function e(e,t){var r=e.length,s=new Array(r),n={},i=r,a=function(e){for(var t=new Map,r=0,s=e.length;r<s;r++){var n=e[r];t.has(n[0])||t.set(n[0],new Set),t.has(n[1])||t.set(n[1],new Set),t.get(n[0]).add(n[1])}return t}(t),o=function(e){for(var t=new Map,r=0,s=e.length;r<s;r++)t.set(e[r],r);return t}(e);for(t.forEach(function(e){if(!o.has(e[0])||!o.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)n[i]||u(e[i],i,new Set);return s;function u(e,t,i){if(i.has(e)){var l;try{l=", node was:"+JSON.stringify(e)}catch{l=""}throw new Error("Cyclic dependency"+l)}if(!o.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!n[t]){n[t]=!0;var c=a.get(e)||new Set;if(t=(c=Array.from(c)).length){i.add(e);do{var d=c[--t];u(d,o.get(d),i)}while(t);i.delete(e)}s[--r]=e}}}return Pe=1,ze.exports=function(t){return e(function(e){for(var t=new Set,r=0,s=e.length;r<s;r++){var n=e[r];t.add(n[0]),t.add(n[1])}return Array.from(t)}(t),t)},ze.exports.array=e,ze.exports}()),Ie=Object.prototype.toString,qe=Error.prototype.toString,Ze=RegExp.prototype.toString,Be=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Ye=/^Symbol\((.*)\)(.*)$/;function We(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const r=typeof e;if("number"===r)return function(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}(e);if("string"===r)return t?`"${e}"`:e;if("function"===r)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===r)return Be.call(e).replace(Ye,"Symbol($1)");const s=Ie.call(e).slice(8,-1);return"Date"===s?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===s||e instanceof Error?"["+qe.call(e)+"]":"RegExp"===s?Ze.call(e):null}function He(e,t){let r=We(e,t);return null!==r?r:JSON.stringify(e,function(e,r){let s=We(this[e],t);return null!==s?s:r},2)}function Je(e){return null==e?[]:[].concat(e)}let Ke,Ge,Qe,Xe=/\$\{\s*(\w+)\s*\}/g;Ke=Symbol.toStringTag;class et{constructor(e,t,r,s){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Ke]="Error",this.name="ValidationError",this.value=t,this.path=r,this.type=s,this.errors=[],this.inner=[],Je(e).forEach(e=>{if(tt.isError(e)){this.errors.push(...e.errors);const t=e.inner.length?e.inner:[e];this.inner.push(...t)}else this.errors.push(e)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Ge=Symbol.hasInstance,Qe=Symbol.toStringTag;class tt extends Error{static formatError(e,t){const r=t.label||t.path||"this";return t=Object.assign({},t,{path:r,originalPath:t.path}),"string"==typeof e?e.replace(Xe,(e,r)=>He(t[r])):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,r,s,n){const i=new et(e,t,r,s);if(n)return i;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Qe]="Error",this.name=i.name,this.message=i.message,this.type=i.type,this.value=i.value,this.path=i.path,this.errors=i.errors,this.inner=i.inner,Error.captureStackTrace&&Error.captureStackTrace(this,tt)}static[Ge](e){return et[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let rt={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:s})=>{const n=null!=s&&s!==r?` (cast from the value \`${He(s,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${He(r,!0)}\``+n:`${e} must match the configured type. The validated value was: \`${He(r,!0)}\``+n}},st={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},nt={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},it={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},at={notType:e=>{const{path:t,value:r,spec:s}=e,n=s.types.length;if(Array.isArray(r)){if(r.length<n)return`${t} tuple value has too few items, expected a length of ${n} but got ${r.length} for value: \`${He(r,!0)}\``;if(r.length>n)return`${t} tuple value has too many items, expected a length of ${n} but got ${r.length} for value: \`${He(r,!0)}\``}return tt.formatError(rt.notType,e)}};Object.assign(Object.create(null),{mixed:rt,string:st,number:{min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date:nt,object:it,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:{isValue:"${path} field must be ${value}"},tuple:at});const ot=e=>e&&e.__isYupSchema__;class ut{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:s,otherwise:n}=t,i="function"==typeof r?r:(...e)=>e.every(e=>e===r);return new ut(e,(e,t)=>{var r;let a=i(...e)?s:n;return null!=(r=a?.(t))?r:t})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let r=this.refs.map(e=>e.getValue(t?.value,t?.parent,t?.context)),s=this.fn(r,e,t);if(void 0===s||s===e)return e;if(!ot(s))throw new TypeError("conditions must return a schema object");return s.resolve(t)}}const lt="$",ct=".";function dt(e,t){return new ft(e,t)}class ft{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===lt,this.isValue=this.key[0]===ct,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?lt:this.isValue?ct:"";this.path=this.key.slice(r.length),this.getter=this.path&&Ue.getter(this.path,!0),this.map=t.map}getValue(e,t,r){let s=this.isContext?r:this.isValue?e:t;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(e,t){return this.getValue(e,t?.parent,t?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}ft.prototype.__isYupRef=!0;const ht=e=>null==e;function pt(e){function t({value:t,path:r="",options:s,originalValue:n,schema:i},a,o){const{name:u,test:l,params:c,message:d,skipAbsent:f}=e;let{parent:h,context:p,abortEarly:m=i.spec.abortEarly,disableStackTrace:y=i.spec.disableStackTrace}=s;const g={value:t,parent:h,context:p};function v(e={}){const s=mt(Object.assign({value:t,originalValue:n,label:i.spec.label,path:e.path||r,spec:i.spec,disableStackTrace:e.disableStackTrace||y},c,e.params),g),a=new tt(tt.formatError(e.message||d,s),t,s.path,e.type||u,s.disableStackTrace);return a.params=s,a}const b=m?a:o;let x={path:r,parent:h,type:u,from:s.from,createError:v,resolve:e=>yt(e,g),options:s,originalValue:n,schema:i};const _=e=>{tt.isError(e)?b(e):e?o(null):b(v())},F=e=>{tt.isError(e)?b(e):a(e)};if(f&&ht(t))return _(!0);let w;try{var k;if(w=l.call(x,t,x),"function"==typeof(null==(k=w)?void 0:k.then)){if(s.sync)throw new Error(`Validation test of type: "${x.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(w).then(_,F)}}catch(e){return void F(e)}_(w)}return t.OPTIONS=e,t}function mt(e,t){if(!e)return e;for(const r of Object.keys(e))e[r]=yt(e[r],t);return e}function yt(e,t){return ft.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function gt(e,t,r,s=r){let n,i,a;return t?(Ue.forEach(t,(o,u,l)=>{let c=u?o.slice(1,o.length-1):o,d="tuple"===(e=e.resolve({context:s,parent:n,value:r})).type,f=l?parseInt(c,10):0;if(e.innerType||d){if(d&&!l)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(r&&f>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${o}, in the path: ${t}. because there is no value at that index. `);n=r,r=r&&r[f],e=d?e.spec.types[f]:e.innerType}if(!l){if(!e.fields||!e.fields[c])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);n=r,r=r&&r[c],e=e.fields[c]}i=c,a=u?"["+o+"]":"."+o}),{schema:e,parent:n,parentPath:i}):{parent:n,parentPath:t,schema:e}}class vt extends Set{describe(){const e=[];for(const t of this.values())e.push(ft.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const r of this.values())t.push(e(r));return t}clone(){return new vt(this.values())}merge(e,t){const r=this.clone();return e.forEach(e=>r.add(e)),t.forEach(e=>r.delete(e)),r}}function bt(e,t=new Map){if(ot(e)||!e||"object"!=typeof e)return e;if(t.has(e))return t.get(e);let r;if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=new Array(e.length),t.set(e,r);for(let s=0;s<e.length;s++)r[s]=bt(e[s],t)}else if(e instanceof Map){r=new Map,t.set(e,r);for(const[s,n]of e.entries())r.set(s,bt(n,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const s of e)r.add(bt(s,t))}else{if(!(e instanceof Object))throw Error(`Unable to clone ${e}`);r={},t.set(e,r);for(const[s,n]of Object.entries(e))r[s]=bt(n,t)}return r}function xt(e){if(null==e||!e.length)return;const t=[];let r="",s=!1,n=!1;for(let i=0;i<e.length;i++){const a=e[i];"["!==a||n?"]"!==a||n?'"'!==a?"."!==a||s||n?r+=a:r&&(t.push(r),r=""):n=!n:(r&&(/^\d+$/.test(r)?t.push(r):t.push(r.replace(/^"|"$/g,"")),r=""),s=!1):(r&&(t.push(...r.split(".").filter(Boolean)),r=""),s=!0)}return r&&t.push(...r.split(".").filter(Boolean)),t}function _t(e,t){var r;if((null==(r=e.inner)||!r.length)&&e.errors.length)return function(e,t){const r=t?`${t}.${e.path}`:e.path;return e.errors.map(e=>({message:e,path:xt(r)}))}(e,t);const s=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(e=>_t(e,s))}class Ft{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new vt,this._blacklist=new vt,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(rt.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e?.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=bt(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let r=e(this);return this._mutate=t,r}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,r=e.clone();const s=Object.assign({},t.spec,r.spec);return r.spec=s,r.internalTests=Object.assign({},t.internalTests,r.internalTests),r._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),r._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),r.tests=t.tests,r.exclusiveTests=t.exclusiveTests,r.withMutation(t=>{e.tests.forEach(e=>{t.test(e.OPTIONS)})}),r.transforms=[...t.transforms,...r.transforms],r}isType(e){return null==e?!!(this.spec.nullable&&null===e||this.spec.optional&&void 0===e):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let r=t.conditions;t=t.clone(),t.conditions=[],t=r.reduce((t,r)=>r.resolve(t,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,r,s,n;return Object.assign({},e,{from:e.from||[],strict:null!=(t=e.strict)?t:this.spec.strict,abortEarly:null!=(r=e.abortEarly)?r:this.spec.abortEarly,recursive:null!=(s=e.recursive)?s:this.spec.recursive,disableStackTrace:null!=(n=e.disableStackTrace)?n:this.spec.disableStackTrace})}cast(e,t={}){let r=this.resolve(Object.assign({},t,{value:e})),s="ignore-optionality"===t.assert,n=r._cast(e,t);if(!1!==t.assert&&!r.isType(n)){if(s&&ht(n))return n;let i=He(e),a=He(n);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}". \n\nattempted value: ${i} \n`+(a!==i?`result of cast: ${a}`:""))}return n}_cast(e,t){let r=void 0===e?e:this.transforms.reduce((r,s)=>s.call(this,r,e,this,t),e);return void 0===r&&(r=this.getDefault(t)),r}_validate(e,t={},r,s){let{path:n,originalValue:i=e,strict:a=this.spec.strict}=t,o=e;a||(o=this._cast(o,Object.assign({assert:!1},t)));let u=[];for(let e of Object.values(this.internalTests))e&&u.push(e);this.runTests({path:n,value:o,originalValue:i,options:t,tests:u},r,e=>{if(e.length)return s(e,o);this.runTests({path:n,value:o,originalValue:i,options:t,tests:this.tests},r,s)})}runTests(e,t,r){let s=!1,{tests:n,value:i,originalValue:a,path:o,options:u}=e,l=e=>{s||(s=!0,t(e,i))},c=e=>{s||(s=!0,r(e,i))},d=n.length,f=[];if(!d)return c([]);let h={value:i,originalValue:a,path:o,options:u,schema:this};for(let e=0;e<n.length;e++){(0,n[e])(h,l,function(e){e&&(Array.isArray(e)?f.push(...e):f.push(e)),--d<=0&&c(f)})}}asNestedTest({key:e,index:t,parent:r,parentPath:s,originalParent:n,options:i}){const a=e??t;if(null==a)throw TypeError("Must include `key` or `index` for nested validations");const o="number"==typeof a;let u=r[a];const l=Object.assign({},i,{strict:!0,parent:r,value:u,originalValue:n[a],key:void 0,[o?"index":"key"]:a,path:o||a.includes(".")?`${s||""}[${o?a:`"${a}"`}]`:(s?`${s}.`:"")+e});return(e,t,r)=>this.resolve(l)._validate(u,l,t,r)}validate(e,t){var r;let s=this.resolve(Object.assign({},t,{value:e})),n=null!=(r=t?.disableStackTrace)?r:s.spec.disableStackTrace;return new Promise((r,i)=>s._validate(e,t,(e,t)=>{tt.isError(e)&&(e.value=t),i(e)},(e,t)=>{e.length?i(new tt(e,t,void 0,void 0,n)):r(t)}))}validateSync(e,t){var r;let s,n=this.resolve(Object.assign({},t,{value:e})),i=null!=(r=t?.disableStackTrace)?r:n.spec.disableStackTrace;return n._validate(e,Object.assign({},t,{sync:!0}),(e,t)=>{throw tt.isError(e)&&(e.value=t),e},(t,r)=>{if(t.length)throw new tt(t,e,void 0,void 0,i);s=r}),s}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(tt.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(tt.isError(e))return!1;throw e}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this,e):bt(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return 0===arguments.length?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const r=this.clone({nullable:e});return r.internalTests.nullable=pt({message:t,name:"nullable",test(e){return null!==e||this.schema.spec.nullable}}),r}optionality(e,t){const r=this.clone({optional:e});return r.internalTests.optionality=pt({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),r}optional(){return this.optionality(!0)}defined(e=rt.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=rt.notNull){return this.nullability(!1,e)}required(e=rt.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=rt.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let r=this.clone(),s=pt(t),n=t.exclusive||t.name&&!0===r.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(r.exclusiveTests[t.name]=!!t.exclusive),r.tests=r.tests.filter(e=>!(e.OPTIONS.name===t.name&&(n||e.OPTIONS.test===s.OPTIONS.test))),r.tests.push(s),r}when(e,t){!Array.isArray(e)&&"string"!=typeof e&&(t=e,e=".");let r=this.clone(),s=Je(e).map(e=>new ft(e));return s.forEach(e=>{e.isSibling&&r.deps.push(e.key)}),r.conditions.push("function"==typeof t?new ut(s,t):ut.fromOptions(s,t)),r}typeError(e){let t=this.clone();return t.internalTests.typeError=pt({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=rt.oneOf){let r=this.clone();return e.forEach(e=>{r._whitelist.add(e),r._blacklist.delete(e)}),r.internalTests.whiteList=pt({message:t,name:"oneOf",skipAbsent:!0,test(e){let t=this.schema._whitelist,r=t.resolveAll(this.resolve);return!!r.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:r}})}}),r}notOneOf(e,t=rt.notOneOf){let r=this.clone();return e.forEach(e=>{r._blacklist.add(e),r._whitelist.delete(e)}),r.internalTests.blacklist=pt({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,r=t.resolveAll(this.resolve);return!r.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:r}})}}),r}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:r,meta:s,optional:n,nullable:i}=t.spec;return{meta:s,label:r,optional:n,nullable:i,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.filter((e,t,r)=>r.findIndex(t=>t.OPTIONS.name===e.OPTIONS.name)===t).map(t=>{const r=t.OPTIONS.params&&e?mt(Object.assign({},t.OPTIONS.params),e):t.OPTIONS.params;return{name:t.OPTIONS.name,params:r}})}}get"~standard"(){const e=this;return{version:1,vendor:"yup",async validate(t){try{return{value:await e.validate(t,{abortEarly:!1})}}catch(e){if(e instanceof tt)return{issues:_t(e)};throw e}}}}}Ft.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Ft.prototype[`${e}At`]=function(t,r,s={}){const{parent:n,parentPath:i,schema:a}=gt(this,t,r,s.context);return a[e](n&&n[i],Object.assign({},s,{parent:n,path:t}))};for(const e of["equals","is"])Ft.prototype[e]=Ft.prototype.oneOf;for(const e of["not","nope"])Ft.prototype[e]=Ft.prototype.notOneOf;const wt=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function kt(e){var t,r;const s=wt.exec(e);return s?{year:Vt(s[1]),month:Vt(s[2],1)-1,day:Vt(s[3],1),hour:Vt(s[4]),minute:Vt(s[5]),second:Vt(s[6]),millisecond:s[7]?Vt(s[7].substring(0,3)):0,precision:null!=(t=null==(r=s[7])?void 0:r.length)?t:void 0,z:s[8]||void 0,plusMinus:s[9]||void 0,hourOffset:Vt(s[10]),minuteOffset:Vt(s[11])}:null}function Vt(e,t=0){return Number(e)||t}let St=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ot=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Et=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,At=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"),Dt=e=>ht(e)||e===e.trim(),$t={}.toString();function Tt(){return new jt}class jt extends Ft{constructor(){super({type:"string",check:e=>(e instanceof String&&(e=e.valueOf()),"string"==typeof e)}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce||this.isType(e)||Array.isArray(e))return e;const r=null!=e&&e.toString?e.toString():e;return r===$t?e:r})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||rt.required,name:"required",skipAbsent:!0,test:e=>!!e.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(e=>"required"!==e.OPTIONS.name),e))}length(e,t=st.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t=st.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t=st.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}matches(e,t){let r,s,n=!1;return t&&("object"==typeof t?({excludeEmptyString:n=!1,message:r,name:s}=t):r=t),this.test({name:s||"matches",message:r||st.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&n||-1!==t.search(e)})}email(e=st.email){return this.matches(St,{name:"email",message:e,excludeEmptyString:!0})}url(e=st.url){return this.matches(Ot,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=st.uuid){return this.matches(Et,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t,r,s="";return e&&("object"==typeof e?({message:s="",allowOffset:t=!1,precision:r}=e):s=e),this.matches(At,{name:"datetime",message:s||st.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:s||st.datetime_offset,params:{allowOffset:t},skipAbsent:!0,test:e=>{if(!e||t)return!0;const r=kt(e);return!!r&&!!r.z}}).test({name:"datetime_precision",message:s||st.datetime_precision,params:{precision:r},skipAbsent:!0,test:e=>{if(!e||null==r)return!0;const t=kt(e);return!!t&&t.precision===r}})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=st.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:Dt})}lowercase(e=st.lowercase){return this.transform(e=>ht(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>ht(e)||e===e.toLowerCase()})}uppercase(e=st.uppercase){return this.transform(e=>ht(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>ht(e)||e===e.toUpperCase()})}}Tt.prototype=jt.prototype;let Ct=new Date("");class Nt extends Ft{constructor(){super({type:"date",check(e){return t=e,"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(e.getTime());var t}}),this.withMutation(()=>{this.transform((e,t)=>!this.spec.coerce||this.isType(e)||null===e?e:(e=function(e){const t=kt(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(void 0===t.z&&void 0===t.plusMinus)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return"Z"!==t.z&&void 0!==t.plusMinus&&(r=60*t.hourOffset+t.minuteOffset,"+"===t.plusMinus&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}(e),isNaN(e)?Nt.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let r;if(ft.isRef(e))r=e;else{let s=this.cast(e);if(!this._typeCheck(s))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);r=s}return r}min(e,t=nt.min){let r=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(e){return e>=this.resolve(r)}})}max(e,t=nt.max){let r=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(e){return e<=this.resolve(r)}})}}function Mt(e,t){let r=1/0;return e.some((e,s)=>{var n;if(null!=(n=t.path)&&n.includes(e))return r=s,!0}),r}function Ut(e){return(t,r)=>Mt(e,t)-Mt(e,r)}Nt.INVALID_DATE=Ct;const Pt=(e,t,r)=>{if("string"!=typeof e)return e;let s=e;try{s=JSON.parse(e)}catch{}return r.isType(s)?s:e};function Rt(e){if("fields"in e){const t={};for(const[r,s]of Object.entries(e.fields))t[r]=Rt(s);return e.setFields(t)}if("array"===e.type){const t=e.optional();return t.innerType&&(t.innerType=Rt(t.innerType)),t}return"tuple"===e.type?e.optional().clone({types:e.spec.types.map(Rt)}):"optional"in e?e.optional():e}let zt=e=>"[object Object]"===Object.prototype.toString.call(e);function Lt(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(e=>-1===r.indexOf(e))}const It=Ut([]);function qt(e){return new Zt(e)}class Zt extends Ft{constructor(e){super({type:"object",check:e=>zt(e)||"function"==typeof e}),this.fields=Object.create(null),this._sortErrors=It,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var r;let s=super._cast(e,t);if(void 0===s)return this.getDefault(t);if(!this._typeCheck(s))return s;let n=this.fields,i=null!=(r=t.stripUnknown)?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(s).filter(e=>!this._nodes.includes(e))),o={},u=Object.assign({},t,{parent:o,__validating:t.__validating||!1}),l=!1;for(const e of a){let r=n[e],a=e in s,c=s[e];if(r){let n;u.path=(t.path?`${t.path}.`:"")+e,r=r.resolve({value:c,context:t.context,parent:o});let i=r instanceof Ft?r.spec:void 0,a=i?.strict;if(null!=i&&i.strip){l=l||e in s;continue}n=t.__validating&&a?c:r.cast(c,u),void 0!==n&&(o[e]=n)}else a&&!i&&(o[e]=c);(a!==e in o||o[e]!==c)&&(l=!0)}return l?o:s}_validate(e,t={},r,s){let{from:n=[],originalValue:i=e,recursive:a=this.spec.recursive}=t;t.from=[{schema:this,value:i},...n],t.__validating=!0,t.originalValue=i,super._validate(e,t,r,(e,n)=>{if(!a||!zt(n))return void s(e,n);i=i||n;let o=[];for(let e of this._nodes){let r=this.fields[e];!r||ft.isRef(r)||o.push(r.asNestedTest({options:t,key:e,parent:n,parentPath:t.path,originalParent:i}))}this.runTests({tests:o,value:n,originalValue:i,options:t},r,t=>{s(t.sort(this._sortErrors).concat(e),n)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),r=t.fields;for(let[e,t]of Object.entries(this.fields)){const s=r[e];r[e]=void 0===s?t:s}return t.withMutation(t=>t.setFields(r,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(r=>{var s;const n=this.fields[r];let i=e;null!=(s=i)&&s.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[r]})),t[r]=n&&"getDefault"in n?n.getDefault(i):void 0}),t}setFields(e,t){let r=this.clone();return r.fields=e,r._nodes=function(e,t=[]){let r=[],s=new Set,n=new Set(t.map(([e,t])=>`${e}-${t}`));function i(e,t){let i=Ue.split(e)[0];s.add(i),n.has(`${t}-${i}`)||r.push([t,i])}for(const t of Object.keys(e)){let r=e[t];s.add(t),ft.isRef(r)&&r.isSibling?i(r.path,t):ot(r)&&"deps"in r&&r.deps.forEach(e=>i(e,t))}return Le.array(Array.from(s),r).reverse()}(e,t),r._sortErrors=Ut(Object.keys(e)),t&&(r._excludedEdges=t),r}shape(e,t=[]){return this.clone().withMutation(r=>{let s=r._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),s=[...r._excludedEdges,...t]),r.setFields(Object.assign(r.fields,e),s)})}partial(){const e={};for(const[t,r]of Object.entries(this.fields))e[t]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(e)}deepPartial(){return Rt(this)}pick(e){const t={};for(const r of e)this.fields[r]&&(t[r]=this.fields[r]);return this.setFields(t,this._excludedEdges.filter(([t,r])=>e.includes(t)&&e.includes(r)))}omit(e){const t=[];for(const r of Object.keys(this.fields))e.includes(r)||t.push(r);return this.pick(t)}from(e,t,r){let s=Ue.getter(e,!0);return this.transform(n=>{if(!n)return n;let i=n;return((e,t)=>{const r=[...Ue.normalizePath(t)];if(1===r.length)return r[0]in e;let s=r.pop(),n=Ue.getter(Ue.join(r),!0)(e);return!(!n||!(s in n))})(n,e)&&(i=Object.assign({},n),r||delete i[e],i[t]=s(n)),i})}json(){return this.transform(Pt)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||it.exact,test(e){if(null==e)return!0;const t=Lt(this.schema,e);return 0===t.length||this.createError({params:{properties:t.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=it.noUnknown){"boolean"!=typeof e&&(t=e,e=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const r=Lt(this.schema,t);return!e||0===r.length||this.createError({params:{unknown:r.join(", ")}})}});return r.spec.noUnknown=e,r}unknown(e=!0,t=it.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const r={};for(const s of Object.keys(t))r[e(s)]=t[s];return r})}camelCase(){return this.transformKeys(Re.camelCase)}snakeCase(){return this.transformKeys(Re.snakeCase)}constantCase(){return this.transformKeys(e=>Re.snakeCase(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),r=super.describe(e);r.fields={};for(const[n,i]of Object.entries(t.fields)){var s;let t=e;null!=(s=t)&&s.value&&(t=Object.assign({},t,{parent:t.value,value:t.value[n]})),r.fields[n]=i.describe(t)}return r}}qt.prototype=Zt.prototype;export{I as C,Tt as a,dt as b,qt as c,Ce as o,Ve as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as t,r as i,c as s,g as e,p as o,s as n,a,b as r,d as h,t as p,f as l,Z as c,h as d,i as u,j as m,P as _,C as v,k as g}from"./ContentsPage-BGtOyWxg.js";class y{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&t(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:s,dragAxis:e}=this.gestures,{currSlide:o}=this.pswp;if("y"===e&&this.pswp.options.closeOnVerticalDrag&&o&&o.currZoomLevel<=o.zoomLevels.fit&&!this.gestures.isMultitouch){const i=o.pan.y+(t.y-s.y);if(!this.pswp.dispatch("verticalDrag",{panY:i}).defaultPrevented){this._setPanWithFriction("y",i,.6);const t=1-Math.abs(this._getVerticalDragRatio(o.pan.y));this.pswp.applyBgOpacity(t),o.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),o&&(i(o.pan),o.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:i,currSlide:s}=this.pswp;let e=0;if(this.pswp.animations.stopAll(),i.isShifted()){const s=(i.x-i.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&s<0||t.x<.1&&s<-.5?(e=1,t.x=Math.min(t.x,0)):(t.x>.5&&s>0||t.x>-.1&&s>.5)&&(e=-1,t.x=Math.max(t.x,0)),i.moveIndexBy(e,!0,t.x,!0)}s&&s.currZoomLevel>s.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:i}=this.gestures,{currSlide:e}=this.pswp;if(!e)return;const{pan:o,bounds:n}=e,a=o[t],r=this.pswp.bgOpacity<1&&"y"===t,h=a+function(t,i){return t*i/(1-i)}(i[t],.995);if(r){const t=this._getVerticalDragRatio(a),i=this._getVerticalDragRatio(h);if(t<0&&i<-.4||t>0&&i>.4)return void this.pswp.close()}const p=n.correctPan(t,h);if(a===p)return;const l=p===h?1:.82,c=this.pswp.bgOpacity,d=p-a;this.pswp.animations.startSpring({name:"panGesture"+t,isPan:!0,start:a,end:p,velocity:i[t],dampingRatio:l,onUpdate:i=>{if(r&&this.pswp.bgOpacity<1){const t=1-(p-i)/d;this.pswp.applyBgOpacity(s(c+(1-c)*t,0,1))}o[t]=Math.floor(i),e.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:i,dragAxis:s,prevP1:e,isMultitouch:o}=this.gestures,{currSlide:n,mainScroll:a}=this.pswp,r=i[t]-e[t],h=a.x+r;if(!r||!n)return!1;if("x"===t&&!n.isPannable()&&!o)return a.moveTo(h,!0),!0;const{bounds:p}=n,l=n.pan[t]+r;if(this.pswp.options.allowPanToNext&&"x"===s&&"x"===t&&!o){const i=a.getCurrSlideX(),s=a.x-i,e=r>0,o=!e;if(l>p.min[t]&&e){if(p.min[t]<=this.startPan[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(l<p.max[t]&&o){if(this.startPan[t]<=p.max[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(0!==s){if(s>0)return a.moveTo(Math.max(h,i),!0),!0;if(s<0)return a.moveTo(Math.min(h,i),!0),!0}else this._setPanWithFriction(t,l)}else"y"===t?!a.isShifted()&&p.min.y!==p.max.y&&this._setPanWithFriction(t,l):this._setPanWithFriction(t,l);return!1}_getVerticalDragRatio(t){return(t-(this.pswp.currSlide?.bounds.center.y??0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,i,s){const{currSlide:e}=this.pswp;if(!e)return;const{pan:o,bounds:n}=e;if(n.correctPan(t,i)!==i||s){const e=Math.round(i-o[t]);o[t]+=e*(s||.35)}else o[t]=i}}function w(t){return!!t.target.closest(".pswp__container")}class f{constructor(t){this.gestures=t}click(t,i){const s=i.target.classList,e=s.contains("pswp__img"),o=s.contains("pswp__item")||s.contains("pswp__zoom-wrap");e?this._doClickOrTapAction("imageClick",t,i):o&&this._doClickOrTapAction("bgClick",t,i)}tap(t,i){w(i)&&this._doClickOrTapAction("tap",t,i)}doubleTap(t,i){w(i)&&this._doClickOrTapAction("doubleTap",t,i)}_doClickOrTapAction(t,i,s){const{pswp:e}=this.gestures,{currSlide:o}=e,n=t+"Action",a=e.options[n];if(!e.dispatch(n,{point:i,originalEvent:s}).defaultPrevented){if("function"==typeof a)return void a.call(e,i,s);switch(a){case"close":case"next":e[a]();break;case"zoom":o?.toggleZoom(i);break;case"zoom-or-close":o?.isZoomable()&&o.zoomLevels.secondary!==o.zoomLevels.initial?o.toggleZoom(i):e.options.clickToCloseNonZoomable&&e.close();break;case"toggle-controls":this.gestures.pswp.element?.classList.toggle("pswp--ui-visible")}}}}function P(t,i,s){return t.x=(i.x+s.x)/2,t.y=(i.y+s.y)/2,t}class x{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:i}=this.gestures.pswp;i&&(this._startZoomLevel=i.currZoomLevel,t(this._startPan,i.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:i,p2:s,startP2:o,pswp:n}=this.gestures,{currSlide:a}=n;if(!a)return;const r=a.zoomLevels.min,h=a.zoomLevels.max;if(!a.isZoomable()||n.mainScroll.isShifted())return;P(this._startZoomPoint,i,o),P(this._zoomPoint,t,s);let p=1/e(i,o)*e(t,s)*this._startZoomLevel;if(p>a.zoomLevels.initial+a.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),p<r)if(n.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=a.zoomLevels.initial){const t=1-(r-p)/(r/1.2);n.dispatch("pinchClose",{bgOpacity:t}).defaultPrevented||n.applyBgOpacity(t)}else p=r-.15*(r-p);else p>h&&(p=h+.05*(p-h));a.pan.x=this._calculatePanForZoomLevel("x",p),a.pan.y=this._calculatePanForZoomLevel("y",p),a.setZoomLevel(p),a.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:i}=t;(!i||i.currZoomLevel<i.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&t.options.pinchToClose?t.close():this.correctZoomPan()}_calculatePanForZoomLevel(t,i){const s=i/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*s}correctZoomPan(i){const{pswp:e}=this.gestures,{currSlide:n}=e;if(!n?.isZoomable())return;0===this._zoomPoint.x&&(i=!0);const a=n.currZoomLevel;let r,h=!0;a<n.zoomLevels.initial?r=n.zoomLevels.initial:a>n.zoomLevels.max?r=n.zoomLevels.max:(h=!1,r=a);const p=e.bgOpacity,l=e.bgOpacity<1,c=t({x:0,y:0},n.pan);let d=t({x:0,y:0},c);i&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=a,t(this._startPan,c)),h&&(d={x:this._calculatePanForZoomLevel("x",r),y:this._calculatePanForZoomLevel("y",r)}),n.setZoomLevel(r),d={x:n.bounds.correctPan("x",d.x),y:n.bounds.correctPan("y",d.y)},n.setZoomLevel(a);const u=!o(d,c);if(!u&&!h&&!l)return n._setResolution(r),void n.applyCurrentZoomPan();e.animations.stopAllPan(),e.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t=>{if(t/=1e3,u||h){if(u&&(n.pan.x=c.x+(d.x-c.x)*t,n.pan.y=c.y+(d.y-c.y)*t),h){const i=a+(r-a)*t;n.setZoomLevel(i)}n.applyCurrentZoomPan()}l&&e.bgOpacity<1&&e.applyBgOpacity(s(p+(1-p)*t,0,1))},onComplete:()=>{n._setResolution(r),n.applyCurrentZoomPan()}})}}class S{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new y(this),this.zoomLevels=new x(this),this.tapHandler=new f(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,i,s,e){const{pswp:o}=this,{events:n}=o,a=e?t+e:"";n.add(o.scrollWrap,t+i,this.onPointerDown.bind(this)),n.add(window,t+"move",this.onPointerMove.bind(this)),n.add(window,t+s,this.onPointerUp.bind(this)),a&&n.add(o.scrollWrap,a,this.onPointerUp.bind(this))}onPointerDown(i){const s="mousedown"===i.type||"mouse"===i.pointerType;if(s&&i.button>0)return;const{pswp:e}=this;e.opener.isOpen?e.dispatch("pointerDown",{originalEvent:i}).defaultPrevented||(s&&(e.mouseDetected(),this._preventPointerEventBehaviour(i,"down")),e.animations.stopAll(),this._updatePoints(i,"down"),1===this._numActivePoints&&(this.dragAxis=null,t(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1):i.preventDefault()}onPointerMove(i){this._preventPointerEventBehaviour(i,"move"),this._numActivePoints&&(this._updatePoints(i,"move"),!this.pswp.dispatch("pointerMove",{originalEvent:i}).defaultPrevented&&(1!==this._numActivePoints||this.isDragging?this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop()):(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,t(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop()))))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),!this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented&&(0===this._numActivePoints&&(this._rafStopLoop(),this.isDragging?this._finishDrag():!this.isZooming&&!this.isMultitouch&&this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),1===this._numActivePoints&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?o(this.p1,this.prevP1)||this.drag.change():(!o(this.p1,this.prevP1)||!o(this.p2,this.prevP2))&&this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(i){const s=Date.now(),e=s-this._intervalTime;e<50&&!i||(this.velocity.x=this._getVelocity("x",e),this.velocity.y=this._getVelocity("y",e),this._intervalTime=s,t(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(i){const{mainScroll:s}=this.pswp;if(s.isShifted())return void s.moveIndexBy(0,!0);if(i.type.indexOf("cancel")>0)return;if("mouseup"===i.type||"mouse"===i.pointerType)return void this.tapHandler.click(this.startP1,i);const o=this.pswp.options.doubleTapAction?300:0;this._tapTimer?(this._clearTapTimer(),e(this._lastStartP1,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,i)):(t(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,i),this._clearTapTimer()},o))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,i){const s=this.p1[t]-this._intervalP1[t];return Math.abs(s)>1&&i>5?s/i:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,i){this.pswp.applyFilters("preventPointerEvent",!0,t,i)&&t.preventDefault()}_updatePoints(i,s){if(this._pointerEventEnabled){const e=i,o=this._ongoingPointers.findIndex(t=>t.id===e.pointerId);"up"===s&&o>-1?this._ongoingPointers.splice(o,1):"down"===s&&-1===o?this._ongoingPointers.push(this._convertEventPosToPoint(e,{x:0,y:0})):o>-1&&this._convertEventPosToPoint(e,this._ongoingPointers[o]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&t(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&t(this.p2,this._ongoingPointers[1])}else{const t=i;this._numActivePoints=0,t.type.indexOf("touch")>-1?t.touches&&t.touches.length>0&&(this._convertEventPosToPoint(t.touches[0],this.p1),this._numActivePoints++,t.touches.length>1&&(this._convertEventPosToPoint(t.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(i,this.p1),"up"===s?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){t(this.prevP1,this.p1),t(this.prevP2,this.p2)}_updateStartPoints(){t(this.startP1,this.p1),t(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(0!==t){const i=t>0?"x":"y";Math.abs(this.p1[i]-this.startP1[i])>=10&&(this.dragAxis=i)}}}_convertEventPosToPoint(t,i){return i.x=t.pageX-this.pswp.offset.x,i.y=t.pageY-this.pswp.offset.y,"pointerId"in t?i.id=t.pointerId:void 0!==t.identifier&&(i.id=t.identifier),i}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}}const b={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},T=(t,i)=>i?t:b[t];class L{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});const i=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&i&&this._wasFocused&&i.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:i}=this;if(i.dispatch("keydown",{originalEvent:t}).defaultPrevented||n(t))return;let s,e,o=!1;const a="key"in t;switch(a?t.key:t.keyCode){case T("Escape",a):i.options.escKey&&(s="close");break;case T("z",a):s="toggleZoom";break;case T("ArrowLeft",a):e="x";break;case T("ArrowUp",a):e="y";break;case T("ArrowRight",a):e="x",o=!0;break;case T("ArrowDown",a):o=!0,e="y";break;case T("Tab",a):this._focusRoot()}if(e){t.preventDefault();const{currSlide:n}=i;i.options.arrowKeys&&"x"===e&&i.getNumItems()>1?s=o?"next":"prev":n&&n.currZoomLevel>n.zoomLevels.fit&&(n.pan[e]+=o?-80:80,n.panTo(n.pan.x,n.pan.y))}s&&(t.preventDefault(),i[s]())}_onFocusIn(t){const{template:i}=this.pswp;i&&document!==t.target&&i!==t.target&&!i.contains(t.target)&&i.focus()}}class A{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:i}=this,s=Math.round(i.viewportSize.x+i.viewportSize.x*i.options.spacing),e=s!==this.slideWidth;e&&(this.slideWidth=s,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((i,s)=>{e&&a(i.el,(s+this._containerShiftIndex)*this.slideWidth),t&&i.slide&&i.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const i=r("pswp__item","div",this.pswp.container);i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-hidden","true"),i.style.display=1===t?"block":"none",this.itemHolders.push({el:i})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,i,s){const{pswp:e}=this;let o=e.potentialIndex+t;const n=e.getNumItems();if(e.canLoop()){o=e.getLoopedIndex(o);const i=(t+n)%n;t=i<=n/2?i:i-n}else o<0?o=0:o>=n&&(o=n-1),t=o-e.potentialIndex;e.potentialIndex=o,this._currPositionIndex-=t,e.animations.stopMainScroll();const a=this.getCurrSlideX();if(i){e.animations.startSpring({isMainScroll:!0,start:this.x,end:a,velocity:s||0,naturalFrequency:30,dampingRatio:1,onUpdate:t=>{this.moveTo(t)},onComplete:()=>{this.updateCurrItem(),e.appendHeavy()}});let t=e.potentialIndex-e.currIndex;if(e.canLoop()){const i=(t+n)%n;t=i<=n/2?i:i-n}Math.abs(t)>1&&this.updateCurrItem()}else this.moveTo(a),this.updateCurrItem();return!!t}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){const{pswp:t}=this,i=this._prevPositionIndex-this._currPositionIndex;if(!i)return;this._prevPositionIndex=this._currPositionIndex,t.currIndex=t.potentialIndex;let s,e=Math.abs(i);e>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),e=3,this.itemHolders.forEach(t=>{t.slide?.destroy(),t.slide=void 0}));for(let o=0;o<e;o++)i>0?(s=this.itemHolders.shift(),s&&(this.itemHolders[2]=s,this._containerShiftIndex++,a(s.el,(this._containerShiftIndex+2)*this.slideWidth),t.setContent(s,t.currIndex-e+o+2))):(s=this.itemHolders.pop(),s&&(this.itemHolders.unshift(s),this._containerShiftIndex--,a(s.el,this._containerShiftIndex*this.slideWidth),t.setContent(s,t.currIndex+e-o-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),t.animations.stopAllPan(),this.itemHolders.forEach((t,i)=>{t.slide&&t.slide.setIsActive(1===i)}),t.currSlide=this.itemHolders[1]?.slide,t.contentLoader.updateLazy(i),t.currSlide&&t.currSlide.applyCurrentZoomPan(),t.dispatch("change")}moveTo(t,i){if(!this.pswp.canLoop()&&i){let i=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;i+=this.pswp.currIndex;const s=Math.round(t-this.x);(i<0&&s>0||i>=this.pswp.getNumItems()-1&&s<0)&&(t=this.x+.35*s)}this.x=t,this.pswp.container&&a(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:i??!1})}}const z=.003;class C{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:t}=this,i=this.pswp.currSlide,{options:s}=t;if("fade"===s.showHideAnimationType?(s.showHideOpacity=!0,this._thumbBounds=void 0):"none"===s.showHideAnimationType?(s.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=i?.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=!!(this._duration&&this._duration>50),this._animateZoom=!!this._thumbBounds&&i?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),this._animateZoom?this._animateRootOpacity=s.showHideOpacity??!1:(this._animateRootOpacity=!0,this.isOpening&&i&&(i.zoomAndPanToInitial(),i.applyCurrentZoomPan())),this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>z,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation)return this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,void(this.isOpening&&(t.element&&(t.element.style.opacity=String(z)),t.applyBgOpacity(1)));this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect?(this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=this.pswp.currSlide?.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=t.viewportSize.x+"px")):this._croppedZoom=!1,this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(z)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(z)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(z)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&0!==t.mainScroll.x&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&"IMG"===this._placeholder.tagName?new Promise(t=>{let i=!1,s=!0;h(this._placeholder).finally(()=>{i=!0,s||t(!0)}),setTimeout(()=>{s=!1,i&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){this.pswp.element?.style.setProperty("--pswp-transition-duration",this._duration+"ms"),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),this.pswp.element?.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:t}=this;this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed?t.destroy():this.isOpen&&(this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),t.currSlide?.applyCurrentZoomPan())}_animateToOpenState(){const{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(i){if(!this._thumbBounds)return;const{pswp:s}=this,{innerRect:e}=this._thumbBounds,{currSlide:o,viewportSize:n}=s;if(this._croppedZoom&&e&&this._cropContainer1&&this._cropContainer2){const t=-n.x+(this._thumbBounds.x-e.x)+e.w,s=-n.y+(this._thumbBounds.y-e.y)+e.h,o=n.x-e.w,r=n.y-e.h;i?(this._animateTo(this._cropContainer1,"transform",p(t,s)),this._animateTo(this._cropContainer2,"transform",p(o,r))):(a(this._cropContainer1,t,s),a(this._cropContainer2,o,r))}o&&(t(o.pan,e||this._thumbBounds),o.currZoomLevel=this._thumbBounds.w/o.width,i?this._animateTo(o.container,"transform",o.getCurrentTransform()):o.applyCurrentZoomPan())}_animateTo(t,i,s){if(!this._duration)return void(t.style[i]=s);const{animations:e}=this.pswp,o={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{e.activeAnimations.length||this._onAnimationComplete()},target:t};o[i]=s,e.startTransition(o)}}class Z{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:i}=this.pswp;let{deltaX:s,deltaY:e}=t;if(i&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(i.isZoomable()){let s=-e;1===t.deltaMode?s*=.05:s*=t.deltaMode?1:.002,s=2**s;const o=i.currZoomLevel*s;i.zoomTo(o,{x:t.clientX,y:t.clientY})}}else i.isPannable()&&(1===t.deltaMode&&(s*=18,e*=18),i.panTo(i.pan.x-s,i.pan.y-e))}}class I{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:i}=this.slide,s=this.slide["x"===t?"width":"height"]*this.currZoomLevel,e=l("x"===t?"left":"top",i.options,i.viewportSize,this.slide.data,this.slide.index),o=this.slide.panAreaSize[t];this.center[t]=Math.round((o-s)/2)+e,this.max[t]=s>o?Math.round(o-s)+e:this.center[t],this.min[t]=s>o?e:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,i){return s(i,this.max[t],this.min[t])}}class O{constructor(t,i,s){this.data=t,this.index=i,this.pswp=s,this.isActive=i===s.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!s.opener.isOpen,this.zoomLevels=new c(s.options,t,i,s),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:i}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=r("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new I(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;this.heavyAppended||!t.opener.isOpen||t.mainScroll.isShifted()||(this.isActive,0)||this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this}))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel!==this.zoomLevels.initial&&this.isActive?(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y)):(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize())}updateContentSize(t){const i=this.currentResolution||this.zoomLevels.initial;if(!i)return;const s=Math.round(this.width*i)||this.pswp.viewportSize.x,e=Math.round(this.height*i)||this.pswp.viewportSize.y;!this.sizeChanged(s,e)&&!t||this.content.setDisplayedSize(s,e)}sizeChanged(t,i){return(t!==this.prevDisplayedWidth||i!==this.prevDisplayedHeight)&&(this.prevDisplayedWidth=t,this.prevDisplayedHeight=i,!0)}getPlaceholderElement(){return this.content.placeholder?.element}zoomTo(t,e,o,n){const{pswp:a}=this;if(!this.isZoomable()||a.mainScroll.isShifted())return;a.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:e,transitionDuration:o}),a.animations.stopAllPan();const r=this.currZoomLevel;n||(t=s(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",e,r),this.pan.y=this.calculateZoomToPanOffset("y",e,r),i(this.pan);const h=()=>{this._setResolution(t),this.applyCurrentZoomPan()};o?a.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:h,duration:o,easing:a.options.easing}):h()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,i,s){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];i||(i=this.pswp.getViewportCenterPoint()),s||(s=this.zoomLevels.initial);const e=this.currZoomLevel/s;return this.bounds.correctPan(t,(this.pan[t]-i[t])*e+i[t])}panTo(t,i){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",i),this.applyCurrentZoomPan()}isPannable(){return!!this.width&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return!!this.width&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),t(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,i,s){s/=this.currentResolution||this.zoomLevels.initial,a(this.container,t,i,s)}calculateSize(){const{pswp:i}=this;t(this.panAreaSize,d(i.options,i.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),i.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return p(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}function D(t,i,s){t.classList.add("pswp__button--arrow"),t.setAttribute("aria-controls","pswp__items"),i.on("change",()=>{i.options.loop||(t.disabled=s?!(i.currIndex<i.getNumItems()-1):!(i.currIndex>0))})}const E={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:D},M={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(t,i)=>{D(t,i,!0)}},F={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},B={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},R={name:"counter",order:5,onInit:(t,i)=>{i.on("change",()=>{t.innerText=i.currIndex+1+i.options.indexIndicatorSep+i.getNumItems()})}},k={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(t,i)=>{let s,e=null;const o=i=>{s!==i&&(s=i,((i,s)=>{t.classList.toggle("pswp__preloader--"+i,s)})("active",i))},n=()=>{if(!i.currSlide?.content.isLoading())return o(!1),void(e&&(clearTimeout(e),e=null));e||(e=setTimeout(()=>{o(!!i.currSlide?.content.isLoading()),e=null},i.options.preloaderDelay))};i.on("change",n),i.on("loadComplete",t=>{i.currSlide===t.slide&&n()}),i.ui&&(i.ui.updatePreloaderVisibility=n)}};class H{constructor(t,i){const s=i.name||i.className;let e=i.html;if(!1===t.options[s])return;"string"==typeof t.options[s+"SVG"]&&(e=t.options[s+"SVG"]),t.dispatch("uiElementCreate",{data:i});let o="";i.isButton?(o+="pswp__button ",o+=i.className||`pswp__button--${i.name}`):o+=i.className||`pswp__${i.name}`;let n=i.isButton?i.tagName||"button":i.tagName||"div";n=n.toLowerCase();const a=r(o,n);if(i.isButton){"button"===n&&(a.type="button");let{title:e}=i;const{ariaLabel:o}=i;"string"==typeof t.options[s+"Title"]&&(e=t.options[s+"Title"]),e&&(a.title=e);const r=o||e;r&&a.setAttribute("aria-label",r)}a.innerHTML=function(t){if("string"==typeof t)return t;if(!t||!t.isCustomSVG)return"";const i=t;let s='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return s=s.split("%d").join(i.size||32),i.outlineID&&(s+='<use class="pswp__icn-shadow" xlink:href="#'+i.outlineID+'"/>'),s+=i.inner,s+="</svg>",s}(e),i.onInit&&i.onInit(a,t),i.onClick&&(a.onclick=s=>{"string"==typeof i.onClick?t[i.onClick]():"function"==typeof i.onClick&&i.onClick(s,a,t)});const h=i.appendTo||"bar";let p=t.element;"bar"===h?(t.topBar||(t.topBar=r("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),p=t.topBar):(a.classList.add("pswp__hide-on-close"),"wrapper"===h&&(p=t.scrollWrap)),p?.appendChild(t.applyFilters("uiElement",a,i))}}function W(t,i){t.classList.toggle("pswp--zoomed-in",i)}class N{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[F,E,M,B,k,R],t.dispatch("uiRegister"),this.uiElementsData.sort((t,i)=>(t.order||0)-(i.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(t=>{this.registerElement(t)}),t.on("change",()=>{t.element?.classList.toggle("pswp--one-slide",1===t.getNumItems())}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new H(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:i,options:s}=this.pswp;if(this.pswp.opener.isClosing||!t||!i)return;let{currZoomLevel:e}=i;if(this.pswp.opener.isOpen||(e=i.zoomLevels.initial),e===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=e;const o=i.zoomLevels.initial-i.zoomLevels.secondary;if(Math.abs(o)<.01||!i.isZoomable())return W(t,!1),void t.classList.remove("pswp--zoom-allowed");t.classList.add("pswp--zoom-allowed");W(t,(e===i.zoomLevels.initial?i.zoomLevels.secondary:i.zoomLevels.initial)<=e),("zoom"===s.imageClickAction||"zoom-or-close"===s.imageClickAction)&&t.classList.add("pswp--click-to-zoom")}}const V="cubic-bezier(.4,0,.22,1)";class q{constructor(t){this.props=t;const{target:i,onComplete:s,transform:e,onFinish:o=()=>{},duration:n=333,easing:a=V}=t;this.onFinish=o;const r=e?"transform":"opacity",h=t[r]??"";this._target=i,this._onComplete=s,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{u(i,r,n,a),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},n+500),i.style[r]=h},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&(clearTimeout(this._helperTimeout),this._helperTimeout=null),m(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}}class U{constructor(t,i,s){this.velocity=1e3*t,this._dampingRatio=i||.75,this._naturalFrequency=s||12,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,i){let s,e=0;i/=1e3;const o=Math.E**(-this._dampingRatio*this._naturalFrequency*i);if(1===this._dampingRatio)s=this.velocity+this._naturalFrequency*t,e=(t+s*i)*o,this.velocity=e*-this._naturalFrequency+s*o;else if(this._dampingRatio<1){s=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const n=Math.cos(this._dampedFrequency*i),a=Math.sin(this._dampedFrequency*i);e=o*(t*n+s*a),this.velocity=e*-this._naturalFrequency*this._dampingRatio+o*(-this._dampedFrequency*t*a+this._dampedFrequency*s*n)}return e}}class G{constructor(t){this.props=t,this._raf=0;const{start:i,end:s,velocity:e,onUpdate:o,onComplete:n,onFinish:a=()=>{},dampingRatio:r,naturalFrequency:h}=t;this.onFinish=a;const p=new U(e,r,h);let l=Date.now(),c=i-s;const d=()=>{this._raf&&(c=p.easeFrame(c,Date.now()-l),Math.abs(c)<1&&Math.abs(p.velocity)<50?(o(s),n&&n(),this.onFinish()):(l=Date.now(),o(c+s),this._raf=requestAnimationFrame(d)))};this._raf=requestAnimationFrame(d)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}}class X{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,i){const s=i?new G(t):new q(t);return this.activeAnimations.push(s),s.onFinish=()=>this.stop(s),s}stop(t){t.destroy();const i=this.activeAnimations.indexOf(t);i>-1&&this.activeAnimations.splice(i,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isPan||(t.destroy(),!1))}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isMainScroll||(t.destroy(),!1))}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}}let K=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{K=!0}}))}catch{}class Y{constructor(){this._pool=[]}add(t,i,s,e){this._toggleListener(t,i,s,e)}remove(t,i,s,e){this._toggleListener(t,i,s,e,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,i,s,e,o,n){if(!t)return;const a=o?"removeEventListener":"addEventListener";i.split(" ").forEach(i=>{if(i){n||(o?this._pool=this._pool.filter(e=>e.type!==i||e.listener!==s||e.target!==t):this._pool.push({target:t,type:i,listener:s,passive:e}));const r=!!K&&{passive:e||!1};t[a](i,s,r)}})}}const j={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"};class $ extends _{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new Y,this.animations=new X,this.mainScroll=new A(this),this.gestures=new S(this),this.opener=new C(this),this.keyboard=new L(this),this.contentLoader=new v(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=" "+this.options.mainClass),this.element&&(this.element.className+=" "+t),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new Z(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:t}=this.mainScroll;t[0]&&(t[0].el.style.display="block",this.setContent(t[0],this.currIndex-1)),t[2]&&(t[2].el.style.display="block",this.setContent(t[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const i=this.getNumItems();return this.options.loop&&(t>i-1&&(t-=i),t<0&&(t+=i)),s(t,0,i-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{t.slide?.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex,!0)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){this.currSlide?.zoomTo(...t)}toggleZoom(){this.currSlide?.toggleZoom()}close(){!this.opener.isOpen||this.isDestroying||(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){if(!this.isDestroying)return this.options.showHideAnimationType="none",void this.close();this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),this.element?.remove(),this.mainScroll.itemHolders.forEach(t=>{t.slide?.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((i,s)=>{let e=(this.currSlide?.index??0)-1+s;this.canLoop()&&(e=this.getLoopedIndex(e)),e===t&&(this.setContent(i,t,!0),1===s&&(this.currSlide=i.slide,i.slide?.setIsActive(!0)))}),this.dispatch("change")}setContent(t,i,s){if(this.canLoop()&&(i=this.getLoopedIndex(i)),t.slide){if(t.slide.index===i&&!s)return;t.slide.destroy(),t.slide=void 0}if(!this.canLoop()&&(i<0||i>=this.getNumItems()))return;const e=this.getItemData(i);t.slide=new O(e,i,this),i===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el)}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(i){if(this.isDestroying)return;const s=g(this.options,this);!i&&o(s,this._prevViewportSize)||(t(this._prevViewportSize,s),this.dispatch("beforeResize"),t(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){this.hasMouse||(this.hasMouse=!0,this.element?.classList.add("pswp--has_mouse"))}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,i){this.offset.x=t,this.offset.y=i,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=r("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=r("pswp__bg","div",this.element),this.scrollWrap=r("pswp__scroll-wrap","section",this.element),this.container=r("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new N(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return function(t,i,s){const e=s.dispatch("thumbBounds",{index:t,itemData:i,instance:s});if(e.thumbBounds)return e.thumbBounds;const{element:o}=i;let n,a;if(o&&!1!==s.options.thumbSelector){const t=s.options.thumbSelector||"img";a=o.matches(t)?o:o.querySelector(t)}return a=s.applyFilters("thumbEl",a,i,t),a&&(n=i.thumbCropped?function(t,i,s){const e=t.getBoundingClientRect(),o=e.width/i,n=e.height/s,a=o>n?o:n,r=(e.width-i*a)/2,h=(e.height-s*a)/2,p={x:e.left+r,y:e.top+h,w:i*a};return p.innerRect={w:e.width,h:e.height,x:r,y:h},p}(a,i.width||i.w||0,i.height||i.h||0):function(t){const i=t.getBoundingClientRect();return{x:i.left,y:i.top,w:i.width}}(a)),s.applyFilters("thumbBounds",n,i,t)}(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{...j,...t}}}export{$ as default};
|
|
1
|
+
import{e as t,r as i,c as s,g as e,p as o,s as n,a,b as r,d as h,t as p,f as l,Z as c,h as d,i as u,j as m,P as _,C as v,k as g}from"./ContentsPage-Bu42OF-F.js";class y{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&t(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:s,dragAxis:e}=this.gestures,{currSlide:o}=this.pswp;if("y"===e&&this.pswp.options.closeOnVerticalDrag&&o&&o.currZoomLevel<=o.zoomLevels.fit&&!this.gestures.isMultitouch){const i=o.pan.y+(t.y-s.y);if(!this.pswp.dispatch("verticalDrag",{panY:i}).defaultPrevented){this._setPanWithFriction("y",i,.6);const t=1-Math.abs(this._getVerticalDragRatio(o.pan.y));this.pswp.applyBgOpacity(t),o.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),o&&(i(o.pan),o.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:i,currSlide:s}=this.pswp;let e=0;if(this.pswp.animations.stopAll(),i.isShifted()){const s=(i.x-i.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&s<0||t.x<.1&&s<-.5?(e=1,t.x=Math.min(t.x,0)):(t.x>.5&&s>0||t.x>-.1&&s>.5)&&(e=-1,t.x=Math.max(t.x,0)),i.moveIndexBy(e,!0,t.x,!0)}s&&s.currZoomLevel>s.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:i}=this.gestures,{currSlide:e}=this.pswp;if(!e)return;const{pan:o,bounds:n}=e,a=o[t],r=this.pswp.bgOpacity<1&&"y"===t,h=a+function(t,i){return t*i/(1-i)}(i[t],.995);if(r){const t=this._getVerticalDragRatio(a),i=this._getVerticalDragRatio(h);if(t<0&&i<-.4||t>0&&i>.4)return void this.pswp.close()}const p=n.correctPan(t,h);if(a===p)return;const l=p===h?1:.82,c=this.pswp.bgOpacity,d=p-a;this.pswp.animations.startSpring({name:"panGesture"+t,isPan:!0,start:a,end:p,velocity:i[t],dampingRatio:l,onUpdate:i=>{if(r&&this.pswp.bgOpacity<1){const t=1-(p-i)/d;this.pswp.applyBgOpacity(s(c+(1-c)*t,0,1))}o[t]=Math.floor(i),e.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:i,dragAxis:s,prevP1:e,isMultitouch:o}=this.gestures,{currSlide:n,mainScroll:a}=this.pswp,r=i[t]-e[t],h=a.x+r;if(!r||!n)return!1;if("x"===t&&!n.isPannable()&&!o)return a.moveTo(h,!0),!0;const{bounds:p}=n,l=n.pan[t]+r;if(this.pswp.options.allowPanToNext&&"x"===s&&"x"===t&&!o){const i=a.getCurrSlideX(),s=a.x-i,e=r>0,o=!e;if(l>p.min[t]&&e){if(p.min[t]<=this.startPan[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(l<p.max[t]&&o){if(this.startPan[t]<=p.max[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(0!==s){if(s>0)return a.moveTo(Math.max(h,i),!0),!0;if(s<0)return a.moveTo(Math.min(h,i),!0),!0}else this._setPanWithFriction(t,l)}else"y"===t?!a.isShifted()&&p.min.y!==p.max.y&&this._setPanWithFriction(t,l):this._setPanWithFriction(t,l);return!1}_getVerticalDragRatio(t){return(t-(this.pswp.currSlide?.bounds.center.y??0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,i,s){const{currSlide:e}=this.pswp;if(!e)return;const{pan:o,bounds:n}=e;if(n.correctPan(t,i)!==i||s){const e=Math.round(i-o[t]);o[t]+=e*(s||.35)}else o[t]=i}}function w(t){return!!t.target.closest(".pswp__container")}class f{constructor(t){this.gestures=t}click(t,i){const s=i.target.classList,e=s.contains("pswp__img"),o=s.contains("pswp__item")||s.contains("pswp__zoom-wrap");e?this._doClickOrTapAction("imageClick",t,i):o&&this._doClickOrTapAction("bgClick",t,i)}tap(t,i){w(i)&&this._doClickOrTapAction("tap",t,i)}doubleTap(t,i){w(i)&&this._doClickOrTapAction("doubleTap",t,i)}_doClickOrTapAction(t,i,s){const{pswp:e}=this.gestures,{currSlide:o}=e,n=t+"Action",a=e.options[n];if(!e.dispatch(n,{point:i,originalEvent:s}).defaultPrevented){if("function"==typeof a)return void a.call(e,i,s);switch(a){case"close":case"next":e[a]();break;case"zoom":o?.toggleZoom(i);break;case"zoom-or-close":o?.isZoomable()&&o.zoomLevels.secondary!==o.zoomLevels.initial?o.toggleZoom(i):e.options.clickToCloseNonZoomable&&e.close();break;case"toggle-controls":this.gestures.pswp.element?.classList.toggle("pswp--ui-visible")}}}}function P(t,i,s){return t.x=(i.x+s.x)/2,t.y=(i.y+s.y)/2,t}class x{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:i}=this.gestures.pswp;i&&(this._startZoomLevel=i.currZoomLevel,t(this._startPan,i.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:i,p2:s,startP2:o,pswp:n}=this.gestures,{currSlide:a}=n;if(!a)return;const r=a.zoomLevels.min,h=a.zoomLevels.max;if(!a.isZoomable()||n.mainScroll.isShifted())return;P(this._startZoomPoint,i,o),P(this._zoomPoint,t,s);let p=1/e(i,o)*e(t,s)*this._startZoomLevel;if(p>a.zoomLevels.initial+a.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),p<r)if(n.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=a.zoomLevels.initial){const t=1-(r-p)/(r/1.2);n.dispatch("pinchClose",{bgOpacity:t}).defaultPrevented||n.applyBgOpacity(t)}else p=r-.15*(r-p);else p>h&&(p=h+.05*(p-h));a.pan.x=this._calculatePanForZoomLevel("x",p),a.pan.y=this._calculatePanForZoomLevel("y",p),a.setZoomLevel(p),a.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:i}=t;(!i||i.currZoomLevel<i.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&t.options.pinchToClose?t.close():this.correctZoomPan()}_calculatePanForZoomLevel(t,i){const s=i/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*s}correctZoomPan(i){const{pswp:e}=this.gestures,{currSlide:n}=e;if(!n?.isZoomable())return;0===this._zoomPoint.x&&(i=!0);const a=n.currZoomLevel;let r,h=!0;a<n.zoomLevels.initial?r=n.zoomLevels.initial:a>n.zoomLevels.max?r=n.zoomLevels.max:(h=!1,r=a);const p=e.bgOpacity,l=e.bgOpacity<1,c=t({x:0,y:0},n.pan);let d=t({x:0,y:0},c);i&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=a,t(this._startPan,c)),h&&(d={x:this._calculatePanForZoomLevel("x",r),y:this._calculatePanForZoomLevel("y",r)}),n.setZoomLevel(r),d={x:n.bounds.correctPan("x",d.x),y:n.bounds.correctPan("y",d.y)},n.setZoomLevel(a);const u=!o(d,c);if(!u&&!h&&!l)return n._setResolution(r),void n.applyCurrentZoomPan();e.animations.stopAllPan(),e.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t=>{if(t/=1e3,u||h){if(u&&(n.pan.x=c.x+(d.x-c.x)*t,n.pan.y=c.y+(d.y-c.y)*t),h){const i=a+(r-a)*t;n.setZoomLevel(i)}n.applyCurrentZoomPan()}l&&e.bgOpacity<1&&e.applyBgOpacity(s(p+(1-p)*t,0,1))},onComplete:()=>{n._setResolution(r),n.applyCurrentZoomPan()}})}}class S{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new y(this),this.zoomLevels=new x(this),this.tapHandler=new f(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,i,s,e){const{pswp:o}=this,{events:n}=o,a=e?t+e:"";n.add(o.scrollWrap,t+i,this.onPointerDown.bind(this)),n.add(window,t+"move",this.onPointerMove.bind(this)),n.add(window,t+s,this.onPointerUp.bind(this)),a&&n.add(o.scrollWrap,a,this.onPointerUp.bind(this))}onPointerDown(i){const s="mousedown"===i.type||"mouse"===i.pointerType;if(s&&i.button>0)return;const{pswp:e}=this;e.opener.isOpen?e.dispatch("pointerDown",{originalEvent:i}).defaultPrevented||(s&&(e.mouseDetected(),this._preventPointerEventBehaviour(i,"down")),e.animations.stopAll(),this._updatePoints(i,"down"),1===this._numActivePoints&&(this.dragAxis=null,t(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1):i.preventDefault()}onPointerMove(i){this._preventPointerEventBehaviour(i,"move"),this._numActivePoints&&(this._updatePoints(i,"move"),!this.pswp.dispatch("pointerMove",{originalEvent:i}).defaultPrevented&&(1!==this._numActivePoints||this.isDragging?this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop()):(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,t(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop()))))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),!this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented&&(0===this._numActivePoints&&(this._rafStopLoop(),this.isDragging?this._finishDrag():!this.isZooming&&!this.isMultitouch&&this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),1===this._numActivePoints&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?o(this.p1,this.prevP1)||this.drag.change():(!o(this.p1,this.prevP1)||!o(this.p2,this.prevP2))&&this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(i){const s=Date.now(),e=s-this._intervalTime;e<50&&!i||(this.velocity.x=this._getVelocity("x",e),this.velocity.y=this._getVelocity("y",e),this._intervalTime=s,t(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(i){const{mainScroll:s}=this.pswp;if(s.isShifted())return void s.moveIndexBy(0,!0);if(i.type.indexOf("cancel")>0)return;if("mouseup"===i.type||"mouse"===i.pointerType)return void this.tapHandler.click(this.startP1,i);const o=this.pswp.options.doubleTapAction?300:0;this._tapTimer?(this._clearTapTimer(),e(this._lastStartP1,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,i)):(t(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,i),this._clearTapTimer()},o))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,i){const s=this.p1[t]-this._intervalP1[t];return Math.abs(s)>1&&i>5?s/i:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,i){this.pswp.applyFilters("preventPointerEvent",!0,t,i)&&t.preventDefault()}_updatePoints(i,s){if(this._pointerEventEnabled){const e=i,o=this._ongoingPointers.findIndex(t=>t.id===e.pointerId);"up"===s&&o>-1?this._ongoingPointers.splice(o,1):"down"===s&&-1===o?this._ongoingPointers.push(this._convertEventPosToPoint(e,{x:0,y:0})):o>-1&&this._convertEventPosToPoint(e,this._ongoingPointers[o]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&t(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&t(this.p2,this._ongoingPointers[1])}else{const t=i;this._numActivePoints=0,t.type.indexOf("touch")>-1?t.touches&&t.touches.length>0&&(this._convertEventPosToPoint(t.touches[0],this.p1),this._numActivePoints++,t.touches.length>1&&(this._convertEventPosToPoint(t.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(i,this.p1),"up"===s?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){t(this.prevP1,this.p1),t(this.prevP2,this.p2)}_updateStartPoints(){t(this.startP1,this.p1),t(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(0!==t){const i=t>0?"x":"y";Math.abs(this.p1[i]-this.startP1[i])>=10&&(this.dragAxis=i)}}}_convertEventPosToPoint(t,i){return i.x=t.pageX-this.pswp.offset.x,i.y=t.pageY-this.pswp.offset.y,"pointerId"in t?i.id=t.pointerId:void 0!==t.identifier&&(i.id=t.identifier),i}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}}const b={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},T=(t,i)=>i?t:b[t];class L{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});const i=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&i&&this._wasFocused&&i.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:i}=this;if(i.dispatch("keydown",{originalEvent:t}).defaultPrevented||n(t))return;let s,e,o=!1;const a="key"in t;switch(a?t.key:t.keyCode){case T("Escape",a):i.options.escKey&&(s="close");break;case T("z",a):s="toggleZoom";break;case T("ArrowLeft",a):e="x";break;case T("ArrowUp",a):e="y";break;case T("ArrowRight",a):e="x",o=!0;break;case T("ArrowDown",a):o=!0,e="y";break;case T("Tab",a):this._focusRoot()}if(e){t.preventDefault();const{currSlide:n}=i;i.options.arrowKeys&&"x"===e&&i.getNumItems()>1?s=o?"next":"prev":n&&n.currZoomLevel>n.zoomLevels.fit&&(n.pan[e]+=o?-80:80,n.panTo(n.pan.x,n.pan.y))}s&&(t.preventDefault(),i[s]())}_onFocusIn(t){const{template:i}=this.pswp;i&&document!==t.target&&i!==t.target&&!i.contains(t.target)&&i.focus()}}class A{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:i}=this,s=Math.round(i.viewportSize.x+i.viewportSize.x*i.options.spacing),e=s!==this.slideWidth;e&&(this.slideWidth=s,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((i,s)=>{e&&a(i.el,(s+this._containerShiftIndex)*this.slideWidth),t&&i.slide&&i.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const i=r("pswp__item","div",this.pswp.container);i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-hidden","true"),i.style.display=1===t?"block":"none",this.itemHolders.push({el:i})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,i,s){const{pswp:e}=this;let o=e.potentialIndex+t;const n=e.getNumItems();if(e.canLoop()){o=e.getLoopedIndex(o);const i=(t+n)%n;t=i<=n/2?i:i-n}else o<0?o=0:o>=n&&(o=n-1),t=o-e.potentialIndex;e.potentialIndex=o,this._currPositionIndex-=t,e.animations.stopMainScroll();const a=this.getCurrSlideX();if(i){e.animations.startSpring({isMainScroll:!0,start:this.x,end:a,velocity:s||0,naturalFrequency:30,dampingRatio:1,onUpdate:t=>{this.moveTo(t)},onComplete:()=>{this.updateCurrItem(),e.appendHeavy()}});let t=e.potentialIndex-e.currIndex;if(e.canLoop()){const i=(t+n)%n;t=i<=n/2?i:i-n}Math.abs(t)>1&&this.updateCurrItem()}else this.moveTo(a),this.updateCurrItem();return!!t}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){const{pswp:t}=this,i=this._prevPositionIndex-this._currPositionIndex;if(!i)return;this._prevPositionIndex=this._currPositionIndex,t.currIndex=t.potentialIndex;let s,e=Math.abs(i);e>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),e=3,this.itemHolders.forEach(t=>{t.slide?.destroy(),t.slide=void 0}));for(let o=0;o<e;o++)i>0?(s=this.itemHolders.shift(),s&&(this.itemHolders[2]=s,this._containerShiftIndex++,a(s.el,(this._containerShiftIndex+2)*this.slideWidth),t.setContent(s,t.currIndex-e+o+2))):(s=this.itemHolders.pop(),s&&(this.itemHolders.unshift(s),this._containerShiftIndex--,a(s.el,this._containerShiftIndex*this.slideWidth),t.setContent(s,t.currIndex+e-o-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),t.animations.stopAllPan(),this.itemHolders.forEach((t,i)=>{t.slide&&t.slide.setIsActive(1===i)}),t.currSlide=this.itemHolders[1]?.slide,t.contentLoader.updateLazy(i),t.currSlide&&t.currSlide.applyCurrentZoomPan(),t.dispatch("change")}moveTo(t,i){if(!this.pswp.canLoop()&&i){let i=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;i+=this.pswp.currIndex;const s=Math.round(t-this.x);(i<0&&s>0||i>=this.pswp.getNumItems()-1&&s<0)&&(t=this.x+.35*s)}this.x=t,this.pswp.container&&a(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:i??!1})}}const z=.003;class C{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:t}=this,i=this.pswp.currSlide,{options:s}=t;if("fade"===s.showHideAnimationType?(s.showHideOpacity=!0,this._thumbBounds=void 0):"none"===s.showHideAnimationType?(s.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=i?.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=!!(this._duration&&this._duration>50),this._animateZoom=!!this._thumbBounds&&i?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),this._animateZoom?this._animateRootOpacity=s.showHideOpacity??!1:(this._animateRootOpacity=!0,this.isOpening&&i&&(i.zoomAndPanToInitial(),i.applyCurrentZoomPan())),this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>z,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation)return this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,void(this.isOpening&&(t.element&&(t.element.style.opacity=String(z)),t.applyBgOpacity(1)));this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect?(this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=this.pswp.currSlide?.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=t.viewportSize.x+"px")):this._croppedZoom=!1,this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(z)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(z)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(z)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&0!==t.mainScroll.x&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&"IMG"===this._placeholder.tagName?new Promise(t=>{let i=!1,s=!0;h(this._placeholder).finally(()=>{i=!0,s||t(!0)}),setTimeout(()=>{s=!1,i&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){this.pswp.element?.style.setProperty("--pswp-transition-duration",this._duration+"ms"),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),this.pswp.element?.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:t}=this;this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed?t.destroy():this.isOpen&&(this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),t.currSlide?.applyCurrentZoomPan())}_animateToOpenState(){const{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(i){if(!this._thumbBounds)return;const{pswp:s}=this,{innerRect:e}=this._thumbBounds,{currSlide:o,viewportSize:n}=s;if(this._croppedZoom&&e&&this._cropContainer1&&this._cropContainer2){const t=-n.x+(this._thumbBounds.x-e.x)+e.w,s=-n.y+(this._thumbBounds.y-e.y)+e.h,o=n.x-e.w,r=n.y-e.h;i?(this._animateTo(this._cropContainer1,"transform",p(t,s)),this._animateTo(this._cropContainer2,"transform",p(o,r))):(a(this._cropContainer1,t,s),a(this._cropContainer2,o,r))}o&&(t(o.pan,e||this._thumbBounds),o.currZoomLevel=this._thumbBounds.w/o.width,i?this._animateTo(o.container,"transform",o.getCurrentTransform()):o.applyCurrentZoomPan())}_animateTo(t,i,s){if(!this._duration)return void(t.style[i]=s);const{animations:e}=this.pswp,o={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{e.activeAnimations.length||this._onAnimationComplete()},target:t};o[i]=s,e.startTransition(o)}}class Z{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:i}=this.pswp;let{deltaX:s,deltaY:e}=t;if(i&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(i.isZoomable()){let s=-e;1===t.deltaMode?s*=.05:s*=t.deltaMode?1:.002,s=2**s;const o=i.currZoomLevel*s;i.zoomTo(o,{x:t.clientX,y:t.clientY})}}else i.isPannable()&&(1===t.deltaMode&&(s*=18,e*=18),i.panTo(i.pan.x-s,i.pan.y-e))}}class I{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:i}=this.slide,s=this.slide["x"===t?"width":"height"]*this.currZoomLevel,e=l("x"===t?"left":"top",i.options,i.viewportSize,this.slide.data,this.slide.index),o=this.slide.panAreaSize[t];this.center[t]=Math.round((o-s)/2)+e,this.max[t]=s>o?Math.round(o-s)+e:this.center[t],this.min[t]=s>o?e:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,i){return s(i,this.max[t],this.min[t])}}class O{constructor(t,i,s){this.data=t,this.index=i,this.pswp=s,this.isActive=i===s.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!s.opener.isOpen,this.zoomLevels=new c(s.options,t,i,s),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:i}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=r("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new I(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;this.heavyAppended||!t.opener.isOpen||t.mainScroll.isShifted()||(this.isActive,0)||this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this}))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel!==this.zoomLevels.initial&&this.isActive?(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y)):(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize())}updateContentSize(t){const i=this.currentResolution||this.zoomLevels.initial;if(!i)return;const s=Math.round(this.width*i)||this.pswp.viewportSize.x,e=Math.round(this.height*i)||this.pswp.viewportSize.y;!this.sizeChanged(s,e)&&!t||this.content.setDisplayedSize(s,e)}sizeChanged(t,i){return(t!==this.prevDisplayedWidth||i!==this.prevDisplayedHeight)&&(this.prevDisplayedWidth=t,this.prevDisplayedHeight=i,!0)}getPlaceholderElement(){return this.content.placeholder?.element}zoomTo(t,e,o,n){const{pswp:a}=this;if(!this.isZoomable()||a.mainScroll.isShifted())return;a.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:e,transitionDuration:o}),a.animations.stopAllPan();const r=this.currZoomLevel;n||(t=s(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",e,r),this.pan.y=this.calculateZoomToPanOffset("y",e,r),i(this.pan);const h=()=>{this._setResolution(t),this.applyCurrentZoomPan()};o?a.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:h,duration:o,easing:a.options.easing}):h()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,i,s){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];i||(i=this.pswp.getViewportCenterPoint()),s||(s=this.zoomLevels.initial);const e=this.currZoomLevel/s;return this.bounds.correctPan(t,(this.pan[t]-i[t])*e+i[t])}panTo(t,i){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",i),this.applyCurrentZoomPan()}isPannable(){return!!this.width&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return!!this.width&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),t(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,i,s){s/=this.currentResolution||this.zoomLevels.initial,a(this.container,t,i,s)}calculateSize(){const{pswp:i}=this;t(this.panAreaSize,d(i.options,i.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),i.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return p(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}function D(t,i,s){t.classList.add("pswp__button--arrow"),t.setAttribute("aria-controls","pswp__items"),i.on("change",()=>{i.options.loop||(t.disabled=s?!(i.currIndex<i.getNumItems()-1):!(i.currIndex>0))})}const E={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:D},M={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(t,i)=>{D(t,i,!0)}},F={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},B={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},R={name:"counter",order:5,onInit:(t,i)=>{i.on("change",()=>{t.innerText=i.currIndex+1+i.options.indexIndicatorSep+i.getNumItems()})}},k={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(t,i)=>{let s,e=null;const o=i=>{s!==i&&(s=i,((i,s)=>{t.classList.toggle("pswp__preloader--"+i,s)})("active",i))},n=()=>{if(!i.currSlide?.content.isLoading())return o(!1),void(e&&(clearTimeout(e),e=null));e||(e=setTimeout(()=>{o(!!i.currSlide?.content.isLoading()),e=null},i.options.preloaderDelay))};i.on("change",n),i.on("loadComplete",t=>{i.currSlide===t.slide&&n()}),i.ui&&(i.ui.updatePreloaderVisibility=n)}};class H{constructor(t,i){const s=i.name||i.className;let e=i.html;if(!1===t.options[s])return;"string"==typeof t.options[s+"SVG"]&&(e=t.options[s+"SVG"]),t.dispatch("uiElementCreate",{data:i});let o="";i.isButton?(o+="pswp__button ",o+=i.className||`pswp__button--${i.name}`):o+=i.className||`pswp__${i.name}`;let n=i.isButton?i.tagName||"button":i.tagName||"div";n=n.toLowerCase();const a=r(o,n);if(i.isButton){"button"===n&&(a.type="button");let{title:e}=i;const{ariaLabel:o}=i;"string"==typeof t.options[s+"Title"]&&(e=t.options[s+"Title"]),e&&(a.title=e);const r=o||e;r&&a.setAttribute("aria-label",r)}a.innerHTML=function(t){if("string"==typeof t)return t;if(!t||!t.isCustomSVG)return"";const i=t;let s='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return s=s.split("%d").join(i.size||32),i.outlineID&&(s+='<use class="pswp__icn-shadow" xlink:href="#'+i.outlineID+'"/>'),s+=i.inner,s+="</svg>",s}(e),i.onInit&&i.onInit(a,t),i.onClick&&(a.onclick=s=>{"string"==typeof i.onClick?t[i.onClick]():"function"==typeof i.onClick&&i.onClick(s,a,t)});const h=i.appendTo||"bar";let p=t.element;"bar"===h?(t.topBar||(t.topBar=r("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),p=t.topBar):(a.classList.add("pswp__hide-on-close"),"wrapper"===h&&(p=t.scrollWrap)),p?.appendChild(t.applyFilters("uiElement",a,i))}}function W(t,i){t.classList.toggle("pswp--zoomed-in",i)}class N{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[F,E,M,B,k,R],t.dispatch("uiRegister"),this.uiElementsData.sort((t,i)=>(t.order||0)-(i.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(t=>{this.registerElement(t)}),t.on("change",()=>{t.element?.classList.toggle("pswp--one-slide",1===t.getNumItems())}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new H(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:i,options:s}=this.pswp;if(this.pswp.opener.isClosing||!t||!i)return;let{currZoomLevel:e}=i;if(this.pswp.opener.isOpen||(e=i.zoomLevels.initial),e===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=e;const o=i.zoomLevels.initial-i.zoomLevels.secondary;if(Math.abs(o)<.01||!i.isZoomable())return W(t,!1),void t.classList.remove("pswp--zoom-allowed");t.classList.add("pswp--zoom-allowed");W(t,(e===i.zoomLevels.initial?i.zoomLevels.secondary:i.zoomLevels.initial)<=e),("zoom"===s.imageClickAction||"zoom-or-close"===s.imageClickAction)&&t.classList.add("pswp--click-to-zoom")}}const V="cubic-bezier(.4,0,.22,1)";class q{constructor(t){this.props=t;const{target:i,onComplete:s,transform:e,onFinish:o=()=>{},duration:n=333,easing:a=V}=t;this.onFinish=o;const r=e?"transform":"opacity",h=t[r]??"";this._target=i,this._onComplete=s,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{u(i,r,n,a),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},n+500),i.style[r]=h},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&(clearTimeout(this._helperTimeout),this._helperTimeout=null),m(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}}class U{constructor(t,i,s){this.velocity=1e3*t,this._dampingRatio=i||.75,this._naturalFrequency=s||12,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,i){let s,e=0;i/=1e3;const o=Math.E**(-this._dampingRatio*this._naturalFrequency*i);if(1===this._dampingRatio)s=this.velocity+this._naturalFrequency*t,e=(t+s*i)*o,this.velocity=e*-this._naturalFrequency+s*o;else if(this._dampingRatio<1){s=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const n=Math.cos(this._dampedFrequency*i),a=Math.sin(this._dampedFrequency*i);e=o*(t*n+s*a),this.velocity=e*-this._naturalFrequency*this._dampingRatio+o*(-this._dampedFrequency*t*a+this._dampedFrequency*s*n)}return e}}class G{constructor(t){this.props=t,this._raf=0;const{start:i,end:s,velocity:e,onUpdate:o,onComplete:n,onFinish:a=()=>{},dampingRatio:r,naturalFrequency:h}=t;this.onFinish=a;const p=new U(e,r,h);let l=Date.now(),c=i-s;const d=()=>{this._raf&&(c=p.easeFrame(c,Date.now()-l),Math.abs(c)<1&&Math.abs(p.velocity)<50?(o(s),n&&n(),this.onFinish()):(l=Date.now(),o(c+s),this._raf=requestAnimationFrame(d)))};this._raf=requestAnimationFrame(d)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}}class X{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,i){const s=i?new G(t):new q(t);return this.activeAnimations.push(s),s.onFinish=()=>this.stop(s),s}stop(t){t.destroy();const i=this.activeAnimations.indexOf(t);i>-1&&this.activeAnimations.splice(i,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isPan||(t.destroy(),!1))}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isMainScroll||(t.destroy(),!1))}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}}let K=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{K=!0}}))}catch{}class Y{constructor(){this._pool=[]}add(t,i,s,e){this._toggleListener(t,i,s,e)}remove(t,i,s,e){this._toggleListener(t,i,s,e,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,i,s,e,o,n){if(!t)return;const a=o?"removeEventListener":"addEventListener";i.split(" ").forEach(i=>{if(i){n||(o?this._pool=this._pool.filter(e=>e.type!==i||e.listener!==s||e.target!==t):this._pool.push({target:t,type:i,listener:s,passive:e}));const r=!!K&&{passive:e||!1};t[a](i,s,r)}})}}const j={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"};class $ extends _{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new Y,this.animations=new X,this.mainScroll=new A(this),this.gestures=new S(this),this.opener=new C(this),this.keyboard=new L(this),this.contentLoader=new v(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=" "+this.options.mainClass),this.element&&(this.element.className+=" "+t),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new Z(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:t}=this.mainScroll;t[0]&&(t[0].el.style.display="block",this.setContent(t[0],this.currIndex-1)),t[2]&&(t[2].el.style.display="block",this.setContent(t[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const i=this.getNumItems();return this.options.loop&&(t>i-1&&(t-=i),t<0&&(t+=i)),s(t,0,i-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{t.slide?.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex,!0)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){this.currSlide?.zoomTo(...t)}toggleZoom(){this.currSlide?.toggleZoom()}close(){!this.opener.isOpen||this.isDestroying||(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){if(!this.isDestroying)return this.options.showHideAnimationType="none",void this.close();this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),this.element?.remove(),this.mainScroll.itemHolders.forEach(t=>{t.slide?.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((i,s)=>{let e=(this.currSlide?.index??0)-1+s;this.canLoop()&&(e=this.getLoopedIndex(e)),e===t&&(this.setContent(i,t,!0),1===s&&(this.currSlide=i.slide,i.slide?.setIsActive(!0)))}),this.dispatch("change")}setContent(t,i,s){if(this.canLoop()&&(i=this.getLoopedIndex(i)),t.slide){if(t.slide.index===i&&!s)return;t.slide.destroy(),t.slide=void 0}if(!this.canLoop()&&(i<0||i>=this.getNumItems()))return;const e=this.getItemData(i);t.slide=new O(e,i,this),i===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el)}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(i){if(this.isDestroying)return;const s=g(this.options,this);!i&&o(s,this._prevViewportSize)||(t(this._prevViewportSize,s),this.dispatch("beforeResize"),t(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){this.hasMouse||(this.hasMouse=!0,this.element?.classList.add("pswp--has_mouse"))}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,i){this.offset.x=t,this.offset.y=i,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=r("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=r("pswp__bg","div",this.element),this.scrollWrap=r("pswp__scroll-wrap","section",this.element),this.container=r("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new N(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return function(t,i,s){const e=s.dispatch("thumbBounds",{index:t,itemData:i,instance:s});if(e.thumbBounds)return e.thumbBounds;const{element:o}=i;let n,a;if(o&&!1!==s.options.thumbSelector){const t=s.options.thumbSelector||"img";a=o.matches(t)?o:o.querySelector(t)}return a=s.applyFilters("thumbEl",a,i,t),a&&(n=i.thumbCropped?function(t,i,s){const e=t.getBoundingClientRect(),o=e.width/i,n=e.height/s,a=o>n?o:n,r=(e.width-i*a)/2,h=(e.height-s*a)/2,p={x:e.left+r,y:e.top+h,w:i*a};return p.innerRect={w:e.width,h:e.height,x:r,y:h},p}(a,i.width||i.w||0,i.height||i.h||0):function(t){const i=t.getBoundingClientRect();return{x:i.left,y:i.top,w:i.width}}(a)),s.applyFilters("thumbBounds",n,i,t)}(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{...j,...t}}}export{$ as default};
|