@roomstay/core 0.1.71 → 0.1.72-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};let n,i,o,r,s;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>$,AddGiftCardSchema:()=>_o,BaseGiftCardSchema:()=>vo,DATE_FORMAT:()=>N,EAddonPricingType:()=>R,EBookingFlow:()=>i,EBookingPaymentMethod:()=>o,EBookingStatus:()=>n,ECompanyProvider:()=>l,EDistanceUnitType:()=>v,EFeeType:()=>A,EGiftCardTransactionType:()=>ko,EGuaranteePolicyDepositMode:()=>k,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,ELogCategory:()=>Io,ELogSeverity:()=>To,ELogType:()=>No,EPlanpayBookingStatus:()=>s,ERMSAuthSyncHistoryStatus:()=>P,ERMSDiscountType:()=>_,ERMSSyncStrategy:()=>y,ERoomstayEventSource:()=>w,ERoomstayImageSize:()=>z,EditGiftCardSchema:()=>yo,GuestProfile:()=>d,HttpMethod:()=>E,IAuxiliaryFilterType:()=>g,IMaintenanceStatusService:()=>b,InternationalAddressSchema:()=>go,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>a,Package:()=>T,PurchaseGiftCardSchema:()=>Po,RedeemGiftCardSchema:()=>bo,RefreshGiftCardTokenSchema:()=>wo,RegisterGiftCardAdminSchema:()=>Eo,Reservation:()=>u,ReservedPackage:()=>I,TotalCalculator:()=>Ho,ValidateGiftCardSchema:()=>zo,calculateFeeAmount:()=>So,calculateTotalForMemberBooking:()=>Ao,getFeeOptionValidity:()=>Mo,getFilteredBookingAddonFees:()=>Uo,getFilteredBookingFees:()=>Do,getFilteredBookingRateFees:()=>jo,maxString:()=>mo,nameof:()=>Go,preprocessDate:()=>uo,preprocessNumber:()=>co,requireEmail:()=>po,requireFutureDate:()=>ho,requirePositiveAmount:()=>fo,requireString:()=>lo,resizeRoomstayImageUrl:()=>Bo,roundMoney:()=>Co,subset:()=>Lo,uppercaseString:()=>Vo,validateFormWithZod:()=>ao}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(n||(n={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(i||(i={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(o||(o={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard",e.Stripe="Stripe"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const a=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,g,v,_,y,P,z,b,k,w,E;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(g||(g={})),function(e){e.Metric="metric",e.Imperial="imperial"}(v||(v={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(_||(_={})),function(e){e.Hotel="hotel",e.HotelImages="hotelImages",e.Cancellation="cancellation",e.Room="room",e.Rates="rates",e.OneGuaranteePolicy="oneGuaranteePolicy",e.RoomRates="roomRates",e.RoomImages="roomImages",e.BookingSources="booking-sources",e.Areas="areas",e.Dwellings="dwellings",e.AreaDwellings="areaDwellings",e.ConvertDwellingConfigToAuxInput="convertDwellingConfigToAuxInput",e.Discounts="discounts",e.PropertyDiscounts="propertyDiscounts",e.RoomDiscounts="roomDiscounts",e.PropertySundries="propertySundries",e.PropertyFees="propertyFees",e.PropertyCards="property-cards",e.Countries="countries",e.Addons="addons",e.Requirements="requirements",e.RoomAddons="room-addons",e.ClientFacingPromoSync="clientFacingPromoSync",e.ClientFacingRoomSync="clientFacingRoomSync",e.ClientFacingRateSync="clientFacingRateSync",e.NewRateFetch="newRateFetch"}(y||(y={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(P||(P={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(z||(z={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(b||(b={}));class T{constructor(){this.ratePlanCode=void 0,this.name=void 0,this.description=void 0,this.inclusive=void 0,this.image=void 0,this.url=void 0,this.pricingType=void 0,this.quantity=void 0,this.category=void 0,this.cancelPenalty=void 0,this.guaranteeDescription=void 0,this.availability={}}}class I extends T{constructor(...e){super(...e),this.code=void 0,this.price=void 0,this.fees=void 0,this.itemisedFees=void 0,this.adultQuantity=void 0,this.childQuantity=void 0,this.adultPrice=void 0,this.childPrice=void 0,this.startDate=void 0,this.startTime=void 0,this.hideDatePicker=!1,this.order=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(k||(k={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(w||(w={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(E||(E={}));const N="DD/MM/YYYY";let A,R;!function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(A||(A={})),function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(R||(R={}));const $=[R.PER_NIGHT,R.PER_PERSON_PER_NIGHT,R.PER_QUANTITY_NAME_PER_NIGHT,R.PER_ROOM_QUANTITY_PER_NIGHT,R.PER_PERSON_OCCUPANCY_PER_NIGHT,R.PER_ADULT_OCCUPANCY_PER_NIGHT,R.PER_CHILD_OCCUPANCY_PER_NIGHT,R.PER_ALL_PERSONS_PER_NIGHT];function C(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function s(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Object.freeze({status:"aborted"}),Symbol("zod_brand");class S extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class O extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const x={};function Z(e){return e&&Object.assign(x,e),x}const F=/^[cC][^\s-]{8,}$/,D=/^[0-9a-z]+$/,j=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,U=/^[0-9a-vA-V]{20}$/,M=/^[A-Za-z0-9]{27}$/,G=/^[a-zA-Z0-9_-]{21}$/,L=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,B=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,H=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,V=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,q=/^(?:(?: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])$/,Y=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Q=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,W=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,J=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,K=/^[A-Za-z0-9_-]*$/,X=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ee=/^\+(?:[0-9]){6,14}[0-9]$/,te="(?:(?:\\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])))",ne=new RegExp(`^${te}$`);function ie(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const oe=/^\d+$/,re=/^-?\d+(?:\.\d+)?/i,se=/true|false/i,ae=/^[^A-Z]*$/,ce=/^[^a-z]*$/;function ue(e,t){return"bigint"==typeof t?t.toString():t}function de(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function le(e){return null==e}function pe(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const fe=Symbol("evaluating");function he(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==fe)return void 0===i&&(i=fe,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function me(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ge(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ve(e){return JSON.stringify(e)}const _e="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ye(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Pe=de((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function ze(e){if(!1===ye(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==ye(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function be(e){return ze(e)?{...e}:e}const ke=new Set(["string","number","symbol"]);function we(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ee(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Te(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}new Set(["string","number","bigint","boolean","symbol","undefined"]);const Ie={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ne(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Ae(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Re(e){return"string"==typeof e?e:e?.message}function $e(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Re(e.inst?._zod.def?.error?.(e))??Re(t?.error?.(e))??Re(n.customError?.(e))??Re(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Ce(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Se(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Oe=C("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),xe={number:"number",bigint:"bigint",object:"date"},Ze=C("$ZodCheckLessThan",((e,t)=>{Oe.init(e,t);const n=xe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Fe=C("$ZodCheckGreaterThan",((e,t)=>{Oe.init(e,t);const n=xe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),De=C("$ZodCheckMultipleOf",((e,t)=>{Oe.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(i)){const e=i.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),je=C("$ZodCheckNumberFormat",((e,t)=>{Oe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Ie[t.format];e._zod.onattach.push((e=>{const i=e._zod.bag;i.format=t.format,i.minimum=o,i.maximum=r,n&&(i.pattern=oe)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>r&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}})),Ue=C("$ZodCheckMaxLength",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!le(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const i=n.value;if(i.length<=t.maximum)return;const o=Ce(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Me=C("$ZodCheckMinLength",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!le(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const i=n.value;if(i.length>=t.minimum)return;const o=Ce(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Ge=C("$ZodCheckLengthEquals",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!le(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const i=n.value,o=i.length;if(o===t.length)return;const r=Ce(i),s=o>t.length;n.issues.push({origin:r,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Le=C("$ZodCheckStringFormat",((e,t)=>{var n,i;Oe.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})})),Be=C("$ZodCheckRegex",((e,t)=>{Le.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),He=C("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=ae),Le.init(e,t)})),Ve=C("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=ce),Le.init(e,t)})),qe=C("$ZodCheckIncludes",((e,t)=>{Oe.init(e,t);const n=we(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),Ye=C("$ZodCheckStartsWith",((e,t)=>{Oe.init(e,t);const n=new RegExp(`^${we(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),Qe=C("$ZodCheckEndsWith",((e,t)=>{Oe.init(e,t);const n=new RegExp(`.*${we(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),We=C("$ZodCheckOverwrite",((e,t)=>{Oe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Je{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),i=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of i)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Ke=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ue,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xe=C("$ZodError",Ke),et=C("$ZodError",Ke,{Parent:Error}),tt=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new S;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>$e(e,r,Z()))));throw _e(t,o?.callee),t}return s.value},nt=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>$e(e,r,Z()))));throw _e(t,o?.callee),t}return s.value},it=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},o);if(r instanceof Promise)throw new S;return r.issues.length?{success:!1,error:new(e??Xe)(r.issues.map((e=>$e(e,o,Z()))))}:{success:!0,data:r.value}},ot=it(et),rt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map((e=>$e(e,o,Z()))))}:{success:!0,data:r.value}},st=rt(et),at=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return tt(e)(t,n,o)},ct=e=>(t,n,i)=>tt(e)(t,n,i),ut=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},dt=e=>async(t,n,i)=>nt(e)(t,n,i),lt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return it(e)(t,n,o)},pt=e=>(t,n,i)=>it(e)(t,n,i),ft=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return rt(e)(t,n,o)},ht=e=>async(t,n,i)=>rt(e)(t,n,i),mt={major:4,minor:1,patch:5},gt=C("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=mt;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=Ne(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=r._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new S;if(i||s instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await s,e.issues.length!==t&&(o||(o=Ne(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ne(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ne(n))return n.aborted=!0,n;const s=t(o,i,r);if(s instanceof Promise){if(!1===r.async)throw new S;return s.then((t=>e._zod.parse(t,r)))}return e._zod.parse(s,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const s=e._zod.parse(o,r);if(s instanceof Promise){if(!1===r.async)throw new S;return s.then((e=>t(e,i,r)))}return t(s,i,r)}}e["~standard"]={validate:t=>{try{const n=ot(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return st(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),vt=C("$ZodString",((e,t)=>{var n;gt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),_t=C("$ZodStringFormat",((e,t)=>{Le.init(e,t),vt.init(e,t)})),yt=C("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=B),_t.init(e,t)})),Pt=C("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=H(e))}else t.pattern??(t.pattern=H());_t.init(e,t)})),zt=C("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=V),_t.init(e,t)})),bt=C("$ZodURL",((e,t)=>{_t.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:X.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=i)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),kt=C("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),_t.init(e,t)})),wt=C("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=G),_t.init(e,t)})),Et=C("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=F),_t.init(e,t)})),Tt=C("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=D),_t.init(e,t)})),It=C("$ZodULID",((e,t)=>{t.pattern??(t.pattern=j),_t.init(e,t)})),Nt=C("$ZodXID",((e,t)=>{t.pattern??(t.pattern=U),_t.init(e,t)})),At=C("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=M),_t.init(e,t)})),Rt=C("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ie({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${te}T(?:${i})$`)}(t)),_t.init(e,t)})),$t=C("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=ne),_t.init(e,t)})),Ct=C("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ie(t)}$`)),_t.init(e,t)})),St=C("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=L),_t.init(e,t)})),Ot=C("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=q),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),xt=C("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=Y),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv6"})),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}})),Zt=C("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=Q),_t.init(e,t)})),Ft=C("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=W),_t.init(e,t),e._zod.check=n=>{const[i,o]=n.value.split("/");try{if(!o)throw new Error;const e=Number(o);if(`${e}`!==o)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function Dt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const jt=C("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=J),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Dt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),Ut=C("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=K),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!K.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Dt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),Mt=C("$ZodE164",((e,t)=>{t.pattern??(t.pattern=ee),_t.init(e,t)})),Gt=C("$ZodJWT",((e,t)=>{_t.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),Lt=C("$ZodNumber",((e,t)=>{gt.init(e,t),e._zod.pattern=e._zod.bag.pattern??re,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const r="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...r?{received:r}:{}}),n}})),Bt=C("$ZodNumber",((e,t)=>{je.init(e,t),Lt.init(e,t)})),Ht=C("$ZodBoolean",((e,t)=>{gt.init(e,t),e._zod.pattern=se,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}})),Vt=C("$ZodUnknown",((e,t)=>{gt.init(e,t),e._zod.parse=e=>e})),qt=C("$ZodNever",((e,t)=>{gt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),Yt=C("$ZodDate",((e,t)=>{gt.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const o=n.value,r=o instanceof Date;return r&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...r?{received:"Invalid Date"}:{},inst:e}),n}}));function Qt(e,t,n){e.issues.length&&t.issues.push(...Ae(n,e.issues)),t.value[n]=e.value}const Wt=C("$ZodArray",((e,t)=>{gt.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},i);a instanceof Promise?r.push(a.then((t=>Qt(t,n,e)))):Qt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function Jt(e,t,n,i){e.issues.length&&t.issues.push(...Ae(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Kt(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape[n]._zod.traits.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(i=e.shape,Object.keys(i).filter((e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout)));var i;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Xt(e,t,n,i,o,r){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(a.has(o))continue;if("never"===u){s.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>Jt(e,n,o,t)))):Jt(r,n,o,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const en=C("$ZodObject",((e,t)=>{gt.init(e,t);const n=de((()=>Kt(t)));he(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const i=e[t]._zod;if(i.values){n[t]??(n[t]=new Set);for(const e of i.values)n[t].add(e)}}return n}));const i=ye,o=t.catchall;let r;e._zod.parse=(t,s)=>{r??(r=n.value);const a=t.value;if(!i(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:a[e],issues:[]},s);n instanceof Promise?c.push(n.then((n=>Jt(n,t,e,a)))):Jt(n,t,e,a)}return o?Xt(c,a,t,s,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),tn=C("$ZodObjectJIT",((e,t)=>{en.init(e,t);const n=e._zod.parse,i=de((()=>Kt(t)));let o;const r=ye,s=!x.jitless,a=s&&Pe.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?s&&a&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new Je(["shape","payload","ctx"]),n=i.value,o=e=>{const t=ve(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let s=0;for(const e of n.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=ve(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),d=o(d,l),c?Xt([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function nn(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!Ne(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>$e(e,i,Z())))))}),t)}const on=C("$ZodUnion",((e,t)=>{gt.init(e,t),he(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),he(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),he(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),he(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>pe(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>nn(t,o,e,r))):nn(a,o,e,r)}})),rn=C("$ZodIntersection",((e,t)=>{gt.init(e,t),e._zod.parse=(e,n)=>{const i=e.value,o=t.left._zod.run({value:i,issues:[]},n),r=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||r instanceof Promise?Promise.all([o,r]).then((([t,n])=>an(e,t,n))):an(e,o,r)}}));function sn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ze(e)&&ze(t)){const n=Object.keys(t),i=Object.keys(e).filter((e=>-1!==n.indexOf(e))),o={...e,...t};for(const n of i){const i=sn(e[n],t[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o[n]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const o=sn(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function an(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ne(e))return e;const i=sn(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const cn=C("$ZodEnum",((e,t)=>{gt.init(e,t);const n=function(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter((e=>ke.has(typeof e))).map((e=>"string"==typeof e?we(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const r=t.value;return i.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),un=C("$ZodTransform",((e,t)=>{gt.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new O(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then((e=>(n.value=e,n)));if(o instanceof Promise)throw new S;return n.value=o,n}}));function dn(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const ln=C("$ZodOptional",((e,t)=>{gt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",he(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),he(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${pe(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((t=>dn(t,e.value))):dn(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),pn=C("$ZodNullable",((e,t)=>{gt.init(e,t),he(e._zod,"optin",(()=>t.innerType._zod.optin)),he(e._zod,"optout",(()=>t.innerType._zod.optout)),he(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${pe(e.source)}|null)$`):void 0})),he(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),fn=C("$ZodDefault",((e,t)=>{gt.init(e,t),e._zod.optin="optional",he(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((e=>hn(e,t))):hn(i,t)}}));function hn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const mn=C("$ZodPrefault",((e,t)=>{gt.init(e,t),e._zod.optin="optional",he(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),gn=C("$ZodNonOptional",((e,t)=>{gt.init(e,t),he(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then((t=>vn(t,e))):vn(o,e)}}));function vn(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const _n=C("$ZodCatch",((e,t)=>{gt.init(e,t),he(e._zod,"optin",(()=>t.innerType._zod.optin)),he(e._zod,"optout",(()=>t.innerType._zod.optout)),he(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>$e(e,n,Z())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>$e(e,n,Z())))},input:e.value}),e.issues=[]),e)}})),yn=C("$ZodPipe",((e,t)=>{gt.init(e,t),he(e._zod,"values",(()=>t.in._zod.values)),he(e._zod,"optin",(()=>t.in._zod.optin)),he(e._zod,"optout",(()=>t.out._zod.optout)),he(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const i=t.out._zod.run(e,n);return i instanceof Promise?i.then((e=>Pn(e,t.in,n))):Pn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>Pn(e,t.out,n))):Pn(i,t.out,n)}}));function Pn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const zn=C("$ZodReadonly",((e,t)=>{gt.init(e,t),he(e._zod,"propValues",(()=>t.innerType._zod.propValues)),he(e._zod,"values",(()=>t.innerType._zod.values)),he(e._zod,"optin",(()=>t.innerType._zod.optin)),he(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(bn):bn(i)}}));function bn(e){return e.value=Object.freeze(e.value),e}const kn=C("$ZodCustom",((e,t)=>{Oe.init(e,t),gt.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then((t=>wn(t,n,i,e)));wn(o,n,i,e)}}));function wn(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push(Se(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class En{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Tn(){return new En}const In=Tn();function Nn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Te(t)})}function An(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Te(t)})}function Rn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Te(t)})}function $n(e,t){return new Ze({check:"less_than",...Te(t),value:e,inclusive:!1})}function Cn(e,t){return new Ze({check:"less_than",...Te(t),value:e,inclusive:!0})}function Sn(e,t){return new Fe({check:"greater_than",...Te(t),value:e,inclusive:!1})}function On(e,t){return new Fe({check:"greater_than",...Te(t),value:e,inclusive:!0})}function xn(e,t){return new De({check:"multiple_of",...Te(t),value:e})}function Zn(e,t){return new Ue({check:"max_length",...Te(t),maximum:e})}function Fn(e,t){return new Me({check:"min_length",...Te(t),minimum:e})}function Dn(e,t){return new Ge({check:"length_equals",...Te(t),length:e})}function jn(e){return new We({check:"overwrite",tx:e})}const Un=C("ZodISODateTime",((e,t)=>{Rt.init(e,t),ci.init(e,t)}));const Mn=C("ZodISODate",((e,t)=>{$t.init(e,t),ci.init(e,t)}));const Gn=C("ZodISOTime",((e,t)=>{Ct.init(e,t),ci.init(e,t)}));const Ln=C("ZodISODuration",((e,t)=>{St.init(e,t),ci.init(e,t)}));const Bn=(e,t)=>{Xe.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},i={_errors:[]},o=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>o({issues:e})));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)i._errors.push(n(t));else{let e=i,o=0;for(;o<t.path.length;){const i=t.path[o];o===t.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(n(t))):e[i]=e[i]||{_errors:[]},e=e[i],o++}}};return o(e),i}(e,t)},flatten:{value:t=>function(e,t=(e=>e.message)){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ue,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ue,2)}},isEmpty:{get:()=>0===e.issues.length}})},Hn=(C("ZodError",Bn),C("ZodError",Bn,{Parent:Error})),Vn=tt(Hn),qn=nt(Hn),Yn=it(Hn),Qn=rt(Hn),Wn=at(Hn),Jn=ct(Hn),Kn=ut(Hn),Xn=dt(Hn),ei=lt(Hn),ti=pt(Hn),ni=ft(Hn),ii=ht(Hn),oi=C("ZodType",((e,t)=>(gt.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>Ee(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Vn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Yn(e,t,n),e.parseAsync=async(t,n)=>qn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Qn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Wn(e,t,n),e.decode=(t,n)=>Jn(e,t,n),e.encodeAsync=async(t,n)=>Kn(e,t,n),e.decodeAsync=async(t,n)=>Xn(e,t,n),e.safeEncode=(t,n)=>ei(e,t,n),e.safeDecode=(t,n)=>ti(e,t,n),e.safeEncodeAsync=async(t,n)=>ni(e,t,n),e.safeDecodeAsync=async(t,n)=>ii(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Te(n)})}(ro,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new Oe({check:"custom",...Te(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Se(e,n.value,t._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Se(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(jn(t)),e.optional=()=>Qi(e),e.nullable=()=>Ji(e),e.nullish=()=>Qi(Ji(e)),e.nonoptional=t=>function(e,t){return new eo({type:"nonoptional",innerType:e,...Te(t)})}(e,t),e.array=()=>Ui(e),e.or=t=>function(e,t){return new Li({type:"union",options:e,...Te(t)})}([e,t]),e.and=t=>new Bi({type:"intersection",left:e,right:t}),e.transform=t=>io(e,qi(t)),e.default=t=>{return n=t,new Ki({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():be(n)}});var n},e.prefault=t=>{return n=t,new Xi({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():be(n)}});var n},e.catch=t=>{return new to({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>io(e,t),e.readonly=()=>new oo({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return In.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>In.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return In.get(e);const n=e.clone();return In.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),ri=C("_ZodString",((e,t)=>{vt.init(e,t),oi.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Be({check:"string_format",format:"regex",...Te(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new qe({check:"string_format",format:"includes",...Te(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Ye({check:"string_format",format:"starts_with",...Te(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Qe({check:"string_format",format:"ends_with",...Te(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Fn(...t)),e.max=(...t)=>e.check(Zn(...t)),e.length=(...t)=>e.check(Dn(...t)),e.nonempty=(...t)=>e.check(Fn(1,...t)),e.lowercase=t=>e.check(function(e){return new He({check:"string_format",format:"lowercase",...Te(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Ve({check:"string_format",format:"uppercase",...Te(e)})}(t)),e.trim=()=>e.check(jn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return jn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(jn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(jn((e=>e.toUpperCase())))})),si=C("ZodString",((e,t)=>{vt.init(e,t),ri.init(e,t),e.email=t=>e.check(Nn(ui,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Te(t)})}(fi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Te(t)})}(Ni,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Te(t)})}(hi,t)),e.guid=t=>e.check(An(li,t)),e.uuid=t=>e.check(Rn(pi,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Te(t)})}(pi,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Te(t)})}(pi,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Te(t)})}(pi,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Te(t)})}(mi,t)),e.guid=t=>e.check(An(li,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Te(t)})}(gi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Te(t)})}(vi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Te(t)})}(_i,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Te(t)})}(Ei,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Te(t)})}(Ti,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Te(t)})}(yi,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Te(t)})}(Pi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Te(t)})}(zi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Te(t)})}(bi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Te(t)})}(ki,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Te(t)})}(wi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Te(t)})}(Ii,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Te(t)})}(Un,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Te(t)})}(Mn,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Te(t)})}(Gn,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Te(t)})}(Ln,e)}(t))}));function ai(e){return function(e,t){return new e({type:"string",...Te(t)})}(si,e)}const ci=C("ZodStringFormat",((e,t)=>{_t.init(e,t),ri.init(e,t)})),ui=C("ZodEmail",((e,t)=>{zt.init(e,t),ci.init(e,t)}));function di(e){return Nn(ui,e)}const li=C("ZodGUID",((e,t)=>{yt.init(e,t),ci.init(e,t)})),pi=C("ZodUUID",((e,t)=>{Pt.init(e,t),ci.init(e,t)})),fi=C("ZodURL",((e,t)=>{bt.init(e,t),ci.init(e,t)})),hi=C("ZodEmoji",((e,t)=>{kt.init(e,t),ci.init(e,t)})),mi=C("ZodNanoID",((e,t)=>{wt.init(e,t),ci.init(e,t)})),gi=C("ZodCUID",((e,t)=>{Et.init(e,t),ci.init(e,t)})),vi=C("ZodCUID2",((e,t)=>{Tt.init(e,t),ci.init(e,t)})),_i=C("ZodULID",((e,t)=>{It.init(e,t),ci.init(e,t)})),yi=C("ZodXID",((e,t)=>{Nt.init(e,t),ci.init(e,t)})),Pi=C("ZodKSUID",((e,t)=>{At.init(e,t),ci.init(e,t)})),zi=C("ZodIPv4",((e,t)=>{Ot.init(e,t),ci.init(e,t)})),bi=C("ZodIPv6",((e,t)=>{xt.init(e,t),ci.init(e,t)})),ki=C("ZodCIDRv4",((e,t)=>{Zt.init(e,t),ci.init(e,t)})),wi=C("ZodCIDRv6",((e,t)=>{Ft.init(e,t),ci.init(e,t)})),Ei=C("ZodBase64",((e,t)=>{jt.init(e,t),ci.init(e,t)})),Ti=C("ZodBase64URL",((e,t)=>{Ut.init(e,t),ci.init(e,t)})),Ii=C("ZodE164",((e,t)=>{Mt.init(e,t),ci.init(e,t)})),Ni=C("ZodJWT",((e,t)=>{Gt.init(e,t),ci.init(e,t)})),Ai=C("ZodNumber",((e,t)=>{Lt.init(e,t),oi.init(e,t),e.gt=(t,n)=>e.check(Sn(t,n)),e.gte=(t,n)=>e.check(On(t,n)),e.min=(t,n)=>e.check(On(t,n)),e.lt=(t,n)=>e.check($n(t,n)),e.lte=(t,n)=>e.check(Cn(t,n)),e.max=(t,n)=>e.check(Cn(t,n)),e.int=t=>e.check(Ci(t)),e.safe=t=>e.check(Ci(t)),e.positive=t=>e.check(Sn(0,t)),e.nonnegative=t=>e.check(On(0,t)),e.negative=t=>e.check($n(0,t)),e.nonpositive=t=>e.check(Cn(0,t)),e.multipleOf=(t,n)=>e.check(xn(t,n)),e.step=(t,n)=>e.check(xn(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Ri(e){return function(e,t){return new e({type:"number",checks:[],...Te(t)})}(Ai,e)}const $i=C("ZodNumberFormat",((e,t)=>{Bt.init(e,t),Ai.init(e,t)}));function Ci(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Te(t)})}($i,e)}const Si=C("ZodBoolean",((e,t)=>{Ht.init(e,t),oi.init(e,t)}));const Oi=C("ZodUnknown",((e,t)=>{Vt.init(e,t),oi.init(e,t)}));function xi(){return new Oi({type:"unknown"})}const Zi=C("ZodNever",((e,t)=>{qt.init(e,t),oi.init(e,t)}));function Fi(e){return function(e,t){return new e({type:"never",...Te(t)})}(Zi,e)}const Di=C("ZodDate",((e,t)=>{Yt.init(e,t),oi.init(e,t),e.min=(t,n)=>e.check(On(t,n)),e.max=(t,n)=>e.check(Cn(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}));const ji=C("ZodArray",((e,t)=>{Wt.init(e,t),oi.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Fn(t,n)),e.nonempty=t=>e.check(Fn(1,t)),e.max=(t,n)=>e.check(Zn(t,n)),e.length=(t,n)=>e.check(Dn(t,n)),e.unwrap=()=>e.element}));function Ui(e,t){return function(e,t,n){return new e({type:"array",element:t,...Te(n)})}(ji,e,t)}const Mi=C("ZodObject",((e,t)=>{tn.init(e,t),oi.init(e,t),he(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Hi({type:"enum",entries:n,...Te(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:xi()}),e.loose=()=>e.clone({...e._zod.def,catchall:xi()}),e.strict=()=>e.clone({...e._zod.def,catchall:Fi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!ze(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=ge(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return me(this,"shape",n),n},checks:[]});return Ee(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!ze(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return me(this,"shape",n),n},checks:e._zod.def.checks};return Ee(e,n)}(e,t),e.merge=t=>function(e,t){const n=ge(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return me(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Ee(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Ee(e,ge(e._zod.def,{get shape(){const e={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(e[i]=n.shape[i])}return me(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=ge(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return me(this,"shape",i),i},checks:[]});return Ee(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=ge(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(const t in i)o[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return me(this,"shape",o),o},checks:[]});return Ee(t,i)}(Yi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=ge(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:i[t]}))}else for(const t in i)o[t]=new e({type:"nonoptional",innerType:i[t]});return me(this,"shape",o),o},checks:[]});return Ee(t,i)}(eo,e,t[0])}));function Gi(e,t){const n={type:"object",get shape(){var t;return me(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...Te(t)};return new Mi(n)}const Li=C("ZodUnion",((e,t)=>{on.init(e,t),oi.init(e,t),e.options=t.options}));const Bi=C("ZodIntersection",((e,t)=>{rn.init(e,t),oi.init(e,t)})),Hi=C("ZodEnum",((e,t)=>{cn.init(e,t),oi.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,i)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new Hi({...t,checks:[],...Te(i),entries:o})},e.exclude=(e,i)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Hi({...t,checks:[],...Te(i),entries:o})}}));const Vi=C("ZodTransform",((e,t)=>{un.init(e,t),oi.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new O(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(Se(i,n.value,t));else{const t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Se(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function qi(e){return new Vi({type:"transform",transform:e})}const Yi=C("ZodOptional",((e,t)=>{ln.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Qi(e){return new Yi({type:"optional",innerType:e})}const Wi=C("ZodNullable",((e,t)=>{pn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Ji(e){return new Wi({type:"nullable",innerType:e})}const Ki=C("ZodDefault",((e,t)=>{fn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Xi=C("ZodPrefault",((e,t)=>{mn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),eo=C("ZodNonOptional",((e,t)=>{gn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),to=C("ZodCatch",((e,t)=>{_n.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),no=C("ZodPipe",((e,t)=>{yn.init(e,t),oi.init(e,t),e.in=t.in,e.out=t.out}));function io(e,t){return new no({type:"pipe",in:e,out:t})}const oo=C("ZodReadonly",((e,t)=>{zn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),ro=C("ZodCustom",((e,t)=>{kn.init(e,t),oi.init(e,t)}));function so(e,t){return io(qi(e),t)}function ao(e,t,n){const i=t.safeParse(n);return i.success?i.data:(i.error.issues.forEach((t=>{const n=t.path.join(".");e.getFieldState(n)?e.setError(n,{type:"manual",message:t.message}):e.setError("root",{type:"manual",message:t.message})})),null)}const co=e=>so((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),uo=e=>so((e=>{if(!e)return;let t;return"string"==typeof e&&(t=new Date(e)),e instanceof Date&&(t=e),t?(t.setUTCHours(0,0,0,0),t):e}),e),lo=e=>ai().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),po=()=>di("Invalid email address").min(1,"Required"),fo=()=>co(Ri("Valid amount required").positive("Positive amount required")),ho=()=>uo(function(e){return function(e,t){return new e({type:"date",...Te(t)})}(Di,e)}("Valid date required").min(new Date,"Date must be in the future")),mo=e=>ai().max(e,`Maximum length is ${e} characters`),go=Gi({address1:lo(100),address2:mo(100).optional(),city:lo(50),state:mo(50).optional(),postcode:mo(20).optional(),country:lo(50)}),vo=Gi({amount:fo(),message:mo(500).nullish(),giverFirstName:lo(50),giverLastName:lo(50),giverEmail:po(),giverPhone:lo(31),giverAddress:go,cardHolder:lo(101),recipientFirstName:mo(50).nullish(),recipientLastName:mo(50).nullish(),recipientEmail:di("Invalid email address").nullish(),recipientPhone:mo(31).nullish()}),_o=vo.extend({expiry:ho(),notes:mo(500).nullish()}),yo=Gi({balance:fo(),expiry:ho(),message:mo(500).nullish(),notes:mo(500).nullish(),giverFirstName:lo(50),giverLastName:lo(50),giverEmail:po(),giverPhone:lo(31),cardHolder:lo(101),recipientEmail:di("Invalid email address").nullish(),recipientPhone:mo(31).nullish()}),Po=vo.extend({companyId:Ri().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...Te(t)})}(Si,e)}().default(!0),payment:Gi({cardHolder:lo(30),cardNumberToken:lo(50),cardExpiry:lo(5),cardCvcToken:lo(50)}).optional()}),zo=Gi({code:lo(10),password:lo(10)}),bo=zo.extend({amount:fo(),description:lo(200)});let ko;!function(e){e.Purchase="Purchase",e.Redemption="Redemption",e.Adjustment="Adjustment"}(ko||(ko={}));const wo=Gi({grant_type:ai().readonly().default("refresh_token"),client_id:Rn(pi,undefined),client_secret:ai(),refresh_token:ai(),scope:ai().optional()});const Eo=Gi({email:di(),firstName:ai().max(100).optional(),lastName:ai().max(100).optional(),phone:ai().max(20).optional(),scopes:Ui(ai()).optional()});let To,Io,No;!function(e){e.Critical="Critical",e.Error="Error",e.Warn="Warn",e.Info="Info"}(To||(To={})),function(e){e.Debug="Diagnostics",e.Security="Security",e.Audit="Audit"}(Io||(Io={})),function(e){e.General="General",e.Authenticated="Token Authenticated",e.Unauthorized="Unauthorized Access",e.RefreshToken="Refresh Token Created",e.AccessToken="Access Token Created",e.Revoked="Token Revoked",e.UserCreated="User Created",e.UserLinked="User Linked to Company",e.Purchase="Gift Card Purchased",e.Payment="Payment Captured",e.Email="Email Delivery",e.Transaction="Gift Card Transaction"}(No||(No={}));const Ao=e=>{let t=0;const n=Object.values(e.itinerary);for(const e of n){const n=Object.keys(e.nights);for(const i of n)t+=e.nights[i].total}return t},Ro=require("decimal.js");var $o=e.n(Ro);const Co=e=>new($o())(e).toDecimalPlaces(2).toNumber();function So(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=Co(n);switch(e.feeType){case A.PercentageOfBooking:if(o)return Co(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return Co(a/(1-t)*e.amount/(100+e.amount))}return Co(a*(e.amount/100));case A.FixedChargePerRoom:case A.FixedChargePerBooking:return e.amount;case A.NightlyChargePerRoom:return Co(e.amount*i);default:return 0}}const Oo=[A.FixedChargePerBooking],xo=[A.PercentageOfBooking,A.FixedChargePerRoom,A.NightlyChargePerRoom],Zo=[A.PercentageOfBooking];function Fo(e,t){return e.filter((e=>t.includes(e.feeType)))}function Do(e){return Fo(e,Oo)}function jo(e){return Fo(e,xo)}function Uo(e){return Fo(e,Zo)}function Mo(e){return{includeInRates:[A.PercentageOfBooking,A.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===A.PercentageOfBooking,appliesToAddons:e===A.PercentageOfBooking,includePreviousFeesInCalculation:e===A.PercentageOfBooking}}const Go=e=>e,Lo=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},Bo=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class Ho{}function Vo(e){return e.toUpperCase()}Ho.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===R.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===R.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(n*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(i=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(o=e.childQuantity*Number(e.childPrice));let r=n+i+o;return $.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},Ho.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Ho.calculateBaseAddonTotal(n,t);let o=0;return(n.fee||n.fees?.length)&&n.quantity?n.fees?.length?n.fees.forEach((e=>{o+=n.quantity*e.amount})):o=n.quantity*Number(n.fee):((n.adultFee||n.adultFees?.length)&&n.adultQuantity&&(n.adultFees?.length?n.adultFees.forEach((e=>{o+=n.adultQuantity*e.amount})):o+=n.adultQuantity??1*Number(n.adultFee)),(n.childFee||n.childFees?.length)&&n.childQuantity&&(n.childFees?.length?n.childFees.forEach((e=>{o+=n.childQuantity??1*e.amount})):o+=n.childQuantity*Number(n.childFee))),$.includes(n.pricingType)&&n.nights&&!t&&(o*=n.nights),{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),Ho.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Ho.calculateBaseAddonTotal(n,t);let o=n.fees||0;n.itemisedFees?.length&&(o=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=n.itemisedFees?.length?i.addonTotal:i.addonTotal+o;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),Ho.calculateTotalForReservation=(e,t=!1)=>{let n=0;return e.itemisedFees?.forEach((e=>{n+=e.amount})),e.reservations.forEach((e=>{n+=e.total.afterTax;const i=Object.keys(e.nights)?.length??0;if(n+=e.fees??0,e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=Ho.calculateReservationAddonTotal(o,t)?.total}})),Co(n)},module.exports=t})();
1
+ (()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};let n,i,o,r,a;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>Fo,AddGiftCardSchema:()=>vo,AdyenEventCode:()=>No,AdyenResultCode:()=>Ao,BaseGiftCardSchema:()=>go,CancelGiftCardTransactionSchema:()=>Oo,CompleteGiftCardTransactionSchema:()=>Co,CreatePaymentSessionSchema:()=>Po,DATE_FORMAT:()=>N,EAddonPricingType:()=>xo,EBookingFlow:()=>i,EBookingPaymentMethod:()=>o,EBookingStatus:()=>n,ECompanyProvider:()=>l,EDistanceUnitType:()=>v,EFeeType:()=>R,EGiftCardPaymentProvider:()=>Eo,EGiftCardPaymentStatus:()=>To,EGiftCardPaymentType:()=>yo,EGiftCardTransactionType:()=>Io,EGuaranteePolicyDepositMode:()=>k,EGuarantyPolicyPrepaymentType:()=>w,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,ELogCategory:()=>Do,ELogSeverity:()=>Zo,ELogType:()=>Uo,EPlanpayBookingStatus:()=>a,ERMSAuthSyncHistoryStatus:()=>P,ERMSDiscountType:()=>_,ERMSSyncStrategy:()=>y,ERoomstayEventSource:()=>E,ERoomstayImageSize:()=>z,ETransactionStatus:()=>Ro,EditGiftCardSchema:()=>_o,GuestProfile:()=>d,HttpMethod:()=>I,IAuxiliaryFilterType:()=>g,IMaintenanceStatusService:()=>b,InternationalAddressSchema:()=>mo,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>s,Package:()=>T,PurchaseGiftCardSchema:()=>zo,RedeemGiftCardSchema:()=>wo,RefreshGiftCardTokenSchema:()=>So,RefundGiftCardSchema:()=>bo,RegisterGiftCardAdminSchema:()=>$o,Reservation:()=>u,ReservedPackage:()=>A,RoundingType:()=>Go,TotalCalculator:()=>ir,ValidateGiftCardSchema:()=>ko,calculateFeeAmount:()=>Bo,calculateTotalForMemberBooking:()=>jo,getFeeOptionValidity:()=>Xo,getFilteredBookingAddonFees:()=>Ko,getFilteredBookingFees:()=>Qo,getFilteredBookingRateFees:()=>Jo,maxString:()=>ho,nameof:()=>er,preprocessDate:()=>co,preprocessNumber:()=>so,requireEmail:()=>lo,requireFutureDate:()=>fo,requirePositiveAmount:()=>po,requireString:()=>uo,resizeRoomstayImageUrl:()=>nr,roundMoney:()=>Ho,subset:()=>tr,uppercaseString:()=>or,validateFormWithZod:()=>ao}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(n||(n={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(i||(i={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(o||(o={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard",e.Stripe="Stripe"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(a||(a={}));const s=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,g,v,_,y,P,z,b,k,w,E;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(g||(g={})),function(e){e.Metric="metric",e.Imperial="imperial"}(v||(v={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(_||(_={})),function(e){e.Hotel="hotel",e.HotelImages="hotelImages",e.Cancellation="cancellation",e.Room="room",e.Rates="rates",e.OneGuaranteePolicy="oneGuaranteePolicy",e.RoomRates="roomRates",e.RoomImages="roomImages",e.BookingSources="booking-sources",e.Areas="areas",e.Dwellings="dwellings",e.AreaDwellings="areaDwellings",e.ConvertDwellingConfigToAuxInput="convertDwellingConfigToAuxInput",e.Discounts="discounts",e.PropertyDiscounts="propertyDiscounts",e.RoomDiscounts="roomDiscounts",e.PropertySundries="propertySundries",e.PropertyFees="propertyFees",e.PropertyCards="property-cards",e.Countries="countries",e.Addons="addons",e.Requirements="requirements",e.RoomAddons="room-addons",e.ClientFacingPromoSync="clientFacingPromoSync",e.ClientFacingRoomSync="clientFacingRoomSync",e.ClientFacingRateSync="clientFacingRateSync",e.NewRateFetch="newRateFetch"}(y||(y={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(P||(P={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(z||(z={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(b||(b={}));class T{constructor(){this.ratePlanCode=void 0,this.name=void 0,this.description=void 0,this.inclusive=void 0,this.image=void 0,this.url=void 0,this.pricingType=void 0,this.quantity=void 0,this.category=void 0,this.cancelPenalty=void 0,this.guaranteeDescription=void 0,this.availability={}}}class A extends T{constructor(...e){super(...e),this.code=void 0,this.price=void 0,this.fees=void 0,this.itemisedFees=void 0,this.adultQuantity=void 0,this.childQuantity=void 0,this.adultPrice=void 0,this.childPrice=void 0,this.startDate=void 0,this.startTime=void 0,this.hideDatePicker=!1,this.order=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(k||(k={})),function(e){e.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(w||(w={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(E||(E={}));const N="DD/MM/YYYY";let I,R;function C(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in a.prototype)e in n||Object.defineProperty(n,e,{value:a.prototype[e].bind(n)});n._zod.constr=a,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function a(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(I||(I={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(R||(R={})),Object.freeze({status:"aborted"}),Symbol("zod_brand");class O extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class S extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const $={};function x(e){return e&&Object.assign($,e),$}const F=/^[cC][^\s-]{8,}$/,Z=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,U=/^[0-9a-vA-V]{20}$/,j=/^[A-Za-z0-9]{27}$/,L=/^[a-zA-Z0-9_-]{21}$/,M=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,G=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,H=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,B=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,V=/^(?:(?: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])$/,q=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Y=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,W=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Q=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,J=/^[A-Za-z0-9_-]*$/,K=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,X=/^\+(?:[0-9]){6,14}[0-9]$/,ee="(?:(?:\\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])))",te=new RegExp(`^${ee}$`);function ne(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const ie=/^\d+$/,oe=/^-?\d+(?:\.\d+)?/i,re=/true|false/i,ae=/^[^A-Z]*$/,se=/^[^a-z]*$/;function ce(e,t){return"bigint"==typeof t?t.toString():t}function ue(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function de(e){return null==e}function le(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const pe=Symbol("evaluating");function fe(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==pe)return void 0===i&&(i=pe,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function he(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function me(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ge(e){return JSON.stringify(e)}const ve="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _e(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ye=ue((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function Pe(e){if(!1===_e(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==_e(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ze(e){return Pe(e)?{...e}:e}const be=new Set(["string","number","symbol"]);function ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function we(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Ee(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}new Set(["string","number","bigint","boolean","symbol","undefined"]);const Te={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ae(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Ne(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Ie(e){return"string"==typeof e?e:e?.message}function Re(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Ie(e.inst?._zod.def?.error?.(e))??Ie(t?.error?.(e))??Ie(n.customError?.(e))??Ie(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Ce(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Oe(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Se=C("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),$e={number:"number",bigint:"bigint",object:"date"},xe=C("$ZodCheckLessThan",((e,t)=>{Se.init(e,t);const n=$e[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Fe=C("$ZodCheckGreaterThan",((e,t)=>{Se.init(e,t);const n=$e[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Ze=C("$ZodCheckMultipleOf",((e,t)=>{Se.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(i)){const e=i.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),De=C("$ZodCheckNumberFormat",((e,t)=>{Se.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Te[t.format];e._zod.onattach.push((e=>{const i=e._zod.bag;i.format=t.format,i.minimum=o,i.maximum=r,n&&(i.pattern=ie)})),e._zod.check=a=>{const s=a.value;if(n){if(!Number.isInteger(s))return void a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}s<o&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>r&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:r,inst:e})}})),Ue=C("$ZodCheckMaxLength",((e,t)=>{var n;Se.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const i=n.value;if(i.length<=t.maximum)return;const o=Ce(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),je=C("$ZodCheckMinLength",((e,t)=>{var n;Se.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const i=n.value;if(i.length>=t.minimum)return;const o=Ce(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Le=C("$ZodCheckLengthEquals",((e,t)=>{var n;Se.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const i=n.value,o=i.length;if(o===t.length)return;const r=Ce(i),a=o>t.length;n.issues.push({origin:r,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Me=C("$ZodCheckStringFormat",((e,t)=>{var n,i;Se.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})})),Ge=C("$ZodCheckRegex",((e,t)=>{Me.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),He=C("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=ae),Me.init(e,t)})),Be=C("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=se),Me.init(e,t)})),Ve=C("$ZodCheckIncludes",((e,t)=>{Se.init(e,t);const n=ke(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),qe=C("$ZodCheckStartsWith",((e,t)=>{Se.init(e,t);const n=new RegExp(`^${ke(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),Ye=C("$ZodCheckEndsWith",((e,t)=>{Se.init(e,t);const n=new RegExp(`.*${ke(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),We=C("$ZodCheckOverwrite",((e,t)=>{Se.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Qe{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),i=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of i)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Je=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ce,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ke=C("$ZodError",Je),Xe=C("$ZodError",Je,{Parent:Error}),et=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},r);if(a instanceof Promise)throw new O;if(a.issues.length){const t=new(o?.Err??e)(a.issues.map((e=>Re(e,r,x()))));throw ve(t,o?.callee),t}return a.value},tt=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},r);if(a instanceof Promise&&(a=await a),a.issues.length){const t=new(o?.Err??e)(a.issues.map((e=>Re(e,r,x()))));throw ve(t,o?.callee),t}return a.value},nt=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},o);if(r instanceof Promise)throw new O;return r.issues.length?{success:!1,error:new(e??Ke)(r.issues.map((e=>Re(e,o,x()))))}:{success:!0,data:r.value}},it=nt(Xe),ot=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map((e=>Re(e,o,x()))))}:{success:!0,data:r.value}},rt=ot(Xe),at=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return et(e)(t,n,o)},st=e=>(t,n,i)=>et(e)(t,n,i),ct=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return tt(e)(t,n,o)},ut=e=>async(t,n,i)=>tt(e)(t,n,i),dt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},lt=e=>(t,n,i)=>nt(e)(t,n,i),pt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ot(e)(t,n,o)},ft=e=>async(t,n,i)=>ot(e)(t,n,i),ht={major:4,minor:1,patch:5},mt=C("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ht;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=Ae(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,a=r._zod.check(e);if(a instanceof Promise&&!1===n?.async)throw new O;if(i||a instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await a,e.issues.length!==t&&(o||(o=Ae(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ae(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ae(n))return n.aborted=!0,n;const a=t(o,i,r);if(a instanceof Promise){if(!1===r.async)throw new O;return a.then((t=>e._zod.parse(t,r)))}return e._zod.parse(a,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const a=e._zod.parse(o,r);if(a instanceof Promise){if(!1===r.async)throw new O;return a.then((e=>t(e,i,r)))}return t(a,i,r)}}e["~standard"]={validate:t=>{try{const n=it(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return rt(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),gt=C("$ZodString",((e,t)=>{var n;mt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),vt=C("$ZodStringFormat",((e,t)=>{Me.init(e,t),gt.init(e,t)})),_t=C("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=G),vt.init(e,t)})),yt=C("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=H(e))}else t.pattern??(t.pattern=H());vt.init(e,t)})),Pt=C("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=B),vt.init(e,t)})),zt=C("$ZodURL",((e,t)=>{vt.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:K.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=i)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),bt=C("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),vt.init(e,t)})),kt=C("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=L),vt.init(e,t)})),wt=C("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=F),vt.init(e,t)})),Et=C("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=Z),vt.init(e,t)})),Tt=C("$ZodULID",((e,t)=>{t.pattern??(t.pattern=D),vt.init(e,t)})),At=C("$ZodXID",((e,t)=>{t.pattern??(t.pattern=U),vt.init(e,t)})),Nt=C("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=j),vt.init(e,t)})),It=C("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ne({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${ee}T(?:${i})$`)}(t)),vt.init(e,t)})),Rt=C("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=te),vt.init(e,t)})),Ct=C("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ne(t)}$`)),vt.init(e,t)})),Ot=C("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=M),vt.init(e,t)})),St=C("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=V),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),$t=C("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=q),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv6"})),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}})),xt=C("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=Y),vt.init(e,t)})),Ft=C("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=W),vt.init(e,t),e._zod.check=n=>{const[i,o]=n.value.split("/");try{if(!o)throw new Error;const e=Number(o);if(`${e}`!==o)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function Zt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Dt=C("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=Q),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Zt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),Ut=C("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=J),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!J.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Zt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),jt=C("$ZodE164",((e,t)=>{t.pattern??(t.pattern=X),vt.init(e,t)})),Lt=C("$ZodJWT",((e,t)=>{vt.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),Mt=C("$ZodNumber",((e,t)=>{mt.init(e,t),e._zod.pattern=e._zod.bag.pattern??oe,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const r="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...r?{received:r}:{}}),n}})),Gt=C("$ZodNumber",((e,t)=>{De.init(e,t),Mt.init(e,t)})),Ht=C("$ZodBoolean",((e,t)=>{mt.init(e,t),e._zod.pattern=re,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}})),Bt=C("$ZodUnknown",((e,t)=>{mt.init(e,t),e._zod.parse=e=>e})),Vt=C("$ZodNever",((e,t)=>{mt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),qt=C("$ZodDate",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const o=n.value,r=o instanceof Date;return r&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...r?{received:"Invalid Date"}:{},inst:e}),n}}));function Yt(e,t,n){e.issues.length&&t.issues.push(...Ne(n,e.issues)),t.value[n]=e.value}const Wt=C("$ZodArray",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const a=o[e],s=t.element._zod.run({value:a,issues:[]},i);s instanceof Promise?r.push(s.then((t=>Yt(t,n,e)))):Yt(s,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function Qt(e,t,n,i){e.issues.length&&t.issues.push(...Ne(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Jt(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape[n]._zod.traits.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(i=e.shape,Object.keys(i).filter((e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout)));var i;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Kt(e,t,n,i,o,r){const a=[],s=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(s.has(o))continue;if("never"===u){a.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>Qt(e,n,o,t)))):Qt(r,n,o,t)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const Xt=C("$ZodObject",((e,t)=>{mt.init(e,t);const n=ue((()=>Jt(t)));fe(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const i=e[t]._zod;if(i.values){n[t]??(n[t]=new Set);for(const e of i.values)n[t].add(e)}}return n}));const i=_e,o=t.catchall;let r;e._zod.parse=(t,a)=>{r??(r=n.value);const s=t.value;if(!i(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:s[e],issues:[]},a);n instanceof Promise?c.push(n.then((n=>Qt(n,t,e,s)))):Qt(n,t,e,s)}return o?Kt(c,s,t,a,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),en=C("$ZodObjectJIT",((e,t)=>{Xt.init(e,t);const n=e._zod.parse,i=ue((()=>Jt(t)));let o;const r=_e,a=!$.jitless,s=a&&ye.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?a&&s&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new Qe(["shape","payload","ctx"]),n=i.value,o=e=>{const t=ge(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let a=0;for(const e of n.keys)r[e]="key_"+a++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=ge(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n `)}t.write("payload.value = newResult;"),t.write("return payload;");const s=t.compile();return(t,n)=>s(e,t,n)})(t.shape)),d=o(d,l),c?Kt([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function tn(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!Ae(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>Re(e,i,x())))))}),t)}const nn=C("$ZodUnion",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),fe(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),fe(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),fe(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>le(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let a=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)s.push(t),a=!0;else{if(0===t.issues.length)return t;s.push(t)}}return a?Promise.all(s).then((t=>tn(t,o,e,r))):tn(s,o,e,r)}})),on=C("$ZodIntersection",((e,t)=>{mt.init(e,t),e._zod.parse=(e,n)=>{const i=e.value,o=t.left._zod.run({value:i,issues:[]},n),r=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||r instanceof Promise?Promise.all([o,r]).then((([t,n])=>an(e,t,n))):an(e,o,r)}}));function rn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Pe(e)&&Pe(t)){const n=Object.keys(t),i=Object.keys(e).filter((e=>-1!==n.indexOf(e))),o={...e,...t};for(const n of i){const i=rn(e[n],t[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o[n]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const o=rn(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function an(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ae(e))return e;const i=rn(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const sn=C("$ZodEnum",((e,t)=>{mt.init(e,t);const n=function(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter((e=>be.has(typeof e))).map((e=>"string"==typeof e?ke(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const r=t.value;return i.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),cn=C("$ZodTransform",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new S(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then((e=>(n.value=e,n)));if(o instanceof Promise)throw new O;return n.value=o,n}}));function un(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const dn=C("$ZodOptional",((e,t)=>{mt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",fe(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((t=>un(t,e.value))):un(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),ln=C("$ZodNullable",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(e.source)}|null)$`):void 0})),fe(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),pn=C("$ZodDefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((e=>fn(e,t))):fn(i,t)}}));function fn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const hn=C("$ZodPrefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),mn=C("$ZodNonOptional",((e,t)=>{mt.init(e,t),fe(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then((t=>gn(t,e))):gn(o,e)}}));function gn(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const vn=C("$ZodCatch",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Re(e,n,x())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Re(e,n,x())))},input:e.value}),e.issues=[]),e)}})),_n=C("$ZodPipe",((e,t)=>{mt.init(e,t),fe(e._zod,"values",(()=>t.in._zod.values)),fe(e._zod,"optin",(()=>t.in._zod.optin)),fe(e._zod,"optout",(()=>t.out._zod.optout)),fe(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const i=t.out._zod.run(e,n);return i instanceof Promise?i.then((e=>yn(e,t.in,n))):yn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>yn(e,t.out,n))):yn(i,t.out,n)}}));function yn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Pn=C("$ZodReadonly",((e,t)=>{mt.init(e,t),fe(e._zod,"propValues",(()=>t.innerType._zod.propValues)),fe(e._zod,"values",(()=>t.innerType._zod.values)),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(zn):zn(i)}}));function zn(e){return e.value=Object.freeze(e.value),e}const bn=C("$ZodCustom",((e,t)=>{Se.init(e,t),mt.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then((t=>kn(t,n,i,e)));kn(o,n,i,e)}}));function kn(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push(Oe(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class wn{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function En(){return new wn}const Tn=En();function An(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ee(t)})}function Nn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(t)})}function In(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(t)})}function Rn(e,t){return new xe({check:"less_than",...Ee(t),value:e,inclusive:!1})}function Cn(e,t){return new xe({check:"less_than",...Ee(t),value:e,inclusive:!0})}function On(e,t){return new Fe({check:"greater_than",...Ee(t),value:e,inclusive:!1})}function Sn(e,t){return new Fe({check:"greater_than",...Ee(t),value:e,inclusive:!0})}function $n(e,t){return new Ze({check:"multiple_of",...Ee(t),value:e})}function xn(e,t){return new Ue({check:"max_length",...Ee(t),maximum:e})}function Fn(e,t){return new je({check:"min_length",...Ee(t),minimum:e})}function Zn(e,t){return new Le({check:"length_equals",...Ee(t),length:e})}function Dn(e){return new We({check:"overwrite",tx:e})}const Un=C("ZodISODateTime",((e,t)=>{It.init(e,t),si.init(e,t)}));const jn=C("ZodISODate",((e,t)=>{Rt.init(e,t),si.init(e,t)}));const Ln=C("ZodISOTime",((e,t)=>{Ct.init(e,t),si.init(e,t)}));const Mn=C("ZodISODuration",((e,t)=>{Ot.init(e,t),si.init(e,t)}));const Gn=(e,t)=>{Ke.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},i={_errors:[]},o=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>o({issues:e})));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)i._errors.push(n(t));else{let e=i,o=0;for(;o<t.path.length;){const i=t.path[o];o===t.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(n(t))):e[i]=e[i]||{_errors:[]},e=e[i],o++}}};return o(e),i}(e,t)},flatten:{value:t=>function(e,t=(e=>e.message)){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ce,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ce,2)}},isEmpty:{get:()=>0===e.issues.length}})},Hn=(C("ZodError",Gn),C("ZodError",Gn,{Parent:Error})),Bn=et(Hn),Vn=tt(Hn),qn=nt(Hn),Yn=ot(Hn),Wn=at(Hn),Qn=st(Hn),Jn=ct(Hn),Kn=ut(Hn),Xn=dt(Hn),ei=lt(Hn),ti=pt(Hn),ni=ft(Hn),ii=C("ZodType",((e,t)=>(mt.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>we(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Bn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>qn(e,t,n),e.parseAsync=async(t,n)=>Vn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Yn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Wn(e,t,n),e.decode=(t,n)=>Qn(e,t,n),e.encodeAsync=async(t,n)=>Jn(e,t,n),e.decodeAsync=async(t,n)=>Kn(e,t,n),e.safeEncode=(t,n)=>Xn(e,t,n),e.safeDecode=(t,n)=>ei(e,t,n),e.safeEncodeAsync=async(t,n)=>ti(e,t,n),e.safeDecodeAsync=async(t,n)=>ni(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ee(n)})}(oo,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new Se({check:"custom",...Ee(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Oe(e,n.value,t._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Oe(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Dn(t)),e.optional=()=>Yi(e),e.nullable=()=>Qi(e),e.nullish=()=>Yi(Qi(e)),e.nonoptional=t=>function(e,t){return new Xi({type:"nonoptional",innerType:e,...Ee(t)})}(e,t),e.array=()=>Ui(e),e.or=t=>function(e,t){return new Mi({type:"union",options:e,...Ee(t)})}([e,t]),e.and=t=>new Gi({type:"intersection",left:e,right:t}),e.transform=t=>no(e,Vi(t)),e.default=t=>{return n=t,new Ji({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.prefault=t=>{return n=t,new Ki({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.catch=t=>{return new eo({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>no(e,t),e.readonly=()=>new io({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Tn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Tn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Tn.get(e);const n=e.clone();return Tn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),oi=C("_ZodString",((e,t)=>{gt.init(e,t),ii.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Ge({check:"string_format",format:"regex",...Ee(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ve({check:"string_format",format:"includes",...Ee(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new qe({check:"string_format",format:"starts_with",...Ee(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Ye({check:"string_format",format:"ends_with",...Ee(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Fn(...t)),e.max=(...t)=>e.check(xn(...t)),e.length=(...t)=>e.check(Zn(...t)),e.nonempty=(...t)=>e.check(Fn(1,...t)),e.lowercase=t=>e.check(function(e){return new He({check:"string_format",format:"lowercase",...Ee(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Be({check:"string_format",format:"uppercase",...Ee(e)})}(t)),e.trim=()=>e.check(Dn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return Dn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(Dn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(Dn((e=>e.toUpperCase())))})),ri=C("ZodString",((e,t)=>{gt.init(e,t),oi.init(e,t),e.email=t=>e.check(An(ci,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ee(t)})}(pi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(t)})}(Ai,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(t)})}(fi,t)),e.guid=t=>e.check(Nn(di,t)),e.uuid=t=>e.check(In(li,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(t)})}(li,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(t)})}(li,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(t)})}(li,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(t)})}(hi,t)),e.guid=t=>e.check(Nn(di,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(t)})}(mi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(t)})}(gi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(t)})}(vi,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(t)})}(wi,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(t)})}(Ei,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(t)})}(_i,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(t)})}(yi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(t)})}(Pi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(t)})}(zi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(t)})}(bi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(t)})}(ki,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(t)})}(Ti,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ee(t)})}(Un,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Ee(t)})}(jn,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ee(t)})}(Ln,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ee(t)})}(Mn,e)}(t))}));function ai(e){return function(e,t){return new e({type:"string",...Ee(t)})}(ri,e)}const si=C("ZodStringFormat",((e,t)=>{vt.init(e,t),oi.init(e,t)})),ci=C("ZodEmail",((e,t)=>{Pt.init(e,t),si.init(e,t)}));function ui(e){return An(ci,e)}const di=C("ZodGUID",((e,t)=>{_t.init(e,t),si.init(e,t)})),li=C("ZodUUID",((e,t)=>{yt.init(e,t),si.init(e,t)})),pi=C("ZodURL",((e,t)=>{zt.init(e,t),si.init(e,t)})),fi=C("ZodEmoji",((e,t)=>{bt.init(e,t),si.init(e,t)})),hi=C("ZodNanoID",((e,t)=>{kt.init(e,t),si.init(e,t)})),mi=C("ZodCUID",((e,t)=>{wt.init(e,t),si.init(e,t)})),gi=C("ZodCUID2",((e,t)=>{Et.init(e,t),si.init(e,t)})),vi=C("ZodULID",((e,t)=>{Tt.init(e,t),si.init(e,t)})),_i=C("ZodXID",((e,t)=>{At.init(e,t),si.init(e,t)})),yi=C("ZodKSUID",((e,t)=>{Nt.init(e,t),si.init(e,t)})),Pi=C("ZodIPv4",((e,t)=>{St.init(e,t),si.init(e,t)})),zi=C("ZodIPv6",((e,t)=>{$t.init(e,t),si.init(e,t)})),bi=C("ZodCIDRv4",((e,t)=>{xt.init(e,t),si.init(e,t)})),ki=C("ZodCIDRv6",((e,t)=>{Ft.init(e,t),si.init(e,t)})),wi=C("ZodBase64",((e,t)=>{Dt.init(e,t),si.init(e,t)})),Ei=C("ZodBase64URL",((e,t)=>{Ut.init(e,t),si.init(e,t)})),Ti=C("ZodE164",((e,t)=>{jt.init(e,t),si.init(e,t)})),Ai=C("ZodJWT",((e,t)=>{Lt.init(e,t),si.init(e,t)})),Ni=C("ZodNumber",((e,t)=>{Mt.init(e,t),ii.init(e,t),e.gt=(t,n)=>e.check(On(t,n)),e.gte=(t,n)=>e.check(Sn(t,n)),e.min=(t,n)=>e.check(Sn(t,n)),e.lt=(t,n)=>e.check(Rn(t,n)),e.lte=(t,n)=>e.check(Cn(t,n)),e.max=(t,n)=>e.check(Cn(t,n)),e.int=t=>e.check(Ci(t)),e.safe=t=>e.check(Ci(t)),e.positive=t=>e.check(On(0,t)),e.nonnegative=t=>e.check(Sn(0,t)),e.negative=t=>e.check(Rn(0,t)),e.nonpositive=t=>e.check(Cn(0,t)),e.multipleOf=(t,n)=>e.check($n(t,n)),e.step=(t,n)=>e.check($n(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Ii(e){return function(e,t){return new e({type:"number",checks:[],...Ee(t)})}(Ni,e)}const Ri=C("ZodNumberFormat",((e,t)=>{Gt.init(e,t),Ni.init(e,t)}));function Ci(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ee(t)})}(Ri,e)}const Oi=C("ZodBoolean",((e,t)=>{Ht.init(e,t),ii.init(e,t)}));const Si=C("ZodUnknown",((e,t)=>{Bt.init(e,t),ii.init(e,t)}));function $i(){return new Si({type:"unknown"})}const xi=C("ZodNever",((e,t)=>{Vt.init(e,t),ii.init(e,t)}));function Fi(e){return function(e,t){return new e({type:"never",...Ee(t)})}(xi,e)}const Zi=C("ZodDate",((e,t)=>{qt.init(e,t),ii.init(e,t),e.min=(t,n)=>e.check(Sn(t,n)),e.max=(t,n)=>e.check(Cn(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}));const Di=C("ZodArray",((e,t)=>{Wt.init(e,t),ii.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Fn(t,n)),e.nonempty=t=>e.check(Fn(1,t)),e.max=(t,n)=>e.check(xn(t,n)),e.length=(t,n)=>e.check(Zn(t,n)),e.unwrap=()=>e.element}));function Ui(e,t){return function(e,t,n){return new e({type:"array",element:t,...Ee(n)})}(Di,e,t)}const ji=C("ZodObject",((e,t)=>{en.init(e,t),ii.init(e,t),fe(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Hi({type:"enum",entries:n,...Ee(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:$i()}),e.loose=()=>e.clone({...e._zod.def,catchall:$i()}),e.strict=()=>e.clone({...e._zod.def,catchall:Fi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Pe(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return he(this,"shape",n),n},checks:[]});return we(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!Pe(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return he(this,"shape",n),n},checks:e._zod.def.checks};return we(e,n)}(e,t),e.merge=t=>function(e,t){const n=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return he(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return we(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return we(e,me(e._zod.def,{get shape(){const e={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(e[i]=n.shape[i])}return he(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=me(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return he(this,"shape",i),i},checks:[]});return we(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=me(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(const t in i)o[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return he(this,"shape",o),o},checks:[]});return we(t,i)}(qi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=me(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:i[t]}))}else for(const t in i)o[t]=new e({type:"nonoptional",innerType:i[t]});return he(this,"shape",o),o},checks:[]});return we(t,i)}(Xi,e,t[0])}));function Li(e,t){const n={type:"object",get shape(){var t;return he(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...Ee(t)};return new ji(n)}const Mi=C("ZodUnion",((e,t)=>{nn.init(e,t),ii.init(e,t),e.options=t.options}));const Gi=C("ZodIntersection",((e,t)=>{on.init(e,t),ii.init(e,t)})),Hi=C("ZodEnum",((e,t)=>{sn.init(e,t),ii.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,i)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new Hi({...t,checks:[],...Ee(i),entries:o})},e.exclude=(e,i)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Hi({...t,checks:[],...Ee(i),entries:o})}}));const Bi=C("ZodTransform",((e,t)=>{cn.init(e,t),ii.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new S(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(Oe(i,n.value,t));else{const t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Oe(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function Vi(e){return new Bi({type:"transform",transform:e})}const qi=C("ZodOptional",((e,t)=>{dn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Yi(e){return new qi({type:"optional",innerType:e})}const Wi=C("ZodNullable",((e,t)=>{ln.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Qi(e){return new Wi({type:"nullable",innerType:e})}const Ji=C("ZodDefault",((e,t)=>{pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Ki=C("ZodPrefault",((e,t)=>{hn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Xi=C("ZodNonOptional",((e,t)=>{mn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),eo=C("ZodCatch",((e,t)=>{vn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),to=C("ZodPipe",((e,t)=>{_n.init(e,t),ii.init(e,t),e.in=t.in,e.out=t.out}));function no(e,t){return new to({type:"pipe",in:e,out:t})}const io=C("ZodReadonly",((e,t)=>{Pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),oo=C("ZodCustom",((e,t)=>{bn.init(e,t),ii.init(e,t)}));function ro(e,t){return no(Vi(e),t)}function ao(e,t,n){const i=t.safeParse(n);return i.success?i.data:(i.error.issues.forEach((t=>{const n=t.path.join(".");e.getFieldState(n)?e.setError(n,{type:"manual",message:t.message}):e.setError("root",{type:"manual",message:t.message})})),null)}const so=e=>ro((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),co=e=>ro((e=>{if(!e)return;let t;return"string"==typeof e&&(t=new Date(e)),e instanceof Date&&(t=e),t?(t.setUTCHours(0,0,0,0),t):e}),e),uo=e=>ai().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),lo=()=>ui("Invalid email address").min(1,"Required"),po=()=>so(Ii("Valid amount required").positive("Positive amount required")),fo=()=>co(function(e){return function(e,t){return new e({type:"date",...Ee(t)})}(Zi,e)}("Valid date required").min(new Date,"Date must be in the future")),ho=e=>ai().max(e,`Maximum length is ${e} characters`),mo=Li({address1:uo(100),address2:ho(100).optional(),city:uo(50),state:ho(50).optional(),postcode:ho(20).optional(),country:uo(50)}),go=Li({amount:po(),message:ho(500).nullish(),giverFirstName:uo(50),giverLastName:uo(50),giverEmail:lo(),giverPhone:uo(31),giverAddress:mo,cardHolder:uo(101),recipientFirstName:ho(50).nullish(),recipientLastName:ho(50).nullish(),recipientEmail:ui("Invalid email address").nullish(),recipientPhone:ho(31).nullish()}),vo=go.extend({expiry:fo(),notes:ho(500).nullish()}),_o=Li({balance:po(),expiry:fo(),message:ho(500).nullish(),notes:ho(500).nullish(),giverFirstName:uo(50),giverLastName:uo(50),giverEmail:lo(),giverPhone:uo(31),cardHolder:uo(101),recipientEmail:ui("Invalid email address").nullish(),recipientPhone:ho(31).nullish()});let yo;!function(e){e.Passthrough="Passthrough",e.PaymentProcessor="PaymentProcessor"}(yo||(yo={}));const Po=Li({companyId:Ii().int().positive(),amount:po(),currency:uo(3).default("AUD")}),zo=go.extend({companyId:Ii().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...Ee(t)})}(Oi,e)}().default(!0),payment:Li({sessionId:uo(100),resultCode:uo(50),pspReference:ho(100).optional()}).optional(),cardNumberToken:ho(200).optional(),cardCvcToken:ho(200).optional(),cardExpiry:ho(5).optional(),cardType:ho(20).optional()}),bo=Li({giftCardId:Ii().int().positive(),reason:ho(500).optional()}),ko=Li({companyId:Ii().int().positive().nullish(),code:uo(10),password:uo(10)}),wo=ko.extend({amount:po(),description:uo(200)});let Eo,To,Ao,No,Io,Ro;!function(e){e.Adyen="Adyen"}(Eo||(Eo={})),function(e){e.Pending="Pending",e.Authorized="Authorized",e.Captured="Captured",e.Failed="Failed",e.Refunded="Refunded"}(To||(To={})),function(e){e.Authorised="Authorised",e.Refused="Refused",e.Cancelled="Cancelled",e.Pending="Pending",e.Received="Received",e.Error="Error",e.IdentifyShopper="IdentifyShopper",e.ChallengeShopper="ChallengeShopper"}(Ao||(Ao={})),function(e){e.AUTHORISATION="AUTHORISATION",e.CAPTURE="CAPTURE",e.REFUND="REFUND",e.CANCELLATION="CANCELLATION",e.REFUND_FAILED="REFUND_FAILED",e.CAPTURE_FAILED="CAPTURE_FAILED"}(No||(No={})),function(e){e.Purchase="Purchase",e.Redemption="Redemption",e.Adjustment="Adjustment"}(Io||(Io={})),function(e){e.Pending="Pending",e.Complete="Complete",e.Cancelled="Cancelled",e.Expired="Expired"}(Ro||(Ro={}));const Co=Li({code:uo(10),token:uo(128)}),Oo=Li({companyId:Ii().int().positive(),code:uo(10),token:uo(128)}),So=Li({grant_type:ai().readonly().default("refresh_token"),client_id:In(li,undefined),client_secret:ai(),refresh_token:ai(),scope:ai().optional()});const $o=Li({email:ui(),firstName:ai().max(100).optional(),lastName:ai().max(100).optional(),phone:ai().max(20).optional(),scopes:Ui(ai()).optional()});let xo;!function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(xo||(xo={}));const Fo=[xo.PER_NIGHT,xo.PER_PERSON_PER_NIGHT,xo.PER_QUANTITY_NAME_PER_NIGHT,xo.PER_ROOM_QUANTITY_PER_NIGHT,xo.PER_PERSON_OCCUPANCY_PER_NIGHT,xo.PER_ADULT_OCCUPANCY_PER_NIGHT,xo.PER_CHILD_OCCUPANCY_PER_NIGHT,xo.PER_ALL_PERSONS_PER_NIGHT];let Zo,Do,Uo;!function(e){e.Critical="Critical",e.Error="Error",e.Warn="Warn",e.Info="Info"}(Zo||(Zo={})),function(e){e.Debug="Diagnostics",e.Security="Security",e.Audit="Audit"}(Do||(Do={})),function(e){e.General="General",e.Authenticated="Token Authenticated",e.Unauthorized="Unauthorized Access",e.RefreshToken="Refresh Token Created",e.AccessToken="Access Token Created",e.Revoked="Token Revoked",e.UserCreated="User Created",e.UserLinked="User Linked to Company",e.Purchase="Gift Card Purchased",e.Payment="Payment",e.Email="Email Delivery",e.Transaction="Gift Card Transaction"}(Uo||(Uo={}));const jo=e=>{let t=0;const n=Object.values(e.itinerary);for(const e of n){const n=Object.keys(e.nights);for(const i of n)t+=e.nights[i].total}return t},Lo=require("decimal.js");var Mo=e.n(Lo);const Go={UP:Mo().ROUND_UP,DOWN:Mo().ROUND_DOWN,CEIL:Mo().ROUND_CEIL,FLOOR:Mo().ROUND_FLOOR,HALF_UP:Mo().ROUND_HALF_UP,HALF_DOWN:Mo().ROUND_HALF_DOWN,HALF_EVEN:Mo().ROUND_HALF_EVEN,HALF_CEIL:Mo().ROUND_HALF_CEIL,HALF_FLOOR:Mo().ROUND_HALF_FLOOR},Ho=(e,t)=>{const{precision:n=2,rounding:i=Go.HALF_UP}=t||{};return new(Mo())(e).toDecimalPlaces(n,i).toNumber()};function Bo(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:a=[]}=t,s=Ho(n);switch(e.feeType){case R.PercentageOfBooking:if(o)return Ho(s*e.amount/(100+e.amount));if(r){const t=a.reduce(((e,t)=>e+t/(100+t)),0);return Ho(s/(1-t)*e.amount/(100+e.amount))}return Ho(s*(e.amount/100));case R.FixedChargePerRoom:case R.FixedChargePerBooking:return e.amount;case R.NightlyChargePerRoom:return Ho(e.amount*i);default:return 0}}const Vo=[R.FixedChargePerBooking],qo=[R.PercentageOfBooking,R.FixedChargePerRoom,R.NightlyChargePerRoom],Yo=[R.PercentageOfBooking];function Wo(e,t){return e.filter((e=>t.includes(e.feeType)))}function Qo(e){return Wo(e,Vo)}function Jo(e){return Wo(e,qo)}function Ko(e){return Wo(e,Yo)}function Xo(e){return{includeInRates:[R.PercentageOfBooking,R.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===R.PercentageOfBooking,appliesToAddons:e===R.PercentageOfBooking,includePreviousFeesInCalculation:e===R.PercentageOfBooking}}const er=e=>e,tr=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},nr=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class ir{}function or(e){return e.toUpperCase()}ir.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===xo.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===xo.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(n*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(i=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(o=e.childQuantity*Number(e.childPrice));let r=n+i+o;return Fo.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},ir.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=ir.calculateBaseAddonTotal(n,t);let o=0;return(n.fee||n.fees?.length)&&n.quantity?n.fees?.length?n.fees.forEach((e=>{o+=n.quantity*e.amount})):o=n.quantity*Number(n.fee):((n.adultFee||n.adultFees?.length)&&n.adultQuantity&&(n.adultFees?.length?n.adultFees.forEach((e=>{o+=n.adultQuantity*e.amount})):o+=n.adultQuantity??1*Number(n.adultFee)),(n.childFee||n.childFees?.length)&&n.childQuantity&&(n.childFees?.length?n.childFees.forEach((e=>{o+=n.childQuantity??1*e.amount})):o+=n.childQuantity*Number(n.childFee))),Fo.includes(n.pricingType)&&n.nights&&!t&&(o*=n.nights),{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),ir.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=ir.calculateBaseAddonTotal(n,t);let o=n.fees||0;n.itemisedFees?.length&&(o=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=n.itemisedFees?.length?i.addonTotal:i.addonTotal+o;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),ir.calculateTotalForReservation=(e,t=!1)=>{let n=0;return e.itemisedFees?.forEach((e=>{n+=e.amount})),e.reservations.forEach((e=>{n+=e.total.afterTax;const i=Object.keys(e.nights)?.length??0;if(n+=e.fees??0,e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=ir.calculateReservationAddonTotal(o,t)?.total}})),Ho(n)},module.exports=t})();
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * decimal.js v10.4.3
3
+ * An arbitrary-precision Decimal type for JavaScript.
4
+ * https://github.com/MikeMcl/decimal.js
5
+ * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
6
+ * MIT Licence
7
+ */
@@ -0,0 +1,24 @@
1
+ export type IDailyRevenue = {
2
+ date: string;
3
+ revenue: number;
4
+ };
5
+ export type IDailyRoomBreakdown = {
6
+ date: string;
7
+ roomName: string;
8
+ purchases: number;
9
+ };
10
+ export type IRegionBreakdown = {
11
+ country: string;
12
+ region: string;
13
+ purchases: number;
14
+ revenue: number;
15
+ };
16
+ export type IBigQueryResponse = {
17
+ purchases: number;
18
+ cancellations: number;
19
+ revenue: number;
20
+ conversionRate: number;
21
+ dailyRevenue: IDailyRevenue[];
22
+ dailyRoomsBreakdown: IDailyRoomBreakdown[];
23
+ regionBreakdown: IRegionBreakdown[];
24
+ };
@@ -0,0 +1,89 @@
1
+ import { EHotelCardProcessor } from './IBookingPayment.type';
2
+ export declare enum ESplitPaymentState {
3
+ INITIATED = "initiated",
4
+ GIFTCARD_AUTHORIZED = "giftcard_authorized",
5
+ CC_AUTHORIZED = "cc_authorized",
6
+ CAPTURED = "captured",
7
+ FAILED = "failed",
8
+ ROLLED_BACK = "rolled_back"
9
+ }
10
+ export declare enum ESplitPaymentStatus {
11
+ PENDING = "pending",
12
+ AUTHORIZED = "authorized",
13
+ CAPTURED = "captured",
14
+ FAILED = "failed"
15
+ }
16
+ export interface IGiftCardPaymentDetails {
17
+ amount: number;
18
+ cardCode: string;
19
+ authorizationId?: string;
20
+ status: ESplitPaymentStatus;
21
+ expiresAt?: Date;
22
+ }
23
+ export interface ICreditCardPaymentDetails {
24
+ amount: number;
25
+ processor: EHotelCardProcessor;
26
+ authorizationId?: string;
27
+ status: ESplitPaymentStatus;
28
+ expiresAt?: Date;
29
+ }
30
+ export interface ISplitPayment {
31
+ splitPaymentId: string;
32
+ totalAmount: number;
33
+ giftCard: IGiftCardPaymentDetails;
34
+ creditCard: ICreditCardPaymentDetails;
35
+ sessionState: ESplitPaymentState;
36
+ createdAt: Date;
37
+ updatedAt: Date;
38
+ expiresAt: Date;
39
+ }
40
+ export interface ISplitPaymentSession {
41
+ id: string;
42
+ bookingId: number;
43
+ companyId: number;
44
+ hotelId: string;
45
+ splitPayment: ISplitPayment;
46
+ }
47
+ export interface IInitiateSplitPaymentRequest {
48
+ bookingId: number;
49
+ giftCardCode: string;
50
+ giftCardAmount: number;
51
+ creditCardAmount: number;
52
+ }
53
+ export interface IInitiateSplitPaymentResponse {
54
+ sessionId: string;
55
+ giftCardAmount: number;
56
+ creditCardAmount: number;
57
+ expiresAt: Date;
58
+ }
59
+ export interface IAuthorizationResult {
60
+ success: boolean;
61
+ authorizationId?: string;
62
+ expiresAt?: Date;
63
+ error?: string;
64
+ }
65
+ export interface ICaptureResult {
66
+ success: boolean;
67
+ giftCardCaptured: boolean;
68
+ creditCardCaptured: boolean;
69
+ error?: string;
70
+ }
71
+ export interface ISplitPaymentCheckoutDetails {
72
+ sessionId: string;
73
+ currentStep: 'giftcard' | 'creditcard' | 'capture';
74
+ giftCard: {
75
+ amount: number;
76
+ status: ESplitPaymentStatus;
77
+ authorizationId?: string;
78
+ expiresAt?: Date;
79
+ };
80
+ creditCard: {
81
+ amount: number;
82
+ status: ESplitPaymentStatus;
83
+ processor?: EHotelCardProcessor;
84
+ redirectUrl?: string;
85
+ authorizationId?: string;
86
+ expiresAt?: Date;
87
+ };
88
+ expiresAt: Date;
89
+ }
@@ -19,6 +19,10 @@ export type IPlaceBookingRequest = {
19
19
  } & IPlaceBookingGCLIDAndUTM;
20
20
  payment: IBookingPayment;
21
21
  frontendMember?: IRoomstayMemberJWTData;
22
+ giftCard?: {
23
+ token: string;
24
+ code: string;
25
+ };
22
26
  extraFields?: IBookingExtraFields;
23
27
  } & ICommonQueryParameters;
24
28
  export type IRepeatPaymentRequest = IPlaceBookingRequest & {
@@ -0,0 +1,6 @@
1
+ export interface IFeeOptions {
2
+ includeInRates: boolean;
3
+ alreadyIncludedInRates: boolean;
4
+ appliesToAddons: boolean;
5
+ includePreviousFeesInCalculation: boolean;
6
+ }
@@ -114,9 +114,27 @@ export declare const EditGiftCardSchema: z.ZodObject<{
114
114
  recipientPhone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
115
115
  }, z.core.$strip>;
116
116
  export type IEditGiftCardRequest = z.infer<typeof EditGiftCardSchema>;
117
+ /**
118
+ * Payment type enum - defines how payment is processed
119
+ */
120
+ export declare enum EGiftCardPaymentType {
121
+ Passthrough = "Passthrough",// VGS tokenization
122
+ PaymentProcessor = "PaymentProcessor"
123
+ }
117
124
  /**
118
125
  * Schema for validating purchasing a gift card.
119
126
  */
127
+ export declare const CreatePaymentSessionSchema: z.ZodObject<{
128
+ companyId: z.ZodNumber;
129
+ amount: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>;
130
+ currency: z.ZodDefault<z.ZodString>;
131
+ }, z.core.$strip>;
132
+ export type ICreatePaymentSessionRequest = z.infer<typeof CreatePaymentSessionSchema>;
133
+ export type ICreatePaymentSessionResponse = {
134
+ sessionId: string;
135
+ sessionData: string;
136
+ clientKey: string;
137
+ };
120
138
  export declare const PurchaseGiftCardSchema: z.ZodObject<{
121
139
  amount: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>;
122
140
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -140,33 +158,81 @@ export declare const PurchaseGiftCardSchema: z.ZodObject<{
140
158
  companyId: z.ZodNumber;
141
159
  sendViaEmail: z.ZodDefault<z.ZodBoolean>;
142
160
  payment: z.ZodOptional<z.ZodObject<{
143
- cardHolder: z.ZodString;
144
- cardNumberToken: z.ZodString;
145
- cardExpiry: z.ZodString;
146
- cardCvcToken: z.ZodString;
161
+ sessionId: z.ZodString;
162
+ resultCode: z.ZodString;
163
+ pspReference: z.ZodOptional<z.ZodString>;
147
164
  }, z.core.$strip>>;
165
+ cardNumberToken: z.ZodOptional<z.ZodString>;
166
+ cardCvcToken: z.ZodOptional<z.ZodString>;
167
+ cardExpiry: z.ZodOptional<z.ZodString>;
168
+ cardType: z.ZodOptional<z.ZodString>;
148
169
  }, z.core.$strip>;
149
170
  export type IPurchaseGiftCardRequest = z.infer<typeof PurchaseGiftCardSchema>;
150
171
  export type IPurchaseGiftCardResponse = IGiftCardDTO & {
151
- password: string;
172
+ password: string | null;
173
+ };
174
+ export declare const RefundGiftCardSchema: z.ZodObject<{
175
+ giftCardId: z.ZodNumber;
176
+ reason: z.ZodOptional<z.ZodString>;
177
+ }, z.core.$strip>;
178
+ export type IRefundGiftCardRequest = z.infer<typeof RefundGiftCardSchema>;
179
+ export type IRefundGiftCardResponse = {
180
+ success: boolean;
181
+ refundReference: string;
152
182
  };
153
183
  export declare const ValidateGiftCardSchema: z.ZodObject<{
184
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
154
185
  code: z.ZodString;
155
186
  password: z.ZodString;
156
187
  }, z.core.$strip>;
157
188
  export type IValidateGiftCardRequest = z.infer<typeof ValidateGiftCardSchema>;
158
189
  export declare const RedeemGiftCardSchema: z.ZodObject<{
190
+ companyId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
159
191
  code: z.ZodString;
160
192
  password: z.ZodString;
161
193
  amount: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>;
162
194
  description: z.ZodString;
163
195
  }, z.core.$strip>;
164
196
  export type IRedeemGiftCardRequest = z.infer<typeof RedeemGiftCardSchema>;
197
+ export declare enum EGiftCardPaymentProvider {
198
+ Adyen = "Adyen"
199
+ }
200
+ export declare enum EGiftCardPaymentStatus {
201
+ Pending = "Pending",
202
+ Authorized = "Authorized",
203
+ Captured = "Captured",
204
+ Failed = "Failed",
205
+ Refunded = "Refunded"
206
+ }
207
+ export declare enum AdyenResultCode {
208
+ Authorised = "Authorised",
209
+ Refused = "Refused",
210
+ Cancelled = "Cancelled",
211
+ Pending = "Pending",
212
+ Received = "Received",
213
+ Error = "Error",
214
+ IdentifyShopper = "IdentifyShopper",
215
+ ChallengeShopper = "ChallengeShopper"
216
+ }
217
+ export declare enum AdyenEventCode {
218
+ AUTHORISATION = "AUTHORISATION",
219
+ CAPTURE = "CAPTURE",
220
+ REFUND = "REFUND",
221
+ CANCELLATION = "CANCELLATION",
222
+ REFUND_FAILED = "REFUND_FAILED",
223
+ CAPTURE_FAILED = "CAPTURE_FAILED"
224
+ }
165
225
  export declare enum EGiftCardTransactionType {
166
226
  Purchase = "Purchase",
167
227
  Redemption = "Redemption",
168
228
  Adjustment = "Adjustment"
169
229
  }
230
+ export declare enum ETransactionStatus {
231
+ Pending = "Pending",
232
+ Complete = "Complete",
233
+ Cancelled = "Cancelled",
234
+ Expired = "Expired"
235
+ }
170
236
  /**
171
237
  * Basic details of a gift card transaction that can be shared with customers.
172
238
  */
@@ -180,14 +246,35 @@ export type IGiftCardTransactionDTO = {
180
246
  /**
181
247
  * Extended transaction details for admin view including description and running balance.
182
248
  */
183
- export type IAdminGiftCardTransactionDTO = {
184
- id: string;
185
- date: Date;
186
- type: EGiftCardTransactionType;
187
- amount: number;
249
+ export type IAdminGiftCardTransactionDTO = IGiftCardTransactionDTO & {
188
250
  description: string;
189
251
  runningBalance: number;
252
+ status: ETransactionStatus;
253
+ };
254
+ /**
255
+ * Details of a preauthorised redemption including the token necessary for completion.
256
+ */
257
+ export type IGiftCardPreauthorisationDTO = IGiftCardTransactionDTO & {
258
+ token: string;
259
+ expiry: Date;
190
260
  };
261
+ /**
262
+ * Schema for validating a request to complete a preauthorised gift card transaction.
263
+ */
264
+ export declare const CompleteGiftCardTransactionSchema: z.ZodObject<{
265
+ code: z.ZodString;
266
+ token: z.ZodString;
267
+ }, z.core.$strip>;
268
+ export type ICompleteGiftCardTransactionRequest = z.infer<typeof CompleteGiftCardTransactionSchema>;
269
+ /**
270
+ * Schema for validating a request to cancel a preauthorised gift card transaction.
271
+ */
272
+ export declare const CancelGiftCardTransactionSchema: z.ZodObject<{
273
+ companyId: z.ZodNumber;
274
+ code: z.ZodString;
275
+ token: z.ZodString;
276
+ }, z.core.$strip>;
277
+ export type ICancelGiftCardTransactionRequest = z.infer<typeof CancelGiftCardTransactionSchema>;
191
278
  /**
192
279
  * Log entry details for admin.
193
280
  */
@@ -28,7 +28,7 @@ export declare enum ELogType {
28
28
  UserCreated = "User Created",
29
29
  UserLinked = "User Linked to Company",
30
30
  Purchase = "Gift Card Purchased",
31
- Payment = "Payment Captured",
31
+ Payment = "Payment",
32
32
  Email = "Email Delivery",
33
33
  Transaction = "Gift Card Transaction"
34
34
  }
@@ -1,5 +1,4 @@
1
1
  export type IMaintenanceStatus = {
2
- uuid: string;
3
2
  /**
4
3
  * Which service is currently experiencing issues.
5
4
  */
@@ -10,6 +9,10 @@ export type IMaintenanceStatus = {
10
9
  * @example 2023-10-01T00:00:00Z
11
10
  */
12
11
  startDate: string;
12
+ /**
13
+ * UUID generated on create. Is not used as a primary key, or an index.
14
+ */
15
+ uuid: string;
13
16
  endDate: string;
14
17
  /**
15
18
  * Whether the status is currently in effect or not
@@ -4,3 +4,8 @@ export declare enum EGuaranteePolicyDepositMode {
4
4
  FirstNight = "FirstNight",
5
5
  None = "None"
6
6
  }
7
+ export declare enum EGuarantyPolicyPrepaymentType {
8
+ FixedAmount = "fixed",
9
+ Percentage = "percentage",
10
+ Nights = "nights"
11
+ }
@@ -87,11 +87,11 @@ export * from './Events/IRoomstayEvent.type';
87
87
  /**
88
88
  * General
89
89
  */
90
+ export * from './General/Format.types';
90
91
  export * from './General/HttpMethod.enum';
91
92
  export * from './General/IMessage.type';
92
- export * from './General/Warning.type';
93
93
  export * from './General/Pagination.types';
94
- export * from './General/Format.types';
94
+ export * from './General/Warning.type';
95
95
  /**
96
96
  * Media
97
97
  */
@@ -102,10 +102,20 @@ export * from './Media/IMedia.type';
102
102
  export * from './Fees/EFeeType.enum';
103
103
  export * from './Fees/IFee.type';
104
104
  export * from './Fees/IFeeConfigurationOptions.type';
105
+ /**
106
+ * Api
107
+ */
108
+ export * from './Api/Reservations.type';
109
+ export * from './Api/RoomNightRate.type';
105
110
  /**
106
111
  * Analytics
107
112
  */
108
113
  export * from './Analytics/IBigQueryResults.type';
114
+ /**
115
+ * Gift Cards
116
+ */
117
+ export * from './GiftCards/GiftCard.types';
118
+ export * from './GiftCards/GiftCardAuth.types';
109
119
  /**
110
120
  * Addons
111
121
  */
File without changes
@@ -1,3 +1,11 @@
1
+ import Decimal from "decimal.js";
2
+ export declare const RoundingType: {
3
+ [key: string]: Decimal.Rounding;
4
+ };
5
+ interface RoundMoneyOptions {
6
+ precision?: number;
7
+ rounding?: Decimal.Rounding;
8
+ }
1
9
  /**
2
10
  * Rounds a monetary amount to two decimal places.
3
11
  *
@@ -5,6 +13,8 @@
5
13
  * with some systems, such as RMS.
6
14
  *
7
15
  * @param amount a string or number to be rounded
16
+ * @param options an object containing precision and rounding options
8
17
  * @returns the rounded amount as a number
9
18
  */
10
- export declare const roundMoney: (amount: string | number) => number;
19
+ export declare const roundMoney: (amount: string | number, options?: RoundMoneyOptions) => number;
20
+ export {};
package/dist/web.js CHANGED
@@ -1 +1 @@
1
- define("@roomstay/core",["decimal.js"],(e=>(()=>{"use strict";var t={60:t=>{t.exports=e}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{let e,t,n,r,s;i.r(o),i.d(o,{ADDON_PER_NIGHT_TYPES:()=>$,AddGiftCardSchema:()=>_o,BaseGiftCardSchema:()=>vo,DATE_FORMAT:()=>N,EAddonPricingType:()=>R,EBookingFlow:()=>t,EBookingPaymentMethod:()=>n,EBookingStatus:()=>e,ECompanyProvider:()=>l,EDistanceUnitType:()=>v,EFeeType:()=>A,EGiftCardTransactionType:()=>ko,EGuaranteePolicyDepositMode:()=>k,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,ELogCategory:()=>Io,ELogSeverity:()=>To,ELogType:()=>No,EPlanpayBookingStatus:()=>s,ERMSAuthSyncHistoryStatus:()=>P,ERMSDiscountType:()=>_,ERMSSyncStrategy:()=>y,ERoomstayEventSource:()=>w,ERoomstayImageSize:()=>z,EditGiftCardSchema:()=>yo,GuestProfile:()=>d,HttpMethod:()=>E,IAuxiliaryFilterType:()=>g,IMaintenanceStatusService:()=>b,InternationalAddressSchema:()=>go,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>a,Package:()=>T,PurchaseGiftCardSchema:()=>Po,RedeemGiftCardSchema:()=>bo,RefreshGiftCardTokenSchema:()=>wo,RegisterGiftCardAdminSchema:()=>Eo,Reservation:()=>u,ReservedPackage:()=>I,TotalCalculator:()=>Ho,ValidateGiftCardSchema:()=>zo,calculateFeeAmount:()=>So,calculateTotalForMemberBooking:()=>Ao,getFeeOptionValidity:()=>Mo,getFilteredBookingAddonFees:()=>Uo,getFilteredBookingFees:()=>Do,getFilteredBookingRateFees:()=>jo,maxString:()=>mo,nameof:()=>Go,preprocessDate:()=>uo,preprocessNumber:()=>co,requireEmail:()=>po,requireFutureDate:()=>ho,requirePositiveAmount:()=>fo,requireString:()=>lo,resizeRoomstayImageUrl:()=>Bo,roundMoney:()=>Co,subset:()=>Lo,uppercaseString:()=>Vo,validateFormWithZod:()=>ao}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(e||(e={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(t||(t={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(n||(n={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard",e.Stripe="Stripe"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const a=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,g,v,_,y,P,z,b,k,w,E;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(g||(g={})),function(e){e.Metric="metric",e.Imperial="imperial"}(v||(v={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(_||(_={})),function(e){e.Hotel="hotel",e.HotelImages="hotelImages",e.Cancellation="cancellation",e.Room="room",e.Rates="rates",e.OneGuaranteePolicy="oneGuaranteePolicy",e.RoomRates="roomRates",e.RoomImages="roomImages",e.BookingSources="booking-sources",e.Areas="areas",e.Dwellings="dwellings",e.AreaDwellings="areaDwellings",e.ConvertDwellingConfigToAuxInput="convertDwellingConfigToAuxInput",e.Discounts="discounts",e.PropertyDiscounts="propertyDiscounts",e.RoomDiscounts="roomDiscounts",e.PropertySundries="propertySundries",e.PropertyFees="propertyFees",e.PropertyCards="property-cards",e.Countries="countries",e.Addons="addons",e.Requirements="requirements",e.RoomAddons="room-addons",e.ClientFacingPromoSync="clientFacingPromoSync",e.ClientFacingRoomSync="clientFacingRoomSync",e.ClientFacingRateSync="clientFacingRateSync",e.NewRateFetch="newRateFetch"}(y||(y={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(P||(P={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(z||(z={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(b||(b={}));class T{constructor(){this.ratePlanCode=void 0,this.name=void 0,this.description=void 0,this.inclusive=void 0,this.image=void 0,this.url=void 0,this.pricingType=void 0,this.quantity=void 0,this.category=void 0,this.cancelPenalty=void 0,this.guaranteeDescription=void 0,this.availability={}}}class I extends T{constructor(...e){super(...e),this.code=void 0,this.price=void 0,this.fees=void 0,this.itemisedFees=void 0,this.adultQuantity=void 0,this.childQuantity=void 0,this.adultPrice=void 0,this.childPrice=void 0,this.startDate=void 0,this.startTime=void 0,this.hideDatePicker=!1,this.order=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(k||(k={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(w||(w={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(E||(E={}));const N="DD/MM/YYYY";let A,R;!function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(A||(A={})),function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(R||(R={}));const $=[R.PER_NIGHT,R.PER_PERSON_PER_NIGHT,R.PER_QUANTITY_NAME_PER_NIGHT,R.PER_ROOM_QUANTITY_PER_NIGHT,R.PER_PERSON_OCCUPANCY_PER_NIGHT,R.PER_ADULT_OCCUPANCY_PER_NIGHT,R.PER_CHILD_OCCUPANCY_PER_NIGHT,R.PER_ALL_PERSONS_PER_NIGHT];function C(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function s(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Object.freeze({status:"aborted"}),Symbol("zod_brand");class S extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class O extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const x={};function Z(e){return e&&Object.assign(x,e),x}const F=/^[cC][^\s-]{8,}$/,D=/^[0-9a-z]+$/,j=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,U=/^[0-9a-vA-V]{20}$/,M=/^[A-Za-z0-9]{27}$/,G=/^[a-zA-Z0-9_-]{21}$/,L=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,B=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,H=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,V=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Y=/^(?:(?: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])$/,q=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Q=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,W=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,J=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,K=/^[A-Za-z0-9_-]*$/,X=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ee=/^\+(?:[0-9]){6,14}[0-9]$/,te="(?:(?:\\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])))",ne=new RegExp(`^${te}$`);function ie(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const oe=/^\d+$/,re=/^-?\d+(?:\.\d+)?/i,se=/true|false/i,ae=/^[^A-Z]*$/,ce=/^[^a-z]*$/;function ue(e,t){return"bigint"==typeof t?t.toString():t}function de(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function le(e){return null==e}function pe(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const fe=Symbol("evaluating");function he(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==fe)return void 0===i&&(i=fe,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function me(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ge(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ve(e){return JSON.stringify(e)}const _e="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ye(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Pe=de((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function ze(e){if(!1===ye(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==ye(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function be(e){return ze(e)?{...e}:e}const ke=new Set(["string","number","symbol"]);function we(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ee(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Te(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}new Set(["string","number","bigint","boolean","symbol","undefined"]);const Ie={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ne(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Ae(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Re(e){return"string"==typeof e?e:e?.message}function $e(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Re(e.inst?._zod.def?.error?.(e))??Re(t?.error?.(e))??Re(n.customError?.(e))??Re(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Ce(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Se(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Oe=C("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),xe={number:"number",bigint:"bigint",object:"date"},Ze=C("$ZodCheckLessThan",((e,t)=>{Oe.init(e,t);const n=xe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Fe=C("$ZodCheckGreaterThan",((e,t)=>{Oe.init(e,t);const n=xe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),De=C("$ZodCheckMultipleOf",((e,t)=>{Oe.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(i)){const e=i.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),je=C("$ZodCheckNumberFormat",((e,t)=>{Oe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Ie[t.format];e._zod.onattach.push((e=>{const i=e._zod.bag;i.format=t.format,i.minimum=o,i.maximum=r,n&&(i.pattern=oe)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>r&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}})),Ue=C("$ZodCheckMaxLength",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!le(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const i=n.value;if(i.length<=t.maximum)return;const o=Ce(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Me=C("$ZodCheckMinLength",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!le(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const i=n.value;if(i.length>=t.minimum)return;const o=Ce(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Ge=C("$ZodCheckLengthEquals",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!le(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const i=n.value,o=i.length;if(o===t.length)return;const r=Ce(i),s=o>t.length;n.issues.push({origin:r,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Le=C("$ZodCheckStringFormat",((e,t)=>{var n,i;Oe.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})})),Be=C("$ZodCheckRegex",((e,t)=>{Le.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),He=C("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=ae),Le.init(e,t)})),Ve=C("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=ce),Le.init(e,t)})),Ye=C("$ZodCheckIncludes",((e,t)=>{Oe.init(e,t);const n=we(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),qe=C("$ZodCheckStartsWith",((e,t)=>{Oe.init(e,t);const n=new RegExp(`^${we(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),Qe=C("$ZodCheckEndsWith",((e,t)=>{Oe.init(e,t);const n=new RegExp(`.*${we(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),We=C("$ZodCheckOverwrite",((e,t)=>{Oe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Je{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),i=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of i)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Ke=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ue,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xe=C("$ZodError",Ke),et=C("$ZodError",Ke,{Parent:Error}),tt=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new S;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>$e(e,r,Z()))));throw _e(t,o?.callee),t}return s.value},nt=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>$e(e,r,Z()))));throw _e(t,o?.callee),t}return s.value},it=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},o);if(r instanceof Promise)throw new S;return r.issues.length?{success:!1,error:new(e??Xe)(r.issues.map((e=>$e(e,o,Z()))))}:{success:!0,data:r.value}},ot=it(et),rt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map((e=>$e(e,o,Z()))))}:{success:!0,data:r.value}},st=rt(et),at=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return tt(e)(t,n,o)},ct=e=>(t,n,i)=>tt(e)(t,n,i),ut=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},dt=e=>async(t,n,i)=>nt(e)(t,n,i),lt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return it(e)(t,n,o)},pt=e=>(t,n,i)=>it(e)(t,n,i),ft=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return rt(e)(t,n,o)},ht=e=>async(t,n,i)=>rt(e)(t,n,i),mt={major:4,minor:1,patch:5},gt=C("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=mt;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=Ne(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=r._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new S;if(i||s instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await s,e.issues.length!==t&&(o||(o=Ne(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ne(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ne(n))return n.aborted=!0,n;const s=t(o,i,r);if(s instanceof Promise){if(!1===r.async)throw new S;return s.then((t=>e._zod.parse(t,r)))}return e._zod.parse(s,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const s=e._zod.parse(o,r);if(s instanceof Promise){if(!1===r.async)throw new S;return s.then((e=>t(e,i,r)))}return t(s,i,r)}}e["~standard"]={validate:t=>{try{const n=ot(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return st(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),vt=C("$ZodString",((e,t)=>{var n;gt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),_t=C("$ZodStringFormat",((e,t)=>{Le.init(e,t),vt.init(e,t)})),yt=C("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=B),_t.init(e,t)})),Pt=C("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=H(e))}else t.pattern??(t.pattern=H());_t.init(e,t)})),zt=C("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=V),_t.init(e,t)})),bt=C("$ZodURL",((e,t)=>{_t.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:X.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=i)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),kt=C("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),_t.init(e,t)})),wt=C("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=G),_t.init(e,t)})),Et=C("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=F),_t.init(e,t)})),Tt=C("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=D),_t.init(e,t)})),It=C("$ZodULID",((e,t)=>{t.pattern??(t.pattern=j),_t.init(e,t)})),Nt=C("$ZodXID",((e,t)=>{t.pattern??(t.pattern=U),_t.init(e,t)})),At=C("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=M),_t.init(e,t)})),Rt=C("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ie({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${te}T(?:${i})$`)}(t)),_t.init(e,t)})),$t=C("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=ne),_t.init(e,t)})),Ct=C("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ie(t)}$`)),_t.init(e,t)})),St=C("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=L),_t.init(e,t)})),Ot=C("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=Y),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),xt=C("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=q),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv6"})),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}})),Zt=C("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=Q),_t.init(e,t)})),Ft=C("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=W),_t.init(e,t),e._zod.check=n=>{const[i,o]=n.value.split("/");try{if(!o)throw new Error;const e=Number(o);if(`${e}`!==o)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function Dt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const jt=C("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=J),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Dt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),Ut=C("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=K),_t.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!K.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Dt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),Mt=C("$ZodE164",((e,t)=>{t.pattern??(t.pattern=ee),_t.init(e,t)})),Gt=C("$ZodJWT",((e,t)=>{_t.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),Lt=C("$ZodNumber",((e,t)=>{gt.init(e,t),e._zod.pattern=e._zod.bag.pattern??re,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const r="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...r?{received:r}:{}}),n}})),Bt=C("$ZodNumber",((e,t)=>{je.init(e,t),Lt.init(e,t)})),Ht=C("$ZodBoolean",((e,t)=>{gt.init(e,t),e._zod.pattern=se,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}})),Vt=C("$ZodUnknown",((e,t)=>{gt.init(e,t),e._zod.parse=e=>e})),Yt=C("$ZodNever",((e,t)=>{gt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),qt=C("$ZodDate",((e,t)=>{gt.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const o=n.value,r=o instanceof Date;return r&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...r?{received:"Invalid Date"}:{},inst:e}),n}}));function Qt(e,t,n){e.issues.length&&t.issues.push(...Ae(n,e.issues)),t.value[n]=e.value}const Wt=C("$ZodArray",((e,t)=>{gt.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},i);a instanceof Promise?r.push(a.then((t=>Qt(t,n,e)))):Qt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function Jt(e,t,n,i){e.issues.length&&t.issues.push(...Ae(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Kt(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape[n]._zod.traits.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(i=e.shape,Object.keys(i).filter((e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout)));var i;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Xt(e,t,n,i,o,r){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(a.has(o))continue;if("never"===u){s.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>Jt(e,n,o,t)))):Jt(r,n,o,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const en=C("$ZodObject",((e,t)=>{gt.init(e,t);const n=de((()=>Kt(t)));he(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const i=e[t]._zod;if(i.values){n[t]??(n[t]=new Set);for(const e of i.values)n[t].add(e)}}return n}));const i=ye,o=t.catchall;let r;e._zod.parse=(t,s)=>{r??(r=n.value);const a=t.value;if(!i(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:a[e],issues:[]},s);n instanceof Promise?c.push(n.then((n=>Jt(n,t,e,a)))):Jt(n,t,e,a)}return o?Xt(c,a,t,s,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),tn=C("$ZodObjectJIT",((e,t)=>{en.init(e,t);const n=e._zod.parse,i=de((()=>Kt(t)));let o;const r=ye,s=!x.jitless,a=s&&Pe.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?s&&a&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new Je(["shape","payload","ctx"]),n=i.value,o=e=>{const t=ve(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let s=0;for(const e of n.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=ve(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),d=o(d,l),c?Xt([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function nn(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!Ne(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>$e(e,i,Z())))))}),t)}const on=C("$ZodUnion",((e,t)=>{gt.init(e,t),he(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),he(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),he(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),he(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>pe(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>nn(t,o,e,r))):nn(a,o,e,r)}})),rn=C("$ZodIntersection",((e,t)=>{gt.init(e,t),e._zod.parse=(e,n)=>{const i=e.value,o=t.left._zod.run({value:i,issues:[]},n),r=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||r instanceof Promise?Promise.all([o,r]).then((([t,n])=>an(e,t,n))):an(e,o,r)}}));function sn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ze(e)&&ze(t)){const n=Object.keys(t),i=Object.keys(e).filter((e=>-1!==n.indexOf(e))),o={...e,...t};for(const n of i){const i=sn(e[n],t[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o[n]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const o=sn(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function an(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ne(e))return e;const i=sn(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const cn=C("$ZodEnum",((e,t)=>{gt.init(e,t);const n=function(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter((e=>ke.has(typeof e))).map((e=>"string"==typeof e?we(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const r=t.value;return i.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),un=C("$ZodTransform",((e,t)=>{gt.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new O(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then((e=>(n.value=e,n)));if(o instanceof Promise)throw new S;return n.value=o,n}}));function dn(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const ln=C("$ZodOptional",((e,t)=>{gt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",he(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),he(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${pe(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((t=>dn(t,e.value))):dn(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),pn=C("$ZodNullable",((e,t)=>{gt.init(e,t),he(e._zod,"optin",(()=>t.innerType._zod.optin)),he(e._zod,"optout",(()=>t.innerType._zod.optout)),he(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${pe(e.source)}|null)$`):void 0})),he(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),fn=C("$ZodDefault",((e,t)=>{gt.init(e,t),e._zod.optin="optional",he(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((e=>hn(e,t))):hn(i,t)}}));function hn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const mn=C("$ZodPrefault",((e,t)=>{gt.init(e,t),e._zod.optin="optional",he(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),gn=C("$ZodNonOptional",((e,t)=>{gt.init(e,t),he(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then((t=>vn(t,e))):vn(o,e)}}));function vn(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const _n=C("$ZodCatch",((e,t)=>{gt.init(e,t),he(e._zod,"optin",(()=>t.innerType._zod.optin)),he(e._zod,"optout",(()=>t.innerType._zod.optout)),he(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>$e(e,n,Z())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>$e(e,n,Z())))},input:e.value}),e.issues=[]),e)}})),yn=C("$ZodPipe",((e,t)=>{gt.init(e,t),he(e._zod,"values",(()=>t.in._zod.values)),he(e._zod,"optin",(()=>t.in._zod.optin)),he(e._zod,"optout",(()=>t.out._zod.optout)),he(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const i=t.out._zod.run(e,n);return i instanceof Promise?i.then((e=>Pn(e,t.in,n))):Pn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>Pn(e,t.out,n))):Pn(i,t.out,n)}}));function Pn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const zn=C("$ZodReadonly",((e,t)=>{gt.init(e,t),he(e._zod,"propValues",(()=>t.innerType._zod.propValues)),he(e._zod,"values",(()=>t.innerType._zod.values)),he(e._zod,"optin",(()=>t.innerType._zod.optin)),he(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(bn):bn(i)}}));function bn(e){return e.value=Object.freeze(e.value),e}const kn=C("$ZodCustom",((e,t)=>{Oe.init(e,t),gt.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then((t=>wn(t,n,i,e)));wn(o,n,i,e)}}));function wn(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push(Se(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class En{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Tn(){return new En}const In=Tn();function Nn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Te(t)})}function An(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Te(t)})}function Rn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Te(t)})}function $n(e,t){return new Ze({check:"less_than",...Te(t),value:e,inclusive:!1})}function Cn(e,t){return new Ze({check:"less_than",...Te(t),value:e,inclusive:!0})}function Sn(e,t){return new Fe({check:"greater_than",...Te(t),value:e,inclusive:!1})}function On(e,t){return new Fe({check:"greater_than",...Te(t),value:e,inclusive:!0})}function xn(e,t){return new De({check:"multiple_of",...Te(t),value:e})}function Zn(e,t){return new Ue({check:"max_length",...Te(t),maximum:e})}function Fn(e,t){return new Me({check:"min_length",...Te(t),minimum:e})}function Dn(e,t){return new Ge({check:"length_equals",...Te(t),length:e})}function jn(e){return new We({check:"overwrite",tx:e})}const Un=C("ZodISODateTime",((e,t)=>{Rt.init(e,t),ci.init(e,t)}));const Mn=C("ZodISODate",((e,t)=>{$t.init(e,t),ci.init(e,t)}));const Gn=C("ZodISOTime",((e,t)=>{Ct.init(e,t),ci.init(e,t)}));const Ln=C("ZodISODuration",((e,t)=>{St.init(e,t),ci.init(e,t)}));const Bn=(e,t)=>{Xe.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},i={_errors:[]},o=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>o({issues:e})));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)i._errors.push(n(t));else{let e=i,o=0;for(;o<t.path.length;){const i=t.path[o];o===t.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(n(t))):e[i]=e[i]||{_errors:[]},e=e[i],o++}}};return o(e),i}(e,t)},flatten:{value:t=>function(e,t=(e=>e.message)){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ue,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ue,2)}},isEmpty:{get:()=>0===e.issues.length}})},Hn=(C("ZodError",Bn),C("ZodError",Bn,{Parent:Error})),Vn=tt(Hn),Yn=nt(Hn),qn=it(Hn),Qn=rt(Hn),Wn=at(Hn),Jn=ct(Hn),Kn=ut(Hn),Xn=dt(Hn),ei=lt(Hn),ti=pt(Hn),ni=ft(Hn),ii=ht(Hn),oi=C("ZodType",((e,t)=>(gt.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>Ee(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Vn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>qn(e,t,n),e.parseAsync=async(t,n)=>Yn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Qn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Wn(e,t,n),e.decode=(t,n)=>Jn(e,t,n),e.encodeAsync=async(t,n)=>Kn(e,t,n),e.decodeAsync=async(t,n)=>Xn(e,t,n),e.safeEncode=(t,n)=>ei(e,t,n),e.safeDecode=(t,n)=>ti(e,t,n),e.safeEncodeAsync=async(t,n)=>ni(e,t,n),e.safeDecodeAsync=async(t,n)=>ii(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Te(n)})}(ro,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new Oe({check:"custom",...Te(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Se(e,n.value,t._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Se(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(jn(t)),e.optional=()=>Qi(e),e.nullable=()=>Ji(e),e.nullish=()=>Qi(Ji(e)),e.nonoptional=t=>function(e,t){return new eo({type:"nonoptional",innerType:e,...Te(t)})}(e,t),e.array=()=>Ui(e),e.or=t=>function(e,t){return new Li({type:"union",options:e,...Te(t)})}([e,t]),e.and=t=>new Bi({type:"intersection",left:e,right:t}),e.transform=t=>io(e,Yi(t)),e.default=t=>{return n=t,new Ki({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():be(n)}});var n},e.prefault=t=>{return n=t,new Xi({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():be(n)}});var n},e.catch=t=>{return new to({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>io(e,t),e.readonly=()=>new oo({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return In.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>In.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return In.get(e);const n=e.clone();return In.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),ri=C("_ZodString",((e,t)=>{vt.init(e,t),oi.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Be({check:"string_format",format:"regex",...Te(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ye({check:"string_format",format:"includes",...Te(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new qe({check:"string_format",format:"starts_with",...Te(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Qe({check:"string_format",format:"ends_with",...Te(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Fn(...t)),e.max=(...t)=>e.check(Zn(...t)),e.length=(...t)=>e.check(Dn(...t)),e.nonempty=(...t)=>e.check(Fn(1,...t)),e.lowercase=t=>e.check(function(e){return new He({check:"string_format",format:"lowercase",...Te(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Ve({check:"string_format",format:"uppercase",...Te(e)})}(t)),e.trim=()=>e.check(jn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return jn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(jn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(jn((e=>e.toUpperCase())))})),si=C("ZodString",((e,t)=>{vt.init(e,t),ri.init(e,t),e.email=t=>e.check(Nn(ui,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Te(t)})}(fi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Te(t)})}(Ni,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Te(t)})}(hi,t)),e.guid=t=>e.check(An(li,t)),e.uuid=t=>e.check(Rn(pi,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Te(t)})}(pi,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Te(t)})}(pi,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Te(t)})}(pi,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Te(t)})}(mi,t)),e.guid=t=>e.check(An(li,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Te(t)})}(gi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Te(t)})}(vi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Te(t)})}(_i,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Te(t)})}(Ei,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Te(t)})}(Ti,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Te(t)})}(yi,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Te(t)})}(Pi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Te(t)})}(zi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Te(t)})}(bi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Te(t)})}(ki,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Te(t)})}(wi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Te(t)})}(Ii,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Te(t)})}(Un,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Te(t)})}(Mn,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Te(t)})}(Gn,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Te(t)})}(Ln,e)}(t))}));function ai(e){return function(e,t){return new e({type:"string",...Te(t)})}(si,e)}const ci=C("ZodStringFormat",((e,t)=>{_t.init(e,t),ri.init(e,t)})),ui=C("ZodEmail",((e,t)=>{zt.init(e,t),ci.init(e,t)}));function di(e){return Nn(ui,e)}const li=C("ZodGUID",((e,t)=>{yt.init(e,t),ci.init(e,t)})),pi=C("ZodUUID",((e,t)=>{Pt.init(e,t),ci.init(e,t)})),fi=C("ZodURL",((e,t)=>{bt.init(e,t),ci.init(e,t)})),hi=C("ZodEmoji",((e,t)=>{kt.init(e,t),ci.init(e,t)})),mi=C("ZodNanoID",((e,t)=>{wt.init(e,t),ci.init(e,t)})),gi=C("ZodCUID",((e,t)=>{Et.init(e,t),ci.init(e,t)})),vi=C("ZodCUID2",((e,t)=>{Tt.init(e,t),ci.init(e,t)})),_i=C("ZodULID",((e,t)=>{It.init(e,t),ci.init(e,t)})),yi=C("ZodXID",((e,t)=>{Nt.init(e,t),ci.init(e,t)})),Pi=C("ZodKSUID",((e,t)=>{At.init(e,t),ci.init(e,t)})),zi=C("ZodIPv4",((e,t)=>{Ot.init(e,t),ci.init(e,t)})),bi=C("ZodIPv6",((e,t)=>{xt.init(e,t),ci.init(e,t)})),ki=C("ZodCIDRv4",((e,t)=>{Zt.init(e,t),ci.init(e,t)})),wi=C("ZodCIDRv6",((e,t)=>{Ft.init(e,t),ci.init(e,t)})),Ei=C("ZodBase64",((e,t)=>{jt.init(e,t),ci.init(e,t)})),Ti=C("ZodBase64URL",((e,t)=>{Ut.init(e,t),ci.init(e,t)})),Ii=C("ZodE164",((e,t)=>{Mt.init(e,t),ci.init(e,t)})),Ni=C("ZodJWT",((e,t)=>{Gt.init(e,t),ci.init(e,t)})),Ai=C("ZodNumber",((e,t)=>{Lt.init(e,t),oi.init(e,t),e.gt=(t,n)=>e.check(Sn(t,n)),e.gte=(t,n)=>e.check(On(t,n)),e.min=(t,n)=>e.check(On(t,n)),e.lt=(t,n)=>e.check($n(t,n)),e.lte=(t,n)=>e.check(Cn(t,n)),e.max=(t,n)=>e.check(Cn(t,n)),e.int=t=>e.check(Ci(t)),e.safe=t=>e.check(Ci(t)),e.positive=t=>e.check(Sn(0,t)),e.nonnegative=t=>e.check(On(0,t)),e.negative=t=>e.check($n(0,t)),e.nonpositive=t=>e.check(Cn(0,t)),e.multipleOf=(t,n)=>e.check(xn(t,n)),e.step=(t,n)=>e.check(xn(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Ri(e){return function(e,t){return new e({type:"number",checks:[],...Te(t)})}(Ai,e)}const $i=C("ZodNumberFormat",((e,t)=>{Bt.init(e,t),Ai.init(e,t)}));function Ci(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Te(t)})}($i,e)}const Si=C("ZodBoolean",((e,t)=>{Ht.init(e,t),oi.init(e,t)}));const Oi=C("ZodUnknown",((e,t)=>{Vt.init(e,t),oi.init(e,t)}));function xi(){return new Oi({type:"unknown"})}const Zi=C("ZodNever",((e,t)=>{Yt.init(e,t),oi.init(e,t)}));function Fi(e){return function(e,t){return new e({type:"never",...Te(t)})}(Zi,e)}const Di=C("ZodDate",((e,t)=>{qt.init(e,t),oi.init(e,t),e.min=(t,n)=>e.check(On(t,n)),e.max=(t,n)=>e.check(Cn(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}));const ji=C("ZodArray",((e,t)=>{Wt.init(e,t),oi.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Fn(t,n)),e.nonempty=t=>e.check(Fn(1,t)),e.max=(t,n)=>e.check(Zn(t,n)),e.length=(t,n)=>e.check(Dn(t,n)),e.unwrap=()=>e.element}));function Ui(e,t){return function(e,t,n){return new e({type:"array",element:t,...Te(n)})}(ji,e,t)}const Mi=C("ZodObject",((e,t)=>{tn.init(e,t),oi.init(e,t),he(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Hi({type:"enum",entries:n,...Te(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:xi()}),e.loose=()=>e.clone({...e._zod.def,catchall:xi()}),e.strict=()=>e.clone({...e._zod.def,catchall:Fi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!ze(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=ge(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return me(this,"shape",n),n},checks:[]});return Ee(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!ze(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return me(this,"shape",n),n},checks:e._zod.def.checks};return Ee(e,n)}(e,t),e.merge=t=>function(e,t){const n=ge(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return me(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Ee(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Ee(e,ge(e._zod.def,{get shape(){const e={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(e[i]=n.shape[i])}return me(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=ge(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return me(this,"shape",i),i},checks:[]});return Ee(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=ge(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(const t in i)o[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return me(this,"shape",o),o},checks:[]});return Ee(t,i)}(qi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=ge(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:i[t]}))}else for(const t in i)o[t]=new e({type:"nonoptional",innerType:i[t]});return me(this,"shape",o),o},checks:[]});return Ee(t,i)}(eo,e,t[0])}));function Gi(e,t){const n={type:"object",get shape(){var t;return me(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...Te(t)};return new Mi(n)}const Li=C("ZodUnion",((e,t)=>{on.init(e,t),oi.init(e,t),e.options=t.options}));const Bi=C("ZodIntersection",((e,t)=>{rn.init(e,t),oi.init(e,t)})),Hi=C("ZodEnum",((e,t)=>{cn.init(e,t),oi.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,i)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new Hi({...t,checks:[],...Te(i),entries:o})},e.exclude=(e,i)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Hi({...t,checks:[],...Te(i),entries:o})}}));const Vi=C("ZodTransform",((e,t)=>{un.init(e,t),oi.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new O(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(Se(i,n.value,t));else{const t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Se(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function Yi(e){return new Vi({type:"transform",transform:e})}const qi=C("ZodOptional",((e,t)=>{ln.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Qi(e){return new qi({type:"optional",innerType:e})}const Wi=C("ZodNullable",((e,t)=>{pn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Ji(e){return new Wi({type:"nullable",innerType:e})}const Ki=C("ZodDefault",((e,t)=>{fn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Xi=C("ZodPrefault",((e,t)=>{mn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),eo=C("ZodNonOptional",((e,t)=>{gn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),to=C("ZodCatch",((e,t)=>{_n.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),no=C("ZodPipe",((e,t)=>{yn.init(e,t),oi.init(e,t),e.in=t.in,e.out=t.out}));function io(e,t){return new no({type:"pipe",in:e,out:t})}const oo=C("ZodReadonly",((e,t)=>{zn.init(e,t),oi.init(e,t),e.unwrap=()=>e._zod.def.innerType})),ro=C("ZodCustom",((e,t)=>{kn.init(e,t),oi.init(e,t)}));function so(e,t){return io(Yi(e),t)}function ao(e,t,n){const i=t.safeParse(n);return i.success?i.data:(i.error.issues.forEach((t=>{const n=t.path.join(".");e.getFieldState(n)?e.setError(n,{type:"manual",message:t.message}):e.setError("root",{type:"manual",message:t.message})})),null)}const co=e=>so((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),uo=e=>so((e=>{if(!e)return;let t;return"string"==typeof e&&(t=new Date(e)),e instanceof Date&&(t=e),t?(t.setUTCHours(0,0,0,0),t):e}),e),lo=e=>ai().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),po=()=>di("Invalid email address").min(1,"Required"),fo=()=>co(Ri("Valid amount required").positive("Positive amount required")),ho=()=>uo(function(e){return function(e,t){return new e({type:"date",...Te(t)})}(Di,e)}("Valid date required").min(new Date,"Date must be in the future")),mo=e=>ai().max(e,`Maximum length is ${e} characters`),go=Gi({address1:lo(100),address2:mo(100).optional(),city:lo(50),state:mo(50).optional(),postcode:mo(20).optional(),country:lo(50)}),vo=Gi({amount:fo(),message:mo(500).nullish(),giverFirstName:lo(50),giverLastName:lo(50),giverEmail:po(),giverPhone:lo(31),giverAddress:go,cardHolder:lo(101),recipientFirstName:mo(50).nullish(),recipientLastName:mo(50).nullish(),recipientEmail:di("Invalid email address").nullish(),recipientPhone:mo(31).nullish()}),_o=vo.extend({expiry:ho(),notes:mo(500).nullish()}),yo=Gi({balance:fo(),expiry:ho(),message:mo(500).nullish(),notes:mo(500).nullish(),giverFirstName:lo(50),giverLastName:lo(50),giverEmail:po(),giverPhone:lo(31),cardHolder:lo(101),recipientEmail:di("Invalid email address").nullish(),recipientPhone:mo(31).nullish()}),Po=vo.extend({companyId:Ri().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...Te(t)})}(Si,e)}().default(!0),payment:Gi({cardHolder:lo(30),cardNumberToken:lo(50),cardExpiry:lo(5),cardCvcToken:lo(50)}).optional()}),zo=Gi({code:lo(10),password:lo(10)}),bo=zo.extend({amount:fo(),description:lo(200)});let ko;!function(e){e.Purchase="Purchase",e.Redemption="Redemption",e.Adjustment="Adjustment"}(ko||(ko={}));const wo=Gi({grant_type:ai().readonly().default("refresh_token"),client_id:Rn(pi,undefined),client_secret:ai(),refresh_token:ai(),scope:ai().optional()});const Eo=Gi({email:di(),firstName:ai().max(100).optional(),lastName:ai().max(100).optional(),phone:ai().max(20).optional(),scopes:Ui(ai()).optional()});let To,Io,No;!function(e){e.Critical="Critical",e.Error="Error",e.Warn="Warn",e.Info="Info"}(To||(To={})),function(e){e.Debug="Diagnostics",e.Security="Security",e.Audit="Audit"}(Io||(Io={})),function(e){e.General="General",e.Authenticated="Token Authenticated",e.Unauthorized="Unauthorized Access",e.RefreshToken="Refresh Token Created",e.AccessToken="Access Token Created",e.Revoked="Token Revoked",e.UserCreated="User Created",e.UserLinked="User Linked to Company",e.Purchase="Gift Card Purchased",e.Payment="Payment Captured",e.Email="Email Delivery",e.Transaction="Gift Card Transaction"}(No||(No={}));const Ao=e=>{let t=0;const n=Object.values(e.itinerary);for(const e of n){const n=Object.keys(e.nights);for(const i of n)t+=e.nights[i].total}return t};var Ro=i(60),$o=i.n(Ro);const Co=e=>new($o())(e).toDecimalPlaces(2).toNumber();function So(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=Co(n);switch(e.feeType){case A.PercentageOfBooking:if(o)return Co(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return Co(a/(1-t)*e.amount/(100+e.amount))}return Co(a*(e.amount/100));case A.FixedChargePerRoom:case A.FixedChargePerBooking:return e.amount;case A.NightlyChargePerRoom:return Co(e.amount*i);default:return 0}}const Oo=[A.FixedChargePerBooking],xo=[A.PercentageOfBooking,A.FixedChargePerRoom,A.NightlyChargePerRoom],Zo=[A.PercentageOfBooking];function Fo(e,t){return e.filter((e=>t.includes(e.feeType)))}function Do(e){return Fo(e,Oo)}function jo(e){return Fo(e,xo)}function Uo(e){return Fo(e,Zo)}function Mo(e){return{includeInRates:[A.PercentageOfBooking,A.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===A.PercentageOfBooking,appliesToAddons:e===A.PercentageOfBooking,includePreviousFeesInCalculation:e===A.PercentageOfBooking}}const Go=e=>e,Lo=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},Bo=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class Ho{}function Vo(e){return e.toUpperCase()}Ho.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===R.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===R.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(n*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(i=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(o=e.childQuantity*Number(e.childPrice));let r=n+i+o;return $.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},Ho.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Ho.calculateBaseAddonTotal(n,t);let o=0;return(n.fee||n.fees?.length)&&n.quantity?n.fees?.length?n.fees.forEach((e=>{o+=n.quantity*e.amount})):o=n.quantity*Number(n.fee):((n.adultFee||n.adultFees?.length)&&n.adultQuantity&&(n.adultFees?.length?n.adultFees.forEach((e=>{o+=n.adultQuantity*e.amount})):o+=n.adultQuantity??1*Number(n.adultFee)),(n.childFee||n.childFees?.length)&&n.childQuantity&&(n.childFees?.length?n.childFees.forEach((e=>{o+=n.childQuantity??1*e.amount})):o+=n.childQuantity*Number(n.childFee))),$.includes(n.pricingType)&&n.nights&&!t&&(o*=n.nights),{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),Ho.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Ho.calculateBaseAddonTotal(n,t);let o=n.fees||0;n.itemisedFees?.length&&(o=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=n.itemisedFees?.length?i.addonTotal:i.addonTotal+o;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),Ho.calculateTotalForReservation=(e,t=!1)=>{let n=0;return e.itemisedFees?.forEach((e=>{n+=e.amount})),e.reservations.forEach((e=>{n+=e.total.afterTax;const i=Object.keys(e.nights)?.length??0;if(n+=e.fees??0,e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=Ho.calculateReservationAddonTotal(o,t)?.total}})),Co(n)}})(),o})()));
1
+ define("@roomstay/core",["decimal.js"],(e=>(()=>{"use strict";var t={60:t=>{t.exports=e}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{let e,t,n,r,a;i.r(o),i.d(o,{ADDON_PER_NIGHT_TYPES:()=>Fo,AddGiftCardSchema:()=>vo,AdyenEventCode:()=>No,AdyenResultCode:()=>Ao,BaseGiftCardSchema:()=>go,CancelGiftCardTransactionSchema:()=>Oo,CompleteGiftCardTransactionSchema:()=>Co,CreatePaymentSessionSchema:()=>Po,DATE_FORMAT:()=>N,EAddonPricingType:()=>xo,EBookingFlow:()=>t,EBookingPaymentMethod:()=>n,EBookingStatus:()=>e,ECompanyProvider:()=>l,EDistanceUnitType:()=>v,EFeeType:()=>R,EGiftCardPaymentProvider:()=>Eo,EGiftCardPaymentStatus:()=>To,EGiftCardPaymentType:()=>yo,EGiftCardTransactionType:()=>Io,EGuaranteePolicyDepositMode:()=>k,EGuarantyPolicyPrepaymentType:()=>w,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,ELogCategory:()=>Do,ELogSeverity:()=>Zo,ELogType:()=>Uo,EPlanpayBookingStatus:()=>a,ERMSAuthSyncHistoryStatus:()=>P,ERMSDiscountType:()=>_,ERMSSyncStrategy:()=>y,ERoomstayEventSource:()=>E,ERoomstayImageSize:()=>z,ETransactionStatus:()=>Ro,EditGiftCardSchema:()=>_o,GuestProfile:()=>d,HttpMethod:()=>I,IAuxiliaryFilterType:()=>g,IMaintenanceStatusService:()=>b,InternationalAddressSchema:()=>mo,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>s,Package:()=>T,PurchaseGiftCardSchema:()=>zo,RedeemGiftCardSchema:()=>wo,RefreshGiftCardTokenSchema:()=>So,RefundGiftCardSchema:()=>bo,RegisterGiftCardAdminSchema:()=>$o,Reservation:()=>u,ReservedPackage:()=>A,RoundingType:()=>Go,TotalCalculator:()=>ir,ValidateGiftCardSchema:()=>ko,calculateFeeAmount:()=>Bo,calculateTotalForMemberBooking:()=>jo,getFeeOptionValidity:()=>Xo,getFilteredBookingAddonFees:()=>Ko,getFilteredBookingFees:()=>Qo,getFilteredBookingRateFees:()=>Jo,maxString:()=>ho,nameof:()=>er,preprocessDate:()=>co,preprocessNumber:()=>so,requireEmail:()=>lo,requireFutureDate:()=>fo,requirePositiveAmount:()=>po,requireString:()=>uo,resizeRoomstayImageUrl:()=>nr,roundMoney:()=>Ho,subset:()=>tr,uppercaseString:()=>or,validateFormWithZod:()=>ao}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(e||(e={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(t||(t={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(n||(n={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard",e.Stripe="Stripe"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(a||(a={}));const s=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,g,v,_,y,P,z,b,k,w,E;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(g||(g={})),function(e){e.Metric="metric",e.Imperial="imperial"}(v||(v={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(_||(_={})),function(e){e.Hotel="hotel",e.HotelImages="hotelImages",e.Cancellation="cancellation",e.Room="room",e.Rates="rates",e.OneGuaranteePolicy="oneGuaranteePolicy",e.RoomRates="roomRates",e.RoomImages="roomImages",e.BookingSources="booking-sources",e.Areas="areas",e.Dwellings="dwellings",e.AreaDwellings="areaDwellings",e.ConvertDwellingConfigToAuxInput="convertDwellingConfigToAuxInput",e.Discounts="discounts",e.PropertyDiscounts="propertyDiscounts",e.RoomDiscounts="roomDiscounts",e.PropertySundries="propertySundries",e.PropertyFees="propertyFees",e.PropertyCards="property-cards",e.Countries="countries",e.Addons="addons",e.Requirements="requirements",e.RoomAddons="room-addons",e.ClientFacingPromoSync="clientFacingPromoSync",e.ClientFacingRoomSync="clientFacingRoomSync",e.ClientFacingRateSync="clientFacingRateSync",e.NewRateFetch="newRateFetch"}(y||(y={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(P||(P={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(z||(z={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(b||(b={}));class T{constructor(){this.ratePlanCode=void 0,this.name=void 0,this.description=void 0,this.inclusive=void 0,this.image=void 0,this.url=void 0,this.pricingType=void 0,this.quantity=void 0,this.category=void 0,this.cancelPenalty=void 0,this.guaranteeDescription=void 0,this.availability={}}}class A extends T{constructor(...e){super(...e),this.code=void 0,this.price=void 0,this.fees=void 0,this.itemisedFees=void 0,this.adultQuantity=void 0,this.childQuantity=void 0,this.adultPrice=void 0,this.childPrice=void 0,this.startDate=void 0,this.startTime=void 0,this.hideDatePicker=!1,this.order=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(k||(k={})),function(e){e.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(w||(w={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(E||(E={}));const N="DD/MM/YYYY";let I,R;function C(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in a.prototype)e in n||Object.defineProperty(n,e,{value:a.prototype[e].bind(n)});n._zod.constr=a,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function a(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(I||(I={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(R||(R={})),Object.freeze({status:"aborted"}),Symbol("zod_brand");class O extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class S extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const $={};function x(e){return e&&Object.assign($,e),$}const F=/^[cC][^\s-]{8,}$/,Z=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,U=/^[0-9a-vA-V]{20}$/,j=/^[A-Za-z0-9]{27}$/,L=/^[a-zA-Z0-9_-]{21}$/,M=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,G=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,H=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,B=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,V=/^(?:(?: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])$/,Y=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,q=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,W=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Q=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,J=/^[A-Za-z0-9_-]*$/,K=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,X=/^\+(?:[0-9]){6,14}[0-9]$/,ee="(?:(?:\\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])))",te=new RegExp(`^${ee}$`);function ne(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const ie=/^\d+$/,oe=/^-?\d+(?:\.\d+)?/i,re=/true|false/i,ae=/^[^A-Z]*$/,se=/^[^a-z]*$/;function ce(e,t){return"bigint"==typeof t?t.toString():t}function ue(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function de(e){return null==e}function le(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const pe=Symbol("evaluating");function fe(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==pe)return void 0===i&&(i=pe,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function he(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function me(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ge(e){return JSON.stringify(e)}const ve="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _e(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ye=ue((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function Pe(e){if(!1===_e(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==_e(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ze(e){return Pe(e)?{...e}:e}const be=new Set(["string","number","symbol"]);function ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function we(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Ee(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}new Set(["string","number","bigint","boolean","symbol","undefined"]);const Te={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ae(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Ne(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Ie(e){return"string"==typeof e?e:e?.message}function Re(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Ie(e.inst?._zod.def?.error?.(e))??Ie(t?.error?.(e))??Ie(n.customError?.(e))??Ie(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Ce(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Oe(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Se=C("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),$e={number:"number",bigint:"bigint",object:"date"},xe=C("$ZodCheckLessThan",((e,t)=>{Se.init(e,t);const n=$e[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Fe=C("$ZodCheckGreaterThan",((e,t)=>{Se.init(e,t);const n=$e[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Ze=C("$ZodCheckMultipleOf",((e,t)=>{Se.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(i)){const e=i.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),De=C("$ZodCheckNumberFormat",((e,t)=>{Se.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Te[t.format];e._zod.onattach.push((e=>{const i=e._zod.bag;i.format=t.format,i.minimum=o,i.maximum=r,n&&(i.pattern=ie)})),e._zod.check=a=>{const s=a.value;if(n){if(!Number.isInteger(s))return void a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}s<o&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>r&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:r,inst:e})}})),Ue=C("$ZodCheckMaxLength",((e,t)=>{var n;Se.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const i=n.value;if(i.length<=t.maximum)return;const o=Ce(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),je=C("$ZodCheckMinLength",((e,t)=>{var n;Se.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const i=n.value;if(i.length>=t.minimum)return;const o=Ce(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Le=C("$ZodCheckLengthEquals",((e,t)=>{var n;Se.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const i=n.value,o=i.length;if(o===t.length)return;const r=Ce(i),a=o>t.length;n.issues.push({origin:r,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Me=C("$ZodCheckStringFormat",((e,t)=>{var n,i;Se.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})})),Ge=C("$ZodCheckRegex",((e,t)=>{Me.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),He=C("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=ae),Me.init(e,t)})),Be=C("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=se),Me.init(e,t)})),Ve=C("$ZodCheckIncludes",((e,t)=>{Se.init(e,t);const n=ke(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),Ye=C("$ZodCheckStartsWith",((e,t)=>{Se.init(e,t);const n=new RegExp(`^${ke(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),qe=C("$ZodCheckEndsWith",((e,t)=>{Se.init(e,t);const n=new RegExp(`.*${ke(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),We=C("$ZodCheckOverwrite",((e,t)=>{Se.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Qe{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),i=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of i)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Je=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ce,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ke=C("$ZodError",Je),Xe=C("$ZodError",Je,{Parent:Error}),et=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},r);if(a instanceof Promise)throw new O;if(a.issues.length){const t=new(o?.Err??e)(a.issues.map((e=>Re(e,r,x()))));throw ve(t,o?.callee),t}return a.value},tt=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},r);if(a instanceof Promise&&(a=await a),a.issues.length){const t=new(o?.Err??e)(a.issues.map((e=>Re(e,r,x()))));throw ve(t,o?.callee),t}return a.value},nt=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},o);if(r instanceof Promise)throw new O;return r.issues.length?{success:!1,error:new(e??Ke)(r.issues.map((e=>Re(e,o,x()))))}:{success:!0,data:r.value}},it=nt(Xe),ot=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map((e=>Re(e,o,x()))))}:{success:!0,data:r.value}},rt=ot(Xe),at=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return et(e)(t,n,o)},st=e=>(t,n,i)=>et(e)(t,n,i),ct=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return tt(e)(t,n,o)},ut=e=>async(t,n,i)=>tt(e)(t,n,i),dt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},lt=e=>(t,n,i)=>nt(e)(t,n,i),pt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ot(e)(t,n,o)},ft=e=>async(t,n,i)=>ot(e)(t,n,i),ht={major:4,minor:1,patch:5},mt=C("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ht;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=Ae(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,a=r._zod.check(e);if(a instanceof Promise&&!1===n?.async)throw new O;if(i||a instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await a,e.issues.length!==t&&(o||(o=Ae(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ae(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ae(n))return n.aborted=!0,n;const a=t(o,i,r);if(a instanceof Promise){if(!1===r.async)throw new O;return a.then((t=>e._zod.parse(t,r)))}return e._zod.parse(a,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const a=e._zod.parse(o,r);if(a instanceof Promise){if(!1===r.async)throw new O;return a.then((e=>t(e,i,r)))}return t(a,i,r)}}e["~standard"]={validate:t=>{try{const n=it(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return rt(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),gt=C("$ZodString",((e,t)=>{var n;mt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),vt=C("$ZodStringFormat",((e,t)=>{Me.init(e,t),gt.init(e,t)})),_t=C("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=G),vt.init(e,t)})),yt=C("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=H(e))}else t.pattern??(t.pattern=H());vt.init(e,t)})),Pt=C("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=B),vt.init(e,t)})),zt=C("$ZodURL",((e,t)=>{vt.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:K.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=i)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),bt=C("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),vt.init(e,t)})),kt=C("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=L),vt.init(e,t)})),wt=C("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=F),vt.init(e,t)})),Et=C("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=Z),vt.init(e,t)})),Tt=C("$ZodULID",((e,t)=>{t.pattern??(t.pattern=D),vt.init(e,t)})),At=C("$ZodXID",((e,t)=>{t.pattern??(t.pattern=U),vt.init(e,t)})),Nt=C("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=j),vt.init(e,t)})),It=C("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ne({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${ee}T(?:${i})$`)}(t)),vt.init(e,t)})),Rt=C("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=te),vt.init(e,t)})),Ct=C("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ne(t)}$`)),vt.init(e,t)})),Ot=C("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=M),vt.init(e,t)})),St=C("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=V),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),$t=C("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=Y),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv6"})),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}})),xt=C("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=q),vt.init(e,t)})),Ft=C("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=W),vt.init(e,t),e._zod.check=n=>{const[i,o]=n.value.split("/");try{if(!o)throw new Error;const e=Number(o);if(`${e}`!==o)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function Zt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Dt=C("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=Q),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Zt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),Ut=C("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=J),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!J.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Zt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),jt=C("$ZodE164",((e,t)=>{t.pattern??(t.pattern=X),vt.init(e,t)})),Lt=C("$ZodJWT",((e,t)=>{vt.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),Mt=C("$ZodNumber",((e,t)=>{mt.init(e,t),e._zod.pattern=e._zod.bag.pattern??oe,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const r="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...r?{received:r}:{}}),n}})),Gt=C("$ZodNumber",((e,t)=>{De.init(e,t),Mt.init(e,t)})),Ht=C("$ZodBoolean",((e,t)=>{mt.init(e,t),e._zod.pattern=re,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}})),Bt=C("$ZodUnknown",((e,t)=>{mt.init(e,t),e._zod.parse=e=>e})),Vt=C("$ZodNever",((e,t)=>{mt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),Yt=C("$ZodDate",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const o=n.value,r=o instanceof Date;return r&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...r?{received:"Invalid Date"}:{},inst:e}),n}}));function qt(e,t,n){e.issues.length&&t.issues.push(...Ne(n,e.issues)),t.value[n]=e.value}const Wt=C("$ZodArray",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const a=o[e],s=t.element._zod.run({value:a,issues:[]},i);s instanceof Promise?r.push(s.then((t=>qt(t,n,e)))):qt(s,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function Qt(e,t,n,i){e.issues.length&&t.issues.push(...Ne(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Jt(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape[n]._zod.traits.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(i=e.shape,Object.keys(i).filter((e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout)));var i;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Kt(e,t,n,i,o,r){const a=[],s=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(s.has(o))continue;if("never"===u){a.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>Qt(e,n,o,t)))):Qt(r,n,o,t)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const Xt=C("$ZodObject",((e,t)=>{mt.init(e,t);const n=ue((()=>Jt(t)));fe(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const i=e[t]._zod;if(i.values){n[t]??(n[t]=new Set);for(const e of i.values)n[t].add(e)}}return n}));const i=_e,o=t.catchall;let r;e._zod.parse=(t,a)=>{r??(r=n.value);const s=t.value;if(!i(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:s[e],issues:[]},a);n instanceof Promise?c.push(n.then((n=>Qt(n,t,e,s)))):Qt(n,t,e,s)}return o?Kt(c,s,t,a,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),en=C("$ZodObjectJIT",((e,t)=>{Xt.init(e,t);const n=e._zod.parse,i=ue((()=>Jt(t)));let o;const r=_e,a=!$.jitless,s=a&&ye.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?a&&s&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new Qe(["shape","payload","ctx"]),n=i.value,o=e=>{const t=ge(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let a=0;for(const e of n.keys)r[e]="key_"+a++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=ge(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n `)}t.write("payload.value = newResult;"),t.write("return payload;");const s=t.compile();return(t,n)=>s(e,t,n)})(t.shape)),d=o(d,l),c?Kt([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function tn(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!Ae(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>Re(e,i,x())))))}),t)}const nn=C("$ZodUnion",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),fe(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),fe(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),fe(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>le(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let a=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)s.push(t),a=!0;else{if(0===t.issues.length)return t;s.push(t)}}return a?Promise.all(s).then((t=>tn(t,o,e,r))):tn(s,o,e,r)}})),on=C("$ZodIntersection",((e,t)=>{mt.init(e,t),e._zod.parse=(e,n)=>{const i=e.value,o=t.left._zod.run({value:i,issues:[]},n),r=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||r instanceof Promise?Promise.all([o,r]).then((([t,n])=>an(e,t,n))):an(e,o,r)}}));function rn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Pe(e)&&Pe(t)){const n=Object.keys(t),i=Object.keys(e).filter((e=>-1!==n.indexOf(e))),o={...e,...t};for(const n of i){const i=rn(e[n],t[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o[n]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const o=rn(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function an(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ae(e))return e;const i=rn(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const sn=C("$ZodEnum",((e,t)=>{mt.init(e,t);const n=function(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter((e=>be.has(typeof e))).map((e=>"string"==typeof e?ke(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const r=t.value;return i.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),cn=C("$ZodTransform",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new S(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then((e=>(n.value=e,n)));if(o instanceof Promise)throw new O;return n.value=o,n}}));function un(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const dn=C("$ZodOptional",((e,t)=>{mt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",fe(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((t=>un(t,e.value))):un(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),ln=C("$ZodNullable",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(e.source)}|null)$`):void 0})),fe(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),pn=C("$ZodDefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((e=>fn(e,t))):fn(i,t)}}));function fn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const hn=C("$ZodPrefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),mn=C("$ZodNonOptional",((e,t)=>{mt.init(e,t),fe(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then((t=>gn(t,e))):gn(o,e)}}));function gn(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const vn=C("$ZodCatch",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Re(e,n,x())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Re(e,n,x())))},input:e.value}),e.issues=[]),e)}})),_n=C("$ZodPipe",((e,t)=>{mt.init(e,t),fe(e._zod,"values",(()=>t.in._zod.values)),fe(e._zod,"optin",(()=>t.in._zod.optin)),fe(e._zod,"optout",(()=>t.out._zod.optout)),fe(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const i=t.out._zod.run(e,n);return i instanceof Promise?i.then((e=>yn(e,t.in,n))):yn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>yn(e,t.out,n))):yn(i,t.out,n)}}));function yn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Pn=C("$ZodReadonly",((e,t)=>{mt.init(e,t),fe(e._zod,"propValues",(()=>t.innerType._zod.propValues)),fe(e._zod,"values",(()=>t.innerType._zod.values)),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(zn):zn(i)}}));function zn(e){return e.value=Object.freeze(e.value),e}const bn=C("$ZodCustom",((e,t)=>{Se.init(e,t),mt.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then((t=>kn(t,n,i,e)));kn(o,n,i,e)}}));function kn(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push(Oe(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class wn{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function En(){return new wn}const Tn=En();function An(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ee(t)})}function Nn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(t)})}function In(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(t)})}function Rn(e,t){return new xe({check:"less_than",...Ee(t),value:e,inclusive:!1})}function Cn(e,t){return new xe({check:"less_than",...Ee(t),value:e,inclusive:!0})}function On(e,t){return new Fe({check:"greater_than",...Ee(t),value:e,inclusive:!1})}function Sn(e,t){return new Fe({check:"greater_than",...Ee(t),value:e,inclusive:!0})}function $n(e,t){return new Ze({check:"multiple_of",...Ee(t),value:e})}function xn(e,t){return new Ue({check:"max_length",...Ee(t),maximum:e})}function Fn(e,t){return new je({check:"min_length",...Ee(t),minimum:e})}function Zn(e,t){return new Le({check:"length_equals",...Ee(t),length:e})}function Dn(e){return new We({check:"overwrite",tx:e})}const Un=C("ZodISODateTime",((e,t)=>{It.init(e,t),si.init(e,t)}));const jn=C("ZodISODate",((e,t)=>{Rt.init(e,t),si.init(e,t)}));const Ln=C("ZodISOTime",((e,t)=>{Ct.init(e,t),si.init(e,t)}));const Mn=C("ZodISODuration",((e,t)=>{Ot.init(e,t),si.init(e,t)}));const Gn=(e,t)=>{Ke.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},i={_errors:[]},o=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>o({issues:e})));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)i._errors.push(n(t));else{let e=i,o=0;for(;o<t.path.length;){const i=t.path[o];o===t.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(n(t))):e[i]=e[i]||{_errors:[]},e=e[i],o++}}};return o(e),i}(e,t)},flatten:{value:t=>function(e,t=(e=>e.message)){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ce,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ce,2)}},isEmpty:{get:()=>0===e.issues.length}})},Hn=(C("ZodError",Gn),C("ZodError",Gn,{Parent:Error})),Bn=et(Hn),Vn=tt(Hn),Yn=nt(Hn),qn=ot(Hn),Wn=at(Hn),Qn=st(Hn),Jn=ct(Hn),Kn=ut(Hn),Xn=dt(Hn),ei=lt(Hn),ti=pt(Hn),ni=ft(Hn),ii=C("ZodType",((e,t)=>(mt.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>we(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Bn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Yn(e,t,n),e.parseAsync=async(t,n)=>Vn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>qn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Wn(e,t,n),e.decode=(t,n)=>Qn(e,t,n),e.encodeAsync=async(t,n)=>Jn(e,t,n),e.decodeAsync=async(t,n)=>Kn(e,t,n),e.safeEncode=(t,n)=>Xn(e,t,n),e.safeDecode=(t,n)=>ei(e,t,n),e.safeEncodeAsync=async(t,n)=>ti(e,t,n),e.safeDecodeAsync=async(t,n)=>ni(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ee(n)})}(oo,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new Se({check:"custom",...Ee(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Oe(e,n.value,t._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Oe(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Dn(t)),e.optional=()=>qi(e),e.nullable=()=>Qi(e),e.nullish=()=>qi(Qi(e)),e.nonoptional=t=>function(e,t){return new Xi({type:"nonoptional",innerType:e,...Ee(t)})}(e,t),e.array=()=>Ui(e),e.or=t=>function(e,t){return new Mi({type:"union",options:e,...Ee(t)})}([e,t]),e.and=t=>new Gi({type:"intersection",left:e,right:t}),e.transform=t=>no(e,Vi(t)),e.default=t=>{return n=t,new Ji({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.prefault=t=>{return n=t,new Ki({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.catch=t=>{return new eo({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>no(e,t),e.readonly=()=>new io({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Tn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Tn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Tn.get(e);const n=e.clone();return Tn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),oi=C("_ZodString",((e,t)=>{gt.init(e,t),ii.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Ge({check:"string_format",format:"regex",...Ee(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ve({check:"string_format",format:"includes",...Ee(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Ye({check:"string_format",format:"starts_with",...Ee(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new qe({check:"string_format",format:"ends_with",...Ee(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Fn(...t)),e.max=(...t)=>e.check(xn(...t)),e.length=(...t)=>e.check(Zn(...t)),e.nonempty=(...t)=>e.check(Fn(1,...t)),e.lowercase=t=>e.check(function(e){return new He({check:"string_format",format:"lowercase",...Ee(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Be({check:"string_format",format:"uppercase",...Ee(e)})}(t)),e.trim=()=>e.check(Dn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return Dn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(Dn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(Dn((e=>e.toUpperCase())))})),ri=C("ZodString",((e,t)=>{gt.init(e,t),oi.init(e,t),e.email=t=>e.check(An(ci,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ee(t)})}(pi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(t)})}(Ai,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(t)})}(fi,t)),e.guid=t=>e.check(Nn(di,t)),e.uuid=t=>e.check(In(li,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(t)})}(li,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(t)})}(li,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(t)})}(li,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(t)})}(hi,t)),e.guid=t=>e.check(Nn(di,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(t)})}(mi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(t)})}(gi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(t)})}(vi,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(t)})}(wi,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(t)})}(Ei,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(t)})}(_i,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(t)})}(yi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(t)})}(Pi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(t)})}(zi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(t)})}(bi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(t)})}(ki,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(t)})}(Ti,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ee(t)})}(Un,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Ee(t)})}(jn,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ee(t)})}(Ln,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ee(t)})}(Mn,e)}(t))}));function ai(e){return function(e,t){return new e({type:"string",...Ee(t)})}(ri,e)}const si=C("ZodStringFormat",((e,t)=>{vt.init(e,t),oi.init(e,t)})),ci=C("ZodEmail",((e,t)=>{Pt.init(e,t),si.init(e,t)}));function ui(e){return An(ci,e)}const di=C("ZodGUID",((e,t)=>{_t.init(e,t),si.init(e,t)})),li=C("ZodUUID",((e,t)=>{yt.init(e,t),si.init(e,t)})),pi=C("ZodURL",((e,t)=>{zt.init(e,t),si.init(e,t)})),fi=C("ZodEmoji",((e,t)=>{bt.init(e,t),si.init(e,t)})),hi=C("ZodNanoID",((e,t)=>{kt.init(e,t),si.init(e,t)})),mi=C("ZodCUID",((e,t)=>{wt.init(e,t),si.init(e,t)})),gi=C("ZodCUID2",((e,t)=>{Et.init(e,t),si.init(e,t)})),vi=C("ZodULID",((e,t)=>{Tt.init(e,t),si.init(e,t)})),_i=C("ZodXID",((e,t)=>{At.init(e,t),si.init(e,t)})),yi=C("ZodKSUID",((e,t)=>{Nt.init(e,t),si.init(e,t)})),Pi=C("ZodIPv4",((e,t)=>{St.init(e,t),si.init(e,t)})),zi=C("ZodIPv6",((e,t)=>{$t.init(e,t),si.init(e,t)})),bi=C("ZodCIDRv4",((e,t)=>{xt.init(e,t),si.init(e,t)})),ki=C("ZodCIDRv6",((e,t)=>{Ft.init(e,t),si.init(e,t)})),wi=C("ZodBase64",((e,t)=>{Dt.init(e,t),si.init(e,t)})),Ei=C("ZodBase64URL",((e,t)=>{Ut.init(e,t),si.init(e,t)})),Ti=C("ZodE164",((e,t)=>{jt.init(e,t),si.init(e,t)})),Ai=C("ZodJWT",((e,t)=>{Lt.init(e,t),si.init(e,t)})),Ni=C("ZodNumber",((e,t)=>{Mt.init(e,t),ii.init(e,t),e.gt=(t,n)=>e.check(On(t,n)),e.gte=(t,n)=>e.check(Sn(t,n)),e.min=(t,n)=>e.check(Sn(t,n)),e.lt=(t,n)=>e.check(Rn(t,n)),e.lte=(t,n)=>e.check(Cn(t,n)),e.max=(t,n)=>e.check(Cn(t,n)),e.int=t=>e.check(Ci(t)),e.safe=t=>e.check(Ci(t)),e.positive=t=>e.check(On(0,t)),e.nonnegative=t=>e.check(Sn(0,t)),e.negative=t=>e.check(Rn(0,t)),e.nonpositive=t=>e.check(Cn(0,t)),e.multipleOf=(t,n)=>e.check($n(t,n)),e.step=(t,n)=>e.check($n(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Ii(e){return function(e,t){return new e({type:"number",checks:[],...Ee(t)})}(Ni,e)}const Ri=C("ZodNumberFormat",((e,t)=>{Gt.init(e,t),Ni.init(e,t)}));function Ci(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ee(t)})}(Ri,e)}const Oi=C("ZodBoolean",((e,t)=>{Ht.init(e,t),ii.init(e,t)}));const Si=C("ZodUnknown",((e,t)=>{Bt.init(e,t),ii.init(e,t)}));function $i(){return new Si({type:"unknown"})}const xi=C("ZodNever",((e,t)=>{Vt.init(e,t),ii.init(e,t)}));function Fi(e){return function(e,t){return new e({type:"never",...Ee(t)})}(xi,e)}const Zi=C("ZodDate",((e,t)=>{Yt.init(e,t),ii.init(e,t),e.min=(t,n)=>e.check(Sn(t,n)),e.max=(t,n)=>e.check(Cn(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}));const Di=C("ZodArray",((e,t)=>{Wt.init(e,t),ii.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Fn(t,n)),e.nonempty=t=>e.check(Fn(1,t)),e.max=(t,n)=>e.check(xn(t,n)),e.length=(t,n)=>e.check(Zn(t,n)),e.unwrap=()=>e.element}));function Ui(e,t){return function(e,t,n){return new e({type:"array",element:t,...Ee(n)})}(Di,e,t)}const ji=C("ZodObject",((e,t)=>{en.init(e,t),ii.init(e,t),fe(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Hi({type:"enum",entries:n,...Ee(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:$i()}),e.loose=()=>e.clone({...e._zod.def,catchall:$i()}),e.strict=()=>e.clone({...e._zod.def,catchall:Fi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Pe(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return he(this,"shape",n),n},checks:[]});return we(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!Pe(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return he(this,"shape",n),n},checks:e._zod.def.checks};return we(e,n)}(e,t),e.merge=t=>function(e,t){const n=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return he(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return we(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return we(e,me(e._zod.def,{get shape(){const e={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(e[i]=n.shape[i])}return he(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=me(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return he(this,"shape",i),i},checks:[]});return we(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=me(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(const t in i)o[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return he(this,"shape",o),o},checks:[]});return we(t,i)}(Yi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=me(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:i[t]}))}else for(const t in i)o[t]=new e({type:"nonoptional",innerType:i[t]});return he(this,"shape",o),o},checks:[]});return we(t,i)}(Xi,e,t[0])}));function Li(e,t){const n={type:"object",get shape(){var t;return he(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...Ee(t)};return new ji(n)}const Mi=C("ZodUnion",((e,t)=>{nn.init(e,t),ii.init(e,t),e.options=t.options}));const Gi=C("ZodIntersection",((e,t)=>{on.init(e,t),ii.init(e,t)})),Hi=C("ZodEnum",((e,t)=>{sn.init(e,t),ii.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,i)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new Hi({...t,checks:[],...Ee(i),entries:o})},e.exclude=(e,i)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Hi({...t,checks:[],...Ee(i),entries:o})}}));const Bi=C("ZodTransform",((e,t)=>{cn.init(e,t),ii.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new S(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(Oe(i,n.value,t));else{const t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Oe(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function Vi(e){return new Bi({type:"transform",transform:e})}const Yi=C("ZodOptional",((e,t)=>{dn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function qi(e){return new Yi({type:"optional",innerType:e})}const Wi=C("ZodNullable",((e,t)=>{ln.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Qi(e){return new Wi({type:"nullable",innerType:e})}const Ji=C("ZodDefault",((e,t)=>{pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Ki=C("ZodPrefault",((e,t)=>{hn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Xi=C("ZodNonOptional",((e,t)=>{mn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),eo=C("ZodCatch",((e,t)=>{vn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),to=C("ZodPipe",((e,t)=>{_n.init(e,t),ii.init(e,t),e.in=t.in,e.out=t.out}));function no(e,t){return new to({type:"pipe",in:e,out:t})}const io=C("ZodReadonly",((e,t)=>{Pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),oo=C("ZodCustom",((e,t)=>{bn.init(e,t),ii.init(e,t)}));function ro(e,t){return no(Vi(e),t)}function ao(e,t,n){const i=t.safeParse(n);return i.success?i.data:(i.error.issues.forEach((t=>{const n=t.path.join(".");e.getFieldState(n)?e.setError(n,{type:"manual",message:t.message}):e.setError("root",{type:"manual",message:t.message})})),null)}const so=e=>ro((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),co=e=>ro((e=>{if(!e)return;let t;return"string"==typeof e&&(t=new Date(e)),e instanceof Date&&(t=e),t?(t.setUTCHours(0,0,0,0),t):e}),e),uo=e=>ai().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),lo=()=>ui("Invalid email address").min(1,"Required"),po=()=>so(Ii("Valid amount required").positive("Positive amount required")),fo=()=>co(function(e){return function(e,t){return new e({type:"date",...Ee(t)})}(Zi,e)}("Valid date required").min(new Date,"Date must be in the future")),ho=e=>ai().max(e,`Maximum length is ${e} characters`),mo=Li({address1:uo(100),address2:ho(100).optional(),city:uo(50),state:ho(50).optional(),postcode:ho(20).optional(),country:uo(50)}),go=Li({amount:po(),message:ho(500).nullish(),giverFirstName:uo(50),giverLastName:uo(50),giverEmail:lo(),giverPhone:uo(31),giverAddress:mo,cardHolder:uo(101),recipientFirstName:ho(50).nullish(),recipientLastName:ho(50).nullish(),recipientEmail:ui("Invalid email address").nullish(),recipientPhone:ho(31).nullish()}),vo=go.extend({expiry:fo(),notes:ho(500).nullish()}),_o=Li({balance:po(),expiry:fo(),message:ho(500).nullish(),notes:ho(500).nullish(),giverFirstName:uo(50),giverLastName:uo(50),giverEmail:lo(),giverPhone:uo(31),cardHolder:uo(101),recipientEmail:ui("Invalid email address").nullish(),recipientPhone:ho(31).nullish()});let yo;!function(e){e.Passthrough="Passthrough",e.PaymentProcessor="PaymentProcessor"}(yo||(yo={}));const Po=Li({companyId:Ii().int().positive(),amount:po(),currency:uo(3).default("AUD")}),zo=go.extend({companyId:Ii().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...Ee(t)})}(Oi,e)}().default(!0),payment:Li({sessionId:uo(100),resultCode:uo(50),pspReference:ho(100).optional()}).optional(),cardNumberToken:ho(200).optional(),cardCvcToken:ho(200).optional(),cardExpiry:ho(5).optional(),cardType:ho(20).optional()}),bo=Li({giftCardId:Ii().int().positive(),reason:ho(500).optional()}),ko=Li({companyId:Ii().int().positive().nullish(),code:uo(10),password:uo(10)}),wo=ko.extend({amount:po(),description:uo(200)});let Eo,To,Ao,No,Io,Ro;!function(e){e.Adyen="Adyen"}(Eo||(Eo={})),function(e){e.Pending="Pending",e.Authorized="Authorized",e.Captured="Captured",e.Failed="Failed",e.Refunded="Refunded"}(To||(To={})),function(e){e.Authorised="Authorised",e.Refused="Refused",e.Cancelled="Cancelled",e.Pending="Pending",e.Received="Received",e.Error="Error",e.IdentifyShopper="IdentifyShopper",e.ChallengeShopper="ChallengeShopper"}(Ao||(Ao={})),function(e){e.AUTHORISATION="AUTHORISATION",e.CAPTURE="CAPTURE",e.REFUND="REFUND",e.CANCELLATION="CANCELLATION",e.REFUND_FAILED="REFUND_FAILED",e.CAPTURE_FAILED="CAPTURE_FAILED"}(No||(No={})),function(e){e.Purchase="Purchase",e.Redemption="Redemption",e.Adjustment="Adjustment"}(Io||(Io={})),function(e){e.Pending="Pending",e.Complete="Complete",e.Cancelled="Cancelled",e.Expired="Expired"}(Ro||(Ro={}));const Co=Li({code:uo(10),token:uo(128)}),Oo=Li({companyId:Ii().int().positive(),code:uo(10),token:uo(128)}),So=Li({grant_type:ai().readonly().default("refresh_token"),client_id:In(li,undefined),client_secret:ai(),refresh_token:ai(),scope:ai().optional()});const $o=Li({email:ui(),firstName:ai().max(100).optional(),lastName:ai().max(100).optional(),phone:ai().max(20).optional(),scopes:Ui(ai()).optional()});let xo;!function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(xo||(xo={}));const Fo=[xo.PER_NIGHT,xo.PER_PERSON_PER_NIGHT,xo.PER_QUANTITY_NAME_PER_NIGHT,xo.PER_ROOM_QUANTITY_PER_NIGHT,xo.PER_PERSON_OCCUPANCY_PER_NIGHT,xo.PER_ADULT_OCCUPANCY_PER_NIGHT,xo.PER_CHILD_OCCUPANCY_PER_NIGHT,xo.PER_ALL_PERSONS_PER_NIGHT];let Zo,Do,Uo;!function(e){e.Critical="Critical",e.Error="Error",e.Warn="Warn",e.Info="Info"}(Zo||(Zo={})),function(e){e.Debug="Diagnostics",e.Security="Security",e.Audit="Audit"}(Do||(Do={})),function(e){e.General="General",e.Authenticated="Token Authenticated",e.Unauthorized="Unauthorized Access",e.RefreshToken="Refresh Token Created",e.AccessToken="Access Token Created",e.Revoked="Token Revoked",e.UserCreated="User Created",e.UserLinked="User Linked to Company",e.Purchase="Gift Card Purchased",e.Payment="Payment",e.Email="Email Delivery",e.Transaction="Gift Card Transaction"}(Uo||(Uo={}));const jo=e=>{let t=0;const n=Object.values(e.itinerary);for(const e of n){const n=Object.keys(e.nights);for(const i of n)t+=e.nights[i].total}return t};var Lo=i(60),Mo=i.n(Lo);const Go={UP:Mo().ROUND_UP,DOWN:Mo().ROUND_DOWN,CEIL:Mo().ROUND_CEIL,FLOOR:Mo().ROUND_FLOOR,HALF_UP:Mo().ROUND_HALF_UP,HALF_DOWN:Mo().ROUND_HALF_DOWN,HALF_EVEN:Mo().ROUND_HALF_EVEN,HALF_CEIL:Mo().ROUND_HALF_CEIL,HALF_FLOOR:Mo().ROUND_HALF_FLOOR},Ho=(e,t)=>{const{precision:n=2,rounding:i=Go.HALF_UP}=t||{};return new(Mo())(e).toDecimalPlaces(n,i).toNumber()};function Bo(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:a=[]}=t,s=Ho(n);switch(e.feeType){case R.PercentageOfBooking:if(o)return Ho(s*e.amount/(100+e.amount));if(r){const t=a.reduce(((e,t)=>e+t/(100+t)),0);return Ho(s/(1-t)*e.amount/(100+e.amount))}return Ho(s*(e.amount/100));case R.FixedChargePerRoom:case R.FixedChargePerBooking:return e.amount;case R.NightlyChargePerRoom:return Ho(e.amount*i);default:return 0}}const Vo=[R.FixedChargePerBooking],Yo=[R.PercentageOfBooking,R.FixedChargePerRoom,R.NightlyChargePerRoom],qo=[R.PercentageOfBooking];function Wo(e,t){return e.filter((e=>t.includes(e.feeType)))}function Qo(e){return Wo(e,Vo)}function Jo(e){return Wo(e,Yo)}function Ko(e){return Wo(e,qo)}function Xo(e){return{includeInRates:[R.PercentageOfBooking,R.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===R.PercentageOfBooking,appliesToAddons:e===R.PercentageOfBooking,includePreviousFeesInCalculation:e===R.PercentageOfBooking}}const er=e=>e,tr=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},nr=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class ir{}function or(e){return e.toUpperCase()}ir.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===xo.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===xo.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(n*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(i=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(o=e.childQuantity*Number(e.childPrice));let r=n+i+o;return Fo.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},ir.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=ir.calculateBaseAddonTotal(n,t);let o=0;return(n.fee||n.fees?.length)&&n.quantity?n.fees?.length?n.fees.forEach((e=>{o+=n.quantity*e.amount})):o=n.quantity*Number(n.fee):((n.adultFee||n.adultFees?.length)&&n.adultQuantity&&(n.adultFees?.length?n.adultFees.forEach((e=>{o+=n.adultQuantity*e.amount})):o+=n.adultQuantity??1*Number(n.adultFee)),(n.childFee||n.childFees?.length)&&n.childQuantity&&(n.childFees?.length?n.childFees.forEach((e=>{o+=n.childQuantity??1*e.amount})):o+=n.childQuantity*Number(n.childFee))),Fo.includes(n.pricingType)&&n.nights&&!t&&(o*=n.nights),{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),ir.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=ir.calculateBaseAddonTotal(n,t);let o=n.fees||0;n.itemisedFees?.length&&(o=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=n.itemisedFees?.length?i.addonTotal:i.addonTotal+o;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),ir.calculateTotalForReservation=(e,t=!1)=>{let n=0;return e.itemisedFees?.forEach((e=>{n+=e.amount})),e.reservations.forEach((e=>{n+=e.total.afterTax;const i=Object.keys(e.nights)?.length??0;if(n+=e.fees??0,e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=ir.calculateReservationAddonTotal(o,t)?.total}})),Ho(n)}})(),o})()));
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * decimal.js v10.4.3
3
+ * An arbitrary-precision Decimal type for JavaScript.
4
+ * https://github.com/MikeMcl/decimal.js
5
+ * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
6
+ * MIT Licence
7
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomstay/core",
3
- "version": "0.1.71",
3
+ "version": "0.1.72-1",
4
4
  "description": "Details shared between Roomstay libraries. Anything from Currency, to Generic types",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [