@wellesley/user 1.0.692 → 1.0.693

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +2 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import{api as Lr,usePostApiV1UploadsMutation as kz,useGetApiV1SearchQuery as wz,useGetApiV1InstanceTimezonesQuery as bz,useGetApiV1AddressesSuggestQuery as xz,usePutApiV1UsersByUserIdMutation as Az}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.677";import zz,{forwardRef as Mn,createElement as ec,useRef as ir,useState as rt,useEffect as Ye,useCallback as di,useMemo as Mk,isValidElement as Sz,cloneElement as Cz}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{toast as qt}from"https://cdn.jsdelivr.net/npm/@wellesley/system-toast@1.0.21";import{getErrorMsg as Xa}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.528";import{createAction as UA,createSlice as _i,createSelector as vi}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{get as xv,set as p0,appendErrors as jz,useForm as Ev,useFieldArray as tu,FormProvider as Tz}from"https://cdn.jsdelivr.net/npm/react-hook-form@7.51.0/+esm";import{getStore as Uv,rootReducer as Dv}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.676";import{useDispatch as Ha,useSelector as Ie}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{fillTopic as DA,wsSlice as Wv}from"https://cdn.jsdelivr.net/npm/@wellesley/ws@1.0.659";import{getAcceptList as WA,useImageSelection as FA,UploadMediaModal as VA,UploadTag as Ok,selectUploadFile as Pz}from"https://cdn.jsdelivr.net/npm/@wellesley/uploads@1.0.562";import{cn as Re,DropdownMenu as xp,DropdownMenuTrigger as Ap,DropdownMenuContent as zp,DropdownMenuItem as cp,Button as Dt,Avatar as Lz,AvatarImage as Rz,TooltipWrapper as XA,Dialog as Iz,DialogContent as Nz,Switch as GA,Tooltip as qk,TooltipTrigger as Ek,TooltipContent as Uk,Textarea as Mz,getTextareaClassName as Oz,FormLabel as Iu,useFormField as BA,FormField as qz,FormItem as Ez,FormControl as $d,Input as h0,FormMessage as Uz,Form as Fv,ButtonLoader as vs,Popover as Dz,PopoverTrigger as Wz,PopoverContent as Fz,Calendar as y0,Checkbox as Vz}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.639";import{useLogout as ZA,authSlice as Xz}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.733";import{useAppsNavigate as HA,getRoute as Dk,AppsLink as lp}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.605";import{EmojiPicker as Gz,EmojiStyle as Bz}from"https://cdn.jsdelivr.net/npm/@wellesley/emoji-picker@1.0.528";var xa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ki(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wk,ou={exports:{}},Zz=ou.exports;
1
+ import{api as Lr,usePostApiV1UploadsMutation as kz,useGetApiV1SearchQuery as wz,useGetApiV1InstanceTimezonesQuery as bz,useGetApiV1AddressesSuggestQuery as xz,usePutApiV1UsersByUserIdMutation as Az}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.678";import zz,{forwardRef as Mn,createElement as ec,useRef as ir,useState as rt,useEffect as Ye,useCallback as di,useMemo as Mk,isValidElement as Sz,cloneElement as Cz}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{toast as qt}from"https://cdn.jsdelivr.net/npm/@wellesley/system-toast@1.0.22";import{getErrorMsg as Xa}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.529";import{createAction as UA,createSlice as _i,createSelector as vi}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{get as xv,set as p0,appendErrors as jz,useForm as Ev,useFieldArray as tu,FormProvider as Tz}from"https://cdn.jsdelivr.net/npm/react-hook-form@7.51.0/+esm";import{getStore as Uv,rootReducer as Dv}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.677";import{useDispatch as Ha,useSelector as Ie}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{fillTopic as DA,wsSlice as Wv}from"https://cdn.jsdelivr.net/npm/@wellesley/ws@1.0.660";import{getAcceptList as WA,useImageSelection as FA,UploadMediaModal as VA,UploadTag as Ok,selectUploadFile as Pz}from"https://cdn.jsdelivr.net/npm/@wellesley/uploads@1.0.563";import{cn as Re,DropdownMenu as xp,DropdownMenuTrigger as Ap,DropdownMenuContent as zp,DropdownMenuItem as cp,Button as Dt,Avatar as Lz,AvatarImage as Rz,TooltipWrapper as XA,Dialog as Iz,DialogContent as Nz,Switch as GA,Tooltip as qk,TooltipTrigger as Ek,TooltipContent as Uk,Textarea as Mz,getTextareaClassName as Oz,FormLabel as Iu,useFormField as BA,FormField as qz,FormItem as Ez,FormControl as $d,Input as h0,FormMessage as Uz,Form as Fv,ButtonLoader as vs,Popover as Dz,PopoverTrigger as Wz,PopoverContent as Fz,Calendar as y0,Checkbox as Vz}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.640";import{useLogout as ZA,authSlice as Xz}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.734";import{useAppsNavigate as HA,getRoute as Dk,AppsLink as lp}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.606";import{EmojiPicker as Gz,EmojiStyle as Bz}from"https://cdn.jsdelivr.net/npm/@wellesley/emoji-picker@1.0.529";var xa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ki(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wk,ou={exports:{}},Zz=ou.exports;
2
2
  /**
3
3
  * @license
4
4
  * Lodash <https://lodash.com/>
@@ -39,7 +39,7 @@ import{api as Lr,usePostApiV1UploadsMutation as kz,useGetApiV1SearchQuery as wz,
39
39
  *
40
40
  * This source code is licensed under the ISC license.
41
41
  * See the LICENSE file in the root directory of this source tree.
42
- */Ge("remoteReady");const P9=Ge("askLogin"),L9=Ge("reselectUser");Ge("requestLogout");const R9=Ge("setConfirmLeavePage");Ge("requestChangePath");const QA=Ge("wsSubscribe"),$A=Ge("wsUnSubscribe");Ge("hostStoreConnect"),Ge("remoteLogin"),Ge("remoteLogout"),Ge("wsOnMessage"),Ge("setRouterPath"),Ge("setDeviceType");const e6=Ge("setUserError"),t6=Ge("setUserIsError"),Av=Ge("setUserPending"),zv=Ge("setUserSuccess"),r6=Ge("setUserData"),a6=Ge("updateAccountData"),I9=Ge("updateUser");Ge("addNotification"),Ge("markNotification"),Ge("setNotificationsError"),Ge("setNotificationsList"),Ge("setNotificationsPending"),Ge("setNotificationsTotalCount"),Ge("setNotificationsUnreadCount"),Ge("resetNotificationsState"),Ge("undoNotification"),Ge("setInstanceInfo"),Ge("setInstanceInfoPending"),Ge("setInstanceInfoError");const N9=Ge("setPlatformSettings");Ge("setProfileSettings");const n6=Ge("setGroupData"),Sv=Ge("setGroupLoading");UA("requestMicroFrontendFetch"),UA("sendMicroFrontendFetchResponse");const M9={data:null,isPending:!1,isSuccess:!1},sr=_i({name:"userNoHTML",initialState:M9,reducers:{setUser:(e,t)=>{e.data=t.payload},setPending:(e,t)=>{e.isPending=t.payload},setSuccess:(e,{payload:t})=>{e.isSuccess=t},setError:(e,{payload:t})=>{e.error=t}},selectors:{selectUser:e=>e.data,selectPending:e=>e.isPending,selectError:e=>e.error,selectSuccess:e=>e.isSuccess}}),s6="getApiV1UsersRelationships",O9=pi.memoize(((e,t)=>Lr.util.selectCachedArgsForQuery(e,s6).find((e=>e.targets.includes(t))))),Pn=({state:e,userId:t,dispatch:r,relationsProps:a})=>{const n=O9(e,t);return n?r(Lr.util.updateQueryData(s6,n,(e=>{e[t]={...e[t],...a}}))):null};var Hk=function(e,t,r){if(e&&"reportValidity"in e){var a=xv(r,t);e.setCustomValidity(a&&a.message||""),e.reportValidity()}},i6=function(e,t){var r=function(r){var a=t.fields[r];a&&a.ref&&"reportValidity"in a.ref?Hk(a.ref,r,e):a.refs&&a.refs.forEach((function(t){return Hk(t,r,e)}))};for(var a in t.fields)r(a)},q9=function(e,t){t.shouldUseNativeValidation&&i6(e,t);var r={};for(var a in e){var n=xv(t.fields,a),i=Object.assign(e[a]||{},{ref:n&&n.ref});if(E9(t.names||Object.keys(e),a)){var o=Object.assign({},xv(r,a));p0(o,"root",i),p0(r,a,o)}else p0(r,a,i)}return r},E9=function(e,t){return e.some((function(e){return e.startsWith(t+".")}))},U9=function(e,t){for(var r={};e.length;){var a=e[0],n=a.code,i=a.message,o=a.path.join(".");if(!r[o])if("unionErrors"in a){var s=a.unionErrors[0].errors[0];r[o]={message:s.message,type:s.code}}else r[o]={message:i,type:n};if("unionErrors"in a&&a.unionErrors.forEach((function(t){return t.errors.forEach((function(t){return e.push(t)}))})),t){var c=r[o].types,l=c&&c[a.code];r[o]=jz(o,t,r,n,l?[].concat(l,a.message):a.message)}e.shift()}return r},up=function(e,t,r){return void 0===r&&(r={}),function(a,n,i){try{return Promise.resolve(function(n,o){try{var s=Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](a,t)).then((function(e){return i.shouldUseNativeValidation&&i6({},i),{errors:{},values:r.raw?a:e}}))}catch(e){return o(e)}return s&&s.then?s.then(void 0,o):s}(0,(function(e){if(null!=e.errors)return{values:{},errors:q9(U9(e.errors,!i.shouldUseNativeValidation&&"all"===i.criteriaMode),i)};throw e})))}catch(e){return Promise.reject(e)}}};const o6=({schema:e,defaultValues:t,mode:r="onChange",reValidateMode:a="onChange",showRequiredErrors:n=!0})=>Ev({mode:r,reValidateMode:a,resolver:n?up(e):async(t,r,a)=>{const n=await up(e)(t,r,a);if(!n.errors||0===Object.keys(n.errors).length)return n;const i={};return Object.keys(n.errors).forEach((e=>{const r=n.errors[e],a=t[e],o="password"===e,s=null==a||""===a,c="invalid_type"===(null==r?void 0:r.type)||"too_small"===(null==r?void 0:r.type)||o&&"custom"===(null==r?void 0:r.type);s&&c||(i[e]=r)})),{values:n.values,errors:i}},defaultValues:t});var $e,Cv;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),a={};for(const e of r)a[e]=t[e];return e.objectValues(a)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}($e||($e={})),(Cv||(Cv={})).mergeShapes=(e,t)=>({...e,...t});const ye=$e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ms=e=>{switch(typeof e){case"undefined":return ye.undefined;case"string":return ye.string;case"number":return isNaN(e)?ye.nan:ye.number;case"boolean":return ye.boolean;case"function":return ye.function;case"bigint":return ye.bigint;case"symbol":return ye.symbol;case"object":return Array.isArray(e)?ye.array:null===e?ye.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?ye.promise:typeof Map<"u"&&e instanceof Map?ye.map:typeof Set<"u"&&e instanceof Set?ye.set:typeof Date<"u"&&e instanceof Date?ye.date:ye.object;default:return ye.unknown}},ae=$e.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),D9=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ra extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},r={_errors:[]},a=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(a);else if("invalid_return_type"===n.code)a(n.returnTypeError);else if("invalid_arguments"===n.code)a(n.argumentsError);else if(0===n.path.length)r._errors.push(t(n));else{let e=r,a=0;for(;a<n.path.length;){const r=n.path[a];a===n.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(n))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(this),r}static assert(e){if(!(e instanceof ra))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$e.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}ra.create=e=>new ra(e);const tc=(e,t)=>{let r;switch(e.code){case ae.invalid_type:r=e.received===ye.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case ae.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,$e.jsonStringifyReplacer)}`;break;case ae.unrecognized_keys:r=`Unrecognized key(s) in object: ${$e.joinValues(e.keys,", ")}`;break;case ae.invalid_union:r="Invalid input";break;case ae.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${$e.joinValues(e.options)}`;break;case ae.invalid_enum_value:r=`Invalid enum value. Expected ${$e.joinValues(e.options)}, received '${e.received}'`;break;case ae.invalid_arguments:r="Invalid function arguments";break;case ae.invalid_return_type:r="Invalid function return type";break;case ae.invalid_date:r="Invalid date";break;case ae.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:$e.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case ae.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case ae.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case ae.custom:r="Invalid input";break;case ae.invalid_intersection_types:r="Intersection results could not be merged";break;case ae.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ae.not_finite:r="Number must be finite";break;default:r=t.defaultError,$e.assertNever(e)}return{message:r}};let c6=tc;function W9(e){c6=e}function fp(){return c6}const dp=e=>{const{data:t,path:r,errorMaps:a,issueData:n}=e,i=[...r,...n.path||[]],o={...n,path:i};if(void 0!==n.message)return{...n,path:i,message:n.message};let s="";const c=a.filter((e=>!!e)).slice().reverse();for(const e of c)s=e(o,{data:t,defaultError:s}).message;return{...n,path:i,message:s}},F9=[];function pe(e,t){const r=fp(),a=dp({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===tc?void 0:tc].filter((e=>!!e))});e.common.issues.push(a)}class wr{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if("aborted"===a.status)return Pe;"dirty"===a.status&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,a=await e.value;r.push({key:t,value:a})}return wr.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:t,value:n}=a;if("aborted"===t.status||"aborted"===n.status)return Pe;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"!==t.value&&(typeof n.value<"u"||a.alwaysSet)&&(r[t.value]=n.value)}return{status:e.value,value:r}}}const Pe=Object.freeze({status:"aborted"}),Jo=e=>({status:"dirty",value:e}),Rr=e=>({status:"valid",value:e}),jv=e=>"aborted"===e.status,Tv=e=>"dirty"===e.status,gu=e=>"valid"===e.status,mu=e=>typeof Promise<"u"&&e instanceof Promise;function pp(e,t,r,a){if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function l6(e,t,r,a,n){if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var xe,cu,lu;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(xe||(xe={}));class un{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Kk=(e,t)=>{if(gu(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ra(e.common.issues);return this._error=t,this._error}}};function We(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:a,description:n}=e;if(t&&(r||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(t,n)=>{var i,o;const{message:s}=e;return"invalid_enum_value"===t.code?{message:s??n.defaultError}:typeof n.data>"u"?{message:null!==(i=s??a)&&void 0!==i?i:n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:null!==(o=s??r)&&void 0!==o?o:n.defaultError}},description:n}}class Ve{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return ms(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ms(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new wr,ctx:{common:e.parent.common,data:e.data,parsedType:ms(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(mu(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const a={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ms(e)},n=this._parseSync({data:e,path:a.path,parent:a});return Kk(a,n)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ms(e)},a=this._parse({data:e,path:r.path,parent:r}),n=await(mu(a)?a:Promise.resolve(a));return Kk(r,n)}refine(e,t){const r=e=>"string"==typeof t||typeof t>"u"?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,a)=>{const n=e(t),i=()=>a.addIssue({code:ae.custom,...r(t)});return typeof Promise<"u"&&n instanceof Promise?n.then((e=>!!e||(i(),!1))):!!n||(i(),!1)}))}refinement(e,t){return this._refinement(((r,a)=>!!e(r)||(a.addIssue("function"==typeof t?t(r,a):t),!1)))}_refinement(e){return new Za({schema:this,typeName:je.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ln.create(this,this._def)}nullable(){return xs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ba.create(this,this._def)}promise(){return ac.create(this,this._def)}or(e){return wu.create([this,e],this._def)}and(e){return bu.create(this,e,this._def)}transform(e){return new Za({...We(this._def),schema:this,typeName:je.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Cu({...We(this._def),innerType:this,defaultValue:t,typeName:je.ZodDefault})}brand(){return new Xv({typeName:je.ZodBranded,type:this,...We(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ju({...We(this._def),innerType:this,catchValue:t,typeName:je.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Nu.create(this,e)}readonly(){return Tu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const V9=/^c[^\s-]{8,}$/i,X9=/^[0-9a-z]+$/,G9=/^[0-9A-HJKMNP-TV-Z]{26}$/,B9=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Z9=/^[a-z0-9_-]{21}$/i,H9=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,K9=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Y9="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let b0;const J9=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Q9=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,$9=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,u6="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",e5=new RegExp(`^${u6}$`);function f6(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function t5(e){return new RegExp(`^${f6(e)}$`)}function d6(e){let t=`${u6}T${f6(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function r5(e,t){return!(("v4"!==t&&t||!J9.test(e))&&("v6"!==t&&t||!Q9.test(e)))}class Ga extends Ve{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ye.string){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.string,received:t.parsedType}),Pe}const t=new wr;let r;for(const a of this._def.checks)if("min"===a.kind)e.data.length<a.value&&(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("max"===a.kind)e.data.length>a.value&&(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("length"===a.kind){const n=e.data.length>a.value,i=e.data.length<a.value;(n||i)&&(r=this._getOrReturnCtx(e,r),n?pe(r,{code:ae.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&pe(r,{code:ae.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),t.dirty())}else if("email"===a.kind)K9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"email",code:ae.invalid_string,message:a.message}),t.dirty());else if("emoji"===a.kind)b0||(b0=new RegExp(Y9,"u")),b0.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"emoji",code:ae.invalid_string,message:a.message}),t.dirty());else if("uuid"===a.kind)B9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"uuid",code:ae.invalid_string,message:a.message}),t.dirty());else if("nanoid"===a.kind)Z9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"nanoid",code:ae.invalid_string,message:a.message}),t.dirty());else if("cuid"===a.kind)V9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"cuid",code:ae.invalid_string,message:a.message}),t.dirty());else if("cuid2"===a.kind)X9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"cuid2",code:ae.invalid_string,message:a.message}),t.dirty());else if("ulid"===a.kind)G9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"ulid",code:ae.invalid_string,message:a.message}),t.dirty());else if("url"===a.kind)try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),pe(r,{validation:"url",code:ae.invalid_string,message:a.message}),t.dirty()}else"regex"===a.kind?(a.regex.lastIndex=0,a.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"regex",code:ae.invalid_string,message:a.message}),t.dirty())):"trim"===a.kind?e.data=e.data.trim():"includes"===a.kind?e.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),t.dirty()):"toLowerCase"===a.kind?e.data=e.data.toLowerCase():"toUpperCase"===a.kind?e.data=e.data.toUpperCase():"startsWith"===a.kind?e.data.startsWith(a.value)||(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.invalid_string,validation:{startsWith:a.value},message:a.message}),t.dirty()):"endsWith"===a.kind?e.data.endsWith(a.value)||(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.invalid_string,validation:{endsWith:a.value},message:a.message}),t.dirty()):"datetime"===a.kind?d6(a).test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.invalid_string,validation:"datetime",message:a.message}),t.dirty()):"date"===a.kind?e5.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.invalid_string,validation:"date",message:a.message}),t.dirty()):"time"===a.kind?t5(a).test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.invalid_string,validation:"time",message:a.message}),t.dirty()):"duration"===a.kind?H9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"duration",code:ae.invalid_string,message:a.message}),t.dirty()):"ip"===a.kind?r5(e.data,a.version)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"ip",code:ae.invalid_string,message:a.message}),t.dirty()):"base64"===a.kind?$9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"base64",code:ae.invalid_string,message:a.message}),t.dirty()):$e.assertNever(a);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement((t=>e.test(t)),{validation:t,code:ae.invalid_string,...xe.errToObj(r)})}_addCheck(e){return new Ga({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...xe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...xe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...xe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...xe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...xe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...xe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...xe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...xe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...xe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...xe.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...xe.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,...xe.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...xe.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...xe.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...xe.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...xe.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...xe.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...xe.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...xe.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...xe.errToObj(t)})}nonempty(e){return this.min(1,xe.errToObj(e))}trim(){return new Ga({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ga({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ga({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function a5(e,t){const r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,n=r>a?r:a;return parseInt(e.toFixed(n).replace(".",""))%parseInt(t.toFixed(n).replace(".",""))/Math.pow(10,n)}Ga.create=e=>{var t;return new Ga({checks:[],typeName:je.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...We(e)})};class ks extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ye.number){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.number,received:t.parsedType}),Pe}let t;const r=new wr;for(const a of this._def.checks)"int"===a.kind?$e.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"multipleOf"===a.kind?0!==a5(e.data,a.value)&&(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.not_finite,message:a.message}),r.dirty()):$e.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,xe.toString(t))}gt(e,t){return this.setLimit("min",e,!1,xe.toString(t))}lte(e,t){return this.setLimit("max",e,!0,xe.toString(t))}lt(e,t){return this.setLimit("max",e,!1,xe.toString(t))}setLimit(e,t,r,a){return new ks({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:xe.toString(a)}]})}_addCheck(e){return new ks({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:xe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:xe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:xe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:xe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:xe.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:xe.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:xe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:xe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:xe.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&$e.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ks.create=e=>new ks({checks:[],typeName:je.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...We(e)});class ws extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ye.bigint){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.bigint,received:t.parsedType}),Pe}let t;const r=new wr;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):$e.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,xe.toString(t))}gt(e,t){return this.setLimit("min",e,!1,xe.toString(t))}lte(e,t){return this.setLimit("max",e,!0,xe.toString(t))}lt(e,t){return this.setLimit("max",e,!1,xe.toString(t))}setLimit(e,t,r,a){return new ws({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:xe.toString(a)}]})}_addCheck(e){return new ws({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:xe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:xe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:xe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:xe.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:xe.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ws.create=e=>{var t;return new ws({checks:[],typeName:je.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...We(e)})};class _u extends Ve{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ye.boolean){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.boolean,received:t.parsedType}),Pe}return Rr(e.data)}}_u.create=e=>new _u({typeName:je.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...We(e)});class yi extends Ve{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ye.date){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.date,received:t.parsedType}),Pe}if(isNaN(e.data.getTime())){return pe(this._getOrReturnCtx(e),{code:ae.invalid_date}),Pe}const t=new wr;let r;for(const a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),t.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),t.dirty()):$e.assertNever(a);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new yi({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:xe.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:xe.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}yi.create=e=>new yi({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:je.ZodDate,...We(e)});class hp extends Ve{_parse(e){if(this._getType(e)!==ye.symbol){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.symbol,received:t.parsedType}),Pe}return Rr(e.data)}}hp.create=e=>new hp({typeName:je.ZodSymbol,...We(e)});class vu extends Ve{_parse(e){if(this._getType(e)!==ye.undefined){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.undefined,received:t.parsedType}),Pe}return Rr(e.data)}}vu.create=e=>new vu({typeName:je.ZodUndefined,...We(e)});class ku extends Ve{_parse(e){if(this._getType(e)!==ye.null){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.null,received:t.parsedType}),Pe}return Rr(e.data)}}ku.create=e=>new ku({typeName:je.ZodNull,...We(e)});class rc extends Ve{constructor(){super(...arguments),this._any=!0}_parse(e){return Rr(e.data)}}rc.create=e=>new rc({typeName:je.ZodAny,...We(e)});class hi extends Ve{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Rr(e.data)}}hi.create=e=>new hi({typeName:je.ZodUnknown,...We(e)});class Rn extends Ve{_parse(e){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.never,received:t.parsedType}),Pe}}Rn.create=e=>new Rn({typeName:je.ZodNever,...We(e)});class yp extends Ve{_parse(e){if(this._getType(e)!==ye.undefined){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.void,received:t.parsedType}),Pe}return Rr(e.data)}}yp.create=e=>new yp({typeName:je.ZodVoid,...We(e)});class Ba extends Ve{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==ye.array)return pe(t,{code:ae.invalid_type,expected:ye.array,received:t.parsedType}),Pe;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,n=t.data.length<a.exactLength.value;(e||n)&&(pe(t,{code:e?ae.too_big:ae.too_small,minimum:n?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(pe(t,{code:ae.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(pe(t,{code:ae.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>a.type._parseAsync(new un(t,e,t.path,r))))).then((e=>wr.mergeArray(r,e)));const n=[...t.data].map(((e,r)=>a.type._parseSync(new un(t,e,t.path,r))));return wr.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new Ba({...this._def,minLength:{value:e,message:xe.toString(t)}})}max(e,t){return new Ba({...this._def,maxLength:{value:e,message:xe.toString(t)}})}length(e,t){return new Ba({...this._def,exactLength:{value:e,message:xe.toString(t)}})}nonempty(e){return this.min(1,e)}}function Yo(e){if(e instanceof Rt){const t={};for(const r in e.shape){const a=e.shape[r];t[r]=ln.create(Yo(a))}return new Rt({...e._def,shape:()=>t})}return e instanceof Ba?new Ba({...e._def,type:Yo(e.element)}):e instanceof ln?ln.create(Yo(e.unwrap())):e instanceof xs?xs.create(Yo(e.unwrap())):e instanceof fn?fn.create(e.items.map((e=>Yo(e)))):e}Ba.create=(e,t)=>new Ba({type:e,minLength:null,maxLength:null,exactLength:null,typeName:je.ZodArray,...We(t)});class Rt extends Ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=$e.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==ye.object){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.object,received:t.parsedType}),Pe}const{status:t,ctx:r}=this._processInputParams(e),{shape:a,keys:n}=this._getCached(),i=[];if(!(this._def.catchall instanceof Rn&&"strip"===this._def.unknownKeys))for(const e in r.data)n.includes(e)||i.push(e);const o=[];for(const e of n){const t=a[e],n=r.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new un(r,n,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof Rn){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)o.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)i.length>0&&(pe(r,{code:ae.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const a=r.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new un(r,a,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of o){const r=await t.key,a=await t.value;e.push({key:r,value:a,alwaysSet:t.alwaysSet})}return e})).then((e=>wr.mergeObjectSync(t,e))):wr.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return xe.errToObj,new Rt({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var a,n,i,o;const s=null!==(i=null===(n=(a=this._def).errorMap)||void 0===n?void 0:n.call(a,t,r).message)&&void 0!==i?i:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(o=xe.errToObj(e).message)&&void 0!==o?o:s}:{message:s}}}:{}})}strip(){return new Rt({...this._def,unknownKeys:"strip"})}passthrough(){return new Rt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Rt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Rt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:je.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Rt({...this._def,catchall:e})}pick(e){const t={};return $e.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new Rt({...this._def,shape:()=>t})}omit(e){const t={};return $e.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new Rt({...this._def,shape:()=>t})}deepPartial(){return Yo(this)}partial(e){const t={};return $e.objectKeys(this.shape).forEach((r=>{const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()})),new Rt({...this._def,shape:()=>t})}required(e){const t={};return $e.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof ln;)e=e._def.innerType;t[r]=e}})),new Rt({...this._def,shape:()=>t})}keyof(){return p6($e.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:Rn.create(),typeName:je.ZodObject,...We(t)}),Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:Rn.create(),typeName:je.ZodObject,...We(t)}),Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:Rn.create(),typeName:je.ZodObject,...We(t)});class wu extends Ve{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map((e=>new ra(e.ctx.common.issues)));return pe(t,{code:ae.invalid_union,unionErrors:r}),Pe}));{let e;const a=[];for(const n of r){const r={...t,common:{...t.common,issues:[]},parent:null},i=n._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"===i.status&&!e&&(e={result:i,ctx:r}),r.common.issues.length&&a.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const n=a.map((e=>new ra(e)));return pe(t,{code:ae.invalid_union,unionErrors:n}),Pe}}get options(){return this._def.options}}wu.create=(e,t)=>new wu({options:e,typeName:je.ZodUnion,...We(t)});const Ln=e=>e instanceof Au?Ln(e.schema):e instanceof Za?Ln(e.innerType()):e instanceof zu?[e.value]:e instanceof bs?e.options:e instanceof Su?$e.objectValues(e.enum):e instanceof Cu?Ln(e._def.innerType):e instanceof vu?[void 0]:e instanceof ku?[null]:e instanceof ln?[void 0,...Ln(e.unwrap())]:e instanceof xs?[null,...Ln(e.unwrap())]:e instanceof Xv||e instanceof Tu?Ln(e.unwrap()):e instanceof ju?Ln(e._def.innerType):[];class Sp extends Ve{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ye.object)return pe(t,{code:ae.invalid_type,expected:ye.object,received:t.parsedType}),Pe;const r=this.discriminator,a=t.data[r],n=this.optionsMap.get(a);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(pe(t,{code:ae.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const a=new Map;for(const r of t){const t=Ln(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(a.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);a.set(n,r)}}return new Sp({typeName:je.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...We(r)})}}function Pv(e,t){const r=ms(e),a=ms(t);if(e===t)return{valid:!0,data:e};if(r===ye.object&&a===ye.object){const r=$e.objectKeys(t),a=$e.objectKeys(e).filter((e=>-1!==r.indexOf(e))),n={...e,...t};for(const r of a){const a=Pv(e[r],t[r]);if(!a.valid)return{valid:!1};n[r]=a.data}return{valid:!0,data:n}}if(r===ye.array&&a===ye.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let a=0;a<e.length;a++){const n=Pv(e[a],t[a]);if(!n.valid)return{valid:!1};r.push(n.data)}return{valid:!0,data:r}}return r===ye.date&&a===ye.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class bu extends Ve{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=(e,a)=>{if(jv(e)||jv(a))return Pe;const n=Pv(e.value,a.value);return n.valid?((Tv(e)||Tv(a))&&t.dirty(),{status:t.value,value:n.data}):(pe(r,{code:ae.invalid_intersection_types}),Pe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>a(e,t))):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}bu.create=(e,t,r)=>new bu({left:e,right:t,typeName:je.ZodIntersection,...We(r)});class fn extends Ve{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ye.array)return pe(r,{code:ae.invalid_type,expected:ye.array,received:r.parsedType}),Pe;if(r.data.length<this._def.items.length)return pe(r,{code:ae.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Pe;!this._def.rest&&r.data.length>this._def.items.length&&(pe(r,{code:ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map(((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new un(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(a).then((e=>wr.mergeArray(t,e))):wr.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new fn({...this._def,rest:e})}}fn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fn({items:e,typeName:je.ZodTuple,rest:null,...We(t)})};class xu extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ye.object)return pe(r,{code:ae.invalid_type,expected:ye.object,received:r.parsedType}),Pe;const a=[],n=this._def.keyType,i=this._def.valueType;for(const e in r.data)a.push({key:n._parse(new un(r,e,r.path,e)),value:i._parse(new un(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?wr.mergeObjectAsync(t,a):wr.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return new xu(t instanceof Ve?{keyType:e,valueType:t,typeName:je.ZodRecord,...We(r)}:{keyType:Ga.create(),valueType:e,typeName:je.ZodRecord,...We(t)})}}class gp extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ye.map)return pe(r,{code:ae.invalid_type,expected:ye.map,received:r.parsedType}),Pe;const a=this._def.keyType,n=this._def.valueType,i=[...r.data.entries()].map((([e,t],i)=>({key:a._parse(new un(r,e,r.path,[i,"key"])),value:n._parse(new un(r,t,r.path,[i,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of i){const a=await r.key,n=await r.value;if("aborted"===a.status||"aborted"===n.status)return Pe;("dirty"===a.status||"dirty"===n.status)&&t.dirty(),e.set(a.value,n.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of i){const a=r.key,n=r.value;if("aborted"===a.status||"aborted"===n.status)return Pe;("dirty"===a.status||"dirty"===n.status)&&t.dirty(),e.set(a.value,n.value)}return{status:t.value,value:e}}}}gp.create=(e,t,r)=>new gp({valueType:t,keyType:e,typeName:je.ZodMap,...We(r)});class gi extends Ve{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ye.set)return pe(r,{code:ae.invalid_type,expected:ye.set,received:r.parsedType}),Pe;const a=this._def;null!==a.minSize&&r.data.size<a.minSize.value&&(pe(r,{code:ae.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&r.data.size>a.maxSize.value&&(pe(r,{code:ae.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const n=this._def.valueType;function i(e){const r=new Set;for(const a of e){if("aborted"===a.status)return Pe;"dirty"===a.status&&t.dirty(),r.add(a.value)}return{status:t.value,value:r}}const o=[...r.data.values()].map(((e,t)=>n._parse(new un(r,e,r.path,t))));return r.common.async?Promise.all(o).then((e=>i(e))):i(o)}min(e,t){return new gi({...this._def,minSize:{value:e,message:xe.toString(t)}})}max(e,t){return new gi({...this._def,maxSize:{value:e,message:xe.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}gi.create=(e,t)=>new gi({valueType:e,minSize:null,maxSize:null,typeName:je.ZodSet,...We(t)});class Qo extends Ve{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ye.function)return pe(t,{code:ae.invalid_type,expected:ye.function,received:t.parsedType}),Pe;function r(e,r){return dp({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,fp(),tc].filter((e=>!!e)),issueData:{code:ae.invalid_arguments,argumentsError:r}})}function a(e,r){return dp({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,fp(),tc].filter((e=>!!e)),issueData:{code:ae.invalid_return_type,returnTypeError:r}})}const n={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof ac){const e=this;return Rr((async function(...t){const o=new ra([]),s=await e._def.args.parseAsync(t,n).catch((e=>{throw o.addIssue(r(t,e)),o})),c=await Reflect.apply(i,this,s);return await e._def.returns._def.type.parseAsync(c,n).catch((e=>{throw o.addIssue(a(c,e)),o}))}))}{const e=this;return Rr((function(...t){const o=e._def.args.safeParse(t,n);if(!o.success)throw new ra([r(t,o.error)]);const s=Reflect.apply(i,this,o.data),c=e._def.returns.safeParse(s,n);if(!c.success)throw new ra([a(s,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Qo({...this._def,args:fn.create(e).rest(hi.create())})}returns(e){return new Qo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Qo({args:e||fn.create([]).rest(hi.create()),returns:t||hi.create(),typeName:je.ZodFunction,...We(r)})}}class Au extends Ve{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Au.create=(e,t)=>new Au({getter:e,typeName:je.ZodLazy,...We(t)});class zu extends Ve{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return pe(t,{received:t.data,code:ae.invalid_literal,expected:this._def.value}),Pe}return{status:"valid",value:e.data}}get value(){return this._def.value}}function p6(e,t){return new bs({values:e,typeName:je.ZodEnum,...We(t)})}zu.create=(e,t)=>new zu({value:e,typeName:je.ZodLiteral,...We(t)});class bs extends Ve{constructor(){super(...arguments),cu.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return pe(t,{expected:$e.joinValues(r),received:t.parsedType,code:ae.invalid_type}),Pe}if(pp(this,cu)||l6(this,cu,new Set(this._def.values)),!pp(this,cu).has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return pe(t,{received:t.data,code:ae.invalid_enum_value,options:r}),Pe}return Rr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return bs.create(e,{...this._def,...t})}exclude(e,t=this._def){return bs.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}cu=new WeakMap,bs.create=p6;class Su extends Ve{constructor(){super(...arguments),lu.set(this,void 0)}_parse(e){const t=$e.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ye.string&&r.parsedType!==ye.number){const e=$e.objectValues(t);return pe(r,{expected:$e.joinValues(e),received:r.parsedType,code:ae.invalid_type}),Pe}if(pp(this,lu)||l6(this,lu,new Set($e.getValidEnumValues(this._def.values))),!pp(this,lu).has(e.data)){const e=$e.objectValues(t);return pe(r,{received:r.data,code:ae.invalid_enum_value,options:e}),Pe}return Rr(e.data)}get enum(){return this._def.values}}lu=new WeakMap,Su.create=(e,t)=>new Su({values:e,typeName:je.ZodNativeEnum,...We(t)});class ac extends Ve{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ye.promise&&!1===t.common.async)return pe(t,{code:ae.invalid_type,expected:ye.promise,received:t.parsedType}),Pe;const r=t.parsedType===ye.promise?t.data:Promise.resolve(t.data);return Rr(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}ac.create=(e,t)=>new ac({type:e,typeName:je.ZodPromise,...We(t)});class Za extends Ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===je.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,n={addIssue:e=>{pe(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===a.type){const e=a.transform(r.data,n);if(r.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return Pe;const a=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===a.status?Pe:"dirty"===a.status||"dirty"===t.value?Jo(a.value):a}));{if("aborted"===t.value)return Pe;const a=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===a.status?Pe:"dirty"===a.status||"dirty"===t.value?Jo(a.value):a}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,n);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===a.status?Pe:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((r=>"aborted"===r.status?Pe:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===a.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!gu(e))return e;const i=a.transform(e.value,n);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>gu(e)?Promise.resolve(a.transform(e.value,n)).then((e=>({status:t.value,value:e}))):e))}$e.assertNever(a)}}Za.create=(e,t,r)=>new Za({schema:e,typeName:je.ZodEffects,effect:t,...We(r)}),Za.createWithPreprocess=(e,t,r)=>new Za({schema:t,effect:{type:"preprocess",transform:e},typeName:je.ZodEffects,...We(r)});class ln extends Ve{_parse(e){return this._getType(e)===ye.undefined?Rr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ln.create=(e,t)=>new ln({innerType:e,typeName:je.ZodOptional,...We(t)});class xs extends Ve{_parse(e){return this._getType(e)===ye.null?Rr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}xs.create=(e,t)=>new xs({innerType:e,typeName:je.ZodNullable,...We(t)});class Cu extends Ve{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===ye.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Cu.create=(e,t)=>new Cu({innerType:e,typeName:je.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...We(t)});class ju extends Ve{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return mu(a)?a.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ra(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new ra(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ju.create=(e,t)=>new ju({innerType:e,typeName:je.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...We(t)});class mp extends Ve{_parse(e){if(this._getType(e)!==ye.nan){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.nan,received:t.parsedType}),Pe}return{status:"valid",value:e.data}}}mp.create=e=>new mp({typeName:je.ZodNaN,...We(e)});const n5=Symbol("zod_brand");class Xv extends Ve{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Nu extends Ve{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?Pe:"dirty"===e.status?(t.dirty(),Jo(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?Pe:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new Nu({in:e,out:t,typeName:je.ZodPipeline})}}class Tu extends Ve{_parse(e){const t=this._def.innerType._parse(e),r=e=>(gu(e)&&(e.value=Object.freeze(e.value)),e);return mu(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}function h6(e,t={},r){return e?rc.create().superRefine(((a,n)=>{var i,o;if(!e(a)){const e="function"==typeof t?t(a):"string"==typeof t?{message:t}:t,s=null===(o=null!==(i=e.fatal)&&void 0!==i?i:r)||void 0===o||o,c="string"==typeof e?{message:e}:e;n.addIssue({code:"custom",...c,fatal:s})}})):rc.create()}Tu.create=(e,t)=>new Tu({innerType:e,typeName:je.ZodReadonly,...We(t)});const s5={object:Rt.lazycreate};var je;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(je||(je={}));const i5=(e,t={message:`Input not instance of ${e.name}`})=>h6((t=>t instanceof e),t),y6=Ga.create,g6=ks.create,o5=mp.create,c5=ws.create,m6=_u.create,l5=yi.create,u5=hp.create,f5=vu.create,d5=ku.create,p5=rc.create,h5=hi.create,y5=Rn.create,g5=yp.create,m5=Ba.create,_5=Rt.create,v5=Rt.strictCreate,k5=wu.create,w5=Sp.create,b5=bu.create,x5=fn.create,A5=xu.create,z5=gp.create,S5=gi.create,C5=Qo.create,j5=Au.create,T5=zu.create,P5=bs.create,L5=Su.create,R5=ac.create,Yk=Za.create,I5=ln.create,N5=xs.create,M5=Za.createWithPreprocess,O5=Nu.create,q5=()=>y6().optional(),E5=()=>g6().optional(),U5=()=>m6().optional(),D5={string:e=>Ga.create({...e,coerce:!0}),number:e=>ks.create({...e,coerce:!0}),boolean:e=>_u.create({...e,coerce:!0}),bigint:e=>ws.create({...e,coerce:!0}),date:e=>yi.create({...e,coerce:!0})},W5=Pe;var ge=Object.freeze({__proto__:null,defaultErrorMap:tc,setErrorMap:W9,getErrorMap:fp,makeIssue:dp,EMPTY_PATH:F9,addIssueToContext:pe,ParseStatus:wr,INVALID:Pe,DIRTY:Jo,OK:Rr,isAborted:jv,isDirty:Tv,isValid:gu,isAsync:mu,get util(){return $e},get objectUtil(){return Cv},ZodParsedType:ye,getParsedType:ms,ZodType:Ve,datetimeRegex:d6,ZodString:Ga,ZodNumber:ks,ZodBigInt:ws,ZodBoolean:_u,ZodDate:yi,ZodSymbol:hp,ZodUndefined:vu,ZodNull:ku,ZodAny:rc,ZodUnknown:hi,ZodNever:Rn,ZodVoid:yp,ZodArray:Ba,ZodObject:Rt,ZodUnion:wu,ZodDiscriminatedUnion:Sp,ZodIntersection:bu,ZodTuple:fn,ZodRecord:xu,ZodMap:gp,ZodSet:gi,ZodFunction:Qo,ZodLazy:Au,ZodLiteral:zu,ZodEnum:bs,ZodNativeEnum:Su,ZodPromise:ac,ZodEffects:Za,ZodTransformer:Za,ZodOptional:ln,ZodNullable:xs,ZodDefault:Cu,ZodCatch:ju,ZodNaN:mp,BRAND:n5,ZodBranded:Xv,ZodPipeline:Nu,ZodReadonly:Tu,custom:h6,Schema:Ve,ZodSchema:Ve,late:s5,get ZodFirstPartyTypeKind(){return je},coerce:D5,any:p5,array:m5,bigint:c5,boolean:m6,date:l5,discriminatedUnion:w5,effect:Yk,enum:P5,function:C5,instanceof:i5,intersection:b5,lazy:j5,literal:T5,map:z5,nan:o5,nativeEnum:L5,never:y5,null:d5,nullable:N5,number:g6,object:_5,oboolean:U5,onumber:E5,optional:I5,ostring:q5,pipeline:O5,preprocess:M5,promise:R5,record:A5,set:S5,strictObject:v5,string:y6,symbol:u5,transformer:Yk,tuple:x5,undefined:f5,union:k5,unknown:h5,void:g5,NEVER:W5,ZodIssueCode:ae,quotelessJson:D9,ZodError:ra}),F5={USER:"teamcity",npm_config_user_agent:"npm/10.9.3 node/v22.18.0 linux x64 workspaces/true",npm_node_execpath:"/home/teamcity/.nvm/versions/node/v22.18.0/bin/node",npm_config_noproxy:"",HOME:"/home/teamcity",npm_package_json:"/mnt/agent/work/70fcd8585843667f/packages/user/package.json",npm_config_userconfig:"/home/teamcity/.npmrc",npm_config_local_prefix:"/mnt/agent/work/70fcd8585843667f",COLOR:"1",npm_config_progress:"",TEMP:"/mnt/agent/temp/buildTmp",npm_config_prefix:"/home/teamcity/.nvm/versions/node/v22.18.0",npm_config_npm_version:"10.9.3",npm_config_cache:"/home/teamcity/.npm",npm_config_node_gyp:"/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/mnt/agent/work/70fcd8585843667f/packages/user/node_modules/.bin:/mnt/agent/work/70fcd8585843667f/packages/node_modules/.bin:/mnt/agent/work/70fcd8585843667f/node_modules/.bin:/mnt/agent/work/node_modules/.bin:/mnt/agent/node_modules/.bin:/mnt/node_modules/.bin:/node_modules/.bin:/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/mnt/agent/work/70fcd8585843667f/node_modules/.bin:/mnt/agent/work/node_modules/.bin:/mnt/agent/node_modules/.bin:/mnt/node_modules/.bin:/node_modules/.bin:/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/teamcity/.cargo/bin:/home/teamcity/.rvm/gems/ruby-3.3.9/bin:/home/teamcity/.rvm/gems/ruby-3.3.9@global/bin:/home/teamcity/.rvm/rubies/ruby-3.3.9/bin:/home/teamcity/.rvm/bin:/home/teamcity/.local/bin:/usr/lib/jvm/java-21-amazon-corretto/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/snap/bin:/usr/share/dotnet:/usr/share/dotnet/tools:/home/teamcity/google-cloud-sdk/bin:/home/teamcity/go/bin:/usr/bin/mvn:/home/teamcity/.nvm/versions/node/v22.18.0/bin",TURBO_HASH:"e940a37329d1f847",NODE:"/home/teamcity/.nvm/versions/node/v22.18.0/bin/node",npm_package_name:"@wellesley/user",npm_config_color:"always",DOMAIN_ENV:"test",LANG:"en_US.UTF-8",TURBO_TEAM:"wellesley",TMP:"/mnt/agent/temp/buildTmp",TURBO_API:"https://turborepo-remote-cache-fo3np.ondigitalocean.app",npm_lifecycle_script:"vite build",SHELL:"/bin/bash",npm_package_version:"1.0.692",npm_lifecycle_event:"build",TURBO_CACHE:"remote:rw",SENTRY_MAPS_UPLOAD:"true",npm_config_globalconfig:"/home/teamcity/.nvm/versions/node/v22.18.0/etc/npmrc",npm_config_init_module:"/home/teamcity/.npm-init.js",PWD:"/mnt/agent/work/70fcd8585843667f/packages/user",npm_execpath:"/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/bin/npm-cli.js",npm_config_global_prefix:"/home/teamcity/.nvm/versions/node/v22.18.0",npm_command:"run-script",TURBO_TOKEN:"wellesley-turbo-token",USE_PACKAGES_FROM_NPM:"true",INIT_CWD:"/mnt/agent/work/70fcd8585843667f/packages/user",EDITOR:"vi",NODE_ENV:"production",BUILD_NUMBER:"3521",APP_NAME:"@wellesley/user"};const _6=e=>F5.DOMAIN_ENV===e,V5=_6("prod"),v6=V5?8:3,k6=64,Jk=5,Lv=2,w6=30,Gv=50,b6=1024,x6=30,cn={link:56,userName:30,pronouns:80,displayName:50,description:b6,fieldLabel:20,fieldContent:80,location:56,timezone:56},_s={short:"Too short",long:"Too long"},X5=(e,t=100)=>{let r;return function(...a){clearTimeout(r),r=setTimeout((()=>e.apply(this,a)),t)}},G5=(e,t)=>{const r=X5(((t,r,a)=>{e(...a).then(t).catch(r)}),t);return(...e)=>new Promise(((t,a)=>{r(t,a,e)}))},Bv=new RegExp("\\p{Extended_Pictographic}","u"),A6=({showInlineError:e=!0})=>ge.string().trim().min(1,e?"Username is required":"").min(2,e?"Must be at least 2 characters long":"").max(30,_s.long).regex(/^[0-9a-zA-Z_]+[0-9a-zA-Z_.]*$/,"Only latin letters, digits, _ and . allowed"),B5=G5((async e=>{try{const{exists:t}=await Uv().dispatch(Lr.endpoints.getApiV1UsersCheck.initiate({username:e})).unwrap();return{exists:t??!1,message:"Username already in use. Please, try another one"}}catch{return{exists:!1,message:""}}}),500),z6=ge.string().trim().min(1,"Display name is required").max(50).regex(/^[^@]*$/,"@ is not allowed").superRefine(((e,t)=>{const r=Bv.test(e),a=/[a-zA-Z0-9]/.test(e);r&&!a&&t.addIssue({code:ge.ZodIssueCode.custom,message:"Emojis alone are not allowed. Please add text"})})),Z5=ge.string().max(1024,_s.long).optional(),S6=({minLength:e,minErrorMessage:t,maxLength:r,regexErrorMessage:a})=>ge.string().trim().min(e,t).max(r,_s.long).regex(/^[0-9a-zA-Z_]+[0-9a-zA-Z_.]*$/,a);S6({minLength:2,maxLength:30,regexErrorMessage:"Invalid characters. ex.: group_name_1"}),S6({minLength:2,minErrorMessage:_s.short,maxLength:30,regexErrorMessage:"Invalid characters. ex.: channel_name_1"}),ge.string().trim().min(1,"").regex(/^[0-9a-zA-Z_]+[0-9a-zA-Z_.]*$|^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{1,}$/,"Invalid characters");const H5=`Required: A-Z, a-z, 0-9, special character, min ${v6}, max 64`;ge.string().trim().superRefine(((e,t)=>{Bv.test(e)&&t.addIssue({code:ge.ZodIssueCode.custom,message:"Emojis are not allowed"}),/[A-Z]/.test(e)&&/[a-z]/.test(e)&&/[0-9]/.test(e)&&/[^A-Za-z0-9]/.test(e)&&e.length>=v6&&e.length<=64||t.addIssue({code:ge.ZodIssueCode.custom,message:H5})})),ge.string().trim().min(5,"Must be at least 5 characters long").regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/i,"Email format is not valid").refine((e=>!Bv.test(e)),"Emojis are not allowed");const K5=({form:e,originalUsername:t})=>{const r=ir(t??"").current,a=e=>e.getValues("userName"),[n,i]=rt(!1),[o,s]=rt(a(e));return{isUserNameChecked:n,handleUserNameChange:()=>{i(!1)},handleUserNameBlur:async()=>{const t=a(e).trim();if(t===o||t===r)return;const{exists:n,message:c}=await B5(t);n&&e.setError("userName",{message:c}),s(t),i(!0)}}},Y5=ge.object({bio:Z5,username:A6({showInlineError:!0}),displayName:z6}),J5=ge.object({show:ge.boolean(),dateOnly:ge.boolean(),date:ge.date().optional().nullable()}),Q5=(e=!0)=>{const t=A6({showInlineError:e});return ge.object({avatarId:ge.string().nullable(),headerId:ge.string().nullable(),channel:ge.boolean().optional(),actorType:ge.enum(["Application","Group","Organization","Person","Service"]).optional(),userName:t,displayName:z6,Pronouns:ge.string().max(cn.pronouns,_s.long).optional(),summary:ge.string().max(cn.description,_s.long).optional(),customFields:ge.array(ge.object({label:ge.string().max(cn.fieldLabel,_s.long).optional(),content:ge.string().max(cn.fieldContent,_s.long).optional()})),location:ge.object({geo:ge.object({latitude:ge.number().optional(),longitude:ge.number().optional(),accuracy:ge.number().optional().nullable()}).optional().nullable(),show:ge.boolean().optional(),name:ge.string().optional(),autoUpdate:ge.boolean().optional()}),timezone:ge.object({show:ge.boolean(),ianaTimezone:ge.string().optional(),autoUpdate:ge.boolean()}),birthday:J5,canSubmit:ge.boolean(),botProfile:ge.object({role:ge.string().optional(),triggers:ge.array(ge.object({id:ge.string(),label:ge.string()})).optional(),personality_traits:ge.array(ge.object({id:ge.string(),label:ge.string()})).optional(),tone:ge.string().optional(),style:ge.array(ge.object({id:ge.string(),label:ge.string()})).optional(),behaviors:ge.array(ge.object({id:ge.string(),label:ge.string()})).optional(),prompt:ge.string().optional()}).optional()})};ge.object({show:ge.boolean(),dateOnly:ge.boolean(),date:ge.date().optional().nullable()});const Pu=e=>{var t;const r=e,a=409===(null==r?void 0:r.status);return{message:"UserNameIsReserved"===(null==(t=null==r?void 0:r.data)?void 0:t.errorCode)?"Restricted words detected. Please, try alternatives":"Username already in use. Please, try another one",isError:a}},C6=Lr.enhanceEndpoints({endpoints:{deleteApiV1Users:{invalidatesTags:["Secure","Account"],async onQueryStarted(e,{dispatch:t,queryFulfilled:r}){try{await Ae(r)&&await t(Lr.endpoints.getApiV1AccountsProfile.initiate({htmlContent:!1})).unwrap()}catch(e){qt.error(`${Xa(e)}`)}}},getApiV1AccountsProfile:{providesTags:["Secure","Account"],async onQueryStarted(e,{dispatch:t,queryFulfilled:r}){t(Av(!0));try{const e=await Ae(r);e&&t(r6(e.data)),t(zv(!0))}catch(e){t(zv(!1)),t(t6(!0)),t(e6(e))}finally{t(Av(!1))}}},putApiV1UsersByUserId:{invalidatesTags:["Secure","Account"],async onQueryStarted(e,{queryFulfilled:t}){try{await t,qt.success("User updated successfully")}catch(e){const t=e.error,{isError:r}=Pu(t);!r&&qt.error(`${Xa(t)}`)}}},getApiV1Users:{providesTags:["Secure","UserNoHtml"],async onQueryStarted(e,{dispatch:t,queryFulfilled:r}){const a=!e.htmlContent;try{a&&t(sr.actions.setPending(!0));const e=await Ae(r);a&&e&&(t(sr.actions.setUser(e.data)),t(sr.actions.setSuccess(!0)),t(sr.actions.setPending(!1)))}catch(e){a&&(t(sr.actions.setSuccess(!1)),t(sr.actions.setError(e)),t(sr.actions.setPending(!1))),qt.error(`${Xa(e)}`)}}},postApiV1Users:{invalidatesTags:["Account"],async onQueryStarted(e,{queryFulfilled:t}){try{await t,qt.success("User created successfully")}catch(e){const t=e.error,{isError:r}=Pu(t);!r&&qt.error(`${Xa(t)}`)}}},getApiV1UsersFollowers:{providesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t}){await Ae(t)}},getApiV1UsersRemoteByUserNameFullFollowers:{providesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t}){await Ae(t)}},getApiV1UsersByUserId:{providesTags:["Secure","UserNoHtml"],async onQueryStarted(e,{dispatch:t,queryFulfilled:r}){const a=!e.htmlContent;try{a&&t(sr.actions.setPending(!0));const e=await Ae(r);a&&e&&(t(sr.actions.setUser(e.data)),t(sr.actions.setSuccess(!0)),t(sr.actions.setPending(!1)))}catch(e){a&&(t(sr.actions.setSuccess(!1)),t(sr.actions.setError(e)),t(sr.actions.setPending(!1))),qt.error(`${Xa(e)}`)}}},getApiV1UsersByUserIdFollowers:{providesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t}){await Ae(t)}},getApiV1UsersFollowees:{providesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t}){await Ae(t)}},getApiV1UsersByUserIdFollowing:{providesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t}){await Ae(t)}},postApiV1UsersFollowByUsernameAccept:{invalidatesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t,dispatch:r,getState:a}){const n=Pn({dispatch:r,userId:e.user.id,state:a(),relationsProps:{followed:"ACCEPTED"}});await Ae(t,`Accepted follow request from ${e.username}`,(()=>null==n?void 0:n.undo()))}},postApiV1UsersFollowByUsernameReject:{invalidatesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t,dispatch:r,getState:a}){const n=Pn({dispatch:r,userId:e.user.id,state:a(),relationsProps:{followed:"REJECTED"}});await Ae(t,`Rejected follow request from ${e.username}`,(()=>null==n?void 0:n.undo()))}},postApiV1UsersFollowByUsername:{invalidatesTags:["Follow","Secure"],async onQueryStarted(e,{queryFulfilled:t,dispatch:r}){await Ae(t,`Follow request sent to ${e.username}`)&&r(Lr.util.invalidateTags([{type:"Relationship",id:e.user.id}]))}},postApiV1UsersFollowByUsernameUndo:{invalidatesTags:["Follow","Secure"],async onQueryStarted(e,{queryFulfilled:t,dispatch:r,getState:a}){const n=Pn({dispatch:r,userId:e.user.id,state:a(),relationsProps:{following:null}});await Ae(t,`You unfollowed ${e.username}`,(()=>null==n?void 0:n.undo()))}},getApiV1Block:{providesTags:["Follow"]},postApiV1BlockByUserId:{invalidatesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t,getState:r,dispatch:a}){const n=Pn({userId:e.userId,dispatch:a,state:r(),relationsProps:{blocked:!0}});await Ae(t,void 0,(()=>null==n?void 0:n.undo()))}},deleteApiV1BlockByUserId:{invalidatesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t,getState:r,dispatch:a}){const n=Pn({userId:e.userId,dispatch:a,state:r(),relationsProps:{blocked:!1,muted:{state:!1}}});await Ae(t,void 0,(()=>null==n?void 0:n.undo()))}},postApiV1MuteByUserId:{async onQueryStarted({userId:e},{queryFulfilled:t,getState:r,dispatch:a}){const n=Pn({userId:e,dispatch:a,state:r(),relationsProps:{muted:{state:!0}}});await Ae(t,void 0,(()=>null==n?void 0:n.undo()))}},deleteApiV1MuteByUserId:{async onQueryStarted({userId:e},{queryFulfilled:t,getState:r,dispatch:a}){const n=Pn({userId:e,dispatch:a,state:r(),relationsProps:{muted:{state:!1}}});await Ae(t,void 0,(()=>null==n?void 0:n.undo()))}},getApiV1Mute:{async onQueryStarted(e,{queryFulfilled:t}){await Ae(t)}},getApiV1UsersRelationships:{providesTags:(e,t,{targets:r})=>r.map((e=>({type:"Relationship",id:e}))),async onQueryStarted(e,{queryFulfilled:t}){await Ae(t)}},postApiV1AdminUserChangeState:{invalidatesTags:["Secure"],async onQueryStarted(e,{queryFulfilled:t}){await Ae(t,`User ${e.changeUserState.userId} state changed to ${e.changeUserState.newState}`)}},putApiV1Notes:{async onQueryStarted(e,{queryFulfilled:t,getState:r,dispatch:a}){const{userId:n,text:i}=e.noteUpdate,o=Pn({userId:n,dispatch:a,state:r(),relationsProps:{note:i}});await Ae(t,"Note has been updated",(()=>null==o?void 0:o.undo()))}},deleteApiV1NotesByUserId:{async onQueryStarted(e,{queryFulfilled:t,getState:r,dispatch:a}){const n=Pn({userId:e.userId,dispatch:a,state:r(),relationsProps:{note:""}});await Ae(t,"Note has been removed",(()=>null==n?void 0:n.undo()))}},postApiV1UsersFollowByUsernamePend:{async onQueryStarted(e,{queryFulfilled:t}){await Ae(t,`${e.username} has been removed from followers`)}}}}).injectEndpoints({endpoints:e=>({getInteractionUrl:e.query({query:e=>({url:e,headers:{Accept:"application/activity+json"}}),transformResponse:e=>"string"==typeof e?JSON.parse(e):e})})}),{useGetInteractionUrlQuery:_oe,usePostApiV1UsersMutation:$5,useDeleteApiV1AccountsDeleteMutation:e7,useGetApiV1AccountsProfileQuery:voe,usePutApiV1UsersByUserIdMutation:Zv,useGetApiV1UsersQuery:t7,useDeleteApiV1UsersMutation:j6,usePostApiV1MuteByUserIdMutation:koe,useDeleteApiV1MuteByUserIdMutation:woe,useGetApiV1MuteQuery:boe,usePostApiV1AdminUserChangeStateMutation:xoe,useGetApiV1UsersRelationshipsQuery:r7,usePutApiV1NotesMutation:Aoe,useDeleteApiV1NotesByUserIdMutation:zoe,useLazyGetApiV1UsersRelationshipsQuery:a7,useLazyGetApiV1GeoQuery:n7,useGetApiV1UsersFollowersQuery:Soe,useGetApiV1UsersByUserIdQuery:s7,useLazyGetApiV1GroupsAccountQuery:i7,useLazyGetApiV1UsersRenameHistoryQuery:Coe,useGetApiV1UsersByUserIdFollowersQuery:joe,usePostApiV1UsersFollowByUsernameMutation:Toe,usePostApiV1UsersFollowByUsernameUndoMutation:Poe,usePostApiV1UsersFollowByUsernameRejectMutation:Loe,usePostApiV1UsersFollowByUsernameAcceptMutation:Roe,useGetApiV1UsersRemoteByUserNameFullFollowersQuery:Ioe}=C6,T6=()=>{const[e]=Zv();return({userId:t,htmlContent:r,data:a})=>{e({userId:t,userUpdate:a,...r&&{htmlContent:r}})}},Qk={data:null,isError:!1,isPending:!1,isSuccess:!1},It=_i({name:"user",initialState:Qk,reducers:{reset:e=>{Object.assign(e,Qk)}},extraReducers:e=>{e.addCase(r6,((e,{payload:t})=>{e.data=t})).addCase(a6,((e,{payload:t})=>{e.data&&Object.assign(e.data,t||{})})).addCase(zv,((e,{payload:t})=>{e.isSuccess=t})).addCase(Av,((e,{payload:t})=>{e.isPending=t})).addCase(t6,((e,{payload:t})=>{e.isError=t})).addCase(e6,((e,{payload:t})=>{e.error=t})).addCase(I9,((e,{payload:t})=>{var r;null!=(r=e.data)&&r.users&&(e.data.users=e.data.users.map((e=>t.id===e.id?t:e)))}))},selectors:{selectIsError:e=>e.isError,selectError:e=>e.error,selectPending:e=>e.isPending,selectData:e=>e.data,selectAccount:e=>{var t;return null==(t=e.data)?void 0:t.account},selectAccountId:e=>{var t;return null==(t=e.data)?void 0:t.account.id},selectUsers:e=>{var t;return null==(t=e.data)?void 0:t.users},selectUserById:(e,t)=>{var r;return null==(r=e.data)?void 0:r.users.find((({id:e})=>e===t))},selectCurrentUser:e=>{var t;return null==(t=e.data)?void 0:t.users.find((({id:t})=>{var r;return t===(null==(r=e.data)?void 0:r.selectedUserId)}))},selectSelectedUserId:e=>{var t;return null==(t=e.data)?void 0:t.selectedUserId},selectSuccess:e=>e.isSuccess}}),o7=e=>e.filter((e=>e.id&&e.username&&e.displayName)),Noe=()=>{const e=Ha(),t=Ie(It.selectors.selectAccount),r=DA("account#$account_id",{account_id:(null==t?void 0:t.id)||""}),a=Ie((e=>Wv.selectors.selectLastUpdateFor(e,r)));Ye((()=>{if(null!=t&&t.id)return e(QA({id:r,topics:[r]})),()=>{e($A(r))}}),[null==t?void 0:t.id]),Ye((()=>{null!=a&&a.data&&e(a6({...a.data,users:o7(a.data.users)}))}),[null==a?void 0:a.data])},sc=()=>{const e=Ie(It.selectors.selectSelectedUserId),t=Ha();return{changeUser:di((r=>{e!==r&&t(L9({userId:r}))}),[e,t]),selectedUserId:e}},c7=(e="")=>e.startsWith("@")?null==e?void 0:e.replace("@",""):e,l7=({username:e,canFetch:t=!0,htmlContent:r=!0})=>{const a=c7(e),{data:n,error:i,isLoading:o}=t7({username:a,full:!0,htmlContent:r},{skip:!a||!t});return{data:n,error:i,isLoading:o}},u7=e=>{const t=Ie(sr.selectors.selectUser),{isLoading:r}=l7({username:e,canFetch:!!e,htmlContent:!1});return[t,r]},f7="wlsy",P6=()=>{try{return window.localStorage}catch(e){console.warn("Error getting window.localStorage storage",e)}},d7=()=>{const e=new Set,t=P6();if(!t)return[];for(let r=0;r<(null==t?void 0:t.length);r+=1){const a=null==t?void 0:t.key(r);"string"==typeof a&&e.add(a)}return Array.from(e)},Hv=e=>{const t=`${f7}${e?`:${e}`:""}`,r=e=>`${t}:${e}`,a=()=>d7().filter((e=>e.startsWith(`${t}:`))),n=e=>e.slice(t.length+1),i=P6(),o=e=>{try{return null==i?void 0:i.getItem(r(e))}catch{return null}},s=(e,t)=>{try{null==i||i.setItem(r(e),String(t))}catch{return}};return{getItem:o,setItem:s,removeItem:e=>{try{null==i||i.removeItem(r(e))}catch{return}},clear:()=>{try{a().forEach((e=>null==i?void 0:i.removeItem(e)))}catch{return}},keys:()=>a().map(n),has:e=>null!==o(e),getJSON:e=>{const t=o(e);if(null==t)return null;try{return JSON.parse(t)}catch{return null}},setJSON:(e,t)=>{try{s(e,JSON.stringify(t))}catch{return}}}},Kv="auth_token",Yv=Hv("user"),L6=()=>Yv.getItem(Kv)||void 0,p7=e=>Yv.setItem(Kv,e),h7=()=>Yv.removeItem(Kv),y7=()=>!!L6(),g7={getToken:L6,setToken:p7,removeToken:h7,hasToken:y7},$k={forgotPasswordStep:"request",forgotPasswordFields:null,signupStep:"rules",signupFields:null,token:null,newEmail:null,isPending:!!g7.getToken(),isAuthenticated:!1,isAskLoginOpen:!1},Jv=_i({name:"auth",initialState:$k,reducers:{setAskLoginOpen:(e,t)=>{e.isAskLoginOpen=t.payload},login:(e,t)=>{e.isAuthenticated=!0,e.token=t.payload||null,e.isPending=!1},logout:()=>({...$k,isPending:!1}),setNewEmail:(e,t)=>{e.newEmail=t.payload},setForgotPasswordStep:(e,t)=>{e.forgotPasswordStep=t.payload},updateForgotPasswordFields:(e,t)=>{e.forgotPasswordFields={...e.forgotPasswordFields,...t.payload}},resetForgotPasswordFields:e=>{e.forgotPasswordFields=null},setSignupStep:(e,t)=>{e.signupStep=t.payload},updateSignupFields:(e,t)=>{e.signupFields={...e.signupFields,...t.payload}},resetSignupFields:e=>{e.signupFields=null},setPending:(e,t)=>{e.isPending=t.payload}},selectors:{selectAskLoginOpen:e=>e.isAskLoginOpen,selectToken:e=>e.token,selectNewEmail:e=>e.newEmail,selectForgotPasswordStep:e=>e.forgotPasswordStep,selectForgotPasswordFields:e=>e.forgotPasswordFields,selectSignupStep:e=>e.signupStep,selectSignupFields:e=>e.signupFields,selectPending:e=>e.isPending,selectIsAuthenticated:e=>e.isAuthenticated}}),Moe=()=>{const e=Ie(Jv.selectors.selectIsAuthenticated),t=Ie(It.selectors.selectPending);return{user:Ie(It.selectors.selectCurrentUser),isLogged:e,isLoading:t}},m7=()=>{const e=Ie(It.selectors.selectCurrentUser),t=Ie(Jv.selectors.selectIsAuthenticated);return{user:e,isLoading:Ie(It.selectors.selectPending),isLogged:t,error:Ie(It.selectors.selectError)}},Ooe=({userId:e="",canFetch:t=!0,htmlContent:r=!0})=>{const{data:a,error:n,isLoading:i,isFetching:o}=s7({userId:e,full:!0,htmlContent:r},{skip:!e||!t});return{data:a,error:n,isLoading:i,isFetching:o}},_7=({onChange:e})=>{const{user:t}=m7(),r=null==t?void 0:t.id,a=ir(r);Ye((()=>{a.current?r!==a.current&&(e(),a.current=r):a.current=r}),[r,a.current])},ew=["following","followed","blocked","muted","note","blocked_by"],tw=({userId:e,currentUserId:t})=>{const r="string"==typeof e,a=r?[e]:(null==e?void 0:e.filter((e=>e!==t)))||[],n=e===t;return{isSingleUser:r,canFetch:!(!a.length||n||!t),safeTargets:a}},v7=({userId:e,skip:t})=>{const r=Ie(It.selectors.selectCurrentUser),a=null==r?void 0:r.id,{canFetch:n,isSingleUser:i,safeTargets:o}=tw({userId:e,currentUserId:a}),{data:s,isLoading:c}=r7({targets:o,filter:ew},{skip:!n||t}),[l]=a7(),u=({userId:e})=>{const{canFetch:t,safeTargets:r}=tw({userId:e,currentUserId:a});t&&l({targets:r,filter:ew})};return _7({onChange:()=>{u({userId:o})}}),{relationship:(i?null==s?void 0:s[e]:s)||{},isLoading:c,updateRelations:u}},Cp=e=>`@${e.username}${e.domain?`@${e.domain}`:""}`,R6=({id:e,user:t})=>{const r=Ha(),a=DA("user#$username",{username:t?Cp(t).slice(1):""}),n=`${e}-${null==t?void 0:t.username}`;return Ye((()=>{if(null!=t&&t.username)return r(QA({id:n,topics:[a]})),()=>{r($A(n))}}),[null==t?void 0:t.username]),{subscriptionName:a}},qoe=({user:e,onUpdate:t})=>{const{updateRelations:r}=v7({}),{subscriptionName:a}=R6({id:"outside-user-update",user:e}),n=Ie((e=>Wv.selectors.selectLastUpdateFor(e,a)));Ye((()=>{const e=null==n?void 0:n.data;e&&(r({userId:e.id}),t(e))}),[null==n?void 0:n.data])},Eoe=({onUpdate:e})=>{const t=Ie(It.selectors.selectCurrentUser),{subscriptionName:r}=R6({id:"current-user-update",user:t}),a=Ie((e=>Wv.selectors.selectLastUpdateFor(e,r)));Ye((()=>{const t=null==a?void 0:a.data;t&&e(t)}),[null==a?void 0:a.data])},I6=e=>{const t=e.toLowerCase().match(/\.([a-zA-Z0-9]{2,4})(\?|$)+/);return t?t[1]:void 0},k7=e=>e.replace(/\.[^.]*$/,""),N6=()=>"object"!=typeof window,w7=()=>!N6()&&/iPhone|iPod|iPad/gi.test(window.navigator.userAgent),yu="8.48.0",In=globalThis;function Qv(e,t,r){const a=In,n=a.__SENTRY__=a.__SENTRY__||{},i=n[yu]=n[yu]||{};return i[e]||(i[e]=t())}const M6=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,b7="Sentry Logger ",rw=["debug","info","warn","error","log","assert","trace"],aw={};function x7(e){if(!("console"in In))return e();const t=In.console,r={},a=Object.keys(aw);a.forEach((e=>{const a=aw[e];r[e]=t[e],t[e]=a}));try{return e()}finally{a.forEach((e=>{t[e]=r[e]}))}}function A7(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return M6?rw.forEach((r=>{t[r]=(...t)=>{e&&x7((()=>{In.console[r](`${b7}[${r}]:`,...t)}))}})):rw.forEach((e=>{t[e]=()=>{}})),t}const np=Qv("logger",A7);function $v(){return ek(In),In}function ek(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||yu,t[yu]=t[yu]||{}}const z7=Object.prototype.toString;function S7(e,t){return z7.call(e)===`[object ${t}]`}function C7(e){return S7(e,"Object")}function j7(e){return!(!e||!e.then||"function"!=typeof e.then)}function T7(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{M6&&np.log(`Failed to add non-enumerable property "${t}" to object`,e)}}const O6=1e3;function q6(){return Date.now()/O6}function P7(){const{performance:e}=In;if(!e||!e.now)return q6;const t=Date.now()-e.now(),r=null==e.timeOrigin?t:e.timeOrigin;return()=>(r+e.now())/O6}const L7=P7();function $o(){const e=In,t=e.crypto||e.msCrypto;let r=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(r=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch{}return"10000000100040008000100000000000".replace(/[018]/g,(e=>(e^(15&r())>>e/4).toString(16)))}function R7(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||L7(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:$o()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function nw(){return $o()}function sw(){return $o().substring(16)}function E6(e,t,r=2){if(!t||"object"!=typeof t||r<=0)return t;if(e&&t&&0===Object.keys(t).length)return e;const a={...e};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(a[e]=E6(a[e],t[e],r-1));return a}(()=>{const{performance:e}=In;if(!e||!e.now)return;const t=36e5,r=e.now(),a=Date.now(),n=e.timeOrigin?Math.abs(e.timeOrigin+r-a):t,i=n<t,o=e.timing&&e.timing.navigationStart,s="number"==typeof o?Math.abs(o+r-a):t;(i||s<t)&&(n<=s&&e.timeOrigin)})();const Rv="_sentrySpan";function iw(e,t){t?T7(e,Rv,t):delete e[Rv]}function ow(e){return e[Rv]}const I7=100;class tk{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:nw(),spanId:sw()}}clone(){const e=new tk;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,iw(e,ow(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&R7(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,[r,a]=t instanceof Lu?[t.getScopeData(),t.getRequestSession()]:C7(t)?[e,e.requestSession]:[],{tags:n,extra:i,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u}=r||{};return this._tags={...this._tags,...n},this._extra={...this._extra,...i},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),a&&(this._requestSession=a),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,iw(this,void 0),this._attachments=[],this.setPropagationContext({traceId:nw()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:I7;if(r<=0)return this;const a={timestamp:q6(),...e},n=this._breadcrumbs;return n.push(a),this._breadcrumbs=n.length>r?n.slice(-r):n,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ow(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=E6(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext={spanId:sw(),...e},this}getPropagationContext(){return this._propagationContext}captureException(e,t){const r=t&&t.event_id?t.event_id:$o();if(!this._client)return np.warn("No client configured on scope - will not capture exception!"),r;const a=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:a,...t,event_id:r},this),r}captureMessage(e,t,r){const a=r&&r.event_id?r.event_id:$o();if(!this._client)return np.warn("No client configured on scope - will not capture message!"),a;const n=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:n,...r,event_id:a},this),a}captureEvent(e,t){const r=t&&t.event_id?t.event_id:$o();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(np.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}const Lu=tk;function N7(){return Qv("defaultCurrentScope",(()=>new Lu))}function M7(){return Qv("defaultIsolationScope",(()=>new Lu))}class O7{constructor(e,t){let r,a;r=e||new Lu,a=t||new Lu,this._stack=[{scope:r}],this._isolationScope=a}withScope(e){const t=this._pushScope();let r;try{r=e(t)}catch(e){throw this._popScope(),e}return j7(r)?r.then((e=>(this._popScope(),e)),(e=>{throw this._popScope(),e})):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function nc(){const e=ek($v());return e.stack=e.stack||new O7(N7(),M7())}function q7(e){return nc().withScope(e)}function E7(e,t){const r=nc();return r.withScope((()=>(r.getStackTop().scope=e,t(e))))}function cw(e){return nc().withScope((()=>e(nc().getIsolationScope())))}function U7(){return{withIsolationScope:cw,withScope:q7,withSetScope:E7,withSetIsolationScope:(e,t)=>cw(t),getCurrentScope:()=>nc().getScope(),getIsolationScope:()=>nc().getIsolationScope()}}function U6(e){const t=ek(e);return t.acs?t.acs:U7()}function D6(){return U6($v()).getCurrentScope()}function D7(){return U6($v()).getIsolationScope()}function W7(e,t){return D6().captureException(e,void 0)}function F7(e,t){const r={captureContext:t};return D6().captureMessage(e,void 0,r)}function V7(e,t){D7().setExtra(e,t)}const X7=(...e)=>{let t="";for(const r of e){if(r instanceof Error){const e=r;return V7("exceptionMessage",t),void W7(e)}if("object"!=typeof r)t+=r;else try{t+=" "+JSON.stringify(r)}catch{t+=" "+r}}F7(t)},lw=["debug","info","warn","error"],G7=(e,t)=>{const r=lw.indexOf(e);return lw.indexOf(t)>=r},ep=(e,t,r,...a)=>{G7(t,e)&&console.log(`[${e}] ${r}`,...a)},B7=()=>Hv().getItem("logger_lvl"),Z7=(e=(N6()?"info":B7()||"warn"))=>{let t=e;return{debug:(e,...r)=>ep("debug",t,e,...r),info:(e,...r)=>ep("info",t,e,...r),warn:(e,...r)=>ep("warn",t,e,...r),error:(e,...r)=>(X7(e,...r),ep("error",t,e,...r)),setLevel:e=>{t=e},getLevel:()=>t}},aa=Z7(),H7=({src:e,name:t=""})=>new Promise(((r,a)=>{const n=document.createElement("video");n.src=e;const i=()=>{const{duration:e,videoHeight:i,videoWidth:o,src:s}=n,c=k7(t);(!e||!i||!o||!s)&&a(),r({src:s,name:c,width:o,height:i,duration:Math.floor(e)})},o=()=>{aa.warn("Failed to load video"),r(null)};return w7()&&n.load(),n.addEventListener("error",o),n.addEventListener("loadeddata",i),()=>{n.removeEventListener("error",o),n.removeEventListener("loadeddata",i)}})),K7=e=>new Promise(((t,r)=>{const a=new Image,n=URL.createObjectURL(e);a.onload=()=>{t({width:a.naturalWidth,height:a.naturalHeight}),URL.revokeObjectURL(n)},a.onerror=()=>{aa.warn("Failed to load image"),r(null),URL.revokeObjectURL(n)},a.src=n})),uw=e=>{if(!e)return;const t="number"==typeof e?e:parseInt(e,10);if(isNaN(t))throw new Error("Can not get number from income argument");const r=t/1048576;return`${Math.floor(r)} MB`},Y7=async({media:e,docPolicy:t,imgPolicy:r,videoPolicy:a,audioPolicy:n})=>{if(!r||!a)return"Media policy is not defined";const i={IMAGE:r.extensions,VIDEO:a.extensions,AUDIO:n.extensions,DOCUMENT:t.extensions},o=I6(e.file.name)||"",s=Object.keys(i).find((e=>{var t;return null==(t=i[e])?void 0:t.includes(o)}));if(!s)return`Extension ${o} is not supported`;const c="VIDEO"===s;if("IMAGE"===s){const t=await K7(e.file),a=e.file.size>r.maxSize,n=t&&Math.max(t.width,t.height)>r.maxResolution,i=t&&t.width*t.height>r.maxMatrix;switch(!0){case a:return`Image is too big. Max size is ${uw(r.maxSize)}`;case n:return`Image resolution is too high. Max resolution is ${r.maxResolution} pixels`;case i:return`The uploaded image exceeds the maximum size allowed. Please choose an image with smaller dimensions or reduce the resolution and try again. Max resolution is ${r.maxMatrix} pixels`}}if(c){const t=await H7({src:e.objectUrl}),r=t&&t.duration>a.maxDuration,n=t&&Math.max(t.width,t.height)>a.maxResolution,i=e.file.size>a.maxSize,o=t&&t.width*t.height>a.maxMatrix;switch(!0){case r:return`Video is too long. Max duration is ${a.maxDuration} seconds`;case i:return`Video is too big. Max size is ${uw(a.maxSize)}`;case n:return`Video resolution is too high. Max resolution is ${a.maxResolution} pixels`;case o:return`The uploaded video exceeds the maximum size allowed. Please choose a video with smaller dimensions or reduce the resolution and try again. Max resolution is ${a.maxMatrix} pixels`}}},J7={sms:"wellesley.admin.sms",auth:"wellesley.admin.auth",openai:"wellesley.admin.openai",uploads:"wellesley.admin.uploads",captcha:"wellesley.admin.captcha",language:"wellesley.admin.language",mediacache:"wellesley.admin.mediacache",translation:"wellesley.admin.translation",link_service:"wellesley.admin.link_service"},sp={posts:"wellesley.posts",translation:"wellesley.translation",registration:"wellesley.registration",confirmationCode:"wellesley.confirmationCode",uploadsPolicyDoc:"wellesley.uploads.policy.doc",uploadsPolicyAudio:"wellesley.uploads.policy.audio",uploadsPolicyImage:"wellesley.uploads.policy.image",uploadsPolicyVideo:"wellesley.uploads.policy.video",captcha:"wellesley.captcha",access:"wellesley.access",branding:"wellesley.branding",instanceAdmin:"wellesley.instance.admin",legal:"wellesley.instance.legal",domainBlocks:"wellesley.instance.domainBlocks",contacts:"wellesley.instance.contacts"},Q7={data:null,isPending:!1},{posts:x0,uploadsPolicyDoc:fw,uploadsPolicyAudio:A0,uploadsPolicyImage:tp,uploadsPolicyVideo:au,registration:$7,captcha:e4,instanceAdmin:t4,branding:r4,translation:a4,access:n4}=sp,{captcha:s4,language:i4,translation:o4,openai:c4,link_service:l4}=J7,ic=e=>e.data,u4=vi(ic,(e=>{var t,r,a;return{max_characters:(null==(t=null==e?void 0:e[x0])?void 0:t.max_characters)||0,max_media_attachments:(null==(r=null==e?void 0:e[x0])?void 0:r.max_media_attachments)||0,max_pins:(null==(a=null==e?void 0:e[x0])?void 0:a.max_pins)||0}})),W6=vi(ic,(e=>{var t,r,a;return{...null==e?void 0:e[tp],maxSize:(null==(t=null==e?void 0:e[tp])?void 0:t.maxSize)||0,maxMatrix:(null==(r=null==e?void 0:e[tp])?void 0:r.maxMatrix)||0,maxResolution:(null==(a=null==e?void 0:e[tp])?void 0:a.maxResolution)||0}})),F6=vi(ic,(e=>{var t,r,a,n;return{...null==e?void 0:e[au],maxSize:(null==(t=null==e?void 0:e[au])?void 0:t.maxSize)||0,maxMatrix:(null==(r=null==e?void 0:e[au])?void 0:r.maxMatrix)||0,maxDuration:(null==(a=null==e?void 0:e[au])?void 0:a.maxDuration)||0,maxResolution:(null==(n=null==e?void 0:e[au])?void 0:n.maxResolution)||0}})),V6=vi(ic,(e=>{var t,r;return{...null==e?void 0:e[A0],maxSize:null==(t=null==e?void 0:e[A0])?void 0:t.maxSize,keepOriginal:(null==(r=null==e?void 0:e[A0])?void 0:r.keepOriginal)||0}})),X6=vi(ic,(e=>{var t;return{...null==e?void 0:e[fw],maxSize:(null==(t=null==e?void 0:e[fw])?void 0:t.maxSize)||0}})),G6=vi([W6,F6,V6,X6],((e,t,r,a)=>({IMAGE:null==e?void 0:e.extensions,VIDEO:null==t?void 0:t.extensions,AUDIO:null==r?void 0:r.extensions,DOCUMENT:null==a?void 0:a.extensions}))),f4=vi(G6,(e=>Object.keys(e).reduce(((t,r)=>[...t,...e[r]||[]]),[]))),uu=_i({name:"platformSettings",initialState:Q7,reducers:{setError:(e,t)=>{e.error=t.payload},setPending:(e,t)=>{e.isPending=t.payload}},extraReducers:e=>{e.addCase(N9,((e,{payload:t})=>{e.data={...e.data,...t}}))},selectors:{selectSettings:ic,selectPostConfig:u4,selectDocPolicy:X6,selectImagePolicy:W6,selectVideoPolicy:F6,selectAudioPolicy:V6,selectSupportedExtensions:G6,selectFullExtensionsList:f4,selectRegistration:e=>{var t;return null==(t=e.data)?void 0:t[$7]},selectLanguageDetection:e=>{var t;return null==(t=e.data)?void 0:t[i4]},selectLanguageTranslation:e=>{var t;return null==(t=e.data)?void 0:t[o4]},selectOpenai:e=>{var t;return null==(t=e.data)?void 0:t[c4]},selectCaptcha:e=>{var t;return null==(t=e.data)?void 0:t[e4]},selectAdminCaptcha:e=>{var t;return null==(t=e.data)?void 0:t[s4]},selectPlatformTranslation:e=>{var t;return null==(t=e.data)?void 0:t[a4]},selectAccess:e=>{var t;return null==(t=e.data)?void 0:t[n4]},selectBranding:e=>{var t;return null==(t=e.data)?void 0:t[r4]},selectLinkService:e=>{var t;return null==(t=e.data)?void 0:t[l4]},selectInstanceAdmin:e=>{var t;return null==(t=e.data)?void 0:t[t4]},selectLegal:e=>{var t;return null==(t=e.data)?void 0:t[sp.legal]},selectDomainBlocks:e=>{var t;return null==(t=e.data)?void 0:t[sp.domainBlocks]},selectContacts:e=>{var t;return null==(t=e.data)?void 0:t[sp.contacts]}}}),d4=()=>{const[e]=kz(),t=new AbortController,r=t.signal,a=Ie(uu.selectors.selectImagePolicy),n=Ie(uu.selectors.selectVideoPolicy),i=Ie(uu.selectors.selectDocPolicy),o=Ie(uu.selectors.selectAudioPolicy);return[async({media:t,tag:s,onError:c,onUpload:l,onProgress:u})=>{var d;const f=I6(t.file.name),p=await Y7({imgPolicy:a,docPolicy:i,videoPolicy:n,audioPolicy:o,media:t});if(p)return qt.error(p),void(null==c||c());try{const a=await e({createUpload:{extension:f,tags:[s],meta:{name:t.file.name}}});if("error"in a)throw new Error(a.error);const n=null==(d=a.data)?void 0:d.uri;return await new Promise(((e,a)=>{const i=new XMLHttpRequest;i.open("PUT",n),r&&r.addEventListener("abort",(()=>{try{i.abort()}catch(e){aa.warn("Cancel upload failed",e)}})),i.upload.onprogress=e=>{if(!e.lengthComputable)return;const t=Math.round(e.loaded/e.total*100);null==u||u(e.loaded,e.total,t)},i.onerror=()=>a(new Error("Upload failed")),i.onload=()=>{i.status>=200&&i.status<300?e():a(new Error(i.statusText))},i.send(t.file)})),null==l||l(),a.data.upload.uploadId}catch(e){null==c||c(e),qt.error(`Could not upload file. ${String(e)}`)}},()=>t.abort("Upload canceled")]};var ba=(e=>(e.header="header",e.avatar="avatar",e))(ba||{});const Ru=({user:e,type:t})=>{var r,a,n,i;if(!e)return"";try{return("avatar"===t?null==(a=null==(r=e.avatar)?void 0:r.files[0])?void 0:a.uri:null==(i=null==(n=e.header)?void 0:n.files[0])?void 0:i.uri)||""}catch{return""}};var dw,fu={exports:{}},p4=fu.exports;
42
+ */Ge("remoteReady");const P9=Ge("askLogin"),L9=Ge("reselectUser");Ge("requestLogout");const R9=Ge("setConfirmLeavePage");Ge("requestChangePath");const QA=Ge("wsSubscribe"),$A=Ge("wsUnSubscribe");Ge("hostStoreConnect"),Ge("remoteLogin"),Ge("remoteLogout"),Ge("wsOnMessage"),Ge("setRouterPath"),Ge("setDeviceType");const e6=Ge("setUserError"),t6=Ge("setUserIsError"),Av=Ge("setUserPending"),zv=Ge("setUserSuccess"),r6=Ge("setUserData"),a6=Ge("updateAccountData"),I9=Ge("updateUser");Ge("addNotification"),Ge("markNotification"),Ge("setNotificationsError"),Ge("setNotificationsList"),Ge("setNotificationsPending"),Ge("setNotificationsTotalCount"),Ge("setNotificationsUnreadCount"),Ge("resetNotificationsState"),Ge("undoNotification"),Ge("setInstanceInfo"),Ge("setInstanceInfoPending"),Ge("setInstanceInfoError");const N9=Ge("setPlatformSettings");Ge("setProfileSettings");const n6=Ge("setGroupData"),Sv=Ge("setGroupLoading");UA("requestMicroFrontendFetch"),UA("sendMicroFrontendFetchResponse");const M9={data:null,isPending:!1,isSuccess:!1},sr=_i({name:"userNoHTML",initialState:M9,reducers:{setUser:(e,t)=>{e.data=t.payload},setPending:(e,t)=>{e.isPending=t.payload},setSuccess:(e,{payload:t})=>{e.isSuccess=t},setError:(e,{payload:t})=>{e.error=t}},selectors:{selectUser:e=>e.data,selectPending:e=>e.isPending,selectError:e=>e.error,selectSuccess:e=>e.isSuccess}}),s6="getApiV1UsersRelationships",O9=pi.memoize(((e,t)=>Lr.util.selectCachedArgsForQuery(e,s6).find((e=>e.targets.includes(t))))),Pn=({state:e,userId:t,dispatch:r,relationsProps:a})=>{const n=O9(e,t);return n?r(Lr.util.updateQueryData(s6,n,(e=>{e[t]={...e[t],...a}}))):null};var Hk=function(e,t,r){if(e&&"reportValidity"in e){var a=xv(r,t);e.setCustomValidity(a&&a.message||""),e.reportValidity()}},i6=function(e,t){var r=function(r){var a=t.fields[r];a&&a.ref&&"reportValidity"in a.ref?Hk(a.ref,r,e):a.refs&&a.refs.forEach((function(t){return Hk(t,r,e)}))};for(var a in t.fields)r(a)},q9=function(e,t){t.shouldUseNativeValidation&&i6(e,t);var r={};for(var a in e){var n=xv(t.fields,a),i=Object.assign(e[a]||{},{ref:n&&n.ref});if(E9(t.names||Object.keys(e),a)){var o=Object.assign({},xv(r,a));p0(o,"root",i),p0(r,a,o)}else p0(r,a,i)}return r},E9=function(e,t){return e.some((function(e){return e.startsWith(t+".")}))},U9=function(e,t){for(var r={};e.length;){var a=e[0],n=a.code,i=a.message,o=a.path.join(".");if(!r[o])if("unionErrors"in a){var s=a.unionErrors[0].errors[0];r[o]={message:s.message,type:s.code}}else r[o]={message:i,type:n};if("unionErrors"in a&&a.unionErrors.forEach((function(t){return t.errors.forEach((function(t){return e.push(t)}))})),t){var c=r[o].types,l=c&&c[a.code];r[o]=jz(o,t,r,n,l?[].concat(l,a.message):a.message)}e.shift()}return r},up=function(e,t,r){return void 0===r&&(r={}),function(a,n,i){try{return Promise.resolve(function(n,o){try{var s=Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](a,t)).then((function(e){return i.shouldUseNativeValidation&&i6({},i),{errors:{},values:r.raw?a:e}}))}catch(e){return o(e)}return s&&s.then?s.then(void 0,o):s}(0,(function(e){if(null!=e.errors)return{values:{},errors:q9(U9(e.errors,!i.shouldUseNativeValidation&&"all"===i.criteriaMode),i)};throw e})))}catch(e){return Promise.reject(e)}}};const o6=({schema:e,defaultValues:t,mode:r="onChange",reValidateMode:a="onChange",showRequiredErrors:n=!0})=>Ev({mode:r,reValidateMode:a,resolver:n?up(e):async(t,r,a)=>{const n=await up(e)(t,r,a);if(!n.errors||0===Object.keys(n.errors).length)return n;const i={};return Object.keys(n.errors).forEach((e=>{const r=n.errors[e],a=t[e],o="password"===e,s=null==a||""===a,c="invalid_type"===(null==r?void 0:r.type)||"too_small"===(null==r?void 0:r.type)||o&&"custom"===(null==r?void 0:r.type);s&&c||(i[e]=r)})),{values:n.values,errors:i}},defaultValues:t});var $e,Cv;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),a={};for(const e of r)a[e]=t[e];return e.objectValues(a)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}($e||($e={})),(Cv||(Cv={})).mergeShapes=(e,t)=>({...e,...t});const ye=$e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ms=e=>{switch(typeof e){case"undefined":return ye.undefined;case"string":return ye.string;case"number":return isNaN(e)?ye.nan:ye.number;case"boolean":return ye.boolean;case"function":return ye.function;case"bigint":return ye.bigint;case"symbol":return ye.symbol;case"object":return Array.isArray(e)?ye.array:null===e?ye.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?ye.promise:typeof Map<"u"&&e instanceof Map?ye.map:typeof Set<"u"&&e instanceof Set?ye.set:typeof Date<"u"&&e instanceof Date?ye.date:ye.object;default:return ye.unknown}},ae=$e.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),D9=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ra extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},r={_errors:[]},a=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(a);else if("invalid_return_type"===n.code)a(n.returnTypeError);else if("invalid_arguments"===n.code)a(n.argumentsError);else if(0===n.path.length)r._errors.push(t(n));else{let e=r,a=0;for(;a<n.path.length;){const r=n.path[a];a===n.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(n))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(this),r}static assert(e){if(!(e instanceof ra))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$e.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}ra.create=e=>new ra(e);const tc=(e,t)=>{let r;switch(e.code){case ae.invalid_type:r=e.received===ye.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case ae.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,$e.jsonStringifyReplacer)}`;break;case ae.unrecognized_keys:r=`Unrecognized key(s) in object: ${$e.joinValues(e.keys,", ")}`;break;case ae.invalid_union:r="Invalid input";break;case ae.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${$e.joinValues(e.options)}`;break;case ae.invalid_enum_value:r=`Invalid enum value. Expected ${$e.joinValues(e.options)}, received '${e.received}'`;break;case ae.invalid_arguments:r="Invalid function arguments";break;case ae.invalid_return_type:r="Invalid function return type";break;case ae.invalid_date:r="Invalid date";break;case ae.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:$e.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case ae.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case ae.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case ae.custom:r="Invalid input";break;case ae.invalid_intersection_types:r="Intersection results could not be merged";break;case ae.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ae.not_finite:r="Number must be finite";break;default:r=t.defaultError,$e.assertNever(e)}return{message:r}};let c6=tc;function W9(e){c6=e}function fp(){return c6}const dp=e=>{const{data:t,path:r,errorMaps:a,issueData:n}=e,i=[...r,...n.path||[]],o={...n,path:i};if(void 0!==n.message)return{...n,path:i,message:n.message};let s="";const c=a.filter((e=>!!e)).slice().reverse();for(const e of c)s=e(o,{data:t,defaultError:s}).message;return{...n,path:i,message:s}},F9=[];function pe(e,t){const r=fp(),a=dp({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===tc?void 0:tc].filter((e=>!!e))});e.common.issues.push(a)}class wr{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if("aborted"===a.status)return Pe;"dirty"===a.status&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,a=await e.value;r.push({key:t,value:a})}return wr.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:t,value:n}=a;if("aborted"===t.status||"aborted"===n.status)return Pe;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"!==t.value&&(typeof n.value<"u"||a.alwaysSet)&&(r[t.value]=n.value)}return{status:e.value,value:r}}}const Pe=Object.freeze({status:"aborted"}),Jo=e=>({status:"dirty",value:e}),Rr=e=>({status:"valid",value:e}),jv=e=>"aborted"===e.status,Tv=e=>"dirty"===e.status,gu=e=>"valid"===e.status,mu=e=>typeof Promise<"u"&&e instanceof Promise;function pp(e,t,r,a){if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function l6(e,t,r,a,n){if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var xe,cu,lu;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(xe||(xe={}));class un{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Kk=(e,t)=>{if(gu(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ra(e.common.issues);return this._error=t,this._error}}};function We(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:a,description:n}=e;if(t&&(r||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(t,n)=>{var i,o;const{message:s}=e;return"invalid_enum_value"===t.code?{message:s??n.defaultError}:typeof n.data>"u"?{message:null!==(i=s??a)&&void 0!==i?i:n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:null!==(o=s??r)&&void 0!==o?o:n.defaultError}},description:n}}class Ve{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return ms(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ms(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new wr,ctx:{common:e.parent.common,data:e.data,parsedType:ms(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(mu(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const a={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ms(e)},n=this._parseSync({data:e,path:a.path,parent:a});return Kk(a,n)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ms(e)},a=this._parse({data:e,path:r.path,parent:r}),n=await(mu(a)?a:Promise.resolve(a));return Kk(r,n)}refine(e,t){const r=e=>"string"==typeof t||typeof t>"u"?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,a)=>{const n=e(t),i=()=>a.addIssue({code:ae.custom,...r(t)});return typeof Promise<"u"&&n instanceof Promise?n.then((e=>!!e||(i(),!1))):!!n||(i(),!1)}))}refinement(e,t){return this._refinement(((r,a)=>!!e(r)||(a.addIssue("function"==typeof t?t(r,a):t),!1)))}_refinement(e){return new Za({schema:this,typeName:je.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ln.create(this,this._def)}nullable(){return xs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ba.create(this,this._def)}promise(){return ac.create(this,this._def)}or(e){return wu.create([this,e],this._def)}and(e){return bu.create(this,e,this._def)}transform(e){return new Za({...We(this._def),schema:this,typeName:je.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Cu({...We(this._def),innerType:this,defaultValue:t,typeName:je.ZodDefault})}brand(){return new Xv({typeName:je.ZodBranded,type:this,...We(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ju({...We(this._def),innerType:this,catchValue:t,typeName:je.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Nu.create(this,e)}readonly(){return Tu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const V9=/^c[^\s-]{8,}$/i,X9=/^[0-9a-z]+$/,G9=/^[0-9A-HJKMNP-TV-Z]{26}$/,B9=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Z9=/^[a-z0-9_-]{21}$/i,H9=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,K9=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Y9="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let b0;const J9=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Q9=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,$9=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,u6="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",e5=new RegExp(`^${u6}$`);function f6(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function t5(e){return new RegExp(`^${f6(e)}$`)}function d6(e){let t=`${u6}T${f6(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function r5(e,t){return!(("v4"!==t&&t||!J9.test(e))&&("v6"!==t&&t||!Q9.test(e)))}class Ga extends Ve{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ye.string){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.string,received:t.parsedType}),Pe}const t=new wr;let r;for(const a of this._def.checks)if("min"===a.kind)e.data.length<a.value&&(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("max"===a.kind)e.data.length>a.value&&(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("length"===a.kind){const n=e.data.length>a.value,i=e.data.length<a.value;(n||i)&&(r=this._getOrReturnCtx(e,r),n?pe(r,{code:ae.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&pe(r,{code:ae.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),t.dirty())}else if("email"===a.kind)K9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"email",code:ae.invalid_string,message:a.message}),t.dirty());else if("emoji"===a.kind)b0||(b0=new RegExp(Y9,"u")),b0.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"emoji",code:ae.invalid_string,message:a.message}),t.dirty());else if("uuid"===a.kind)B9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"uuid",code:ae.invalid_string,message:a.message}),t.dirty());else if("nanoid"===a.kind)Z9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"nanoid",code:ae.invalid_string,message:a.message}),t.dirty());else if("cuid"===a.kind)V9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"cuid",code:ae.invalid_string,message:a.message}),t.dirty());else if("cuid2"===a.kind)X9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"cuid2",code:ae.invalid_string,message:a.message}),t.dirty());else if("ulid"===a.kind)G9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"ulid",code:ae.invalid_string,message:a.message}),t.dirty());else if("url"===a.kind)try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),pe(r,{validation:"url",code:ae.invalid_string,message:a.message}),t.dirty()}else"regex"===a.kind?(a.regex.lastIndex=0,a.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"regex",code:ae.invalid_string,message:a.message}),t.dirty())):"trim"===a.kind?e.data=e.data.trim():"includes"===a.kind?e.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),t.dirty()):"toLowerCase"===a.kind?e.data=e.data.toLowerCase():"toUpperCase"===a.kind?e.data=e.data.toUpperCase():"startsWith"===a.kind?e.data.startsWith(a.value)||(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.invalid_string,validation:{startsWith:a.value},message:a.message}),t.dirty()):"endsWith"===a.kind?e.data.endsWith(a.value)||(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.invalid_string,validation:{endsWith:a.value},message:a.message}),t.dirty()):"datetime"===a.kind?d6(a).test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.invalid_string,validation:"datetime",message:a.message}),t.dirty()):"date"===a.kind?e5.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.invalid_string,validation:"date",message:a.message}),t.dirty()):"time"===a.kind?t5(a).test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.invalid_string,validation:"time",message:a.message}),t.dirty()):"duration"===a.kind?H9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"duration",code:ae.invalid_string,message:a.message}),t.dirty()):"ip"===a.kind?r5(e.data,a.version)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"ip",code:ae.invalid_string,message:a.message}),t.dirty()):"base64"===a.kind?$9.test(e.data)||(r=this._getOrReturnCtx(e,r),pe(r,{validation:"base64",code:ae.invalid_string,message:a.message}),t.dirty()):$e.assertNever(a);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement((t=>e.test(t)),{validation:t,code:ae.invalid_string,...xe.errToObj(r)})}_addCheck(e){return new Ga({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...xe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...xe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...xe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...xe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...xe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...xe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...xe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...xe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...xe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...xe.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...xe.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,...xe.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...xe.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...xe.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...xe.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...xe.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...xe.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...xe.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...xe.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...xe.errToObj(t)})}nonempty(e){return this.min(1,xe.errToObj(e))}trim(){return new Ga({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ga({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ga({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function a5(e,t){const r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,n=r>a?r:a;return parseInt(e.toFixed(n).replace(".",""))%parseInt(t.toFixed(n).replace(".",""))/Math.pow(10,n)}Ga.create=e=>{var t;return new Ga({checks:[],typeName:je.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...We(e)})};class ks extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ye.number){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.number,received:t.parsedType}),Pe}let t;const r=new wr;for(const a of this._def.checks)"int"===a.kind?$e.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"multipleOf"===a.kind?0!==a5(e.data,a.value)&&(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.not_finite,message:a.message}),r.dirty()):$e.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,xe.toString(t))}gt(e,t){return this.setLimit("min",e,!1,xe.toString(t))}lte(e,t){return this.setLimit("max",e,!0,xe.toString(t))}lt(e,t){return this.setLimit("max",e,!1,xe.toString(t))}setLimit(e,t,r,a){return new ks({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:xe.toString(a)}]})}_addCheck(e){return new ks({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:xe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:xe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:xe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:xe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:xe.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:xe.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:xe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:xe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:xe.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&$e.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ks.create=e=>new ks({checks:[],typeName:je.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...We(e)});class ws extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ye.bigint){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.bigint,received:t.parsedType}),Pe}let t;const r=new wr;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),pe(t,{code:ae.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):$e.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,xe.toString(t))}gt(e,t){return this.setLimit("min",e,!1,xe.toString(t))}lte(e,t){return this.setLimit("max",e,!0,xe.toString(t))}lt(e,t){return this.setLimit("max",e,!1,xe.toString(t))}setLimit(e,t,r,a){return new ws({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:xe.toString(a)}]})}_addCheck(e){return new ws({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:xe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:xe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:xe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:xe.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:xe.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ws.create=e=>{var t;return new ws({checks:[],typeName:je.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...We(e)})};class _u extends Ve{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ye.boolean){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.boolean,received:t.parsedType}),Pe}return Rr(e.data)}}_u.create=e=>new _u({typeName:je.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...We(e)});class yi extends Ve{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ye.date){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.date,received:t.parsedType}),Pe}if(isNaN(e.data.getTime())){return pe(this._getOrReturnCtx(e),{code:ae.invalid_date}),Pe}const t=new wr;let r;for(const a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),t.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),pe(r,{code:ae.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),t.dirty()):$e.assertNever(a);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new yi({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:xe.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:xe.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}yi.create=e=>new yi({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:je.ZodDate,...We(e)});class hp extends Ve{_parse(e){if(this._getType(e)!==ye.symbol){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.symbol,received:t.parsedType}),Pe}return Rr(e.data)}}hp.create=e=>new hp({typeName:je.ZodSymbol,...We(e)});class vu extends Ve{_parse(e){if(this._getType(e)!==ye.undefined){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.undefined,received:t.parsedType}),Pe}return Rr(e.data)}}vu.create=e=>new vu({typeName:je.ZodUndefined,...We(e)});class ku extends Ve{_parse(e){if(this._getType(e)!==ye.null){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.null,received:t.parsedType}),Pe}return Rr(e.data)}}ku.create=e=>new ku({typeName:je.ZodNull,...We(e)});class rc extends Ve{constructor(){super(...arguments),this._any=!0}_parse(e){return Rr(e.data)}}rc.create=e=>new rc({typeName:je.ZodAny,...We(e)});class hi extends Ve{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Rr(e.data)}}hi.create=e=>new hi({typeName:je.ZodUnknown,...We(e)});class Rn extends Ve{_parse(e){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.never,received:t.parsedType}),Pe}}Rn.create=e=>new Rn({typeName:je.ZodNever,...We(e)});class yp extends Ve{_parse(e){if(this._getType(e)!==ye.undefined){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.void,received:t.parsedType}),Pe}return Rr(e.data)}}yp.create=e=>new yp({typeName:je.ZodVoid,...We(e)});class Ba extends Ve{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==ye.array)return pe(t,{code:ae.invalid_type,expected:ye.array,received:t.parsedType}),Pe;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,n=t.data.length<a.exactLength.value;(e||n)&&(pe(t,{code:e?ae.too_big:ae.too_small,minimum:n?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(pe(t,{code:ae.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(pe(t,{code:ae.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>a.type._parseAsync(new un(t,e,t.path,r))))).then((e=>wr.mergeArray(r,e)));const n=[...t.data].map(((e,r)=>a.type._parseSync(new un(t,e,t.path,r))));return wr.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new Ba({...this._def,minLength:{value:e,message:xe.toString(t)}})}max(e,t){return new Ba({...this._def,maxLength:{value:e,message:xe.toString(t)}})}length(e,t){return new Ba({...this._def,exactLength:{value:e,message:xe.toString(t)}})}nonempty(e){return this.min(1,e)}}function Yo(e){if(e instanceof Rt){const t={};for(const r in e.shape){const a=e.shape[r];t[r]=ln.create(Yo(a))}return new Rt({...e._def,shape:()=>t})}return e instanceof Ba?new Ba({...e._def,type:Yo(e.element)}):e instanceof ln?ln.create(Yo(e.unwrap())):e instanceof xs?xs.create(Yo(e.unwrap())):e instanceof fn?fn.create(e.items.map((e=>Yo(e)))):e}Ba.create=(e,t)=>new Ba({type:e,minLength:null,maxLength:null,exactLength:null,typeName:je.ZodArray,...We(t)});class Rt extends Ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=$e.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==ye.object){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.object,received:t.parsedType}),Pe}const{status:t,ctx:r}=this._processInputParams(e),{shape:a,keys:n}=this._getCached(),i=[];if(!(this._def.catchall instanceof Rn&&"strip"===this._def.unknownKeys))for(const e in r.data)n.includes(e)||i.push(e);const o=[];for(const e of n){const t=a[e],n=r.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new un(r,n,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof Rn){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)o.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)i.length>0&&(pe(r,{code:ae.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const a=r.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new un(r,a,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of o){const r=await t.key,a=await t.value;e.push({key:r,value:a,alwaysSet:t.alwaysSet})}return e})).then((e=>wr.mergeObjectSync(t,e))):wr.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return xe.errToObj,new Rt({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var a,n,i,o;const s=null!==(i=null===(n=(a=this._def).errorMap)||void 0===n?void 0:n.call(a,t,r).message)&&void 0!==i?i:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(o=xe.errToObj(e).message)&&void 0!==o?o:s}:{message:s}}}:{}})}strip(){return new Rt({...this._def,unknownKeys:"strip"})}passthrough(){return new Rt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Rt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Rt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:je.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Rt({...this._def,catchall:e})}pick(e){const t={};return $e.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new Rt({...this._def,shape:()=>t})}omit(e){const t={};return $e.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new Rt({...this._def,shape:()=>t})}deepPartial(){return Yo(this)}partial(e){const t={};return $e.objectKeys(this.shape).forEach((r=>{const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()})),new Rt({...this._def,shape:()=>t})}required(e){const t={};return $e.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof ln;)e=e._def.innerType;t[r]=e}})),new Rt({...this._def,shape:()=>t})}keyof(){return p6($e.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:Rn.create(),typeName:je.ZodObject,...We(t)}),Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:Rn.create(),typeName:je.ZodObject,...We(t)}),Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:Rn.create(),typeName:je.ZodObject,...We(t)});class wu extends Ve{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map((e=>new ra(e.ctx.common.issues)));return pe(t,{code:ae.invalid_union,unionErrors:r}),Pe}));{let e;const a=[];for(const n of r){const r={...t,common:{...t.common,issues:[]},parent:null},i=n._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"===i.status&&!e&&(e={result:i,ctx:r}),r.common.issues.length&&a.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const n=a.map((e=>new ra(e)));return pe(t,{code:ae.invalid_union,unionErrors:n}),Pe}}get options(){return this._def.options}}wu.create=(e,t)=>new wu({options:e,typeName:je.ZodUnion,...We(t)});const Ln=e=>e instanceof Au?Ln(e.schema):e instanceof Za?Ln(e.innerType()):e instanceof zu?[e.value]:e instanceof bs?e.options:e instanceof Su?$e.objectValues(e.enum):e instanceof Cu?Ln(e._def.innerType):e instanceof vu?[void 0]:e instanceof ku?[null]:e instanceof ln?[void 0,...Ln(e.unwrap())]:e instanceof xs?[null,...Ln(e.unwrap())]:e instanceof Xv||e instanceof Tu?Ln(e.unwrap()):e instanceof ju?Ln(e._def.innerType):[];class Sp extends Ve{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ye.object)return pe(t,{code:ae.invalid_type,expected:ye.object,received:t.parsedType}),Pe;const r=this.discriminator,a=t.data[r],n=this.optionsMap.get(a);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(pe(t,{code:ae.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const a=new Map;for(const r of t){const t=Ln(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(a.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);a.set(n,r)}}return new Sp({typeName:je.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...We(r)})}}function Pv(e,t){const r=ms(e),a=ms(t);if(e===t)return{valid:!0,data:e};if(r===ye.object&&a===ye.object){const r=$e.objectKeys(t),a=$e.objectKeys(e).filter((e=>-1!==r.indexOf(e))),n={...e,...t};for(const r of a){const a=Pv(e[r],t[r]);if(!a.valid)return{valid:!1};n[r]=a.data}return{valid:!0,data:n}}if(r===ye.array&&a===ye.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let a=0;a<e.length;a++){const n=Pv(e[a],t[a]);if(!n.valid)return{valid:!1};r.push(n.data)}return{valid:!0,data:r}}return r===ye.date&&a===ye.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class bu extends Ve{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=(e,a)=>{if(jv(e)||jv(a))return Pe;const n=Pv(e.value,a.value);return n.valid?((Tv(e)||Tv(a))&&t.dirty(),{status:t.value,value:n.data}):(pe(r,{code:ae.invalid_intersection_types}),Pe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>a(e,t))):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}bu.create=(e,t,r)=>new bu({left:e,right:t,typeName:je.ZodIntersection,...We(r)});class fn extends Ve{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ye.array)return pe(r,{code:ae.invalid_type,expected:ye.array,received:r.parsedType}),Pe;if(r.data.length<this._def.items.length)return pe(r,{code:ae.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Pe;!this._def.rest&&r.data.length>this._def.items.length&&(pe(r,{code:ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map(((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new un(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(a).then((e=>wr.mergeArray(t,e))):wr.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new fn({...this._def,rest:e})}}fn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fn({items:e,typeName:je.ZodTuple,rest:null,...We(t)})};class xu extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ye.object)return pe(r,{code:ae.invalid_type,expected:ye.object,received:r.parsedType}),Pe;const a=[],n=this._def.keyType,i=this._def.valueType;for(const e in r.data)a.push({key:n._parse(new un(r,e,r.path,e)),value:i._parse(new un(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?wr.mergeObjectAsync(t,a):wr.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return new xu(t instanceof Ve?{keyType:e,valueType:t,typeName:je.ZodRecord,...We(r)}:{keyType:Ga.create(),valueType:e,typeName:je.ZodRecord,...We(t)})}}class gp extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ye.map)return pe(r,{code:ae.invalid_type,expected:ye.map,received:r.parsedType}),Pe;const a=this._def.keyType,n=this._def.valueType,i=[...r.data.entries()].map((([e,t],i)=>({key:a._parse(new un(r,e,r.path,[i,"key"])),value:n._parse(new un(r,t,r.path,[i,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of i){const a=await r.key,n=await r.value;if("aborted"===a.status||"aborted"===n.status)return Pe;("dirty"===a.status||"dirty"===n.status)&&t.dirty(),e.set(a.value,n.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of i){const a=r.key,n=r.value;if("aborted"===a.status||"aborted"===n.status)return Pe;("dirty"===a.status||"dirty"===n.status)&&t.dirty(),e.set(a.value,n.value)}return{status:t.value,value:e}}}}gp.create=(e,t,r)=>new gp({valueType:t,keyType:e,typeName:je.ZodMap,...We(r)});class gi extends Ve{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ye.set)return pe(r,{code:ae.invalid_type,expected:ye.set,received:r.parsedType}),Pe;const a=this._def;null!==a.minSize&&r.data.size<a.minSize.value&&(pe(r,{code:ae.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&r.data.size>a.maxSize.value&&(pe(r,{code:ae.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const n=this._def.valueType;function i(e){const r=new Set;for(const a of e){if("aborted"===a.status)return Pe;"dirty"===a.status&&t.dirty(),r.add(a.value)}return{status:t.value,value:r}}const o=[...r.data.values()].map(((e,t)=>n._parse(new un(r,e,r.path,t))));return r.common.async?Promise.all(o).then((e=>i(e))):i(o)}min(e,t){return new gi({...this._def,minSize:{value:e,message:xe.toString(t)}})}max(e,t){return new gi({...this._def,maxSize:{value:e,message:xe.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}gi.create=(e,t)=>new gi({valueType:e,minSize:null,maxSize:null,typeName:je.ZodSet,...We(t)});class Qo extends Ve{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ye.function)return pe(t,{code:ae.invalid_type,expected:ye.function,received:t.parsedType}),Pe;function r(e,r){return dp({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,fp(),tc].filter((e=>!!e)),issueData:{code:ae.invalid_arguments,argumentsError:r}})}function a(e,r){return dp({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,fp(),tc].filter((e=>!!e)),issueData:{code:ae.invalid_return_type,returnTypeError:r}})}const n={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof ac){const e=this;return Rr((async function(...t){const o=new ra([]),s=await e._def.args.parseAsync(t,n).catch((e=>{throw o.addIssue(r(t,e)),o})),c=await Reflect.apply(i,this,s);return await e._def.returns._def.type.parseAsync(c,n).catch((e=>{throw o.addIssue(a(c,e)),o}))}))}{const e=this;return Rr((function(...t){const o=e._def.args.safeParse(t,n);if(!o.success)throw new ra([r(t,o.error)]);const s=Reflect.apply(i,this,o.data),c=e._def.returns.safeParse(s,n);if(!c.success)throw new ra([a(s,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Qo({...this._def,args:fn.create(e).rest(hi.create())})}returns(e){return new Qo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Qo({args:e||fn.create([]).rest(hi.create()),returns:t||hi.create(),typeName:je.ZodFunction,...We(r)})}}class Au extends Ve{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Au.create=(e,t)=>new Au({getter:e,typeName:je.ZodLazy,...We(t)});class zu extends Ve{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return pe(t,{received:t.data,code:ae.invalid_literal,expected:this._def.value}),Pe}return{status:"valid",value:e.data}}get value(){return this._def.value}}function p6(e,t){return new bs({values:e,typeName:je.ZodEnum,...We(t)})}zu.create=(e,t)=>new zu({value:e,typeName:je.ZodLiteral,...We(t)});class bs extends Ve{constructor(){super(...arguments),cu.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return pe(t,{expected:$e.joinValues(r),received:t.parsedType,code:ae.invalid_type}),Pe}if(pp(this,cu)||l6(this,cu,new Set(this._def.values)),!pp(this,cu).has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return pe(t,{received:t.data,code:ae.invalid_enum_value,options:r}),Pe}return Rr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return bs.create(e,{...this._def,...t})}exclude(e,t=this._def){return bs.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}cu=new WeakMap,bs.create=p6;class Su extends Ve{constructor(){super(...arguments),lu.set(this,void 0)}_parse(e){const t=$e.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ye.string&&r.parsedType!==ye.number){const e=$e.objectValues(t);return pe(r,{expected:$e.joinValues(e),received:r.parsedType,code:ae.invalid_type}),Pe}if(pp(this,lu)||l6(this,lu,new Set($e.getValidEnumValues(this._def.values))),!pp(this,lu).has(e.data)){const e=$e.objectValues(t);return pe(r,{received:r.data,code:ae.invalid_enum_value,options:e}),Pe}return Rr(e.data)}get enum(){return this._def.values}}lu=new WeakMap,Su.create=(e,t)=>new Su({values:e,typeName:je.ZodNativeEnum,...We(t)});class ac extends Ve{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ye.promise&&!1===t.common.async)return pe(t,{code:ae.invalid_type,expected:ye.promise,received:t.parsedType}),Pe;const r=t.parsedType===ye.promise?t.data:Promise.resolve(t.data);return Rr(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}ac.create=(e,t)=>new ac({type:e,typeName:je.ZodPromise,...We(t)});class Za extends Ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===je.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,n={addIssue:e=>{pe(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===a.type){const e=a.transform(r.data,n);if(r.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return Pe;const a=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===a.status?Pe:"dirty"===a.status||"dirty"===t.value?Jo(a.value):a}));{if("aborted"===t.value)return Pe;const a=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===a.status?Pe:"dirty"===a.status||"dirty"===t.value?Jo(a.value):a}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,n);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===a.status?Pe:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((r=>"aborted"===r.status?Pe:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===a.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!gu(e))return e;const i=a.transform(e.value,n);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>gu(e)?Promise.resolve(a.transform(e.value,n)).then((e=>({status:t.value,value:e}))):e))}$e.assertNever(a)}}Za.create=(e,t,r)=>new Za({schema:e,typeName:je.ZodEffects,effect:t,...We(r)}),Za.createWithPreprocess=(e,t,r)=>new Za({schema:t,effect:{type:"preprocess",transform:e},typeName:je.ZodEffects,...We(r)});class ln extends Ve{_parse(e){return this._getType(e)===ye.undefined?Rr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ln.create=(e,t)=>new ln({innerType:e,typeName:je.ZodOptional,...We(t)});class xs extends Ve{_parse(e){return this._getType(e)===ye.null?Rr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}xs.create=(e,t)=>new xs({innerType:e,typeName:je.ZodNullable,...We(t)});class Cu extends Ve{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===ye.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Cu.create=(e,t)=>new Cu({innerType:e,typeName:je.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...We(t)});class ju extends Ve{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return mu(a)?a.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ra(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new ra(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ju.create=(e,t)=>new ju({innerType:e,typeName:je.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...We(t)});class mp extends Ve{_parse(e){if(this._getType(e)!==ye.nan){const t=this._getOrReturnCtx(e);return pe(t,{code:ae.invalid_type,expected:ye.nan,received:t.parsedType}),Pe}return{status:"valid",value:e.data}}}mp.create=e=>new mp({typeName:je.ZodNaN,...We(e)});const n5=Symbol("zod_brand");class Xv extends Ve{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Nu extends Ve{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?Pe:"dirty"===e.status?(t.dirty(),Jo(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?Pe:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new Nu({in:e,out:t,typeName:je.ZodPipeline})}}class Tu extends Ve{_parse(e){const t=this._def.innerType._parse(e),r=e=>(gu(e)&&(e.value=Object.freeze(e.value)),e);return mu(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}function h6(e,t={},r){return e?rc.create().superRefine(((a,n)=>{var i,o;if(!e(a)){const e="function"==typeof t?t(a):"string"==typeof t?{message:t}:t,s=null===(o=null!==(i=e.fatal)&&void 0!==i?i:r)||void 0===o||o,c="string"==typeof e?{message:e}:e;n.addIssue({code:"custom",...c,fatal:s})}})):rc.create()}Tu.create=(e,t)=>new Tu({innerType:e,typeName:je.ZodReadonly,...We(t)});const s5={object:Rt.lazycreate};var je;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(je||(je={}));const i5=(e,t={message:`Input not instance of ${e.name}`})=>h6((t=>t instanceof e),t),y6=Ga.create,g6=ks.create,o5=mp.create,c5=ws.create,m6=_u.create,l5=yi.create,u5=hp.create,f5=vu.create,d5=ku.create,p5=rc.create,h5=hi.create,y5=Rn.create,g5=yp.create,m5=Ba.create,_5=Rt.create,v5=Rt.strictCreate,k5=wu.create,w5=Sp.create,b5=bu.create,x5=fn.create,A5=xu.create,z5=gp.create,S5=gi.create,C5=Qo.create,j5=Au.create,T5=zu.create,P5=bs.create,L5=Su.create,R5=ac.create,Yk=Za.create,I5=ln.create,N5=xs.create,M5=Za.createWithPreprocess,O5=Nu.create,q5=()=>y6().optional(),E5=()=>g6().optional(),U5=()=>m6().optional(),D5={string:e=>Ga.create({...e,coerce:!0}),number:e=>ks.create({...e,coerce:!0}),boolean:e=>_u.create({...e,coerce:!0}),bigint:e=>ws.create({...e,coerce:!0}),date:e=>yi.create({...e,coerce:!0})},W5=Pe;var ge=Object.freeze({__proto__:null,defaultErrorMap:tc,setErrorMap:W9,getErrorMap:fp,makeIssue:dp,EMPTY_PATH:F9,addIssueToContext:pe,ParseStatus:wr,INVALID:Pe,DIRTY:Jo,OK:Rr,isAborted:jv,isDirty:Tv,isValid:gu,isAsync:mu,get util(){return $e},get objectUtil(){return Cv},ZodParsedType:ye,getParsedType:ms,ZodType:Ve,datetimeRegex:d6,ZodString:Ga,ZodNumber:ks,ZodBigInt:ws,ZodBoolean:_u,ZodDate:yi,ZodSymbol:hp,ZodUndefined:vu,ZodNull:ku,ZodAny:rc,ZodUnknown:hi,ZodNever:Rn,ZodVoid:yp,ZodArray:Ba,ZodObject:Rt,ZodUnion:wu,ZodDiscriminatedUnion:Sp,ZodIntersection:bu,ZodTuple:fn,ZodRecord:xu,ZodMap:gp,ZodSet:gi,ZodFunction:Qo,ZodLazy:Au,ZodLiteral:zu,ZodEnum:bs,ZodNativeEnum:Su,ZodPromise:ac,ZodEffects:Za,ZodTransformer:Za,ZodOptional:ln,ZodNullable:xs,ZodDefault:Cu,ZodCatch:ju,ZodNaN:mp,BRAND:n5,ZodBranded:Xv,ZodPipeline:Nu,ZodReadonly:Tu,custom:h6,Schema:Ve,ZodSchema:Ve,late:s5,get ZodFirstPartyTypeKind(){return je},coerce:D5,any:p5,array:m5,bigint:c5,boolean:m6,date:l5,discriminatedUnion:w5,effect:Yk,enum:P5,function:C5,instanceof:i5,intersection:b5,lazy:j5,literal:T5,map:z5,nan:o5,nativeEnum:L5,never:y5,null:d5,nullable:N5,number:g6,object:_5,oboolean:U5,onumber:E5,optional:I5,ostring:q5,pipeline:O5,preprocess:M5,promise:R5,record:A5,set:S5,strictObject:v5,string:y6,symbol:u5,transformer:Yk,tuple:x5,undefined:f5,union:k5,unknown:h5,void:g5,NEVER:W5,ZodIssueCode:ae,quotelessJson:D9,ZodError:ra}),F5={USER:"teamcity",npm_config_user_agent:"npm/10.9.3 node/v22.18.0 linux x64 workspaces/true",npm_node_execpath:"/home/teamcity/.nvm/versions/node/v22.18.0/bin/node",npm_config_noproxy:"",HOME:"/home/teamcity",npm_package_json:"/mnt/agent/work/70fcd8585843667f/packages/user/package.json",npm_config_userconfig:"/home/teamcity/.npmrc",npm_config_local_prefix:"/mnt/agent/work/70fcd8585843667f",COLOR:"1",npm_config_progress:"",TEMP:"/mnt/agent/temp/buildTmp",npm_config_prefix:"/home/teamcity/.nvm/versions/node/v22.18.0",npm_config_npm_version:"10.9.3",npm_config_cache:"/home/teamcity/.npm",npm_config_node_gyp:"/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/mnt/agent/work/70fcd8585843667f/packages/user/node_modules/.bin:/mnt/agent/work/70fcd8585843667f/packages/node_modules/.bin:/mnt/agent/work/70fcd8585843667f/node_modules/.bin:/mnt/agent/work/node_modules/.bin:/mnt/agent/node_modules/.bin:/mnt/node_modules/.bin:/node_modules/.bin:/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/mnt/agent/work/70fcd8585843667f/node_modules/.bin:/mnt/agent/work/node_modules/.bin:/mnt/agent/node_modules/.bin:/mnt/node_modules/.bin:/node_modules/.bin:/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/teamcity/.cargo/bin:/home/teamcity/.rvm/gems/ruby-3.3.9/bin:/home/teamcity/.rvm/gems/ruby-3.3.9@global/bin:/home/teamcity/.rvm/rubies/ruby-3.3.9/bin:/home/teamcity/.rvm/bin:/home/teamcity/.local/bin:/usr/lib/jvm/java-21-amazon-corretto/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/snap/bin:/usr/share/dotnet:/usr/share/dotnet/tools:/home/teamcity/google-cloud-sdk/bin:/home/teamcity/go/bin:/usr/bin/mvn:/home/teamcity/.nvm/versions/node/v22.18.0/bin",TURBO_HASH:"e1d171f0b2d299e8",NODE:"/home/teamcity/.nvm/versions/node/v22.18.0/bin/node",npm_package_name:"@wellesley/user",npm_config_color:"always",DOMAIN_ENV:"test",LANG:"en_US.UTF-8",TURBO_TEAM:"wellesley",TMP:"/mnt/agent/temp/buildTmp",TURBO_API:"https://turborepo-remote-cache-fo3np.ondigitalocean.app",npm_lifecycle_script:"vite build",SHELL:"/bin/bash",npm_package_version:"1.0.693",npm_lifecycle_event:"build",TURBO_CACHE:"remote:rw",SENTRY_MAPS_UPLOAD:"true",npm_config_globalconfig:"/home/teamcity/.nvm/versions/node/v22.18.0/etc/npmrc",npm_config_init_module:"/home/teamcity/.npm-init.js",PWD:"/mnt/agent/work/70fcd8585843667f/packages/user",npm_execpath:"/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/bin/npm-cli.js",npm_config_global_prefix:"/home/teamcity/.nvm/versions/node/v22.18.0",npm_command:"run-script",TURBO_TOKEN:"wellesley-turbo-token",USE_PACKAGES_FROM_NPM:"true",INIT_CWD:"/mnt/agent/work/70fcd8585843667f/packages/user",EDITOR:"vi",NODE_ENV:"production",BUILD_NUMBER:"3522",APP_NAME:"@wellesley/user"};const _6=e=>F5.DOMAIN_ENV===e,V5=_6("prod"),v6=V5?8:3,k6=64,Jk=5,Lv=2,w6=30,Gv=50,b6=1024,x6=30,cn={link:56,userName:30,pronouns:80,displayName:50,description:b6,fieldLabel:20,fieldContent:80,location:56,timezone:56},_s={short:"Too short",long:"Too long"},X5=(e,t=100)=>{let r;return function(...a){clearTimeout(r),r=setTimeout((()=>e.apply(this,a)),t)}},G5=(e,t)=>{const r=X5(((t,r,a)=>{e(...a).then(t).catch(r)}),t);return(...e)=>new Promise(((t,a)=>{r(t,a,e)}))},Bv=new RegExp("\\p{Extended_Pictographic}","u"),A6=({showInlineError:e=!0})=>ge.string().trim().min(1,e?"Username is required":"").min(2,e?"Must be at least 2 characters long":"").max(30,_s.long).regex(/^[0-9a-zA-Z_]+[0-9a-zA-Z_.]*$/,"Only latin letters, digits, _ and . allowed"),B5=G5((async e=>{try{const{exists:t}=await Uv().dispatch(Lr.endpoints.getApiV1UsersCheck.initiate({username:e})).unwrap();return{exists:t??!1,message:"Username already in use. Please, try another one"}}catch{return{exists:!1,message:""}}}),500),z6=ge.string().trim().min(1,"Display name is required").max(50).regex(/^[^@]*$/,"@ is not allowed").superRefine(((e,t)=>{const r=Bv.test(e),a=/[a-zA-Z0-9]/.test(e);r&&!a&&t.addIssue({code:ge.ZodIssueCode.custom,message:"Emojis alone are not allowed. Please add text"})})),Z5=ge.string().max(1024,_s.long).optional(),S6=({minLength:e,minErrorMessage:t,maxLength:r,regexErrorMessage:a})=>ge.string().trim().min(e,t).max(r,_s.long).regex(/^[0-9a-zA-Z_]+[0-9a-zA-Z_.]*$/,a);S6({minLength:2,maxLength:30,regexErrorMessage:"Invalid characters. ex.: group_name_1"}),S6({minLength:2,minErrorMessage:_s.short,maxLength:30,regexErrorMessage:"Invalid characters. ex.: channel_name_1"}),ge.string().trim().min(1,"").regex(/^[0-9a-zA-Z_]+[0-9a-zA-Z_.]*$|^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{1,}$/,"Invalid characters");const H5=`Required: A-Z, a-z, 0-9, special character, min ${v6}, max 64`;ge.string().trim().superRefine(((e,t)=>{Bv.test(e)&&t.addIssue({code:ge.ZodIssueCode.custom,message:"Emojis are not allowed"}),/[A-Z]/.test(e)&&/[a-z]/.test(e)&&/[0-9]/.test(e)&&/[^A-Za-z0-9]/.test(e)&&e.length>=v6&&e.length<=64||t.addIssue({code:ge.ZodIssueCode.custom,message:H5})})),ge.string().trim().min(5,"Must be at least 5 characters long").regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/i,"Email format is not valid").refine((e=>!Bv.test(e)),"Emojis are not allowed");const K5=({form:e,originalUsername:t})=>{const r=ir(t??"").current,a=e=>e.getValues("userName"),[n,i]=rt(!1),[o,s]=rt(a(e));return{isUserNameChecked:n,handleUserNameChange:()=>{i(!1)},handleUserNameBlur:async()=>{const t=a(e).trim();if(t===o||t===r)return;const{exists:n,message:c}=await B5(t);n&&e.setError("userName",{message:c}),s(t),i(!0)}}},Y5=ge.object({bio:Z5,username:A6({showInlineError:!0}),displayName:z6}),J5=ge.object({show:ge.boolean(),dateOnly:ge.boolean(),date:ge.date().optional().nullable()}),Q5=(e=!0)=>{const t=A6({showInlineError:e});return ge.object({avatarId:ge.string().nullable(),headerId:ge.string().nullable(),channel:ge.boolean().optional(),actorType:ge.enum(["Application","Group","Organization","Person","Service"]).optional(),userName:t,displayName:z6,Pronouns:ge.string().max(cn.pronouns,_s.long).optional(),summary:ge.string().max(cn.description,_s.long).optional(),customFields:ge.array(ge.object({label:ge.string().max(cn.fieldLabel,_s.long).optional(),content:ge.string().max(cn.fieldContent,_s.long).optional()})),location:ge.object({geo:ge.object({latitude:ge.number().optional(),longitude:ge.number().optional(),accuracy:ge.number().optional().nullable()}).optional().nullable(),show:ge.boolean().optional(),name:ge.string().optional(),autoUpdate:ge.boolean().optional()}),timezone:ge.object({show:ge.boolean(),ianaTimezone:ge.string().optional(),autoUpdate:ge.boolean()}),birthday:J5,canSubmit:ge.boolean(),botProfile:ge.object({role:ge.string().optional(),triggers:ge.array(ge.object({id:ge.string(),label:ge.string()})).optional(),personality_traits:ge.array(ge.object({id:ge.string(),label:ge.string()})).optional(),tone:ge.string().optional(),style:ge.array(ge.object({id:ge.string(),label:ge.string()})).optional(),behaviors:ge.array(ge.object({id:ge.string(),label:ge.string()})).optional(),prompt:ge.string().optional()}).optional()})};ge.object({show:ge.boolean(),dateOnly:ge.boolean(),date:ge.date().optional().nullable()});const Pu=e=>{var t;const r=e,a=409===(null==r?void 0:r.status);return{message:"UserNameIsReserved"===(null==(t=null==r?void 0:r.data)?void 0:t.errorCode)?"Restricted words detected. Please, try alternatives":"Username already in use. Please, try another one",isError:a}},C6=Lr.enhanceEndpoints({endpoints:{deleteApiV1Users:{invalidatesTags:["Secure","Account"],async onQueryStarted(e,{dispatch:t,queryFulfilled:r}){try{await Ae(r)&&await t(Lr.endpoints.getApiV1AccountsProfile.initiate({htmlContent:!1})).unwrap()}catch(e){qt.error(`${Xa(e)}`)}}},getApiV1AccountsProfile:{providesTags:["Secure","Account"],async onQueryStarted(e,{dispatch:t,queryFulfilled:r}){t(Av(!0));try{const e=await Ae(r);e&&t(r6(e.data)),t(zv(!0))}catch(e){t(zv(!1)),t(t6(!0)),t(e6(e))}finally{t(Av(!1))}}},putApiV1UsersByUserId:{invalidatesTags:["Secure","Account"],async onQueryStarted(e,{queryFulfilled:t}){try{await t,qt.success("User updated successfully")}catch(e){const t=e.error,{isError:r}=Pu(t);!r&&qt.error(`${Xa(t)}`)}}},getApiV1Users:{providesTags:["Secure","UserNoHtml"],async onQueryStarted(e,{dispatch:t,queryFulfilled:r}){const a=!e.htmlContent;try{a&&t(sr.actions.setPending(!0));const e=await Ae(r);a&&e&&(t(sr.actions.setUser(e.data)),t(sr.actions.setSuccess(!0)),t(sr.actions.setPending(!1)))}catch(e){a&&(t(sr.actions.setSuccess(!1)),t(sr.actions.setError(e)),t(sr.actions.setPending(!1))),qt.error(`${Xa(e)}`)}}},postApiV1Users:{invalidatesTags:["Account"],async onQueryStarted(e,{queryFulfilled:t}){try{await t,qt.success("User created successfully")}catch(e){const t=e.error,{isError:r}=Pu(t);!r&&qt.error(`${Xa(t)}`)}}},getApiV1UsersFollowers:{providesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t}){await Ae(t)}},getApiV1UsersRemoteByUserNameFullFollowers:{providesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t}){await Ae(t)}},getApiV1UsersByUserId:{providesTags:["Secure","UserNoHtml"],async onQueryStarted(e,{dispatch:t,queryFulfilled:r}){const a=!e.htmlContent;try{a&&t(sr.actions.setPending(!0));const e=await Ae(r);a&&e&&(t(sr.actions.setUser(e.data)),t(sr.actions.setSuccess(!0)),t(sr.actions.setPending(!1)))}catch(e){a&&(t(sr.actions.setSuccess(!1)),t(sr.actions.setError(e)),t(sr.actions.setPending(!1))),qt.error(`${Xa(e)}`)}}},getApiV1UsersByUserIdFollowers:{providesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t}){await Ae(t)}},getApiV1UsersFollowees:{providesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t}){await Ae(t)}},getApiV1UsersByUserIdFollowing:{providesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t}){await Ae(t)}},postApiV1UsersFollowByUsernameAccept:{invalidatesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t,dispatch:r,getState:a}){const n=Pn({dispatch:r,userId:e.user.id,state:a(),relationsProps:{followed:"ACCEPTED"}});await Ae(t,`Accepted follow request from ${e.username}`,(()=>null==n?void 0:n.undo()))}},postApiV1UsersFollowByUsernameReject:{invalidatesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t,dispatch:r,getState:a}){const n=Pn({dispatch:r,userId:e.user.id,state:a(),relationsProps:{followed:"REJECTED"}});await Ae(t,`Rejected follow request from ${e.username}`,(()=>null==n?void 0:n.undo()))}},postApiV1UsersFollowByUsername:{invalidatesTags:["Follow","Secure"],async onQueryStarted(e,{queryFulfilled:t,dispatch:r}){await Ae(t,`Follow request sent to ${e.username}`)&&r(Lr.util.invalidateTags([{type:"Relationship",id:e.user.id}]))}},postApiV1UsersFollowByUsernameUndo:{invalidatesTags:["Follow","Secure"],async onQueryStarted(e,{queryFulfilled:t,dispatch:r,getState:a}){const n=Pn({dispatch:r,userId:e.user.id,state:a(),relationsProps:{following:null}});await Ae(t,`You unfollowed ${e.username}`,(()=>null==n?void 0:n.undo()))}},getApiV1Block:{providesTags:["Follow"]},postApiV1BlockByUserId:{invalidatesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t,getState:r,dispatch:a}){const n=Pn({userId:e.userId,dispatch:a,state:r(),relationsProps:{blocked:!0}});await Ae(t,void 0,(()=>null==n?void 0:n.undo()))}},deleteApiV1BlockByUserId:{invalidatesTags:["Follow"],async onQueryStarted(e,{queryFulfilled:t,getState:r,dispatch:a}){const n=Pn({userId:e.userId,dispatch:a,state:r(),relationsProps:{blocked:!1,muted:{state:!1}}});await Ae(t,void 0,(()=>null==n?void 0:n.undo()))}},postApiV1MuteByUserId:{async onQueryStarted({userId:e},{queryFulfilled:t,getState:r,dispatch:a}){const n=Pn({userId:e,dispatch:a,state:r(),relationsProps:{muted:{state:!0}}});await Ae(t,void 0,(()=>null==n?void 0:n.undo()))}},deleteApiV1MuteByUserId:{async onQueryStarted({userId:e},{queryFulfilled:t,getState:r,dispatch:a}){const n=Pn({userId:e,dispatch:a,state:r(),relationsProps:{muted:{state:!1}}});await Ae(t,void 0,(()=>null==n?void 0:n.undo()))}},getApiV1Mute:{async onQueryStarted(e,{queryFulfilled:t}){await Ae(t)}},getApiV1UsersRelationships:{providesTags:(e,t,{targets:r})=>r.map((e=>({type:"Relationship",id:e}))),async onQueryStarted(e,{queryFulfilled:t}){await Ae(t)}},postApiV1AdminUserChangeState:{invalidatesTags:["Secure"],async onQueryStarted(e,{queryFulfilled:t}){await Ae(t,`User ${e.changeUserState.userId} state changed to ${e.changeUserState.newState}`)}},putApiV1Notes:{async onQueryStarted(e,{queryFulfilled:t,getState:r,dispatch:a}){const{userId:n,text:i}=e.noteUpdate,o=Pn({userId:n,dispatch:a,state:r(),relationsProps:{note:i}});await Ae(t,"Note has been updated",(()=>null==o?void 0:o.undo()))}},deleteApiV1NotesByUserId:{async onQueryStarted(e,{queryFulfilled:t,getState:r,dispatch:a}){const n=Pn({userId:e.userId,dispatch:a,state:r(),relationsProps:{note:""}});await Ae(t,"Note has been removed",(()=>null==n?void 0:n.undo()))}},postApiV1UsersFollowByUsernamePend:{async onQueryStarted(e,{queryFulfilled:t}){await Ae(t,`${e.username} has been removed from followers`)}}}}).injectEndpoints({endpoints:e=>({getInteractionUrl:e.query({query:e=>({url:e,headers:{Accept:"application/activity+json"}}),transformResponse:e=>"string"==typeof e?JSON.parse(e):e})})}),{useGetInteractionUrlQuery:_oe,usePostApiV1UsersMutation:$5,useDeleteApiV1AccountsDeleteMutation:e7,useGetApiV1AccountsProfileQuery:voe,usePutApiV1UsersByUserIdMutation:Zv,useGetApiV1UsersQuery:t7,useDeleteApiV1UsersMutation:j6,usePostApiV1MuteByUserIdMutation:koe,useDeleteApiV1MuteByUserIdMutation:woe,useGetApiV1MuteQuery:boe,usePostApiV1AdminUserChangeStateMutation:xoe,useGetApiV1UsersRelationshipsQuery:r7,usePutApiV1NotesMutation:Aoe,useDeleteApiV1NotesByUserIdMutation:zoe,useLazyGetApiV1UsersRelationshipsQuery:a7,useLazyGetApiV1GeoQuery:n7,useGetApiV1UsersFollowersQuery:Soe,useGetApiV1UsersByUserIdQuery:s7,useLazyGetApiV1GroupsAccountQuery:i7,useLazyGetApiV1UsersRenameHistoryQuery:Coe,useGetApiV1UsersByUserIdFollowersQuery:joe,usePostApiV1UsersFollowByUsernameMutation:Toe,usePostApiV1UsersFollowByUsernameUndoMutation:Poe,usePostApiV1UsersFollowByUsernameRejectMutation:Loe,usePostApiV1UsersFollowByUsernameAcceptMutation:Roe,useGetApiV1UsersRemoteByUserNameFullFollowersQuery:Ioe}=C6,T6=()=>{const[e]=Zv();return({userId:t,htmlContent:r,data:a})=>{e({userId:t,userUpdate:a,...r&&{htmlContent:r}})}},Qk={data:null,isError:!1,isPending:!1,isSuccess:!1},It=_i({name:"user",initialState:Qk,reducers:{reset:e=>{Object.assign(e,Qk)}},extraReducers:e=>{e.addCase(r6,((e,{payload:t})=>{e.data=t})).addCase(a6,((e,{payload:t})=>{e.data&&Object.assign(e.data,t||{})})).addCase(zv,((e,{payload:t})=>{e.isSuccess=t})).addCase(Av,((e,{payload:t})=>{e.isPending=t})).addCase(t6,((e,{payload:t})=>{e.isError=t})).addCase(e6,((e,{payload:t})=>{e.error=t})).addCase(I9,((e,{payload:t})=>{var r;null!=(r=e.data)&&r.users&&(e.data.users=e.data.users.map((e=>t.id===e.id?t:e)))}))},selectors:{selectIsError:e=>e.isError,selectError:e=>e.error,selectPending:e=>e.isPending,selectData:e=>e.data,selectAccount:e=>{var t;return null==(t=e.data)?void 0:t.account},selectAccountId:e=>{var t;return null==(t=e.data)?void 0:t.account.id},selectUsers:e=>{var t;return null==(t=e.data)?void 0:t.users},selectUserById:(e,t)=>{var r;return null==(r=e.data)?void 0:r.users.find((({id:e})=>e===t))},selectCurrentUser:e=>{var t;return null==(t=e.data)?void 0:t.users.find((({id:t})=>{var r;return t===(null==(r=e.data)?void 0:r.selectedUserId)}))},selectSelectedUserId:e=>{var t;return null==(t=e.data)?void 0:t.selectedUserId},selectSuccess:e=>e.isSuccess}}),o7=e=>e.filter((e=>e.id&&e.username&&e.displayName)),Noe=()=>{const e=Ha(),t=Ie(It.selectors.selectAccount),r=DA("account#$account_id",{account_id:(null==t?void 0:t.id)||""}),a=Ie((e=>Wv.selectors.selectLastUpdateFor(e,r)));Ye((()=>{if(null!=t&&t.id)return e(QA({id:r,topics:[r]})),()=>{e($A(r))}}),[null==t?void 0:t.id]),Ye((()=>{null!=a&&a.data&&e(a6({...a.data,users:o7(a.data.users)}))}),[null==a?void 0:a.data])},sc=()=>{const e=Ie(It.selectors.selectSelectedUserId),t=Ha();return{changeUser:di((r=>{e!==r&&t(L9({userId:r}))}),[e,t]),selectedUserId:e}},c7=(e="")=>e.startsWith("@")?null==e?void 0:e.replace("@",""):e,l7=({username:e,canFetch:t=!0,htmlContent:r=!0})=>{const a=c7(e),{data:n,error:i,isLoading:o}=t7({username:a,full:!0,htmlContent:r},{skip:!a||!t});return{data:n,error:i,isLoading:o}},u7=e=>{const t=Ie(sr.selectors.selectUser),{isLoading:r}=l7({username:e,canFetch:!!e,htmlContent:!1});return[t,r]},f7="wlsy",P6=()=>{try{return window.localStorage}catch(e){console.warn("Error getting window.localStorage storage",e)}},d7=()=>{const e=new Set,t=P6();if(!t)return[];for(let r=0;r<(null==t?void 0:t.length);r+=1){const a=null==t?void 0:t.key(r);"string"==typeof a&&e.add(a)}return Array.from(e)},Hv=e=>{const t=`${f7}${e?`:${e}`:""}`,r=e=>`${t}:${e}`,a=()=>d7().filter((e=>e.startsWith(`${t}:`))),n=e=>e.slice(t.length+1),i=P6(),o=e=>{try{return null==i?void 0:i.getItem(r(e))}catch{return null}},s=(e,t)=>{try{null==i||i.setItem(r(e),String(t))}catch{return}};return{getItem:o,setItem:s,removeItem:e=>{try{null==i||i.removeItem(r(e))}catch{return}},clear:()=>{try{a().forEach((e=>null==i?void 0:i.removeItem(e)))}catch{return}},keys:()=>a().map(n),has:e=>null!==o(e),getJSON:e=>{const t=o(e);if(null==t)return null;try{return JSON.parse(t)}catch{return null}},setJSON:(e,t)=>{try{s(e,JSON.stringify(t))}catch{return}}}},Kv="auth_token",Yv=Hv("user"),L6=()=>Yv.getItem(Kv)||void 0,p7=e=>Yv.setItem(Kv,e),h7=()=>Yv.removeItem(Kv),y7=()=>!!L6(),g7={getToken:L6,setToken:p7,removeToken:h7,hasToken:y7},$k={forgotPasswordStep:"request",forgotPasswordFields:null,signupStep:"rules",signupFields:null,token:null,newEmail:null,isPending:!!g7.getToken(),isAuthenticated:!1,isAskLoginOpen:!1},Jv=_i({name:"auth",initialState:$k,reducers:{setAskLoginOpen:(e,t)=>{e.isAskLoginOpen=t.payload},login:(e,t)=>{e.isAuthenticated=!0,e.token=t.payload||null,e.isPending=!1},logout:()=>({...$k,isPending:!1}),setNewEmail:(e,t)=>{e.newEmail=t.payload},setForgotPasswordStep:(e,t)=>{e.forgotPasswordStep=t.payload},updateForgotPasswordFields:(e,t)=>{e.forgotPasswordFields={...e.forgotPasswordFields,...t.payload}},resetForgotPasswordFields:e=>{e.forgotPasswordFields=null},setSignupStep:(e,t)=>{e.signupStep=t.payload},updateSignupFields:(e,t)=>{e.signupFields={...e.signupFields,...t.payload}},resetSignupFields:e=>{e.signupFields=null},setPending:(e,t)=>{e.isPending=t.payload}},selectors:{selectAskLoginOpen:e=>e.isAskLoginOpen,selectToken:e=>e.token,selectNewEmail:e=>e.newEmail,selectForgotPasswordStep:e=>e.forgotPasswordStep,selectForgotPasswordFields:e=>e.forgotPasswordFields,selectSignupStep:e=>e.signupStep,selectSignupFields:e=>e.signupFields,selectPending:e=>e.isPending,selectIsAuthenticated:e=>e.isAuthenticated}}),Moe=()=>{const e=Ie(Jv.selectors.selectIsAuthenticated),t=Ie(It.selectors.selectPending);return{user:Ie(It.selectors.selectCurrentUser),isLogged:e,isLoading:t}},m7=()=>{const e=Ie(It.selectors.selectCurrentUser),t=Ie(Jv.selectors.selectIsAuthenticated);return{user:e,isLoading:Ie(It.selectors.selectPending),isLogged:t,error:Ie(It.selectors.selectError)}},Ooe=({userId:e="",canFetch:t=!0,htmlContent:r=!0})=>{const{data:a,error:n,isLoading:i,isFetching:o}=s7({userId:e,full:!0,htmlContent:r},{skip:!e||!t});return{data:a,error:n,isLoading:i,isFetching:o}},_7=({onChange:e})=>{const{user:t}=m7(),r=null==t?void 0:t.id,a=ir(r);Ye((()=>{a.current?r!==a.current&&(e(),a.current=r):a.current=r}),[r,a.current])},ew=["following","followed","blocked","muted","note","blocked_by"],tw=({userId:e,currentUserId:t})=>{const r="string"==typeof e,a=r?[e]:(null==e?void 0:e.filter((e=>e!==t)))||[],n=e===t;return{isSingleUser:r,canFetch:!(!a.length||n||!t),safeTargets:a}},v7=({userId:e,skip:t})=>{const r=Ie(It.selectors.selectCurrentUser),a=null==r?void 0:r.id,{canFetch:n,isSingleUser:i,safeTargets:o}=tw({userId:e,currentUserId:a}),{data:s,isLoading:c}=r7({targets:o,filter:ew},{skip:!n||t}),[l]=a7(),u=({userId:e})=>{const{canFetch:t,safeTargets:r}=tw({userId:e,currentUserId:a});t&&l({targets:r,filter:ew})};return _7({onChange:()=>{u({userId:o})}}),{relationship:(i?null==s?void 0:s[e]:s)||{},isLoading:c,updateRelations:u}},Cp=e=>`@${e.username}${e.domain?`@${e.domain}`:""}`,R6=({id:e,user:t})=>{const r=Ha(),a=DA("user#$username",{username:t?Cp(t).slice(1):""}),n=`${e}-${null==t?void 0:t.username}`;return Ye((()=>{if(null!=t&&t.username)return r(QA({id:n,topics:[a]})),()=>{r($A(n))}}),[null==t?void 0:t.username]),{subscriptionName:a}},qoe=({user:e,onUpdate:t})=>{const{updateRelations:r}=v7({}),{subscriptionName:a}=R6({id:"outside-user-update",user:e}),n=Ie((e=>Wv.selectors.selectLastUpdateFor(e,a)));Ye((()=>{const e=null==n?void 0:n.data;e&&(r({userId:e.id}),t(e))}),[null==n?void 0:n.data])},Eoe=({onUpdate:e})=>{const t=Ie(It.selectors.selectCurrentUser),{subscriptionName:r}=R6({id:"current-user-update",user:t}),a=Ie((e=>Wv.selectors.selectLastUpdateFor(e,r)));Ye((()=>{const t=null==a?void 0:a.data;t&&e(t)}),[null==a?void 0:a.data])},I6=e=>{const t=e.toLowerCase().match(/\.([a-zA-Z0-9]{2,4})(\?|$)+/);return t?t[1]:void 0},k7=e=>e.replace(/\.[^.]*$/,""),N6=()=>"object"!=typeof window,w7=()=>!N6()&&/iPhone|iPod|iPad/gi.test(window.navigator.userAgent),yu="8.48.0",In=globalThis;function Qv(e,t,r){const a=In,n=a.__SENTRY__=a.__SENTRY__||{},i=n[yu]=n[yu]||{};return i[e]||(i[e]=t())}const M6=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,b7="Sentry Logger ",rw=["debug","info","warn","error","log","assert","trace"],aw={};function x7(e){if(!("console"in In))return e();const t=In.console,r={},a=Object.keys(aw);a.forEach((e=>{const a=aw[e];r[e]=t[e],t[e]=a}));try{return e()}finally{a.forEach((e=>{t[e]=r[e]}))}}function A7(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return M6?rw.forEach((r=>{t[r]=(...t)=>{e&&x7((()=>{In.console[r](`${b7}[${r}]:`,...t)}))}})):rw.forEach((e=>{t[e]=()=>{}})),t}const np=Qv("logger",A7);function $v(){return ek(In),In}function ek(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||yu,t[yu]=t[yu]||{}}const z7=Object.prototype.toString;function S7(e,t){return z7.call(e)===`[object ${t}]`}function C7(e){return S7(e,"Object")}function j7(e){return!(!e||!e.then||"function"!=typeof e.then)}function T7(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{M6&&np.log(`Failed to add non-enumerable property "${t}" to object`,e)}}const O6=1e3;function q6(){return Date.now()/O6}function P7(){const{performance:e}=In;if(!e||!e.now)return q6;const t=Date.now()-e.now(),r=null==e.timeOrigin?t:e.timeOrigin;return()=>(r+e.now())/O6}const L7=P7();function $o(){const e=In,t=e.crypto||e.msCrypto;let r=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(r=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch{}return"10000000100040008000100000000000".replace(/[018]/g,(e=>(e^(15&r())>>e/4).toString(16)))}function R7(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||L7(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:$o()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function nw(){return $o()}function sw(){return $o().substring(16)}function E6(e,t,r=2){if(!t||"object"!=typeof t||r<=0)return t;if(e&&t&&0===Object.keys(t).length)return e;const a={...e};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(a[e]=E6(a[e],t[e],r-1));return a}(()=>{const{performance:e}=In;if(!e||!e.now)return;const t=36e5,r=e.now(),a=Date.now(),n=e.timeOrigin?Math.abs(e.timeOrigin+r-a):t,i=n<t,o=e.timing&&e.timing.navigationStart,s="number"==typeof o?Math.abs(o+r-a):t;(i||s<t)&&(n<=s&&e.timeOrigin)})();const Rv="_sentrySpan";function iw(e,t){t?T7(e,Rv,t):delete e[Rv]}function ow(e){return e[Rv]}const I7=100;class tk{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:nw(),spanId:sw()}}clone(){const e=new tk;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,iw(e,ow(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&R7(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,[r,a]=t instanceof Lu?[t.getScopeData(),t.getRequestSession()]:C7(t)?[e,e.requestSession]:[],{tags:n,extra:i,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u}=r||{};return this._tags={...this._tags,...n},this._extra={...this._extra,...i},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),a&&(this._requestSession=a),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,iw(this,void 0),this._attachments=[],this.setPropagationContext({traceId:nw()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:I7;if(r<=0)return this;const a={timestamp:q6(),...e},n=this._breadcrumbs;return n.push(a),this._breadcrumbs=n.length>r?n.slice(-r):n,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ow(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=E6(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext={spanId:sw(),...e},this}getPropagationContext(){return this._propagationContext}captureException(e,t){const r=t&&t.event_id?t.event_id:$o();if(!this._client)return np.warn("No client configured on scope - will not capture exception!"),r;const a=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:a,...t,event_id:r},this),r}captureMessage(e,t,r){const a=r&&r.event_id?r.event_id:$o();if(!this._client)return np.warn("No client configured on scope - will not capture message!"),a;const n=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:n,...r,event_id:a},this),a}captureEvent(e,t){const r=t&&t.event_id?t.event_id:$o();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(np.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}const Lu=tk;function N7(){return Qv("defaultCurrentScope",(()=>new Lu))}function M7(){return Qv("defaultIsolationScope",(()=>new Lu))}class O7{constructor(e,t){let r,a;r=e||new Lu,a=t||new Lu,this._stack=[{scope:r}],this._isolationScope=a}withScope(e){const t=this._pushScope();let r;try{r=e(t)}catch(e){throw this._popScope(),e}return j7(r)?r.then((e=>(this._popScope(),e)),(e=>{throw this._popScope(),e})):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function nc(){const e=ek($v());return e.stack=e.stack||new O7(N7(),M7())}function q7(e){return nc().withScope(e)}function E7(e,t){const r=nc();return r.withScope((()=>(r.getStackTop().scope=e,t(e))))}function cw(e){return nc().withScope((()=>e(nc().getIsolationScope())))}function U7(){return{withIsolationScope:cw,withScope:q7,withSetScope:E7,withSetIsolationScope:(e,t)=>cw(t),getCurrentScope:()=>nc().getScope(),getIsolationScope:()=>nc().getIsolationScope()}}function U6(e){const t=ek(e);return t.acs?t.acs:U7()}function D6(){return U6($v()).getCurrentScope()}function D7(){return U6($v()).getIsolationScope()}function W7(e,t){return D6().captureException(e,void 0)}function F7(e,t){const r={captureContext:t};return D6().captureMessage(e,void 0,r)}function V7(e,t){D7().setExtra(e,t)}const X7=(...e)=>{let t="";for(const r of e){if(r instanceof Error){const e=r;return V7("exceptionMessage",t),void W7(e)}if("object"!=typeof r)t+=r;else try{t+=" "+JSON.stringify(r)}catch{t+=" "+r}}F7(t)},lw=["debug","info","warn","error"],G7=(e,t)=>{const r=lw.indexOf(e);return lw.indexOf(t)>=r},ep=(e,t,r,...a)=>{G7(t,e)&&console.log(`[${e}] ${r}`,...a)},B7=()=>Hv().getItem("logger_lvl"),Z7=(e=(N6()?"info":B7()||"warn"))=>{let t=e;return{debug:(e,...r)=>ep("debug",t,e,...r),info:(e,...r)=>ep("info",t,e,...r),warn:(e,...r)=>ep("warn",t,e,...r),error:(e,...r)=>(X7(e,...r),ep("error",t,e,...r)),setLevel:e=>{t=e},getLevel:()=>t}},aa=Z7(),H7=({src:e,name:t=""})=>new Promise(((r,a)=>{const n=document.createElement("video");n.src=e;const i=()=>{const{duration:e,videoHeight:i,videoWidth:o,src:s}=n,c=k7(t);(!e||!i||!o||!s)&&a(),r({src:s,name:c,width:o,height:i,duration:Math.floor(e)})},o=()=>{aa.warn("Failed to load video"),r(null)};return w7()&&n.load(),n.addEventListener("error",o),n.addEventListener("loadeddata",i),()=>{n.removeEventListener("error",o),n.removeEventListener("loadeddata",i)}})),K7=e=>new Promise(((t,r)=>{const a=new Image,n=URL.createObjectURL(e);a.onload=()=>{t({width:a.naturalWidth,height:a.naturalHeight}),URL.revokeObjectURL(n)},a.onerror=()=>{aa.warn("Failed to load image"),r(null),URL.revokeObjectURL(n)},a.src=n})),uw=e=>{if(!e)return;const t="number"==typeof e?e:parseInt(e,10);if(isNaN(t))throw new Error("Can not get number from income argument");const r=t/1048576;return`${Math.floor(r)} MB`},Y7=async({media:e,docPolicy:t,imgPolicy:r,videoPolicy:a,audioPolicy:n})=>{if(!r||!a)return"Media policy is not defined";const i={IMAGE:r.extensions,VIDEO:a.extensions,AUDIO:n.extensions,DOCUMENT:t.extensions},o=I6(e.file.name)||"",s=Object.keys(i).find((e=>{var t;return null==(t=i[e])?void 0:t.includes(o)}));if(!s)return`Extension ${o} is not supported`;const c="VIDEO"===s;if("IMAGE"===s){const t=await K7(e.file),a=e.file.size>r.maxSize,n=t&&Math.max(t.width,t.height)>r.maxResolution,i=t&&t.width*t.height>r.maxMatrix;switch(!0){case a:return`Image is too big. Max size is ${uw(r.maxSize)}`;case n:return`Image resolution is too high. Max resolution is ${r.maxResolution} pixels`;case i:return`The uploaded image exceeds the maximum size allowed. Please choose an image with smaller dimensions or reduce the resolution and try again. Max resolution is ${r.maxMatrix} pixels`}}if(c){const t=await H7({src:e.objectUrl}),r=t&&t.duration>a.maxDuration,n=t&&Math.max(t.width,t.height)>a.maxResolution,i=e.file.size>a.maxSize,o=t&&t.width*t.height>a.maxMatrix;switch(!0){case r:return`Video is too long. Max duration is ${a.maxDuration} seconds`;case i:return`Video is too big. Max size is ${uw(a.maxSize)}`;case n:return`Video resolution is too high. Max resolution is ${a.maxResolution} pixels`;case o:return`The uploaded video exceeds the maximum size allowed. Please choose a video with smaller dimensions or reduce the resolution and try again. Max resolution is ${a.maxMatrix} pixels`}}},J7={sms:"wellesley.admin.sms",auth:"wellesley.admin.auth",openai:"wellesley.admin.openai",uploads:"wellesley.admin.uploads",captcha:"wellesley.admin.captcha",language:"wellesley.admin.language",mediacache:"wellesley.admin.mediacache",translation:"wellesley.admin.translation",link_service:"wellesley.admin.link_service"},sp={posts:"wellesley.posts",translation:"wellesley.translation",registration:"wellesley.registration",confirmationCode:"wellesley.confirmationCode",uploadsPolicyDoc:"wellesley.uploads.policy.doc",uploadsPolicyAudio:"wellesley.uploads.policy.audio",uploadsPolicyImage:"wellesley.uploads.policy.image",uploadsPolicyVideo:"wellesley.uploads.policy.video",captcha:"wellesley.captcha",access:"wellesley.access",branding:"wellesley.branding",instanceAdmin:"wellesley.instance.admin",legal:"wellesley.instance.legal",domainBlocks:"wellesley.instance.domainBlocks",contacts:"wellesley.instance.contacts"},Q7={data:null,isPending:!1},{posts:x0,uploadsPolicyDoc:fw,uploadsPolicyAudio:A0,uploadsPolicyImage:tp,uploadsPolicyVideo:au,registration:$7,captcha:e4,instanceAdmin:t4,branding:r4,translation:a4,access:n4}=sp,{captcha:s4,language:i4,translation:o4,openai:c4,link_service:l4}=J7,ic=e=>e.data,u4=vi(ic,(e=>{var t,r,a;return{max_characters:(null==(t=null==e?void 0:e[x0])?void 0:t.max_characters)||0,max_media_attachments:(null==(r=null==e?void 0:e[x0])?void 0:r.max_media_attachments)||0,max_pins:(null==(a=null==e?void 0:e[x0])?void 0:a.max_pins)||0}})),W6=vi(ic,(e=>{var t,r,a;return{...null==e?void 0:e[tp],maxSize:(null==(t=null==e?void 0:e[tp])?void 0:t.maxSize)||0,maxMatrix:(null==(r=null==e?void 0:e[tp])?void 0:r.maxMatrix)||0,maxResolution:(null==(a=null==e?void 0:e[tp])?void 0:a.maxResolution)||0}})),F6=vi(ic,(e=>{var t,r,a,n;return{...null==e?void 0:e[au],maxSize:(null==(t=null==e?void 0:e[au])?void 0:t.maxSize)||0,maxMatrix:(null==(r=null==e?void 0:e[au])?void 0:r.maxMatrix)||0,maxDuration:(null==(a=null==e?void 0:e[au])?void 0:a.maxDuration)||0,maxResolution:(null==(n=null==e?void 0:e[au])?void 0:n.maxResolution)||0}})),V6=vi(ic,(e=>{var t,r;return{...null==e?void 0:e[A0],maxSize:null==(t=null==e?void 0:e[A0])?void 0:t.maxSize,keepOriginal:(null==(r=null==e?void 0:e[A0])?void 0:r.keepOriginal)||0}})),X6=vi(ic,(e=>{var t;return{...null==e?void 0:e[fw],maxSize:(null==(t=null==e?void 0:e[fw])?void 0:t.maxSize)||0}})),G6=vi([W6,F6,V6,X6],((e,t,r,a)=>({IMAGE:null==e?void 0:e.extensions,VIDEO:null==t?void 0:t.extensions,AUDIO:null==r?void 0:r.extensions,DOCUMENT:null==a?void 0:a.extensions}))),f4=vi(G6,(e=>Object.keys(e).reduce(((t,r)=>[...t,...e[r]||[]]),[]))),uu=_i({name:"platformSettings",initialState:Q7,reducers:{setError:(e,t)=>{e.error=t.payload},setPending:(e,t)=>{e.isPending=t.payload}},extraReducers:e=>{e.addCase(N9,((e,{payload:t})=>{e.data={...e.data,...t}}))},selectors:{selectSettings:ic,selectPostConfig:u4,selectDocPolicy:X6,selectImagePolicy:W6,selectVideoPolicy:F6,selectAudioPolicy:V6,selectSupportedExtensions:G6,selectFullExtensionsList:f4,selectRegistration:e=>{var t;return null==(t=e.data)?void 0:t[$7]},selectLanguageDetection:e=>{var t;return null==(t=e.data)?void 0:t[i4]},selectLanguageTranslation:e=>{var t;return null==(t=e.data)?void 0:t[o4]},selectOpenai:e=>{var t;return null==(t=e.data)?void 0:t[c4]},selectCaptcha:e=>{var t;return null==(t=e.data)?void 0:t[e4]},selectAdminCaptcha:e=>{var t;return null==(t=e.data)?void 0:t[s4]},selectPlatformTranslation:e=>{var t;return null==(t=e.data)?void 0:t[a4]},selectAccess:e=>{var t;return null==(t=e.data)?void 0:t[n4]},selectBranding:e=>{var t;return null==(t=e.data)?void 0:t[r4]},selectLinkService:e=>{var t;return null==(t=e.data)?void 0:t[l4]},selectInstanceAdmin:e=>{var t;return null==(t=e.data)?void 0:t[t4]},selectLegal:e=>{var t;return null==(t=e.data)?void 0:t[sp.legal]},selectDomainBlocks:e=>{var t;return null==(t=e.data)?void 0:t[sp.domainBlocks]},selectContacts:e=>{var t;return null==(t=e.data)?void 0:t[sp.contacts]}}}),d4=()=>{const[e]=kz(),t=new AbortController,r=t.signal,a=Ie(uu.selectors.selectImagePolicy),n=Ie(uu.selectors.selectVideoPolicy),i=Ie(uu.selectors.selectDocPolicy),o=Ie(uu.selectors.selectAudioPolicy);return[async({media:t,tag:s,onError:c,onUpload:l,onProgress:u})=>{var d;const f=I6(t.file.name),p=await Y7({imgPolicy:a,docPolicy:i,videoPolicy:n,audioPolicy:o,media:t});if(p)return qt.error(p),void(null==c||c());try{const a=await e({createUpload:{extension:f,tags:[s],meta:{name:t.file.name}}});if("error"in a)throw new Error(a.error);const n=null==(d=a.data)?void 0:d.uri;return await new Promise(((e,a)=>{const i=new XMLHttpRequest;i.open("PUT",n),r&&r.addEventListener("abort",(()=>{try{i.abort()}catch(e){aa.warn("Cancel upload failed",e)}})),i.upload.onprogress=e=>{if(!e.lengthComputable)return;const t=Math.round(e.loaded/e.total*100);null==u||u(e.loaded,e.total,t)},i.onerror=()=>a(new Error("Upload failed")),i.onload=()=>{i.status>=200&&i.status<300?e():a(new Error(i.statusText))},i.send(t.file)})),null==l||l(),a.data.upload.uploadId}catch(e){null==c||c(e),qt.error(`Could not upload file. ${String(e)}`)}},()=>t.abort("Upload canceled")]};var ba=(e=>(e.header="header",e.avatar="avatar",e))(ba||{});const Ru=({user:e,type:t})=>{var r,a,n,i;if(!e)return"";try{return("avatar"===t?null==(a=null==(r=e.avatar)?void 0:r.files[0])?void 0:a.uri:null==(i=null==(n=e.header)?void 0:n.files[0])?void 0:i.uri)||""}catch{return""}};var dw,fu={exports:{}},p4=fu.exports;
43
43
  /**
44
44
  * @license
45
45
  * Lodash <https://lodash.com/>
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "!.*",
8
8
  "!*.map"
9
9
  ],
10
- "version": "1.0.692",
10
+ "version": "1.0.693",
11
11
  "module": "index.ts",
12
12
  "scripts": {
13
13
  "build": "vite build",