From 52e3afba654f464009c15b3eaa672f98405ea843 Mon Sep 17 00:00:00 2001 From: Turtuvshin Byambaa Date: Fri, 23 Feb 2024 12:59:00 +0800 Subject: [PATCH] fixed bundle (#5) --- dist/@fleetbase/storefront.min.js | 2 +- dist/@fleetbase/storefront.min.js.map | 2 +- dist/cjs/storefront.js | 2 +- dist/cjs/storefront.js.map | 2 +- dist/esm/storefront.js | 2 +- dist/esm/storefront.js.map | 2 +- package.json | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dist/@fleetbase/storefront.min.js b/dist/@fleetbase/storefront.min.js index 61cc219..8de08ce 100644 --- a/dist/@fleetbase/storefront.min.js +++ b/dist/@fleetbase/storefront.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@fleetbase/sdk")):"function"==typeof define&&define.amd?define(["exports","@fleetbase/sdk"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@fleetbase/storefront"]={},t.sdk)}(this,(function(t,e){"use strict";function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function n(t){for(var e=1;e=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),w}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:H(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),w}},e}function a(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function s(t,e,r,n,o,a,i){try{var s=t[a](i),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){s(a,n,o,i,u,"next",t)}function u(t){s(a,n,o,i,u,"throw",t)}i(void 0)}))}}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{},r={};return t&&(r.store=t),this.adapter.get("".concat(this.namespace,"/count"),r,e)}}),M=function(t){f(r,t);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,r),e.call(this,t,n,"review",o)}return l(r,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),r}(x);function D(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:r}).format(t)}var S=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var r=i(t);if("object"===r){var n=t.size;if("number"==typeof n)return!n}if("number"==typeof t.length&&"function"!==r)return!t.length;if("object"===r){var o=t.length;if("number"==typeof o)return!o}return!1},P=function(t){f(n,t);var r=v(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,n),r.call(this,t,e,"product",o)}return l(n,[{key:"variants",value:function(){return this.getAttribute("variants")}},{key:"addons",value:function(){return this.getAttribute("addon_categories")}},{key:"isOnSale",get:function(){return this.getAttribute("is_on_sale")}},{key:"isNotOnSale",get:function(){return!this.getAttribute("is_on_sale")}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["price","sale_price","currency"]),e=t.price,r=t.sale_price,n=t.currency;return this.isOnSale?S(r)||S(n)?null:D(r/100,n):S(e)||S(n)?null:D(e/100,n)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(r){return new e.Collection(r.map((function(e){return new M(e,t.adapter)})))}))}}]),n}(x),E=function(t){f(n,t);var r=v(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,n),r.call(this,t,e,"category",o)}return l(n,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(r){return new e.Collection(r.map((function(e){return new P(e,t.adapter)})))}))}}]),n}(x),O=new e.StoreActions({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("customers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("customers/login",n({identity:t,password:e},r)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers/verify-code",n({identity:t,code:e},r)).then(this.afterFetch.bind(this))},requestCreationCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"email";return this.adapter.post("customers/request-creation-code",{identity:t,mode:e})},create:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers",n({identity:t,code:e},r)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),A=function(t){f(h,t);var r,a,i,s,d=v(h);function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,h),d.call(this,t,e,"customer",n({actions:O},r))}return l(h,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Re(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"token",get:function(){return this.getAttribute("token")}},{key:"syncDevice",value:(s=u(o().mark((function t(e){var r=this;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",e).then((function(){return r})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"performAuthorizedRequest",value:(i=u(o().mark((function t(e){var r,n,a,i,s=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},n=s.length>2&&void 0!==s[2]?s[2]:"GET",t.prev=2,a={"Customer-Token":this.token},t.next=6,this.adapter.setHeaders(a)[n.toLowerCase()](e,r);case 6:return i=t.sent,t.abrupt("return",i);case 10:throw t.prev=10,t.t0=t.catch(2),console.error("Error in ".concat(n," request to ").concat(e,":"),t.t0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[2,10]])}))),function(t){return i.apply(this,arguments)})},{key:"getSavedPlaces",value:(a=u(o().mark((function t(){var r,n=this;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.performAuthorizedRequest("customers/places");case 3:return r=t.sent,t.abrupt("return",new e.Collection(r.map((function(t){return new e.Place(t,n.adapter)}))));case 7:throw t.prev=7,t.t0=t.catch(0),new Error("Failed to retrieve saved places");case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(){return a.apply(this,arguments)})},{key:"getOrderHistory",value:(r=u(o().mark((function t(){var r,n,a=this,i=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.prev=1,t.next=4,this.performAuthorizedRequest("customers/orders",r);case 4:return n=t.sent,t.abrupt("return",new e.Collection(n.map((function(t){return new e.Order(t,a.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),new Error("Failed to retrieve order history");case 11:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(){return r.apply(this,arguments)})}]),h}(x),q=Array.isArray,H=new e.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,add:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),n(n({},o),{},{quantity:r}),a).then(this.afterFetch.bind(this))},update:function(t,e,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),n(n({},o),{},{quantity:r}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},r).then(this.afterFetch.bind(this))},empty:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/empty"),{},e).then(this.afterFetch.bind(this))},retrieve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.findRecord(t)}}),N=function(t){f(r,t);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,r),e.call(this,t,o,"cart",n({actions:H},a))}return l(r,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof P&&(t=t.id),this.store.add(this.id,t,e,r,n)}},{key:"update",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,r,n)}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.remove(this.id,t,e)}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.empty(this.id,t)}},{key:"delete",value:function(){return this.destroy()}},{key:"refresh",value:function(){return this.store.retrieve(this.id)}},{key:"subtotal",value:function(){var t=0;return this.contents().forEach((function(e){t+=e.subtotal})),t}},{key:"contents",value:function(){return this.getAttribute("items",[])}},{key:"hasProduct",value:function(t){return-1!==this.contents().findIndex((function(e){return e.product_id===t}))}},{key:"isEmpty",get:function(){var t=this.contents();return!q(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),r}(x),Y=function(t){f(r,t);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,r),e.call(this,t,n,"payment-gateway",o)}return l(r,[{key:"type",get:function(){return this.getAttribute("type")}},{key:"code",get:function(){return this.getAttribute("code")}},{key:"isCashGateway",get:function(){return"cash"===this.type}},{key:"isStripeGateway",get:function(){return"stripe"===this.type}},{key:"setCheckoutToken",value:function(t){this.token=t}},{key:"getCheckoutToken",value:function(){return this.token}},{key:"findRecord",value:function(){throw new Error("There is no findRecord() method for payment gateways!")}},{key:"create",value:function(){throw new Error("There is no create() method for payment gateways!")}},{key:"update",value:function(){throw new Error("There is no update() method for payment gateways!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method for payment gateways!")}},{key:"reload",value:function(){throw new Error("There is no reload() method for payment gateways!")}}]),r}(x);function C(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function L(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function j(t,e){const r=C(t);return isNaN(e)?L(t,NaN):e?(r.setDate(r.getDate()+e),r):r}const F=6048e5,R=864e5;let W={};function Q(){return W}function I(t,e){const r=Q(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=C(t),a=o.getDay(),i=(a=o.getTime()?r+1:e.getTime()>=i.getTime()?r:r-1}function B(t){const e=C(t);return e.setHours(0,0,0,0),e}function z(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function X(t){if(!(e=t,e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)||"number"==typeof t))return!1;var e;const r=C(t);return!isNaN(Number(r))}const $={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function K(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const U={date:K({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:K({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:K({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},J={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function V(t){return(e,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,o=r?.width?String(r.width):e;n=t.formattingValues[o]||t.formattingValues[e]}else{const e=t.defaultWidth,o=r?.width?String(r.width):t.defaultWidth;n=t.values[o]||t.values[e]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function Z(t){return(e,r={})=>{const n=r.width,o=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],a=e.match(o);if(!a)return null;const i=a[0],s=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let r=0;rt.test(i))):function(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=r.valueCallback?r.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var tt;const et={code:"en-US",formatDistance:(t,e,r)=>{let n;const o=$[t];return n="string"==typeof o?o:1===e?o.one:o.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:U,formatRelative:(t,e,r,n)=>J[t],localize:{ordinalNumber:(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:V({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:V({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:V({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:V({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:V({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(tt={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const r=t.match(tt.matchPattern);if(!r)return null;const n=r[0],o=t.match(tt.parsePattern);if(!o)return null;let a=tt.valueCallback?tt.valueCallback(o[0]):o[0];return a=e.valueCallback?e.valueCallback(a):a,{value:a,rest:t.slice(n.length)}}),era:Z({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Z({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:Z({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Z({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Z({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function rt(t){const e=C(t),r=function(t,e){const r=B(t),n=B(e),o=r.getTime()-z(r),a=n.getTime()-z(n);return Math.round((o-a)/R)}(e,function(t){const e=C(t),r=L(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}(e));return r+1}function nt(t){const e=C(t),r=G(e).getTime()-function(t){const e=_(t),r=L(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),G(r)}(e).getTime();return Math.round(r/F)+1}function ot(t,e){const r=C(t),n=r.getFullYear(),o=Q(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=L(t,0);i.setFullYear(n+1,0,a),i.setHours(0,0,0,0);const s=I(i,e),u=L(t,0);u.setFullYear(n,0,a),u.setHours(0,0,0,0);const c=I(u,e);return r.getTime()>=s.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function at(t,e){const r=C(t),n=I(r,e).getTime()-function(t,e){const r=Q(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=ot(t,e),a=L(t,0);return a.setFullYear(o,0,n),a.setHours(0,0,0,0),I(a,e)}(r,e).getTime();return Math.round(n/F)+1}function it(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const st={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return it("yy"===e?n%100:n,e.length)},M(t,e){const r=t.getMonth();return"M"===e?String(r+1):it(r+1,2)},d:(t,e)=>it(t.getDate(),e.length),a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(t,e)=>it(t.getHours()%12||12,e.length),H:(t,e)=>it(t.getHours(),e.length),m:(t,e)=>it(t.getMinutes(),e.length),s:(t,e)=>it(t.getSeconds(),e.length),S(t,e){const r=e.length,n=t.getMilliseconds();return it(Math.floor(n*Math.pow(10,r-3)),e.length)}},ut="midnight",ct="noon",dt="morning",lt="afternoon",ht="evening",ft="night",gt={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if("yo"===e){const e=t.getFullYear(),n=e>0?e:1-e;return r.ordinalNumber(n,{unit:"year"})}return st.y(t,e)},Y:function(t,e,r,n){const o=ot(t,n),a=o>0?o:1-o;if("YY"===e){return it(a%100,2)}return"Yo"===e?r.ordinalNumber(a,{unit:"year"}):it(a,e.length)},R:function(t,e){return it(_(t),e.length)},u:function(t,e){return it(t.getFullYear(),e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return it(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return it(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return st.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return it(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const o=at(t,n);return"wo"===e?r.ordinalNumber(o,{unit:"week"}):it(o,e.length)},I:function(t,e,r){const n=nt(t);return"Io"===e?r.ordinalNumber(n,{unit:"week"}):it(n,e.length)},d:function(t,e,r){return"do"===e?r.ordinalNumber(t.getDate(),{unit:"date"}):st.d(t,e)},D:function(t,e,r){const n=rt(t);return"Do"===e?r.ordinalNumber(n,{unit:"dayOfYear"}):it(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return it(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return it(a,e.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),o=0===n?7:n;switch(e){case"i":return String(o);case"ii":return it(o,e.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let o;switch(o=12===n?ct:0===n?ut:n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let o;switch(o=n>=17?ht:n>=12?lt:n>=4?dt:ft,e){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,e,r){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),r.ordinalNumber(e,{unit:"hour"})}return st.h(t,e)},H:function(t,e,r){return"Ho"===e?r.ordinalNumber(t.getHours(),{unit:"hour"}):st.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return"Ko"===e?r.ordinalNumber(n,{unit:"hour"}):it(n,e.length)},k:function(t,e,r){let n=t.getHours();return 0===n&&(n=24),"ko"===e?r.ordinalNumber(n,{unit:"hour"}):it(n,e.length)},m:function(t,e,r){return"mo"===e?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):st.m(t,e)},s:function(t,e,r){return"so"===e?r.ordinalNumber(t.getSeconds(),{unit:"second"}):st.s(t,e)},S:function(t,e){return st.S(t,e)},X:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();if(0===o)return"Z";switch(e){case"X":return mt(o);case"XXXX":case"XX":return wt(o);default:return wt(o,":")}},x:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return mt(o);case"xxxx":case"xx":return wt(o);default:return wt(o,":")}},O:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+pt(o,":");default:return"GMT"+wt(o,":")}},z:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+pt(o,":");default:return"GMT"+wt(o,":")}},t:function(t,e,r,n){const o=n._originalDate||t;return it(Math.floor(o.getTime()/1e3),e.length)},T:function(t,e,r,n){return it((n._originalDate||t).getTime(),e.length)}};function pt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),o=Math.floor(n/60),a=n%60;return 0===a?r+String(o):r+String(o)+e+it(a,2)}function mt(t,e){if(t%60==0){return(t>0?"-":"+")+it(Math.abs(t)/60,2)}return wt(t,e)}function wt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t);return r+it(Math.floor(n/60),2)+e+it(n%60,2)}const yt=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},vt=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},bt={p:vt,P:(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return yt(t,e);let a;switch(n){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"})}return a.replace("{{date}}",yt(n,e)).replace("{{time}}",vt(o,e))}},kt=["D","DD"],xt=["YY","YYYY"];function Tt(t){return-1!==kt.indexOf(t)}function Mt(t){return-1!==xt.indexOf(t)}function Dt(t,e,r){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("YY"===t)throw new RangeError(`Use \`yy\` instead of \`YY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("D"===t)throw new RangeError(`Use \`d\` instead of \`D\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("DD"===t)throw new RangeError(`Use \`dd\` instead of \`DD\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const St=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Pt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Et=/^'([^]*?)'?$/,Ot=/''/g,At=/[a-zA-Z]/;function qt(t,e,r){const n=Q(),o=r?.locale??n.locale??et,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=C(t);if(!X(s))throw new RangeError("Invalid time value");const u={firstWeekContainsDate:a,weekStartsOn:i,locale:o,_originalDate:s};return e.match(Pt).map((function(t){const e=t[0];if("p"===e||"P"===e){return(0,bt[e])(t,o.formatLong)}return t})).join("").match(St).map((function(n){if("''"===n)return"'";const a=n[0];if("'"===a)return function(t){const e=t.match(Et);if(!e)return t;return e[1].replace(Ot,"'")}(n);const i=gt[a];if(i)return!r?.useAdditionalWeekYearTokens&&Mt(n)&&Dt(n,e,String(t)),!r?.useAdditionalDayOfYearTokens&&Tt(n)&&Dt(n,e,String(t)),i(s,n,o.localize,u);if(a.match(At))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return n})).join("")}class Ht{subPriority=0;validate(t,e){return!0}}class Nt extends Ht{constructor(t,e,r,n,o){super(),this.value=t,this.validateValue=e,this.setValue=r,this.priority=n,o&&(this.subPriority=o)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,r){return this.setValue(t,e,this.value,r)}}class Yt extends Ht{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:L(t,function(t,e){const r=e instanceof Date?L(e,0):new e(0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}(t,Date))}}class Ct{run(t,e,r,n){const o=this.parse(t,e,r,n);return o?{setter:new Nt(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,e,r){return!0}}const Lt=/^(1[0-2]|0?\d)/,jt=/^(3[0-1]|[0-2]?\d)/,Ft=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Rt=/^(5[0-3]|[0-4]?\d)/,Wt=/^(2[0-3]|[0-1]?\d)/,Qt=/^(2[0-4]|[0-1]?\d)/,It=/^(1[0-1]|0?\d)/,Gt=/^(1[0-2]|0?\d)/,_t=/^[0-5]?\d/,Bt=/^[0-5]?\d/,zt=/^\d/,Xt=/^\d{1,2}/,$t=/^\d{1,3}/,Kt=/^\d{1,4}/,Ut=/^-?\d+/,Jt=/^-?\d/,Vt=/^-?\d{1,2}/,Zt=/^-?\d{1,3}/,te=/^-?\d{1,4}/,ee=/^([+-])(\d{2})(\d{2})?|Z/,re=/^([+-])(\d{2})(\d{2})|Z/,ne=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,oe=/^([+-])(\d{2}):(\d{2})|Z/,ae=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function ie(t,e){return t?{value:e(t.value),rest:t.rest}:t}function se(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function ue(t,e){const r=e.match(t);if(!r)return null;if("Z"===r[0])return{value:0,rest:e.slice(1)};return{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:e.slice(r[0].length)}}function ce(t){return se(Ut,t)}function de(t,e){switch(t){case 1:return se(zt,e);case 2:return se(Xt,e);case 3:return se($t,e);case 4:return se(Kt,e);default:return se(new RegExp("^\\d{1,"+t+"}"),e)}}function le(t,e){switch(t){case 1:return se(Jt,e);case 2:return se(Vt,e);case 3:return se(Zt,e);case 4:return se(te,e);default:return se(new RegExp("^-?\\d{1,"+t+"}"),e)}}function he(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function fe(t,e){const r=e>0,n=r?e:1-e;let o;if(n<=50)o=t||100;else{const e=n+50;o=t+100*Math.floor(e/100)-(t>=e%100?100:0)}return r?o:1-o}function ge(t){return t%400==0||t%4==0&&t%100!=0}const pe=[31,28,31,30,31,30,31,31,30,31,30,31],me=[31,29,31,30,31,30,31,31,30,31,30,31];function we(t,e,r){const n=Q(),o=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=C(t),i=a.getDay(),s=7-o;return j(a,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function ye(t,e){const r=C(t),n=function(t){let e=C(t).getDay();return 0===e&&(e=7),e}(r);return j(r,e-n)}const ve={G:new class extends Ct{priority=140;parse(t,e,r){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,e,r){return e.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Ct{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return ie(de(4,t),n);case"yo":return ie(r.ordinalNumber(t,{unit:"year"}),n);default:return ie(de(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r){const n=t.getFullYear();if(r.isTwoDigitYear){const e=fe(r.year,n);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const o="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Ct{priority=130;parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return ie(de(4,t),n);case"Yo":return ie(r.ordinalNumber(t,{unit:"year"}),n);default:return ie(de(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r,n){const o=ot(t,n);if(r.isTwoDigitYear){const e=fe(r.year,o);return t.setFullYear(e,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),I(t,n)}const a="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(a,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),I(t,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Ct{priority=130;parse(t,e){return le("R"===e?4:e.length,t)}set(t,e,r){const n=L(t,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),G(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Ct{priority=130;parse(t,e){return le("u"===e?4:e.length,t)}set(t,e,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends Ct{priority=120;parse(t,e,r){switch(e){case"Q":case"QQ":return de(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends Ct{priority=120;parse(t,e,r){switch(e){case"q":case"qq":return de(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends Ct{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"M":return ie(se(Lt,t),n);case"MM":return ie(de(2,t),n);case"Mo":return ie(r.ordinalNumber(t,{unit:"month"}),n);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}},L:new class extends Ct{priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"L":return ie(se(Lt,t),n);case"LL":return ie(de(2,t),n);case"Lo":return ie(r.ordinalNumber(t,{unit:"month"}),n);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends Ct{priority=100;parse(t,e,r){switch(e){case"w":return se(Rt,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r,n){return I(function(t,e,r){const n=C(t),o=at(n,r)-e;return n.setDate(n.getDate()-7*o),n}(t,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Ct{priority=100;parse(t,e,r){switch(e){case"I":return se(Rt,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r){return G(function(t,e){const r=C(t),n=nt(r)-e;return r.setDate(r.getDate()-7*n),r}(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Ct{priority=90;subPriority=1;parse(t,e,r){switch(e){case"d":return se(jt,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return de(e.length,t)}}validate(t,e){const r=ge(t.getFullYear()),n=t.getMonth();return r?e>=1&&e<=me[n]:e>=1&&e<=pe[n]}set(t,e,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Ct{priority=90;subpriority=1;parse(t,e,r){switch(e){case"D":case"DD":return se(Ft,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return de(e.length,t)}}validate(t,e){return ge(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends Ct{priority=90;parse(t,e,r){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=we(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Ct{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return ie(de(e.length,t),o);case"eo":return ie(r.ordinalNumber(t,{unit:"day"}),o);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=we(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends Ct{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return ie(de(e.length,t),o);case"co":return ie(r.ordinalNumber(t,{unit:"day"}),o);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=we(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends Ct{priority=90;parse(t,e,r){const n=t=>0===t?7:t;switch(e){case"i":case"ii":return de(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return ie(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiii":return ie(r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiiii":return ie(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);default:return ie(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n)}}validate(t,e){return e>=1&&e<=7}set(t,e,r){return(t=ye(t,r)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends Ct{priority=80;parse(t,e,r){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(he(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Ct{priority=80;parse(t,e,r){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(he(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Ct{priority=80;parse(t,e,r){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(he(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"h":return se(Gt,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,r){const n=t.getHours()>=12;return n&&r<12?t.setHours(r+12,0,0,0):n||12!==r?t.setHours(r,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"H":return se(Wt,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"K":return se(It,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"k":return se(Qt,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,r){const n=r<=24?r%24:r;return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Ct{priority=60;parse(t,e,r){switch(e){case"m":return se(_t,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Ct{priority=50;parse(t,e,r){switch(e){case"s":return se(Bt,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]},S:new class extends Ct{priority=30;parse(t,e){return ie(de(e.length,t),(t=>Math.floor(t*Math.pow(10,3-e.length))))}set(t,e,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]},X:new class extends Ct{priority=10;parse(t,e){switch(e){case"X":return ue(ee,t);case"XX":return ue(re,t);case"XXXX":return ue(ne,t);case"XXXXX":return ue(ae,t);default:return ue(oe,t)}}set(t,e,r){return e.timestampIsSet?t:L(t,t.getTime()-z(t)-r)}incompatibleTokens=["t","T","x"]},x:new class extends Ct{priority=10;parse(t,e){switch(e){case"x":return ue(ee,t);case"xx":return ue(re,t);case"xxxx":return ue(ne,t);case"xxxxx":return ue(ae,t);default:return ue(oe,t)}}set(t,e,r){return e.timestampIsSet?t:L(t,t.getTime()-z(t)-r)}incompatibleTokens=["t","T","X"]},t:new class extends Ct{priority=40;parse(t){return ce(t)}set(t,e,r){return[L(t,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Ct{priority=20;parse(t){return ce(t)}set(t,e,r){return[L(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},be=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ke=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xe=/^'([^]*?)'?$/,Te=/''/g,Me=/\S/,De=/[a-zA-Z]/;function Se(t,e,r,n){const o=Object.assign({},Q()),a=n?.locale??o.locale??et,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(""===e)return""===t?C(r):L(r,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:a},c=[new Yt],d=e.match(ke).map((t=>{const e=t[0];if(e in bt){return(0,bt[e])(t,a.formatLong)}return t})).join("").match(be),l=[];for(let o of d){!n?.useAdditionalWeekYearTokens&&Mt(o)&&Dt(o,e,t),!n?.useAdditionalDayOfYearTokens&&Tt(o)&&Dt(o,e,t);const i=o[0],s=ve[i];if(s){const{incompatibleTokens:e}=s;if(Array.isArray(e)){const t=l.find((t=>e.includes(t.token)||t.token===i));if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${o}\` at the same time`)}else if("*"===s.incompatibleTokens&&l.length>0)throw new RangeError(`The format string mustn't contain \`${o}\` and any other token at the same time`);l.push({token:i,fullToken:o});const n=s.run(t,o,a.match,u);if(!n)return L(r,NaN);c.push(n.setter),t=n.rest}else{if(i.match(De))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");if("''"===o?o="'":"'"===i&&(o=o.match(xe)[1].replace(Te,"'")),0!==t.indexOf(o))return L(r,NaN);t=t.slice(o.length)}}if(t.length>0&&Me.test(t))return L(r,NaN);const h=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,r)=>r.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=C(r);if(isNaN(f.getTime()))return L(r,NaN);const g={};for(const t of h){if(!t.validate(f,u))return L(r,NaN);const e=t.set(f,g,u);Array.isArray(e)?(f=e[0],Object.assign(g,e[1])):f=e}return L(r,f)}var Pe=function(t){f(r,t);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,r),e.call(this,t,n,"store-hour",o)}return l(r,[{key:"day",get:function(){return this.getAttribute("day")}},{key:"isClosed",get:function(){return null===this.getAttribute("start")&&null===this.getAttribute("end")}},{key:"is24Hours",get:function(){var t=this.startDateInstance,e=this.endDateInstance,r=Math.abs(t-e);return Math.floor(r/1e3/60)/60>23}},{key:"startDateInstance",get:function(){if(!this.hasAttribute("start"))return null;var t=this.getAttribute("start"),e=3===t.split(":").length;return Se(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"endDateInstance",get:function(){if(!this.hasAttribute("end"))return null;var t=this.getAttribute("end"),e=3===t.split(":").length;return Se(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return X(this.startDateInstance)&&X(this.endDateInstance)?"".concat(qt(this.startDateInstance,"p")," - ").concat(qt(this.endDateInstance,"p")):"".concat(this.start," - ").concat(this.end)}},{key:"humanReadableHours",get:function(){return this.isClosed?"Closed":this.is24Hours?"24 Hours":this.humanReadableHoursRange}},{key:"create",value:function(){throw new Error("There is no create() method store location!")}},{key:"update",value:function(){throw new Error("There is no update() method store location!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method store location!")}},{key:"reload",value:function(){throw new Error("There is no reload() method store location!")}}]),r}(x),Ee=function(t){f(n,t);var r=v(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,n),r.call(this,t,e,"store-location",o)}return l(n,[{key:"latitude",get:function(){return this.getAttribute("place.location.coordinates.1")}},{key:"longitude",get:function(){return this.getAttribute("place.location.coordinates.0")}},{key:"hours",get:function(){return new e.Collection(this.getAttribute("hours").map((function(t){return new Pe(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=qt(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},r=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,o),r.call(this,t,e,"store",n)}return l(o,[{key:"getReviews",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",n({store:this.id},r)).then((function(r){return new e.Collection(r.map((function(e){return new M(e,t.adapter)})))}))}},{key:"getLocations",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",n({store:this.id},r)).then((function(r){return new e.Collection(r.map((function(r){return r.place&&(r.place=new e.Place(r.place)),new Ee(r,t.adapter)})))}))}},{key:"getLocation",value:function(t){var e=this;return this.adapter.get("locations/".concat(t),{store:this.id}).then((function(t){return new Ee(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",r).then((function(r){return new e.Collection(r.map((function(e){return new Y(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new Y(t,e.adapter)}))}}]),o}(x),Ae=function(t){f(d,t);var r,n,a,i,s=v(d);function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,d),s.call(this,t,e,"network",r)}return l(d,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getResourceCollection",value:(i=u(o().mark((function t(r,n){var a,i,s=this,u=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=u.length>2&&void 0!==u[2]?u[2]:{},t.prev=1,t.next=4,this.adapter.get(r,a);case 4:return i=t.sent,t.abrupt("return",new e.Collection(i.map((function(t){return new n(t,s.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),console.error("Error fetching ".concat(r,":"),t.t0),t.t0;case 12:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(t,e){return i.apply(this,arguments)})},{key:"getStores",value:(a=u(o().mark((function t(){var e,r=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("stores",Oe,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"getStoreLocations",value:(n=u(o().mark((function t(){var e,r=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("store-locations",Ee,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"getPaymentGateways",value:(r=u(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.getResourceCollection("gateways",Y));case 1:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})}]),d}(x),qe=Array.isArray,He=function(t){f(i,t);var r,n,a=v(i);function i(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,i),r instanceof e.Adapter?y(t,t=a.call(this,{},r,"service-quote",o)):a.call(this,r,n,"service-quote",o)}return l(i,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Re(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["amount","currency"]),e=t.amount,r=t.currency;return S(e)||S(r)?null:D(e/100,r)}},{key:"fetchServiceQuotesFromCart",value:(n=u(o().mark((function t(r,n,a){var s,u,c,d,l,h,f=this,g=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d=g.length>3&&void 0!==g[3]?g[3]:"storefront",l=g.length>4&&void 0!==g[4]&&g[4],null!==(s=r)&&void 0!==s&&s.id&&(r=r.id),null!==(u=n)&&void 0!==u&&u.id&&(n=n.id),null!==(c=a)&&void 0!==c&&c.id&&(a=a.id),t.prev=5,t.next=8,this.adapter.get("service-quotes/from-cart",{origin:r,destination:n,cart:a,config:d,all:l});case 8:if(h=t.sent,!qe(h)){t.next=11;break}return t.abrupt("return",new e.Collection(h.map((function(t){return new i(t,f.adapter)}))));case 11:return t.abrupt("return",new i(h,this.adapter));case 14:throw t.prev=14,t.t0=t.catch(5),console.error("Error fetching service quotes:",t.t0),t.t0;case 18:case"end":return t.stop()}}),t,this,[[5,14]])}))),function(t,e,r){return n.apply(this,arguments)})}],[{key:"getFromCart",value:(r=u(o().mark((function t(e,r,n,a){var s,u,c,d=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=d.length>4&&void 0!==d[4]?d[4]:"storefront",u=d.length>5&&void 0!==d[5]&&d[5],c=new i(e),t.abrupt("return",c.fetchServiceQuotesFromCart(r,n,a,s,u));case 4:case"end":return t.stop()}}),t)}))),function(t,e,n,o){return r.apply(this,arguments)})}]),i}(e.ServiceQuote),Ne=new e.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,initialize:function(t,r,o,a){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return e.isResource(t)&&(t=t.id),e.isResource(r)&&(r=r.id),e.isResource(o)&&(o=o.id),e.isResource(a)&&(a=a.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),n(n({},i),{},{customer:t,cart:r,serviceQuote:o,gateway:a}),s)},captureOrder:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("".concat(this.namespace,"/capture"),{token:t,transactionDetails:r},n).then((function(t){return new e.Order(t)}))}}),Ye=function(t){f(r,t);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,r),e.call(this,t,n,"checkout",o)}return l(r,[{key:"initialize",value:function(){var t;return(t=this.store).initialize.apply(t,arguments)}},{key:"captureOrder",value:function(){var t;return(t=this.store).captureOrder.apply(t,arguments)}}]),r}(x),Ce={Product:P,Category:E,Customer:A,Cart:N,DeliveryServiceQuote:He,Store:Oe,StoreLocation:Ee,StoreHour:Pe,Checkout:Ye,Review:M},Le={BrowserAdapter:e.BrowserAdapter,NodeAdapter:e.NodeAdapter},je=function(){function t(){return c(this,t),this.resources=Ce,this.adapters=Le,this.lookup.apply(this,arguments)}return l(t,[{key:"lookup",value:function(t,r){var n=e.pluralize(t),o=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][r])throw new Error("No ".concat(e.singularize(t)," named ").concat(r," to resolve"));return w(this[n][r],b(o))}}]),t}(),Fe=function(){return w(je,Array.prototype.slice.call(arguments))},Re=function(t){f(n,t);var r=v(n);function n(){return c(this,n),r.apply(this,arguments)}return l(n,[{key:"extendActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.extendStoreActions(this,t)}},{key:"serialize",value:function(t){return Fe("resource",e.classify(this.resource),t,this.adapter)}}]),n}(e.Store),We=function(){function t(r){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(c(this,t),this.version=o.version||"v1",this.options={version:this.version,host:o.host||"https://api.fleetbase.io",namespace:"storefront/".concat(this.version)||o.namespace,publicKey:r,debug:a},!("string"==typeof(n=r)&&n.length>30&&(n.startsWith("store_")||n.startsWith("network_"))))throw new Error("⚠️ Invalid Storefront key given to Storefront SDK");this.adapter=o.adapter||function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.isNodeEnvironment()?Fe("adapter","NodeAdapter",t):Fe("adapter","BrowserAdapter",t)}(this.options),this.products=new Re("product",this.adapter),this.categories=new Re("category",this.adapter),this.reviews=new Re("review",this.adapter).extendActions(T),this.customers=new Re("customer",this.adapter).extendActions(O),this.cart=new Re("cart",this.adapter).extendActions(H),this.checkout=new Re("checkout",this.adapter).extendActions(Ne)}return l(t,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"search",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",n({query:t},r)).then((function(t){return new e.Collection(t.map((function(t){return new P(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return w(t,Array.prototype.slice.call(arguments))}}]),t}();t.Cart=N,t.Category=E,t.Checkout=Ye,t.Customer=A,t.DeliveryServiceQuote=He,t.Network=Ae,t.PaymentGateway=Y,t.Product=P,t.Review=M,t.Store=Oe,t.StoreHour=Pe,t.StoreLocation=Ee,t.default=We})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@fleetbase/sdk")):"function"==typeof define&&define.amd?define(["exports","@fleetbase/sdk"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@fleetbase/storefront"]={},t.sdk)}(this,(function(t,e){"use strict";function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function n(t){for(var e=1;e=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),w}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:H(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),w}},e}function a(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function s(t,e,r,n,o,a,i){try{var s=t[a](i),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){s(a,n,o,i,u,"next",t)}function u(t){s(a,n,o,i,u,"throw",t)}i(void 0)}))}}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{},r={};return t&&(r.store=t),this.adapter.get("".concat(this.namespace,"/count"),r,e)}}),M=function(t){f(r,t);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,r),e.call(this,t,n,"review",o)}return l(r,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),r}(x);function D(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:r}).format(t)}var S=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var r=i(t);if("object"===r){var n=t.size;if("number"==typeof n)return!n}if("number"==typeof t.length&&"function"!==r)return!t.length;if("object"===r){var o=t.length;if("number"==typeof o)return!o}return!1},P=function(t){f(n,t);var r=v(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,n),r.call(this,t,e,"product",o)}return l(n,[{key:"variants",value:function(){return this.getAttribute("variants")}},{key:"addons",value:function(){return this.getAttribute("addon_categories")}},{key:"isOnSale",get:function(){return this.getAttribute("is_on_sale")}},{key:"isNotOnSale",get:function(){return!this.getAttribute("is_on_sale")}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["price","sale_price","currency"]),e=t.price,r=t.sale_price,n=t.currency;return this.isOnSale?S(r)||S(n)?null:D(r/100,n):S(e)||S(n)?null:D(e/100,n)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(r){return new e.Collection(r.map((function(e){return new M(e,t.adapter)})))}))}}]),n}(x),E=function(t){f(n,t);var r=v(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,n),r.call(this,t,e,"category",o)}return l(n,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(r){return new e.Collection(r.map((function(e){return new P(e,t.adapter)})))}))}}]),n}(x),O=new e.StoreActions({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("customers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("customers/login",n({identity:t,password:e},r)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers/verify-code",n({identity:t,code:e},r)).then(this.afterFetch.bind(this))},requestCreationCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"email";return this.adapter.post("customers/request-creation-code",{identity:t,mode:e})},create:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers",n({identity:t,code:e},r)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),A=function(t){f(h,t);var r,a,i,s,d=v(h);function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,h),d.call(this,t,e,"customer",n({actions:O},r))}return l(h,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Re(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"token",get:function(){return this.getAttribute("token")}},{key:"syncDevice",value:(s=u(o().mark((function t(e){var r=this;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",e).then((function(){return r})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"performAuthorizedRequest",value:(i=u(o().mark((function t(e){var r,n,a,i,s=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},n=s.length>2&&void 0!==s[2]?s[2]:"GET",t.prev=2,a={"Customer-Token":this.token},t.next=6,this.adapter.setHeaders(a)[n.toLowerCase()](e,r);case 6:return i=t.sent,t.abrupt("return",i);case 10:throw t.prev=10,t.t0=t.catch(2),console.error("Error in ".concat(n," request to ").concat(e,":"),t.t0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[2,10]])}))),function(t){return i.apply(this,arguments)})},{key:"getSavedPlaces",value:(a=u(o().mark((function t(){var r,n=this;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.performAuthorizedRequest("customers/places");case 3:return r=t.sent,t.abrupt("return",new e.Collection(r.map((function(t){return new e.Place(t,n.adapter)}))));case 7:throw t.prev=7,t.t0=t.catch(0),new Error("Failed to retrieve saved places");case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(){return a.apply(this,arguments)})},{key:"getOrderHistory",value:(r=u(o().mark((function t(){var r,n,a=this,i=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.prev=1,t.next=4,this.performAuthorizedRequest("customers/orders",r);case 4:return n=t.sent,t.abrupt("return",new e.Collection(n.map((function(t){return new e.Order(t,a.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),new Error("Failed to retrieve order history");case 11:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(){return r.apply(this,arguments)})}]),h}(x),q=Array.isArray,H=new e.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,add:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),n(n({},o),{},{quantity:r}),a).then(this.afterFetch.bind(this))},update:function(t,e,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),n(n({},o),{},{quantity:r}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},r).then(this.afterFetch.bind(this))},empty:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/empty"),{},e).then(this.afterFetch.bind(this))},retrieve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.findRecord(t)}}),N=function(t){f(r,t);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,r),e.call(this,t,o,"cart",n({actions:H},a))}return l(r,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof P&&(t=t.id),this.store.add(this.id,t,e,r,n)}},{key:"update",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,r,n)}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.remove(this.id,t,e)}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.empty(this.id,t)}},{key:"delete",value:function(){return this.destroy()}},{key:"refresh",value:function(){return this.store.retrieve(this.id)}},{key:"subtotal",value:function(){var t=0;return this.contents().forEach((function(e){t+=e.subtotal})),t}},{key:"contents",value:function(){return this.getAttribute("items",[])}},{key:"hasProduct",value:function(t){return-1!==this.contents().findIndex((function(e){return e.product_id===t}))}},{key:"isEmpty",get:function(){var t=this.contents();return!q(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),r}(x),Y=function(t){f(r,t);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,r),e.call(this,t,n,"payment-gateway",o)}return l(r,[{key:"type",get:function(){return this.getAttribute("type")}},{key:"code",get:function(){return this.getAttribute("code")}},{key:"isCashGateway",get:function(){return"cash"===this.type}},{key:"isStripeGateway",get:function(){return"stripe"===this.type}},{key:"setCheckoutToken",value:function(t){this.token=t}},{key:"getCheckoutToken",value:function(){return this.token}},{key:"findRecord",value:function(){throw new Error("There is no findRecord() method for payment gateways!")}},{key:"create",value:function(){throw new Error("There is no create() method for payment gateways!")}},{key:"update",value:function(){throw new Error("There is no update() method for payment gateways!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method for payment gateways!")}},{key:"reload",value:function(){throw new Error("There is no reload() method for payment gateways!")}}]),r}(x);function C(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function L(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function j(t,e){const r=C(t);return isNaN(e)?L(t,NaN):e?(r.setDate(r.getDate()+e),r):r}const F=6048e5,R=864e5;let W={};function Q(){return W}function I(t,e){const r=Q(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=C(t),a=o.getDay(),i=(a=o.getTime()?r+1:e.getTime()>=i.getTime()?r:r-1}function B(t){const e=C(t);return e.setHours(0,0,0,0),e}function z(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function X(t){if(!(e=t,e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)||"number"==typeof t))return!1;var e;const r=C(t);return!isNaN(Number(r))}const $={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function K(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const U={date:K({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:K({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:K({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},J={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function V(t){return(e,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,o=r?.width?String(r.width):e;n=t.formattingValues[o]||t.formattingValues[e]}else{const e=t.defaultWidth,o=r?.width?String(r.width):t.defaultWidth;n=t.values[o]||t.values[e]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function Z(t){return(e,r={})=>{const n=r.width,o=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],a=e.match(o);if(!a)return null;const i=a[0],s=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let r=0;rt.test(i))):function(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=r.valueCallback?r.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var tt;const et={code:"en-US",formatDistance:(t,e,r)=>{let n;const o=$[t];return n="string"==typeof o?o:1===e?o.one:o.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:U,formatRelative:(t,e,r,n)=>J[t],localize:{ordinalNumber:(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:V({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:V({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:V({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:V({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:V({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(tt={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const r=t.match(tt.matchPattern);if(!r)return null;const n=r[0],o=t.match(tt.parsePattern);if(!o)return null;let a=tt.valueCallback?tt.valueCallback(o[0]):o[0];return a=e.valueCallback?e.valueCallback(a):a,{value:a,rest:t.slice(n.length)}}),era:Z({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Z({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:Z({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Z({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Z({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function rt(t){const e=C(t),r=function(t,e){const r=B(t),n=B(e),o=r.getTime()-z(r),a=n.getTime()-z(n);return Math.round((o-a)/R)}(e,function(t){const e=C(t),r=L(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}(e));return r+1}function nt(t){const e=C(t),r=G(e).getTime()-function(t){const e=_(t),r=L(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),G(r)}(e).getTime();return Math.round(r/F)+1}function ot(t,e){const r=C(t),n=r.getFullYear(),o=Q(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=L(t,0);i.setFullYear(n+1,0,a),i.setHours(0,0,0,0);const s=I(i,e),u=L(t,0);u.setFullYear(n,0,a),u.setHours(0,0,0,0);const c=I(u,e);return r.getTime()>=s.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function at(t,e){const r=C(t),n=I(r,e).getTime()-function(t,e){const r=Q(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=ot(t,e),a=L(t,0);return a.setFullYear(o,0,n),a.setHours(0,0,0,0),I(a,e)}(r,e).getTime();return Math.round(n/F)+1}function it(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const st={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return it("yy"===e?n%100:n,e.length)},M(t,e){const r=t.getMonth();return"M"===e?String(r+1):it(r+1,2)},d:(t,e)=>it(t.getDate(),e.length),a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(t,e)=>it(t.getHours()%12||12,e.length),H:(t,e)=>it(t.getHours(),e.length),m:(t,e)=>it(t.getMinutes(),e.length),s:(t,e)=>it(t.getSeconds(),e.length),S(t,e){const r=e.length,n=t.getMilliseconds();return it(Math.floor(n*Math.pow(10,r-3)),e.length)}},ut="midnight",ct="noon",dt="morning",lt="afternoon",ht="evening",ft="night",pt={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if("yo"===e){const e=t.getFullYear(),n=e>0?e:1-e;return r.ordinalNumber(n,{unit:"year"})}return st.y(t,e)},Y:function(t,e,r,n){const o=ot(t,n),a=o>0?o:1-o;if("YY"===e){return it(a%100,2)}return"Yo"===e?r.ordinalNumber(a,{unit:"year"}):it(a,e.length)},R:function(t,e){return it(_(t),e.length)},u:function(t,e){return it(t.getFullYear(),e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return it(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return it(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return st.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return it(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const o=at(t,n);return"wo"===e?r.ordinalNumber(o,{unit:"week"}):it(o,e.length)},I:function(t,e,r){const n=nt(t);return"Io"===e?r.ordinalNumber(n,{unit:"week"}):it(n,e.length)},d:function(t,e,r){return"do"===e?r.ordinalNumber(t.getDate(),{unit:"date"}):st.d(t,e)},D:function(t,e,r){const n=rt(t);return"Do"===e?r.ordinalNumber(n,{unit:"dayOfYear"}):it(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return it(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return it(a,e.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),o=0===n?7:n;switch(e){case"i":return String(o);case"ii":return it(o,e.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let o;switch(o=12===n?ct:0===n?ut:n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let o;switch(o=n>=17?ht:n>=12?lt:n>=4?dt:ft,e){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,e,r){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),r.ordinalNumber(e,{unit:"hour"})}return st.h(t,e)},H:function(t,e,r){return"Ho"===e?r.ordinalNumber(t.getHours(),{unit:"hour"}):st.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return"Ko"===e?r.ordinalNumber(n,{unit:"hour"}):it(n,e.length)},k:function(t,e,r){let n=t.getHours();return 0===n&&(n=24),"ko"===e?r.ordinalNumber(n,{unit:"hour"}):it(n,e.length)},m:function(t,e,r){return"mo"===e?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):st.m(t,e)},s:function(t,e,r){return"so"===e?r.ordinalNumber(t.getSeconds(),{unit:"second"}):st.s(t,e)},S:function(t,e){return st.S(t,e)},X:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();if(0===o)return"Z";switch(e){case"X":return mt(o);case"XXXX":case"XX":return wt(o);default:return wt(o,":")}},x:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return mt(o);case"xxxx":case"xx":return wt(o);default:return wt(o,":")}},O:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+gt(o,":");default:return"GMT"+wt(o,":")}},z:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+gt(o,":");default:return"GMT"+wt(o,":")}},t:function(t,e,r,n){const o=n._originalDate||t;return it(Math.floor(o.getTime()/1e3),e.length)},T:function(t,e,r,n){return it((n._originalDate||t).getTime(),e.length)}};function gt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),o=Math.floor(n/60),a=n%60;return 0===a?r+String(o):r+String(o)+e+it(a,2)}function mt(t,e){if(t%60==0){return(t>0?"-":"+")+it(Math.abs(t)/60,2)}return wt(t,e)}function wt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t);return r+it(Math.floor(n/60),2)+e+it(n%60,2)}const yt=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},vt=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},bt={p:vt,P:(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return yt(t,e);let a;switch(n){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"})}return a.replace("{{date}}",yt(n,e)).replace("{{time}}",vt(o,e))}},kt=["D","DD"],xt=["YY","YYYY"];function Tt(t){return-1!==kt.indexOf(t)}function Mt(t){return-1!==xt.indexOf(t)}function Dt(t,e,r){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("YY"===t)throw new RangeError(`Use \`yy\` instead of \`YY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("D"===t)throw new RangeError(`Use \`d\` instead of \`D\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("DD"===t)throw new RangeError(`Use \`dd\` instead of \`DD\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const St=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Pt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Et=/^'([^]*?)'?$/,Ot=/''/g,At=/[a-zA-Z]/;function qt(t,e,r){const n=Q(),o=r?.locale??n.locale??et,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=C(t);if(!X(s))throw new RangeError("Invalid time value");const u={firstWeekContainsDate:a,weekStartsOn:i,locale:o,_originalDate:s};return e.match(Pt).map((function(t){const e=t[0];if("p"===e||"P"===e){return(0,bt[e])(t,o.formatLong)}return t})).join("").match(St).map((function(n){if("''"===n)return"'";const a=n[0];if("'"===a)return function(t){const e=t.match(Et);if(!e)return t;return e[1].replace(Ot,"'")}(n);const i=pt[a];if(i)return!r?.useAdditionalWeekYearTokens&&Mt(n)&&Dt(n,e,String(t)),!r?.useAdditionalDayOfYearTokens&&Tt(n)&&Dt(n,e,String(t)),i(s,n,o.localize,u);if(a.match(At))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return n})).join("")}class Ht{subPriority=0;validate(t,e){return!0}}class Nt extends Ht{constructor(t,e,r,n,o){super(),this.value=t,this.validateValue=e,this.setValue=r,this.priority=n,o&&(this.subPriority=o)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,r){return this.setValue(t,e,this.value,r)}}class Yt extends Ht{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:L(t,function(t,e){const r=e instanceof Date?L(e,0):new e(0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}(t,Date))}}class Ct{run(t,e,r,n){const o=this.parse(t,e,r,n);return o?{setter:new Nt(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,e,r){return!0}}const Lt=/^(1[0-2]|0?\d)/,jt=/^(3[0-1]|[0-2]?\d)/,Ft=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Rt=/^(5[0-3]|[0-4]?\d)/,Wt=/^(2[0-3]|[0-1]?\d)/,Qt=/^(2[0-4]|[0-1]?\d)/,It=/^(1[0-1]|0?\d)/,Gt=/^(1[0-2]|0?\d)/,_t=/^[0-5]?\d/,Bt=/^[0-5]?\d/,zt=/^\d/,Xt=/^\d{1,2}/,$t=/^\d{1,3}/,Kt=/^\d{1,4}/,Ut=/^-?\d+/,Jt=/^-?\d/,Vt=/^-?\d{1,2}/,Zt=/^-?\d{1,3}/,te=/^-?\d{1,4}/,ee=/^([+-])(\d{2})(\d{2})?|Z/,re=/^([+-])(\d{2})(\d{2})|Z/,ne=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,oe=/^([+-])(\d{2}):(\d{2})|Z/,ae=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function ie(t,e){return t?{value:e(t.value),rest:t.rest}:t}function se(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function ue(t,e){const r=e.match(t);if(!r)return null;if("Z"===r[0])return{value:0,rest:e.slice(1)};return{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:e.slice(r[0].length)}}function ce(t){return se(Ut,t)}function de(t,e){switch(t){case 1:return se(zt,e);case 2:return se(Xt,e);case 3:return se($t,e);case 4:return se(Kt,e);default:return se(new RegExp("^\\d{1,"+t+"}"),e)}}function le(t,e){switch(t){case 1:return se(Jt,e);case 2:return se(Vt,e);case 3:return se(Zt,e);case 4:return se(te,e);default:return se(new RegExp("^-?\\d{1,"+t+"}"),e)}}function he(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function fe(t,e){const r=e>0,n=r?e:1-e;let o;if(n<=50)o=t||100;else{const e=n+50;o=t+100*Math.floor(e/100)-(t>=e%100?100:0)}return r?o:1-o}function pe(t){return t%400==0||t%4==0&&t%100!=0}const ge=[31,28,31,30,31,30,31,31,30,31,30,31],me=[31,29,31,30,31,30,31,31,30,31,30,31];function we(t,e,r){const n=Q(),o=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=C(t),i=a.getDay(),s=7-o;return j(a,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function ye(t,e){const r=C(t),n=function(t){let e=C(t).getDay();return 0===e&&(e=7),e}(r);return j(r,e-n)}const ve={G:new class extends Ct{priority=140;parse(t,e,r){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,e,r){return e.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Ct{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return ie(de(4,t),n);case"yo":return ie(r.ordinalNumber(t,{unit:"year"}),n);default:return ie(de(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r){const n=t.getFullYear();if(r.isTwoDigitYear){const e=fe(r.year,n);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const o="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Ct{priority=130;parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return ie(de(4,t),n);case"Yo":return ie(r.ordinalNumber(t,{unit:"year"}),n);default:return ie(de(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r,n){const o=ot(t,n);if(r.isTwoDigitYear){const e=fe(r.year,o);return t.setFullYear(e,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),I(t,n)}const a="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(a,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),I(t,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Ct{priority=130;parse(t,e){return le("R"===e?4:e.length,t)}set(t,e,r){const n=L(t,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),G(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Ct{priority=130;parse(t,e){return le("u"===e?4:e.length,t)}set(t,e,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends Ct{priority=120;parse(t,e,r){switch(e){case"Q":case"QQ":return de(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends Ct{priority=120;parse(t,e,r){switch(e){case"q":case"qq":return de(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends Ct{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"M":return ie(se(Lt,t),n);case"MM":return ie(de(2,t),n);case"Mo":return ie(r.ordinalNumber(t,{unit:"month"}),n);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}},L:new class extends Ct{priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"L":return ie(se(Lt,t),n);case"LL":return ie(de(2,t),n);case"Lo":return ie(r.ordinalNumber(t,{unit:"month"}),n);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends Ct{priority=100;parse(t,e,r){switch(e){case"w":return se(Rt,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r,n){return I(function(t,e,r){const n=C(t),o=at(n,r)-e;return n.setDate(n.getDate()-7*o),n}(t,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Ct{priority=100;parse(t,e,r){switch(e){case"I":return se(Rt,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r){return G(function(t,e){const r=C(t),n=nt(r)-e;return r.setDate(r.getDate()-7*n),r}(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Ct{priority=90;subPriority=1;parse(t,e,r){switch(e){case"d":return se(jt,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return de(e.length,t)}}validate(t,e){const r=pe(t.getFullYear()),n=t.getMonth();return r?e>=1&&e<=me[n]:e>=1&&e<=ge[n]}set(t,e,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Ct{priority=90;subpriority=1;parse(t,e,r){switch(e){case"D":case"DD":return se(Ft,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return de(e.length,t)}}validate(t,e){return pe(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends Ct{priority=90;parse(t,e,r){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=we(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Ct{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return ie(de(e.length,t),o);case"eo":return ie(r.ordinalNumber(t,{unit:"day"}),o);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=we(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends Ct{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return ie(de(e.length,t),o);case"co":return ie(r.ordinalNumber(t,{unit:"day"}),o);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=we(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends Ct{priority=90;parse(t,e,r){const n=t=>0===t?7:t;switch(e){case"i":case"ii":return de(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return ie(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiii":return ie(r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiiii":return ie(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);default:return ie(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n)}}validate(t,e){return e>=1&&e<=7}set(t,e,r){return(t=ye(t,r)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends Ct{priority=80;parse(t,e,r){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(he(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Ct{priority=80;parse(t,e,r){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(he(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Ct{priority=80;parse(t,e,r){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(he(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"h":return se(Gt,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,r){const n=t.getHours()>=12;return n&&r<12?t.setHours(r+12,0,0,0):n||12!==r?t.setHours(r,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"H":return se(Wt,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"K":return se(It,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"k":return se(Qt,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,r){const n=r<=24?r%24:r;return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Ct{priority=60;parse(t,e,r){switch(e){case"m":return se(_t,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Ct{priority=50;parse(t,e,r){switch(e){case"s":return se(Bt,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]},S:new class extends Ct{priority=30;parse(t,e){return ie(de(e.length,t),(t=>Math.floor(t*Math.pow(10,3-e.length))))}set(t,e,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]},X:new class extends Ct{priority=10;parse(t,e){switch(e){case"X":return ue(ee,t);case"XX":return ue(re,t);case"XXXX":return ue(ne,t);case"XXXXX":return ue(ae,t);default:return ue(oe,t)}}set(t,e,r){return e.timestampIsSet?t:L(t,t.getTime()-z(t)-r)}incompatibleTokens=["t","T","x"]},x:new class extends Ct{priority=10;parse(t,e){switch(e){case"x":return ue(ee,t);case"xx":return ue(re,t);case"xxxx":return ue(ne,t);case"xxxxx":return ue(ae,t);default:return ue(oe,t)}}set(t,e,r){return e.timestampIsSet?t:L(t,t.getTime()-z(t)-r)}incompatibleTokens=["t","T","X"]},t:new class extends Ct{priority=40;parse(t){return ce(t)}set(t,e,r){return[L(t,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Ct{priority=20;parse(t){return ce(t)}set(t,e,r){return[L(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},be=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ke=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xe=/^'([^]*?)'?$/,Te=/''/g,Me=/\S/,De=/[a-zA-Z]/;function Se(t,e,r,n){const o=Object.assign({},Q()),a=n?.locale??o.locale??et,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(""===e)return""===t?C(r):L(r,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:a},c=[new Yt],d=e.match(ke).map((t=>{const e=t[0];if(e in bt){return(0,bt[e])(t,a.formatLong)}return t})).join("").match(be),l=[];for(let o of d){!n?.useAdditionalWeekYearTokens&&Mt(o)&&Dt(o,e,t),!n?.useAdditionalDayOfYearTokens&&Tt(o)&&Dt(o,e,t);const i=o[0],s=ve[i];if(s){const{incompatibleTokens:e}=s;if(Array.isArray(e)){const t=l.find((t=>e.includes(t.token)||t.token===i));if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${o}\` at the same time`)}else if("*"===s.incompatibleTokens&&l.length>0)throw new RangeError(`The format string mustn't contain \`${o}\` and any other token at the same time`);l.push({token:i,fullToken:o});const n=s.run(t,o,a.match,u);if(!n)return L(r,NaN);c.push(n.setter),t=n.rest}else{if(i.match(De))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");if("''"===o?o="'":"'"===i&&(o=o.match(xe)[1].replace(Te,"'")),0!==t.indexOf(o))return L(r,NaN);t=t.slice(o.length)}}if(t.length>0&&Me.test(t))return L(r,NaN);const h=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,r)=>r.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=C(r);if(isNaN(f.getTime()))return L(r,NaN);const p={};for(const t of h){if(!t.validate(f,u))return L(r,NaN);const e=t.set(f,p,u);Array.isArray(e)?(f=e[0],Object.assign(p,e[1])):f=e}return L(r,f)}var Pe=function(t){f(r,t);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,r),e.call(this,t,n,"store-hour",o)}return l(r,[{key:"day",get:function(){return this.getAttribute("day")}},{key:"isClosed",get:function(){return null===this.getAttribute("start")&&null===this.getAttribute("end")}},{key:"is24Hours",get:function(){var t=this.startDateInstance,e=this.endDateInstance,r=Math.abs(t-e);return Math.floor(r/1e3/60)/60>23}},{key:"startDateInstance",get:function(){if(!this.hasAttribute("start"))return null;var t=this.getAttribute("start"),e=3===t.split(":").length;return Se(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"endDateInstance",get:function(){if(!this.hasAttribute("end"))return null;var t=this.getAttribute("end"),e=3===t.split(":").length;return Se(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return X(this.startDateInstance)&&X(this.endDateInstance)?"".concat(qt(this.startDateInstance,"p")," - ").concat(qt(this.endDateInstance,"p")):"".concat(this.start," - ").concat(this.end)}},{key:"humanReadableHours",get:function(){return this.isClosed?"Closed":this.is24Hours?"24 Hours":this.humanReadableHoursRange}},{key:"create",value:function(){throw new Error("There is no create() method store location!")}},{key:"update",value:function(){throw new Error("There is no update() method store location!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method store location!")}},{key:"reload",value:function(){throw new Error("There is no reload() method store location!")}}]),r}(x),Ee=function(t){f(n,t);var r=v(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,n),r.call(this,t,e,"store-location",o)}return l(n,[{key:"latitude",get:function(){return this.getAttribute("place.location.coordinates.1")}},{key:"longitude",get:function(){return this.getAttribute("place.location.coordinates.0")}},{key:"hours",get:function(){return new e.Collection(this.getAttribute("hours").map((function(t){return new Pe(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=qt(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},r=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,o),r.call(this,t,e,"store",n)}return l(o,[{key:"getReviews",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",n({store:this.id},r)).then((function(r){return new e.Collection(r.map((function(e){return new M(e,t.adapter)})))}))}},{key:"getLocations",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",n({store:this.id},r)).then((function(r){return new e.Collection(r.map((function(r){return r.place&&(r.place=new e.Place(r.place)),new Ee(r,t.adapter)})))}))}},{key:"getLocation",value:function(t){var e=this;return this.adapter.get("locations/".concat(t),{store:this.id}).then((function(t){return new Ee(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",r).then((function(r){return new e.Collection(r.map((function(e){return new Y(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new Y(t,e.adapter)}))}}]),o}(x),Ae=function(t){f(d,t);var r,n,a,i,s=v(d);function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,d),s.call(this,t,e,"network",r)}return l(d,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getResourceCollection",value:(i=u(o().mark((function t(r,n){var a,i,s=this,u=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=u.length>2&&void 0!==u[2]?u[2]:{},t.prev=1,t.next=4,this.adapter.get(r,a);case 4:return i=t.sent,t.abrupt("return",new e.Collection(i.map((function(t){return new n(t,s.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),console.error("Error fetching ".concat(r,":"),t.t0),t.t0;case 12:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(t,e){return i.apply(this,arguments)})},{key:"getStores",value:(a=u(o().mark((function t(){var e,r=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("stores",Oe,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"getStoreLocations",value:(n=u(o().mark((function t(){var e,r=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("store-locations",Ee,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"getPaymentGateways",value:(r=u(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.getResourceCollection("gateways",Y));case 1:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})}]),d}(x),qe=Array.isArray,He=function(t){f(i,t);var r,n,a=v(i);function i(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,i),r instanceof e.Adapter?y(t,t=a.call(this,{},r,"service-quote",o)):a.call(this,r,n,"service-quote",o)}return l(i,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Re(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["amount","currency"]),e=t.amount,r=t.currency;return S(e)||S(r)?null:D(e/100,r)}},{key:"fetchServiceQuotesFromCart",value:(n=u(o().mark((function t(r,n,a){var s,u,c,d,l,h,f=this,p=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d=p.length>3&&void 0!==p[3]?p[3]:"storefront",l=p.length>4&&void 0!==p[4]&&p[4],null!==(s=r)&&void 0!==s&&s.id&&(r=r.id),null!==(u=n)&&void 0!==u&&u.id&&(n=n.id),null!==(c=a)&&void 0!==c&&c.id&&(a=a.id),t.prev=5,t.next=8,this.adapter.get("service-quotes/from-cart",{origin:r,destination:n,cart:a,config:d,all:l});case 8:if(h=t.sent,!qe(h)){t.next=11;break}return t.abrupt("return",new e.Collection(h.map((function(t){return new i(t,f.adapter)}))));case 11:return t.abrupt("return",new i(h,this.adapter));case 14:throw t.prev=14,t.t0=t.catch(5),console.error("Error fetching service quotes:",t.t0),t.t0;case 18:case"end":return t.stop()}}),t,this,[[5,14]])}))),function(t,e,r){return n.apply(this,arguments)})}],[{key:"getFromCart",value:(r=u(o().mark((function t(e,r,n,a){var s,u,c,d=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=d.length>4&&void 0!==d[4]?d[4]:"storefront",u=d.length>5&&void 0!==d[5]&&d[5],c=new i(e),t.abrupt("return",c.fetchServiceQuotesFromCart(r,n,a,s,u));case 4:case"end":return t.stop()}}),t)}))),function(t,e,n,o){return r.apply(this,arguments)})}]),i}(e.ServiceQuote),Ne=new e.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,initialize:function(t,r,o,a){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return e.isResource(t)&&(t=t.id),e.isResource(r)&&(r=r.id),e.isResource(o)&&(o=o.id),e.isResource(a)&&(a=a.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),n(n({},i),{},{customer:t,cart:r,serviceQuote:o,gateway:a}),s)},captureOrder:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/capture"),{token:t,transactionDetails:r},n).then((function(t){return new e.Order(t)}))}}),Ye=function(t){f(r,t);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,r),e.call(this,t,n,"checkout",o)}return l(r,[{key:"initialize",value:function(){var t;return(t=this.store).initialize.apply(t,arguments)}},{key:"captureOrder",value:function(){var t;return(t=this.store).captureOrder.apply(t,arguments)}}]),r}(x),Ce={Product:P,Category:E,Customer:A,Cart:N,DeliveryServiceQuote:He,Store:Oe,StoreLocation:Ee,StoreHour:Pe,Checkout:Ye,Review:M},Le={BrowserAdapter:e.BrowserAdapter,NodeAdapter:e.NodeAdapter},je=function(){function t(){return c(this,t),this.resources=Ce,this.adapters=Le,this.lookup.apply(this,arguments)}return l(t,[{key:"lookup",value:function(t,r){var n=e.pluralize(t),o=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][r])throw new Error("No ".concat(e.singularize(t)," named ").concat(r," to resolve"));return w(this[n][r],b(o))}}]),t}(),Fe=function(){return w(je,Array.prototype.slice.call(arguments))},Re=function(t){f(n,t);var r=v(n);function n(){return c(this,n),r.apply(this,arguments)}return l(n,[{key:"extendActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.extendStoreActions(this,t)}},{key:"serialize",value:function(t){return Fe("resource",e.classify(this.resource),t,this.adapter)}}]),n}(e.Store),We=function(){function t(r){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(c(this,t),this.version=o.version||"v1",this.options={version:this.version,host:o.host||"https://api.fleetbase.io",namespace:"storefront/".concat(this.version)||o.namespace,publicKey:r,debug:a},!("string"==typeof(n=r)&&n.length>30&&(n.startsWith("store_")||n.startsWith("network_"))))throw new Error("⚠️ Invalid Storefront key given to Storefront SDK");this.adapter=o.adapter||function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.isNodeEnvironment()?Fe("adapter","NodeAdapter",t):Fe("adapter","BrowserAdapter",t)}(this.options),this.products=new Re("product",this.adapter),this.categories=new Re("category",this.adapter),this.reviews=new Re("review",this.adapter).extendActions(T),this.customers=new Re("customer",this.adapter).extendActions(O),this.cart=new Re("cart",this.adapter).extendActions(H),this.checkout=new Re("checkout",this.adapter).extendActions(Ne)}return l(t,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"search",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",n({query:t},r)).then((function(t){return new e.Collection(t.map((function(t){return new P(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return w(t,Array.prototype.slice.call(arguments))}}]),t}();t.Cart=N,t.Category=E,t.Checkout=Ye,t.Customer=A,t.DeliveryServiceQuote=He,t.Network=Ae,t.PaymentGateway=Y,t.Product=P,t.Review=M,t.Store=Oe,t.StoreHour=Pe,t.StoreLocation=Ee,t.default=We})); //# sourceMappingURL=storefront.min.js.map diff --git a/dist/@fleetbase/storefront.min.js.map b/dist/@fleetbase/storefront.min.js.map index 5a9a72c..93575d2 100644 --- a/dist/@fleetbase/storefront.min.js.map +++ b/dist/@fleetbase/storefront.min.js.map @@ -1 +1 @@ -{"version":3,"file":"storefront.min.js","sources":["../../src/resource.js","../../src/resources/review.js","../../src/utils/format-currency.js","../../src/utils/is-key-valid.js","../../src/utils/is-empty.js","../../src/resources/product.js","../../src/resources/category.js","../../src/resources/customer.js","../../src/utils/is-phone.js","../../src/resources/cart.js","../../src/resources/payment-gateway.js","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/toDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constructFrom.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/addDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/defaultOptions.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isValid.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/match.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDayOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/differenceInCalendarDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/addLeadingZeros.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/lightFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/formatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/longFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/protectedTokens.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/format.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Setter.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/transpose.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/utils.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DateParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/EraParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDefaultOptions.mjs","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/store.js","../../src/resources/network.js","../../src/resources/delivery-service-quote.js","../../src/resources/checkout.js","../../src/resolver.js","../../src/store.js","../../src/storefront.js","../../src/utils/detect-adapter.js"],"sourcesContent":["import { Resource } from '@fleetbase/sdk';\nimport StorefrontStore from './store';\n\nexport default class StorefrontResource extends Resource {\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n}\n","import Resource from '../resource';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst reviewActions = new StoreActions({\n count: function (storeId, options = {}) {\n const params = {};\n\n if (storeId) {\n params.store = storeId;\n }\n\n return this.adapter.get(`${this.namespace}/count`, params, options);\n },\n});\n\nexport default class Review extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'review', options);\n }\n\n getMedia() {\n // @todo\n }\n\n getPhotos() {\n // @todo\n }\n\n getVideos() {\n // @todo\n }\n}\n\nexport { reviewActions };\n","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n currencyDisplay,\n }).format(amount);\n}\n","const isKeyValid = (key) => {\n return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_'));\n};\n\nexport default isKeyValid;\n","const isEmpty = (obj) => {\n const none = obj === null || obj === undefined;\n if (none) {\n return none;\n }\n\n if (typeof obj.size === 'number') {\n return !obj.size;\n }\n\n const objectType = typeof obj;\n\n if (objectType === 'object') {\n const { size } = obj;\n if (typeof size === 'number') {\n return !size;\n }\n }\n\n if (typeof obj.length === 'number' && objectType !== 'function') {\n return !obj.length;\n }\n\n if (objectType === 'object') {\n const { length } = obj;\n if (typeof length === 'number') {\n return !length;\n }\n }\n\n return false;\n};\n\nexport default isEmpty;\n","import Resource from '../resource';\nimport Review from './review';\nimport { formatCurrency, isEmpty } from '../utils';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Product extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'product', options);\n }\n\n variants() {\n return this.getAttribute('variants');\n }\n\n addons() {\n return this.getAttribute('addon_categories');\n }\n\n get isOnSale() {\n return this.getAttribute('is_on_sale');\n }\n\n get isNotOnSale() {\n return !this.getAttribute('is_on_sale');\n }\n\n get formattedAmount() {\n const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']);\n\n if (this.isOnSale) {\n if (isEmpty(sale_price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(sale_price / 100, currency);\n }\n\n if (isEmpty(price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(price / 100, currency);\n }\n\n getReviews() {\n return this.adapter.get('reviews', { store: this.id }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n}\n","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Category extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'category', options);\n }\n\n getProducts() {\n return this.adapter.get('products', { category: this.id }).then((products) => {\n return new Collection(products.map((attributes) => new Product(attributes, this.adapter)));\n });\n }\n}\n","import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport StorefrontStore from '../store';\nimport { isPhone } from '../utils';\n\nconst customerActions = new StoreActions({\n // const { error } = await storefront.customers.login('+1 111-1111');\n login: function (identity, password = null, attributes = {}) {\n // handle phone number authentication\n if (isPhone(identity)) {\n return this.adapter.post('customers/login-with-sms', { phone: identity });\n }\n\n if (!password) {\n throw new Error('Login requires password!');\n }\n\n return this.adapter.post('customers/login', { identity, password, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n verifyCode: function (identity, code, attributes = {}) {\n return this.adapter.post('customers/verify-code', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n requestCreationCode(identity, mode = 'email') {\n return this.adapter.post('customers/request-creation-code', {\n identity,\n mode,\n });\n },\n\n create(identity, code, attributes = {}) {\n return this.adapter.post('customers', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id) {\n return this.findRecord(id);\n },\n});\n\nexport default class Customer extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'customer', {\n actions: customerActions,\n ...options,\n });\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get token() {\n return this.getAttribute('token');\n }\n\n async syncDevice(token) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/register-device', token)\n .then(() => {\n return this;\n });\n }\n\n async performAuthorizedRequest(endpoint, params = {}, method = 'GET') {\n try {\n const headers = { 'Customer-Token': this.token };\n const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params);\n return response;\n } catch (error) {\n console.error(`Error in ${method} request to ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getSavedPlaces() {\n try {\n const places = await this.performAuthorizedRequest('customers/places');\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve saved places');\n }\n }\n\n async getOrderHistory(params = {}) {\n try {\n const orders = await this.performAuthorizedRequest('customers/orders', params);\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve order history');\n }\n }\n}\n\nexport { customerActions };\n","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n};\n\nexport default isPhone;\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\n\nconst cartActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n add: function (id, productId, quantity = 1, data = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/${id}/${productId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n update: function (id, cartItemId, quantity, data = {}, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/${cartItemId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n remove: function (id, cartItemId, options = {}) {\n return this.adapter.delete(`${this.namespace}/${id}/${cartItemId}`, {}, options).then(this.afterFetch.bind(this));\n },\n\n empty: function (id, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/empty`, {}, options).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id = '') {\n return this.findRecord(id);\n },\n});\n\nexport default class Cart extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'cart', { actions: cartActions, ...options });\n }\n\n add(productId, quantity = 1, data = {}, options = {}) {\n if (productId instanceof Product) {\n productId = productId.id;\n }\n\n return this.store.add(this.id, productId, quantity, data, options);\n }\n\n update(cartItemId, quantity, data = {}, options = {}) {\n return this.store.update(this.id, cartItemId, quantity, data, options);\n }\n\n remove(cartItemId, options = {}) {\n return this.store.remove(this.id, cartItemId, options);\n }\n\n empty(options = {}) {\n return this.store.empty(this.id, options);\n }\n\n delete() {\n return this.destroy();\n }\n\n refresh() {\n return this.store.retrieve(this.id);\n }\n\n subtotal() {\n let subtotal = 0;\n\n this.contents().forEach((cartItem) => {\n subtotal += cartItem.subtotal;\n });\n\n return subtotal;\n }\n\n contents() {\n return this.getAttribute('items', []);\n }\n\n hasProduct(productId) {\n return this.contents().findIndex((cartItem) => cartItem.product_id === productId) !== -1;\n }\n\n get isEmpty() {\n const contents = this.contents();\n\n if (!isArray(contents)) {\n return true;\n }\n\n return contents.length === 0;\n }\n\n get isNotEmpty() {\n return !this.isEmpty;\n }\n}\n\nexport { cartActions };\n","import Resource from '../resource';\n\nexport default class PaymentGateway extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'payment-gateway', options);\n }\n\n get type() {\n return this.getAttribute('type');\n }\n\n get code() {\n return this.getAttribute('code');\n }\n\n get isCashGateway() {\n return this.type === 'cash';\n }\n\n get isStripeGateway() {\n return this.type === 'stripe';\n }\n\n setCheckoutToken(token) {\n this.token = token;\n }\n\n getCheckoutToken() {\n return this.token;\n }\n\n // remove default resource methods\n findRecord() {\n throw new Error('There is no findRecord() method for payment gateways!');\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method for payment gateways!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method for payment gateways!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method for payment gateways!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method for payment gateways!');\n }\n}\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const utcDate = new Date(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}\n","import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n startOfDayRight.getTime() -\n getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff =\n startOfISOWeek(_date).getTime() - startOfISOWeekYear(_date).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff =\n startOfWeek(_date, options).getTime() -\n startOfWeekYear(_date, options).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.floor(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.floor(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const protectedDayOfYearTokens = [\"D\", \"DD\"];\nconst protectedWeekYearTokens = [\"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\n\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\n\nexport function throwProtectedError(token, format, input) {\n if (token === \"YYYY\") {\n throw new RangeError(\n `Use \\`yyyy\\` instead of \\`YYYY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"YY\") {\n throw new RangeError(\n `Use \\`yy\\` instead of \\`YY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"D\") {\n throw new RangeError(\n `Use \\`d\\` instead of \\`D\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"DD\") {\n throw new RangeError(\n `Use \\`dd\\` instead of \\`DD\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n }\n}\n","import { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate,\n };\n\n const result = formatStr\n .match(longFormattingTokensRegExp)\n .map(function (substring) {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n const formatter = formatters[firstCharacter];\n if (formatter) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n return formatter(\n originalDate,\n substring,\n locale.localize,\n formatterOptions,\n );\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return substring;\n })\n .join(\"\");\n\n return result;\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { transpose } from \"../../transpose.mjs\";\nimport { constructFrom } from \"../../constructFrom.mjs\";\n\nconst TIMEZONE_UNIT_PRIORITY = 10;\n\nexport class Setter {\n subPriority = 0;\n\n validate(_utcDate, _options) {\n return true;\n }\n}\n\nexport class ValueSetter extends Setter {\n constructor(\n value,\n\n validateValue,\n\n setValue,\n\n priority,\n subPriority,\n ) {\n super();\n this.value = value;\n this.validateValue = validateValue;\n this.setValue = setValue;\n this.priority = priority;\n if (subPriority) {\n this.subPriority = subPriority;\n }\n }\n\n validate(date, options) {\n return this.validateValue(date, this.value, options);\n }\n\n set(date, flags, options) {\n return this.setValue(date, flags, this.value, options);\n }\n}\n\nexport class DateToSystemTimezoneSetter extends Setter {\n priority = TIMEZONE_UNIT_PRIORITY;\n subPriority = -1;\n set(date, flags) {\n if (flags.timestampIsSet) return date;\n return constructFrom(date, transpose(date, Date));\n }\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name transpose\n * @category Generic Helpers\n * @summary Transpose the date to the given constructor.\n *\n * @description\n * The function transposes the date to the given constructor. It helps you\n * to transpose the date in the system time zone to say `UTCDate` or any other\n * date extension.\n *\n * @typeParam DateInputType - The input `Date` type derived from the passed argument.\n * @typeParam DateOutputType - The output `Date` type derived from the passed constructor.\n *\n * @param fromDate - The date to use values from\n * @param constructor - The date constructor to use\n *\n * @returns Date transposed to the given constructor\n *\n * @example\n * // Create July 10, 2022 00:00 in locale time zone\n * const date = new Date(2022, 6, 10)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'\n *\n * @example\n * // Transpose the date to July 10, 2022 00:00 in UTC\n * transpose(date, UTCDate)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'\n */\nexport function transpose(fromDate, constructor) {\n const date =\n constructor instanceof Date\n ? constructFrom(constructor, 0)\n : new constructor(0);\n date.setFullYear(\n fromDate.getFullYear(),\n fromDate.getMonth(),\n fromDate.getDate(),\n );\n date.setHours(\n fromDate.getHours(),\n fromDate.getMinutes(),\n fromDate.getSeconds(),\n fromDate.getMilliseconds(),\n );\n return date;\n}\n\n// Fallback for modularized imports:\nexport default transpose;\n","import { ValueSetter } from \"./Setter.mjs\";\n\nexport class Parser {\n run(dateString, token, match, options) {\n const result = this.parse(dateString, token, match, options);\n if (!result) {\n return null;\n }\n\n return {\n setter: new ValueSetter(\n result.value,\n this.validate,\n this.set,\n this.priority,\n this.subPriority,\n ),\n rest: result.rest,\n };\n }\n\n validate(_utcDate, _value, _options) {\n return true;\n }\n}\n","export const numericPatterns = {\n month: /^(1[0-2]|0?\\d)/, // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/, // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/, // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/, // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/, // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/, // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/, // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/, // 0 to 12\n minute: /^[0-5]?\\d/, // 0 to 59\n second: /^[0-5]?\\d/, // 0 to 59\n\n singleDigit: /^\\d/, // 0 to 9\n twoDigits: /^\\d{1,2}/, // 0 to 99\n threeDigits: /^\\d{1,3}/, // 0 to 999\n fourDigits: /^\\d{1,4}/, // 0 to 9999\n\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/, // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/, // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/, // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/, // 0 to 9999, -0 to -9999\n};\n\nexport const timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/,\n};\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n millisecondsInSecond,\n} from \"../../constants.mjs\";\nimport { numericPatterns } from \"./constants.mjs\";\n\nexport function mapValue(parseFnResult, mapFn) {\n if (!parseFnResult) {\n return parseFnResult;\n }\n\n return {\n value: mapFn(parseFnResult.value),\n rest: parseFnResult.rest,\n };\n}\n\nexport function parseNumericPattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n return {\n value: parseInt(matchResult[0], 10),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseTimezonePattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n // Input is 'Z'\n if (matchResult[0] === \"Z\") {\n return {\n value: 0,\n rest: dateString.slice(1),\n };\n }\n\n const sign = matchResult[1] === \"+\" ? 1 : -1;\n const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n\n return {\n value:\n sign *\n (hours * millisecondsInHour +\n minutes * millisecondsInMinute +\n seconds * millisecondsInSecond),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseAnyDigitsSigned(dateString) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);\n}\n\nexport function parseNDigits(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function parseNDigitsSigned(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^-?\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function dayPeriodEnumToHours(dayPeriod) {\n switch (dayPeriod) {\n case \"morning\":\n return 4;\n case \"evening\":\n return 17;\n case \"pm\":\n case \"noon\":\n case \"afternoon\":\n return 12;\n case \"am\":\n case \"midnight\":\n case \"night\":\n default:\n return 0;\n }\n}\n\nexport function normalizeTwoDigitYear(twoDigitYear, currentYear) {\n const isCommonEra = currentYear > 0;\n // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n\n let result;\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n const rangeEnd = absCurrentYear + 50;\n const rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n const isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nexport function isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DAYS_IN_MONTH_LEAP_YEAR = [\n 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n];\n\n// Day of the month\nexport class DateParser extends Parser {\n priority = 90;\n subPriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"d\":\n return parseNumericPattern(numericPatterns.date, dateString);\n case \"do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n const month = date.getMonth();\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n }\n\n set(date, _flags, value) {\n date.setDate(value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { addDays } from \"./addDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link setDay} function options.\n */\n\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the week of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the day of the week set\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setDay(date, day, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const currentDay = _date.getDay();\n\n const remainder = day % 7;\n const dayIndex = (remainder + 7) % 7;\n\n const delta = 7 - weekStartsOn;\n const diff =\n day < 0 || day > 6\n ? day - ((currentDay + delta) % 7)\n : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setDay;\n","import { addDays } from \"./addDays.mjs\";\nimport { getISODay } from \"./getISODay.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the ISO week of the new date\n *\n * @returns The new date with the day of the ISO week set\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * const result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setISODay(date, day) {\n const _date = toDate(date);\n const currentDay = getISODay(_date);\n const diff = day - currentDay;\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setISODay;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * const result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nexport function getISODay(date) {\n const _date = toDate(date);\n let day = _date.getDay();\n\n if (day === 0) {\n day = 7;\n }\n\n return day;\n}\n\n// Fallback for modularized imports:\nexport default getISODay;\n","import { EraParser } from \"./parsers/EraParser.mjs\";\nimport { YearParser } from \"./parsers/YearParser.mjs\";\nimport { LocalWeekYearParser } from \"./parsers/LocalWeekYearParser.mjs\";\nimport { ISOWeekYearParser } from \"./parsers/ISOWeekYearParser.mjs\";\nimport { ExtendedYearParser } from \"./parsers/ExtendedYearParser.mjs\";\nimport { QuarterParser } from \"./parsers/QuarterParser.mjs\";\nimport { StandAloneQuarterParser } from \"./parsers/StandAloneQuarterParser.mjs\";\nimport { MonthParser } from \"./parsers/MonthParser.mjs\";\nimport { StandAloneMonthParser } from \"./parsers/StandAloneMonthParser.mjs\";\nimport { LocalWeekParser } from \"./parsers/LocalWeekParser.mjs\";\nimport { ISOWeekParser } from \"./parsers/ISOWeekParser.mjs\";\nimport { DateParser } from \"./parsers/DateParser.mjs\";\nimport { DayOfYearParser } from \"./parsers/DayOfYearParser.mjs\";\nimport { DayParser } from \"./parsers/DayParser.mjs\";\nimport { LocalDayParser } from \"./parsers/LocalDayParser.mjs\";\nimport { StandAloneLocalDayParser } from \"./parsers/StandAloneLocalDayParser.mjs\";\nimport { ISODayParser } from \"./parsers/ISODayParser.mjs\";\nimport { AMPMParser } from \"./parsers/AMPMParser.mjs\";\nimport { AMPMMidnightParser } from \"./parsers/AMPMMidnightParser.mjs\";\nimport { DayPeriodParser } from \"./parsers/DayPeriodParser.mjs\";\nimport { Hour1to12Parser } from \"./parsers/Hour1to12Parser.mjs\";\nimport { Hour0to23Parser } from \"./parsers/Hour0to23Parser.mjs\";\nimport { Hour0To11Parser } from \"./parsers/Hour0To11Parser.mjs\";\nimport { Hour1To24Parser } from \"./parsers/Hour1To24Parser.mjs\";\nimport { MinuteParser } from \"./parsers/MinuteParser.mjs\";\nimport { SecondParser } from \"./parsers/SecondParser.mjs\";\nimport { FractionOfSecondParser } from \"./parsers/FractionOfSecondParser.mjs\";\nimport { ISOTimezoneWithZParser } from \"./parsers/ISOTimezoneWithZParser.mjs\";\nimport { ISOTimezoneParser } from \"./parsers/ISOTimezoneParser.mjs\";\nimport { TimestampSecondsParser } from \"./parsers/TimestampSecondsParser.mjs\";\nimport { TimestampMillisecondsParser } from \"./parsers/TimestampMillisecondsParser.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- It's ok, we want any here\nexport const parsers = {\n G: new EraParser(),\n y: new YearParser(),\n Y: new LocalWeekYearParser(),\n R: new ISOWeekYearParser(),\n u: new ExtendedYearParser(),\n Q: new QuarterParser(),\n q: new StandAloneQuarterParser(),\n M: new MonthParser(),\n L: new StandAloneMonthParser(),\n w: new LocalWeekParser(),\n I: new ISOWeekParser(),\n d: new DateParser(),\n D: new DayOfYearParser(),\n E: new DayParser(),\n e: new LocalDayParser(),\n c: new StandAloneLocalDayParser(),\n i: new ISODayParser(),\n a: new AMPMParser(),\n b: new AMPMMidnightParser(),\n B: new DayPeriodParser(),\n h: new Hour1to12Parser(),\n H: new Hour0to23Parser(),\n K: new Hour0To11Parser(),\n k: new Hour1To24Parser(),\n m: new MinuteParser(),\n s: new SecondParser(),\n S: new FractionOfSecondParser(),\n X: new ISOTimezoneWithZParser(),\n x: new ISOTimezoneParser(),\n t: new TimestampSecondsParser(),\n T: new TimestampMillisecondsParser(),\n};\n","import { Parser } from \"../Parser.mjs\";\n\nexport class EraParser extends Parser {\n priority = 140;\n\n parse(dateString, token, match) {\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return (\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n\n // A, B\n case \"GGGGG\":\n return match.era(dateString, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return (\n match.era(dateString, { width: \"wide\" }) ||\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n }\n }\n\n set(date, flags, value) {\n flags.era = value;\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"R\", \"u\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n// | Year | y | yy | yyy | yyyy | yyyyy |\n// |----------|-------|----|-------|-------|-------|\n// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\nexport class YearParser extends Parser {\n priority = 130;\n incompatibleTokens = [\"Y\", \"R\", \"u\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"yy\",\n });\n\n switch (token) {\n case \"y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value) {\n const currentYear = date.getFullYear();\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(normalizedTwoDigitYear, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { getWeekYear } from \"../../../getWeekYear.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// Local week-numbering year\nexport class LocalWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"YY\",\n });\n\n switch (token) {\n case \"Y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"Yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value, options) {\n const currentYear = getWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(\n normalizedTwoDigitYear,\n 0,\n options.firstWeekContainsDate,\n );\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\n// ISO week-numbering year\nexport class ISOWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"R\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n const firstWeekOfYear = constructFrom(date, 0);\n firstWeekOfYear.setFullYear(value, 0, 4);\n firstWeekOfYear.setHours(0, 0, 0, 0);\n return startOfISOWeek(firstWeekOfYear);\n }\n\n incompatibleTokens = [\n \"G\",\n \"y\",\n \"Y\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\nexport class ExtendedYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"u\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"G\", \"y\", \"Y\", \"R\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class QuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n case \"QQ\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class StandAloneQuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n case \"qq\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MonthParser extends Parser {\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"L\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"M\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"MM\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // J, F, ..., D\n case \"MMMMM\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class StandAloneMonthParser extends Parser {\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"LL\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // J, F, ..., D\n case \"LLLLL\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setWeek } from \"../../../setWeek.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// Local week of year\nexport class LocalWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"w\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"wo\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value, options) {\n return startOfWeek(setWeek(date, value, options), options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { getWeek } from \"./getWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link setWeek} function options.\n */\n\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the local week set\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * const result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * const result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\nexport function setWeek(date, week, options) {\n const _date = toDate(date);\n const diff = getWeek(_date, options) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setWeek;\n","import { setISOWeek } from \"../../../setISOWeek.mjs\";\nimport { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// ISO week of year\nexport class ISOWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"I\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"Io\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value) {\n return startOfISOWeek(setISOWeek(date, value));\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { getISOWeek } from \"./getISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The ISO week of the new date\n *\n * @returns The new date with the ISO week set\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * const result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nexport function setISOWeek(date, week) {\n const _date = toDate(date);\n const diff = getISOWeek(_date) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setISOWeek;\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nexport class DayOfYearParser extends Parser {\n priority = 90;\n\n subpriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"D\":\n case \"DD\":\n return parseNumericPattern(numericPatterns.dayOfYear, dateString);\n case \"Do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n }\n\n set(date, _flags, value) {\n date.setMonth(0, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"E\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\n\n// Day of week\nexport class DayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"EEEEE\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"EEEE\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"D\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Local day of week\nexport class LocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"e\":\n case \"ee\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"eo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"eee\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"eeeee\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"eeee\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Stand-alone local day of week\nexport class StandAloneLocalDayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"c\":\n case \"cc\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"co\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"ccc\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // T\n case \"ccccc\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return (\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // Tuesday\n case \"cccc\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"e\",\n \"t\",\n \"T\",\n ];\n}\n","import { setISODay } from \"../../../setISODay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// ISO day of week\nexport class ISODayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => {\n if (value === 0) {\n return 7;\n }\n return value;\n };\n\n switch (token) {\n // 2\n case \"i\":\n case \"ii\": // 02\n return parseNDigits(token.length, dateString);\n // 2nd\n case \"io\":\n return match.ordinalNumber(dateString, { unit: \"day\" });\n // Tue\n case \"iii\":\n return mapValue(\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // T\n case \"iiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tu\n case \"iiiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tuesday\n case \"iiii\":\n default:\n return mapValue(\n match.day(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 7;\n }\n\n set(date, _flags, value) {\n date = setISODay(date, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"E\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"a\":\n case \"aa\":\n case \"aaa\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"aaaaa\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"b\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMMidnightParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"b\":\n case \"bb\":\n case \"bbb\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"bbbbb\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\n// in the morning, in the afternoon, in the evening, at night\nexport class DayPeriodParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"BBBBB\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1to12Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"h\":\n return parseNumericPattern(numericPatterns.hour12h, dateString);\n case \"ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 12;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setHours(0, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"H\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0to23Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"H\":\n return parseNumericPattern(numericPatterns.hour23h, dateString);\n case \"Ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 23;\n }\n\n set(date, _flags, value) {\n date.setHours(value, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0To11Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"K\":\n return parseNumericPattern(numericPatterns.hour11h, dateString);\n case \"Ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"h\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1To24Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"k\":\n return parseNumericPattern(numericPatterns.hour24h, dateString);\n case \"ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 24;\n }\n\n set(date, _flags, value) {\n const hours = value <= 24 ? value % 24 : value;\n date.setHours(hours, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"H\", \"K\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MinuteParser extends Parser {\n priority = 60;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"m\":\n return parseNumericPattern(numericPatterns.minute, dateString);\n case \"mo\":\n return match.ordinalNumber(dateString, { unit: \"minute\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setMinutes(value, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class SecondParser extends Parser {\n priority = 50;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"s\":\n return parseNumericPattern(numericPatterns.second, dateString);\n case \"so\":\n return match.ordinalNumber(dateString, { unit: \"second\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setSeconds(value, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\nexport class FractionOfSecondParser extends Parser {\n priority = 30;\n\n parse(dateString, token) {\n const valueCallback = (value) =>\n Math.floor(value * Math.pow(10, -token.length + 3));\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n\n set(date, _flags, value) {\n date.setMilliseconds(value);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601. +00:00 is `'Z'`)\nexport class ISOTimezoneWithZParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"X\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"XX\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"XXXX\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"XXXXX\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"XXX\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"x\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601)\nexport class ISOTimezoneParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"x\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"xx\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"xxxx\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"xxxxx\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"xxx\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"X\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampSecondsParser extends Parser {\n priority = 40;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value * 1000), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampMillisecondsParser extends Parser {\n priority = 20;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getDefaultOptions } from \"./getDefaultOptions.mjs\";\nimport { enUS as defaultLocale } from \"./locale/en-US.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { parsers } from \"./parse/_lib/parsers.mjs\";\nimport { DateToSystemTimezoneSetter } from \"./parse/_lib/Setter.mjs\";\n\n/**\n * The {@link parse} function options.\n */\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\n\nconst notWhitespaceRegExp = /\\S/;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)\n * and [setWeekYear](https://date-fns.org/docs/setWeekYear)).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateStr - The string to parse\n * @param formatStr - The string of tokens\n * @param referenceDate - defines values missing from the parsed dateString\n * @param options - An object with options.\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @returns The parsed date\n *\n * @throws `options.locale` must contain `match` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\nexport function parse(dateStr, formatStr, referenceDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n if (formatStr === \"\") {\n if (dateStr === \"\") {\n return toDate(referenceDate);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n\n const subFnOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n // If timezone isn't specified, it will be set to the system timezone\n const setters = [new DateToSystemTimezoneSetter()];\n\n const tokens = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter in longFormatters) {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp);\n\n const usedTokens = [];\n\n for (let token of tokens) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n\n const firstCharacter = token[0];\n const parser = parsers[firstCharacter];\n if (parser) {\n const { incompatibleTokens } = parser;\n if (Array.isArray(incompatibleTokens)) {\n const incompatibleToken = usedTokens.find(\n (usedToken) =>\n incompatibleTokens.includes(usedToken.token) ||\n usedToken.token === firstCharacter,\n );\n if (incompatibleToken) {\n throw new RangeError(\n `The format string mustn't contain \\`${incompatibleToken.fullToken}\\` and \\`${token}\\` at the same time`,\n );\n }\n } else if (parser.incompatibleTokens === \"*\" && usedTokens.length > 0) {\n throw new RangeError(\n `The format string mustn't contain \\`${token}\\` and any other token at the same time`,\n );\n }\n\n usedTokens.push({ token: firstCharacter, fullToken: token });\n\n const parseResult = parser.run(\n dateStr,\n token,\n locale.match,\n subFnOptions,\n );\n\n if (!parseResult) {\n return constructFrom(referenceDate, NaN);\n }\n\n setters.push(parseResult.setter);\n\n dateStr = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n // Replace two single quote characters with one single quote character\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n }\n\n // Cut token from string, or, if string doesn't match the token, return Invalid Date\n if (dateStr.indexOf(token) === 0) {\n dateStr = dateStr.slice(token.length);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n }\n\n // Check if the remaining input contains something other than whitespace\n if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const uniquePrioritySetters = setters\n .map((setter) => setter.priority)\n .sort((a, b) => b - a)\n .filter((priority, index, array) => array.indexOf(priority) === index)\n .map((priority) =>\n setters\n .filter((setter) => setter.priority === priority)\n .sort((a, b) => b.subPriority - a.subPriority),\n )\n .map((setterArray) => setterArray[0]);\n\n let date = toDate(referenceDate);\n\n if (isNaN(date.getTime())) {\n return constructFrom(referenceDate, NaN);\n }\n\n const flags = {};\n for (const setter of uniquePrioritySetters) {\n if (!setter.validate(date, subFnOptions)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const result = setter.set(date, flags, subFnOptions);\n // Result is tuple (date, flags)\n if (Array.isArray(result)) {\n date = result[0];\n Object.assign(flags, result[1]);\n // Result is date\n } else {\n date = result;\n }\n }\n\n return constructFrom(referenceDate, date);\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default parse;\n","import { getDefaultOptions as getInternalDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * @name getDefaultOptions\n * @category Common Helpers\n * @summary Get default options.\n * @pure false\n *\n * @description\n * Returns an object that contains defaults for\n * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`\n * arguments for all functions.\n *\n * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).\n *\n * @returns The default options\n *\n * @example\n * const result = getDefaultOptions()\n * //=> {}\n *\n * @example\n * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })\n * const result = getDefaultOptions()\n * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }\n */\nexport function getDefaultOptions() {\n return Object.assign({}, getInternalDefaultOptions());\n}\n\n// Fallback for modularized imports:\nexport default getDefaultOptions;\n","import Resource from '../resource';\nimport { format, parse, isValid } from 'date-fns';\n\nexport default class StoreHour extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-hour', options);\n }\n\n get day() {\n return this.getAttribute('day');\n }\n\n get isClosed() {\n return this.getAttribute('start') === null && this.getAttribute('end') === null;\n }\n\n get is24Hours() {\n const start = this.startDateInstance;\n const end = this.endDateInstance;\n const diff = Math.abs(start - end);\n const hours = Math.floor(diff / 1000 / 60) / 60;\n\n return hours > 23;\n }\n\n get startDateInstance() {\n if (!this.hasAttribute('start')) {\n return null;\n }\n\n const start = this.getAttribute('start');\n const includesSeconds = start.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(start, format, new Date());\n }\n\n get endDateInstance() {\n if (!this.hasAttribute('end')) {\n return null;\n }\n\n const end = this.getAttribute('end');\n const includesSeconds = end.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(end, format, new Date());\n }\n\n get humanReadableHoursRange() {\n if (!isValid(this.startDateInstance) || !isValid(this.endDateInstance)) {\n return `${this.start} - ${this.end}`;\n }\n\n return `${format(this.startDateInstance, 'p')} - ${format(this.endDateInstance, 'p')}`;\n }\n\n get humanReadableHours() {\n if (this.isClosed) {\n return 'Closed';\n }\n\n if (this.is24Hours) {\n return '24 Hours';\n }\n\n return this.humanReadableHoursRange;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreHour from './store-hour';\nimport { Collection } from '@fleetbase/sdk';\nimport { format } from 'date-fns';\n\nexport default class StoreLocation extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-location', options);\n }\n\n get latitude() {\n return this.getAttribute('place.location.coordinates.1');\n }\n\n get longitude() {\n return this.getAttribute('place.location.coordinates.0');\n }\n\n get hours() {\n return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes)));\n }\n\n get isAlwaysOpen() {\n return this.hours.every((hour) => hour?.is24Hours);\n }\n\n get today() {\n const today = format(new Date(), 'EEEE');\n\n return this.schedule[today];\n }\n\n get schedule() {\n const schedule = {};\n const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\n for (let i = 0; i < week.length; i++) {\n const day = week[i];\n\n schedule[day] = new Collection();\n }\n\n for (let i = 0; i < this.hours.length; i++) {\n const hour = this.hours.objectAt(i);\n\n schedule[hour.day].pushObject(hour);\n }\n\n return schedule;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Review from './review';\nimport { Collection, Place } from '@fleetbase/sdk';\n\nexport default class Store extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store', options);\n }\n\n getReviews(params = {}) {\n return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n\n getLocations(params = {}) {\n return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {\n return new Collection(\n storeLocations.map((attributes) => {\n if (attributes.place) {\n attributes.place = new Place(attributes.place);\n }\n\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getLocation(id) {\n return this.adapter.get(`locations/${id}`, { store: this.id }).then((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n });\n }\n\n getPaymentGateways(params = {}) {\n return this.adapter.get('gateways', params).then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateway(id) {\n return this.adapter.get(`gateways/${id}`).then((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n });\n }\n}\n","import { Collection } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport PaymentGateway from './payment-gateway';\nimport Store from './store';\nimport StoreLocation from './store-location';\n\nexport default class Network extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'network', options);\n }\n\n getTags(params = {}) {\n return this.adapter.get('tags', params);\n }\n\n async getResourceCollection(endpoint, ResourceClass, params = {}) {\n try {\n const resources = await this.adapter.get(endpoint, params);\n return new Collection(resources.map((attributes) => new ResourceClass(attributes, this.adapter)));\n } catch (error) {\n console.error(`Error fetching ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getStores(params = {}) {\n return this.getResourceCollection('stores', Store, params);\n }\n\n async getStoreLocations(params = {}) {\n return this.getResourceCollection('store-locations', StoreLocation, params);\n }\n\n async getPaymentGateways() {\n return this.getResourceCollection('gateways', PaymentGateway);\n }\n}\n","import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk';\nimport StorefrontStore from '../store';\nimport { formatCurrency, isEmpty } from '../utils';\n\nconst { isArray } = Array;\n\nexport default class DeliveryServiceQuote extends ServiceQuote {\n constructor(attributes = {}, adapter, options = {}) {\n if (attributes instanceof Adapter) {\n return super({}, attributes, 'service-quote', options);\n }\n\n super(attributes, adapter, 'service-quote', options);\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get formattedAmount() {\n const { amount, currency } = this.getAttributes(['amount', 'currency']);\n\n if (isEmpty(amount) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(amount / 100, currency);\n }\n\n async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n if (destination?.id) {\n destination = destination.id;\n }\n if (cart?.id) {\n cart = cart.id;\n }\n\n try {\n const serviceQuotes = await this.adapter.get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n });\n\n if (isArray(serviceQuotes)) {\n return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter)));\n }\n\n return new DeliveryServiceQuote(serviceQuotes, this.adapter);\n } catch (error) {\n console.error('Error fetching service quotes:', error);\n throw error;\n }\n }\n\n static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) {\n const quote = new DeliveryServiceQuote(adapter);\n return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all);\n }\n}\n","import { Order, StoreActions, isResource } from '@fleetbase/sdk';\nimport Resource from '../resource';\n\nconst checkoutActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n initialize: function (customer, cart, serviceQuote, gateway, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n if (isResource(gateway)) {\n gateway = gateway.getAttribute('code');\n }\n\n return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options);\n },\n\n captureOrder: function (token, transactionDetails = {}, options = {}) {\n return this.adapter.get(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson));\n },\n});\n\nexport default class Checkout extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'checkout', options);\n }\n\n initialize() {\n return this.store.initialize(...arguments);\n }\n\n captureOrder() {\n return this.store.captureOrder(...arguments);\n }\n}\n\nexport { checkoutActions };\n","import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources';\nimport { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk';\n\nconst resources = {\n Product,\n Category,\n Customer,\n Cart,\n DeliveryServiceQuote,\n Store,\n StoreLocation,\n StoreHour,\n Checkout,\n Review,\n};\n\nconst adapters = {\n BrowserAdapter,\n NodeAdapter,\n};\n\nclass Resolver {\n constructor() {\n this.resources = resources;\n this.adapters = adapters;\n\n return this.lookup(...arguments);\n }\n\n lookup(type, className) {\n const key = pluralize(type);\n const params = [...arguments].slice(2);\n\n if (!this[key]) {\n throw new Error('Attempted to resolve invalid type');\n }\n\n if (!this[key][className]) {\n throw new Error(`No ${singularize(type)} named ${className} to resolve`);\n }\n\n return new this[key][className](...params);\n }\n}\n\nconst lookup = function () {\n return new Resolver(...arguments);\n};\n\nexport { Resolver, lookup };\n","import { Store, classify, extendStoreActions } from '@fleetbase/sdk';\nimport { lookup } from './resolver';\n\nexport default class StorefrontStore extends Store {\n constructor() {\n super(...arguments);\n }\n\n extendActions(actions = []) {\n return extendStoreActions(this, actions);\n }\n\n serialize(json) {\n return lookup('resource', classify(this.resource), json, this.adapter);\n }\n}\n","import StorefrontStore from './store';\nimport { detectAdapter, isKeyValid } from './utils';\nimport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network } from './resources';\nimport { cartActions } from './resources/cart';\nimport { customerActions } from './resources/customer';\nimport { checkoutActions } from './resources/checkout';\nimport { reviewActions } from './resources/review';\nimport { Collection } from '@fleetbase/sdk';\n\n/**\n * // instance\n * const storefront = new Storefront();\n *\n */\n\nexport default class Storefront {\n /**\n * Builds an instance of the Fleetbase Storefront SDK\n *\n * @param {String} storeKey The access key for the storefront store\n * @param {Object} config The config object\n * @param {Boolean} debug Enable debug mode\n * @return {Storefront} Instance\n */\n constructor(storeKey, config = {}, debug = false) {\n this.version = config.version || 'v1';\n this.options = {\n version: this.version,\n host: config.host || 'https://api.fleetbase.io',\n namespace: `storefront/${this.version}` || config.namespace,\n publicKey: storeKey,\n debug,\n };\n\n if (!isKeyValid(storeKey)) {\n throw new Error('⚠️ Invalid Storefront key given to Storefront SDK');\n }\n\n this.adapter = config.adapter || detectAdapter(this.options);\n\n this.products = new StorefrontStore('product', this.adapter);\n this.categories = new StorefrontStore('category', this.adapter);\n this.reviews = new StorefrontStore('review', this.adapter).extendActions(reviewActions);\n this.customers = new StorefrontStore('customer', this.adapter).extendActions(customerActions);\n this.cart = new StorefrontStore('cart', this.adapter).extendActions(cartActions);\n this.checkout = new StorefrontStore('checkout', this.adapter).extendActions(checkoutActions);\n }\n\n /** loads information about this storefront */\n about() {\n return this.adapter.get('about');\n }\n\n /** search products in store or network */\n search(query, options = {}) {\n return this.adapter.get('search', { query, ...options }).then((products) => {\n return new Collection(products.map((product) => new Product(product)));\n });\n }\n\n static newInstance() {\n return new Storefront(...arguments);\n }\n\n setAdapter(adapter) {\n this.adapter = adapter;\n }\n\n getAdapter() {\n return this.adapter;\n }\n}\n\nexport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network };\n","import { lookup } from '../resolver';\nimport { isNodeEnvironment } from '@fleetbase/sdk';\n\nconst detectAdapter = (options = {}) => {\n if (isNodeEnvironment()) {\n return lookup('adapter', 'NodeAdapter', options);\n }\n\n return lookup('adapter', 'BrowserAdapter', options);\n};\n\nexport default detectAdapter;\n"],"names":["StorefrontResource","_Resource","_inherits","_super","_createSuper","_classCallCheck","apply","this","arguments","_createClass","key","value","adapter","_this$options","store","StorefrontStore","resource","onAfterFetch","syncAttributes","bind","actions","options","Resource","reviewActions","StoreActions","count","storeId","length","undefined","params","get","concat","namespace","Review","attributes","call","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isEmpty","obj","none","size","objectType","_typeof","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","_this","id","then","reviews","Collection","map","Category","category","products","customerActions","login","identity","password","test","isPhone","post","phone","Error","_objectSpread","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","_getOrderHistory","_getSavedPlaces","_performAuthorizedRequest","_syncDevice","_asyncToGenerator","_regeneratorRuntime","mark","_callee","token","wrap","_context","prev","next","abrupt","setHeaders","stop","_x","_callee2","endpoint","method","headers","response","_args2","_context2","toLowerCase","sent","t0","console","error","_x2","_callee3","places","_this2","_context3","performAuthorizedRequest","Place","_callee4","orders","_this3","_args4","_context4","Order","isArray","Array","cartActions","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","PaymentGateway","type","toDate","argument","argStr","Object","prototype","toString","Date","constructor","NaN","constructFrom","date","addDays","_date","isNaN","setDate","getDate","millisecondsInWeek","millisecondsInDay","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","locale","day","getDay","diff","setHours","startOfISOWeek","getISOWeekYear","year","getFullYear","fourthOfJanuaryOfNextYear","setFullYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTime","startOfDay","getTimezoneOffsetInMilliseconds","utcDate","UTC","getMonth","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isValid","Number","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","buildFormatLongFn","args","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","valuesArray","context","formattingValues","defaultFormattingWidth","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","array","predicate","pattern","object","hasOwnProperty","findKey","valueCallback","rest","slice","enUS","formatDistance","result","tokenValue","replace","addSuffix","comparison","formatRelative","_baseDate","_options","localize","ordinalNumber","dirtyNumber","number","rem100","era","narrow","abbreviated","wide","quarter","month","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","firstWeekContainsDate","getDayOfYear","dateLeft","dateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","Math","round","differenceInCalendarDays","cleanDate","startOfYear","getISOWeek","fourthOfJanuary","startOfISOWeekYear","getWeekYear","firstWeekOfNextYear","firstWeekOfThisYear","getWeek","firstWeek","startOfWeekYear","addLeadingZeros","targetLength","abs","padStart","lightFormatters","y","signedYear","M","d","a","dayPeriodEnumValue","toUpperCase","h","H","m","s","S","numberOfDigits","milliseconds","floor","pow","dayPeriodEnum","formatters","G","unit","Y","signedWeekYear","weekYear","R","u","Q","ceil","q","L","w","week","I","isoWeek","D","dayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","b","hours","B","K","k","X","_localize","timezoneOffset","_originalDate","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","originalDate","T","offset","delimiter","sign","absOffset","minutes","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeLongFormatter","datePattern","timePattern","dateTimeFormat","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","indexOf","isProtectedWeekYearToken","throwProtectedError","input","RangeError","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","defaultLocale","formatterOptions","substring","firstCharacter","longFormatter","join","matched","cleanEscapedString","formatter","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","Setter","subPriority","validate","_utcDate","ValueSetter","validateValue","setValue","priority","super","set","flags","DateToSystemTimezoneSetter","timestampIsSet","fromDate","transpose","Parser","run","dateString","parse","setter","_value","numericPatterns","timezonePatterns","mapValue","parseFnResult","mapFn","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","isLeapYearIndex","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","setDay","currentDay","delta","setISODay","getISODay","parsers","incompatibleTokens","isTwoDigitYear","normalizedTwoDigitYear","_flags","firstWeekOfYear","setMonth","setWeek","setISOWeek","isLeapYear","subpriority","wholeWeekDays","isPM","setMinutes","setSeconds","setMilliseconds","notWhitespaceRegExp","dateStr","referenceDate","assign","getInternalDefaultOptions","subFnOptions","setters","tokens","usedTokens","parser","incompatibleToken","find","usedToken","includes","fullToken","push","uniquePrioritySetters","sort","filter","setterArray","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","Store","storeLocations","place","_this4","gateways","_this5","Network","_getPaymentGateways","_getStoreLocations","_getStores","_getResourceCollection","ResourceClass","resources","_args","getResourceCollection","_args3","DeliveryServiceQuote","_ServiceQuote","_getFromCart","_fetchServiceQuotesFromCart","Adapter","_possibleConstructorReturn","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","_x3","quote","fetchServiceQuotesFromCart","_x4","_x5","_x6","_x7","ServiceQuote","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","_this$store","_this$store2","adapters","BrowserAdapter","NodeAdapter","Resolver","lookup","className","pluralize","singularize","_construct","_toConsumableArray","_Store","extendStoreActions","json","classify","Storefront","storeKey","debug","version","host","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CAAAF,IAAA,cAAAC,MAVD,WACI,OAAAikB,EAAWM,EAAUld,MAAA4B,UAAA4G,MAAArO,KAAI3B,WAC7B,KAAC0kB,CAAA,CA/C0B","x_google_ignoreList":[11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90]} \ No newline at end of file +{"version":3,"file":"storefront.min.js","sources":["../../src/resource.js","../../src/resources/review.js","../../src/utils/format-currency.js","../../src/utils/is-key-valid.js","../../src/utils/is-empty.js","../../src/resources/product.js","../../src/resources/category.js","../../src/resources/customer.js","../../src/utils/is-phone.js","../../src/resources/cart.js","../../src/resources/payment-gateway.js","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/toDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constructFrom.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/addDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/defaultOptions.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isValid.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/match.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDayOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/differenceInCalendarDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/addLeadingZeros.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/lightFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/formatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/longFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/protectedTokens.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/format.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Setter.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/transpose.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/utils.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DateParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/EraParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDefaultOptions.mjs","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/store.js","../../src/resources/network.js","../../src/resources/delivery-service-quote.js","../../src/resources/checkout.js","../../src/resolver.js","../../src/store.js","../../src/storefront.js","../../src/utils/detect-adapter.js"],"sourcesContent":["import { Resource } from '@fleetbase/sdk';\nimport StorefrontStore from './store';\n\nexport default class StorefrontResource extends Resource {\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n}\n","import Resource from '../resource';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst reviewActions = new StoreActions({\n count: function (storeId, options = {}) {\n const params = {};\n\n if (storeId) {\n params.store = storeId;\n }\n\n return this.adapter.get(`${this.namespace}/count`, params, options);\n },\n});\n\nexport default class Review extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'review', options);\n }\n\n getMedia() {\n // @todo\n }\n\n getPhotos() {\n // @todo\n }\n\n getVideos() {\n // @todo\n }\n}\n\nexport { reviewActions };\n","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n currencyDisplay,\n }).format(amount);\n}\n","const isKeyValid = (key) => {\n return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_'));\n};\n\nexport default isKeyValid;\n","const isEmpty = (obj) => {\n const none = obj === null || obj === undefined;\n if (none) {\n return none;\n }\n\n if (typeof obj.size === 'number') {\n return !obj.size;\n }\n\n const objectType = typeof obj;\n\n if (objectType === 'object') {\n const { size } = obj;\n if (typeof size === 'number') {\n return !size;\n }\n }\n\n if (typeof obj.length === 'number' && objectType !== 'function') {\n return !obj.length;\n }\n\n if (objectType === 'object') {\n const { length } = obj;\n if (typeof length === 'number') {\n return !length;\n }\n }\n\n return false;\n};\n\nexport default isEmpty;\n","import Resource from '../resource';\nimport Review from './review';\nimport { formatCurrency, isEmpty } from '../utils';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Product extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'product', options);\n }\n\n variants() {\n return this.getAttribute('variants');\n }\n\n addons() {\n return this.getAttribute('addon_categories');\n }\n\n get isOnSale() {\n return this.getAttribute('is_on_sale');\n }\n\n get isNotOnSale() {\n return !this.getAttribute('is_on_sale');\n }\n\n get formattedAmount() {\n const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']);\n\n if (this.isOnSale) {\n if (isEmpty(sale_price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(sale_price / 100, currency);\n }\n\n if (isEmpty(price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(price / 100, currency);\n }\n\n getReviews() {\n return this.adapter.get('reviews', { store: this.id }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n}\n","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Category extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'category', options);\n }\n\n getProducts() {\n return this.adapter.get('products', { category: this.id }).then((products) => {\n return new Collection(products.map((attributes) => new Product(attributes, this.adapter)));\n });\n }\n}\n","import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport StorefrontStore from '../store';\nimport { isPhone } from '../utils';\n\nconst customerActions = new StoreActions({\n // const { error } = await storefront.customers.login('+1 111-1111');\n login: function (identity, password = null, attributes = {}) {\n // handle phone number authentication\n if (isPhone(identity)) {\n return this.adapter.post('customers/login-with-sms', { phone: identity });\n }\n\n if (!password) {\n throw new Error('Login requires password!');\n }\n\n return this.adapter.post('customers/login', { identity, password, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n verifyCode: function (identity, code, attributes = {}) {\n return this.adapter.post('customers/verify-code', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n requestCreationCode(identity, mode = 'email') {\n return this.adapter.post('customers/request-creation-code', {\n identity,\n mode,\n });\n },\n\n create(identity, code, attributes = {}) {\n return this.adapter.post('customers', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id) {\n return this.findRecord(id);\n },\n});\n\nexport default class Customer extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'customer', {\n actions: customerActions,\n ...options,\n });\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get token() {\n return this.getAttribute('token');\n }\n\n async syncDevice(token) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/register-device', token)\n .then(() => {\n return this;\n });\n }\n\n async performAuthorizedRequest(endpoint, params = {}, method = 'GET') {\n try {\n const headers = { 'Customer-Token': this.token };\n const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params);\n return response;\n } catch (error) {\n console.error(`Error in ${method} request to ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getSavedPlaces() {\n try {\n const places = await this.performAuthorizedRequest('customers/places');\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve saved places');\n }\n }\n\n async getOrderHistory(params = {}) {\n try {\n const orders = await this.performAuthorizedRequest('customers/orders', params);\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve order history');\n }\n }\n}\n\nexport { customerActions };\n","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n};\n\nexport default isPhone;\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\n\nconst cartActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n add: function (id, productId, quantity = 1, data = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/${id}/${productId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n update: function (id, cartItemId, quantity, data = {}, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/${cartItemId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n remove: function (id, cartItemId, options = {}) {\n return this.adapter.delete(`${this.namespace}/${id}/${cartItemId}`, {}, options).then(this.afterFetch.bind(this));\n },\n\n empty: function (id, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/empty`, {}, options).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id = '') {\n return this.findRecord(id);\n },\n});\n\nexport default class Cart extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'cart', { actions: cartActions, ...options });\n }\n\n add(productId, quantity = 1, data = {}, options = {}) {\n if (productId instanceof Product) {\n productId = productId.id;\n }\n\n return this.store.add(this.id, productId, quantity, data, options);\n }\n\n update(cartItemId, quantity, data = {}, options = {}) {\n return this.store.update(this.id, cartItemId, quantity, data, options);\n }\n\n remove(cartItemId, options = {}) {\n return this.store.remove(this.id, cartItemId, options);\n }\n\n empty(options = {}) {\n return this.store.empty(this.id, options);\n }\n\n delete() {\n return this.destroy();\n }\n\n refresh() {\n return this.store.retrieve(this.id);\n }\n\n subtotal() {\n let subtotal = 0;\n\n this.contents().forEach((cartItem) => {\n subtotal += cartItem.subtotal;\n });\n\n return subtotal;\n }\n\n contents() {\n return this.getAttribute('items', []);\n }\n\n hasProduct(productId) {\n return this.contents().findIndex((cartItem) => cartItem.product_id === productId) !== -1;\n }\n\n get isEmpty() {\n const contents = this.contents();\n\n if (!isArray(contents)) {\n return true;\n }\n\n return contents.length === 0;\n }\n\n get isNotEmpty() {\n return !this.isEmpty;\n }\n}\n\nexport { cartActions };\n","import Resource from '../resource';\n\nexport default class PaymentGateway extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'payment-gateway', options);\n }\n\n get type() {\n return this.getAttribute('type');\n }\n\n get code() {\n return this.getAttribute('code');\n }\n\n get isCashGateway() {\n return this.type === 'cash';\n }\n\n get isStripeGateway() {\n return this.type === 'stripe';\n }\n\n setCheckoutToken(token) {\n this.token = token;\n }\n\n getCheckoutToken() {\n return this.token;\n }\n\n // remove default resource methods\n findRecord() {\n throw new Error('There is no findRecord() method for payment gateways!');\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method for payment gateways!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method for payment gateways!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method for payment gateways!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method for payment gateways!');\n }\n}\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const utcDate = new Date(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}\n","import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n startOfDayRight.getTime() -\n getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff =\n startOfISOWeek(_date).getTime() - startOfISOWeekYear(_date).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff =\n startOfWeek(_date, options).getTime() -\n startOfWeekYear(_date, options).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.floor(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.floor(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const protectedDayOfYearTokens = [\"D\", \"DD\"];\nconst protectedWeekYearTokens = [\"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\n\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\n\nexport function throwProtectedError(token, format, input) {\n if (token === \"YYYY\") {\n throw new RangeError(\n `Use \\`yyyy\\` instead of \\`YYYY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"YY\") {\n throw new RangeError(\n `Use \\`yy\\` instead of \\`YY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"D\") {\n throw new RangeError(\n `Use \\`d\\` instead of \\`D\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"DD\") {\n throw new RangeError(\n `Use \\`dd\\` instead of \\`DD\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n }\n}\n","import { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate,\n };\n\n const result = formatStr\n .match(longFormattingTokensRegExp)\n .map(function (substring) {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n const formatter = formatters[firstCharacter];\n if (formatter) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n return formatter(\n originalDate,\n substring,\n locale.localize,\n formatterOptions,\n );\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return substring;\n })\n .join(\"\");\n\n return result;\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { transpose } from \"../../transpose.mjs\";\nimport { constructFrom } from \"../../constructFrom.mjs\";\n\nconst TIMEZONE_UNIT_PRIORITY = 10;\n\nexport class Setter {\n subPriority = 0;\n\n validate(_utcDate, _options) {\n return true;\n }\n}\n\nexport class ValueSetter extends Setter {\n constructor(\n value,\n\n validateValue,\n\n setValue,\n\n priority,\n subPriority,\n ) {\n super();\n this.value = value;\n this.validateValue = validateValue;\n this.setValue = setValue;\n this.priority = priority;\n if (subPriority) {\n this.subPriority = subPriority;\n }\n }\n\n validate(date, options) {\n return this.validateValue(date, this.value, options);\n }\n\n set(date, flags, options) {\n return this.setValue(date, flags, this.value, options);\n }\n}\n\nexport class DateToSystemTimezoneSetter extends Setter {\n priority = TIMEZONE_UNIT_PRIORITY;\n subPriority = -1;\n set(date, flags) {\n if (flags.timestampIsSet) return date;\n return constructFrom(date, transpose(date, Date));\n }\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name transpose\n * @category Generic Helpers\n * @summary Transpose the date to the given constructor.\n *\n * @description\n * The function transposes the date to the given constructor. It helps you\n * to transpose the date in the system time zone to say `UTCDate` or any other\n * date extension.\n *\n * @typeParam DateInputType - The input `Date` type derived from the passed argument.\n * @typeParam DateOutputType - The output `Date` type derived from the passed constructor.\n *\n * @param fromDate - The date to use values from\n * @param constructor - The date constructor to use\n *\n * @returns Date transposed to the given constructor\n *\n * @example\n * // Create July 10, 2022 00:00 in locale time zone\n * const date = new Date(2022, 6, 10)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'\n *\n * @example\n * // Transpose the date to July 10, 2022 00:00 in UTC\n * transpose(date, UTCDate)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'\n */\nexport function transpose(fromDate, constructor) {\n const date =\n constructor instanceof Date\n ? constructFrom(constructor, 0)\n : new constructor(0);\n date.setFullYear(\n fromDate.getFullYear(),\n fromDate.getMonth(),\n fromDate.getDate(),\n );\n date.setHours(\n fromDate.getHours(),\n fromDate.getMinutes(),\n fromDate.getSeconds(),\n fromDate.getMilliseconds(),\n );\n return date;\n}\n\n// Fallback for modularized imports:\nexport default transpose;\n","import { ValueSetter } from \"./Setter.mjs\";\n\nexport class Parser {\n run(dateString, token, match, options) {\n const result = this.parse(dateString, token, match, options);\n if (!result) {\n return null;\n }\n\n return {\n setter: new ValueSetter(\n result.value,\n this.validate,\n this.set,\n this.priority,\n this.subPriority,\n ),\n rest: result.rest,\n };\n }\n\n validate(_utcDate, _value, _options) {\n return true;\n }\n}\n","export const numericPatterns = {\n month: /^(1[0-2]|0?\\d)/, // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/, // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/, // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/, // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/, // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/, // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/, // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/, // 0 to 12\n minute: /^[0-5]?\\d/, // 0 to 59\n second: /^[0-5]?\\d/, // 0 to 59\n\n singleDigit: /^\\d/, // 0 to 9\n twoDigits: /^\\d{1,2}/, // 0 to 99\n threeDigits: /^\\d{1,3}/, // 0 to 999\n fourDigits: /^\\d{1,4}/, // 0 to 9999\n\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/, // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/, // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/, // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/, // 0 to 9999, -0 to -9999\n};\n\nexport const timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/,\n};\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n millisecondsInSecond,\n} from \"../../constants.mjs\";\nimport { numericPatterns } from \"./constants.mjs\";\n\nexport function mapValue(parseFnResult, mapFn) {\n if (!parseFnResult) {\n return parseFnResult;\n }\n\n return {\n value: mapFn(parseFnResult.value),\n rest: parseFnResult.rest,\n };\n}\n\nexport function parseNumericPattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n return {\n value: parseInt(matchResult[0], 10),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseTimezonePattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n // Input is 'Z'\n if (matchResult[0] === \"Z\") {\n return {\n value: 0,\n rest: dateString.slice(1),\n };\n }\n\n const sign = matchResult[1] === \"+\" ? 1 : -1;\n const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n\n return {\n value:\n sign *\n (hours * millisecondsInHour +\n minutes * millisecondsInMinute +\n seconds * millisecondsInSecond),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseAnyDigitsSigned(dateString) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);\n}\n\nexport function parseNDigits(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function parseNDigitsSigned(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^-?\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function dayPeriodEnumToHours(dayPeriod) {\n switch (dayPeriod) {\n case \"morning\":\n return 4;\n case \"evening\":\n return 17;\n case \"pm\":\n case \"noon\":\n case \"afternoon\":\n return 12;\n case \"am\":\n case \"midnight\":\n case \"night\":\n default:\n return 0;\n }\n}\n\nexport function normalizeTwoDigitYear(twoDigitYear, currentYear) {\n const isCommonEra = currentYear > 0;\n // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n\n let result;\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n const rangeEnd = absCurrentYear + 50;\n const rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n const isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nexport function isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DAYS_IN_MONTH_LEAP_YEAR = [\n 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n];\n\n// Day of the month\nexport class DateParser extends Parser {\n priority = 90;\n subPriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"d\":\n return parseNumericPattern(numericPatterns.date, dateString);\n case \"do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n const month = date.getMonth();\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n }\n\n set(date, _flags, value) {\n date.setDate(value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { addDays } from \"./addDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link setDay} function options.\n */\n\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the week of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the day of the week set\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setDay(date, day, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const currentDay = _date.getDay();\n\n const remainder = day % 7;\n const dayIndex = (remainder + 7) % 7;\n\n const delta = 7 - weekStartsOn;\n const diff =\n day < 0 || day > 6\n ? day - ((currentDay + delta) % 7)\n : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setDay;\n","import { addDays } from \"./addDays.mjs\";\nimport { getISODay } from \"./getISODay.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the ISO week of the new date\n *\n * @returns The new date with the day of the ISO week set\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * const result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setISODay(date, day) {\n const _date = toDate(date);\n const currentDay = getISODay(_date);\n const diff = day - currentDay;\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setISODay;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * const result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nexport function getISODay(date) {\n const _date = toDate(date);\n let day = _date.getDay();\n\n if (day === 0) {\n day = 7;\n }\n\n return day;\n}\n\n// Fallback for modularized imports:\nexport default getISODay;\n","import { EraParser } from \"./parsers/EraParser.mjs\";\nimport { YearParser } from \"./parsers/YearParser.mjs\";\nimport { LocalWeekYearParser } from \"./parsers/LocalWeekYearParser.mjs\";\nimport { ISOWeekYearParser } from \"./parsers/ISOWeekYearParser.mjs\";\nimport { ExtendedYearParser } from \"./parsers/ExtendedYearParser.mjs\";\nimport { QuarterParser } from \"./parsers/QuarterParser.mjs\";\nimport { StandAloneQuarterParser } from \"./parsers/StandAloneQuarterParser.mjs\";\nimport { MonthParser } from \"./parsers/MonthParser.mjs\";\nimport { StandAloneMonthParser } from \"./parsers/StandAloneMonthParser.mjs\";\nimport { LocalWeekParser } from \"./parsers/LocalWeekParser.mjs\";\nimport { ISOWeekParser } from \"./parsers/ISOWeekParser.mjs\";\nimport { DateParser } from \"./parsers/DateParser.mjs\";\nimport { DayOfYearParser } from \"./parsers/DayOfYearParser.mjs\";\nimport { DayParser } from \"./parsers/DayParser.mjs\";\nimport { LocalDayParser } from \"./parsers/LocalDayParser.mjs\";\nimport { StandAloneLocalDayParser } from \"./parsers/StandAloneLocalDayParser.mjs\";\nimport { ISODayParser } from \"./parsers/ISODayParser.mjs\";\nimport { AMPMParser } from \"./parsers/AMPMParser.mjs\";\nimport { AMPMMidnightParser } from \"./parsers/AMPMMidnightParser.mjs\";\nimport { DayPeriodParser } from \"./parsers/DayPeriodParser.mjs\";\nimport { Hour1to12Parser } from \"./parsers/Hour1to12Parser.mjs\";\nimport { Hour0to23Parser } from \"./parsers/Hour0to23Parser.mjs\";\nimport { Hour0To11Parser } from \"./parsers/Hour0To11Parser.mjs\";\nimport { Hour1To24Parser } from \"./parsers/Hour1To24Parser.mjs\";\nimport { MinuteParser } from \"./parsers/MinuteParser.mjs\";\nimport { SecondParser } from \"./parsers/SecondParser.mjs\";\nimport { FractionOfSecondParser } from \"./parsers/FractionOfSecondParser.mjs\";\nimport { ISOTimezoneWithZParser } from \"./parsers/ISOTimezoneWithZParser.mjs\";\nimport { ISOTimezoneParser } from \"./parsers/ISOTimezoneParser.mjs\";\nimport { TimestampSecondsParser } from \"./parsers/TimestampSecondsParser.mjs\";\nimport { TimestampMillisecondsParser } from \"./parsers/TimestampMillisecondsParser.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- It's ok, we want any here\nexport const parsers = {\n G: new EraParser(),\n y: new YearParser(),\n Y: new LocalWeekYearParser(),\n R: new ISOWeekYearParser(),\n u: new ExtendedYearParser(),\n Q: new QuarterParser(),\n q: new StandAloneQuarterParser(),\n M: new MonthParser(),\n L: new StandAloneMonthParser(),\n w: new LocalWeekParser(),\n I: new ISOWeekParser(),\n d: new DateParser(),\n D: new DayOfYearParser(),\n E: new DayParser(),\n e: new LocalDayParser(),\n c: new StandAloneLocalDayParser(),\n i: new ISODayParser(),\n a: new AMPMParser(),\n b: new AMPMMidnightParser(),\n B: new DayPeriodParser(),\n h: new Hour1to12Parser(),\n H: new Hour0to23Parser(),\n K: new Hour0To11Parser(),\n k: new Hour1To24Parser(),\n m: new MinuteParser(),\n s: new SecondParser(),\n S: new FractionOfSecondParser(),\n X: new ISOTimezoneWithZParser(),\n x: new ISOTimezoneParser(),\n t: new TimestampSecondsParser(),\n T: new TimestampMillisecondsParser(),\n};\n","import { Parser } from \"../Parser.mjs\";\n\nexport class EraParser extends Parser {\n priority = 140;\n\n parse(dateString, token, match) {\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return (\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n\n // A, B\n case \"GGGGG\":\n return match.era(dateString, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return (\n match.era(dateString, { width: \"wide\" }) ||\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n }\n }\n\n set(date, flags, value) {\n flags.era = value;\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"R\", \"u\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n// | Year | y | yy | yyy | yyyy | yyyyy |\n// |----------|-------|----|-------|-------|-------|\n// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\nexport class YearParser extends Parser {\n priority = 130;\n incompatibleTokens = [\"Y\", \"R\", \"u\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"yy\",\n });\n\n switch (token) {\n case \"y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value) {\n const currentYear = date.getFullYear();\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(normalizedTwoDigitYear, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { getWeekYear } from \"../../../getWeekYear.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// Local week-numbering year\nexport class LocalWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"YY\",\n });\n\n switch (token) {\n case \"Y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"Yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value, options) {\n const currentYear = getWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(\n normalizedTwoDigitYear,\n 0,\n options.firstWeekContainsDate,\n );\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\n// ISO week-numbering year\nexport class ISOWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"R\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n const firstWeekOfYear = constructFrom(date, 0);\n firstWeekOfYear.setFullYear(value, 0, 4);\n firstWeekOfYear.setHours(0, 0, 0, 0);\n return startOfISOWeek(firstWeekOfYear);\n }\n\n incompatibleTokens = [\n \"G\",\n \"y\",\n \"Y\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\nexport class ExtendedYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"u\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"G\", \"y\", \"Y\", \"R\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class QuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n case \"QQ\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class StandAloneQuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n case \"qq\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MonthParser extends Parser {\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"L\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"M\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"MM\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // J, F, ..., D\n case \"MMMMM\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class StandAloneMonthParser extends Parser {\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"LL\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // J, F, ..., D\n case \"LLLLL\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setWeek } from \"../../../setWeek.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// Local week of year\nexport class LocalWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"w\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"wo\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value, options) {\n return startOfWeek(setWeek(date, value, options), options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { getWeek } from \"./getWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link setWeek} function options.\n */\n\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the local week set\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * const result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * const result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\nexport function setWeek(date, week, options) {\n const _date = toDate(date);\n const diff = getWeek(_date, options) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setWeek;\n","import { setISOWeek } from \"../../../setISOWeek.mjs\";\nimport { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// ISO week of year\nexport class ISOWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"I\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"Io\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value) {\n return startOfISOWeek(setISOWeek(date, value));\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { getISOWeek } from \"./getISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The ISO week of the new date\n *\n * @returns The new date with the ISO week set\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * const result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nexport function setISOWeek(date, week) {\n const _date = toDate(date);\n const diff = getISOWeek(_date) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setISOWeek;\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nexport class DayOfYearParser extends Parser {\n priority = 90;\n\n subpriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"D\":\n case \"DD\":\n return parseNumericPattern(numericPatterns.dayOfYear, dateString);\n case \"Do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n }\n\n set(date, _flags, value) {\n date.setMonth(0, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"E\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\n\n// Day of week\nexport class DayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"EEEEE\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"EEEE\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"D\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Local day of week\nexport class LocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"e\":\n case \"ee\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"eo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"eee\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"eeeee\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"eeee\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Stand-alone local day of week\nexport class StandAloneLocalDayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"c\":\n case \"cc\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"co\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"ccc\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // T\n case \"ccccc\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return (\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // Tuesday\n case \"cccc\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"e\",\n \"t\",\n \"T\",\n ];\n}\n","import { setISODay } from \"../../../setISODay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// ISO day of week\nexport class ISODayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => {\n if (value === 0) {\n return 7;\n }\n return value;\n };\n\n switch (token) {\n // 2\n case \"i\":\n case \"ii\": // 02\n return parseNDigits(token.length, dateString);\n // 2nd\n case \"io\":\n return match.ordinalNumber(dateString, { unit: \"day\" });\n // Tue\n case \"iii\":\n return mapValue(\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // T\n case \"iiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tu\n case \"iiiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tuesday\n case \"iiii\":\n default:\n return mapValue(\n match.day(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 7;\n }\n\n set(date, _flags, value) {\n date = setISODay(date, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"E\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"a\":\n case \"aa\":\n case \"aaa\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"aaaaa\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"b\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMMidnightParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"b\":\n case \"bb\":\n case \"bbb\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"bbbbb\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\n// in the morning, in the afternoon, in the evening, at night\nexport class DayPeriodParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"BBBBB\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1to12Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"h\":\n return parseNumericPattern(numericPatterns.hour12h, dateString);\n case \"ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 12;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setHours(0, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"H\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0to23Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"H\":\n return parseNumericPattern(numericPatterns.hour23h, dateString);\n case \"Ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 23;\n }\n\n set(date, _flags, value) {\n date.setHours(value, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0To11Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"K\":\n return parseNumericPattern(numericPatterns.hour11h, dateString);\n case \"Ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"h\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1To24Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"k\":\n return parseNumericPattern(numericPatterns.hour24h, dateString);\n case \"ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 24;\n }\n\n set(date, _flags, value) {\n const hours = value <= 24 ? value % 24 : value;\n date.setHours(hours, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"H\", \"K\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MinuteParser extends Parser {\n priority = 60;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"m\":\n return parseNumericPattern(numericPatterns.minute, dateString);\n case \"mo\":\n return match.ordinalNumber(dateString, { unit: \"minute\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setMinutes(value, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class SecondParser extends Parser {\n priority = 50;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"s\":\n return parseNumericPattern(numericPatterns.second, dateString);\n case \"so\":\n return match.ordinalNumber(dateString, { unit: \"second\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setSeconds(value, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\nexport class FractionOfSecondParser extends Parser {\n priority = 30;\n\n parse(dateString, token) {\n const valueCallback = (value) =>\n Math.floor(value * Math.pow(10, -token.length + 3));\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n\n set(date, _flags, value) {\n date.setMilliseconds(value);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601. +00:00 is `'Z'`)\nexport class ISOTimezoneWithZParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"X\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"XX\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"XXXX\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"XXXXX\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"XXX\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"x\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601)\nexport class ISOTimezoneParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"x\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"xx\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"xxxx\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"xxxxx\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"xxx\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"X\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampSecondsParser extends Parser {\n priority = 40;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value * 1000), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampMillisecondsParser extends Parser {\n priority = 20;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getDefaultOptions } from \"./getDefaultOptions.mjs\";\nimport { enUS as defaultLocale } from \"./locale/en-US.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { parsers } from \"./parse/_lib/parsers.mjs\";\nimport { DateToSystemTimezoneSetter } from \"./parse/_lib/Setter.mjs\";\n\n/**\n * The {@link parse} function options.\n */\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\n\nconst notWhitespaceRegExp = /\\S/;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)\n * and [setWeekYear](https://date-fns.org/docs/setWeekYear)).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateStr - The string to parse\n * @param formatStr - The string of tokens\n * @param referenceDate - defines values missing from the parsed dateString\n * @param options - An object with options.\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @returns The parsed date\n *\n * @throws `options.locale` must contain `match` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\nexport function parse(dateStr, formatStr, referenceDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n if (formatStr === \"\") {\n if (dateStr === \"\") {\n return toDate(referenceDate);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n\n const subFnOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n // If timezone isn't specified, it will be set to the system timezone\n const setters = [new DateToSystemTimezoneSetter()];\n\n const tokens = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter in longFormatters) {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp);\n\n const usedTokens = [];\n\n for (let token of tokens) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n\n const firstCharacter = token[0];\n const parser = parsers[firstCharacter];\n if (parser) {\n const { incompatibleTokens } = parser;\n if (Array.isArray(incompatibleTokens)) {\n const incompatibleToken = usedTokens.find(\n (usedToken) =>\n incompatibleTokens.includes(usedToken.token) ||\n usedToken.token === firstCharacter,\n );\n if (incompatibleToken) {\n throw new RangeError(\n `The format string mustn't contain \\`${incompatibleToken.fullToken}\\` and \\`${token}\\` at the same time`,\n );\n }\n } else if (parser.incompatibleTokens === \"*\" && usedTokens.length > 0) {\n throw new RangeError(\n `The format string mustn't contain \\`${token}\\` and any other token at the same time`,\n );\n }\n\n usedTokens.push({ token: firstCharacter, fullToken: token });\n\n const parseResult = parser.run(\n dateStr,\n token,\n locale.match,\n subFnOptions,\n );\n\n if (!parseResult) {\n return constructFrom(referenceDate, NaN);\n }\n\n setters.push(parseResult.setter);\n\n dateStr = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n // Replace two single quote characters with one single quote character\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n }\n\n // Cut token from string, or, if string doesn't match the token, return Invalid Date\n if (dateStr.indexOf(token) === 0) {\n dateStr = dateStr.slice(token.length);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n }\n\n // Check if the remaining input contains something other than whitespace\n if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const uniquePrioritySetters = setters\n .map((setter) => setter.priority)\n .sort((a, b) => b - a)\n .filter((priority, index, array) => array.indexOf(priority) === index)\n .map((priority) =>\n setters\n .filter((setter) => setter.priority === priority)\n .sort((a, b) => b.subPriority - a.subPriority),\n )\n .map((setterArray) => setterArray[0]);\n\n let date = toDate(referenceDate);\n\n if (isNaN(date.getTime())) {\n return constructFrom(referenceDate, NaN);\n }\n\n const flags = {};\n for (const setter of uniquePrioritySetters) {\n if (!setter.validate(date, subFnOptions)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const result = setter.set(date, flags, subFnOptions);\n // Result is tuple (date, flags)\n if (Array.isArray(result)) {\n date = result[0];\n Object.assign(flags, result[1]);\n // Result is date\n } else {\n date = result;\n }\n }\n\n return constructFrom(referenceDate, date);\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default parse;\n","import { getDefaultOptions as getInternalDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * @name getDefaultOptions\n * @category Common Helpers\n * @summary Get default options.\n * @pure false\n *\n * @description\n * Returns an object that contains defaults for\n * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`\n * arguments for all functions.\n *\n * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).\n *\n * @returns The default options\n *\n * @example\n * const result = getDefaultOptions()\n * //=> {}\n *\n * @example\n * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })\n * const result = getDefaultOptions()\n * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }\n */\nexport function getDefaultOptions() {\n return Object.assign({}, getInternalDefaultOptions());\n}\n\n// Fallback for modularized imports:\nexport default getDefaultOptions;\n","import Resource from '../resource';\nimport { format, parse, isValid } from 'date-fns';\n\nexport default class StoreHour extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-hour', options);\n }\n\n get day() {\n return this.getAttribute('day');\n }\n\n get isClosed() {\n return this.getAttribute('start') === null && this.getAttribute('end') === null;\n }\n\n get is24Hours() {\n const start = this.startDateInstance;\n const end = this.endDateInstance;\n const diff = Math.abs(start - end);\n const hours = Math.floor(diff / 1000 / 60) / 60;\n\n return hours > 23;\n }\n\n get startDateInstance() {\n if (!this.hasAttribute('start')) {\n return null;\n }\n\n const start = this.getAttribute('start');\n const includesSeconds = start.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(start, format, new Date());\n }\n\n get endDateInstance() {\n if (!this.hasAttribute('end')) {\n return null;\n }\n\n const end = this.getAttribute('end');\n const includesSeconds = end.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(end, format, new Date());\n }\n\n get humanReadableHoursRange() {\n if (!isValid(this.startDateInstance) || !isValid(this.endDateInstance)) {\n return `${this.start} - ${this.end}`;\n }\n\n return `${format(this.startDateInstance, 'p')} - ${format(this.endDateInstance, 'p')}`;\n }\n\n get humanReadableHours() {\n if (this.isClosed) {\n return 'Closed';\n }\n\n if (this.is24Hours) {\n return '24 Hours';\n }\n\n return this.humanReadableHoursRange;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreHour from './store-hour';\nimport { Collection } from '@fleetbase/sdk';\nimport { format } from 'date-fns';\n\nexport default class StoreLocation extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-location', options);\n }\n\n get latitude() {\n return this.getAttribute('place.location.coordinates.1');\n }\n\n get longitude() {\n return this.getAttribute('place.location.coordinates.0');\n }\n\n get hours() {\n return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes)));\n }\n\n get isAlwaysOpen() {\n return this.hours.every((hour) => hour?.is24Hours);\n }\n\n get today() {\n const today = format(new Date(), 'EEEE');\n\n return this.schedule[today];\n }\n\n get schedule() {\n const schedule = {};\n const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\n for (let i = 0; i < week.length; i++) {\n const day = week[i];\n\n schedule[day] = new Collection();\n }\n\n for (let i = 0; i < this.hours.length; i++) {\n const hour = this.hours.objectAt(i);\n\n schedule[hour.day].pushObject(hour);\n }\n\n return schedule;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Review from './review';\nimport { Collection, Place } from '@fleetbase/sdk';\n\nexport default class Store extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store', options);\n }\n\n getReviews(params = {}) {\n return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n\n getLocations(params = {}) {\n return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {\n return new Collection(\n storeLocations.map((attributes) => {\n if (attributes.place) {\n attributes.place = new Place(attributes.place);\n }\n\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getLocation(id) {\n return this.adapter.get(`locations/${id}`, { store: this.id }).then((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n });\n }\n\n getPaymentGateways(params = {}) {\n return this.adapter.get('gateways', params).then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateway(id) {\n return this.adapter.get(`gateways/${id}`).then((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n });\n }\n}\n","import { Collection } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport PaymentGateway from './payment-gateway';\nimport Store from './store';\nimport StoreLocation from './store-location';\n\nexport default class Network extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'network', options);\n }\n\n getTags(params = {}) {\n return this.adapter.get('tags', params);\n }\n\n async getResourceCollection(endpoint, ResourceClass, params = {}) {\n try {\n const resources = await this.adapter.get(endpoint, params);\n return new Collection(resources.map((attributes) => new ResourceClass(attributes, this.adapter)));\n } catch (error) {\n console.error(`Error fetching ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getStores(params = {}) {\n return this.getResourceCollection('stores', Store, params);\n }\n\n async getStoreLocations(params = {}) {\n return this.getResourceCollection('store-locations', StoreLocation, params);\n }\n\n async getPaymentGateways() {\n return this.getResourceCollection('gateways', PaymentGateway);\n }\n}\n","import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk';\nimport StorefrontStore from '../store';\nimport { formatCurrency, isEmpty } from '../utils';\n\nconst { isArray } = Array;\n\nexport default class DeliveryServiceQuote extends ServiceQuote {\n constructor(attributes = {}, adapter, options = {}) {\n if (attributes instanceof Adapter) {\n return super({}, attributes, 'service-quote', options);\n }\n\n super(attributes, adapter, 'service-quote', options);\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get formattedAmount() {\n const { amount, currency } = this.getAttributes(['amount', 'currency']);\n\n if (isEmpty(amount) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(amount / 100, currency);\n }\n\n async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n if (destination?.id) {\n destination = destination.id;\n }\n if (cart?.id) {\n cart = cart.id;\n }\n\n try {\n const serviceQuotes = await this.adapter.get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n });\n\n if (isArray(serviceQuotes)) {\n return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter)));\n }\n\n return new DeliveryServiceQuote(serviceQuotes, this.adapter);\n } catch (error) {\n console.error('Error fetching service quotes:', error);\n throw error;\n }\n }\n\n static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) {\n const quote = new DeliveryServiceQuote(adapter);\n return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all);\n }\n}\n","import { Order, StoreActions, isResource } from '@fleetbase/sdk';\nimport Resource from '../resource';\n\nconst checkoutActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n initialize: function (customer, cart, serviceQuote, gateway, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n if (isResource(gateway)) {\n gateway = gateway.getAttribute('code');\n }\n\n return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options);\n },\n\n captureOrder: function (token, transactionDetails = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson));\n },\n});\n\nexport default class Checkout extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'checkout', options);\n }\n\n initialize() {\n return this.store.initialize(...arguments);\n }\n\n captureOrder() {\n return this.store.captureOrder(...arguments);\n }\n}\n\nexport { checkoutActions };\n","import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources';\nimport { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk';\n\nconst resources = {\n Product,\n Category,\n Customer,\n Cart,\n DeliveryServiceQuote,\n Store,\n StoreLocation,\n StoreHour,\n Checkout,\n Review,\n};\n\nconst adapters = {\n BrowserAdapter,\n NodeAdapter,\n};\n\nclass Resolver {\n constructor() {\n this.resources = resources;\n this.adapters = adapters;\n\n return this.lookup(...arguments);\n }\n\n lookup(type, className) {\n const key = pluralize(type);\n const params = [...arguments].slice(2);\n\n if (!this[key]) {\n throw new Error('Attempted to resolve invalid type');\n }\n\n if (!this[key][className]) {\n throw new Error(`No ${singularize(type)} named ${className} to resolve`);\n }\n\n return new this[key][className](...params);\n }\n}\n\nconst lookup = function () {\n return new Resolver(...arguments);\n};\n\nexport { Resolver, lookup };\n","import { Store, classify, extendStoreActions } from '@fleetbase/sdk';\nimport { lookup } from './resolver';\n\nexport default class StorefrontStore extends Store {\n constructor() {\n super(...arguments);\n }\n\n extendActions(actions = []) {\n return extendStoreActions(this, actions);\n }\n\n serialize(json) {\n return lookup('resource', classify(this.resource), json, this.adapter);\n }\n}\n","import StorefrontStore from './store';\nimport { detectAdapter, isKeyValid } from './utils';\nimport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network } from './resources';\nimport { cartActions } from './resources/cart';\nimport { customerActions } from './resources/customer';\nimport { checkoutActions } from './resources/checkout';\nimport { reviewActions } from './resources/review';\nimport { Collection } from '@fleetbase/sdk';\n\n/**\n * // instance\n * const storefront = new Storefront();\n *\n */\n\nexport default class Storefront {\n /**\n * Builds an instance of the Fleetbase Storefront SDK\n *\n * @param {String} storeKey The access key for the storefront store\n * @param {Object} config The config object\n * @param {Boolean} debug Enable debug mode\n * @return {Storefront} Instance\n */\n constructor(storeKey, config = {}, debug = false) {\n this.version = config.version || 'v1';\n this.options = {\n version: this.version,\n host: config.host || 'https://api.fleetbase.io',\n namespace: `storefront/${this.version}` || config.namespace,\n publicKey: storeKey,\n debug,\n };\n\n if (!isKeyValid(storeKey)) {\n throw new Error('⚠️ Invalid Storefront key given to Storefront SDK');\n }\n\n this.adapter = config.adapter || detectAdapter(this.options);\n\n this.products = new StorefrontStore('product', this.adapter);\n this.categories = new StorefrontStore('category', this.adapter);\n this.reviews = new StorefrontStore('review', this.adapter).extendActions(reviewActions);\n this.customers = new StorefrontStore('customer', this.adapter).extendActions(customerActions);\n this.cart = new StorefrontStore('cart', this.adapter).extendActions(cartActions);\n this.checkout = new StorefrontStore('checkout', this.adapter).extendActions(checkoutActions);\n }\n\n /** loads information about this storefront */\n about() {\n return this.adapter.get('about');\n }\n\n /** search products in store or network */\n search(query, options = {}) {\n return this.adapter.get('search', { query, ...options }).then((products) => {\n return new Collection(products.map((product) => new Product(product)));\n });\n }\n\n static newInstance() {\n return new Storefront(...arguments);\n }\n\n setAdapter(adapter) {\n this.adapter = adapter;\n }\n\n getAdapter() {\n return this.adapter;\n }\n}\n\nexport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network };\n","import { lookup } from '../resolver';\nimport { isNodeEnvironment } from '@fleetbase/sdk';\n\nconst detectAdapter = (options = {}) => {\n if (isNodeEnvironment()) {\n return lookup('adapter', 'NodeAdapter', options);\n }\n\n return lookup('adapter', 'BrowserAdapter', options);\n};\n\nexport default detectAdapter;\n"],"names":["StorefrontResource","_Resource","_inherits","_super","_createSuper","_classCallCheck","apply","this","arguments","_createClass","key","value","adapter","_this$options","store","StorefrontStore","resource","onAfterFetch","syncAttributes","bind","actions","options","Resource","reviewActions","StoreActions","count","storeId","length","undefined","params","get","concat","namespace","Review","attributes","call","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isEmpty","obj","none","size","objectType","_typeof","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","_this","id","then","reviews","Collection","map","Category","category","products","customerActions","login","identity","password","test","isPhone","post","phone","Error","_objectSpread","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","_getOrderHistory","_getSavedPlaces","_performAuthorizedRequest","_syncDevice","_asyncToGenerator","_regeneratorRuntime","mark","_callee","token","wrap","_context","prev","next","abrupt","setHeaders","stop","_x","_callee2","endpoint","method","headers","response","_args2","_context2","toLowerCase","sent","t0","console","error","_x2","_callee3","places","_this2","_context3","performAuthorizedRequest","Place","_callee4","orders","_this3","_args4","_context4","Order","isArray","Array","cartActions","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","PaymentGateway","type","toDate","argument","argStr","Object","prototype","toString","Date","constructor","NaN","constructFrom","date","addDays","_date","isNaN","setDate","getDate","millisecondsInWeek","millisecondsInDay","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","locale","day","getDay","diff","setHours","startOfISOWeek","getISOWeekYear","year","getFullYear","fourthOfJanuaryOfNextYear","setFullYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTime","startOfDay","getTimezoneOffsetInMilliseconds","utcDate","UTC","getMonth","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isValid","Number","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","buildFormatLongFn","args","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","valuesArray","context","formattingValues","defaultFormattingWidth","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","array","predicate","pattern","object","hasOwnProperty","findKey","valueCallback","rest","slice","enUS","formatDistance","result","tokenValue","replace","addSuffix","comparison","formatRelative","_baseDate","_options","localize","ordinalNumber","dirtyNumber","number","rem100","era","narrow","abbreviated","wide","quarter","month","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","firstWeekContainsDate","getDayOfYear","dateLeft","dateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","Math","round","differenceInCalendarDays","cleanDate","startOfYear","getISOWeek","fourthOfJanuary","startOfISOWeekYear","getWeekYear","firstWeekOfNextYear","firstWeekOfThisYear","getWeek","firstWeek","startOfWeekYear","addLeadingZeros","targetLength","abs","padStart","lightFormatters","y","signedYear","M","d","a","dayPeriodEnumValue","toUpperCase","h","H","m","s","S","numberOfDigits","milliseconds","floor","pow","dayPeriodEnum","formatters","G","unit","Y","signedWeekYear","weekYear","R","u","Q","ceil","q","L","w","week","I","isoWeek","D","dayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","b","hours","B","K","k","X","_localize","timezoneOffset","_originalDate","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","originalDate","T","offset","delimiter","sign","absOffset","minutes","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeLongFormatter","datePattern","timePattern","dateTimeFormat","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","indexOf","isProtectedWeekYearToken","throwProtectedError","input","RangeError","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","defaultLocale","formatterOptions","substring","firstCharacter","longFormatter","join","matched","cleanEscapedString","formatter","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","Setter","subPriority","validate","_utcDate","ValueSetter","validateValue","setValue","priority","super","set","flags","DateToSystemTimezoneSetter","timestampIsSet","fromDate","transpose","Parser","run","dateString","parse","setter","_value","numericPatterns","timezonePatterns","mapValue","parseFnResult","mapFn","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","isLeapYearIndex","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","setDay","currentDay","delta","setISODay","getISODay","parsers","incompatibleTokens","isTwoDigitYear","normalizedTwoDigitYear","_flags","firstWeekOfYear","setMonth","setWeek","setISOWeek","isLeapYear","subpriority","wholeWeekDays","isPM","setMinutes","setSeconds","setMilliseconds","notWhitespaceRegExp","dateStr","referenceDate","assign","getInternalDefaultOptions","subFnOptions","setters","tokens","usedTokens","parser","incompatibleToken","find","usedToken","includes","fullToken","push","uniquePrioritySetters","sort","filter","setterArray","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","Store","storeLocations","place","_this4","gateways","_this5","Network","_getPaymentGateways","_getStoreLocations","_getStores","_getResourceCollection","ResourceClass","resources","_args","getResourceCollection","_args3","DeliveryServiceQuote","_ServiceQuote","_getFromCart","_fetchServiceQuotesFromCart","Adapter","_possibleConstructorReturn","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","_x3","quote","fetchServiceQuotesFromCart","_x4","_x5","_x6","_x7","ServiceQuote","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","_this$store","_this$store2","adapters","BrowserAdapter","NodeAdapter","Resolver","lookup","className","pluralize","singularize","_construct","_toConsumableArray","_Store","extendStoreActions","json","classify","Storefront","storeKey","debug","version","host","publicKey","startsWith","isNodeEnvironment","detectAdapter","categories","extendActions","customers","checkout","product"],"mappings":"2uVACsC,IAEjBA,WAAkBC,GAAAC,EAAAF,EAAAC,GAAA,IAAAE,EAAAC,EAAAJ,GAAA,SAAAA,IAAA,OAAAK,OAAAL,GAAAG,EAAAG,MAAAC,KAAAC,UAAA,CAelC,OAfkCC,EAAAT,EAAA,CAAA,CAAAU,IAAA,aAAAC,MAOnC,SAAWC,GAAS,IAAAC,EAOhB,OANAN,KAAKK,QAAUA,EACfL,KAAKO,MAAQ,IAAIC,GAAgBR,KAAKS,SAAUJ,EAAS,CACrDK,aAAcV,KAAKW,eAAeC,KAAKZ,MACvCa,QAAqBP,QAAdA,EAAEN,KAAKc,eAALR,IAAYA,OAAZA,EAAAA,EAAcO,UAGpBb,IACX,KAACP,CAAA,EAf2CsB,YCA1CC,EAAgB,IAAIC,EAAAA,aAAa,CACnCC,MAAO,SAAUC,GAAuB,IAAdL,EAAOb,UAAAmB,OAAA,QAAAC,IAAApB,UAAA,GAAAA,UAAA,GAAG,CAAA,EAC1BqB,EAAS,CAAA,EAMf,OAJ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,EAAA,CAAA,CAAAxkB,IAAA,QAAAC,MACA,WACI,OAAOJ,KAAKK,QAAQkB,IAAI,QAC5B,GAEA,CAAApB,IAAA,SAAAC,MACA,SAAOwH,GAAqB,IAAd9G,EAAOb,UAAAmB,OAAA,QAAAC,IAAApB,UAAA,GAAAA,UAAA,GAAG,CAAA,EACpB,OAAOD,KAAKK,QAAQkB,IAAI,SAAQ6C,EAAA,CAAIwD,MAAAA,GAAU9G,IAAWsC,MAAK,SAACM,GAC3D,OAAO,IAAIJ,EAAAA,WAAWI,EAASH,KAAI,SAACiiB,GAAO,OAAK,IAAI7iB,EAAQ6iB,EAAQ,IACxE,GACJ,GAAC,CAAArlB,IAAA,aAAAC,MAMD,SAAWC,GACPL,KAAKK,QAAUA,CACnB,GAAC,CAAAF,IAAA,aAAAC,MAED,WACI,OAAOJ,KAAKK,OAChB,IAAC,CAAA,CAAAF,IAAA,cAAAC,MAVD,WACI,OAAAikB,EAAWM,EAAUld,MAAA4B,UAAA4G,MAAArO,KAAI3B,WAC7B,KAAC0kB,CAAA,CA/C0B","x_google_ignoreList":[11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90]} \ No newline at end of file diff --git a/dist/cjs/storefront.js b/dist/cjs/storefront.js index f4025e7..40f08d6 100644 --- a/dist/cjs/storefront.js +++ b/dist/cjs/storefront.js @@ -1,2 +1,2 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@fleetbase/sdk");function e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function r(t){for(var r=1;r=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),w}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:H(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),w}},e}function o(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function i(t,e,r,n,o,a,i){try{var s=t[a](i),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function s(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function s(t){i(a,n,o,s,u,"next",t)}function u(t){i(a,n,o,s,u,"throw",t)}s(void 0)}))}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{},r={};return t&&(r.store=t),this.adapter.get("".concat(this.namespace,"/count"),r,e)}}),T=function(t){h(r,k);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,r),e.call(this,t,n,"review",o)}return d(r,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),r}();function M(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:r}).format(t)}var D=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var r=a(t);if("object"===r){var n=t.size;if("number"==typeof n)return!n}if("number"==typeof t.length&&"function"!==r)return!t.length;if("object"===r){var o=t.length;if("number"==typeof o)return!o}return!1},S=function(e){h(n,k);var r=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),r.call(this,t,e,"product",o)}return d(n,[{key:"variants",value:function(){return this.getAttribute("variants")}},{key:"addons",value:function(){return this.getAttribute("addon_categories")}},{key:"isOnSale",get:function(){return this.getAttribute("is_on_sale")}},{key:"isNotOnSale",get:function(){return!this.getAttribute("is_on_sale")}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["price","sale_price","currency"]),e=t.price,r=t.sale_price,n=t.currency;return this.isOnSale?D(r)||D(n)?null:M(r/100,n):D(e)||D(n)?null:M(e/100,n)}},{key:"getReviews",value:function(){var e=this;return this.adapter.get("reviews",{store:this.id}).then((function(r){return new t.Collection(r.map((function(t){return new T(t,e.adapter)})))}))}}]),n}(),P=function(e){h(n,k);var r=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),r.call(this,t,e,"category",o)}return d(n,[{key:"getProducts",value:function(){var e=this;return this.adapter.get("products",{category:this.id}).then((function(r){return new t.Collection(r.map((function(t){return new S(t,e.adapter)})))}))}}]),n}(),E=new t.StoreActions({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("customers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("customers/login",r({identity:t,password:e},n)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers/verify-code",r({identity:t,code:e},n)).then(this.afterFetch.bind(this))},requestCreationCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"email";return this.adapter.post("customers/request-creation-code",{identity:t,mode:e})},create:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers",r({identity:t,code:e},n)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),O=function(e){h(f,k);var o,a,i,c,l=y(f);function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,f),l.call(this,t,e,"customer",r({actions:E},n))}return d(f,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Fe(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"token",get:function(){return this.getAttribute("token")}},{key:"syncDevice",value:(c=s(n().mark((function t(e){var r=this;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",e).then((function(){return r})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return c.apply(this,arguments)})},{key:"performAuthorizedRequest",value:(i=s(n().mark((function t(e){var r,o,a,i,s=arguments;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},o=s.length>2&&void 0!==s[2]?s[2]:"GET",t.prev=2,a={"Customer-Token":this.token},t.next=6,this.adapter.setHeaders(a)[o.toLowerCase()](e,r);case 6:return i=t.sent,t.abrupt("return",i);case 10:throw t.prev=10,t.t0=t.catch(2),console.error("Error in ".concat(o," request to ").concat(e,":"),t.t0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[2,10]])}))),function(t){return i.apply(this,arguments)})},{key:"getSavedPlaces",value:(a=s(n().mark((function e(){var r,o=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.performAuthorizedRequest("customers/places");case 3:return r=e.sent,e.abrupt("return",new t.Collection(r.map((function(e){return new t.Place(e,o.adapter)}))));case 7:throw e.prev=7,e.t0=e.catch(0),new Error("Failed to retrieve saved places");case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return a.apply(this,arguments)})},{key:"getOrderHistory",value:(o=s(n().mark((function e(){var r,o,a=this,i=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},e.prev=1,e.next=4,this.performAuthorizedRequest("customers/orders",r);case 4:return o=e.sent,e.abrupt("return",new t.Collection(o.map((function(e){return new t.Order(e,a.adapter)}))));case 8:throw e.prev=8,e.t0=e.catch(1),new Error("Failed to retrieve order history");case 11:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(){return o.apply(this,arguments)})}]),f}(),A=Array.isArray,q=new t.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,add:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),r(r({},o),{},{quantity:n}),a).then(this.afterFetch.bind(this))},update:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),r(r({},o),{},{quantity:n}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},r).then(this.afterFetch.bind(this))},empty:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/empty"),{},e).then(this.afterFetch.bind(this))},retrieve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.findRecord(t)}}),H=function(t){h(n,k);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,o,"cart",r({actions:q},a))}return d(n,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof S&&(t=t.id),this.store.add(this.id,t,e,r,n)}},{key:"update",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,r,n)}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.remove(this.id,t,e)}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.empty(this.id,t)}},{key:"delete",value:function(){return this.destroy()}},{key:"refresh",value:function(){return this.store.retrieve(this.id)}},{key:"subtotal",value:function(){var t=0;return this.contents().forEach((function(e){t+=e.subtotal})),t}},{key:"contents",value:function(){return this.getAttribute("items",[])}},{key:"hasProduct",value:function(t){return-1!==this.contents().findIndex((function(e){return e.product_id===t}))}},{key:"isEmpty",get:function(){var t=this.contents();return!A(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),n}(),N=function(t){h(r,k);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,r),e.call(this,t,n,"payment-gateway",o)}return d(r,[{key:"type",get:function(){return this.getAttribute("type")}},{key:"code",get:function(){return this.getAttribute("code")}},{key:"isCashGateway",get:function(){return"cash"===this.type}},{key:"isStripeGateway",get:function(){return"stripe"===this.type}},{key:"setCheckoutToken",value:function(t){this.token=t}},{key:"getCheckoutToken",value:function(){return this.token}},{key:"findRecord",value:function(){throw new Error("There is no findRecord() method for payment gateways!")}},{key:"create",value:function(){throw new Error("There is no create() method for payment gateways!")}},{key:"update",value:function(){throw new Error("There is no update() method for payment gateways!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method for payment gateways!")}},{key:"reload",value:function(){throw new Error("There is no reload() method for payment gateways!")}}]),r}();function Y(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function C(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function L(t,e){const r=Y(t);return isNaN(e)?C(t,NaN):e?(r.setDate(r.getDate()+e),r):r}const j=6048e5,F=864e5;let R={};function W(){return R}function Q(t,e){const r=W(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=Y(t),a=o.getDay(),i=(a=o.getTime()?r+1:e.getTime()>=i.getTime()?r:r-1}function _(t){const e=Y(t);return e.setHours(0,0,0,0),e}function B(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function z(t){if(!(e=t,e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)||"number"==typeof t))return!1;var e;const r=Y(t);return!isNaN(Number(r))}const X={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function $(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const K={date:$({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:$({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:$({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function J(t){return(e,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,o=r?.width?String(r.width):e;n=t.formattingValues[o]||t.formattingValues[e]}else{const e=t.defaultWidth,o=r?.width?String(r.width):t.defaultWidth;n=t.values[o]||t.values[e]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function V(t){return(e,r={})=>{const n=r.width,o=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],a=e.match(o);if(!a)return null;const i=a[0],s=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let r=0;rt.test(i))):function(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=r.valueCallback?r.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var Z;const tt={code:"en-US",formatDistance:(t,e,r)=>{let n;const o=X[t];return n="string"==typeof o?o:1===e?o.one:o.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:K,formatRelative:(t,e,r,n)=>U[t],localize:{ordinalNumber:(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:J({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:J({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:J({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:J({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:J({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Z={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const r=t.match(Z.matchPattern);if(!r)return null;const n=r[0],o=t.match(Z.parsePattern);if(!o)return null;let a=Z.valueCallback?Z.valueCallback(o[0]):o[0];return a=e.valueCallback?e.valueCallback(a):a,{value:a,rest:t.slice(n.length)}}),era:V({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:V({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:V({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:V({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:V({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function et(t){const e=Y(t),r=function(t,e){const r=_(t),n=_(e),o=r.getTime()-B(r),a=n.getTime()-B(n);return Math.round((o-a)/F)}(e,function(t){const e=Y(t),r=C(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}(e));return r+1}function rt(t){const e=Y(t),r=I(e).getTime()-function(t){const e=G(t),r=C(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),I(r)}(e).getTime();return Math.round(r/j)+1}function nt(t,e){const r=Y(t),n=r.getFullYear(),o=W(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=C(t,0);i.setFullYear(n+1,0,a),i.setHours(0,0,0,0);const s=Q(i,e),u=C(t,0);u.setFullYear(n,0,a),u.setHours(0,0,0,0);const c=Q(u,e);return r.getTime()>=s.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function ot(t,e){const r=Y(t),n=Q(r,e).getTime()-function(t,e){const r=W(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=nt(t,e),a=C(t,0);return a.setFullYear(o,0,n),a.setHours(0,0,0,0),Q(a,e)}(r,e).getTime();return Math.round(n/j)+1}function at(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const it={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return at("yy"===e?n%100:n,e.length)},M(t,e){const r=t.getMonth();return"M"===e?String(r+1):at(r+1,2)},d:(t,e)=>at(t.getDate(),e.length),a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(t,e)=>at(t.getHours()%12||12,e.length),H:(t,e)=>at(t.getHours(),e.length),m:(t,e)=>at(t.getMinutes(),e.length),s:(t,e)=>at(t.getSeconds(),e.length),S(t,e){const r=e.length,n=t.getMilliseconds();return at(Math.floor(n*Math.pow(10,r-3)),e.length)}},st="midnight",ut="noon",ct="morning",dt="afternoon",lt="evening",ht="night",ft={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if("yo"===e){const e=t.getFullYear(),n=e>0?e:1-e;return r.ordinalNumber(n,{unit:"year"})}return it.y(t,e)},Y:function(t,e,r,n){const o=nt(t,n),a=o>0?o:1-o;if("YY"===e){return at(a%100,2)}return"Yo"===e?r.ordinalNumber(a,{unit:"year"}):at(a,e.length)},R:function(t,e){return at(G(t),e.length)},u:function(t,e){return at(t.getFullYear(),e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return at(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return at(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return it.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return at(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const o=ot(t,n);return"wo"===e?r.ordinalNumber(o,{unit:"week"}):at(o,e.length)},I:function(t,e,r){const n=rt(t);return"Io"===e?r.ordinalNumber(n,{unit:"week"}):at(n,e.length)},d:function(t,e,r){return"do"===e?r.ordinalNumber(t.getDate(),{unit:"date"}):it.d(t,e)},D:function(t,e,r){const n=et(t);return"Do"===e?r.ordinalNumber(n,{unit:"dayOfYear"}):at(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return at(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return at(a,e.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),o=0===n?7:n;switch(e){case"i":return String(o);case"ii":return at(o,e.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let o;switch(o=12===n?ut:0===n?st:n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let o;switch(o=n>=17?lt:n>=12?dt:n>=4?ct:ht,e){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,e,r){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),r.ordinalNumber(e,{unit:"hour"})}return it.h(t,e)},H:function(t,e,r){return"Ho"===e?r.ordinalNumber(t.getHours(),{unit:"hour"}):it.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return"Ko"===e?r.ordinalNumber(n,{unit:"hour"}):at(n,e.length)},k:function(t,e,r){let n=t.getHours();return 0===n&&(n=24),"ko"===e?r.ordinalNumber(n,{unit:"hour"}):at(n,e.length)},m:function(t,e,r){return"mo"===e?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):it.m(t,e)},s:function(t,e,r){return"so"===e?r.ordinalNumber(t.getSeconds(),{unit:"second"}):it.s(t,e)},S:function(t,e){return it.S(t,e)},X:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();if(0===o)return"Z";switch(e){case"X":return gt(o);case"XXXX":case"XX":return mt(o);default:return mt(o,":")}},x:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return gt(o);case"xxxx":case"xx":return mt(o);default:return mt(o,":")}},O:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+pt(o,":");default:return"GMT"+mt(o,":")}},z:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+pt(o,":");default:return"GMT"+mt(o,":")}},t:function(t,e,r,n){const o=n._originalDate||t;return at(Math.floor(o.getTime()/1e3),e.length)},T:function(t,e,r,n){return at((n._originalDate||t).getTime(),e.length)}};function pt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),o=Math.floor(n/60),a=n%60;return 0===a?r+String(o):r+String(o)+e+at(a,2)}function gt(t,e){if(t%60==0){return(t>0?"-":"+")+at(Math.abs(t)/60,2)}return mt(t,e)}function mt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t);return r+at(Math.floor(n/60),2)+e+at(n%60,2)}const wt=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},yt=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},vt={p:yt,P:(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return wt(t,e);let a;switch(n){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"})}return a.replace("{{date}}",wt(n,e)).replace("{{time}}",yt(o,e))}},bt=["D","DD"],kt=["YY","YYYY"];function xt(t){return-1!==bt.indexOf(t)}function Tt(t){return-1!==kt.indexOf(t)}function Mt(t,e,r){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("YY"===t)throw new RangeError(`Use \`yy\` instead of \`YY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("D"===t)throw new RangeError(`Use \`d\` instead of \`D\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("DD"===t)throw new RangeError(`Use \`dd\` instead of \`DD\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const Dt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,St=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Pt=/^'([^]*?)'?$/,Et=/''/g,Ot=/[a-zA-Z]/;function At(t,e,r){const n=W(),o=r?.locale??n.locale??tt,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Y(t);if(!z(s))throw new RangeError("Invalid time value");const u={firstWeekContainsDate:a,weekStartsOn:i,locale:o,_originalDate:s};return e.match(St).map((function(t){const e=t[0];if("p"===e||"P"===e){return(0,vt[e])(t,o.formatLong)}return t})).join("").match(Dt).map((function(n){if("''"===n)return"'";const a=n[0];if("'"===a)return function(t){const e=t.match(Pt);if(!e)return t;return e[1].replace(Et,"'")}(n);const i=ft[a];if(i)return!r?.useAdditionalWeekYearTokens&&Tt(n)&&Mt(n,e,String(t)),!r?.useAdditionalDayOfYearTokens&&xt(n)&&Mt(n,e,String(t)),i(s,n,o.localize,u);if(a.match(Ot))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return n})).join("")}class qt{subPriority=0;validate(t,e){return!0}}class Ht extends qt{constructor(t,e,r,n,o){super(),this.value=t,this.validateValue=e,this.setValue=r,this.priority=n,o&&(this.subPriority=o)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,r){return this.setValue(t,e,this.value,r)}}class Nt extends qt{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:C(t,function(t,e){const r=e instanceof Date?C(e,0):new e(0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}(t,Date))}}class Yt{run(t,e,r,n){const o=this.parse(t,e,r,n);return o?{setter:new Ht(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,e,r){return!0}}const Ct=/^(1[0-2]|0?\d)/,Lt=/^(3[0-1]|[0-2]?\d)/,jt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Ft=/^(5[0-3]|[0-4]?\d)/,Rt=/^(2[0-3]|[0-1]?\d)/,Wt=/^(2[0-4]|[0-1]?\d)/,Qt=/^(1[0-1]|0?\d)/,It=/^(1[0-2]|0?\d)/,Gt=/^[0-5]?\d/,_t=/^[0-5]?\d/,Bt=/^\d/,zt=/^\d{1,2}/,Xt=/^\d{1,3}/,$t=/^\d{1,4}/,Kt=/^-?\d+/,Ut=/^-?\d/,Jt=/^-?\d{1,2}/,Vt=/^-?\d{1,3}/,Zt=/^-?\d{1,4}/,te=/^([+-])(\d{2})(\d{2})?|Z/,ee=/^([+-])(\d{2})(\d{2})|Z/,re=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ne=/^([+-])(\d{2}):(\d{2})|Z/,oe=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function ae(t,e){return t?{value:e(t.value),rest:t.rest}:t}function ie(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function se(t,e){const r=e.match(t);if(!r)return null;if("Z"===r[0])return{value:0,rest:e.slice(1)};return{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:e.slice(r[0].length)}}function ue(t){return ie(Kt,t)}function ce(t,e){switch(t){case 1:return ie(Bt,e);case 2:return ie(zt,e);case 3:return ie(Xt,e);case 4:return ie($t,e);default:return ie(new RegExp("^\\d{1,"+t+"}"),e)}}function de(t,e){switch(t){case 1:return ie(Ut,e);case 2:return ie(Jt,e);case 3:return ie(Vt,e);case 4:return ie(Zt,e);default:return ie(new RegExp("^-?\\d{1,"+t+"}"),e)}}function le(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function he(t,e){const r=e>0,n=r?e:1-e;let o;if(n<=50)o=t||100;else{const e=n+50;o=t+100*Math.floor(e/100)-(t>=e%100?100:0)}return r?o:1-o}function fe(t){return t%400==0||t%4==0&&t%100!=0}const pe=[31,28,31,30,31,30,31,31,30,31,30,31],ge=[31,29,31,30,31,30,31,31,30,31,30,31];function me(t,e,r){const n=W(),o=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Y(t),i=a.getDay(),s=7-o;return L(a,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function we(t,e){const r=Y(t),n=function(t){let e=Y(t).getDay();return 0===e&&(e=7),e}(r);return L(r,e-n)}const ye={G:new class extends Yt{priority=140;parse(t,e,r){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,e,r){return e.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Yt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return ae(ce(4,t),n);case"yo":return ae(r.ordinalNumber(t,{unit:"year"}),n);default:return ae(ce(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r){const n=t.getFullYear();if(r.isTwoDigitYear){const e=he(r.year,n);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const o="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Yt{priority=130;parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return ae(ce(4,t),n);case"Yo":return ae(r.ordinalNumber(t,{unit:"year"}),n);default:return ae(ce(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r,n){const o=nt(t,n);if(r.isTwoDigitYear){const e=he(r.year,o);return t.setFullYear(e,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),Q(t,n)}const a="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(a,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),Q(t,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Yt{priority=130;parse(t,e){return de("R"===e?4:e.length,t)}set(t,e,r){const n=C(t,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),I(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Yt{priority=130;parse(t,e){return de("u"===e?4:e.length,t)}set(t,e,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends Yt{priority=120;parse(t,e,r){switch(e){case"Q":case"QQ":return ce(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends Yt{priority=120;parse(t,e,r){switch(e){case"q":case"qq":return ce(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends Yt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"M":return ae(ie(Ct,t),n);case"MM":return ae(ce(2,t),n);case"Mo":return ae(r.ordinalNumber(t,{unit:"month"}),n);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}},L:new class extends Yt{priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"L":return ae(ie(Ct,t),n);case"LL":return ae(ce(2,t),n);case"Lo":return ae(r.ordinalNumber(t,{unit:"month"}),n);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends Yt{priority=100;parse(t,e,r){switch(e){case"w":return ie(Ft,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return ce(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r,n){return Q(function(t,e,r){const n=Y(t),o=ot(n,r)-e;return n.setDate(n.getDate()-7*o),n}(t,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Yt{priority=100;parse(t,e,r){switch(e){case"I":return ie(Ft,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return ce(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r){return I(function(t,e){const r=Y(t),n=rt(r)-e;return r.setDate(r.getDate()-7*n),r}(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Yt{priority=90;subPriority=1;parse(t,e,r){switch(e){case"d":return ie(Lt,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return ce(e.length,t)}}validate(t,e){const r=fe(t.getFullYear()),n=t.getMonth();return r?e>=1&&e<=ge[n]:e>=1&&e<=pe[n]}set(t,e,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Yt{priority=90;subpriority=1;parse(t,e,r){switch(e){case"D":case"DD":return ie(jt,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return ce(e.length,t)}}validate(t,e){return fe(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends Yt{priority=90;parse(t,e,r){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=me(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Yt{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return ae(ce(e.length,t),o);case"eo":return ae(r.ordinalNumber(t,{unit:"day"}),o);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=me(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends Yt{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return ae(ce(e.length,t),o);case"co":return ae(r.ordinalNumber(t,{unit:"day"}),o);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=me(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends Yt{priority=90;parse(t,e,r){const n=t=>0===t?7:t;switch(e){case"i":case"ii":return ce(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return ae(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiii":return ae(r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiiii":return ae(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);default:return ae(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n)}}validate(t,e){return e>=1&&e<=7}set(t,e,r){return(t=we(t,r)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends Yt{priority=80;parse(t,e,r){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(le(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Yt{priority=80;parse(t,e,r){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(le(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Yt{priority=80;parse(t,e,r){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(le(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Yt{priority=70;parse(t,e,r){switch(e){case"h":return ie(It,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return ce(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,r){const n=t.getHours()>=12;return n&&r<12?t.setHours(r+12,0,0,0):n||12!==r?t.setHours(r,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Yt{priority=70;parse(t,e,r){switch(e){case"H":return ie(Rt,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return ce(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Yt{priority=70;parse(t,e,r){switch(e){case"K":return ie(Qt,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return ce(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Yt{priority=70;parse(t,e,r){switch(e){case"k":return ie(Wt,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return ce(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,r){const n=r<=24?r%24:r;return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Yt{priority=60;parse(t,e,r){switch(e){case"m":return ie(Gt,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return ce(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Yt{priority=50;parse(t,e,r){switch(e){case"s":return ie(_t,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return ce(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]},S:new class extends Yt{priority=30;parse(t,e){return ae(ce(e.length,t),(t=>Math.floor(t*Math.pow(10,3-e.length))))}set(t,e,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]},X:new class extends Yt{priority=10;parse(t,e){switch(e){case"X":return se(te,t);case"XX":return se(ee,t);case"XXXX":return se(re,t);case"XXXXX":return se(oe,t);default:return se(ne,t)}}set(t,e,r){return e.timestampIsSet?t:C(t,t.getTime()-B(t)-r)}incompatibleTokens=["t","T","x"]},x:new class extends Yt{priority=10;parse(t,e){switch(e){case"x":return se(te,t);case"xx":return se(ee,t);case"xxxx":return se(re,t);case"xxxxx":return se(oe,t);default:return se(ne,t)}}set(t,e,r){return e.timestampIsSet?t:C(t,t.getTime()-B(t)-r)}incompatibleTokens=["t","T","X"]},t:new class extends Yt{priority=40;parse(t){return ue(t)}set(t,e,r){return[C(t,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Yt{priority=20;parse(t){return ue(t)}set(t,e,r){return[C(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},ve=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,be=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ke=/^'([^]*?)'?$/,xe=/''/g,Te=/\S/,Me=/[a-zA-Z]/;function De(t,e,r,n){const o=Object.assign({},W()),a=n?.locale??o.locale??tt,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(""===e)return""===t?Y(r):C(r,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:a},c=[new Nt],d=e.match(be).map((t=>{const e=t[0];if(e in vt){return(0,vt[e])(t,a.formatLong)}return t})).join("").match(ve),l=[];for(let o of d){!n?.useAdditionalWeekYearTokens&&Tt(o)&&Mt(o,e,t),!n?.useAdditionalDayOfYearTokens&&xt(o)&&Mt(o,e,t);const i=o[0],s=ye[i];if(s){const{incompatibleTokens:e}=s;if(Array.isArray(e)){const t=l.find((t=>e.includes(t.token)||t.token===i));if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${o}\` at the same time`)}else if("*"===s.incompatibleTokens&&l.length>0)throw new RangeError(`The format string mustn't contain \`${o}\` and any other token at the same time`);l.push({token:i,fullToken:o});const n=s.run(t,o,a.match,u);if(!n)return C(r,NaN);c.push(n.setter),t=n.rest}else{if(i.match(Me))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");if("''"===o?o="'":"'"===i&&(o=o.match(ke)[1].replace(xe,"'")),0!==t.indexOf(o))return C(r,NaN);t=t.slice(o.length)}}if(t.length>0&&Te.test(t))return C(r,NaN);const h=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,r)=>r.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=Y(r);if(isNaN(f.getTime()))return C(r,NaN);const p={};for(const t of h){if(!t.validate(f,u))return C(r,NaN);const e=t.set(f,p,u);Array.isArray(e)?(f=e[0],Object.assign(p,e[1])):f=e}return C(r,f)}var Se=function(t){h(r,k);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,r),e.call(this,t,n,"store-hour",o)}return d(r,[{key:"day",get:function(){return this.getAttribute("day")}},{key:"isClosed",get:function(){return null===this.getAttribute("start")&&null===this.getAttribute("end")}},{key:"is24Hours",get:function(){var t=this.startDateInstance,e=this.endDateInstance,r=Math.abs(t-e);return Math.floor(r/1e3/60)/60>23}},{key:"startDateInstance",get:function(){if(!this.hasAttribute("start"))return null;var t=this.getAttribute("start"),e=3===t.split(":").length;return De(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"endDateInstance",get:function(){if(!this.hasAttribute("end"))return null;var t=this.getAttribute("end"),e=3===t.split(":").length;return De(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return z(this.startDateInstance)&&z(this.endDateInstance)?"".concat(At(this.startDateInstance,"p")," - ").concat(At(this.endDateInstance,"p")):"".concat(this.start," - ").concat(this.end)}},{key:"humanReadableHours",get:function(){return this.isClosed?"Closed":this.is24Hours?"24 Hours":this.humanReadableHoursRange}},{key:"create",value:function(){throw new Error("There is no create() method store location!")}},{key:"update",value:function(){throw new Error("There is no update() method store location!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method store location!")}},{key:"reload",value:function(){throw new Error("There is no reload() method store location!")}}]),r}(),Pe=function(e){h(n,k);var r=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),r.call(this,t,e,"store-location",o)}return d(n,[{key:"latitude",get:function(){return this.getAttribute("place.location.coordinates.1")}},{key:"longitude",get:function(){return this.getAttribute("place.location.coordinates.0")}},{key:"hours",get:function(){return new t.Collection(this.getAttribute("hours").map((function(t){return new Se(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=At(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var e={},r=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,o),n.call(this,t,e,"store",r)}return d(o,[{key:"getReviews",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",r({store:this.id},n)).then((function(r){return new t.Collection(r.map((function(t){return new T(t,e.adapter)})))}))}},{key:"getLocations",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",r({store:this.id},n)).then((function(r){return new t.Collection(r.map((function(r){return r.place&&(r.place=new t.Place(r.place)),new Pe(r,e.adapter)})))}))}},{key:"getLocation",value:function(t){var e=this;return this.adapter.get("locations/".concat(t),{store:this.id}).then((function(t){return new Pe(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",r).then((function(r){return new t.Collection(r.map((function(t){return new N(t,e.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new N(t,e.adapter)}))}}]),o}(),Oe=function(e){h(l,k);var r,o,a,i,c=y(l);function l(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,l),c.call(this,t,e,"network",r)}return d(l,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getResourceCollection",value:(i=s(n().mark((function e(r,o){var a,i,s=this,u=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=u.length>2&&void 0!==u[2]?u[2]:{},e.prev=1,e.next=4,this.adapter.get(r,a);case 4:return i=e.sent,e.abrupt("return",new t.Collection(i.map((function(t){return new o(t,s.adapter)}))));case 8:throw e.prev=8,e.t0=e.catch(1),console.error("Error fetching ".concat(r,":"),e.t0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(t,e){return i.apply(this,arguments)})},{key:"getStores",value:(a=s(n().mark((function t(){var e,r=arguments;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("stores",Ee,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"getStoreLocations",value:(o=s(n().mark((function t(){var e,r=arguments;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("store-locations",Pe,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"getPaymentGateways",value:(r=s(n().mark((function t(){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.getResourceCollection("gateways",N));case 1:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})}]),l}(),Ae=Array.isArray,qe=function(e){h(i,t.ServiceQuote);var r,o,a=y(i);function i(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,i),r instanceof t.Adapter?w(e,e=a.call(this,{},r,"service-quote",o)):a.call(this,r,n,"service-quote",o)}return d(i,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Fe(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["amount","currency"]),e=t.amount,r=t.currency;return D(e)||D(r)?null:M(e/100,r)}},{key:"fetchServiceQuotesFromCart",value:(o=s(n().mark((function e(r,o,a){var s,u,c,d,l,h,f=this,p=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d=p.length>3&&void 0!==p[3]?p[3]:"storefront",l=p.length>4&&void 0!==p[4]&&p[4],null!==(s=r)&&void 0!==s&&s.id&&(r=r.id),null!==(u=o)&&void 0!==u&&u.id&&(o=o.id),null!==(c=a)&&void 0!==c&&c.id&&(a=a.id),e.prev=5,e.next=8,this.adapter.get("service-quotes/from-cart",{origin:r,destination:o,cart:a,config:d,all:l});case 8:if(h=e.sent,!Ae(h)){e.next=11;break}return e.abrupt("return",new t.Collection(h.map((function(t){return new i(t,f.adapter)}))));case 11:return e.abrupt("return",new i(h,this.adapter));case 14:throw e.prev=14,e.t0=e.catch(5),console.error("Error fetching service quotes:",e.t0),e.t0;case 18:case"end":return e.stop()}}),e,this,[[5,14]])}))),function(t,e,r){return o.apply(this,arguments)})}],[{key:"getFromCart",value:(r=s(n().mark((function t(e,r,o,a){var s,u,c,d=arguments;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=d.length>4&&void 0!==d[4]?d[4]:"storefront",u=d.length>5&&void 0!==d[5]&&d[5],c=new i(e),t.abrupt("return",c.fetchServiceQuotesFromCart(r,o,a,s,u));case 4:case"end":return t.stop()}}),t)}))),function(t,e,n,o){return r.apply(this,arguments)})}]),i}(),He=new t.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,initialize:function(e,n,o,a){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return t.isResource(e)&&(e=e.id),t.isResource(n)&&(n=n.id),t.isResource(o)&&(o=o.id),t.isResource(a)&&(a=a.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),r(r({},i),{},{customer:e,cart:n,serviceQuote:o,gateway:a}),s)},captureOrder:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("".concat(this.namespace,"/capture"),{token:e,transactionDetails:r},n).then((function(e){return new t.Order(e)}))}}),Ne=function(t){h(r,k);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,r),e.call(this,t,n,"checkout",o)}return d(r,[{key:"initialize",value:function(){var t;return(t=this.store).initialize.apply(t,arguments)}},{key:"captureOrder",value:function(){var t;return(t=this.store).captureOrder.apply(t,arguments)}}]),r}(),Ye={Product:S,Category:P,Customer:O,Cart:H,DeliveryServiceQuote:qe,Store:Ee,StoreLocation:Pe,StoreHour:Se,Checkout:Ne,Review:T},Ce={BrowserAdapter:t.BrowserAdapter,NodeAdapter:t.NodeAdapter},Le=function(){function e(){return u(this,e),this.resources=Ye,this.adapters=Ce,this.lookup.apply(this,arguments)}return d(e,[{key:"lookup",value:function(e,r){var n=t.pluralize(e),o=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][r])throw new Error("No ".concat(t.singularize(e)," named ").concat(r," to resolve"));return m(this[n][r],v(o))}}]),e}(),je=function(){return m(Le,Array.prototype.slice.call(arguments))},Fe=function(e){h(n,t.Store);var r=y(n);function n(){return u(this,n),r.apply(this,arguments)}return d(n,[{key:"extendActions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.extendStoreActions(this,e)}},{key:"serialize",value:function(e){return je("resource",t.classify(this.resource),e,this.adapter)}}]),n}(),Re=function(){function e(r){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(u(this,e),this.version=o.version||"v1",this.options={version:this.version,host:o.host||"https://api.fleetbase.io",namespace:"storefront/".concat(this.version)||o.namespace,publicKey:r,debug:a},!("string"==typeof(n=r)&&n.length>30&&(n.startsWith("store_")||n.startsWith("network_"))))throw new Error("⚠️ Invalid Storefront key given to Storefront SDK");this.adapter=o.adapter||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.isNodeEnvironment()?je("adapter","NodeAdapter",e):je("adapter","BrowserAdapter",e)}(this.options),this.products=new Fe("product",this.adapter),this.categories=new Fe("category",this.adapter),this.reviews=new Fe("review",this.adapter).extendActions(x),this.customers=new Fe("customer",this.adapter).extendActions(E),this.cart=new Fe("cart",this.adapter).extendActions(q),this.checkout=new Fe("checkout",this.adapter).extendActions(He)}return d(e,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"search",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",r({query:e},n)).then((function(e){return new t.Collection(e.map((function(t){return new S(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return m(e,Array.prototype.slice.call(arguments))}}]),e}();exports.Cart=H,exports.Category=P,exports.Checkout=Ne,exports.Customer=O,exports.DeliveryServiceQuote=qe,exports.Network=Oe,exports.PaymentGateway=N,exports.Product=S,exports.Review=T,exports.Store=Ee,exports.StoreHour=Se,exports.StoreLocation=Pe,exports.default=Re; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@fleetbase/sdk");function e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function r(t){for(var r=1;r=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),w}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:H(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),w}},e}function o(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function i(t,e,r,n,o,a,i){try{var s=t[a](i),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function s(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function s(t){i(a,n,o,s,u,"next",t)}function u(t){i(a,n,o,s,u,"throw",t)}s(void 0)}))}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{},r={};return t&&(r.store=t),this.adapter.get("".concat(this.namespace,"/count"),r,e)}}),T=function(t){h(r,k);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,r),e.call(this,t,n,"review",o)}return d(r,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),r}();function M(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:r}).format(t)}var D=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var r=a(t);if("object"===r){var n=t.size;if("number"==typeof n)return!n}if("number"==typeof t.length&&"function"!==r)return!t.length;if("object"===r){var o=t.length;if("number"==typeof o)return!o}return!1},S=function(e){h(n,k);var r=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),r.call(this,t,e,"product",o)}return d(n,[{key:"variants",value:function(){return this.getAttribute("variants")}},{key:"addons",value:function(){return this.getAttribute("addon_categories")}},{key:"isOnSale",get:function(){return this.getAttribute("is_on_sale")}},{key:"isNotOnSale",get:function(){return!this.getAttribute("is_on_sale")}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["price","sale_price","currency"]),e=t.price,r=t.sale_price,n=t.currency;return this.isOnSale?D(r)||D(n)?null:M(r/100,n):D(e)||D(n)?null:M(e/100,n)}},{key:"getReviews",value:function(){var e=this;return this.adapter.get("reviews",{store:this.id}).then((function(r){return new t.Collection(r.map((function(t){return new T(t,e.adapter)})))}))}}]),n}(),P=function(e){h(n,k);var r=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),r.call(this,t,e,"category",o)}return d(n,[{key:"getProducts",value:function(){var e=this;return this.adapter.get("products",{category:this.id}).then((function(r){return new t.Collection(r.map((function(t){return new S(t,e.adapter)})))}))}}]),n}(),E=new t.StoreActions({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("customers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("customers/login",r({identity:t,password:e},n)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers/verify-code",r({identity:t,code:e},n)).then(this.afterFetch.bind(this))},requestCreationCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"email";return this.adapter.post("customers/request-creation-code",{identity:t,mode:e})},create:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers",r({identity:t,code:e},n)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),O=function(e){h(f,k);var o,a,i,c,l=y(f);function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,f),l.call(this,t,e,"customer",r({actions:E},n))}return d(f,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Fe(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"token",get:function(){return this.getAttribute("token")}},{key:"syncDevice",value:(c=s(n().mark((function t(e){var r=this;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",e).then((function(){return r})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return c.apply(this,arguments)})},{key:"performAuthorizedRequest",value:(i=s(n().mark((function t(e){var r,o,a,i,s=arguments;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},o=s.length>2&&void 0!==s[2]?s[2]:"GET",t.prev=2,a={"Customer-Token":this.token},t.next=6,this.adapter.setHeaders(a)[o.toLowerCase()](e,r);case 6:return i=t.sent,t.abrupt("return",i);case 10:throw t.prev=10,t.t0=t.catch(2),console.error("Error in ".concat(o," request to ").concat(e,":"),t.t0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[2,10]])}))),function(t){return i.apply(this,arguments)})},{key:"getSavedPlaces",value:(a=s(n().mark((function e(){var r,o=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.performAuthorizedRequest("customers/places");case 3:return r=e.sent,e.abrupt("return",new t.Collection(r.map((function(e){return new t.Place(e,o.adapter)}))));case 7:throw e.prev=7,e.t0=e.catch(0),new Error("Failed to retrieve saved places");case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return a.apply(this,arguments)})},{key:"getOrderHistory",value:(o=s(n().mark((function e(){var r,o,a=this,i=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},e.prev=1,e.next=4,this.performAuthorizedRequest("customers/orders",r);case 4:return o=e.sent,e.abrupt("return",new t.Collection(o.map((function(e){return new t.Order(e,a.adapter)}))));case 8:throw e.prev=8,e.t0=e.catch(1),new Error("Failed to retrieve order history");case 11:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(){return o.apply(this,arguments)})}]),f}(),A=Array.isArray,q=new t.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,add:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),r(r({},o),{},{quantity:n}),a).then(this.afterFetch.bind(this))},update:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),r(r({},o),{},{quantity:n}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},r).then(this.afterFetch.bind(this))},empty:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/empty"),{},e).then(this.afterFetch.bind(this))},retrieve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.findRecord(t)}}),H=function(t){h(n,k);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,o,"cart",r({actions:q},a))}return d(n,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof S&&(t=t.id),this.store.add(this.id,t,e,r,n)}},{key:"update",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,r,n)}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.remove(this.id,t,e)}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.empty(this.id,t)}},{key:"delete",value:function(){return this.destroy()}},{key:"refresh",value:function(){return this.store.retrieve(this.id)}},{key:"subtotal",value:function(){var t=0;return this.contents().forEach((function(e){t+=e.subtotal})),t}},{key:"contents",value:function(){return this.getAttribute("items",[])}},{key:"hasProduct",value:function(t){return-1!==this.contents().findIndex((function(e){return e.product_id===t}))}},{key:"isEmpty",get:function(){var t=this.contents();return!A(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),n}(),N=function(t){h(r,k);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,r),e.call(this,t,n,"payment-gateway",o)}return d(r,[{key:"type",get:function(){return this.getAttribute("type")}},{key:"code",get:function(){return this.getAttribute("code")}},{key:"isCashGateway",get:function(){return"cash"===this.type}},{key:"isStripeGateway",get:function(){return"stripe"===this.type}},{key:"setCheckoutToken",value:function(t){this.token=t}},{key:"getCheckoutToken",value:function(){return this.token}},{key:"findRecord",value:function(){throw new Error("There is no findRecord() method for payment gateways!")}},{key:"create",value:function(){throw new Error("There is no create() method for payment gateways!")}},{key:"update",value:function(){throw new Error("There is no update() method for payment gateways!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method for payment gateways!")}},{key:"reload",value:function(){throw new Error("There is no reload() method for payment gateways!")}}]),r}();function Y(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function C(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function L(t,e){const r=Y(t);return isNaN(e)?C(t,NaN):e?(r.setDate(r.getDate()+e),r):r}const j=6048e5,F=864e5;let R={};function W(){return R}function Q(t,e){const r=W(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=Y(t),a=o.getDay(),i=(a=o.getTime()?r+1:e.getTime()>=i.getTime()?r:r-1}function _(t){const e=Y(t);return e.setHours(0,0,0,0),e}function B(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function z(t){if(!(e=t,e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)||"number"==typeof t))return!1;var e;const r=Y(t);return!isNaN(Number(r))}const X={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function $(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const K={date:$({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:$({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:$({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function J(t){return(e,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,o=r?.width?String(r.width):e;n=t.formattingValues[o]||t.formattingValues[e]}else{const e=t.defaultWidth,o=r?.width?String(r.width):t.defaultWidth;n=t.values[o]||t.values[e]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function V(t){return(e,r={})=>{const n=r.width,o=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],a=e.match(o);if(!a)return null;const i=a[0],s=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let r=0;rt.test(i))):function(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=r.valueCallback?r.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var Z;const tt={code:"en-US",formatDistance:(t,e,r)=>{let n;const o=X[t];return n="string"==typeof o?o:1===e?o.one:o.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:K,formatRelative:(t,e,r,n)=>U[t],localize:{ordinalNumber:(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:J({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:J({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:J({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:J({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:J({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Z={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const r=t.match(Z.matchPattern);if(!r)return null;const n=r[0],o=t.match(Z.parsePattern);if(!o)return null;let a=Z.valueCallback?Z.valueCallback(o[0]):o[0];return a=e.valueCallback?e.valueCallback(a):a,{value:a,rest:t.slice(n.length)}}),era:V({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:V({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:V({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:V({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:V({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function et(t){const e=Y(t),r=function(t,e){const r=_(t),n=_(e),o=r.getTime()-B(r),a=n.getTime()-B(n);return Math.round((o-a)/F)}(e,function(t){const e=Y(t),r=C(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}(e));return r+1}function rt(t){const e=Y(t),r=I(e).getTime()-function(t){const e=G(t),r=C(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),I(r)}(e).getTime();return Math.round(r/j)+1}function nt(t,e){const r=Y(t),n=r.getFullYear(),o=W(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=C(t,0);i.setFullYear(n+1,0,a),i.setHours(0,0,0,0);const s=Q(i,e),u=C(t,0);u.setFullYear(n,0,a),u.setHours(0,0,0,0);const c=Q(u,e);return r.getTime()>=s.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function ot(t,e){const r=Y(t),n=Q(r,e).getTime()-function(t,e){const r=W(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=nt(t,e),a=C(t,0);return a.setFullYear(o,0,n),a.setHours(0,0,0,0),Q(a,e)}(r,e).getTime();return Math.round(n/j)+1}function at(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const it={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return at("yy"===e?n%100:n,e.length)},M(t,e){const r=t.getMonth();return"M"===e?String(r+1):at(r+1,2)},d:(t,e)=>at(t.getDate(),e.length),a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(t,e)=>at(t.getHours()%12||12,e.length),H:(t,e)=>at(t.getHours(),e.length),m:(t,e)=>at(t.getMinutes(),e.length),s:(t,e)=>at(t.getSeconds(),e.length),S(t,e){const r=e.length,n=t.getMilliseconds();return at(Math.floor(n*Math.pow(10,r-3)),e.length)}},st="midnight",ut="noon",ct="morning",dt="afternoon",lt="evening",ht="night",ft={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if("yo"===e){const e=t.getFullYear(),n=e>0?e:1-e;return r.ordinalNumber(n,{unit:"year"})}return it.y(t,e)},Y:function(t,e,r,n){const o=nt(t,n),a=o>0?o:1-o;if("YY"===e){return at(a%100,2)}return"Yo"===e?r.ordinalNumber(a,{unit:"year"}):at(a,e.length)},R:function(t,e){return at(G(t),e.length)},u:function(t,e){return at(t.getFullYear(),e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return at(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return at(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return it.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return at(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const o=ot(t,n);return"wo"===e?r.ordinalNumber(o,{unit:"week"}):at(o,e.length)},I:function(t,e,r){const n=rt(t);return"Io"===e?r.ordinalNumber(n,{unit:"week"}):at(n,e.length)},d:function(t,e,r){return"do"===e?r.ordinalNumber(t.getDate(),{unit:"date"}):it.d(t,e)},D:function(t,e,r){const n=et(t);return"Do"===e?r.ordinalNumber(n,{unit:"dayOfYear"}):at(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return at(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return at(a,e.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),o=0===n?7:n;switch(e){case"i":return String(o);case"ii":return at(o,e.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let o;switch(o=12===n?ut:0===n?st:n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let o;switch(o=n>=17?lt:n>=12?dt:n>=4?ct:ht,e){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,e,r){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),r.ordinalNumber(e,{unit:"hour"})}return it.h(t,e)},H:function(t,e,r){return"Ho"===e?r.ordinalNumber(t.getHours(),{unit:"hour"}):it.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return"Ko"===e?r.ordinalNumber(n,{unit:"hour"}):at(n,e.length)},k:function(t,e,r){let n=t.getHours();return 0===n&&(n=24),"ko"===e?r.ordinalNumber(n,{unit:"hour"}):at(n,e.length)},m:function(t,e,r){return"mo"===e?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):it.m(t,e)},s:function(t,e,r){return"so"===e?r.ordinalNumber(t.getSeconds(),{unit:"second"}):it.s(t,e)},S:function(t,e){return it.S(t,e)},X:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();if(0===o)return"Z";switch(e){case"X":return gt(o);case"XXXX":case"XX":return mt(o);default:return mt(o,":")}},x:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return gt(o);case"xxxx":case"xx":return mt(o);default:return mt(o,":")}},O:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+pt(o,":");default:return"GMT"+mt(o,":")}},z:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+pt(o,":");default:return"GMT"+mt(o,":")}},t:function(t,e,r,n){const o=n._originalDate||t;return at(Math.floor(o.getTime()/1e3),e.length)},T:function(t,e,r,n){return at((n._originalDate||t).getTime(),e.length)}};function pt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),o=Math.floor(n/60),a=n%60;return 0===a?r+String(o):r+String(o)+e+at(a,2)}function gt(t,e){if(t%60==0){return(t>0?"-":"+")+at(Math.abs(t)/60,2)}return mt(t,e)}function mt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t);return r+at(Math.floor(n/60),2)+e+at(n%60,2)}const wt=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},yt=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},vt={p:yt,P:(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return wt(t,e);let a;switch(n){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"})}return a.replace("{{date}}",wt(n,e)).replace("{{time}}",yt(o,e))}},bt=["D","DD"],kt=["YY","YYYY"];function xt(t){return-1!==bt.indexOf(t)}function Tt(t){return-1!==kt.indexOf(t)}function Mt(t,e,r){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("YY"===t)throw new RangeError(`Use \`yy\` instead of \`YY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("D"===t)throw new RangeError(`Use \`d\` instead of \`D\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("DD"===t)throw new RangeError(`Use \`dd\` instead of \`DD\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const Dt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,St=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Pt=/^'([^]*?)'?$/,Et=/''/g,Ot=/[a-zA-Z]/;function At(t,e,r){const n=W(),o=r?.locale??n.locale??tt,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Y(t);if(!z(s))throw new RangeError("Invalid time value");const u={firstWeekContainsDate:a,weekStartsOn:i,locale:o,_originalDate:s};return e.match(St).map((function(t){const e=t[0];if("p"===e||"P"===e){return(0,vt[e])(t,o.formatLong)}return t})).join("").match(Dt).map((function(n){if("''"===n)return"'";const a=n[0];if("'"===a)return function(t){const e=t.match(Pt);if(!e)return t;return e[1].replace(Et,"'")}(n);const i=ft[a];if(i)return!r?.useAdditionalWeekYearTokens&&Tt(n)&&Mt(n,e,String(t)),!r?.useAdditionalDayOfYearTokens&&xt(n)&&Mt(n,e,String(t)),i(s,n,o.localize,u);if(a.match(Ot))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return n})).join("")}class qt{subPriority=0;validate(t,e){return!0}}class Ht extends qt{constructor(t,e,r,n,o){super(),this.value=t,this.validateValue=e,this.setValue=r,this.priority=n,o&&(this.subPriority=o)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,r){return this.setValue(t,e,this.value,r)}}class Nt extends qt{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:C(t,function(t,e){const r=e instanceof Date?C(e,0):new e(0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}(t,Date))}}class Yt{run(t,e,r,n){const o=this.parse(t,e,r,n);return o?{setter:new Ht(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,e,r){return!0}}const Ct=/^(1[0-2]|0?\d)/,Lt=/^(3[0-1]|[0-2]?\d)/,jt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Ft=/^(5[0-3]|[0-4]?\d)/,Rt=/^(2[0-3]|[0-1]?\d)/,Wt=/^(2[0-4]|[0-1]?\d)/,Qt=/^(1[0-1]|0?\d)/,It=/^(1[0-2]|0?\d)/,Gt=/^[0-5]?\d/,_t=/^[0-5]?\d/,Bt=/^\d/,zt=/^\d{1,2}/,Xt=/^\d{1,3}/,$t=/^\d{1,4}/,Kt=/^-?\d+/,Ut=/^-?\d/,Jt=/^-?\d{1,2}/,Vt=/^-?\d{1,3}/,Zt=/^-?\d{1,4}/,te=/^([+-])(\d{2})(\d{2})?|Z/,ee=/^([+-])(\d{2})(\d{2})|Z/,re=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ne=/^([+-])(\d{2}):(\d{2})|Z/,oe=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function ae(t,e){return t?{value:e(t.value),rest:t.rest}:t}function ie(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function se(t,e){const r=e.match(t);if(!r)return null;if("Z"===r[0])return{value:0,rest:e.slice(1)};return{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:e.slice(r[0].length)}}function ue(t){return ie(Kt,t)}function ce(t,e){switch(t){case 1:return ie(Bt,e);case 2:return ie(zt,e);case 3:return ie(Xt,e);case 4:return ie($t,e);default:return ie(new RegExp("^\\d{1,"+t+"}"),e)}}function de(t,e){switch(t){case 1:return ie(Ut,e);case 2:return ie(Jt,e);case 3:return ie(Vt,e);case 4:return ie(Zt,e);default:return ie(new RegExp("^-?\\d{1,"+t+"}"),e)}}function le(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function he(t,e){const r=e>0,n=r?e:1-e;let o;if(n<=50)o=t||100;else{const e=n+50;o=t+100*Math.floor(e/100)-(t>=e%100?100:0)}return r?o:1-o}function fe(t){return t%400==0||t%4==0&&t%100!=0}const pe=[31,28,31,30,31,30,31,31,30,31,30,31],ge=[31,29,31,30,31,30,31,31,30,31,30,31];function me(t,e,r){const n=W(),o=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Y(t),i=a.getDay(),s=7-o;return L(a,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function we(t,e){const r=Y(t),n=function(t){let e=Y(t).getDay();return 0===e&&(e=7),e}(r);return L(r,e-n)}const ye={G:new class extends Yt{priority=140;parse(t,e,r){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,e,r){return e.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Yt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return ae(ce(4,t),n);case"yo":return ae(r.ordinalNumber(t,{unit:"year"}),n);default:return ae(ce(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r){const n=t.getFullYear();if(r.isTwoDigitYear){const e=he(r.year,n);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const o="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Yt{priority=130;parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return ae(ce(4,t),n);case"Yo":return ae(r.ordinalNumber(t,{unit:"year"}),n);default:return ae(ce(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r,n){const o=nt(t,n);if(r.isTwoDigitYear){const e=he(r.year,o);return t.setFullYear(e,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),Q(t,n)}const a="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(a,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),Q(t,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Yt{priority=130;parse(t,e){return de("R"===e?4:e.length,t)}set(t,e,r){const n=C(t,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),I(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Yt{priority=130;parse(t,e){return de("u"===e?4:e.length,t)}set(t,e,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends Yt{priority=120;parse(t,e,r){switch(e){case"Q":case"QQ":return ce(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends Yt{priority=120;parse(t,e,r){switch(e){case"q":case"qq":return ce(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends Yt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"M":return ae(ie(Ct,t),n);case"MM":return ae(ce(2,t),n);case"Mo":return ae(r.ordinalNumber(t,{unit:"month"}),n);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}},L:new class extends Yt{priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"L":return ae(ie(Ct,t),n);case"LL":return ae(ce(2,t),n);case"Lo":return ae(r.ordinalNumber(t,{unit:"month"}),n);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends Yt{priority=100;parse(t,e,r){switch(e){case"w":return ie(Ft,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return ce(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r,n){return Q(function(t,e,r){const n=Y(t),o=ot(n,r)-e;return n.setDate(n.getDate()-7*o),n}(t,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Yt{priority=100;parse(t,e,r){switch(e){case"I":return ie(Ft,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return ce(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r){return I(function(t,e){const r=Y(t),n=rt(r)-e;return r.setDate(r.getDate()-7*n),r}(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Yt{priority=90;subPriority=1;parse(t,e,r){switch(e){case"d":return ie(Lt,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return ce(e.length,t)}}validate(t,e){const r=fe(t.getFullYear()),n=t.getMonth();return r?e>=1&&e<=ge[n]:e>=1&&e<=pe[n]}set(t,e,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Yt{priority=90;subpriority=1;parse(t,e,r){switch(e){case"D":case"DD":return ie(jt,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return ce(e.length,t)}}validate(t,e){return fe(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends Yt{priority=90;parse(t,e,r){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=me(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Yt{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return ae(ce(e.length,t),o);case"eo":return ae(r.ordinalNumber(t,{unit:"day"}),o);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=me(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends Yt{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return ae(ce(e.length,t),o);case"co":return ae(r.ordinalNumber(t,{unit:"day"}),o);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=me(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends Yt{priority=90;parse(t,e,r){const n=t=>0===t?7:t;switch(e){case"i":case"ii":return ce(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return ae(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiii":return ae(r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiiii":return ae(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);default:return ae(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n)}}validate(t,e){return e>=1&&e<=7}set(t,e,r){return(t=we(t,r)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends Yt{priority=80;parse(t,e,r){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(le(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Yt{priority=80;parse(t,e,r){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(le(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Yt{priority=80;parse(t,e,r){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(le(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Yt{priority=70;parse(t,e,r){switch(e){case"h":return ie(It,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return ce(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,r){const n=t.getHours()>=12;return n&&r<12?t.setHours(r+12,0,0,0):n||12!==r?t.setHours(r,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Yt{priority=70;parse(t,e,r){switch(e){case"H":return ie(Rt,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return ce(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Yt{priority=70;parse(t,e,r){switch(e){case"K":return ie(Qt,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return ce(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Yt{priority=70;parse(t,e,r){switch(e){case"k":return ie(Wt,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return ce(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,r){const n=r<=24?r%24:r;return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Yt{priority=60;parse(t,e,r){switch(e){case"m":return ie(Gt,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return ce(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Yt{priority=50;parse(t,e,r){switch(e){case"s":return ie(_t,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return ce(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]},S:new class extends Yt{priority=30;parse(t,e){return ae(ce(e.length,t),(t=>Math.floor(t*Math.pow(10,3-e.length))))}set(t,e,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]},X:new class extends Yt{priority=10;parse(t,e){switch(e){case"X":return se(te,t);case"XX":return se(ee,t);case"XXXX":return se(re,t);case"XXXXX":return se(oe,t);default:return se(ne,t)}}set(t,e,r){return e.timestampIsSet?t:C(t,t.getTime()-B(t)-r)}incompatibleTokens=["t","T","x"]},x:new class extends Yt{priority=10;parse(t,e){switch(e){case"x":return se(te,t);case"xx":return se(ee,t);case"xxxx":return se(re,t);case"xxxxx":return se(oe,t);default:return se(ne,t)}}set(t,e,r){return e.timestampIsSet?t:C(t,t.getTime()-B(t)-r)}incompatibleTokens=["t","T","X"]},t:new class extends Yt{priority=40;parse(t){return ue(t)}set(t,e,r){return[C(t,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Yt{priority=20;parse(t){return ue(t)}set(t,e,r){return[C(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},ve=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,be=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ke=/^'([^]*?)'?$/,xe=/''/g,Te=/\S/,Me=/[a-zA-Z]/;function De(t,e,r,n){const o=Object.assign({},W()),a=n?.locale??o.locale??tt,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(""===e)return""===t?Y(r):C(r,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:a},c=[new Nt],d=e.match(be).map((t=>{const e=t[0];if(e in vt){return(0,vt[e])(t,a.formatLong)}return t})).join("").match(ve),l=[];for(let o of d){!n?.useAdditionalWeekYearTokens&&Tt(o)&&Mt(o,e,t),!n?.useAdditionalDayOfYearTokens&&xt(o)&&Mt(o,e,t);const i=o[0],s=ye[i];if(s){const{incompatibleTokens:e}=s;if(Array.isArray(e)){const t=l.find((t=>e.includes(t.token)||t.token===i));if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${o}\` at the same time`)}else if("*"===s.incompatibleTokens&&l.length>0)throw new RangeError(`The format string mustn't contain \`${o}\` and any other token at the same time`);l.push({token:i,fullToken:o});const n=s.run(t,o,a.match,u);if(!n)return C(r,NaN);c.push(n.setter),t=n.rest}else{if(i.match(Me))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");if("''"===o?o="'":"'"===i&&(o=o.match(ke)[1].replace(xe,"'")),0!==t.indexOf(o))return C(r,NaN);t=t.slice(o.length)}}if(t.length>0&&Te.test(t))return C(r,NaN);const h=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,r)=>r.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=Y(r);if(isNaN(f.getTime()))return C(r,NaN);const p={};for(const t of h){if(!t.validate(f,u))return C(r,NaN);const e=t.set(f,p,u);Array.isArray(e)?(f=e[0],Object.assign(p,e[1])):f=e}return C(r,f)}var Se=function(t){h(r,k);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,r),e.call(this,t,n,"store-hour",o)}return d(r,[{key:"day",get:function(){return this.getAttribute("day")}},{key:"isClosed",get:function(){return null===this.getAttribute("start")&&null===this.getAttribute("end")}},{key:"is24Hours",get:function(){var t=this.startDateInstance,e=this.endDateInstance,r=Math.abs(t-e);return Math.floor(r/1e3/60)/60>23}},{key:"startDateInstance",get:function(){if(!this.hasAttribute("start"))return null;var t=this.getAttribute("start"),e=3===t.split(":").length;return De(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"endDateInstance",get:function(){if(!this.hasAttribute("end"))return null;var t=this.getAttribute("end"),e=3===t.split(":").length;return De(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return z(this.startDateInstance)&&z(this.endDateInstance)?"".concat(At(this.startDateInstance,"p")," - ").concat(At(this.endDateInstance,"p")):"".concat(this.start," - ").concat(this.end)}},{key:"humanReadableHours",get:function(){return this.isClosed?"Closed":this.is24Hours?"24 Hours":this.humanReadableHoursRange}},{key:"create",value:function(){throw new Error("There is no create() method store location!")}},{key:"update",value:function(){throw new Error("There is no update() method store location!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method store location!")}},{key:"reload",value:function(){throw new Error("There is no reload() method store location!")}}]),r}(),Pe=function(e){h(n,k);var r=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),r.call(this,t,e,"store-location",o)}return d(n,[{key:"latitude",get:function(){return this.getAttribute("place.location.coordinates.1")}},{key:"longitude",get:function(){return this.getAttribute("place.location.coordinates.0")}},{key:"hours",get:function(){return new t.Collection(this.getAttribute("hours").map((function(t){return new Se(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=At(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var e={},r=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,o),n.call(this,t,e,"store",r)}return d(o,[{key:"getReviews",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",r({store:this.id},n)).then((function(r){return new t.Collection(r.map((function(t){return new T(t,e.adapter)})))}))}},{key:"getLocations",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",r({store:this.id},n)).then((function(r){return new t.Collection(r.map((function(r){return r.place&&(r.place=new t.Place(r.place)),new Pe(r,e.adapter)})))}))}},{key:"getLocation",value:function(t){var e=this;return this.adapter.get("locations/".concat(t),{store:this.id}).then((function(t){return new Pe(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",r).then((function(r){return new t.Collection(r.map((function(t){return new N(t,e.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new N(t,e.adapter)}))}}]),o}(),Oe=function(e){h(l,k);var r,o,a,i,c=y(l);function l(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,l),c.call(this,t,e,"network",r)}return d(l,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getResourceCollection",value:(i=s(n().mark((function e(r,o){var a,i,s=this,u=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=u.length>2&&void 0!==u[2]?u[2]:{},e.prev=1,e.next=4,this.adapter.get(r,a);case 4:return i=e.sent,e.abrupt("return",new t.Collection(i.map((function(t){return new o(t,s.adapter)}))));case 8:throw e.prev=8,e.t0=e.catch(1),console.error("Error fetching ".concat(r,":"),e.t0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(t,e){return i.apply(this,arguments)})},{key:"getStores",value:(a=s(n().mark((function t(){var e,r=arguments;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("stores",Ee,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"getStoreLocations",value:(o=s(n().mark((function t(){var e,r=arguments;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("store-locations",Pe,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"getPaymentGateways",value:(r=s(n().mark((function t(){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.getResourceCollection("gateways",N));case 1:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})}]),l}(),Ae=Array.isArray,qe=function(e){h(i,t.ServiceQuote);var r,o,a=y(i);function i(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,i),r instanceof t.Adapter?w(e,e=a.call(this,{},r,"service-quote",o)):a.call(this,r,n,"service-quote",o)}return d(i,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Fe(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["amount","currency"]),e=t.amount,r=t.currency;return D(e)||D(r)?null:M(e/100,r)}},{key:"fetchServiceQuotesFromCart",value:(o=s(n().mark((function e(r,o,a){var s,u,c,d,l,h,f=this,p=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d=p.length>3&&void 0!==p[3]?p[3]:"storefront",l=p.length>4&&void 0!==p[4]&&p[4],null!==(s=r)&&void 0!==s&&s.id&&(r=r.id),null!==(u=o)&&void 0!==u&&u.id&&(o=o.id),null!==(c=a)&&void 0!==c&&c.id&&(a=a.id),e.prev=5,e.next=8,this.adapter.get("service-quotes/from-cart",{origin:r,destination:o,cart:a,config:d,all:l});case 8:if(h=e.sent,!Ae(h)){e.next=11;break}return e.abrupt("return",new t.Collection(h.map((function(t){return new i(t,f.adapter)}))));case 11:return e.abrupt("return",new i(h,this.adapter));case 14:throw e.prev=14,e.t0=e.catch(5),console.error("Error fetching service quotes:",e.t0),e.t0;case 18:case"end":return e.stop()}}),e,this,[[5,14]])}))),function(t,e,r){return o.apply(this,arguments)})}],[{key:"getFromCart",value:(r=s(n().mark((function t(e,r,o,a){var s,u,c,d=arguments;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=d.length>4&&void 0!==d[4]?d[4]:"storefront",u=d.length>5&&void 0!==d[5]&&d[5],c=new i(e),t.abrupt("return",c.fetchServiceQuotesFromCart(r,o,a,s,u));case 4:case"end":return t.stop()}}),t)}))),function(t,e,n,o){return r.apply(this,arguments)})}]),i}(),He=new t.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,initialize:function(e,n,o,a){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return t.isResource(e)&&(e=e.id),t.isResource(n)&&(n=n.id),t.isResource(o)&&(o=o.id),t.isResource(a)&&(a=a.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),r(r({},i),{},{customer:e,cart:n,serviceQuote:o,gateway:a}),s)},captureOrder:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/capture"),{token:e,transactionDetails:r},n).then((function(e){return new t.Order(e)}))}}),Ne=function(t){h(r,k);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,r),e.call(this,t,n,"checkout",o)}return d(r,[{key:"initialize",value:function(){var t;return(t=this.store).initialize.apply(t,arguments)}},{key:"captureOrder",value:function(){var t;return(t=this.store).captureOrder.apply(t,arguments)}}]),r}(),Ye={Product:S,Category:P,Customer:O,Cart:H,DeliveryServiceQuote:qe,Store:Ee,StoreLocation:Pe,StoreHour:Se,Checkout:Ne,Review:T},Ce={BrowserAdapter:t.BrowserAdapter,NodeAdapter:t.NodeAdapter},Le=function(){function e(){return u(this,e),this.resources=Ye,this.adapters=Ce,this.lookup.apply(this,arguments)}return d(e,[{key:"lookup",value:function(e,r){var n=t.pluralize(e),o=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][r])throw new Error("No ".concat(t.singularize(e)," named ").concat(r," to resolve"));return m(this[n][r],v(o))}}]),e}(),je=function(){return m(Le,Array.prototype.slice.call(arguments))},Fe=function(e){h(n,t.Store);var r=y(n);function n(){return u(this,n),r.apply(this,arguments)}return d(n,[{key:"extendActions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.extendStoreActions(this,e)}},{key:"serialize",value:function(e){return je("resource",t.classify(this.resource),e,this.adapter)}}]),n}(),Re=function(){function e(r){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(u(this,e),this.version=o.version||"v1",this.options={version:this.version,host:o.host||"https://api.fleetbase.io",namespace:"storefront/".concat(this.version)||o.namespace,publicKey:r,debug:a},!("string"==typeof(n=r)&&n.length>30&&(n.startsWith("store_")||n.startsWith("network_"))))throw new Error("⚠️ Invalid Storefront key given to Storefront SDK");this.adapter=o.adapter||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.isNodeEnvironment()?je("adapter","NodeAdapter",e):je("adapter","BrowserAdapter",e)}(this.options),this.products=new Fe("product",this.adapter),this.categories=new Fe("category",this.adapter),this.reviews=new Fe("review",this.adapter).extendActions(x),this.customers=new Fe("customer",this.adapter).extendActions(E),this.cart=new Fe("cart",this.adapter).extendActions(q),this.checkout=new Fe("checkout",this.adapter).extendActions(He)}return d(e,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"search",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",r({query:e},n)).then((function(e){return new t.Collection(e.map((function(t){return new S(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return m(e,Array.prototype.slice.call(arguments))}}]),e}();exports.Cart=H,exports.Category=P,exports.Checkout=Ne,exports.Customer=O,exports.DeliveryServiceQuote=qe,exports.Network=Oe,exports.PaymentGateway=N,exports.Product=S,exports.Review=T,exports.Store=Ee,exports.StoreHour=Se,exports.StoreLocation=Pe,exports.default=Re; //# sourceMappingURL=storefront.js.map diff --git a/dist/cjs/storefront.js.map b/dist/cjs/storefront.js.map index 17205a4..1a6d2d9 100644 --- a/dist/cjs/storefront.js.map +++ b/dist/cjs/storefront.js.map @@ -1 +1 @@ -{"version":3,"file":"storefront.js","sources":["../../src/resource.js","../../src/resources/review.js","../../src/utils/format-currency.js","../../src/utils/is-key-valid.js","../../src/utils/is-empty.js","../../src/resources/product.js","../../src/resources/category.js","../../src/resources/customer.js","../../src/utils/is-phone.js","../../src/resources/cart.js","../../src/resources/payment-gateway.js","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/toDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constructFrom.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/addDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/defaultOptions.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isValid.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/match.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDayOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/differenceInCalendarDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/addLeadingZeros.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/lightFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/formatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/longFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/protectedTokens.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/format.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Setter.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/transpose.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/utils.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DateParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/EraParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDefaultOptions.mjs","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/store.js","../../src/resources/network.js","../../src/resources/delivery-service-quote.js","../../src/resources/checkout.js","../../src/resolver.js","../../src/store.js","../../src/storefront.js","../../src/utils/detect-adapter.js"],"sourcesContent":["import { Resource } from '@fleetbase/sdk';\nimport StorefrontStore from './store';\n\nexport default class StorefrontResource extends Resource {\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n}\n","import Resource from '../resource';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst reviewActions = new StoreActions({\n count: function (storeId, options = {}) {\n const params = {};\n\n if (storeId) {\n params.store = storeId;\n }\n\n return this.adapter.get(`${this.namespace}/count`, params, options);\n },\n});\n\nexport default class Review extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'review', options);\n }\n\n getMedia() {\n // @todo\n }\n\n getPhotos() {\n // @todo\n }\n\n getVideos() {\n // @todo\n }\n}\n\nexport { reviewActions };\n","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n currencyDisplay,\n }).format(amount);\n}\n","const isKeyValid = (key) => {\n return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_'));\n};\n\nexport default isKeyValid;\n","const isEmpty = (obj) => {\n const none = obj === null || obj === undefined;\n if (none) {\n return none;\n }\n\n if (typeof obj.size === 'number') {\n return !obj.size;\n }\n\n const objectType = typeof obj;\n\n if (objectType === 'object') {\n const { size } = obj;\n if (typeof size === 'number') {\n return !size;\n }\n }\n\n if (typeof obj.length === 'number' && objectType !== 'function') {\n return !obj.length;\n }\n\n if (objectType === 'object') {\n const { length } = obj;\n if (typeof length === 'number') {\n return !length;\n }\n }\n\n return false;\n};\n\nexport default isEmpty;\n","import Resource from '../resource';\nimport Review from './review';\nimport { formatCurrency, isEmpty } from '../utils';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Product extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'product', options);\n }\n\n variants() {\n return this.getAttribute('variants');\n }\n\n addons() {\n return this.getAttribute('addon_categories');\n }\n\n get isOnSale() {\n return this.getAttribute('is_on_sale');\n }\n\n get isNotOnSale() {\n return !this.getAttribute('is_on_sale');\n }\n\n get formattedAmount() {\n const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']);\n\n if (this.isOnSale) {\n if (isEmpty(sale_price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(sale_price / 100, currency);\n }\n\n if (isEmpty(price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(price / 100, currency);\n }\n\n getReviews() {\n return this.adapter.get('reviews', { store: this.id }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n}\n","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Category extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'category', options);\n }\n\n getProducts() {\n return this.adapter.get('products', { category: this.id }).then((products) => {\n return new Collection(products.map((attributes) => new Product(attributes, this.adapter)));\n });\n }\n}\n","import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport StorefrontStore from '../store';\nimport { isPhone } from '../utils';\n\nconst customerActions = new StoreActions({\n // const { error } = await storefront.customers.login('+1 111-1111');\n login: function (identity, password = null, attributes = {}) {\n // handle phone number authentication\n if (isPhone(identity)) {\n return this.adapter.post('customers/login-with-sms', { phone: identity });\n }\n\n if (!password) {\n throw new Error('Login requires password!');\n }\n\n return this.adapter.post('customers/login', { identity, password, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n verifyCode: function (identity, code, attributes = {}) {\n return this.adapter.post('customers/verify-code', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n requestCreationCode(identity, mode = 'email') {\n return this.adapter.post('customers/request-creation-code', {\n identity,\n mode,\n });\n },\n\n create(identity, code, attributes = {}) {\n return this.adapter.post('customers', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id) {\n return this.findRecord(id);\n },\n});\n\nexport default class Customer extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'customer', {\n actions: customerActions,\n ...options,\n });\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get token() {\n return this.getAttribute('token');\n }\n\n async syncDevice(token) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/register-device', token)\n .then(() => {\n return this;\n });\n }\n\n async performAuthorizedRequest(endpoint, params = {}, method = 'GET') {\n try {\n const headers = { 'Customer-Token': this.token };\n const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params);\n return response;\n } catch (error) {\n console.error(`Error in ${method} request to ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getSavedPlaces() {\n try {\n const places = await this.performAuthorizedRequest('customers/places');\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve saved places');\n }\n }\n\n async getOrderHistory(params = {}) {\n try {\n const orders = await this.performAuthorizedRequest('customers/orders', params);\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve order history');\n }\n }\n}\n\nexport { customerActions };\n","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n};\n\nexport default isPhone;\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\n\nconst cartActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n add: function (id, productId, quantity = 1, data = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/${id}/${productId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n update: function (id, cartItemId, quantity, data = {}, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/${cartItemId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n remove: function (id, cartItemId, options = {}) {\n return this.adapter.delete(`${this.namespace}/${id}/${cartItemId}`, {}, options).then(this.afterFetch.bind(this));\n },\n\n empty: function (id, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/empty`, {}, options).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id = '') {\n return this.findRecord(id);\n },\n});\n\nexport default class Cart extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'cart', { actions: cartActions, ...options });\n }\n\n add(productId, quantity = 1, data = {}, options = {}) {\n if (productId instanceof Product) {\n productId = productId.id;\n }\n\n return this.store.add(this.id, productId, quantity, data, options);\n }\n\n update(cartItemId, quantity, data = {}, options = {}) {\n return this.store.update(this.id, cartItemId, quantity, data, options);\n }\n\n remove(cartItemId, options = {}) {\n return this.store.remove(this.id, cartItemId, options);\n }\n\n empty(options = {}) {\n return this.store.empty(this.id, options);\n }\n\n delete() {\n return this.destroy();\n }\n\n refresh() {\n return this.store.retrieve(this.id);\n }\n\n subtotal() {\n let subtotal = 0;\n\n this.contents().forEach((cartItem) => {\n subtotal += cartItem.subtotal;\n });\n\n return subtotal;\n }\n\n contents() {\n return this.getAttribute('items', []);\n }\n\n hasProduct(productId) {\n return this.contents().findIndex((cartItem) => cartItem.product_id === productId) !== -1;\n }\n\n get isEmpty() {\n const contents = this.contents();\n\n if (!isArray(contents)) {\n return true;\n }\n\n return contents.length === 0;\n }\n\n get isNotEmpty() {\n return !this.isEmpty;\n }\n}\n\nexport { cartActions };\n","import Resource from '../resource';\n\nexport default class PaymentGateway extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'payment-gateway', options);\n }\n\n get type() {\n return this.getAttribute('type');\n }\n\n get code() {\n return this.getAttribute('code');\n }\n\n get isCashGateway() {\n return this.type === 'cash';\n }\n\n get isStripeGateway() {\n return this.type === 'stripe';\n }\n\n setCheckoutToken(token) {\n this.token = token;\n }\n\n getCheckoutToken() {\n return this.token;\n }\n\n // remove default resource methods\n findRecord() {\n throw new Error('There is no findRecord() method for payment gateways!');\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method for payment gateways!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method for payment gateways!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method for payment gateways!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method for payment gateways!');\n }\n}\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const utcDate = new Date(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}\n","import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n startOfDayRight.getTime() -\n getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff =\n startOfISOWeek(_date).getTime() - startOfISOWeekYear(_date).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff =\n startOfWeek(_date, options).getTime() -\n startOfWeekYear(_date, options).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.floor(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.floor(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const protectedDayOfYearTokens = [\"D\", \"DD\"];\nconst protectedWeekYearTokens = [\"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\n\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\n\nexport function throwProtectedError(token, format, input) {\n if (token === \"YYYY\") {\n throw new RangeError(\n `Use \\`yyyy\\` instead of \\`YYYY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"YY\") {\n throw new RangeError(\n `Use \\`yy\\` instead of \\`YY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"D\") {\n throw new RangeError(\n `Use \\`d\\` instead of \\`D\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"DD\") {\n throw new RangeError(\n `Use \\`dd\\` instead of \\`DD\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n }\n}\n","import { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate,\n };\n\n const result = formatStr\n .match(longFormattingTokensRegExp)\n .map(function (substring) {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n const formatter = formatters[firstCharacter];\n if (formatter) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n return formatter(\n originalDate,\n substring,\n locale.localize,\n formatterOptions,\n );\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return substring;\n })\n .join(\"\");\n\n return result;\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { transpose } from \"../../transpose.mjs\";\nimport { constructFrom } from \"../../constructFrom.mjs\";\n\nconst TIMEZONE_UNIT_PRIORITY = 10;\n\nexport class Setter {\n subPriority = 0;\n\n validate(_utcDate, _options) {\n return true;\n }\n}\n\nexport class ValueSetter extends Setter {\n constructor(\n value,\n\n validateValue,\n\n setValue,\n\n priority,\n subPriority,\n ) {\n super();\n this.value = value;\n this.validateValue = validateValue;\n this.setValue = setValue;\n this.priority = priority;\n if (subPriority) {\n this.subPriority = subPriority;\n }\n }\n\n validate(date, options) {\n return this.validateValue(date, this.value, options);\n }\n\n set(date, flags, options) {\n return this.setValue(date, flags, this.value, options);\n }\n}\n\nexport class DateToSystemTimezoneSetter extends Setter {\n priority = TIMEZONE_UNIT_PRIORITY;\n subPriority = -1;\n set(date, flags) {\n if (flags.timestampIsSet) return date;\n return constructFrom(date, transpose(date, Date));\n }\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name transpose\n * @category Generic Helpers\n * @summary Transpose the date to the given constructor.\n *\n * @description\n * The function transposes the date to the given constructor. It helps you\n * to transpose the date in the system time zone to say `UTCDate` or any other\n * date extension.\n *\n * @typeParam DateInputType - The input `Date` type derived from the passed argument.\n * @typeParam DateOutputType - The output `Date` type derived from the passed constructor.\n *\n * @param fromDate - The date to use values from\n * @param constructor - The date constructor to use\n *\n * @returns Date transposed to the given constructor\n *\n * @example\n * // Create July 10, 2022 00:00 in locale time zone\n * const date = new Date(2022, 6, 10)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'\n *\n * @example\n * // Transpose the date to July 10, 2022 00:00 in UTC\n * transpose(date, UTCDate)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'\n */\nexport function transpose(fromDate, constructor) {\n const date =\n constructor instanceof Date\n ? constructFrom(constructor, 0)\n : new constructor(0);\n date.setFullYear(\n fromDate.getFullYear(),\n fromDate.getMonth(),\n fromDate.getDate(),\n );\n date.setHours(\n fromDate.getHours(),\n fromDate.getMinutes(),\n fromDate.getSeconds(),\n fromDate.getMilliseconds(),\n );\n return date;\n}\n\n// Fallback for modularized imports:\nexport default transpose;\n","import { ValueSetter } from \"./Setter.mjs\";\n\nexport class Parser {\n run(dateString, token, match, options) {\n const result = this.parse(dateString, token, match, options);\n if (!result) {\n return null;\n }\n\n return {\n setter: new ValueSetter(\n result.value,\n this.validate,\n this.set,\n this.priority,\n this.subPriority,\n ),\n rest: result.rest,\n };\n }\n\n validate(_utcDate, _value, _options) {\n return true;\n }\n}\n","export const numericPatterns = {\n month: /^(1[0-2]|0?\\d)/, // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/, // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/, // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/, // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/, // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/, // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/, // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/, // 0 to 12\n minute: /^[0-5]?\\d/, // 0 to 59\n second: /^[0-5]?\\d/, // 0 to 59\n\n singleDigit: /^\\d/, // 0 to 9\n twoDigits: /^\\d{1,2}/, // 0 to 99\n threeDigits: /^\\d{1,3}/, // 0 to 999\n fourDigits: /^\\d{1,4}/, // 0 to 9999\n\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/, // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/, // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/, // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/, // 0 to 9999, -0 to -9999\n};\n\nexport const timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/,\n};\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n millisecondsInSecond,\n} from \"../../constants.mjs\";\nimport { numericPatterns } from \"./constants.mjs\";\n\nexport function mapValue(parseFnResult, mapFn) {\n if (!parseFnResult) {\n return parseFnResult;\n }\n\n return {\n value: mapFn(parseFnResult.value),\n rest: parseFnResult.rest,\n };\n}\n\nexport function parseNumericPattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n return {\n value: parseInt(matchResult[0], 10),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseTimezonePattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n // Input is 'Z'\n if (matchResult[0] === \"Z\") {\n return {\n value: 0,\n rest: dateString.slice(1),\n };\n }\n\n const sign = matchResult[1] === \"+\" ? 1 : -1;\n const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n\n return {\n value:\n sign *\n (hours * millisecondsInHour +\n minutes * millisecondsInMinute +\n seconds * millisecondsInSecond),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseAnyDigitsSigned(dateString) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);\n}\n\nexport function parseNDigits(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function parseNDigitsSigned(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^-?\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function dayPeriodEnumToHours(dayPeriod) {\n switch (dayPeriod) {\n case \"morning\":\n return 4;\n case \"evening\":\n return 17;\n case \"pm\":\n case \"noon\":\n case \"afternoon\":\n return 12;\n case \"am\":\n case \"midnight\":\n case \"night\":\n default:\n return 0;\n }\n}\n\nexport function normalizeTwoDigitYear(twoDigitYear, currentYear) {\n const isCommonEra = currentYear > 0;\n // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n\n let result;\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n const rangeEnd = absCurrentYear + 50;\n const rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n const isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nexport function isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DAYS_IN_MONTH_LEAP_YEAR = [\n 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n];\n\n// Day of the month\nexport class DateParser extends Parser {\n priority = 90;\n subPriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"d\":\n return parseNumericPattern(numericPatterns.date, dateString);\n case \"do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n const month = date.getMonth();\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n }\n\n set(date, _flags, value) {\n date.setDate(value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { addDays } from \"./addDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link setDay} function options.\n */\n\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the week of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the day of the week set\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setDay(date, day, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const currentDay = _date.getDay();\n\n const remainder = day % 7;\n const dayIndex = (remainder + 7) % 7;\n\n const delta = 7 - weekStartsOn;\n const diff =\n day < 0 || day > 6\n ? day - ((currentDay + delta) % 7)\n : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setDay;\n","import { addDays } from \"./addDays.mjs\";\nimport { getISODay } from \"./getISODay.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the ISO week of the new date\n *\n * @returns The new date with the day of the ISO week set\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * const result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setISODay(date, day) {\n const _date = toDate(date);\n const currentDay = getISODay(_date);\n const diff = day - currentDay;\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setISODay;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * const result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nexport function getISODay(date) {\n const _date = toDate(date);\n let day = _date.getDay();\n\n if (day === 0) {\n day = 7;\n }\n\n return day;\n}\n\n// Fallback for modularized imports:\nexport default getISODay;\n","import { EraParser } from \"./parsers/EraParser.mjs\";\nimport { YearParser } from \"./parsers/YearParser.mjs\";\nimport { LocalWeekYearParser } from \"./parsers/LocalWeekYearParser.mjs\";\nimport { ISOWeekYearParser } from \"./parsers/ISOWeekYearParser.mjs\";\nimport { ExtendedYearParser } from \"./parsers/ExtendedYearParser.mjs\";\nimport { QuarterParser } from \"./parsers/QuarterParser.mjs\";\nimport { StandAloneQuarterParser } from \"./parsers/StandAloneQuarterParser.mjs\";\nimport { MonthParser } from \"./parsers/MonthParser.mjs\";\nimport { StandAloneMonthParser } from \"./parsers/StandAloneMonthParser.mjs\";\nimport { LocalWeekParser } from \"./parsers/LocalWeekParser.mjs\";\nimport { ISOWeekParser } from \"./parsers/ISOWeekParser.mjs\";\nimport { DateParser } from \"./parsers/DateParser.mjs\";\nimport { DayOfYearParser } from \"./parsers/DayOfYearParser.mjs\";\nimport { DayParser } from \"./parsers/DayParser.mjs\";\nimport { LocalDayParser } from \"./parsers/LocalDayParser.mjs\";\nimport { StandAloneLocalDayParser } from \"./parsers/StandAloneLocalDayParser.mjs\";\nimport { ISODayParser } from \"./parsers/ISODayParser.mjs\";\nimport { AMPMParser } from \"./parsers/AMPMParser.mjs\";\nimport { AMPMMidnightParser } from \"./parsers/AMPMMidnightParser.mjs\";\nimport { DayPeriodParser } from \"./parsers/DayPeriodParser.mjs\";\nimport { Hour1to12Parser } from \"./parsers/Hour1to12Parser.mjs\";\nimport { Hour0to23Parser } from \"./parsers/Hour0to23Parser.mjs\";\nimport { Hour0To11Parser } from \"./parsers/Hour0To11Parser.mjs\";\nimport { Hour1To24Parser } from \"./parsers/Hour1To24Parser.mjs\";\nimport { MinuteParser } from \"./parsers/MinuteParser.mjs\";\nimport { SecondParser } from \"./parsers/SecondParser.mjs\";\nimport { FractionOfSecondParser } from \"./parsers/FractionOfSecondParser.mjs\";\nimport { ISOTimezoneWithZParser } from \"./parsers/ISOTimezoneWithZParser.mjs\";\nimport { ISOTimezoneParser } from \"./parsers/ISOTimezoneParser.mjs\";\nimport { TimestampSecondsParser } from \"./parsers/TimestampSecondsParser.mjs\";\nimport { TimestampMillisecondsParser } from \"./parsers/TimestampMillisecondsParser.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- It's ok, we want any here\nexport const parsers = {\n G: new EraParser(),\n y: new YearParser(),\n Y: new LocalWeekYearParser(),\n R: new ISOWeekYearParser(),\n u: new ExtendedYearParser(),\n Q: new QuarterParser(),\n q: new StandAloneQuarterParser(),\n M: new MonthParser(),\n L: new StandAloneMonthParser(),\n w: new LocalWeekParser(),\n I: new ISOWeekParser(),\n d: new DateParser(),\n D: new DayOfYearParser(),\n E: new DayParser(),\n e: new LocalDayParser(),\n c: new StandAloneLocalDayParser(),\n i: new ISODayParser(),\n a: new AMPMParser(),\n b: new AMPMMidnightParser(),\n B: new DayPeriodParser(),\n h: new Hour1to12Parser(),\n H: new Hour0to23Parser(),\n K: new Hour0To11Parser(),\n k: new Hour1To24Parser(),\n m: new MinuteParser(),\n s: new SecondParser(),\n S: new FractionOfSecondParser(),\n X: new ISOTimezoneWithZParser(),\n x: new ISOTimezoneParser(),\n t: new TimestampSecondsParser(),\n T: new TimestampMillisecondsParser(),\n};\n","import { Parser } from \"../Parser.mjs\";\n\nexport class EraParser extends Parser {\n priority = 140;\n\n parse(dateString, token, match) {\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return (\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n\n // A, B\n case \"GGGGG\":\n return match.era(dateString, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return (\n match.era(dateString, { width: \"wide\" }) ||\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n }\n }\n\n set(date, flags, value) {\n flags.era = value;\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"R\", \"u\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n// | Year | y | yy | yyy | yyyy | yyyyy |\n// |----------|-------|----|-------|-------|-------|\n// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\nexport class YearParser extends Parser {\n priority = 130;\n incompatibleTokens = [\"Y\", \"R\", \"u\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"yy\",\n });\n\n switch (token) {\n case \"y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value) {\n const currentYear = date.getFullYear();\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(normalizedTwoDigitYear, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { getWeekYear } from \"../../../getWeekYear.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// Local week-numbering year\nexport class LocalWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"YY\",\n });\n\n switch (token) {\n case \"Y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"Yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value, options) {\n const currentYear = getWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(\n normalizedTwoDigitYear,\n 0,\n options.firstWeekContainsDate,\n );\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\n// ISO week-numbering year\nexport class ISOWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"R\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n const firstWeekOfYear = constructFrom(date, 0);\n firstWeekOfYear.setFullYear(value, 0, 4);\n firstWeekOfYear.setHours(0, 0, 0, 0);\n return startOfISOWeek(firstWeekOfYear);\n }\n\n incompatibleTokens = [\n \"G\",\n \"y\",\n \"Y\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\nexport class ExtendedYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"u\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"G\", \"y\", \"Y\", \"R\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class QuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n case \"QQ\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class StandAloneQuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n case \"qq\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MonthParser extends Parser {\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"L\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"M\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"MM\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // J, F, ..., D\n case \"MMMMM\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class StandAloneMonthParser extends Parser {\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"LL\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // J, F, ..., D\n case \"LLLLL\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setWeek } from \"../../../setWeek.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// Local week of year\nexport class LocalWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"w\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"wo\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value, options) {\n return startOfWeek(setWeek(date, value, options), options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { getWeek } from \"./getWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link setWeek} function options.\n */\n\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the local week set\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * const result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * const result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\nexport function setWeek(date, week, options) {\n const _date = toDate(date);\n const diff = getWeek(_date, options) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setWeek;\n","import { setISOWeek } from \"../../../setISOWeek.mjs\";\nimport { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// ISO week of year\nexport class ISOWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"I\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"Io\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value) {\n return startOfISOWeek(setISOWeek(date, value));\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { getISOWeek } from \"./getISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The ISO week of the new date\n *\n * @returns The new date with the ISO week set\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * const result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nexport function setISOWeek(date, week) {\n const _date = toDate(date);\n const diff = getISOWeek(_date) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setISOWeek;\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nexport class DayOfYearParser extends Parser {\n priority = 90;\n\n subpriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"D\":\n case \"DD\":\n return parseNumericPattern(numericPatterns.dayOfYear, dateString);\n case \"Do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n }\n\n set(date, _flags, value) {\n date.setMonth(0, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"E\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\n\n// Day of week\nexport class DayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"EEEEE\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"EEEE\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"D\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Local day of week\nexport class LocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"e\":\n case \"ee\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"eo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"eee\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"eeeee\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"eeee\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Stand-alone local day of week\nexport class StandAloneLocalDayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"c\":\n case \"cc\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"co\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"ccc\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // T\n case \"ccccc\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return (\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // Tuesday\n case \"cccc\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"e\",\n \"t\",\n \"T\",\n ];\n}\n","import { setISODay } from \"../../../setISODay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// ISO day of week\nexport class ISODayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => {\n if (value === 0) {\n return 7;\n }\n return value;\n };\n\n switch (token) {\n // 2\n case \"i\":\n case \"ii\": // 02\n return parseNDigits(token.length, dateString);\n // 2nd\n case \"io\":\n return match.ordinalNumber(dateString, { unit: \"day\" });\n // Tue\n case \"iii\":\n return mapValue(\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // T\n case \"iiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tu\n case \"iiiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tuesday\n case \"iiii\":\n default:\n return mapValue(\n match.day(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 7;\n }\n\n set(date, _flags, value) {\n date = setISODay(date, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"E\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"a\":\n case \"aa\":\n case \"aaa\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"aaaaa\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"b\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMMidnightParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"b\":\n case \"bb\":\n case \"bbb\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"bbbbb\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\n// in the morning, in the afternoon, in the evening, at night\nexport class DayPeriodParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"BBBBB\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1to12Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"h\":\n return parseNumericPattern(numericPatterns.hour12h, dateString);\n case \"ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 12;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setHours(0, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"H\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0to23Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"H\":\n return parseNumericPattern(numericPatterns.hour23h, dateString);\n case \"Ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 23;\n }\n\n set(date, _flags, value) {\n date.setHours(value, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0To11Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"K\":\n return parseNumericPattern(numericPatterns.hour11h, dateString);\n case \"Ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"h\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1To24Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"k\":\n return parseNumericPattern(numericPatterns.hour24h, dateString);\n case \"ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 24;\n }\n\n set(date, _flags, value) {\n const hours = value <= 24 ? value % 24 : value;\n date.setHours(hours, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"H\", \"K\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MinuteParser extends Parser {\n priority = 60;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"m\":\n return parseNumericPattern(numericPatterns.minute, dateString);\n case \"mo\":\n return match.ordinalNumber(dateString, { unit: \"minute\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setMinutes(value, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class SecondParser extends Parser {\n priority = 50;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"s\":\n return parseNumericPattern(numericPatterns.second, dateString);\n case \"so\":\n return match.ordinalNumber(dateString, { unit: \"second\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setSeconds(value, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\nexport class FractionOfSecondParser extends Parser {\n priority = 30;\n\n parse(dateString, token) {\n const valueCallback = (value) =>\n Math.floor(value * Math.pow(10, -token.length + 3));\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n\n set(date, _flags, value) {\n date.setMilliseconds(value);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601. +00:00 is `'Z'`)\nexport class ISOTimezoneWithZParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"X\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"XX\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"XXXX\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"XXXXX\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"XXX\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"x\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601)\nexport class ISOTimezoneParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"x\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"xx\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"xxxx\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"xxxxx\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"xxx\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"X\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampSecondsParser extends Parser {\n priority = 40;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value * 1000), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampMillisecondsParser extends Parser {\n priority = 20;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getDefaultOptions } from \"./getDefaultOptions.mjs\";\nimport { enUS as defaultLocale } from \"./locale/en-US.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { parsers } from \"./parse/_lib/parsers.mjs\";\nimport { DateToSystemTimezoneSetter } from \"./parse/_lib/Setter.mjs\";\n\n/**\n * The {@link parse} function options.\n */\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\n\nconst notWhitespaceRegExp = /\\S/;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)\n * and [setWeekYear](https://date-fns.org/docs/setWeekYear)).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateStr - The string to parse\n * @param formatStr - The string of tokens\n * @param referenceDate - defines values missing from the parsed dateString\n * @param options - An object with options.\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @returns The parsed date\n *\n * @throws `options.locale` must contain `match` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\nexport function parse(dateStr, formatStr, referenceDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n if (formatStr === \"\") {\n if (dateStr === \"\") {\n return toDate(referenceDate);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n\n const subFnOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n // If timezone isn't specified, it will be set to the system timezone\n const setters = [new DateToSystemTimezoneSetter()];\n\n const tokens = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter in longFormatters) {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp);\n\n const usedTokens = [];\n\n for (let token of tokens) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n\n const firstCharacter = token[0];\n const parser = parsers[firstCharacter];\n if (parser) {\n const { incompatibleTokens } = parser;\n if (Array.isArray(incompatibleTokens)) {\n const incompatibleToken = usedTokens.find(\n (usedToken) =>\n incompatibleTokens.includes(usedToken.token) ||\n usedToken.token === firstCharacter,\n );\n if (incompatibleToken) {\n throw new RangeError(\n `The format string mustn't contain \\`${incompatibleToken.fullToken}\\` and \\`${token}\\` at the same time`,\n );\n }\n } else if (parser.incompatibleTokens === \"*\" && usedTokens.length > 0) {\n throw new RangeError(\n `The format string mustn't contain \\`${token}\\` and any other token at the same time`,\n );\n }\n\n usedTokens.push({ token: firstCharacter, fullToken: token });\n\n const parseResult = parser.run(\n dateStr,\n token,\n locale.match,\n subFnOptions,\n );\n\n if (!parseResult) {\n return constructFrom(referenceDate, NaN);\n }\n\n setters.push(parseResult.setter);\n\n dateStr = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n // Replace two single quote characters with one single quote character\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n }\n\n // Cut token from string, or, if string doesn't match the token, return Invalid Date\n if (dateStr.indexOf(token) === 0) {\n dateStr = dateStr.slice(token.length);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n }\n\n // Check if the remaining input contains something other than whitespace\n if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const uniquePrioritySetters = setters\n .map((setter) => setter.priority)\n .sort((a, b) => b - a)\n .filter((priority, index, array) => array.indexOf(priority) === index)\n .map((priority) =>\n setters\n .filter((setter) => setter.priority === priority)\n .sort((a, b) => b.subPriority - a.subPriority),\n )\n .map((setterArray) => setterArray[0]);\n\n let date = toDate(referenceDate);\n\n if (isNaN(date.getTime())) {\n return constructFrom(referenceDate, NaN);\n }\n\n const flags = {};\n for (const setter of uniquePrioritySetters) {\n if (!setter.validate(date, subFnOptions)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const result = setter.set(date, flags, subFnOptions);\n // Result is tuple (date, flags)\n if (Array.isArray(result)) {\n date = result[0];\n Object.assign(flags, result[1]);\n // Result is date\n } else {\n date = result;\n }\n }\n\n return constructFrom(referenceDate, date);\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default parse;\n","import { getDefaultOptions as getInternalDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * @name getDefaultOptions\n * @category Common Helpers\n * @summary Get default options.\n * @pure false\n *\n * @description\n * Returns an object that contains defaults for\n * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`\n * arguments for all functions.\n *\n * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).\n *\n * @returns The default options\n *\n * @example\n * const result = getDefaultOptions()\n * //=> {}\n *\n * @example\n * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })\n * const result = getDefaultOptions()\n * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }\n */\nexport function getDefaultOptions() {\n return Object.assign({}, getInternalDefaultOptions());\n}\n\n// Fallback for modularized imports:\nexport default getDefaultOptions;\n","import Resource from '../resource';\nimport { format, parse, isValid } from 'date-fns';\n\nexport default class StoreHour extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-hour', options);\n }\n\n get day() {\n return this.getAttribute('day');\n }\n\n get isClosed() {\n return this.getAttribute('start') === null && this.getAttribute('end') === null;\n }\n\n get is24Hours() {\n const start = this.startDateInstance;\n const end = this.endDateInstance;\n const diff = Math.abs(start - end);\n const hours = Math.floor(diff / 1000 / 60) / 60;\n\n return hours > 23;\n }\n\n get startDateInstance() {\n if (!this.hasAttribute('start')) {\n return null;\n }\n\n const start = this.getAttribute('start');\n const includesSeconds = start.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(start, format, new Date());\n }\n\n get endDateInstance() {\n if (!this.hasAttribute('end')) {\n return null;\n }\n\n const end = this.getAttribute('end');\n const includesSeconds = end.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(end, format, new Date());\n }\n\n get humanReadableHoursRange() {\n if (!isValid(this.startDateInstance) || !isValid(this.endDateInstance)) {\n return `${this.start} - ${this.end}`;\n }\n\n return `${format(this.startDateInstance, 'p')} - ${format(this.endDateInstance, 'p')}`;\n }\n\n get humanReadableHours() {\n if (this.isClosed) {\n return 'Closed';\n }\n\n if (this.is24Hours) {\n return '24 Hours';\n }\n\n return this.humanReadableHoursRange;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreHour from './store-hour';\nimport { Collection } from '@fleetbase/sdk';\nimport { format } from 'date-fns';\n\nexport default class StoreLocation extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-location', options);\n }\n\n get latitude() {\n return this.getAttribute('place.location.coordinates.1');\n }\n\n get longitude() {\n return this.getAttribute('place.location.coordinates.0');\n }\n\n get hours() {\n return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes)));\n }\n\n get isAlwaysOpen() {\n return this.hours.every((hour) => hour?.is24Hours);\n }\n\n get today() {\n const today = format(new Date(), 'EEEE');\n\n return this.schedule[today];\n }\n\n get schedule() {\n const schedule = {};\n const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\n for (let i = 0; i < week.length; i++) {\n const day = week[i];\n\n schedule[day] = new Collection();\n }\n\n for (let i = 0; i < this.hours.length; i++) {\n const hour = this.hours.objectAt(i);\n\n schedule[hour.day].pushObject(hour);\n }\n\n return schedule;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Review from './review';\nimport { Collection, Place } from '@fleetbase/sdk';\n\nexport default class Store extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store', options);\n }\n\n getReviews(params = {}) {\n return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n\n getLocations(params = {}) {\n return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {\n return new Collection(\n storeLocations.map((attributes) => {\n if (attributes.place) {\n attributes.place = new Place(attributes.place);\n }\n\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getLocation(id) {\n return this.adapter.get(`locations/${id}`, { store: this.id }).then((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n });\n }\n\n getPaymentGateways(params = {}) {\n return this.adapter.get('gateways', params).then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateway(id) {\n return this.adapter.get(`gateways/${id}`).then((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n });\n }\n}\n","import { Collection } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport PaymentGateway from './payment-gateway';\nimport Store from './store';\nimport StoreLocation from './store-location';\n\nexport default class Network extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'network', options);\n }\n\n getTags(params = {}) {\n return this.adapter.get('tags', params);\n }\n\n async getResourceCollection(endpoint, ResourceClass, params = {}) {\n try {\n const resources = await this.adapter.get(endpoint, params);\n return new Collection(resources.map((attributes) => new ResourceClass(attributes, this.adapter)));\n } catch (error) {\n console.error(`Error fetching ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getStores(params = {}) {\n return this.getResourceCollection('stores', Store, params);\n }\n\n async getStoreLocations(params = {}) {\n return this.getResourceCollection('store-locations', StoreLocation, params);\n }\n\n async getPaymentGateways() {\n return this.getResourceCollection('gateways', PaymentGateway);\n }\n}\n","import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk';\nimport StorefrontStore from '../store';\nimport { formatCurrency, isEmpty } from '../utils';\n\nconst { isArray } = Array;\n\nexport default class DeliveryServiceQuote extends ServiceQuote {\n constructor(attributes = {}, adapter, options = {}) {\n if (attributes instanceof Adapter) {\n return super({}, attributes, 'service-quote', options);\n }\n\n super(attributes, adapter, 'service-quote', options);\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get formattedAmount() {\n const { amount, currency } = this.getAttributes(['amount', 'currency']);\n\n if (isEmpty(amount) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(amount / 100, currency);\n }\n\n async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n if (destination?.id) {\n destination = destination.id;\n }\n if (cart?.id) {\n cart = cart.id;\n }\n\n try {\n const serviceQuotes = await this.adapter.get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n });\n\n if (isArray(serviceQuotes)) {\n return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter)));\n }\n\n return new DeliveryServiceQuote(serviceQuotes, this.adapter);\n } catch (error) {\n console.error('Error fetching service quotes:', error);\n throw error;\n }\n }\n\n static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) {\n const quote = new DeliveryServiceQuote(adapter);\n return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all);\n }\n}\n","import { Order, StoreActions, isResource } from '@fleetbase/sdk';\nimport Resource from '../resource';\n\nconst checkoutActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n initialize: function (customer, cart, serviceQuote, gateway, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n if (isResource(gateway)) {\n gateway = gateway.getAttribute('code');\n }\n\n return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options);\n },\n\n captureOrder: function (token, transactionDetails = {}, options = {}) {\n return this.adapter.get(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson));\n },\n});\n\nexport default class Checkout extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'checkout', options);\n }\n\n initialize() {\n return this.store.initialize(...arguments);\n }\n\n captureOrder() {\n return this.store.captureOrder(...arguments);\n }\n}\n\nexport { checkoutActions };\n","import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources';\nimport { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk';\n\nconst resources = {\n Product,\n Category,\n Customer,\n Cart,\n DeliveryServiceQuote,\n Store,\n StoreLocation,\n StoreHour,\n Checkout,\n Review,\n};\n\nconst adapters = {\n BrowserAdapter,\n NodeAdapter,\n};\n\nclass Resolver {\n constructor() {\n this.resources = resources;\n this.adapters = adapters;\n\n return this.lookup(...arguments);\n }\n\n lookup(type, className) {\n const key = pluralize(type);\n const params = [...arguments].slice(2);\n\n if (!this[key]) {\n throw new Error('Attempted to resolve invalid type');\n }\n\n if (!this[key][className]) {\n throw new Error(`No ${singularize(type)} named ${className} to resolve`);\n }\n\n return new this[key][className](...params);\n }\n}\n\nconst lookup = function () {\n return new Resolver(...arguments);\n};\n\nexport { Resolver, lookup };\n","import { Store, classify, extendStoreActions } from '@fleetbase/sdk';\nimport { lookup } from './resolver';\n\nexport default class StorefrontStore extends Store {\n constructor() {\n super(...arguments);\n }\n\n extendActions(actions = []) {\n return extendStoreActions(this, actions);\n }\n\n serialize(json) {\n return lookup('resource', classify(this.resource), json, this.adapter);\n }\n}\n","import StorefrontStore from './store';\nimport { detectAdapter, isKeyValid } from './utils';\nimport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network } from './resources';\nimport { cartActions } from './resources/cart';\nimport { customerActions } from './resources/customer';\nimport { checkoutActions } from './resources/checkout';\nimport { reviewActions } from './resources/review';\nimport { Collection } from '@fleetbase/sdk';\n\n/**\n * // instance\n * const storefront = new Storefront();\n *\n */\n\nexport default class Storefront {\n /**\n * Builds an instance of the Fleetbase Storefront SDK\n *\n * @param {String} storeKey The access key for the storefront store\n * @param {Object} config The config object\n * @param {Boolean} debug Enable debug mode\n * @return {Storefront} Instance\n */\n constructor(storeKey, config = {}, debug = false) {\n this.version = config.version || 'v1';\n this.options = {\n version: this.version,\n host: config.host || 'https://api.fleetbase.io',\n namespace: `storefront/${this.version}` || config.namespace,\n publicKey: storeKey,\n debug,\n };\n\n if (!isKeyValid(storeKey)) {\n throw new Error('⚠️ Invalid Storefront key given to Storefront SDK');\n }\n\n this.adapter = config.adapter || detectAdapter(this.options);\n\n this.products = new StorefrontStore('product', this.adapter);\n this.categories = new StorefrontStore('category', this.adapter);\n this.reviews = new StorefrontStore('review', this.adapter).extendActions(reviewActions);\n this.customers = new StorefrontStore('customer', this.adapter).extendActions(customerActions);\n this.cart = new StorefrontStore('cart', this.adapter).extendActions(cartActions);\n this.checkout = new StorefrontStore('checkout', this.adapter).extendActions(checkoutActions);\n }\n\n /** loads information about this storefront */\n about() {\n return this.adapter.get('about');\n }\n\n /** search products in store or network */\n search(query, options = {}) {\n return this.adapter.get('search', { query, ...options }).then((products) => {\n return new Collection(products.map((product) => new Product(product)));\n });\n }\n\n static newInstance() {\n return new Storefront(...arguments);\n }\n\n setAdapter(adapter) {\n this.adapter = adapter;\n }\n\n getAdapter() {\n return this.adapter;\n }\n}\n\nexport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network };\n","import { lookup } from '../resolver';\nimport { isNodeEnvironment } from '@fleetbase/sdk';\n\nconst detectAdapter = (options = {}) => {\n if (isNodeEnvironment()) {\n return lookup('adapter', 'NodeAdapter', options);\n }\n\n return lookup('adapter', 'BrowserAdapter', options);\n};\n\nexport default detectAdapter;\n"],"names":["StorefrontResource","_Resource","_inherits","Resource","_super","_createSuper","_classCallCheck","apply","this","arguments","_createClass","key","value","adapter","_this$options","store","StorefrontStore","resource","onAfterFetch","syncAttributes","bind","actions","options","reviewActions","StoreActions","count","storeId","length","undefined","params","get","concat","namespace","Review","attributes","call","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isEmpty","obj","none","size","objectType","_typeof","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","_this","id","then","reviews","Collection","map","Category","category","products","customerActions","login","identity","password","test","isPhone","post","phone","Error","_objectSpread","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","_getOrderHistory","_getSavedPlaces","_performAuthorizedRequest","_syncDevice","_asyncToGenerator","_regeneratorRuntime","mark","_callee","token","wrap","_context","prev","next","abrupt","setHeaders","stop","_x","_callee2","endpoint","method","headers","response","_args2","_context2","toLowerCase","sent","t0","console","error","_x2","_callee3","places","_this2","_context3","performAuthorizedRequest","Place","_callee4","orders","_this3","_args4","_context4","Order","isArray","Array","cartActions","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","PaymentGateway","type","toDate","argument","argStr","Object","prototype","toString","Date","constructor","NaN","constructFrom","date","addDays","_date","isNaN","setDate","getDate","millisecondsInWeek","millisecondsInDay","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","locale","day","getDay","diff","setHours","startOfISOWeek","getISOWeekYear","year","getFullYear","fourthOfJanuaryOfNextYear","setFullYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTime","startOfDay","getTimezoneOffsetInMilliseconds","utcDate","UTC","getMonth","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isValid","Number","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","buildFormatLongFn","args","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","valuesArray","context","formattingValues","defaultFormattingWidth","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","array","predicate","pattern","object","hasOwnProperty","findKey","valueCallback","rest","slice","enUS","formatDistance","result","tokenValue","replace","addSuffix","comparison","formatRelative","_baseDate","_options","localize","ordinalNumber","dirtyNumber","number","rem100","era","narrow","abbreviated","wide","quarter","month","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","firstWeekContainsDate","getDayOfYear","dateLeft","dateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","Math","round","differenceInCalendarDays","cleanDate","startOfYear","getISOWeek","fourthOfJanuary","startOfISOWeekYear","getWeekYear","firstWeekOfNextYear","firstWeekOfThisYear","getWeek","firstWeek","startOfWeekYear","addLeadingZeros","targetLength","abs","padStart","lightFormatters","y","signedYear","M","d","a","dayPeriodEnumValue","toUpperCase","h","H","m","s","S","numberOfDigits","milliseconds","floor","pow","dayPeriodEnum","formatters","G","unit","Y","signedWeekYear","weekYear","R","u","Q","ceil","q","L","w","week","I","isoWeek","D","dayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","b","hours","B","K","k","X","_localize","timezoneOffset","_originalDate","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","originalDate","T","offset","delimiter","sign","absOffset","minutes","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeLongFormatter","datePattern","timePattern","dateTimeFormat","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","indexOf","isProtectedWeekYearToken","throwProtectedError","input","RangeError","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","defaultLocale","formatterOptions","substring","firstCharacter","longFormatter","join","matched","cleanEscapedString","formatter","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","Setter","subPriority","validate","_utcDate","ValueSetter","validateValue","setValue","priority","super","set","flags","DateToSystemTimezoneSetter","timestampIsSet","fromDate","transpose","Parser","run","dateString","parse","setter","_value","numericPatterns","timezonePatterns","mapValue","parseFnResult","mapFn","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","isLeapYearIndex","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","setDay","currentDay","delta","setISODay","getISODay","parsers","incompatibleTokens","isTwoDigitYear","normalizedTwoDigitYear","_flags","firstWeekOfYear","setMonth","setWeek","setISOWeek","isLeapYear","subpriority","wholeWeekDays","isPM","setMinutes","setSeconds","setMilliseconds","notWhitespaceRegExp","dateStr","referenceDate","assign","getInternalDefaultOptions","subFnOptions","setters","tokens","usedTokens","parser","incompatibleToken","find","usedToken","includes","fullToken","push","uniquePrioritySetters","sort","filter","setterArray","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","Store","storeLocations","place","_this4","gateways","_this5","Network","_getPaymentGateways","_getStoreLocations","_getStores","_getResourceCollection","ResourceClass","resources","_args","getResourceCollection","_args3","DeliveryServiceQuote","_ServiceQuote","ServiceQuote","_getFromCart","_fetchServiceQuotesFromCart","Adapter","_possibleConstructorReturn","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","_x3","quote","fetchServiceQuotesFromCart","_x4","_x5","_x6","_x7","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","_this$store","_this$store2","adapters","BrowserAdapter","NodeAdapter","Resolver","lookup","className","pluralize","singularize","_construct","_toConsumableArray","_Store","extendStoreActions","json","classify","Storefront","storeKey","debug","version","host","publicKey","startsWith","isNodeEnvironment","detectAdapter","categories","extendActions","customers","checkout","product"],"mappings":"4hVACsC,IAEjBA,WAAkBC,GAAAC,EAAAF,EAASG,YAAT,IAAAC,EAAAC,EAAAL,GAAA,SAAAA,IAAA,OAAAM,OAAAN,GAAAI,EAAAG,MAAAC,KAAAC,UAAA,CAelC,OAfkCC,EAAAV,EAAA,CAAA,CAAAW,IAAA,aAAAC,MAOnC,SAAWC,GAAS,IAAAC,EAOhB,OANAN,KAAKK,QAAUA,EACfL,KAAKO,MAAQ,IAAIC,GAAgBR,KAAKS,SAAUJ,EAAS,CACrDK,aAAcV,KAAKW,eAAeC,KAAKZ,MACvCa,QAAqBP,QAAdA,EAAEN,KAAKc,eAALR,IAAYA,OAAZA,EAAAA,EAAcO,UAGpBb,IACX,KAACR,CAAA,ICfCuB,EAAgB,IAAIC,EAAAA,aAAa,CACnCC,MAAO,SAAUC,GAAuB,IAAdJ,EAAOb,UAAAkB,OAAA,QAAAC,IAAAnB,UAAA,GAAAA,UAAA,GAAG,CAAA,EAC1BoB,EAAS,CAAA,EAMf,OAJIH,IACAG,EAAOd,MAAQW,GAGZlB,KAAKK,QAAQiB,IAAGC,GAAAA,OAAIvB,KAAKwB,UAAS,UAAUH,EAAQP,EAC/D,IAGiBW,WAAMhC,GAAAC,EAAA+B,EAAS9B,GAAT,IAAAC,EAAAC,EAAA4B,GACvB,SAAAA,IAAo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,EAAA,CAAIwD,MAAAA,GAAU7G,IAAWqC,MAAK,SAACM,GAC3D,OAAO,IAAIJ,EAAAA,WAAWI,EAASH,KAAI,SAACiiB,GAAO,OAAK,IAAI7iB,EAAQ6iB,EAAQ,IACxE,GACJ,GAAC,CAAAplB,IAAA,aAAAC,MAMD,SAAWC,GACPL,KAAKK,QAAUA,CACnB,GAAC,CAAAF,IAAA,aAAAC,MAED,WACI,OAAOJ,KAAKK,OAChB,IAAC,CAAA,CAAAF,IAAA,cAAAC,MAVD,WACI,OAAAgkB,EAAWM,EAAUld,MAAA4B,UAAA4G,MAAArO,KAAI1B,WAC7B,KAACykB,CAAA,CA/C0B","x_google_ignoreList":[11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90]} \ No newline at end of file +{"version":3,"file":"storefront.js","sources":["../../src/resource.js","../../src/resources/review.js","../../src/utils/format-currency.js","../../src/utils/is-key-valid.js","../../src/utils/is-empty.js","../../src/resources/product.js","../../src/resources/category.js","../../src/resources/customer.js","../../src/utils/is-phone.js","../../src/resources/cart.js","../../src/resources/payment-gateway.js","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/toDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constructFrom.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/addDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/defaultOptions.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isValid.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/match.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDayOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/differenceInCalendarDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/addLeadingZeros.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/lightFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/formatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/longFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/protectedTokens.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/format.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Setter.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/transpose.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/utils.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DateParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/EraParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDefaultOptions.mjs","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/store.js","../../src/resources/network.js","../../src/resources/delivery-service-quote.js","../../src/resources/checkout.js","../../src/resolver.js","../../src/store.js","../../src/storefront.js","../../src/utils/detect-adapter.js"],"sourcesContent":["import { Resource } from '@fleetbase/sdk';\nimport StorefrontStore from './store';\n\nexport default class StorefrontResource extends Resource {\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n}\n","import Resource from '../resource';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst reviewActions = new StoreActions({\n count: function (storeId, options = {}) {\n const params = {};\n\n if (storeId) {\n params.store = storeId;\n }\n\n return this.adapter.get(`${this.namespace}/count`, params, options);\n },\n});\n\nexport default class Review extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'review', options);\n }\n\n getMedia() {\n // @todo\n }\n\n getPhotos() {\n // @todo\n }\n\n getVideos() {\n // @todo\n }\n}\n\nexport { reviewActions };\n","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n currencyDisplay,\n }).format(amount);\n}\n","const isKeyValid = (key) => {\n return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_'));\n};\n\nexport default isKeyValid;\n","const isEmpty = (obj) => {\n const none = obj === null || obj === undefined;\n if (none) {\n return none;\n }\n\n if (typeof obj.size === 'number') {\n return !obj.size;\n }\n\n const objectType = typeof obj;\n\n if (objectType === 'object') {\n const { size } = obj;\n if (typeof size === 'number') {\n return !size;\n }\n }\n\n if (typeof obj.length === 'number' && objectType !== 'function') {\n return !obj.length;\n }\n\n if (objectType === 'object') {\n const { length } = obj;\n if (typeof length === 'number') {\n return !length;\n }\n }\n\n return false;\n};\n\nexport default isEmpty;\n","import Resource from '../resource';\nimport Review from './review';\nimport { formatCurrency, isEmpty } from '../utils';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Product extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'product', options);\n }\n\n variants() {\n return this.getAttribute('variants');\n }\n\n addons() {\n return this.getAttribute('addon_categories');\n }\n\n get isOnSale() {\n return this.getAttribute('is_on_sale');\n }\n\n get isNotOnSale() {\n return !this.getAttribute('is_on_sale');\n }\n\n get formattedAmount() {\n const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']);\n\n if (this.isOnSale) {\n if (isEmpty(sale_price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(sale_price / 100, currency);\n }\n\n if (isEmpty(price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(price / 100, currency);\n }\n\n getReviews() {\n return this.adapter.get('reviews', { store: this.id }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n}\n","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Category extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'category', options);\n }\n\n getProducts() {\n return this.adapter.get('products', { category: this.id }).then((products) => {\n return new Collection(products.map((attributes) => new Product(attributes, this.adapter)));\n });\n }\n}\n","import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport StorefrontStore from '../store';\nimport { isPhone } from '../utils';\n\nconst customerActions = new StoreActions({\n // const { error } = await storefront.customers.login('+1 111-1111');\n login: function (identity, password = null, attributes = {}) {\n // handle phone number authentication\n if (isPhone(identity)) {\n return this.adapter.post('customers/login-with-sms', { phone: identity });\n }\n\n if (!password) {\n throw new Error('Login requires password!');\n }\n\n return this.adapter.post('customers/login', { identity, password, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n verifyCode: function (identity, code, attributes = {}) {\n return this.adapter.post('customers/verify-code', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n requestCreationCode(identity, mode = 'email') {\n return this.adapter.post('customers/request-creation-code', {\n identity,\n mode,\n });\n },\n\n create(identity, code, attributes = {}) {\n return this.adapter.post('customers', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id) {\n return this.findRecord(id);\n },\n});\n\nexport default class Customer extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'customer', {\n actions: customerActions,\n ...options,\n });\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get token() {\n return this.getAttribute('token');\n }\n\n async syncDevice(token) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/register-device', token)\n .then(() => {\n return this;\n });\n }\n\n async performAuthorizedRequest(endpoint, params = {}, method = 'GET') {\n try {\n const headers = { 'Customer-Token': this.token };\n const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params);\n return response;\n } catch (error) {\n console.error(`Error in ${method} request to ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getSavedPlaces() {\n try {\n const places = await this.performAuthorizedRequest('customers/places');\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve saved places');\n }\n }\n\n async getOrderHistory(params = {}) {\n try {\n const orders = await this.performAuthorizedRequest('customers/orders', params);\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve order history');\n }\n }\n}\n\nexport { customerActions };\n","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n};\n\nexport default isPhone;\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\n\nconst cartActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n add: function (id, productId, quantity = 1, data = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/${id}/${productId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n update: function (id, cartItemId, quantity, data = {}, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/${cartItemId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n remove: function (id, cartItemId, options = {}) {\n return this.adapter.delete(`${this.namespace}/${id}/${cartItemId}`, {}, options).then(this.afterFetch.bind(this));\n },\n\n empty: function (id, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/empty`, {}, options).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id = '') {\n return this.findRecord(id);\n },\n});\n\nexport default class Cart extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'cart', { actions: cartActions, ...options });\n }\n\n add(productId, quantity = 1, data = {}, options = {}) {\n if (productId instanceof Product) {\n productId = productId.id;\n }\n\n return this.store.add(this.id, productId, quantity, data, options);\n }\n\n update(cartItemId, quantity, data = {}, options = {}) {\n return this.store.update(this.id, cartItemId, quantity, data, options);\n }\n\n remove(cartItemId, options = {}) {\n return this.store.remove(this.id, cartItemId, options);\n }\n\n empty(options = {}) {\n return this.store.empty(this.id, options);\n }\n\n delete() {\n return this.destroy();\n }\n\n refresh() {\n return this.store.retrieve(this.id);\n }\n\n subtotal() {\n let subtotal = 0;\n\n this.contents().forEach((cartItem) => {\n subtotal += cartItem.subtotal;\n });\n\n return subtotal;\n }\n\n contents() {\n return this.getAttribute('items', []);\n }\n\n hasProduct(productId) {\n return this.contents().findIndex((cartItem) => cartItem.product_id === productId) !== -1;\n }\n\n get isEmpty() {\n const contents = this.contents();\n\n if (!isArray(contents)) {\n return true;\n }\n\n return contents.length === 0;\n }\n\n get isNotEmpty() {\n return !this.isEmpty;\n }\n}\n\nexport { cartActions };\n","import Resource from '../resource';\n\nexport default class PaymentGateway extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'payment-gateway', options);\n }\n\n get type() {\n return this.getAttribute('type');\n }\n\n get code() {\n return this.getAttribute('code');\n }\n\n get isCashGateway() {\n return this.type === 'cash';\n }\n\n get isStripeGateway() {\n return this.type === 'stripe';\n }\n\n setCheckoutToken(token) {\n this.token = token;\n }\n\n getCheckoutToken() {\n return this.token;\n }\n\n // remove default resource methods\n findRecord() {\n throw new Error('There is no findRecord() method for payment gateways!');\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method for payment gateways!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method for payment gateways!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method for payment gateways!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method for payment gateways!');\n }\n}\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const utcDate = new Date(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}\n","import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n startOfDayRight.getTime() -\n getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff =\n startOfISOWeek(_date).getTime() - startOfISOWeekYear(_date).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff =\n startOfWeek(_date, options).getTime() -\n startOfWeekYear(_date, options).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.floor(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.floor(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const protectedDayOfYearTokens = [\"D\", \"DD\"];\nconst protectedWeekYearTokens = [\"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\n\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\n\nexport function throwProtectedError(token, format, input) {\n if (token === \"YYYY\") {\n throw new RangeError(\n `Use \\`yyyy\\` instead of \\`YYYY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"YY\") {\n throw new RangeError(\n `Use \\`yy\\` instead of \\`YY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"D\") {\n throw new RangeError(\n `Use \\`d\\` instead of \\`D\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"DD\") {\n throw new RangeError(\n `Use \\`dd\\` instead of \\`DD\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n }\n}\n","import { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate,\n };\n\n const result = formatStr\n .match(longFormattingTokensRegExp)\n .map(function (substring) {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n const formatter = formatters[firstCharacter];\n if (formatter) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n return formatter(\n originalDate,\n substring,\n locale.localize,\n formatterOptions,\n );\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return substring;\n })\n .join(\"\");\n\n return result;\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { transpose } from \"../../transpose.mjs\";\nimport { constructFrom } from \"../../constructFrom.mjs\";\n\nconst TIMEZONE_UNIT_PRIORITY = 10;\n\nexport class Setter {\n subPriority = 0;\n\n validate(_utcDate, _options) {\n return true;\n }\n}\n\nexport class ValueSetter extends Setter {\n constructor(\n value,\n\n validateValue,\n\n setValue,\n\n priority,\n subPriority,\n ) {\n super();\n this.value = value;\n this.validateValue = validateValue;\n this.setValue = setValue;\n this.priority = priority;\n if (subPriority) {\n this.subPriority = subPriority;\n }\n }\n\n validate(date, options) {\n return this.validateValue(date, this.value, options);\n }\n\n set(date, flags, options) {\n return this.setValue(date, flags, this.value, options);\n }\n}\n\nexport class DateToSystemTimezoneSetter extends Setter {\n priority = TIMEZONE_UNIT_PRIORITY;\n subPriority = -1;\n set(date, flags) {\n if (flags.timestampIsSet) return date;\n return constructFrom(date, transpose(date, Date));\n }\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name transpose\n * @category Generic Helpers\n * @summary Transpose the date to the given constructor.\n *\n * @description\n * The function transposes the date to the given constructor. It helps you\n * to transpose the date in the system time zone to say `UTCDate` or any other\n * date extension.\n *\n * @typeParam DateInputType - The input `Date` type derived from the passed argument.\n * @typeParam DateOutputType - The output `Date` type derived from the passed constructor.\n *\n * @param fromDate - The date to use values from\n * @param constructor - The date constructor to use\n *\n * @returns Date transposed to the given constructor\n *\n * @example\n * // Create July 10, 2022 00:00 in locale time zone\n * const date = new Date(2022, 6, 10)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'\n *\n * @example\n * // Transpose the date to July 10, 2022 00:00 in UTC\n * transpose(date, UTCDate)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'\n */\nexport function transpose(fromDate, constructor) {\n const date =\n constructor instanceof Date\n ? constructFrom(constructor, 0)\n : new constructor(0);\n date.setFullYear(\n fromDate.getFullYear(),\n fromDate.getMonth(),\n fromDate.getDate(),\n );\n date.setHours(\n fromDate.getHours(),\n fromDate.getMinutes(),\n fromDate.getSeconds(),\n fromDate.getMilliseconds(),\n );\n return date;\n}\n\n// Fallback for modularized imports:\nexport default transpose;\n","import { ValueSetter } from \"./Setter.mjs\";\n\nexport class Parser {\n run(dateString, token, match, options) {\n const result = this.parse(dateString, token, match, options);\n if (!result) {\n return null;\n }\n\n return {\n setter: new ValueSetter(\n result.value,\n this.validate,\n this.set,\n this.priority,\n this.subPriority,\n ),\n rest: result.rest,\n };\n }\n\n validate(_utcDate, _value, _options) {\n return true;\n }\n}\n","export const numericPatterns = {\n month: /^(1[0-2]|0?\\d)/, // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/, // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/, // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/, // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/, // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/, // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/, // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/, // 0 to 12\n minute: /^[0-5]?\\d/, // 0 to 59\n second: /^[0-5]?\\d/, // 0 to 59\n\n singleDigit: /^\\d/, // 0 to 9\n twoDigits: /^\\d{1,2}/, // 0 to 99\n threeDigits: /^\\d{1,3}/, // 0 to 999\n fourDigits: /^\\d{1,4}/, // 0 to 9999\n\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/, // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/, // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/, // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/, // 0 to 9999, -0 to -9999\n};\n\nexport const timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/,\n};\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n millisecondsInSecond,\n} from \"../../constants.mjs\";\nimport { numericPatterns } from \"./constants.mjs\";\n\nexport function mapValue(parseFnResult, mapFn) {\n if (!parseFnResult) {\n return parseFnResult;\n }\n\n return {\n value: mapFn(parseFnResult.value),\n rest: parseFnResult.rest,\n };\n}\n\nexport function parseNumericPattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n return {\n value: parseInt(matchResult[0], 10),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseTimezonePattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n // Input is 'Z'\n if (matchResult[0] === \"Z\") {\n return {\n value: 0,\n rest: dateString.slice(1),\n };\n }\n\n const sign = matchResult[1] === \"+\" ? 1 : -1;\n const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n\n return {\n value:\n sign *\n (hours * millisecondsInHour +\n minutes * millisecondsInMinute +\n seconds * millisecondsInSecond),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseAnyDigitsSigned(dateString) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);\n}\n\nexport function parseNDigits(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function parseNDigitsSigned(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^-?\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function dayPeriodEnumToHours(dayPeriod) {\n switch (dayPeriod) {\n case \"morning\":\n return 4;\n case \"evening\":\n return 17;\n case \"pm\":\n case \"noon\":\n case \"afternoon\":\n return 12;\n case \"am\":\n case \"midnight\":\n case \"night\":\n default:\n return 0;\n }\n}\n\nexport function normalizeTwoDigitYear(twoDigitYear, currentYear) {\n const isCommonEra = currentYear > 0;\n // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n\n let result;\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n const rangeEnd = absCurrentYear + 50;\n const rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n const isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nexport function isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DAYS_IN_MONTH_LEAP_YEAR = [\n 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n];\n\n// Day of the month\nexport class DateParser extends Parser {\n priority = 90;\n subPriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"d\":\n return parseNumericPattern(numericPatterns.date, dateString);\n case \"do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n const month = date.getMonth();\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n }\n\n set(date, _flags, value) {\n date.setDate(value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { addDays } from \"./addDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link setDay} function options.\n */\n\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the week of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the day of the week set\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setDay(date, day, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const currentDay = _date.getDay();\n\n const remainder = day % 7;\n const dayIndex = (remainder + 7) % 7;\n\n const delta = 7 - weekStartsOn;\n const diff =\n day < 0 || day > 6\n ? day - ((currentDay + delta) % 7)\n : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setDay;\n","import { addDays } from \"./addDays.mjs\";\nimport { getISODay } from \"./getISODay.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the ISO week of the new date\n *\n * @returns The new date with the day of the ISO week set\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * const result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setISODay(date, day) {\n const _date = toDate(date);\n const currentDay = getISODay(_date);\n const diff = day - currentDay;\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setISODay;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * const result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nexport function getISODay(date) {\n const _date = toDate(date);\n let day = _date.getDay();\n\n if (day === 0) {\n day = 7;\n }\n\n return day;\n}\n\n// Fallback for modularized imports:\nexport default getISODay;\n","import { EraParser } from \"./parsers/EraParser.mjs\";\nimport { YearParser } from \"./parsers/YearParser.mjs\";\nimport { LocalWeekYearParser } from \"./parsers/LocalWeekYearParser.mjs\";\nimport { ISOWeekYearParser } from \"./parsers/ISOWeekYearParser.mjs\";\nimport { ExtendedYearParser } from \"./parsers/ExtendedYearParser.mjs\";\nimport { QuarterParser } from \"./parsers/QuarterParser.mjs\";\nimport { StandAloneQuarterParser } from \"./parsers/StandAloneQuarterParser.mjs\";\nimport { MonthParser } from \"./parsers/MonthParser.mjs\";\nimport { StandAloneMonthParser } from \"./parsers/StandAloneMonthParser.mjs\";\nimport { LocalWeekParser } from \"./parsers/LocalWeekParser.mjs\";\nimport { ISOWeekParser } from \"./parsers/ISOWeekParser.mjs\";\nimport { DateParser } from \"./parsers/DateParser.mjs\";\nimport { DayOfYearParser } from \"./parsers/DayOfYearParser.mjs\";\nimport { DayParser } from \"./parsers/DayParser.mjs\";\nimport { LocalDayParser } from \"./parsers/LocalDayParser.mjs\";\nimport { StandAloneLocalDayParser } from \"./parsers/StandAloneLocalDayParser.mjs\";\nimport { ISODayParser } from \"./parsers/ISODayParser.mjs\";\nimport { AMPMParser } from \"./parsers/AMPMParser.mjs\";\nimport { AMPMMidnightParser } from \"./parsers/AMPMMidnightParser.mjs\";\nimport { DayPeriodParser } from \"./parsers/DayPeriodParser.mjs\";\nimport { Hour1to12Parser } from \"./parsers/Hour1to12Parser.mjs\";\nimport { Hour0to23Parser } from \"./parsers/Hour0to23Parser.mjs\";\nimport { Hour0To11Parser } from \"./parsers/Hour0To11Parser.mjs\";\nimport { Hour1To24Parser } from \"./parsers/Hour1To24Parser.mjs\";\nimport { MinuteParser } from \"./parsers/MinuteParser.mjs\";\nimport { SecondParser } from \"./parsers/SecondParser.mjs\";\nimport { FractionOfSecondParser } from \"./parsers/FractionOfSecondParser.mjs\";\nimport { ISOTimezoneWithZParser } from \"./parsers/ISOTimezoneWithZParser.mjs\";\nimport { ISOTimezoneParser } from \"./parsers/ISOTimezoneParser.mjs\";\nimport { TimestampSecondsParser } from \"./parsers/TimestampSecondsParser.mjs\";\nimport { TimestampMillisecondsParser } from \"./parsers/TimestampMillisecondsParser.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- It's ok, we want any here\nexport const parsers = {\n G: new EraParser(),\n y: new YearParser(),\n Y: new LocalWeekYearParser(),\n R: new ISOWeekYearParser(),\n u: new ExtendedYearParser(),\n Q: new QuarterParser(),\n q: new StandAloneQuarterParser(),\n M: new MonthParser(),\n L: new StandAloneMonthParser(),\n w: new LocalWeekParser(),\n I: new ISOWeekParser(),\n d: new DateParser(),\n D: new DayOfYearParser(),\n E: new DayParser(),\n e: new LocalDayParser(),\n c: new StandAloneLocalDayParser(),\n i: new ISODayParser(),\n a: new AMPMParser(),\n b: new AMPMMidnightParser(),\n B: new DayPeriodParser(),\n h: new Hour1to12Parser(),\n H: new Hour0to23Parser(),\n K: new Hour0To11Parser(),\n k: new Hour1To24Parser(),\n m: new MinuteParser(),\n s: new SecondParser(),\n S: new FractionOfSecondParser(),\n X: new ISOTimezoneWithZParser(),\n x: new ISOTimezoneParser(),\n t: new TimestampSecondsParser(),\n T: new TimestampMillisecondsParser(),\n};\n","import { Parser } from \"../Parser.mjs\";\n\nexport class EraParser extends Parser {\n priority = 140;\n\n parse(dateString, token, match) {\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return (\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n\n // A, B\n case \"GGGGG\":\n return match.era(dateString, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return (\n match.era(dateString, { width: \"wide\" }) ||\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n }\n }\n\n set(date, flags, value) {\n flags.era = value;\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"R\", \"u\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n// | Year | y | yy | yyy | yyyy | yyyyy |\n// |----------|-------|----|-------|-------|-------|\n// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\nexport class YearParser extends Parser {\n priority = 130;\n incompatibleTokens = [\"Y\", \"R\", \"u\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"yy\",\n });\n\n switch (token) {\n case \"y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value) {\n const currentYear = date.getFullYear();\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(normalizedTwoDigitYear, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { getWeekYear } from \"../../../getWeekYear.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// Local week-numbering year\nexport class LocalWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"YY\",\n });\n\n switch (token) {\n case \"Y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"Yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value, options) {\n const currentYear = getWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(\n normalizedTwoDigitYear,\n 0,\n options.firstWeekContainsDate,\n );\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\n// ISO week-numbering year\nexport class ISOWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"R\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n const firstWeekOfYear = constructFrom(date, 0);\n firstWeekOfYear.setFullYear(value, 0, 4);\n firstWeekOfYear.setHours(0, 0, 0, 0);\n return startOfISOWeek(firstWeekOfYear);\n }\n\n incompatibleTokens = [\n \"G\",\n \"y\",\n \"Y\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\nexport class ExtendedYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"u\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"G\", \"y\", \"Y\", \"R\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class QuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n case \"QQ\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class StandAloneQuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n case \"qq\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MonthParser extends Parser {\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"L\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"M\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"MM\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // J, F, ..., D\n case \"MMMMM\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class StandAloneMonthParser extends Parser {\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"LL\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // J, F, ..., D\n case \"LLLLL\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setWeek } from \"../../../setWeek.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// Local week of year\nexport class LocalWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"w\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"wo\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value, options) {\n return startOfWeek(setWeek(date, value, options), options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { getWeek } from \"./getWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link setWeek} function options.\n */\n\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the local week set\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * const result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * const result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\nexport function setWeek(date, week, options) {\n const _date = toDate(date);\n const diff = getWeek(_date, options) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setWeek;\n","import { setISOWeek } from \"../../../setISOWeek.mjs\";\nimport { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// ISO week of year\nexport class ISOWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"I\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"Io\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value) {\n return startOfISOWeek(setISOWeek(date, value));\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { getISOWeek } from \"./getISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The ISO week of the new date\n *\n * @returns The new date with the ISO week set\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * const result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nexport function setISOWeek(date, week) {\n const _date = toDate(date);\n const diff = getISOWeek(_date) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setISOWeek;\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nexport class DayOfYearParser extends Parser {\n priority = 90;\n\n subpriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"D\":\n case \"DD\":\n return parseNumericPattern(numericPatterns.dayOfYear, dateString);\n case \"Do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n }\n\n set(date, _flags, value) {\n date.setMonth(0, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"E\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\n\n// Day of week\nexport class DayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"EEEEE\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"EEEE\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"D\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Local day of week\nexport class LocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"e\":\n case \"ee\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"eo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"eee\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"eeeee\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"eeee\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Stand-alone local day of week\nexport class StandAloneLocalDayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"c\":\n case \"cc\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"co\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"ccc\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // T\n case \"ccccc\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return (\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // Tuesday\n case \"cccc\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"e\",\n \"t\",\n \"T\",\n ];\n}\n","import { setISODay } from \"../../../setISODay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// ISO day of week\nexport class ISODayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => {\n if (value === 0) {\n return 7;\n }\n return value;\n };\n\n switch (token) {\n // 2\n case \"i\":\n case \"ii\": // 02\n return parseNDigits(token.length, dateString);\n // 2nd\n case \"io\":\n return match.ordinalNumber(dateString, { unit: \"day\" });\n // Tue\n case \"iii\":\n return mapValue(\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // T\n case \"iiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tu\n case \"iiiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tuesday\n case \"iiii\":\n default:\n return mapValue(\n match.day(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 7;\n }\n\n set(date, _flags, value) {\n date = setISODay(date, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"E\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"a\":\n case \"aa\":\n case \"aaa\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"aaaaa\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"b\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMMidnightParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"b\":\n case \"bb\":\n case \"bbb\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"bbbbb\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\n// in the morning, in the afternoon, in the evening, at night\nexport class DayPeriodParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"BBBBB\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1to12Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"h\":\n return parseNumericPattern(numericPatterns.hour12h, dateString);\n case \"ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 12;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setHours(0, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"H\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0to23Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"H\":\n return parseNumericPattern(numericPatterns.hour23h, dateString);\n case \"Ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 23;\n }\n\n set(date, _flags, value) {\n date.setHours(value, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0To11Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"K\":\n return parseNumericPattern(numericPatterns.hour11h, dateString);\n case \"Ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"h\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1To24Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"k\":\n return parseNumericPattern(numericPatterns.hour24h, dateString);\n case \"ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 24;\n }\n\n set(date, _flags, value) {\n const hours = value <= 24 ? value % 24 : value;\n date.setHours(hours, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"H\", \"K\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MinuteParser extends Parser {\n priority = 60;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"m\":\n return parseNumericPattern(numericPatterns.minute, dateString);\n case \"mo\":\n return match.ordinalNumber(dateString, { unit: \"minute\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setMinutes(value, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class SecondParser extends Parser {\n priority = 50;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"s\":\n return parseNumericPattern(numericPatterns.second, dateString);\n case \"so\":\n return match.ordinalNumber(dateString, { unit: \"second\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setSeconds(value, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\nexport class FractionOfSecondParser extends Parser {\n priority = 30;\n\n parse(dateString, token) {\n const valueCallback = (value) =>\n Math.floor(value * Math.pow(10, -token.length + 3));\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n\n set(date, _flags, value) {\n date.setMilliseconds(value);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601. +00:00 is `'Z'`)\nexport class ISOTimezoneWithZParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"X\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"XX\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"XXXX\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"XXXXX\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"XXX\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"x\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601)\nexport class ISOTimezoneParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"x\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"xx\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"xxxx\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"xxxxx\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"xxx\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"X\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampSecondsParser extends Parser {\n priority = 40;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value * 1000), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampMillisecondsParser extends Parser {\n priority = 20;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getDefaultOptions } from \"./getDefaultOptions.mjs\";\nimport { enUS as defaultLocale } from \"./locale/en-US.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { parsers } from \"./parse/_lib/parsers.mjs\";\nimport { DateToSystemTimezoneSetter } from \"./parse/_lib/Setter.mjs\";\n\n/**\n * The {@link parse} function options.\n */\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\n\nconst notWhitespaceRegExp = /\\S/;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)\n * and [setWeekYear](https://date-fns.org/docs/setWeekYear)).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateStr - The string to parse\n * @param formatStr - The string of tokens\n * @param referenceDate - defines values missing from the parsed dateString\n * @param options - An object with options.\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @returns The parsed date\n *\n * @throws `options.locale` must contain `match` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\nexport function parse(dateStr, formatStr, referenceDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n if (formatStr === \"\") {\n if (dateStr === \"\") {\n return toDate(referenceDate);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n\n const subFnOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n // If timezone isn't specified, it will be set to the system timezone\n const setters = [new DateToSystemTimezoneSetter()];\n\n const tokens = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter in longFormatters) {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp);\n\n const usedTokens = [];\n\n for (let token of tokens) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n\n const firstCharacter = token[0];\n const parser = parsers[firstCharacter];\n if (parser) {\n const { incompatibleTokens } = parser;\n if (Array.isArray(incompatibleTokens)) {\n const incompatibleToken = usedTokens.find(\n (usedToken) =>\n incompatibleTokens.includes(usedToken.token) ||\n usedToken.token === firstCharacter,\n );\n if (incompatibleToken) {\n throw new RangeError(\n `The format string mustn't contain \\`${incompatibleToken.fullToken}\\` and \\`${token}\\` at the same time`,\n );\n }\n } else if (parser.incompatibleTokens === \"*\" && usedTokens.length > 0) {\n throw new RangeError(\n `The format string mustn't contain \\`${token}\\` and any other token at the same time`,\n );\n }\n\n usedTokens.push({ token: firstCharacter, fullToken: token });\n\n const parseResult = parser.run(\n dateStr,\n token,\n locale.match,\n subFnOptions,\n );\n\n if (!parseResult) {\n return constructFrom(referenceDate, NaN);\n }\n\n setters.push(parseResult.setter);\n\n dateStr = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n // Replace two single quote characters with one single quote character\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n }\n\n // Cut token from string, or, if string doesn't match the token, return Invalid Date\n if (dateStr.indexOf(token) === 0) {\n dateStr = dateStr.slice(token.length);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n }\n\n // Check if the remaining input contains something other than whitespace\n if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const uniquePrioritySetters = setters\n .map((setter) => setter.priority)\n .sort((a, b) => b - a)\n .filter((priority, index, array) => array.indexOf(priority) === index)\n .map((priority) =>\n setters\n .filter((setter) => setter.priority === priority)\n .sort((a, b) => b.subPriority - a.subPriority),\n )\n .map((setterArray) => setterArray[0]);\n\n let date = toDate(referenceDate);\n\n if (isNaN(date.getTime())) {\n return constructFrom(referenceDate, NaN);\n }\n\n const flags = {};\n for (const setter of uniquePrioritySetters) {\n if (!setter.validate(date, subFnOptions)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const result = setter.set(date, flags, subFnOptions);\n // Result is tuple (date, flags)\n if (Array.isArray(result)) {\n date = result[0];\n Object.assign(flags, result[1]);\n // Result is date\n } else {\n date = result;\n }\n }\n\n return constructFrom(referenceDate, date);\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default parse;\n","import { getDefaultOptions as getInternalDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * @name getDefaultOptions\n * @category Common Helpers\n * @summary Get default options.\n * @pure false\n *\n * @description\n * Returns an object that contains defaults for\n * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`\n * arguments for all functions.\n *\n * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).\n *\n * @returns The default options\n *\n * @example\n * const result = getDefaultOptions()\n * //=> {}\n *\n * @example\n * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })\n * const result = getDefaultOptions()\n * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }\n */\nexport function getDefaultOptions() {\n return Object.assign({}, getInternalDefaultOptions());\n}\n\n// Fallback for modularized imports:\nexport default getDefaultOptions;\n","import Resource from '../resource';\nimport { format, parse, isValid } from 'date-fns';\n\nexport default class StoreHour extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-hour', options);\n }\n\n get day() {\n return this.getAttribute('day');\n }\n\n get isClosed() {\n return this.getAttribute('start') === null && this.getAttribute('end') === null;\n }\n\n get is24Hours() {\n const start = this.startDateInstance;\n const end = this.endDateInstance;\n const diff = Math.abs(start - end);\n const hours = Math.floor(diff / 1000 / 60) / 60;\n\n return hours > 23;\n }\n\n get startDateInstance() {\n if (!this.hasAttribute('start')) {\n return null;\n }\n\n const start = this.getAttribute('start');\n const includesSeconds = start.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(start, format, new Date());\n }\n\n get endDateInstance() {\n if (!this.hasAttribute('end')) {\n return null;\n }\n\n const end = this.getAttribute('end');\n const includesSeconds = end.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(end, format, new Date());\n }\n\n get humanReadableHoursRange() {\n if (!isValid(this.startDateInstance) || !isValid(this.endDateInstance)) {\n return `${this.start} - ${this.end}`;\n }\n\n return `${format(this.startDateInstance, 'p')} - ${format(this.endDateInstance, 'p')}`;\n }\n\n get humanReadableHours() {\n if (this.isClosed) {\n return 'Closed';\n }\n\n if (this.is24Hours) {\n return '24 Hours';\n }\n\n return this.humanReadableHoursRange;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreHour from './store-hour';\nimport { Collection } from '@fleetbase/sdk';\nimport { format } from 'date-fns';\n\nexport default class StoreLocation extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-location', options);\n }\n\n get latitude() {\n return this.getAttribute('place.location.coordinates.1');\n }\n\n get longitude() {\n return this.getAttribute('place.location.coordinates.0');\n }\n\n get hours() {\n return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes)));\n }\n\n get isAlwaysOpen() {\n return this.hours.every((hour) => hour?.is24Hours);\n }\n\n get today() {\n const today = format(new Date(), 'EEEE');\n\n return this.schedule[today];\n }\n\n get schedule() {\n const schedule = {};\n const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\n for (let i = 0; i < week.length; i++) {\n const day = week[i];\n\n schedule[day] = new Collection();\n }\n\n for (let i = 0; i < this.hours.length; i++) {\n const hour = this.hours.objectAt(i);\n\n schedule[hour.day].pushObject(hour);\n }\n\n return schedule;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Review from './review';\nimport { Collection, Place } from '@fleetbase/sdk';\n\nexport default class Store extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store', options);\n }\n\n getReviews(params = {}) {\n return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n\n getLocations(params = {}) {\n return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {\n return new Collection(\n storeLocations.map((attributes) => {\n if (attributes.place) {\n attributes.place = new Place(attributes.place);\n }\n\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getLocation(id) {\n return this.adapter.get(`locations/${id}`, { store: this.id }).then((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n });\n }\n\n getPaymentGateways(params = {}) {\n return this.adapter.get('gateways', params).then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateway(id) {\n return this.adapter.get(`gateways/${id}`).then((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n });\n }\n}\n","import { Collection } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport PaymentGateway from './payment-gateway';\nimport Store from './store';\nimport StoreLocation from './store-location';\n\nexport default class Network extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'network', options);\n }\n\n getTags(params = {}) {\n return this.adapter.get('tags', params);\n }\n\n async getResourceCollection(endpoint, ResourceClass, params = {}) {\n try {\n const resources = await this.adapter.get(endpoint, params);\n return new Collection(resources.map((attributes) => new ResourceClass(attributes, this.adapter)));\n } catch (error) {\n console.error(`Error fetching ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getStores(params = {}) {\n return this.getResourceCollection('stores', Store, params);\n }\n\n async getStoreLocations(params = {}) {\n return this.getResourceCollection('store-locations', StoreLocation, params);\n }\n\n async getPaymentGateways() {\n return this.getResourceCollection('gateways', PaymentGateway);\n }\n}\n","import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk';\nimport StorefrontStore from '../store';\nimport { formatCurrency, isEmpty } from '../utils';\n\nconst { isArray } = Array;\n\nexport default class DeliveryServiceQuote extends ServiceQuote {\n constructor(attributes = {}, adapter, options = {}) {\n if (attributes instanceof Adapter) {\n return super({}, attributes, 'service-quote', options);\n }\n\n super(attributes, adapter, 'service-quote', options);\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get formattedAmount() {\n const { amount, currency } = this.getAttributes(['amount', 'currency']);\n\n if (isEmpty(amount) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(amount / 100, currency);\n }\n\n async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n if (destination?.id) {\n destination = destination.id;\n }\n if (cart?.id) {\n cart = cart.id;\n }\n\n try {\n const serviceQuotes = await this.adapter.get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n });\n\n if (isArray(serviceQuotes)) {\n return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter)));\n }\n\n return new DeliveryServiceQuote(serviceQuotes, this.adapter);\n } catch (error) {\n console.error('Error fetching service quotes:', error);\n throw error;\n }\n }\n\n static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) {\n const quote = new DeliveryServiceQuote(adapter);\n return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all);\n }\n}\n","import { Order, StoreActions, isResource } from '@fleetbase/sdk';\nimport Resource from '../resource';\n\nconst checkoutActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n initialize: function (customer, cart, serviceQuote, gateway, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n if (isResource(gateway)) {\n gateway = gateway.getAttribute('code');\n }\n\n return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options);\n },\n\n captureOrder: function (token, transactionDetails = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson));\n },\n});\n\nexport default class Checkout extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'checkout', options);\n }\n\n initialize() {\n return this.store.initialize(...arguments);\n }\n\n captureOrder() {\n return this.store.captureOrder(...arguments);\n }\n}\n\nexport { checkoutActions };\n","import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources';\nimport { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk';\n\nconst resources = {\n Product,\n Category,\n Customer,\n Cart,\n DeliveryServiceQuote,\n Store,\n StoreLocation,\n StoreHour,\n Checkout,\n Review,\n};\n\nconst adapters = {\n BrowserAdapter,\n NodeAdapter,\n};\n\nclass Resolver {\n constructor() {\n this.resources = resources;\n this.adapters = adapters;\n\n return this.lookup(...arguments);\n }\n\n lookup(type, className) {\n const key = pluralize(type);\n const params = [...arguments].slice(2);\n\n if (!this[key]) {\n throw new Error('Attempted to resolve invalid type');\n }\n\n if (!this[key][className]) {\n throw new Error(`No ${singularize(type)} named ${className} to resolve`);\n }\n\n return new this[key][className](...params);\n }\n}\n\nconst lookup = function () {\n return new Resolver(...arguments);\n};\n\nexport { Resolver, lookup };\n","import { Store, classify, extendStoreActions } from '@fleetbase/sdk';\nimport { lookup } from './resolver';\n\nexport default class StorefrontStore extends Store {\n constructor() {\n super(...arguments);\n }\n\n extendActions(actions = []) {\n return extendStoreActions(this, actions);\n }\n\n serialize(json) {\n return lookup('resource', classify(this.resource), json, this.adapter);\n }\n}\n","import StorefrontStore from './store';\nimport { detectAdapter, isKeyValid } from './utils';\nimport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network } from './resources';\nimport { cartActions } from './resources/cart';\nimport { customerActions } from './resources/customer';\nimport { checkoutActions } from './resources/checkout';\nimport { reviewActions } from './resources/review';\nimport { Collection } from '@fleetbase/sdk';\n\n/**\n * // instance\n * const storefront = new Storefront();\n *\n */\n\nexport default class Storefront {\n /**\n * Builds an instance of the Fleetbase Storefront SDK\n *\n * @param {String} storeKey The access key for the storefront store\n * @param {Object} config The config object\n * @param {Boolean} debug Enable debug mode\n * @return {Storefront} Instance\n */\n constructor(storeKey, config = {}, debug = false) {\n this.version = config.version || 'v1';\n this.options = {\n version: this.version,\n host: config.host || 'https://api.fleetbase.io',\n namespace: `storefront/${this.version}` || config.namespace,\n publicKey: storeKey,\n debug,\n };\n\n if (!isKeyValid(storeKey)) {\n throw new Error('⚠️ Invalid Storefront key given to Storefront SDK');\n }\n\n this.adapter = config.adapter || detectAdapter(this.options);\n\n this.products = new StorefrontStore('product', this.adapter);\n this.categories = new StorefrontStore('category', this.adapter);\n this.reviews = new StorefrontStore('review', this.adapter).extendActions(reviewActions);\n this.customers = new StorefrontStore('customer', this.adapter).extendActions(customerActions);\n this.cart = new StorefrontStore('cart', this.adapter).extendActions(cartActions);\n this.checkout = new StorefrontStore('checkout', this.adapter).extendActions(checkoutActions);\n }\n\n /** loads information about this storefront */\n about() {\n return this.adapter.get('about');\n }\n\n /** search products in store or network */\n search(query, options = {}) {\n return this.adapter.get('search', { query, ...options }).then((products) => {\n return new Collection(products.map((product) => new Product(product)));\n });\n }\n\n static newInstance() {\n return new Storefront(...arguments);\n }\n\n setAdapter(adapter) {\n this.adapter = adapter;\n }\n\n getAdapter() {\n return this.adapter;\n }\n}\n\nexport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network };\n","import { lookup } from '../resolver';\nimport { isNodeEnvironment } from '@fleetbase/sdk';\n\nconst detectAdapter = (options = {}) => {\n if (isNodeEnvironment()) {\n return lookup('adapter', 'NodeAdapter', options);\n }\n\n return lookup('adapter', 'BrowserAdapter', options);\n};\n\nexport default detectAdapter;\n"],"names":["StorefrontResource","_Resource","_inherits","Resource","_super","_createSuper","_classCallCheck","apply","this","arguments","_createClass","key","value","adapter","_this$options","store","StorefrontStore","resource","onAfterFetch","syncAttributes","bind","actions","options","reviewActions","StoreActions","count","storeId","length","undefined","params","get","concat","namespace","Review","attributes","call","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isEmpty","obj","none","size","objectType","_typeof","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","_this","id","then","reviews","Collection","map","Category","category","products","customerActions","login","identity","password","test","isPhone","post","phone","Error","_objectSpread","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","_getOrderHistory","_getSavedPlaces","_performAuthorizedRequest","_syncDevice","_asyncToGenerator","_regeneratorRuntime","mark","_callee","token","wrap","_context","prev","next","abrupt","setHeaders","stop","_x","_callee2","endpoint","method","headers","response","_args2","_context2","toLowerCase","sent","t0","console","error","_x2","_callee3","places","_this2","_context3","performAuthorizedRequest","Place","_callee4","orders","_this3","_args4","_context4","Order","isArray","Array","cartActions","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","PaymentGateway","type","toDate","argument","argStr","Object","prototype","toString","Date","constructor","NaN","constructFrom","date","addDays","_date","isNaN","setDate","getDate","millisecondsInWeek","millisecondsInDay","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","locale","day","getDay","diff","setHours","startOfISOWeek","getISOWeekYear","year","getFullYear","fourthOfJanuaryOfNextYear","setFullYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTime","startOfDay","getTimezoneOffsetInMilliseconds","utcDate","UTC","getMonth","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isValid","Number","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","buildFormatLongFn","args","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","valuesArray","context","formattingValues","defaultFormattingWidth","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","array","predicate","pattern","object","hasOwnProperty","findKey","valueCallback","rest","slice","enUS","formatDistance","result","tokenValue","replace","addSuffix","comparison","formatRelative","_baseDate","_options","localize","ordinalNumber","dirtyNumber","number","rem100","era","narrow","abbreviated","wide","quarter","month","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","firstWeekContainsDate","getDayOfYear","dateLeft","dateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","Math","round","differenceInCalendarDays","cleanDate","startOfYear","getISOWeek","fourthOfJanuary","startOfISOWeekYear","getWeekYear","firstWeekOfNextYear","firstWeekOfThisYear","getWeek","firstWeek","startOfWeekYear","addLeadingZeros","targetLength","abs","padStart","lightFormatters","y","signedYear","M","d","a","dayPeriodEnumValue","toUpperCase","h","H","m","s","S","numberOfDigits","milliseconds","floor","pow","dayPeriodEnum","formatters","G","unit","Y","signedWeekYear","weekYear","R","u","Q","ceil","q","L","w","week","I","isoWeek","D","dayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","b","hours","B","K","k","X","_localize","timezoneOffset","_originalDate","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","originalDate","T","offset","delimiter","sign","absOffset","minutes","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeLongFormatter","datePattern","timePattern","dateTimeFormat","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","indexOf","isProtectedWeekYearToken","throwProtectedError","input","RangeError","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","defaultLocale","formatterOptions","substring","firstCharacter","longFormatter","join","matched","cleanEscapedString","formatter","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","Setter","subPriority","validate","_utcDate","ValueSetter","validateValue","setValue","priority","super","set","flags","DateToSystemTimezoneSetter","timestampIsSet","fromDate","transpose","Parser","run","dateString","parse","setter","_value","numericPatterns","timezonePatterns","mapValue","parseFnResult","mapFn","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","isLeapYearIndex","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","setDay","currentDay","delta","setISODay","getISODay","parsers","incompatibleTokens","isTwoDigitYear","normalizedTwoDigitYear","_flags","firstWeekOfYear","setMonth","setWeek","setISOWeek","isLeapYear","subpriority","wholeWeekDays","isPM","setMinutes","setSeconds","setMilliseconds","notWhitespaceRegExp","dateStr","referenceDate","assign","getInternalDefaultOptions","subFnOptions","setters","tokens","usedTokens","parser","incompatibleToken","find","usedToken","includes","fullToken","push","uniquePrioritySetters","sort","filter","setterArray","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","Store","storeLocations","place","_this4","gateways","_this5","Network","_getPaymentGateways","_getStoreLocations","_getStores","_getResourceCollection","ResourceClass","resources","_args","getResourceCollection","_args3","DeliveryServiceQuote","_ServiceQuote","ServiceQuote","_getFromCart","_fetchServiceQuotesFromCart","Adapter","_possibleConstructorReturn","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","_x3","quote","fetchServiceQuotesFromCart","_x4","_x5","_x6","_x7","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","_this$store","_this$store2","adapters","BrowserAdapter","NodeAdapter","Resolver","lookup","className","pluralize","singularize","_construct","_toConsumableArray","_Store","extendStoreActions","json","classify","Storefront","storeKey","debug","version","host","publicKey","startsWith","isNodeEnvironment","detectAdapter","categories","extendActions","customers","checkout","product"],"mappings":"4hVACsC,IAEjBA,WAAkBC,GAAAC,EAAAF,EAASG,YAAT,IAAAC,EAAAC,EAAAL,GAAA,SAAAA,IAAA,OAAAM,OAAAN,GAAAI,EAAAG,MAAAC,KAAAC,UAAA,CAelC,OAfkCC,EAAAV,EAAA,CAAA,CAAAW,IAAA,aAAAC,MAOnC,SAAWC,GAAS,IAAAC,EAOhB,OANAN,KAAKK,QAAUA,EACfL,KAAKO,MAAQ,IAAIC,GAAgBR,KAAKS,SAAUJ,EAAS,CACrDK,aAAcV,KAAKW,e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IAAI7kB,GAAgB,WAAYR,KAAKK,SAAS+kB,cAAc1hB,GAC7E1D,KAAKiiB,KAAO,IAAIzhB,GAAgB,OAAQR,KAAKK,SAAS+kB,cAAc3d,GACpEzH,KAAKslB,SAAW,IAAI9kB,GAAgB,WAAYR,KAAKK,SAAS+kB,cAAcpC,GAChF,CAgBC,OAdD9iB,EAAAwkB,EAAA,CAAA,CAAAvkB,IAAA,QAAAC,MACA,WACI,OAAOJ,KAAKK,QAAQiB,IAAI,QAC5B,GAEA,CAAAnB,IAAA,SAAAC,MACA,SAAOuH,GAAqB,IAAd7G,EAAOb,UAAAkB,OAAA,QAAAC,IAAAnB,UAAA,GAAAA,UAAA,GAAG,CAAA,EACpB,OAAOD,KAAKK,QAAQiB,IAAI,SAAQ6C,EAAA,CAAIwD,MAAAA,GAAU7G,IAAWqC,MAAK,SAACM,GAC3D,OAAO,IAAIJ,EAAAA,WAAWI,EAASH,KAAI,SAACiiB,GAAO,OAAK,IAAI7iB,EAAQ6iB,EAAQ,IACxE,GACJ,GAAC,CAAAplB,IAAA,aAAAC,MAMD,SAAWC,GACPL,KAAKK,QAAUA,CACnB,GAAC,CAAAF,IAAA,aAAAC,MAED,WACI,OAAOJ,KAAKK,OAChB,IAAC,CAAA,CAAAF,IAAA,cAAAC,MAVD,WACI,OAAAgkB,EAAWM,EAAUld,MAAA4B,UAAA4G,MAAArO,KAAI1B,WAC7B,KAACykB,CAAA,CA/C0B","x_google_ignoreList":[11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90]} \ No newline at end of file diff --git a/dist/esm/storefront.js b/dist/esm/storefront.js index c8741de..744e115 100644 --- a/dist/esm/storefront.js +++ b/dist/esm/storefront.js @@ -1,2 +1,2 @@ -import{Resource as t,StoreActions as e,isNodeEnvironment as r,Collection as n,Place as a,Order as o,Adapter as i,ServiceQuote as s,isResource as u,pluralize as c,singularize as d,BrowserAdapter as h,NodeAdapter as l,extendStoreActions as f,classify as g,Store as p}from"@fleetbase/sdk";function m(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;A(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:H(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function v(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function k(t,e,r,n,a,o,i){try{var s=t[o](i),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,a)}function x(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){k(o,n,a,i,s,"next",t)}function s(t){k(o,n,a,i,s,"throw",t)}i(void 0)}))}}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{},r={};return t&&(r.store=t),this.adapter.get("".concat(this.namespace,"/count"),r,e)}}),F=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"review",a)}return D(r,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),r}();function W(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:r}).format(t)}var R=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var r=b(t);if("object"===r){var n=t.size;if("number"==typeof n)return!n}if("number"==typeof t.length&&"function"!==r)return!t.length;if("object"===r){var a=t.length;if("number"==typeof a)return!a}return!1},I=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"product",a)}return D(r,[{key:"variants",value:function(){return this.getAttribute("variants")}},{key:"addons",value:function(){return this.getAttribute("addon_categories")}},{key:"isOnSale",get:function(){return this.getAttribute("is_on_sale")}},{key:"isNotOnSale",get:function(){return!this.getAttribute("is_on_sale")}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["price","sale_price","currency"]),e=t.price,r=t.sale_price,n=t.currency;return this.isOnSale?R(r)||R(n)?null:W(r/100,n):R(e)||R(n)?null:W(e/100,n)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(e){return new n(e.map((function(e){return new F(e,t.adapter)})))}))}}]),r}(),Q=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"category",a)}return D(r,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(e){return new n(e.map((function(e){return new I(e,t.adapter)})))}))}}]),r}(),G=new e({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("customers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("customers/login",w({identity:t,password:e},r)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers/verify-code",w({identity:t,code:e},r)).then(this.afterFetch.bind(this))},requestCreationCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"email";return this.adapter.post("customers/request-creation-code",{identity:t,mode:e})},create:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers",w({identity:t,code:e},r)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),_=function(t){S(c,j);var e,r,i,s,u=Y(c);function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,c),u.call(this,t,e,"customer",w({actions:G},r))}return D(c,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ze(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"token",get:function(){return this.getAttribute("token")}},{key:"syncDevice",value:(s=x(y().mark((function t(e){var r=this;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",e).then((function(){return r})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"performAuthorizedRequest",value:(i=x(y().mark((function t(e){var r,n,a,o,i=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},n=i.length>2&&void 0!==i[2]?i[2]:"GET",t.prev=2,a={"Customer-Token":this.token},t.next=6,this.adapter.setHeaders(a)[n.toLowerCase()](e,r);case 6:return o=t.sent,t.abrupt("return",o);case 10:throw t.prev=10,t.t0=t.catch(2),console.error("Error in ".concat(n," request to ").concat(e,":"),t.t0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[2,10]])}))),function(t){return i.apply(this,arguments)})},{key:"getSavedPlaces",value:(r=x(y().mark((function t(){var e,r=this;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.performAuthorizedRequest("customers/places");case 3:return e=t.sent,t.abrupt("return",new n(e.map((function(t){return new a(t,r.adapter)}))));case 7:throw t.prev=7,t.t0=t.catch(0),new Error("Failed to retrieve saved places");case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(){return r.apply(this,arguments)})},{key:"getOrderHistory",value:(e=x(y().mark((function t(){var e,r,a=this,i=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},t.prev=1,t.next=4,this.performAuthorizedRequest("customers/orders",e);case 4:return r=t.sent,t.abrupt("return",new n(r.map((function(t){return new o(t,a.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),new Error("Failed to retrieve order history");case 11:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(){return e.apply(this,arguments)})}]),c}(),B=Array.isArray,z=new e({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,add:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),w(w({},n),{},{quantity:r}),a).then(this.afterFetch.bind(this))},update:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),w(w({},n),{},{quantity:r}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},r).then(this.afterFetch.bind(this))},empty:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/empty"),{},e).then(this.afterFetch.bind(this))},retrieve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.findRecord(t)}}),X=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"cart",w({actions:z},a))}return D(r,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof I&&(t=t.id),this.store.add(this.id,t,e,r,n)}},{key:"update",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,r,n)}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.remove(this.id,t,e)}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.empty(this.id,t)}},{key:"delete",value:function(){return this.destroy()}},{key:"refresh",value:function(){return this.store.retrieve(this.id)}},{key:"subtotal",value:function(){var t=0;return this.contents().forEach((function(e){t+=e.subtotal})),t}},{key:"contents",value:function(){return this.getAttribute("items",[])}},{key:"hasProduct",value:function(t){return-1!==this.contents().findIndex((function(e){return e.product_id===t}))}},{key:"isEmpty",get:function(){var t=this.contents();return!B(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),r}(),$=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"payment-gateway",a)}return D(r,[{key:"type",get:function(){return this.getAttribute("type")}},{key:"code",get:function(){return this.getAttribute("code")}},{key:"isCashGateway",get:function(){return"cash"===this.type}},{key:"isStripeGateway",get:function(){return"stripe"===this.type}},{key:"setCheckoutToken",value:function(t){this.token=t}},{key:"getCheckoutToken",value:function(){return this.token}},{key:"findRecord",value:function(){throw new Error("There is no findRecord() method for payment gateways!")}},{key:"create",value:function(){throw new Error("There is no create() method for payment gateways!")}},{key:"update",value:function(){throw new Error("There is no update() method for payment gateways!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method for payment gateways!")}},{key:"reload",value:function(){throw new Error("There is no reload() method for payment gateways!")}}]),r}();function K(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function U(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function J(t,e){const r=K(t);return isNaN(e)?U(t,NaN):e?(r.setDate(r.getDate()+e),r):r}const V=6048e5,Z=864e5;let tt={};function et(){return tt}function rt(t,e){const r=et(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=K(t),o=a.getDay(),i=(o=a.getTime()?r+1:e.getTime()>=i.getTime()?r:r-1}function ot(t){const e=K(t);return e.setHours(0,0,0,0),e}function it(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function st(t){if(!(e=t,e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)||"number"==typeof t))return!1;var e;const r=K(t);return!isNaN(Number(r))}const ut={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function ct(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const dt={date:ct({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:ct({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:ct({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ht={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function lt(t){return(e,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,a=r?.width?String(r.width):e;n=t.formattingValues[a]||t.formattingValues[e]}else{const e=t.defaultWidth,a=r?.width?String(r.width):t.defaultWidth;n=t.values[a]||t.values[e]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function ft(t){return(e,r={})=>{const n=r.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;const i=o[0],s=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let r=0;rt.test(i))):function(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=r.valueCallback?r.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var gt;const pt={code:"en-US",formatDistance:(t,e,r)=>{let n;const a=ut[t];return n="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:dt,formatRelative:(t,e,r,n)=>ht[t],localize:{ordinalNumber:(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:lt({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:lt({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:lt({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:lt({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:lt({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(gt={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const r=t.match(gt.matchPattern);if(!r)return null;const n=r[0],a=t.match(gt.parsePattern);if(!a)return null;let o=gt.valueCallback?gt.valueCallback(a[0]):a[0];return o=e.valueCallback?e.valueCallback(o):o,{value:o,rest:t.slice(n.length)}}),era:ft({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ft({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:ft({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ft({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ft({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function mt(t){const e=K(t),r=function(t,e){const r=ot(t),n=ot(e),a=r.getTime()-it(r),o=n.getTime()-it(n);return Math.round((a-o)/Z)}(e,function(t){const e=K(t),r=U(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}(e));return r+1}function wt(t){const e=K(t),r=nt(e).getTime()-function(t){const e=at(t),r=U(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),nt(r)}(e).getTime();return Math.round(r/V)+1}function yt(t,e){const r=K(t),n=r.getFullYear(),a=et(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=U(t,0);i.setFullYear(n+1,0,o),i.setHours(0,0,0,0);const s=rt(i,e),u=U(t,0);u.setFullYear(n,0,o),u.setHours(0,0,0,0);const c=rt(u,e);return r.getTime()>=s.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function vt(t,e){const r=K(t),n=rt(r,e).getTime()-function(t,e){const r=et(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=yt(t,e),o=U(t,0);return o.setFullYear(a,0,n),o.setHours(0,0,0,0),rt(o,e)}(r,e).getTime();return Math.round(n/V)+1}function bt(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const kt={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return bt("yy"===e?n%100:n,e.length)},M(t,e){const r=t.getMonth();return"M"===e?String(r+1):bt(r+1,2)},d:(t,e)=>bt(t.getDate(),e.length),a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(t,e)=>bt(t.getHours()%12||12,e.length),H:(t,e)=>bt(t.getHours(),e.length),m:(t,e)=>bt(t.getMinutes(),e.length),s:(t,e)=>bt(t.getSeconds(),e.length),S(t,e){const r=e.length,n=t.getMilliseconds();return bt(Math.floor(n*Math.pow(10,r-3)),e.length)}},xt="midnight",Tt="noon",Mt="morning",Dt="afternoon",Pt="evening",St="night",Et={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if("yo"===e){const e=t.getFullYear(),n=e>0?e:1-e;return r.ordinalNumber(n,{unit:"year"})}return kt.y(t,e)},Y:function(t,e,r,n){const a=yt(t,n),o=a>0?a:1-a;if("YY"===e){return bt(o%100,2)}return"Yo"===e?r.ordinalNumber(o,{unit:"year"}):bt(o,e.length)},R:function(t,e){return bt(at(t),e.length)},u:function(t,e){return bt(t.getFullYear(),e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return bt(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return bt(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return kt.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return bt(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const a=vt(t,n);return"wo"===e?r.ordinalNumber(a,{unit:"week"}):bt(a,e.length)},I:function(t,e,r){const n=wt(t);return"Io"===e?r.ordinalNumber(n,{unit:"week"}):bt(n,e.length)},d:function(t,e,r){return"do"===e?r.ordinalNumber(t.getDate(),{unit:"date"}):kt.d(t,e)},D:function(t,e,r){const n=mt(t);return"Do"===e?r.ordinalNumber(n,{unit:"dayOfYear"}):bt(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const a=t.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return bt(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const a=t.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return bt(o,e.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),a=0===n?7:n;switch(e){case"i":return String(a);case"ii":return bt(a,e.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let a;switch(a=12===n?Tt:0===n?xt:n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let a;switch(a=n>=17?Pt:n>=12?Dt:n>=4?Mt:St,e){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,r){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),r.ordinalNumber(e,{unit:"hour"})}return kt.h(t,e)},H:function(t,e,r){return"Ho"===e?r.ordinalNumber(t.getHours(),{unit:"hour"}):kt.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return"Ko"===e?r.ordinalNumber(n,{unit:"hour"}):bt(n,e.length)},k:function(t,e,r){let n=t.getHours();return 0===n&&(n=24),"ko"===e?r.ordinalNumber(n,{unit:"hour"}):bt(n,e.length)},m:function(t,e,r){return"mo"===e?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):kt.m(t,e)},s:function(t,e,r){return"so"===e?r.ordinalNumber(t.getSeconds(),{unit:"second"}):kt.s(t,e)},S:function(t,e){return kt.S(t,e)},X:function(t,e,r,n){const a=(n._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return At(a);case"XXXX":case"XX":return qt(a);default:return qt(a,":")}},x:function(t,e,r,n){const a=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return At(a);case"xxxx":case"xx":return qt(a);default:return qt(a,":")}},O:function(t,e,r,n){const a=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ot(a,":");default:return"GMT"+qt(a,":")}},z:function(t,e,r,n){const a=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ot(a,":");default:return"GMT"+qt(a,":")}},t:function(t,e,r,n){const a=n._originalDate||t;return bt(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,r,n){return bt((n._originalDate||t).getTime(),e.length)}};function Ot(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),a=Math.floor(n/60),o=n%60;return 0===o?r+String(a):r+String(a)+e+bt(o,2)}function At(t,e){if(t%60==0){return(t>0?"-":"+")+bt(Math.abs(t)/60,2)}return qt(t,e)}function qt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t);return r+bt(Math.floor(n/60),2)+e+bt(n%60,2)}const Ht=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Yt=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Nt={p:Yt,P:(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return Ht(t,e);let o;switch(n){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;default:o=e.dateTime({width:"full"})}return o.replace("{{date}}",Ht(n,e)).replace("{{time}}",Yt(a,e))}},Lt=["D","DD"],jt=["YY","YYYY"];function Ct(t){return-1!==Lt.indexOf(t)}function Ft(t){return-1!==jt.indexOf(t)}function Wt(t,e,r){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("YY"===t)throw new RangeError(`Use \`yy\` instead of \`YY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("D"===t)throw new RangeError(`Use \`d\` instead of \`D\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("DD"===t)throw new RangeError(`Use \`dd\` instead of \`DD\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const Rt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,It=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qt=/^'([^]*?)'?$/,Gt=/''/g,_t=/[a-zA-Z]/;function Bt(t,e,r){const n=et(),a=r?.locale??n.locale??pt,o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=K(t);if(!st(s))throw new RangeError("Invalid time value");const u={firstWeekContainsDate:o,weekStartsOn:i,locale:a,_originalDate:s};return e.match(It).map((function(t){const e=t[0];if("p"===e||"P"===e){return(0,Nt[e])(t,a.formatLong)}return t})).join("").match(Rt).map((function(n){if("''"===n)return"'";const o=n[0];if("'"===o)return function(t){const e=t.match(Qt);if(!e)return t;return e[1].replace(Gt,"'")}(n);const i=Et[o];if(i)return!r?.useAdditionalWeekYearTokens&&Ft(n)&&Wt(n,e,String(t)),!r?.useAdditionalDayOfYearTokens&&Ct(n)&&Wt(n,e,String(t)),i(s,n,a.localize,u);if(o.match(_t))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return n})).join("")}class zt{subPriority=0;validate(t,e){return!0}}class Xt extends zt{constructor(t,e,r,n,a){super(),this.value=t,this.validateValue=e,this.setValue=r,this.priority=n,a&&(this.subPriority=a)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,r){return this.setValue(t,e,this.value,r)}}class $t extends zt{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:U(t,function(t,e){const r=e instanceof Date?U(e,0):new e(0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}(t,Date))}}class Kt{run(t,e,r,n){const a=this.parse(t,e,r,n);return a?{setter:new Xt(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(t,e,r){return!0}}const Ut=/^(1[0-2]|0?\d)/,Jt=/^(3[0-1]|[0-2]?\d)/,Vt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Zt=/^(5[0-3]|[0-4]?\d)/,te=/^(2[0-3]|[0-1]?\d)/,ee=/^(2[0-4]|[0-1]?\d)/,re=/^(1[0-1]|0?\d)/,ne=/^(1[0-2]|0?\d)/,ae=/^[0-5]?\d/,oe=/^[0-5]?\d/,ie=/^\d/,se=/^\d{1,2}/,ue=/^\d{1,3}/,ce=/^\d{1,4}/,de=/^-?\d+/,he=/^-?\d/,le=/^-?\d{1,2}/,fe=/^-?\d{1,3}/,ge=/^-?\d{1,4}/,pe=/^([+-])(\d{2})(\d{2})?|Z/,me=/^([+-])(\d{2})(\d{2})|Z/,we=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ye=/^([+-])(\d{2}):(\d{2})|Z/,ve=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function be(t,e){return t?{value:e(t.value),rest:t.rest}:t}function ke(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function xe(t,e){const r=e.match(t);if(!r)return null;if("Z"===r[0])return{value:0,rest:e.slice(1)};return{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:e.slice(r[0].length)}}function Te(t){return ke(de,t)}function Me(t,e){switch(t){case 1:return ke(ie,e);case 2:return ke(se,e);case 3:return ke(ue,e);case 4:return ke(ce,e);default:return ke(new RegExp("^\\d{1,"+t+"}"),e)}}function De(t,e){switch(t){case 1:return ke(he,e);case 2:return ke(le,e);case 3:return ke(fe,e);case 4:return ke(ge,e);default:return ke(new RegExp("^-?\\d{1,"+t+"}"),e)}}function Pe(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Se(t,e){const r=e>0,n=r?e:1-e;let a;if(n<=50)a=t||100;else{const e=n+50;a=t+100*Math.floor(e/100)-(t>=e%100?100:0)}return r?a:1-a}function Ee(t){return t%400==0||t%4==0&&t%100!=0}const Oe=[31,28,31,30,31,30,31,31,30,31,30,31],Ae=[31,29,31,30,31,30,31,31,30,31,30,31];function qe(t,e,r){const n=et(),a=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=K(t),i=o.getDay(),s=7-a;return J(o,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function He(t,e){const r=K(t),n=function(t){let e=K(t).getDay();return 0===e&&(e=7),e}(r);return J(r,e-n)}const Ye={G:new class extends Kt{priority=140;parse(t,e,r){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,e,r){return e.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Kt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return be(Me(4,t),n);case"yo":return be(r.ordinalNumber(t,{unit:"year"}),n);default:return be(Me(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r){const n=t.getFullYear();if(r.isTwoDigitYear){const e=Se(r.year,n);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const a="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Kt{priority=130;parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return be(Me(4,t),n);case"Yo":return be(r.ordinalNumber(t,{unit:"year"}),n);default:return be(Me(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r,n){const a=yt(t,n);if(r.isTwoDigitYear){const e=Se(r.year,a);return t.setFullYear(e,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,n)}const o="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(o,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Kt{priority=130;parse(t,e){return De("R"===e?4:e.length,t)}set(t,e,r){const n=U(t,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),nt(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Kt{priority=130;parse(t,e){return De("u"===e?4:e.length,t)}set(t,e,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends Kt{priority=120;parse(t,e,r){switch(e){case"Q":case"QQ":return Me(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends Kt{priority=120;parse(t,e,r){switch(e){case"q":case"qq":return Me(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends Kt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"M":return be(ke(Ut,t),n);case"MM":return be(Me(2,t),n);case"Mo":return be(r.ordinalNumber(t,{unit:"month"}),n);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}},L:new class extends Kt{priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"L":return be(ke(Ut,t),n);case"LL":return be(Me(2,t),n);case"Lo":return be(r.ordinalNumber(t,{unit:"month"}),n);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends Kt{priority=100;parse(t,e,r){switch(e){case"w":return ke(Zt,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r,n){return rt(function(t,e,r){const n=K(t),a=vt(n,r)-e;return n.setDate(n.getDate()-7*a),n}(t,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Kt{priority=100;parse(t,e,r){switch(e){case"I":return ke(Zt,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r){return nt(function(t,e){const r=K(t),n=wt(r)-e;return r.setDate(r.getDate()-7*n),r}(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Kt{priority=90;subPriority=1;parse(t,e,r){switch(e){case"d":return ke(Jt,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return Me(e.length,t)}}validate(t,e){const r=Ee(t.getFullYear()),n=t.getMonth();return r?e>=1&&e<=Ae[n]:e>=1&&e<=Oe[n]}set(t,e,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Kt{priority=90;subpriority=1;parse(t,e,r){switch(e){case"D":case"DD":return ke(Vt,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return Me(e.length,t)}}validate(t,e){return Ee(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends Kt{priority=90;parse(t,e,r){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=qe(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Kt{priority=90;parse(t,e,r,n){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return be(Me(e.length,t),a);case"eo":return be(r.ordinalNumber(t,{unit:"day"}),a);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=qe(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends Kt{priority=90;parse(t,e,r,n){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return be(Me(e.length,t),a);case"co":return be(r.ordinalNumber(t,{unit:"day"}),a);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=qe(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends Kt{priority=90;parse(t,e,r){const n=t=>0===t?7:t;switch(e){case"i":case"ii":return Me(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return be(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiii":return be(r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiiii":return be(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);default:return be(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n)}}validate(t,e){return e>=1&&e<=7}set(t,e,r){return(t=He(t,r)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends Kt{priority=80;parse(t,e,r){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(Pe(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Kt{priority=80;parse(t,e,r){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(Pe(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Kt{priority=80;parse(t,e,r){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(Pe(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"h":return ke(ne,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,r){const n=t.getHours()>=12;return n&&r<12?t.setHours(r+12,0,0,0):n||12!==r?t.setHours(r,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"H":return ke(te,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"K":return ke(re,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"k":return ke(ee,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,r){const n=r<=24?r%24:r;return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Kt{priority=60;parse(t,e,r){switch(e){case"m":return ke(ae,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Kt{priority=50;parse(t,e,r){switch(e){case"s":return ke(oe,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]},S:new class extends Kt{priority=30;parse(t,e){return be(Me(e.length,t),(t=>Math.floor(t*Math.pow(10,3-e.length))))}set(t,e,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]},X:new class extends Kt{priority=10;parse(t,e){switch(e){case"X":return xe(pe,t);case"XX":return xe(me,t);case"XXXX":return xe(we,t);case"XXXXX":return xe(ve,t);default:return xe(ye,t)}}set(t,e,r){return e.timestampIsSet?t:U(t,t.getTime()-it(t)-r)}incompatibleTokens=["t","T","x"]},x:new class extends Kt{priority=10;parse(t,e){switch(e){case"x":return xe(pe,t);case"xx":return xe(me,t);case"xxxx":return xe(we,t);case"xxxxx":return xe(ve,t);default:return xe(ye,t)}}set(t,e,r){return e.timestampIsSet?t:U(t,t.getTime()-it(t)-r)}incompatibleTokens=["t","T","X"]},t:new class extends Kt{priority=40;parse(t){return Te(t)}set(t,e,r){return[U(t,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Kt{priority=20;parse(t){return Te(t)}set(t,e,r){return[U(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},Ne=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Le=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,je=/^'([^]*?)'?$/,Ce=/''/g,Fe=/\S/,We=/[a-zA-Z]/;function Re(t,e,r,n){const a=Object.assign({},et()),o=n?.locale??a.locale??pt,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(""===e)return""===t?K(r):U(r,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:o},c=[new $t],d=e.match(Le).map((t=>{const e=t[0];if(e in Nt){return(0,Nt[e])(t,o.formatLong)}return t})).join("").match(Ne),h=[];for(let a of d){!n?.useAdditionalWeekYearTokens&&Ft(a)&&Wt(a,e,t),!n?.useAdditionalDayOfYearTokens&&Ct(a)&&Wt(a,e,t);const i=a[0],s=Ye[i];if(s){const{incompatibleTokens:e}=s;if(Array.isArray(e)){const t=h.find((t=>e.includes(t.token)||t.token===i));if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${a}\` at the same time`)}else if("*"===s.incompatibleTokens&&h.length>0)throw new RangeError(`The format string mustn't contain \`${a}\` and any other token at the same time`);h.push({token:i,fullToken:a});const n=s.run(t,a,o.match,u);if(!n)return U(r,NaN);c.push(n.setter),t=n.rest}else{if(i.match(We))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");if("''"===a?a="'":"'"===i&&(a=a.match(je)[1].replace(Ce,"'")),0!==t.indexOf(a))return U(r,NaN);t=t.slice(a.length)}}if(t.length>0&&Fe.test(t))return U(r,NaN);const l=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,r)=>r.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=K(r);if(isNaN(f.getTime()))return U(r,NaN);const g={};for(const t of l){if(!t.validate(f,u))return U(r,NaN);const e=t.set(f,g,u);Array.isArray(e)?(f=e[0],Object.assign(g,e[1])):f=e}return U(r,f)}var Ie=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"store-hour",a)}return D(r,[{key:"day",get:function(){return this.getAttribute("day")}},{key:"isClosed",get:function(){return null===this.getAttribute("start")&&null===this.getAttribute("end")}},{key:"is24Hours",get:function(){var t=this.startDateInstance,e=this.endDateInstance,r=Math.abs(t-e);return Math.floor(r/1e3/60)/60>23}},{key:"startDateInstance",get:function(){if(!this.hasAttribute("start"))return null;var t=this.getAttribute("start"),e=3===t.split(":").length;return Re(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"endDateInstance",get:function(){if(!this.hasAttribute("end"))return null;var t=this.getAttribute("end"),e=3===t.split(":").length;return Re(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return st(this.startDateInstance)&&st(this.endDateInstance)?"".concat(Bt(this.startDateInstance,"p")," - ").concat(Bt(this.endDateInstance,"p")):"".concat(this.start," - ").concat(this.end)}},{key:"humanReadableHours",get:function(){return this.isClosed?"Closed":this.is24Hours?"24 Hours":this.humanReadableHoursRange}},{key:"create",value:function(){throw new Error("There is no create() method store location!")}},{key:"update",value:function(){throw new Error("There is no update() method store location!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method store location!")}},{key:"reload",value:function(){throw new Error("There is no reload() method store location!")}}]),r}(),Qe=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"store-location",a)}return D(r,[{key:"latitude",get:function(){return this.getAttribute("place.location.coordinates.1")}},{key:"longitude",get:function(){return this.getAttribute("place.location.coordinates.0")}},{key:"hours",get:function(){return new n(this.getAttribute("hours").map((function(t){return new Ie(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=Bt(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},e=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"store",a)}return D(r,[{key:"getReviews",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",w({store:this.id},e)).then((function(e){return new n(e.map((function(e){return new F(e,t.adapter)})))}))}},{key:"getLocations",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",w({store:this.id},e)).then((function(e){return new n(e.map((function(e){return e.place&&(e.place=new a(e.place)),new Qe(e,t.adapter)})))}))}},{key:"getLocation",value:function(t){var e=this;return this.adapter.get("locations/".concat(t),{store:this.id}).then((function(t){return new Qe(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",e).then((function(e){return new n(e.map((function(e){return new $(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new $(t,e.adapter)}))}}]),r}(),_e=function(t){S(s,j);var e,r,a,o,i=Y(s);function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,s),i.call(this,t,e,"network",r)}return D(s,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getResourceCollection",value:(o=x(y().mark((function t(e,r){var a,o,i=this,s=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=s.length>2&&void 0!==s[2]?s[2]:{},t.prev=1,t.next=4,this.adapter.get(e,a);case 4:return o=t.sent,t.abrupt("return",new n(o.map((function(t){return new r(t,i.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),console.error("Error fetching ".concat(e,":"),t.t0),t.t0;case 12:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(t,e){return o.apply(this,arguments)})},{key:"getStores",value:(a=x(y().mark((function t(){var e,r=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("stores",Ge,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"getStoreLocations",value:(r=x(y().mark((function t(){var e,r=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("store-locations",Qe,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"getPaymentGateways",value:(e=x(y().mark((function t(){return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.getResourceCollection("gateways",$));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),s}(),Be=Array.isArray,ze=function(t){S(o,s);var e,r,a=Y(o);function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,o),e instanceof i?H(t,t=a.call(this,{},e,"service-quote",n)):a.call(this,e,r,"service-quote",n)}return D(o,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ze(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["amount","currency"]),e=t.amount,r=t.currency;return R(e)||R(r)?null:W(e/100,r)}},{key:"fetchServiceQuotesFromCart",value:(r=x(y().mark((function t(e,r,a){var i,s,u,c,d,h,l=this,f=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=f.length>3&&void 0!==f[3]?f[3]:"storefront",d=f.length>4&&void 0!==f[4]&&f[4],null!==(i=e)&&void 0!==i&&i.id&&(e=e.id),null!==(s=r)&&void 0!==s&&s.id&&(r=r.id),null!==(u=a)&&void 0!==u&&u.id&&(a=a.id),t.prev=5,t.next=8,this.adapter.get("service-quotes/from-cart",{origin:e,destination:r,cart:a,config:c,all:d});case 8:if(h=t.sent,!Be(h)){t.next=11;break}return t.abrupt("return",new n(h.map((function(t){return new o(t,l.adapter)}))));case 11:return t.abrupt("return",new o(h,this.adapter));case 14:throw t.prev=14,t.t0=t.catch(5),console.error("Error fetching service quotes:",t.t0),t.t0;case 18:case"end":return t.stop()}}),t,this,[[5,14]])}))),function(t,e,n){return r.apply(this,arguments)})}],[{key:"getFromCart",value:(e=x(y().mark((function t(e,r,n,a){var i,s,u,c=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=c.length>4&&void 0!==c[4]?c[4]:"storefront",s=c.length>5&&void 0!==c[5]&&c[5],u=new o(e),t.abrupt("return",u.fetchServiceQuotesFromCart(r,n,a,i,s));case 4:case"end":return t.stop()}}),t)}))),function(t,r,n,a){return e.apply(this,arguments)})}]),o}(),Xe=new e({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,initialize:function(t,e,r,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return u(t)&&(t=t.id),u(e)&&(e=e.id),u(r)&&(r=r.id),u(n)&&(n=n.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),w(w({},a),{},{customer:t,cart:e,serviceQuote:r,gateway:n}),o)},captureOrder:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("".concat(this.namespace,"/capture"),{token:t,transactionDetails:e},r).then((function(t){return new o(t)}))}}),$e=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"checkout",a)}return D(r,[{key:"initialize",value:function(){var t;return(t=this.store).initialize.apply(t,arguments)}},{key:"captureOrder",value:function(){var t;return(t=this.store).captureOrder.apply(t,arguments)}}]),r}(),Ke={Product:I,Category:Q,Customer:_,Cart:X,DeliveryServiceQuote:ze,Store:Ge,StoreLocation:Qe,StoreHour:Ie,Checkout:$e,Review:F},Ue={BrowserAdapter:h,NodeAdapter:l},Je=function(){function t(){return T(this,t),this.resources=Ke,this.adapters=Ue,this.lookup.apply(this,arguments)}return D(t,[{key:"lookup",value:function(t,e){var r=c(t),n=Array.prototype.slice.call(arguments).slice(2);if(!this[r])throw new Error("Attempted to resolve invalid type");if(!this[r][e])throw new Error("No ".concat(d(t)," named ").concat(e," to resolve"));return q(this[r][e],N(n))}}]),t}(),Ve=function(){return q(Je,Array.prototype.slice.call(arguments))},Ze=function(t){S(r,p);var e=Y(r);function r(){return T(this,r),e.apply(this,arguments)}return D(r,[{key:"extendActions",value:function(){return f(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:[])}},{key:"serialize",value:function(t){return Ve("resource",g(this.resource),t,this.adapter)}}]),r}(),tr=function(){function t(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(T(this,t),this.version=a.version||"v1",this.options={version:this.version,host:a.host||"https://api.fleetbase.io",namespace:"storefront/".concat(this.version)||a.namespace,publicKey:e,debug:o},!("string"==typeof(n=e)&&n.length>30&&(n.startsWith("store_")||n.startsWith("network_"))))throw new Error("⚠️ Invalid Storefront key given to Storefront SDK");this.adapter=a.adapter||function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r()?Ve("adapter","NodeAdapter",t):Ve("adapter","BrowserAdapter",t)}(this.options),this.products=new Ze("product",this.adapter),this.categories=new Ze("category",this.adapter),this.reviews=new Ze("review",this.adapter).extendActions(C),this.customers=new Ze("customer",this.adapter).extendActions(G),this.cart=new Ze("cart",this.adapter).extendActions(z),this.checkout=new Ze("checkout",this.adapter).extendActions(Xe)}return D(t,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",w({query:t},e)).then((function(t){return new n(t.map((function(t){return new I(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return q(t,Array.prototype.slice.call(arguments))}}]),t}();export{X as Cart,Q as Category,$e as Checkout,_ as Customer,ze as DeliveryServiceQuote,_e as Network,$ as PaymentGateway,I as Product,F as Review,Ge as Store,Ie as StoreHour,Qe as StoreLocation,tr as default}; +import{Resource as t,StoreActions as e,isNodeEnvironment as r,Collection as n,Place as a,Order as o,Adapter as i,ServiceQuote as s,isResource as u,pluralize as c,singularize as d,BrowserAdapter as h,NodeAdapter as l,extendStoreActions as f,classify as g,Store as p}from"@fleetbase/sdk";function m(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;A(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:H(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function v(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function k(t,e,r,n,a,o,i){try{var s=t[o](i),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,a)}function x(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){k(o,n,a,i,s,"next",t)}function s(t){k(o,n,a,i,s,"throw",t)}i(void 0)}))}}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{},r={};return t&&(r.store=t),this.adapter.get("".concat(this.namespace,"/count"),r,e)}}),F=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"review",a)}return D(r,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),r}();function W(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:r}).format(t)}var R=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var r=b(t);if("object"===r){var n=t.size;if("number"==typeof n)return!n}if("number"==typeof t.length&&"function"!==r)return!t.length;if("object"===r){var a=t.length;if("number"==typeof a)return!a}return!1},I=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"product",a)}return D(r,[{key:"variants",value:function(){return this.getAttribute("variants")}},{key:"addons",value:function(){return this.getAttribute("addon_categories")}},{key:"isOnSale",get:function(){return this.getAttribute("is_on_sale")}},{key:"isNotOnSale",get:function(){return!this.getAttribute("is_on_sale")}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["price","sale_price","currency"]),e=t.price,r=t.sale_price,n=t.currency;return this.isOnSale?R(r)||R(n)?null:W(r/100,n):R(e)||R(n)?null:W(e/100,n)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(e){return new n(e.map((function(e){return new F(e,t.adapter)})))}))}}]),r}(),Q=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"category",a)}return D(r,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(e){return new n(e.map((function(e){return new I(e,t.adapter)})))}))}}]),r}(),G=new e({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("customers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("customers/login",w({identity:t,password:e},r)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers/verify-code",w({identity:t,code:e},r)).then(this.afterFetch.bind(this))},requestCreationCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"email";return this.adapter.post("customers/request-creation-code",{identity:t,mode:e})},create:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers",w({identity:t,code:e},r)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),_=function(t){S(c,j);var e,r,i,s,u=Y(c);function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,c),u.call(this,t,e,"customer",w({actions:G},r))}return D(c,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ze(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"token",get:function(){return this.getAttribute("token")}},{key:"syncDevice",value:(s=x(y().mark((function t(e){var r=this;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",e).then((function(){return r})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"performAuthorizedRequest",value:(i=x(y().mark((function t(e){var r,n,a,o,i=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},n=i.length>2&&void 0!==i[2]?i[2]:"GET",t.prev=2,a={"Customer-Token":this.token},t.next=6,this.adapter.setHeaders(a)[n.toLowerCase()](e,r);case 6:return o=t.sent,t.abrupt("return",o);case 10:throw t.prev=10,t.t0=t.catch(2),console.error("Error in ".concat(n," request to ").concat(e,":"),t.t0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[2,10]])}))),function(t){return i.apply(this,arguments)})},{key:"getSavedPlaces",value:(r=x(y().mark((function t(){var e,r=this;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.performAuthorizedRequest("customers/places");case 3:return e=t.sent,t.abrupt("return",new n(e.map((function(t){return new a(t,r.adapter)}))));case 7:throw t.prev=7,t.t0=t.catch(0),new Error("Failed to retrieve saved places");case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(){return r.apply(this,arguments)})},{key:"getOrderHistory",value:(e=x(y().mark((function t(){var e,r,a=this,i=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},t.prev=1,t.next=4,this.performAuthorizedRequest("customers/orders",e);case 4:return r=t.sent,t.abrupt("return",new n(r.map((function(t){return new o(t,a.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),new Error("Failed to retrieve order history");case 11:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(){return e.apply(this,arguments)})}]),c}(),B=Array.isArray,z=new e({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,add:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),w(w({},n),{},{quantity:r}),a).then(this.afterFetch.bind(this))},update:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),w(w({},n),{},{quantity:r}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},r).then(this.afterFetch.bind(this))},empty:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/empty"),{},e).then(this.afterFetch.bind(this))},retrieve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.findRecord(t)}}),X=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"cart",w({actions:z},a))}return D(r,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof I&&(t=t.id),this.store.add(this.id,t,e,r,n)}},{key:"update",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,r,n)}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.remove(this.id,t,e)}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.empty(this.id,t)}},{key:"delete",value:function(){return this.destroy()}},{key:"refresh",value:function(){return this.store.retrieve(this.id)}},{key:"subtotal",value:function(){var t=0;return this.contents().forEach((function(e){t+=e.subtotal})),t}},{key:"contents",value:function(){return this.getAttribute("items",[])}},{key:"hasProduct",value:function(t){return-1!==this.contents().findIndex((function(e){return e.product_id===t}))}},{key:"isEmpty",get:function(){var t=this.contents();return!B(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),r}(),$=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"payment-gateway",a)}return D(r,[{key:"type",get:function(){return this.getAttribute("type")}},{key:"code",get:function(){return this.getAttribute("code")}},{key:"isCashGateway",get:function(){return"cash"===this.type}},{key:"isStripeGateway",get:function(){return"stripe"===this.type}},{key:"setCheckoutToken",value:function(t){this.token=t}},{key:"getCheckoutToken",value:function(){return this.token}},{key:"findRecord",value:function(){throw new Error("There is no findRecord() method for payment gateways!")}},{key:"create",value:function(){throw new Error("There is no create() method for payment gateways!")}},{key:"update",value:function(){throw new Error("There is no update() method for payment gateways!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method for payment gateways!")}},{key:"reload",value:function(){throw new Error("There is no reload() method for payment gateways!")}}]),r}();function K(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function U(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function J(t,e){const r=K(t);return isNaN(e)?U(t,NaN):e?(r.setDate(r.getDate()+e),r):r}const V=6048e5,Z=864e5;let tt={};function et(){return tt}function rt(t,e){const r=et(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=K(t),o=a.getDay(),i=(o=a.getTime()?r+1:e.getTime()>=i.getTime()?r:r-1}function ot(t){const e=K(t);return e.setHours(0,0,0,0),e}function it(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function st(t){if(!(e=t,e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)||"number"==typeof t))return!1;var e;const r=K(t);return!isNaN(Number(r))}const ut={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function ct(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const dt={date:ct({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:ct({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:ct({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ht={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function lt(t){return(e,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,a=r?.width?String(r.width):e;n=t.formattingValues[a]||t.formattingValues[e]}else{const e=t.defaultWidth,a=r?.width?String(r.width):t.defaultWidth;n=t.values[a]||t.values[e]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function ft(t){return(e,r={})=>{const n=r.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;const i=o[0],s=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let r=0;rt.test(i))):function(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=r.valueCallback?r.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var gt;const pt={code:"en-US",formatDistance:(t,e,r)=>{let n;const a=ut[t];return n="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:dt,formatRelative:(t,e,r,n)=>ht[t],localize:{ordinalNumber:(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:lt({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:lt({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:lt({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:lt({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:lt({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(gt={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const r=t.match(gt.matchPattern);if(!r)return null;const n=r[0],a=t.match(gt.parsePattern);if(!a)return null;let o=gt.valueCallback?gt.valueCallback(a[0]):a[0];return o=e.valueCallback?e.valueCallback(o):o,{value:o,rest:t.slice(n.length)}}),era:ft({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ft({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:ft({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ft({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ft({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function mt(t){const e=K(t),r=function(t,e){const r=ot(t),n=ot(e),a=r.getTime()-it(r),o=n.getTime()-it(n);return Math.round((a-o)/Z)}(e,function(t){const e=K(t),r=U(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}(e));return r+1}function wt(t){const e=K(t),r=nt(e).getTime()-function(t){const e=at(t),r=U(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),nt(r)}(e).getTime();return Math.round(r/V)+1}function yt(t,e){const r=K(t),n=r.getFullYear(),a=et(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=U(t,0);i.setFullYear(n+1,0,o),i.setHours(0,0,0,0);const s=rt(i,e),u=U(t,0);u.setFullYear(n,0,o),u.setHours(0,0,0,0);const c=rt(u,e);return r.getTime()>=s.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function vt(t,e){const r=K(t),n=rt(r,e).getTime()-function(t,e){const r=et(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=yt(t,e),o=U(t,0);return o.setFullYear(a,0,n),o.setHours(0,0,0,0),rt(o,e)}(r,e).getTime();return Math.round(n/V)+1}function bt(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const kt={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return bt("yy"===e?n%100:n,e.length)},M(t,e){const r=t.getMonth();return"M"===e?String(r+1):bt(r+1,2)},d:(t,e)=>bt(t.getDate(),e.length),a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(t,e)=>bt(t.getHours()%12||12,e.length),H:(t,e)=>bt(t.getHours(),e.length),m:(t,e)=>bt(t.getMinutes(),e.length),s:(t,e)=>bt(t.getSeconds(),e.length),S(t,e){const r=e.length,n=t.getMilliseconds();return bt(Math.floor(n*Math.pow(10,r-3)),e.length)}},xt="midnight",Tt="noon",Mt="morning",Dt="afternoon",Pt="evening",St="night",Et={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if("yo"===e){const e=t.getFullYear(),n=e>0?e:1-e;return r.ordinalNumber(n,{unit:"year"})}return kt.y(t,e)},Y:function(t,e,r,n){const a=yt(t,n),o=a>0?a:1-a;if("YY"===e){return bt(o%100,2)}return"Yo"===e?r.ordinalNumber(o,{unit:"year"}):bt(o,e.length)},R:function(t,e){return bt(at(t),e.length)},u:function(t,e){return bt(t.getFullYear(),e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return bt(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return bt(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return kt.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return bt(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const a=vt(t,n);return"wo"===e?r.ordinalNumber(a,{unit:"week"}):bt(a,e.length)},I:function(t,e,r){const n=wt(t);return"Io"===e?r.ordinalNumber(n,{unit:"week"}):bt(n,e.length)},d:function(t,e,r){return"do"===e?r.ordinalNumber(t.getDate(),{unit:"date"}):kt.d(t,e)},D:function(t,e,r){const n=mt(t);return"Do"===e?r.ordinalNumber(n,{unit:"dayOfYear"}):bt(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const a=t.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return bt(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const a=t.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return bt(o,e.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),a=0===n?7:n;switch(e){case"i":return String(a);case"ii":return bt(a,e.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let a;switch(a=12===n?Tt:0===n?xt:n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let a;switch(a=n>=17?Pt:n>=12?Dt:n>=4?Mt:St,e){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,r){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),r.ordinalNumber(e,{unit:"hour"})}return kt.h(t,e)},H:function(t,e,r){return"Ho"===e?r.ordinalNumber(t.getHours(),{unit:"hour"}):kt.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return"Ko"===e?r.ordinalNumber(n,{unit:"hour"}):bt(n,e.length)},k:function(t,e,r){let n=t.getHours();return 0===n&&(n=24),"ko"===e?r.ordinalNumber(n,{unit:"hour"}):bt(n,e.length)},m:function(t,e,r){return"mo"===e?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):kt.m(t,e)},s:function(t,e,r){return"so"===e?r.ordinalNumber(t.getSeconds(),{unit:"second"}):kt.s(t,e)},S:function(t,e){return kt.S(t,e)},X:function(t,e,r,n){const a=(n._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return At(a);case"XXXX":case"XX":return qt(a);default:return qt(a,":")}},x:function(t,e,r,n){const a=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return At(a);case"xxxx":case"xx":return qt(a);default:return qt(a,":")}},O:function(t,e,r,n){const a=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ot(a,":");default:return"GMT"+qt(a,":")}},z:function(t,e,r,n){const a=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ot(a,":");default:return"GMT"+qt(a,":")}},t:function(t,e,r,n){const a=n._originalDate||t;return bt(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,r,n){return bt((n._originalDate||t).getTime(),e.length)}};function Ot(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),a=Math.floor(n/60),o=n%60;return 0===o?r+String(a):r+String(a)+e+bt(o,2)}function At(t,e){if(t%60==0){return(t>0?"-":"+")+bt(Math.abs(t)/60,2)}return qt(t,e)}function qt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t);return r+bt(Math.floor(n/60),2)+e+bt(n%60,2)}const Ht=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Yt=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Nt={p:Yt,P:(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return Ht(t,e);let o;switch(n){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;default:o=e.dateTime({width:"full"})}return o.replace("{{date}}",Ht(n,e)).replace("{{time}}",Yt(a,e))}},Lt=["D","DD"],jt=["YY","YYYY"];function Ct(t){return-1!==Lt.indexOf(t)}function Ft(t){return-1!==jt.indexOf(t)}function Wt(t,e,r){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("YY"===t)throw new RangeError(`Use \`yy\` instead of \`YY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("D"===t)throw new RangeError(`Use \`d\` instead of \`D\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("DD"===t)throw new RangeError(`Use \`dd\` instead of \`DD\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const Rt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,It=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qt=/^'([^]*?)'?$/,Gt=/''/g,_t=/[a-zA-Z]/;function Bt(t,e,r){const n=et(),a=r?.locale??n.locale??pt,o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=K(t);if(!st(s))throw new RangeError("Invalid time value");const u={firstWeekContainsDate:o,weekStartsOn:i,locale:a,_originalDate:s};return e.match(It).map((function(t){const e=t[0];if("p"===e||"P"===e){return(0,Nt[e])(t,a.formatLong)}return t})).join("").match(Rt).map((function(n){if("''"===n)return"'";const o=n[0];if("'"===o)return function(t){const e=t.match(Qt);if(!e)return t;return e[1].replace(Gt,"'")}(n);const i=Et[o];if(i)return!r?.useAdditionalWeekYearTokens&&Ft(n)&&Wt(n,e,String(t)),!r?.useAdditionalDayOfYearTokens&&Ct(n)&&Wt(n,e,String(t)),i(s,n,a.localize,u);if(o.match(_t))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return n})).join("")}class zt{subPriority=0;validate(t,e){return!0}}class Xt extends zt{constructor(t,e,r,n,a){super(),this.value=t,this.validateValue=e,this.setValue=r,this.priority=n,a&&(this.subPriority=a)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,r){return this.setValue(t,e,this.value,r)}}class $t extends zt{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:U(t,function(t,e){const r=e instanceof Date?U(e,0):new e(0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}(t,Date))}}class Kt{run(t,e,r,n){const a=this.parse(t,e,r,n);return a?{setter:new Xt(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(t,e,r){return!0}}const Ut=/^(1[0-2]|0?\d)/,Jt=/^(3[0-1]|[0-2]?\d)/,Vt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Zt=/^(5[0-3]|[0-4]?\d)/,te=/^(2[0-3]|[0-1]?\d)/,ee=/^(2[0-4]|[0-1]?\d)/,re=/^(1[0-1]|0?\d)/,ne=/^(1[0-2]|0?\d)/,ae=/^[0-5]?\d/,oe=/^[0-5]?\d/,ie=/^\d/,se=/^\d{1,2}/,ue=/^\d{1,3}/,ce=/^\d{1,4}/,de=/^-?\d+/,he=/^-?\d/,le=/^-?\d{1,2}/,fe=/^-?\d{1,3}/,ge=/^-?\d{1,4}/,pe=/^([+-])(\d{2})(\d{2})?|Z/,me=/^([+-])(\d{2})(\d{2})|Z/,we=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ye=/^([+-])(\d{2}):(\d{2})|Z/,ve=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function be(t,e){return t?{value:e(t.value),rest:t.rest}:t}function ke(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function xe(t,e){const r=e.match(t);if(!r)return null;if("Z"===r[0])return{value:0,rest:e.slice(1)};return{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:e.slice(r[0].length)}}function Te(t){return ke(de,t)}function Me(t,e){switch(t){case 1:return ke(ie,e);case 2:return ke(se,e);case 3:return ke(ue,e);case 4:return ke(ce,e);default:return ke(new RegExp("^\\d{1,"+t+"}"),e)}}function De(t,e){switch(t){case 1:return ke(he,e);case 2:return ke(le,e);case 3:return ke(fe,e);case 4:return ke(ge,e);default:return ke(new RegExp("^-?\\d{1,"+t+"}"),e)}}function Pe(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Se(t,e){const r=e>0,n=r?e:1-e;let a;if(n<=50)a=t||100;else{const e=n+50;a=t+100*Math.floor(e/100)-(t>=e%100?100:0)}return r?a:1-a}function Ee(t){return t%400==0||t%4==0&&t%100!=0}const Oe=[31,28,31,30,31,30,31,31,30,31,30,31],Ae=[31,29,31,30,31,30,31,31,30,31,30,31];function qe(t,e,r){const n=et(),a=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=K(t),i=o.getDay(),s=7-a;return J(o,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function He(t,e){const r=K(t),n=function(t){let e=K(t).getDay();return 0===e&&(e=7),e}(r);return J(r,e-n)}const Ye={G:new class extends Kt{priority=140;parse(t,e,r){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,e,r){return e.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Kt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return be(Me(4,t),n);case"yo":return be(r.ordinalNumber(t,{unit:"year"}),n);default:return be(Me(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r){const n=t.getFullYear();if(r.isTwoDigitYear){const e=Se(r.year,n);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const a="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Kt{priority=130;parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return be(Me(4,t),n);case"Yo":return be(r.ordinalNumber(t,{unit:"year"}),n);default:return be(Me(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r,n){const a=yt(t,n);if(r.isTwoDigitYear){const e=Se(r.year,a);return t.setFullYear(e,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,n)}const o="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(o,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Kt{priority=130;parse(t,e){return De("R"===e?4:e.length,t)}set(t,e,r){const n=U(t,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),nt(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Kt{priority=130;parse(t,e){return De("u"===e?4:e.length,t)}set(t,e,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends Kt{priority=120;parse(t,e,r){switch(e){case"Q":case"QQ":return Me(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends Kt{priority=120;parse(t,e,r){switch(e){case"q":case"qq":return Me(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends Kt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"M":return be(ke(Ut,t),n);case"MM":return be(Me(2,t),n);case"Mo":return be(r.ordinalNumber(t,{unit:"month"}),n);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}},L:new class extends Kt{priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"L":return be(ke(Ut,t),n);case"LL":return be(Me(2,t),n);case"Lo":return be(r.ordinalNumber(t,{unit:"month"}),n);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends Kt{priority=100;parse(t,e,r){switch(e){case"w":return ke(Zt,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r,n){return rt(function(t,e,r){const n=K(t),a=vt(n,r)-e;return n.setDate(n.getDate()-7*a),n}(t,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Kt{priority=100;parse(t,e,r){switch(e){case"I":return ke(Zt,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r){return nt(function(t,e){const r=K(t),n=wt(r)-e;return r.setDate(r.getDate()-7*n),r}(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Kt{priority=90;subPriority=1;parse(t,e,r){switch(e){case"d":return ke(Jt,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return Me(e.length,t)}}validate(t,e){const r=Ee(t.getFullYear()),n=t.getMonth();return r?e>=1&&e<=Ae[n]:e>=1&&e<=Oe[n]}set(t,e,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Kt{priority=90;subpriority=1;parse(t,e,r){switch(e){case"D":case"DD":return ke(Vt,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return Me(e.length,t)}}validate(t,e){return Ee(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends Kt{priority=90;parse(t,e,r){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=qe(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Kt{priority=90;parse(t,e,r,n){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return be(Me(e.length,t),a);case"eo":return be(r.ordinalNumber(t,{unit:"day"}),a);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=qe(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends Kt{priority=90;parse(t,e,r,n){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return be(Me(e.length,t),a);case"co":return be(r.ordinalNumber(t,{unit:"day"}),a);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=qe(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends Kt{priority=90;parse(t,e,r){const n=t=>0===t?7:t;switch(e){case"i":case"ii":return Me(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return be(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiii":return be(r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiiii":return be(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);default:return be(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n)}}validate(t,e){return e>=1&&e<=7}set(t,e,r){return(t=He(t,r)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends Kt{priority=80;parse(t,e,r){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(Pe(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Kt{priority=80;parse(t,e,r){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(Pe(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Kt{priority=80;parse(t,e,r){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(Pe(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"h":return ke(ne,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,r){const n=t.getHours()>=12;return n&&r<12?t.setHours(r+12,0,0,0):n||12!==r?t.setHours(r,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"H":return ke(te,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"K":return ke(re,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"k":return ke(ee,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,r){const n=r<=24?r%24:r;return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Kt{priority=60;parse(t,e,r){switch(e){case"m":return ke(ae,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Kt{priority=50;parse(t,e,r){switch(e){case"s":return ke(oe,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]},S:new class extends Kt{priority=30;parse(t,e){return be(Me(e.length,t),(t=>Math.floor(t*Math.pow(10,3-e.length))))}set(t,e,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]},X:new class extends Kt{priority=10;parse(t,e){switch(e){case"X":return xe(pe,t);case"XX":return xe(me,t);case"XXXX":return xe(we,t);case"XXXXX":return xe(ve,t);default:return xe(ye,t)}}set(t,e,r){return e.timestampIsSet?t:U(t,t.getTime()-it(t)-r)}incompatibleTokens=["t","T","x"]},x:new class extends Kt{priority=10;parse(t,e){switch(e){case"x":return xe(pe,t);case"xx":return xe(me,t);case"xxxx":return xe(we,t);case"xxxxx":return xe(ve,t);default:return xe(ye,t)}}set(t,e,r){return e.timestampIsSet?t:U(t,t.getTime()-it(t)-r)}incompatibleTokens=["t","T","X"]},t:new class extends Kt{priority=40;parse(t){return Te(t)}set(t,e,r){return[U(t,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Kt{priority=20;parse(t){return Te(t)}set(t,e,r){return[U(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},Ne=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Le=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,je=/^'([^]*?)'?$/,Ce=/''/g,Fe=/\S/,We=/[a-zA-Z]/;function Re(t,e,r,n){const a=Object.assign({},et()),o=n?.locale??a.locale??pt,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(""===e)return""===t?K(r):U(r,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:o},c=[new $t],d=e.match(Le).map((t=>{const e=t[0];if(e in Nt){return(0,Nt[e])(t,o.formatLong)}return t})).join("").match(Ne),h=[];for(let a of d){!n?.useAdditionalWeekYearTokens&&Ft(a)&&Wt(a,e,t),!n?.useAdditionalDayOfYearTokens&&Ct(a)&&Wt(a,e,t);const i=a[0],s=Ye[i];if(s){const{incompatibleTokens:e}=s;if(Array.isArray(e)){const t=h.find((t=>e.includes(t.token)||t.token===i));if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${a}\` at the same time`)}else if("*"===s.incompatibleTokens&&h.length>0)throw new RangeError(`The format string mustn't contain \`${a}\` and any other token at the same time`);h.push({token:i,fullToken:a});const n=s.run(t,a,o.match,u);if(!n)return U(r,NaN);c.push(n.setter),t=n.rest}else{if(i.match(We))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");if("''"===a?a="'":"'"===i&&(a=a.match(je)[1].replace(Ce,"'")),0!==t.indexOf(a))return U(r,NaN);t=t.slice(a.length)}}if(t.length>0&&Fe.test(t))return U(r,NaN);const l=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,r)=>r.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=K(r);if(isNaN(f.getTime()))return U(r,NaN);const g={};for(const t of l){if(!t.validate(f,u))return U(r,NaN);const e=t.set(f,g,u);Array.isArray(e)?(f=e[0],Object.assign(g,e[1])):f=e}return U(r,f)}var Ie=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"store-hour",a)}return D(r,[{key:"day",get:function(){return this.getAttribute("day")}},{key:"isClosed",get:function(){return null===this.getAttribute("start")&&null===this.getAttribute("end")}},{key:"is24Hours",get:function(){var t=this.startDateInstance,e=this.endDateInstance,r=Math.abs(t-e);return Math.floor(r/1e3/60)/60>23}},{key:"startDateInstance",get:function(){if(!this.hasAttribute("start"))return null;var t=this.getAttribute("start"),e=3===t.split(":").length;return Re(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"endDateInstance",get:function(){if(!this.hasAttribute("end"))return null;var t=this.getAttribute("end"),e=3===t.split(":").length;return Re(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return st(this.startDateInstance)&&st(this.endDateInstance)?"".concat(Bt(this.startDateInstance,"p")," - ").concat(Bt(this.endDateInstance,"p")):"".concat(this.start," - ").concat(this.end)}},{key:"humanReadableHours",get:function(){return this.isClosed?"Closed":this.is24Hours?"24 Hours":this.humanReadableHoursRange}},{key:"create",value:function(){throw new Error("There is no create() method store location!")}},{key:"update",value:function(){throw new Error("There is no update() method store location!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method store location!")}},{key:"reload",value:function(){throw new Error("There is no reload() method store location!")}}]),r}(),Qe=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"store-location",a)}return D(r,[{key:"latitude",get:function(){return this.getAttribute("place.location.coordinates.1")}},{key:"longitude",get:function(){return this.getAttribute("place.location.coordinates.0")}},{key:"hours",get:function(){return new n(this.getAttribute("hours").map((function(t){return new Ie(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=Bt(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},e=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"store",a)}return D(r,[{key:"getReviews",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",w({store:this.id},e)).then((function(e){return new n(e.map((function(e){return new F(e,t.adapter)})))}))}},{key:"getLocations",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",w({store:this.id},e)).then((function(e){return new n(e.map((function(e){return e.place&&(e.place=new a(e.place)),new Qe(e,t.adapter)})))}))}},{key:"getLocation",value:function(t){var e=this;return this.adapter.get("locations/".concat(t),{store:this.id}).then((function(t){return new Qe(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",e).then((function(e){return new n(e.map((function(e){return new $(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new $(t,e.adapter)}))}}]),r}(),_e=function(t){S(s,j);var e,r,a,o,i=Y(s);function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,s),i.call(this,t,e,"network",r)}return D(s,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getResourceCollection",value:(o=x(y().mark((function t(e,r){var a,o,i=this,s=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=s.length>2&&void 0!==s[2]?s[2]:{},t.prev=1,t.next=4,this.adapter.get(e,a);case 4:return o=t.sent,t.abrupt("return",new n(o.map((function(t){return new r(t,i.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),console.error("Error fetching ".concat(e,":"),t.t0),t.t0;case 12:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(t,e){return o.apply(this,arguments)})},{key:"getStores",value:(a=x(y().mark((function t(){var e,r=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("stores",Ge,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"getStoreLocations",value:(r=x(y().mark((function t(){var e,r=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("store-locations",Qe,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"getPaymentGateways",value:(e=x(y().mark((function t(){return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.getResourceCollection("gateways",$));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),s}(),Be=Array.isArray,ze=function(t){S(o,s);var e,r,a=Y(o);function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,o),e instanceof i?H(t,t=a.call(this,{},e,"service-quote",n)):a.call(this,e,r,"service-quote",n)}return D(o,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ze(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["amount","currency"]),e=t.amount,r=t.currency;return R(e)||R(r)?null:W(e/100,r)}},{key:"fetchServiceQuotesFromCart",value:(r=x(y().mark((function t(e,r,a){var i,s,u,c,d,h,l=this,f=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=f.length>3&&void 0!==f[3]?f[3]:"storefront",d=f.length>4&&void 0!==f[4]&&f[4],null!==(i=e)&&void 0!==i&&i.id&&(e=e.id),null!==(s=r)&&void 0!==s&&s.id&&(r=r.id),null!==(u=a)&&void 0!==u&&u.id&&(a=a.id),t.prev=5,t.next=8,this.adapter.get("service-quotes/from-cart",{origin:e,destination:r,cart:a,config:c,all:d});case 8:if(h=t.sent,!Be(h)){t.next=11;break}return t.abrupt("return",new n(h.map((function(t){return new o(t,l.adapter)}))));case 11:return t.abrupt("return",new o(h,this.adapter));case 14:throw t.prev=14,t.t0=t.catch(5),console.error("Error fetching service quotes:",t.t0),t.t0;case 18:case"end":return t.stop()}}),t,this,[[5,14]])}))),function(t,e,n){return r.apply(this,arguments)})}],[{key:"getFromCart",value:(e=x(y().mark((function t(e,r,n,a){var i,s,u,c=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=c.length>4&&void 0!==c[4]?c[4]:"storefront",s=c.length>5&&void 0!==c[5]&&c[5],u=new o(e),t.abrupt("return",u.fetchServiceQuotesFromCart(r,n,a,i,s));case 4:case"end":return t.stop()}}),t)}))),function(t,r,n,a){return e.apply(this,arguments)})}]),o}(),Xe=new e({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,initialize:function(t,e,r,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return u(t)&&(t=t.id),u(e)&&(e=e.id),u(r)&&(r=r.id),u(n)&&(n=n.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),w(w({},a),{},{customer:t,cart:e,serviceQuote:r,gateway:n}),o)},captureOrder:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/capture"),{token:t,transactionDetails:e},r).then((function(t){return new o(t)}))}}),$e=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"checkout",a)}return D(r,[{key:"initialize",value:function(){var t;return(t=this.store).initialize.apply(t,arguments)}},{key:"captureOrder",value:function(){var t;return(t=this.store).captureOrder.apply(t,arguments)}}]),r}(),Ke={Product:I,Category:Q,Customer:_,Cart:X,DeliveryServiceQuote:ze,Store:Ge,StoreLocation:Qe,StoreHour:Ie,Checkout:$e,Review:F},Ue={BrowserAdapter:h,NodeAdapter:l},Je=function(){function t(){return T(this,t),this.resources=Ke,this.adapters=Ue,this.lookup.apply(this,arguments)}return D(t,[{key:"lookup",value:function(t,e){var r=c(t),n=Array.prototype.slice.call(arguments).slice(2);if(!this[r])throw new Error("Attempted to resolve invalid type");if(!this[r][e])throw new Error("No ".concat(d(t)," named ").concat(e," to resolve"));return q(this[r][e],N(n))}}]),t}(),Ve=function(){return q(Je,Array.prototype.slice.call(arguments))},Ze=function(t){S(r,p);var e=Y(r);function r(){return T(this,r),e.apply(this,arguments)}return D(r,[{key:"extendActions",value:function(){return f(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:[])}},{key:"serialize",value:function(t){return Ve("resource",g(this.resource),t,this.adapter)}}]),r}(),tr=function(){function t(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(T(this,t),this.version=a.version||"v1",this.options={version:this.version,host:a.host||"https://api.fleetbase.io",namespace:"storefront/".concat(this.version)||a.namespace,publicKey:e,debug:o},!("string"==typeof(n=e)&&n.length>30&&(n.startsWith("store_")||n.startsWith("network_"))))throw new Error("⚠️ Invalid Storefront key given to Storefront SDK");this.adapter=a.adapter||function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r()?Ve("adapter","NodeAdapter",t):Ve("adapter","BrowserAdapter",t)}(this.options),this.products=new Ze("product",this.adapter),this.categories=new Ze("category",this.adapter),this.reviews=new Ze("review",this.adapter).extendActions(C),this.customers=new Ze("customer",this.adapter).extendActions(G),this.cart=new Ze("cart",this.adapter).extendActions(z),this.checkout=new Ze("checkout",this.adapter).extendActions(Xe)}return D(t,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",w({query:t},e)).then((function(t){return new n(t.map((function(t){return new I(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return q(t,Array.prototype.slice.call(arguments))}}]),t}();export{X as Cart,Q as Category,$e as Checkout,_ as Customer,ze as DeliveryServiceQuote,_e as Network,$ as PaymentGateway,I as Product,F as Review,Ge as Store,Ie as StoreHour,Qe as StoreLocation,tr as default}; //# sourceMappingURL=storefront.js.map diff --git a/dist/esm/storefront.js.map b/dist/esm/storefront.js.map index a428db8..6673aa6 100644 --- a/dist/esm/storefront.js.map +++ b/dist/esm/storefront.js.map @@ -1 +1 @@ -{"version":3,"file":"storefront.js","sources":["../../src/resource.js","../../src/resources/review.js","../../src/utils/format-currency.js","../../src/utils/is-key-valid.js","../../src/utils/is-empty.js","../../src/resources/product.js","../../src/resources/category.js","../../src/resources/customer.js","../../src/utils/is-phone.js","../../src/resources/cart.js","../../src/resources/payment-gateway.js","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/toDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constructFrom.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/addDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/defaultOptions.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isValid.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/match.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDayOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/differenceInCalendarDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/addLeadingZeros.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/lightFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/formatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/longFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/protectedTokens.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/format.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Setter.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/transpose.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/utils.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DateParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/EraParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDefaultOptions.mjs","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/store.js","../../src/resources/network.js","../../src/resources/delivery-service-quote.js","../../src/resources/checkout.js","../../src/resolver.js","../../src/store.js","../../src/storefront.js","../../src/utils/detect-adapter.js"],"sourcesContent":["import { Resource } from '@fleetbase/sdk';\nimport StorefrontStore from './store';\n\nexport default class StorefrontResource extends Resource {\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n}\n","import Resource from '../resource';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst reviewActions = new StoreActions({\n count: function (storeId, options = {}) {\n const params = {};\n\n if (storeId) {\n params.store = storeId;\n }\n\n return this.adapter.get(`${this.namespace}/count`, params, options);\n },\n});\n\nexport default class Review extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'review', options);\n }\n\n getMedia() {\n // @todo\n }\n\n getPhotos() {\n // @todo\n }\n\n getVideos() {\n // @todo\n }\n}\n\nexport { reviewActions };\n","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n currencyDisplay,\n }).format(amount);\n}\n","const isKeyValid = (key) => {\n return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_'));\n};\n\nexport default isKeyValid;\n","const isEmpty = (obj) => {\n const none = obj === null || obj === undefined;\n if (none) {\n return none;\n }\n\n if (typeof obj.size === 'number') {\n return !obj.size;\n }\n\n const objectType = typeof obj;\n\n if (objectType === 'object') {\n const { size } = obj;\n if (typeof size === 'number') {\n return !size;\n }\n }\n\n if (typeof obj.length === 'number' && objectType !== 'function') {\n return !obj.length;\n }\n\n if (objectType === 'object') {\n const { length } = obj;\n if (typeof length === 'number') {\n return !length;\n }\n }\n\n return false;\n};\n\nexport default isEmpty;\n","import Resource from '../resource';\nimport Review from './review';\nimport { formatCurrency, isEmpty } from '../utils';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Product extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'product', options);\n }\n\n variants() {\n return this.getAttribute('variants');\n }\n\n addons() {\n return this.getAttribute('addon_categories');\n }\n\n get isOnSale() {\n return this.getAttribute('is_on_sale');\n }\n\n get isNotOnSale() {\n return !this.getAttribute('is_on_sale');\n }\n\n get formattedAmount() {\n const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']);\n\n if (this.isOnSale) {\n if (isEmpty(sale_price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(sale_price / 100, currency);\n }\n\n if (isEmpty(price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(price / 100, currency);\n }\n\n getReviews() {\n return this.adapter.get('reviews', { store: this.id }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n}\n","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Category extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'category', options);\n }\n\n getProducts() {\n return this.adapter.get('products', { category: this.id }).then((products) => {\n return new Collection(products.map((attributes) => new Product(attributes, this.adapter)));\n });\n }\n}\n","import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport StorefrontStore from '../store';\nimport { isPhone } from '../utils';\n\nconst customerActions = new StoreActions({\n // const { error } = await storefront.customers.login('+1 111-1111');\n login: function (identity, password = null, attributes = {}) {\n // handle phone number authentication\n if (isPhone(identity)) {\n return this.adapter.post('customers/login-with-sms', { phone: identity });\n }\n\n if (!password) {\n throw new Error('Login requires password!');\n }\n\n return this.adapter.post('customers/login', { identity, password, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n verifyCode: function (identity, code, attributes = {}) {\n return this.adapter.post('customers/verify-code', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n requestCreationCode(identity, mode = 'email') {\n return this.adapter.post('customers/request-creation-code', {\n identity,\n mode,\n });\n },\n\n create(identity, code, attributes = {}) {\n return this.adapter.post('customers', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id) {\n return this.findRecord(id);\n },\n});\n\nexport default class Customer extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'customer', {\n actions: customerActions,\n ...options,\n });\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get token() {\n return this.getAttribute('token');\n }\n\n async syncDevice(token) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/register-device', token)\n .then(() => {\n return this;\n });\n }\n\n async performAuthorizedRequest(endpoint, params = {}, method = 'GET') {\n try {\n const headers = { 'Customer-Token': this.token };\n const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params);\n return response;\n } catch (error) {\n console.error(`Error in ${method} request to ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getSavedPlaces() {\n try {\n const places = await this.performAuthorizedRequest('customers/places');\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve saved places');\n }\n }\n\n async getOrderHistory(params = {}) {\n try {\n const orders = await this.performAuthorizedRequest('customers/orders', params);\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve order history');\n }\n }\n}\n\nexport { customerActions };\n","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n};\n\nexport default isPhone;\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\n\nconst cartActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n add: function (id, productId, quantity = 1, data = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/${id}/${productId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n update: function (id, cartItemId, quantity, data = {}, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/${cartItemId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n remove: function (id, cartItemId, options = {}) {\n return this.adapter.delete(`${this.namespace}/${id}/${cartItemId}`, {}, options).then(this.afterFetch.bind(this));\n },\n\n empty: function (id, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/empty`, {}, options).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id = '') {\n return this.findRecord(id);\n },\n});\n\nexport default class Cart extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'cart', { actions: cartActions, ...options });\n }\n\n add(productId, quantity = 1, data = {}, options = {}) {\n if (productId instanceof Product) {\n productId = productId.id;\n }\n\n return this.store.add(this.id, productId, quantity, data, options);\n }\n\n update(cartItemId, quantity, data = {}, options = {}) {\n return this.store.update(this.id, cartItemId, quantity, data, options);\n }\n\n remove(cartItemId, options = {}) {\n return this.store.remove(this.id, cartItemId, options);\n }\n\n empty(options = {}) {\n return this.store.empty(this.id, options);\n }\n\n delete() {\n return this.destroy();\n }\n\n refresh() {\n return this.store.retrieve(this.id);\n }\n\n subtotal() {\n let subtotal = 0;\n\n this.contents().forEach((cartItem) => {\n subtotal += cartItem.subtotal;\n });\n\n return subtotal;\n }\n\n contents() {\n return this.getAttribute('items', []);\n }\n\n hasProduct(productId) {\n return this.contents().findIndex((cartItem) => cartItem.product_id === productId) !== -1;\n }\n\n get isEmpty() {\n const contents = this.contents();\n\n if (!isArray(contents)) {\n return true;\n }\n\n return contents.length === 0;\n }\n\n get isNotEmpty() {\n return !this.isEmpty;\n }\n}\n\nexport { cartActions };\n","import Resource from '../resource';\n\nexport default class PaymentGateway extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'payment-gateway', options);\n }\n\n get type() {\n return this.getAttribute('type');\n }\n\n get code() {\n return this.getAttribute('code');\n }\n\n get isCashGateway() {\n return this.type === 'cash';\n }\n\n get isStripeGateway() {\n return this.type === 'stripe';\n }\n\n setCheckoutToken(token) {\n this.token = token;\n }\n\n getCheckoutToken() {\n return this.token;\n }\n\n // remove default resource methods\n findRecord() {\n throw new Error('There is no findRecord() method for payment gateways!');\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method for payment gateways!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method for payment gateways!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method for payment gateways!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method for payment gateways!');\n }\n}\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const utcDate = new Date(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}\n","import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n startOfDayRight.getTime() -\n getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff =\n startOfISOWeek(_date).getTime() - startOfISOWeekYear(_date).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff =\n startOfWeek(_date, options).getTime() -\n startOfWeekYear(_date, options).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.floor(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.floor(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const protectedDayOfYearTokens = [\"D\", \"DD\"];\nconst protectedWeekYearTokens = [\"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\n\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\n\nexport function throwProtectedError(token, format, input) {\n if (token === \"YYYY\") {\n throw new RangeError(\n `Use \\`yyyy\\` instead of \\`YYYY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"YY\") {\n throw new RangeError(\n `Use \\`yy\\` instead of \\`YY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"D\") {\n throw new RangeError(\n `Use \\`d\\` instead of \\`D\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"DD\") {\n throw new RangeError(\n `Use \\`dd\\` instead of \\`DD\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n }\n}\n","import { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate,\n };\n\n const result = formatStr\n .match(longFormattingTokensRegExp)\n .map(function (substring) {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n const formatter = formatters[firstCharacter];\n if (formatter) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n return formatter(\n originalDate,\n substring,\n locale.localize,\n formatterOptions,\n );\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return substring;\n })\n .join(\"\");\n\n return result;\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { transpose } from \"../../transpose.mjs\";\nimport { constructFrom } from \"../../constructFrom.mjs\";\n\nconst TIMEZONE_UNIT_PRIORITY = 10;\n\nexport class Setter {\n subPriority = 0;\n\n validate(_utcDate, _options) {\n return true;\n }\n}\n\nexport class ValueSetter extends Setter {\n constructor(\n value,\n\n validateValue,\n\n setValue,\n\n priority,\n subPriority,\n ) {\n super();\n this.value = value;\n this.validateValue = validateValue;\n this.setValue = setValue;\n this.priority = priority;\n if (subPriority) {\n this.subPriority = subPriority;\n }\n }\n\n validate(date, options) {\n return this.validateValue(date, this.value, options);\n }\n\n set(date, flags, options) {\n return this.setValue(date, flags, this.value, options);\n }\n}\n\nexport class DateToSystemTimezoneSetter extends Setter {\n priority = TIMEZONE_UNIT_PRIORITY;\n subPriority = -1;\n set(date, flags) {\n if (flags.timestampIsSet) return date;\n return constructFrom(date, transpose(date, Date));\n }\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name transpose\n * @category Generic Helpers\n * @summary Transpose the date to the given constructor.\n *\n * @description\n * The function transposes the date to the given constructor. It helps you\n * to transpose the date in the system time zone to say `UTCDate` or any other\n * date extension.\n *\n * @typeParam DateInputType - The input `Date` type derived from the passed argument.\n * @typeParam DateOutputType - The output `Date` type derived from the passed constructor.\n *\n * @param fromDate - The date to use values from\n * @param constructor - The date constructor to use\n *\n * @returns Date transposed to the given constructor\n *\n * @example\n * // Create July 10, 2022 00:00 in locale time zone\n * const date = new Date(2022, 6, 10)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'\n *\n * @example\n * // Transpose the date to July 10, 2022 00:00 in UTC\n * transpose(date, UTCDate)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'\n */\nexport function transpose(fromDate, constructor) {\n const date =\n constructor instanceof Date\n ? constructFrom(constructor, 0)\n : new constructor(0);\n date.setFullYear(\n fromDate.getFullYear(),\n fromDate.getMonth(),\n fromDate.getDate(),\n );\n date.setHours(\n fromDate.getHours(),\n fromDate.getMinutes(),\n fromDate.getSeconds(),\n fromDate.getMilliseconds(),\n );\n return date;\n}\n\n// Fallback for modularized imports:\nexport default transpose;\n","import { ValueSetter } from \"./Setter.mjs\";\n\nexport class Parser {\n run(dateString, token, match, options) {\n const result = this.parse(dateString, token, match, options);\n if (!result) {\n return null;\n }\n\n return {\n setter: new ValueSetter(\n result.value,\n this.validate,\n this.set,\n this.priority,\n this.subPriority,\n ),\n rest: result.rest,\n };\n }\n\n validate(_utcDate, _value, _options) {\n return true;\n }\n}\n","export const numericPatterns = {\n month: /^(1[0-2]|0?\\d)/, // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/, // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/, // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/, // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/, // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/, // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/, // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/, // 0 to 12\n minute: /^[0-5]?\\d/, // 0 to 59\n second: /^[0-5]?\\d/, // 0 to 59\n\n singleDigit: /^\\d/, // 0 to 9\n twoDigits: /^\\d{1,2}/, // 0 to 99\n threeDigits: /^\\d{1,3}/, // 0 to 999\n fourDigits: /^\\d{1,4}/, // 0 to 9999\n\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/, // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/, // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/, // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/, // 0 to 9999, -0 to -9999\n};\n\nexport const timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/,\n};\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n millisecondsInSecond,\n} from \"../../constants.mjs\";\nimport { numericPatterns } from \"./constants.mjs\";\n\nexport function mapValue(parseFnResult, mapFn) {\n if (!parseFnResult) {\n return parseFnResult;\n }\n\n return {\n value: mapFn(parseFnResult.value),\n rest: parseFnResult.rest,\n };\n}\n\nexport function parseNumericPattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n return {\n value: parseInt(matchResult[0], 10),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseTimezonePattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n // Input is 'Z'\n if (matchResult[0] === \"Z\") {\n return {\n value: 0,\n rest: dateString.slice(1),\n };\n }\n\n const sign = matchResult[1] === \"+\" ? 1 : -1;\n const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n\n return {\n value:\n sign *\n (hours * millisecondsInHour +\n minutes * millisecondsInMinute +\n seconds * millisecondsInSecond),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseAnyDigitsSigned(dateString) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);\n}\n\nexport function parseNDigits(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function parseNDigitsSigned(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^-?\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function dayPeriodEnumToHours(dayPeriod) {\n switch (dayPeriod) {\n case \"morning\":\n return 4;\n case \"evening\":\n return 17;\n case \"pm\":\n case \"noon\":\n case \"afternoon\":\n return 12;\n case \"am\":\n case \"midnight\":\n case \"night\":\n default:\n return 0;\n }\n}\n\nexport function normalizeTwoDigitYear(twoDigitYear, currentYear) {\n const isCommonEra = currentYear > 0;\n // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n\n let result;\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n const rangeEnd = absCurrentYear + 50;\n const rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n const isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nexport function isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DAYS_IN_MONTH_LEAP_YEAR = [\n 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n];\n\n// Day of the month\nexport class DateParser extends Parser {\n priority = 90;\n subPriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"d\":\n return parseNumericPattern(numericPatterns.date, dateString);\n case \"do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n const month = date.getMonth();\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n }\n\n set(date, _flags, value) {\n date.setDate(value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { addDays } from \"./addDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link setDay} function options.\n */\n\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the week of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the day of the week set\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setDay(date, day, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const currentDay = _date.getDay();\n\n const remainder = day % 7;\n const dayIndex = (remainder + 7) % 7;\n\n const delta = 7 - weekStartsOn;\n const diff =\n day < 0 || day > 6\n ? day - ((currentDay + delta) % 7)\n : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setDay;\n","import { addDays } from \"./addDays.mjs\";\nimport { getISODay } from \"./getISODay.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the ISO week of the new date\n *\n * @returns The new date with the day of the ISO week set\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * const result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setISODay(date, day) {\n const _date = toDate(date);\n const currentDay = getISODay(_date);\n const diff = day - currentDay;\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setISODay;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * const result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nexport function getISODay(date) {\n const _date = toDate(date);\n let day = _date.getDay();\n\n if (day === 0) {\n day = 7;\n }\n\n return day;\n}\n\n// Fallback for modularized imports:\nexport default getISODay;\n","import { EraParser } from \"./parsers/EraParser.mjs\";\nimport { YearParser } from \"./parsers/YearParser.mjs\";\nimport { LocalWeekYearParser } from \"./parsers/LocalWeekYearParser.mjs\";\nimport { ISOWeekYearParser } from \"./parsers/ISOWeekYearParser.mjs\";\nimport { ExtendedYearParser } from \"./parsers/ExtendedYearParser.mjs\";\nimport { QuarterParser } from \"./parsers/QuarterParser.mjs\";\nimport { StandAloneQuarterParser } from \"./parsers/StandAloneQuarterParser.mjs\";\nimport { MonthParser } from \"./parsers/MonthParser.mjs\";\nimport { StandAloneMonthParser } from \"./parsers/StandAloneMonthParser.mjs\";\nimport { LocalWeekParser } from \"./parsers/LocalWeekParser.mjs\";\nimport { ISOWeekParser } from \"./parsers/ISOWeekParser.mjs\";\nimport { DateParser } from \"./parsers/DateParser.mjs\";\nimport { DayOfYearParser } from \"./parsers/DayOfYearParser.mjs\";\nimport { DayParser } from \"./parsers/DayParser.mjs\";\nimport { LocalDayParser } from \"./parsers/LocalDayParser.mjs\";\nimport { StandAloneLocalDayParser } from \"./parsers/StandAloneLocalDayParser.mjs\";\nimport { ISODayParser } from \"./parsers/ISODayParser.mjs\";\nimport { AMPMParser } from \"./parsers/AMPMParser.mjs\";\nimport { AMPMMidnightParser } from \"./parsers/AMPMMidnightParser.mjs\";\nimport { DayPeriodParser } from \"./parsers/DayPeriodParser.mjs\";\nimport { Hour1to12Parser } from \"./parsers/Hour1to12Parser.mjs\";\nimport { Hour0to23Parser } from \"./parsers/Hour0to23Parser.mjs\";\nimport { Hour0To11Parser } from \"./parsers/Hour0To11Parser.mjs\";\nimport { Hour1To24Parser } from \"./parsers/Hour1To24Parser.mjs\";\nimport { MinuteParser } from \"./parsers/MinuteParser.mjs\";\nimport { SecondParser } from \"./parsers/SecondParser.mjs\";\nimport { FractionOfSecondParser } from \"./parsers/FractionOfSecondParser.mjs\";\nimport { ISOTimezoneWithZParser } from \"./parsers/ISOTimezoneWithZParser.mjs\";\nimport { ISOTimezoneParser } from \"./parsers/ISOTimezoneParser.mjs\";\nimport { TimestampSecondsParser } from \"./parsers/TimestampSecondsParser.mjs\";\nimport { TimestampMillisecondsParser } from \"./parsers/TimestampMillisecondsParser.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- It's ok, we want any here\nexport const parsers = {\n G: new EraParser(),\n y: new YearParser(),\n Y: new LocalWeekYearParser(),\n R: new ISOWeekYearParser(),\n u: new ExtendedYearParser(),\n Q: new QuarterParser(),\n q: new StandAloneQuarterParser(),\n M: new MonthParser(),\n L: new StandAloneMonthParser(),\n w: new LocalWeekParser(),\n I: new ISOWeekParser(),\n d: new DateParser(),\n D: new DayOfYearParser(),\n E: new DayParser(),\n e: new LocalDayParser(),\n c: new StandAloneLocalDayParser(),\n i: new ISODayParser(),\n a: new AMPMParser(),\n b: new AMPMMidnightParser(),\n B: new DayPeriodParser(),\n h: new Hour1to12Parser(),\n H: new Hour0to23Parser(),\n K: new Hour0To11Parser(),\n k: new Hour1To24Parser(),\n m: new MinuteParser(),\n s: new SecondParser(),\n S: new FractionOfSecondParser(),\n X: new ISOTimezoneWithZParser(),\n x: new ISOTimezoneParser(),\n t: new TimestampSecondsParser(),\n T: new TimestampMillisecondsParser(),\n};\n","import { Parser } from \"../Parser.mjs\";\n\nexport class EraParser extends Parser {\n priority = 140;\n\n parse(dateString, token, match) {\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return (\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n\n // A, B\n case \"GGGGG\":\n return match.era(dateString, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return (\n match.era(dateString, { width: \"wide\" }) ||\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n }\n }\n\n set(date, flags, value) {\n flags.era = value;\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"R\", \"u\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n// | Year | y | yy | yyy | yyyy | yyyyy |\n// |----------|-------|----|-------|-------|-------|\n// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\nexport class YearParser extends Parser {\n priority = 130;\n incompatibleTokens = [\"Y\", \"R\", \"u\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"yy\",\n });\n\n switch (token) {\n case \"y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value) {\n const currentYear = date.getFullYear();\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(normalizedTwoDigitYear, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { getWeekYear } from \"../../../getWeekYear.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// Local week-numbering year\nexport class LocalWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"YY\",\n });\n\n switch (token) {\n case \"Y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"Yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value, options) {\n const currentYear = getWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(\n normalizedTwoDigitYear,\n 0,\n options.firstWeekContainsDate,\n );\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\n// ISO week-numbering year\nexport class ISOWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"R\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n const firstWeekOfYear = constructFrom(date, 0);\n firstWeekOfYear.setFullYear(value, 0, 4);\n firstWeekOfYear.setHours(0, 0, 0, 0);\n return startOfISOWeek(firstWeekOfYear);\n }\n\n incompatibleTokens = [\n \"G\",\n \"y\",\n \"Y\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\nexport class ExtendedYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"u\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"G\", \"y\", \"Y\", \"R\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class QuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n case \"QQ\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class StandAloneQuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n case \"qq\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MonthParser extends Parser {\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"L\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"M\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"MM\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // J, F, ..., D\n case \"MMMMM\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class StandAloneMonthParser extends Parser {\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"LL\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // J, F, ..., D\n case \"LLLLL\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setWeek } from \"../../../setWeek.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// Local week of year\nexport class LocalWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"w\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"wo\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value, options) {\n return startOfWeek(setWeek(date, value, options), options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { getWeek } from \"./getWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link setWeek} function options.\n */\n\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the local week set\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * const result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * const result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\nexport function setWeek(date, week, options) {\n const _date = toDate(date);\n const diff = getWeek(_date, options) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setWeek;\n","import { setISOWeek } from \"../../../setISOWeek.mjs\";\nimport { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// ISO week of year\nexport class ISOWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"I\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"Io\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value) {\n return startOfISOWeek(setISOWeek(date, value));\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { getISOWeek } from \"./getISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The ISO week of the new date\n *\n * @returns The new date with the ISO week set\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * const result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nexport function setISOWeek(date, week) {\n const _date = toDate(date);\n const diff = getISOWeek(_date) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setISOWeek;\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nexport class DayOfYearParser extends Parser {\n priority = 90;\n\n subpriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"D\":\n case \"DD\":\n return parseNumericPattern(numericPatterns.dayOfYear, dateString);\n case \"Do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n }\n\n set(date, _flags, value) {\n date.setMonth(0, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"E\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\n\n// Day of week\nexport class DayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"EEEEE\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"EEEE\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"D\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Local day of week\nexport class LocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"e\":\n case \"ee\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"eo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"eee\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"eeeee\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"eeee\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Stand-alone local day of week\nexport class StandAloneLocalDayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"c\":\n case \"cc\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"co\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"ccc\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // T\n case \"ccccc\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return (\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // Tuesday\n case \"cccc\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"e\",\n \"t\",\n \"T\",\n ];\n}\n","import { setISODay } from \"../../../setISODay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// ISO day of week\nexport class ISODayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => {\n if (value === 0) {\n return 7;\n }\n return value;\n };\n\n switch (token) {\n // 2\n case \"i\":\n case \"ii\": // 02\n return parseNDigits(token.length, dateString);\n // 2nd\n case \"io\":\n return match.ordinalNumber(dateString, { unit: \"day\" });\n // Tue\n case \"iii\":\n return mapValue(\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // T\n case \"iiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tu\n case \"iiiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tuesday\n case \"iiii\":\n default:\n return mapValue(\n match.day(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 7;\n }\n\n set(date, _flags, value) {\n date = setISODay(date, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"E\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"a\":\n case \"aa\":\n case \"aaa\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"aaaaa\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"b\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMMidnightParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"b\":\n case \"bb\":\n case \"bbb\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"bbbbb\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\n// in the morning, in the afternoon, in the evening, at night\nexport class DayPeriodParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"BBBBB\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1to12Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"h\":\n return parseNumericPattern(numericPatterns.hour12h, dateString);\n case \"ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 12;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setHours(0, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"H\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0to23Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"H\":\n return parseNumericPattern(numericPatterns.hour23h, dateString);\n case \"Ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 23;\n }\n\n set(date, _flags, value) {\n date.setHours(value, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0To11Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"K\":\n return parseNumericPattern(numericPatterns.hour11h, dateString);\n case \"Ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"h\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1To24Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"k\":\n return parseNumericPattern(numericPatterns.hour24h, dateString);\n case \"ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 24;\n }\n\n set(date, _flags, value) {\n const hours = value <= 24 ? value % 24 : value;\n date.setHours(hours, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"H\", \"K\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MinuteParser extends Parser {\n priority = 60;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"m\":\n return parseNumericPattern(numericPatterns.minute, dateString);\n case \"mo\":\n return match.ordinalNumber(dateString, { unit: \"minute\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setMinutes(value, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class SecondParser extends Parser {\n priority = 50;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"s\":\n return parseNumericPattern(numericPatterns.second, dateString);\n case \"so\":\n return match.ordinalNumber(dateString, { unit: \"second\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setSeconds(value, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\nexport class FractionOfSecondParser extends Parser {\n priority = 30;\n\n parse(dateString, token) {\n const valueCallback = (value) =>\n Math.floor(value * Math.pow(10, -token.length + 3));\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n\n set(date, _flags, value) {\n date.setMilliseconds(value);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601. +00:00 is `'Z'`)\nexport class ISOTimezoneWithZParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"X\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"XX\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"XXXX\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"XXXXX\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"XXX\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"x\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601)\nexport class ISOTimezoneParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"x\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"xx\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"xxxx\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"xxxxx\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"xxx\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"X\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampSecondsParser extends Parser {\n priority = 40;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value * 1000), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampMillisecondsParser extends Parser {\n priority = 20;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getDefaultOptions } from \"./getDefaultOptions.mjs\";\nimport { enUS as defaultLocale } from \"./locale/en-US.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { parsers } from \"./parse/_lib/parsers.mjs\";\nimport { DateToSystemTimezoneSetter } from \"./parse/_lib/Setter.mjs\";\n\n/**\n * The {@link parse} function options.\n */\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\n\nconst notWhitespaceRegExp = /\\S/;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)\n * and [setWeekYear](https://date-fns.org/docs/setWeekYear)).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateStr - The string to parse\n * @param formatStr - The string of tokens\n * @param referenceDate - defines values missing from the parsed dateString\n * @param options - An object with options.\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @returns The parsed date\n *\n * @throws `options.locale` must contain `match` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\nexport function parse(dateStr, formatStr, referenceDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n if (formatStr === \"\") {\n if (dateStr === \"\") {\n return toDate(referenceDate);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n\n const subFnOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n // If timezone isn't specified, it will be set to the system timezone\n const setters = [new DateToSystemTimezoneSetter()];\n\n const tokens = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter in longFormatters) {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp);\n\n const usedTokens = [];\n\n for (let token of tokens) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n\n const firstCharacter = token[0];\n const parser = parsers[firstCharacter];\n if (parser) {\n const { incompatibleTokens } = parser;\n if (Array.isArray(incompatibleTokens)) {\n const incompatibleToken = usedTokens.find(\n (usedToken) =>\n incompatibleTokens.includes(usedToken.token) ||\n usedToken.token === firstCharacter,\n );\n if (incompatibleToken) {\n throw new RangeError(\n `The format string mustn't contain \\`${incompatibleToken.fullToken}\\` and \\`${token}\\` at the same time`,\n );\n }\n } else if (parser.incompatibleTokens === \"*\" && usedTokens.length > 0) {\n throw new RangeError(\n `The format string mustn't contain \\`${token}\\` and any other token at the same time`,\n );\n }\n\n usedTokens.push({ token: firstCharacter, fullToken: token });\n\n const parseResult = parser.run(\n dateStr,\n token,\n locale.match,\n subFnOptions,\n );\n\n if (!parseResult) {\n return constructFrom(referenceDate, NaN);\n }\n\n setters.push(parseResult.setter);\n\n dateStr = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n // Replace two single quote characters with one single quote character\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n }\n\n // Cut token from string, or, if string doesn't match the token, return Invalid Date\n if (dateStr.indexOf(token) === 0) {\n dateStr = dateStr.slice(token.length);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n }\n\n // Check if the remaining input contains something other than whitespace\n if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const uniquePrioritySetters = setters\n .map((setter) => setter.priority)\n .sort((a, b) => b - a)\n .filter((priority, index, array) => array.indexOf(priority) === index)\n .map((priority) =>\n setters\n .filter((setter) => setter.priority === priority)\n .sort((a, b) => b.subPriority - a.subPriority),\n )\n .map((setterArray) => setterArray[0]);\n\n let date = toDate(referenceDate);\n\n if (isNaN(date.getTime())) {\n return constructFrom(referenceDate, NaN);\n }\n\n const flags = {};\n for (const setter of uniquePrioritySetters) {\n if (!setter.validate(date, subFnOptions)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const result = setter.set(date, flags, subFnOptions);\n // Result is tuple (date, flags)\n if (Array.isArray(result)) {\n date = result[0];\n Object.assign(flags, result[1]);\n // Result is date\n } else {\n date = result;\n }\n }\n\n return constructFrom(referenceDate, date);\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default parse;\n","import { getDefaultOptions as getInternalDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * @name getDefaultOptions\n * @category Common Helpers\n * @summary Get default options.\n * @pure false\n *\n * @description\n * Returns an object that contains defaults for\n * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`\n * arguments for all functions.\n *\n * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).\n *\n * @returns The default options\n *\n * @example\n * const result = getDefaultOptions()\n * //=> {}\n *\n * @example\n * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })\n * const result = getDefaultOptions()\n * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }\n */\nexport function getDefaultOptions() {\n return Object.assign({}, getInternalDefaultOptions());\n}\n\n// Fallback for modularized imports:\nexport default getDefaultOptions;\n","import Resource from '../resource';\nimport { format, parse, isValid } from 'date-fns';\n\nexport default class StoreHour extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-hour', options);\n }\n\n get day() {\n return this.getAttribute('day');\n }\n\n get isClosed() {\n return this.getAttribute('start') === null && this.getAttribute('end') === null;\n }\n\n get is24Hours() {\n const start = this.startDateInstance;\n const end = this.endDateInstance;\n const diff = Math.abs(start - end);\n const hours = Math.floor(diff / 1000 / 60) / 60;\n\n return hours > 23;\n }\n\n get startDateInstance() {\n if (!this.hasAttribute('start')) {\n return null;\n }\n\n const start = this.getAttribute('start');\n const includesSeconds = start.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(start, format, new Date());\n }\n\n get endDateInstance() {\n if (!this.hasAttribute('end')) {\n return null;\n }\n\n const end = this.getAttribute('end');\n const includesSeconds = end.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(end, format, new Date());\n }\n\n get humanReadableHoursRange() {\n if (!isValid(this.startDateInstance) || !isValid(this.endDateInstance)) {\n return `${this.start} - ${this.end}`;\n }\n\n return `${format(this.startDateInstance, 'p')} - ${format(this.endDateInstance, 'p')}`;\n }\n\n get humanReadableHours() {\n if (this.isClosed) {\n return 'Closed';\n }\n\n if (this.is24Hours) {\n return '24 Hours';\n }\n\n return this.humanReadableHoursRange;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreHour from './store-hour';\nimport { Collection } from '@fleetbase/sdk';\nimport { format } from 'date-fns';\n\nexport default class StoreLocation extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-location', options);\n }\n\n get latitude() {\n return this.getAttribute('place.location.coordinates.1');\n }\n\n get longitude() {\n return this.getAttribute('place.location.coordinates.0');\n }\n\n get hours() {\n return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes)));\n }\n\n get isAlwaysOpen() {\n return this.hours.every((hour) => hour?.is24Hours);\n }\n\n get today() {\n const today = format(new Date(), 'EEEE');\n\n return this.schedule[today];\n }\n\n get schedule() {\n const schedule = {};\n const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\n for (let i = 0; i < week.length; i++) {\n const day = week[i];\n\n schedule[day] = new Collection();\n }\n\n for (let i = 0; i < this.hours.length; i++) {\n const hour = this.hours.objectAt(i);\n\n schedule[hour.day].pushObject(hour);\n }\n\n return schedule;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Review from './review';\nimport { Collection, Place } from '@fleetbase/sdk';\n\nexport default class Store extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store', options);\n }\n\n getReviews(params = {}) {\n return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n\n getLocations(params = {}) {\n return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {\n return new Collection(\n storeLocations.map((attributes) => {\n if (attributes.place) {\n attributes.place = new Place(attributes.place);\n }\n\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getLocation(id) {\n return this.adapter.get(`locations/${id}`, { store: this.id }).then((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n });\n }\n\n getPaymentGateways(params = {}) {\n return this.adapter.get('gateways', params).then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateway(id) {\n return this.adapter.get(`gateways/${id}`).then((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n });\n }\n}\n","import { Collection } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport PaymentGateway from './payment-gateway';\nimport Store from './store';\nimport StoreLocation from './store-location';\n\nexport default class Network extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'network', options);\n }\n\n getTags(params = {}) {\n return this.adapter.get('tags', params);\n }\n\n async getResourceCollection(endpoint, ResourceClass, params = {}) {\n try {\n const resources = await this.adapter.get(endpoint, params);\n return new Collection(resources.map((attributes) => new ResourceClass(attributes, this.adapter)));\n } catch (error) {\n console.error(`Error fetching ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getStores(params = {}) {\n return this.getResourceCollection('stores', Store, params);\n }\n\n async getStoreLocations(params = {}) {\n return this.getResourceCollection('store-locations', StoreLocation, params);\n }\n\n async getPaymentGateways() {\n return this.getResourceCollection('gateways', PaymentGateway);\n }\n}\n","import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk';\nimport StorefrontStore from '../store';\nimport { formatCurrency, isEmpty } from '../utils';\n\nconst { isArray } = Array;\n\nexport default class DeliveryServiceQuote extends ServiceQuote {\n constructor(attributes = {}, adapter, options = {}) {\n if (attributes instanceof Adapter) {\n return super({}, attributes, 'service-quote', options);\n }\n\n super(attributes, adapter, 'service-quote', options);\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get formattedAmount() {\n const { amount, currency } = this.getAttributes(['amount', 'currency']);\n\n if (isEmpty(amount) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(amount / 100, currency);\n }\n\n async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n if (destination?.id) {\n destination = destination.id;\n }\n if (cart?.id) {\n cart = cart.id;\n }\n\n try {\n const serviceQuotes = await this.adapter.get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n });\n\n if (isArray(serviceQuotes)) {\n return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter)));\n }\n\n return new DeliveryServiceQuote(serviceQuotes, this.adapter);\n } catch (error) {\n console.error('Error fetching service quotes:', error);\n throw error;\n }\n }\n\n static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) {\n const quote = new DeliveryServiceQuote(adapter);\n return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all);\n }\n}\n","import { Order, StoreActions, isResource } from '@fleetbase/sdk';\nimport Resource from '../resource';\n\nconst checkoutActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n initialize: function (customer, cart, serviceQuote, gateway, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n if (isResource(gateway)) {\n gateway = gateway.getAttribute('code');\n }\n\n return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options);\n },\n\n captureOrder: function (token, transactionDetails = {}, options = {}) {\n return this.adapter.get(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson));\n },\n});\n\nexport default class Checkout extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'checkout', options);\n }\n\n initialize() {\n return this.store.initialize(...arguments);\n }\n\n captureOrder() {\n return this.store.captureOrder(...arguments);\n }\n}\n\nexport { checkoutActions };\n","import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources';\nimport { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk';\n\nconst resources = {\n Product,\n Category,\n Customer,\n Cart,\n DeliveryServiceQuote,\n Store,\n StoreLocation,\n StoreHour,\n Checkout,\n Review,\n};\n\nconst adapters = {\n BrowserAdapter,\n NodeAdapter,\n};\n\nclass Resolver {\n constructor() {\n this.resources = resources;\n this.adapters = adapters;\n\n return this.lookup(...arguments);\n }\n\n lookup(type, className) {\n const key = pluralize(type);\n const params = [...arguments].slice(2);\n\n if (!this[key]) {\n throw new Error('Attempted to resolve invalid type');\n }\n\n if (!this[key][className]) {\n throw new Error(`No ${singularize(type)} named ${className} to resolve`);\n }\n\n return new this[key][className](...params);\n }\n}\n\nconst lookup = function () {\n return new Resolver(...arguments);\n};\n\nexport { Resolver, lookup };\n","import { Store, classify, extendStoreActions } from '@fleetbase/sdk';\nimport { lookup } from './resolver';\n\nexport default class StorefrontStore extends Store {\n constructor() {\n super(...arguments);\n }\n\n extendActions(actions = []) {\n return extendStoreActions(this, actions);\n }\n\n serialize(json) {\n return lookup('resource', classify(this.resource), json, this.adapter);\n }\n}\n","import StorefrontStore from './store';\nimport { detectAdapter, isKeyValid } from './utils';\nimport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network } from './resources';\nimport { cartActions } from './resources/cart';\nimport { customerActions } from './resources/customer';\nimport { checkoutActions } from './resources/checkout';\nimport { reviewActions } from './resources/review';\nimport { Collection } from '@fleetbase/sdk';\n\n/**\n * // instance\n * const storefront = new Storefront();\n *\n */\n\nexport default class Storefront {\n /**\n * Builds an instance of the Fleetbase Storefront SDK\n *\n * @param {String} storeKey The access key for the storefront store\n * @param {Object} config The config object\n * @param {Boolean} debug Enable debug mode\n * @return {Storefront} Instance\n */\n constructor(storeKey, config = {}, debug = false) {\n this.version = config.version || 'v1';\n this.options = {\n version: this.version,\n host: config.host || 'https://api.fleetbase.io',\n namespace: `storefront/${this.version}` || config.namespace,\n publicKey: storeKey,\n debug,\n };\n\n if (!isKeyValid(storeKey)) {\n throw new Error('⚠️ Invalid Storefront key given to Storefront SDK');\n }\n\n this.adapter = config.adapter || detectAdapter(this.options);\n\n this.products = new StorefrontStore('product', this.adapter);\n this.categories = new StorefrontStore('category', this.adapter);\n this.reviews = new StorefrontStore('review', this.adapter).extendActions(reviewActions);\n this.customers = new StorefrontStore('customer', this.adapter).extendActions(customerActions);\n this.cart = new StorefrontStore('cart', this.adapter).extendActions(cartActions);\n this.checkout = new StorefrontStore('checkout', this.adapter).extendActions(checkoutActions);\n }\n\n /** loads information about this storefront */\n about() {\n return this.adapter.get('about');\n }\n\n /** search products in store or network */\n search(query, options = {}) {\n return this.adapter.get('search', { query, ...options }).then((products) => {\n return new Collection(products.map((product) => new Product(product)));\n });\n }\n\n static newInstance() {\n return new Storefront(...arguments);\n }\n\n setAdapter(adapter) {\n this.adapter = adapter;\n }\n\n getAdapter() {\n return this.adapter;\n }\n}\n\nexport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network };\n","import { lookup } from '../resolver';\nimport { isNodeEnvironment } from '@fleetbase/sdk';\n\nconst detectAdapter = (options = {}) => {\n if (isNodeEnvironment()) {\n return lookup('adapter', 'NodeAdapter', options);\n }\n\n return lookup('adapter', 'BrowserAdapter', options);\n};\n\nexport default detectAdapter;\n"],"names":["StorefrontResource","_Resource","_inherits","Resource","_super","_createSuper","_classCallCheck","apply","this","arguments","_createClass","key","value","adapter","_this$options","store","StorefrontStore","resource","onAfterFetch","syncAttributes","bind","actions","options","reviewActions","StoreActions","count","storeId","length","undefined","params","get","concat","namespace","Review","attributes","call","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isEmpty","obj","none","size","objectType","_typeof","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","_this","id","then","reviews","Collection","map","Category","category","products","customerActions","login","identity","password","test","isPhone","post","phone","Error","_objectSpread","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","_getOrderHistory","_getSavedPlaces","_performAuthorizedRequest","_syncDevice","_asyncToGenerator","_regeneratorRuntime","mark","_callee","token","wrap","_context","prev","next","abrupt","setHeaders","stop","_x","_callee2","endpoint","method","headers","response","_args2","_context2","toLowerCase","sent","t0","console","error","_x2","_callee3","places","_this2","_context3","performAuthorizedRequest","Place","_callee4","orders","_this3","_args4","_context4","Order","isArray","Array","cartActions","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","PaymentGateway","type","toDate","argument","argStr","Object","prototype","toString","Date","constructor","NaN","constructFrom","date","addDays","_date","isNaN","setDate","getDate","millisecondsInWeek","millisecondsInDay","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","locale","day","getDay","diff","setHours","startOfISOWeek","getISOWeekYear","year","getFullYear","fourthOfJanuaryOfNextYear","setFullYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTime","startOfDay","getTimezoneOffsetInMilliseconds","utcDate","UTC","getMonth","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isValid","Number","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","buildFormatLongFn","args","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","valuesArray","context","formattingValues","defaultFormattingWidth","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","array","predicate","pattern","object","hasOwnProperty","findKey","valueCallback","rest","slice","enUS","formatDistance","result","tokenValue","replace","addSuffix","comparison","formatRelative","_baseDate","_options","localize","ordinalNumber","dirtyNumber","number","rem100","era","narrow","abbreviated","wide","quarter","month","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","firstWeekContainsDate","getDayOfYear","dateLeft","dateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","Math","round","differenceInCalendarDays","cleanDate","startOfYear","getISOWeek","fourthOfJanuary","startOfISOWeekYear","getWeekYear","firstWeekOfNextYear","firstWeekOfThisYear","getWeek","firstWeek","startOfWeekYear","addLeadingZeros","targetLength","abs","padStart","lightFormatters","y","signedYear","M","d","a","dayPeriodEnumValue","toUpperCase","h","H","m","s","S","numberOfDigits","milliseconds","floor","pow","dayPeriodEnum","formatters","G","unit","Y","signedWeekYear","weekYear","R","u","Q","ceil","q","L","w","week","I","isoWeek","D","dayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","b","hours","B","K","k","X","_localize","timezoneOffset","_originalDate","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","originalDate","T","offset","delimiter","sign","absOffset","minutes","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeLongFormatter","datePattern","timePattern","dateTimeFormat","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","indexOf","isProtectedWeekYearToken","throwProtectedError","input","RangeError","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","defaultLocale","formatterOptions","substring","firstCharacter","longFormatter","join","matched","cleanEscapedString","formatter","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","Setter","subPriority","validate","_utcDate","ValueSetter","validateValue","setValue","priority","super","set","flags","DateToSystemTimezoneSetter","timestampIsSet","fromDate","transpose","Parser","run","dateString","parse","setter","_value","numericPatterns","timezonePatterns","mapValue","parseFnResult","mapFn","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","isLeapYearIndex","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","setDay","currentDay","delta","setISODay","getISODay","parsers","incompatibleTokens","isTwoDigitYear","normalizedTwoDigitYear","_flags","firstWeekOfYear","setMonth","setWeek","setISOWeek","isLeapYear","subpriority","wholeWeekDays","isPM","setMinutes","setSeconds","setMilliseconds","notWhitespaceRegExp","dateStr","referenceDate","assign","getInternalDefaultOptions","subFnOptions","setters","tokens","usedTokens","parser","incompatibleToken","find","usedToken","includes","fullToken","push","uniquePrioritySetters","sort","filter","setterArray","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","Store","storeLocations","place","_this4","gateways","_this5","Network","_getPaymentGateways","_getStoreLocations","_getStores","_getResourceCollection","ResourceClass","resources","_args","getResourceCollection","_args3","DeliveryServiceQuote","_ServiceQuote","ServiceQuote","_getFromCart","_fetchServiceQuotesFromCart","Adapter","_possibleConstructorReturn","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","_x3","quote","fetchServiceQuotesFromCart","_x4","_x5","_x6","_x7","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","_this$store","_this$store2","adapters","BrowserAdapter","NodeAdapter","Resolver","lookup","className","pluralize","singularize","_construct","_toConsumableArray","_Store","extendStoreActions","json","classify","Storefront","storeKey","debug","version","host","publicKey","startsWith","isNodeEnvironment","detectAdapter","categories","extendActions","customers","checkout","product"],"mappings":"stVACsC,IAEjBA,WAAkBC,GAAAC,EAAAF,EAASG,GAAT,IAAAC,EAAAC,EAAAL,GAAA,SAAAA,IAAA,OAAAM,OAAAN,GAAAI,EAAAG,MAAAC,KAAAC,UAAA,CAelC,OAfkCC,EAAAV,EAAA,CAAA,CAAAW,IAAA,aAAAC,MAOnC,SAAWC,GAAS,IAAAC,EAOhB,OANAN,KAAKK,QAAUA,EACfL,KAAKO,MAAQ,IAAIC,GAAgBR,KAAKS,SAAUJ,EAAS,CACrDK,aAAcV,KAAKW,eAAeC,KAAKZ,MACvCa,QAAqBP,QAAdA,EAAEN,KAAKc,eAALR,IAAYA,OAAZA,EAAAA,EAAcO,UAGpBb,IACX,KAACR,CAAA,ICfCuB,EAAgB,IAAIC,EAAa,CACnCC,MAAO,SAAUC,GAAuB,IAAdJ,EAAOb,UAAAkB,OAAA,QAAAC,IAAAnB,UAAA,GAAAA,UAAA,GAAG,CAAA,EAC1BoB,EAAS,CAAA,EAMf,O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AAK,SAACM,GAC3D,OAAO,IAAIJ,EAAWI,EAASH,KAAI,SAACiiB,GAAO,OAAK,IAAI7iB,EAAQ6iB,EAAQ,IACxE,GACJ,GAAC,CAAAplB,IAAA,aAAAC,MAMD,SAAWC,GACPL,KAAKK,QAAUA,CACnB,GAAC,CAAAF,IAAA,aAAAC,MAED,WACI,OAAOJ,KAAKK,OAChB,IAAC,CAAA,CAAAF,IAAA,cAAAC,MAVD,WACI,OAAAgkB,EAAWM,EAAUld,MAAA4B,UAAA4G,MAAArO,KAAI1B,WAC7B,KAACykB,CAAA,CA/C0B","x_google_ignoreList":[11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90]} \ No newline at end of file +{"version":3,"file":"storefront.js","sources":["../../src/resource.js","../../src/resources/review.js","../../src/utils/format-currency.js","../../src/utils/is-key-valid.js","../../src/utils/is-empty.js","../../src/resources/product.js","../../src/resources/category.js","../../src/resources/customer.js","../../src/utils/is-phone.js","../../src/resources/cart.js","../../src/resources/payment-gateway.js","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/toDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constructFrom.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/addDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/defaultOptions.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isValid.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/match.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDayOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/differenceInCalendarDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/addLeadingZeros.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/lightFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/formatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/longFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/protectedTokens.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/format.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Setter.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/transpose.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/utils.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DateParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/EraParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDefaultOptions.mjs","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/store.js","../../src/resources/network.js","../../src/resources/delivery-service-quote.js","../../src/resources/checkout.js","../../src/resolver.js","../../src/store.js","../../src/storefront.js","../../src/utils/detect-adapter.js"],"sourcesContent":["import { Resource } from '@fleetbase/sdk';\nimport StorefrontStore from './store';\n\nexport default class StorefrontResource extends Resource {\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n}\n","import Resource from '../resource';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst reviewActions = new StoreActions({\n count: function (storeId, options = {}) {\n const params = {};\n\n if (storeId) {\n params.store = storeId;\n }\n\n return this.adapter.get(`${this.namespace}/count`, params, options);\n },\n});\n\nexport default class Review extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'review', options);\n }\n\n getMedia() {\n // @todo\n }\n\n getPhotos() {\n // @todo\n }\n\n getVideos() {\n // @todo\n }\n}\n\nexport { reviewActions };\n","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n currencyDisplay,\n }).format(amount);\n}\n","const isKeyValid = (key) => {\n return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_'));\n};\n\nexport default isKeyValid;\n","const isEmpty = (obj) => {\n const none = obj === null || obj === undefined;\n if (none) {\n return none;\n }\n\n if (typeof obj.size === 'number') {\n return !obj.size;\n }\n\n const objectType = typeof obj;\n\n if (objectType === 'object') {\n const { size } = obj;\n if (typeof size === 'number') {\n return !size;\n }\n }\n\n if (typeof obj.length === 'number' && objectType !== 'function') {\n return !obj.length;\n }\n\n if (objectType === 'object') {\n const { length } = obj;\n if (typeof length === 'number') {\n return !length;\n }\n }\n\n return false;\n};\n\nexport default isEmpty;\n","import Resource from '../resource';\nimport Review from './review';\nimport { formatCurrency, isEmpty } from '../utils';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Product extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'product', options);\n }\n\n variants() {\n return this.getAttribute('variants');\n }\n\n addons() {\n return this.getAttribute('addon_categories');\n }\n\n get isOnSale() {\n return this.getAttribute('is_on_sale');\n }\n\n get isNotOnSale() {\n return !this.getAttribute('is_on_sale');\n }\n\n get formattedAmount() {\n const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']);\n\n if (this.isOnSale) {\n if (isEmpty(sale_price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(sale_price / 100, currency);\n }\n\n if (isEmpty(price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(price / 100, currency);\n }\n\n getReviews() {\n return this.adapter.get('reviews', { store: this.id }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n}\n","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Category extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'category', options);\n }\n\n getProducts() {\n return this.adapter.get('products', { category: this.id }).then((products) => {\n return new Collection(products.map((attributes) => new Product(attributes, this.adapter)));\n });\n }\n}\n","import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport StorefrontStore from '../store';\nimport { isPhone } from '../utils';\n\nconst customerActions = new StoreActions({\n // const { error } = await storefront.customers.login('+1 111-1111');\n login: function (identity, password = null, attributes = {}) {\n // handle phone number authentication\n if (isPhone(identity)) {\n return this.adapter.post('customers/login-with-sms', { phone: identity });\n }\n\n if (!password) {\n throw new Error('Login requires password!');\n }\n\n return this.adapter.post('customers/login', { identity, password, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n verifyCode: function (identity, code, attributes = {}) {\n return this.adapter.post('customers/verify-code', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n requestCreationCode(identity, mode = 'email') {\n return this.adapter.post('customers/request-creation-code', {\n identity,\n mode,\n });\n },\n\n create(identity, code, attributes = {}) {\n return this.adapter.post('customers', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id) {\n return this.findRecord(id);\n },\n});\n\nexport default class Customer extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'customer', {\n actions: customerActions,\n ...options,\n });\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get token() {\n return this.getAttribute('token');\n }\n\n async syncDevice(token) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/register-device', token)\n .then(() => {\n return this;\n });\n }\n\n async performAuthorizedRequest(endpoint, params = {}, method = 'GET') {\n try {\n const headers = { 'Customer-Token': this.token };\n const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params);\n return response;\n } catch (error) {\n console.error(`Error in ${method} request to ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getSavedPlaces() {\n try {\n const places = await this.performAuthorizedRequest('customers/places');\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve saved places');\n }\n }\n\n async getOrderHistory(params = {}) {\n try {\n const orders = await this.performAuthorizedRequest('customers/orders', params);\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve order history');\n }\n }\n}\n\nexport { customerActions };\n","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n};\n\nexport default isPhone;\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\n\nconst cartActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n add: function (id, productId, quantity = 1, data = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/${id}/${productId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n update: function (id, cartItemId, quantity, data = {}, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/${cartItemId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n remove: function (id, cartItemId, options = {}) {\n return this.adapter.delete(`${this.namespace}/${id}/${cartItemId}`, {}, options).then(this.afterFetch.bind(this));\n },\n\n empty: function (id, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/empty`, {}, options).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id = '') {\n return this.findRecord(id);\n },\n});\n\nexport default class Cart extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'cart', { actions: cartActions, ...options });\n }\n\n add(productId, quantity = 1, data = {}, options = {}) {\n if (productId instanceof Product) {\n productId = productId.id;\n }\n\n return this.store.add(this.id, productId, quantity, data, options);\n }\n\n update(cartItemId, quantity, data = {}, options = {}) {\n return this.store.update(this.id, cartItemId, quantity, data, options);\n }\n\n remove(cartItemId, options = {}) {\n return this.store.remove(this.id, cartItemId, options);\n }\n\n empty(options = {}) {\n return this.store.empty(this.id, options);\n }\n\n delete() {\n return this.destroy();\n }\n\n refresh() {\n return this.store.retrieve(this.id);\n }\n\n subtotal() {\n let subtotal = 0;\n\n this.contents().forEach((cartItem) => {\n subtotal += cartItem.subtotal;\n });\n\n return subtotal;\n }\n\n contents() {\n return this.getAttribute('items', []);\n }\n\n hasProduct(productId) {\n return this.contents().findIndex((cartItem) => cartItem.product_id === productId) !== -1;\n }\n\n get isEmpty() {\n const contents = this.contents();\n\n if (!isArray(contents)) {\n return true;\n }\n\n return contents.length === 0;\n }\n\n get isNotEmpty() {\n return !this.isEmpty;\n }\n}\n\nexport { cartActions };\n","import Resource from '../resource';\n\nexport default class PaymentGateway extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'payment-gateway', options);\n }\n\n get type() {\n return this.getAttribute('type');\n }\n\n get code() {\n return this.getAttribute('code');\n }\n\n get isCashGateway() {\n return this.type === 'cash';\n }\n\n get isStripeGateway() {\n return this.type === 'stripe';\n }\n\n setCheckoutToken(token) {\n this.token = token;\n }\n\n getCheckoutToken() {\n return this.token;\n }\n\n // remove default resource methods\n findRecord() {\n throw new Error('There is no findRecord() method for payment gateways!');\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method for payment gateways!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method for payment gateways!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method for payment gateways!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method for payment gateways!');\n }\n}\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const utcDate = new Date(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}\n","import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n startOfDayRight.getTime() -\n getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff =\n startOfISOWeek(_date).getTime() - startOfISOWeekYear(_date).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff =\n startOfWeek(_date, options).getTime() -\n startOfWeekYear(_date, options).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.floor(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.floor(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const protectedDayOfYearTokens = [\"D\", \"DD\"];\nconst protectedWeekYearTokens = [\"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\n\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\n\nexport function throwProtectedError(token, format, input) {\n if (token === \"YYYY\") {\n throw new RangeError(\n `Use \\`yyyy\\` instead of \\`YYYY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"YY\") {\n throw new RangeError(\n `Use \\`yy\\` instead of \\`YY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"D\") {\n throw new RangeError(\n `Use \\`d\\` instead of \\`D\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"DD\") {\n throw new RangeError(\n `Use \\`dd\\` instead of \\`DD\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n }\n}\n","import { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate,\n };\n\n const result = formatStr\n .match(longFormattingTokensRegExp)\n .map(function (substring) {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n const formatter = formatters[firstCharacter];\n if (formatter) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n return formatter(\n originalDate,\n substring,\n locale.localize,\n formatterOptions,\n );\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return substring;\n })\n .join(\"\");\n\n return result;\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { transpose } from \"../../transpose.mjs\";\nimport { constructFrom } from \"../../constructFrom.mjs\";\n\nconst TIMEZONE_UNIT_PRIORITY = 10;\n\nexport class Setter {\n subPriority = 0;\n\n validate(_utcDate, _options) {\n return true;\n }\n}\n\nexport class ValueSetter extends Setter {\n constructor(\n value,\n\n validateValue,\n\n setValue,\n\n priority,\n subPriority,\n ) {\n super();\n this.value = value;\n this.validateValue = validateValue;\n this.setValue = setValue;\n this.priority = priority;\n if (subPriority) {\n this.subPriority = subPriority;\n }\n }\n\n validate(date, options) {\n return this.validateValue(date, this.value, options);\n }\n\n set(date, flags, options) {\n return this.setValue(date, flags, this.value, options);\n }\n}\n\nexport class DateToSystemTimezoneSetter extends Setter {\n priority = TIMEZONE_UNIT_PRIORITY;\n subPriority = -1;\n set(date, flags) {\n if (flags.timestampIsSet) return date;\n return constructFrom(date, transpose(date, Date));\n }\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name transpose\n * @category Generic Helpers\n * @summary Transpose the date to the given constructor.\n *\n * @description\n * The function transposes the date to the given constructor. It helps you\n * to transpose the date in the system time zone to say `UTCDate` or any other\n * date extension.\n *\n * @typeParam DateInputType - The input `Date` type derived from the passed argument.\n * @typeParam DateOutputType - The output `Date` type derived from the passed constructor.\n *\n * @param fromDate - The date to use values from\n * @param constructor - The date constructor to use\n *\n * @returns Date transposed to the given constructor\n *\n * @example\n * // Create July 10, 2022 00:00 in locale time zone\n * const date = new Date(2022, 6, 10)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'\n *\n * @example\n * // Transpose the date to July 10, 2022 00:00 in UTC\n * transpose(date, UTCDate)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'\n */\nexport function transpose(fromDate, constructor) {\n const date =\n constructor instanceof Date\n ? constructFrom(constructor, 0)\n : new constructor(0);\n date.setFullYear(\n fromDate.getFullYear(),\n fromDate.getMonth(),\n fromDate.getDate(),\n );\n date.setHours(\n fromDate.getHours(),\n fromDate.getMinutes(),\n fromDate.getSeconds(),\n fromDate.getMilliseconds(),\n );\n return date;\n}\n\n// Fallback for modularized imports:\nexport default transpose;\n","import { ValueSetter } from \"./Setter.mjs\";\n\nexport class Parser {\n run(dateString, token, match, options) {\n const result = this.parse(dateString, token, match, options);\n if (!result) {\n return null;\n }\n\n return {\n setter: new ValueSetter(\n result.value,\n this.validate,\n this.set,\n this.priority,\n this.subPriority,\n ),\n rest: result.rest,\n };\n }\n\n validate(_utcDate, _value, _options) {\n return true;\n }\n}\n","export const numericPatterns = {\n month: /^(1[0-2]|0?\\d)/, // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/, // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/, // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/, // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/, // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/, // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/, // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/, // 0 to 12\n minute: /^[0-5]?\\d/, // 0 to 59\n second: /^[0-5]?\\d/, // 0 to 59\n\n singleDigit: /^\\d/, // 0 to 9\n twoDigits: /^\\d{1,2}/, // 0 to 99\n threeDigits: /^\\d{1,3}/, // 0 to 999\n fourDigits: /^\\d{1,4}/, // 0 to 9999\n\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/, // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/, // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/, // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/, // 0 to 9999, -0 to -9999\n};\n\nexport const timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/,\n};\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n millisecondsInSecond,\n} from \"../../constants.mjs\";\nimport { numericPatterns } from \"./constants.mjs\";\n\nexport function mapValue(parseFnResult, mapFn) {\n if (!parseFnResult) {\n return parseFnResult;\n }\n\n return {\n value: mapFn(parseFnResult.value),\n rest: parseFnResult.rest,\n };\n}\n\nexport function parseNumericPattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n return {\n value: parseInt(matchResult[0], 10),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseTimezonePattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n // Input is 'Z'\n if (matchResult[0] === \"Z\") {\n return {\n value: 0,\n rest: dateString.slice(1),\n };\n }\n\n const sign = matchResult[1] === \"+\" ? 1 : -1;\n const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n\n return {\n value:\n sign *\n (hours * millisecondsInHour +\n minutes * millisecondsInMinute +\n seconds * millisecondsInSecond),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseAnyDigitsSigned(dateString) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);\n}\n\nexport function parseNDigits(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function parseNDigitsSigned(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^-?\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function dayPeriodEnumToHours(dayPeriod) {\n switch (dayPeriod) {\n case \"morning\":\n return 4;\n case \"evening\":\n return 17;\n case \"pm\":\n case \"noon\":\n case \"afternoon\":\n return 12;\n case \"am\":\n case \"midnight\":\n case \"night\":\n default:\n return 0;\n }\n}\n\nexport function normalizeTwoDigitYear(twoDigitYear, currentYear) {\n const isCommonEra = currentYear > 0;\n // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n\n let result;\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n const rangeEnd = absCurrentYear + 50;\n const rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n const isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nexport function isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DAYS_IN_MONTH_LEAP_YEAR = [\n 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n];\n\n// Day of the month\nexport class DateParser extends Parser {\n priority = 90;\n subPriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"d\":\n return parseNumericPattern(numericPatterns.date, dateString);\n case \"do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n const month = date.getMonth();\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n }\n\n set(date, _flags, value) {\n date.setDate(value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { addDays } from \"./addDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link setDay} function options.\n */\n\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the week of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the day of the week set\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setDay(date, day, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const currentDay = _date.getDay();\n\n const remainder = day % 7;\n const dayIndex = (remainder + 7) % 7;\n\n const delta = 7 - weekStartsOn;\n const diff =\n day < 0 || day > 6\n ? day - ((currentDay + delta) % 7)\n : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setDay;\n","import { addDays } from \"./addDays.mjs\";\nimport { getISODay } from \"./getISODay.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the ISO week of the new date\n *\n * @returns The new date with the day of the ISO week set\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * const result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setISODay(date, day) {\n const _date = toDate(date);\n const currentDay = getISODay(_date);\n const diff = day - currentDay;\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setISODay;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * const result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nexport function getISODay(date) {\n const _date = toDate(date);\n let day = _date.getDay();\n\n if (day === 0) {\n day = 7;\n }\n\n return day;\n}\n\n// Fallback for modularized imports:\nexport default getISODay;\n","import { EraParser } from \"./parsers/EraParser.mjs\";\nimport { YearParser } from \"./parsers/YearParser.mjs\";\nimport { LocalWeekYearParser } from \"./parsers/LocalWeekYearParser.mjs\";\nimport { ISOWeekYearParser } from \"./parsers/ISOWeekYearParser.mjs\";\nimport { ExtendedYearParser } from \"./parsers/ExtendedYearParser.mjs\";\nimport { QuarterParser } from \"./parsers/QuarterParser.mjs\";\nimport { StandAloneQuarterParser } from \"./parsers/StandAloneQuarterParser.mjs\";\nimport { MonthParser } from \"./parsers/MonthParser.mjs\";\nimport { StandAloneMonthParser } from \"./parsers/StandAloneMonthParser.mjs\";\nimport { LocalWeekParser } from \"./parsers/LocalWeekParser.mjs\";\nimport { ISOWeekParser } from \"./parsers/ISOWeekParser.mjs\";\nimport { DateParser } from \"./parsers/DateParser.mjs\";\nimport { DayOfYearParser } from \"./parsers/DayOfYearParser.mjs\";\nimport { DayParser } from \"./parsers/DayParser.mjs\";\nimport { LocalDayParser } from \"./parsers/LocalDayParser.mjs\";\nimport { StandAloneLocalDayParser } from \"./parsers/StandAloneLocalDayParser.mjs\";\nimport { ISODayParser } from \"./parsers/ISODayParser.mjs\";\nimport { AMPMParser } from \"./parsers/AMPMParser.mjs\";\nimport { AMPMMidnightParser } from \"./parsers/AMPMMidnightParser.mjs\";\nimport { DayPeriodParser } from \"./parsers/DayPeriodParser.mjs\";\nimport { Hour1to12Parser } from \"./parsers/Hour1to12Parser.mjs\";\nimport { Hour0to23Parser } from \"./parsers/Hour0to23Parser.mjs\";\nimport { Hour0To11Parser } from \"./parsers/Hour0To11Parser.mjs\";\nimport { Hour1To24Parser } from \"./parsers/Hour1To24Parser.mjs\";\nimport { MinuteParser } from \"./parsers/MinuteParser.mjs\";\nimport { SecondParser } from \"./parsers/SecondParser.mjs\";\nimport { FractionOfSecondParser } from \"./parsers/FractionOfSecondParser.mjs\";\nimport { ISOTimezoneWithZParser } from \"./parsers/ISOTimezoneWithZParser.mjs\";\nimport { ISOTimezoneParser } from \"./parsers/ISOTimezoneParser.mjs\";\nimport { TimestampSecondsParser } from \"./parsers/TimestampSecondsParser.mjs\";\nimport { TimestampMillisecondsParser } from \"./parsers/TimestampMillisecondsParser.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- It's ok, we want any here\nexport const parsers = {\n G: new EraParser(),\n y: new YearParser(),\n Y: new LocalWeekYearParser(),\n R: new ISOWeekYearParser(),\n u: new ExtendedYearParser(),\n Q: new QuarterParser(),\n q: new StandAloneQuarterParser(),\n M: new MonthParser(),\n L: new StandAloneMonthParser(),\n w: new LocalWeekParser(),\n I: new ISOWeekParser(),\n d: new DateParser(),\n D: new DayOfYearParser(),\n E: new DayParser(),\n e: new LocalDayParser(),\n c: new StandAloneLocalDayParser(),\n i: new ISODayParser(),\n a: new AMPMParser(),\n b: new AMPMMidnightParser(),\n B: new DayPeriodParser(),\n h: new Hour1to12Parser(),\n H: new Hour0to23Parser(),\n K: new Hour0To11Parser(),\n k: new Hour1To24Parser(),\n m: new MinuteParser(),\n s: new SecondParser(),\n S: new FractionOfSecondParser(),\n X: new ISOTimezoneWithZParser(),\n x: new ISOTimezoneParser(),\n t: new TimestampSecondsParser(),\n T: new TimestampMillisecondsParser(),\n};\n","import { Parser } from \"../Parser.mjs\";\n\nexport class EraParser extends Parser {\n priority = 140;\n\n parse(dateString, token, match) {\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return (\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n\n // A, B\n case \"GGGGG\":\n return match.era(dateString, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return (\n match.era(dateString, { width: \"wide\" }) ||\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n }\n }\n\n set(date, flags, value) {\n flags.era = value;\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"R\", \"u\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n// | Year | y | yy | yyy | yyyy | yyyyy |\n// |----------|-------|----|-------|-------|-------|\n// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\nexport class YearParser extends Parser {\n priority = 130;\n incompatibleTokens = [\"Y\", \"R\", \"u\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"yy\",\n });\n\n switch (token) {\n case \"y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value) {\n const currentYear = date.getFullYear();\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(normalizedTwoDigitYear, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { getWeekYear } from \"../../../getWeekYear.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// Local week-numbering year\nexport class LocalWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"YY\",\n });\n\n switch (token) {\n case \"Y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"Yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value, options) {\n const currentYear = getWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(\n normalizedTwoDigitYear,\n 0,\n options.firstWeekContainsDate,\n );\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\n// ISO week-numbering year\nexport class ISOWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"R\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n const firstWeekOfYear = constructFrom(date, 0);\n firstWeekOfYear.setFullYear(value, 0, 4);\n firstWeekOfYear.setHours(0, 0, 0, 0);\n return startOfISOWeek(firstWeekOfYear);\n }\n\n incompatibleTokens = [\n \"G\",\n \"y\",\n \"Y\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\nexport class ExtendedYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"u\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"G\", \"y\", \"Y\", \"R\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class QuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n case \"QQ\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class StandAloneQuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n case \"qq\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MonthParser extends Parser {\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"L\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"M\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"MM\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // J, F, ..., D\n case \"MMMMM\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class StandAloneMonthParser extends Parser {\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"LL\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // J, F, ..., D\n case \"LLLLL\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setWeek } from \"../../../setWeek.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// Local week of year\nexport class LocalWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"w\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"wo\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value, options) {\n return startOfWeek(setWeek(date, value, options), options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { getWeek } from \"./getWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link setWeek} function options.\n */\n\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the local week set\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * const result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * const result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\nexport function setWeek(date, week, options) {\n const _date = toDate(date);\n const diff = getWeek(_date, options) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setWeek;\n","import { setISOWeek } from \"../../../setISOWeek.mjs\";\nimport { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// ISO week of year\nexport class ISOWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"I\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"Io\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value) {\n return startOfISOWeek(setISOWeek(date, value));\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { getISOWeek } from \"./getISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The ISO week of the new date\n *\n * @returns The new date with the ISO week set\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * const result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nexport function setISOWeek(date, week) {\n const _date = toDate(date);\n const diff = getISOWeek(_date) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setISOWeek;\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nexport class DayOfYearParser extends Parser {\n priority = 90;\n\n subpriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"D\":\n case \"DD\":\n return parseNumericPattern(numericPatterns.dayOfYear, dateString);\n case \"Do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n }\n\n set(date, _flags, value) {\n date.setMonth(0, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"E\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\n\n// Day of week\nexport class DayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"EEEEE\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"EEEE\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"D\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Local day of week\nexport class LocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"e\":\n case \"ee\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"eo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"eee\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"eeeee\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"eeee\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Stand-alone local day of week\nexport class StandAloneLocalDayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"c\":\n case \"cc\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"co\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"ccc\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // T\n case \"ccccc\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return (\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // Tuesday\n case \"cccc\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"e\",\n \"t\",\n \"T\",\n ];\n}\n","import { setISODay } from \"../../../setISODay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// ISO day of week\nexport class ISODayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => {\n if (value === 0) {\n return 7;\n }\n return value;\n };\n\n switch (token) {\n // 2\n case \"i\":\n case \"ii\": // 02\n return parseNDigits(token.length, dateString);\n // 2nd\n case \"io\":\n return match.ordinalNumber(dateString, { unit: \"day\" });\n // Tue\n case \"iii\":\n return mapValue(\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // T\n case \"iiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tu\n case \"iiiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tuesday\n case \"iiii\":\n default:\n return mapValue(\n match.day(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 7;\n }\n\n set(date, _flags, value) {\n date = setISODay(date, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"E\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"a\":\n case \"aa\":\n case \"aaa\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"aaaaa\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"b\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMMidnightParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"b\":\n case \"bb\":\n case \"bbb\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"bbbbb\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\n// in the morning, in the afternoon, in the evening, at night\nexport class DayPeriodParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"BBBBB\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1to12Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"h\":\n return parseNumericPattern(numericPatterns.hour12h, dateString);\n case \"ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 12;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setHours(0, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"H\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0to23Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"H\":\n return parseNumericPattern(numericPatterns.hour23h, dateString);\n case \"Ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 23;\n }\n\n set(date, _flags, value) {\n date.setHours(value, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0To11Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"K\":\n return parseNumericPattern(numericPatterns.hour11h, dateString);\n case \"Ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"h\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1To24Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"k\":\n return parseNumericPattern(numericPatterns.hour24h, dateString);\n case \"ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 24;\n }\n\n set(date, _flags, value) {\n const hours = value <= 24 ? value % 24 : value;\n date.setHours(hours, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"H\", \"K\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MinuteParser extends Parser {\n priority = 60;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"m\":\n return parseNumericPattern(numericPatterns.minute, dateString);\n case \"mo\":\n return match.ordinalNumber(dateString, { unit: \"minute\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setMinutes(value, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class SecondParser extends Parser {\n priority = 50;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"s\":\n return parseNumericPattern(numericPatterns.second, dateString);\n case \"so\":\n return match.ordinalNumber(dateString, { unit: \"second\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setSeconds(value, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\nexport class FractionOfSecondParser extends Parser {\n priority = 30;\n\n parse(dateString, token) {\n const valueCallback = (value) =>\n Math.floor(value * Math.pow(10, -token.length + 3));\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n\n set(date, _flags, value) {\n date.setMilliseconds(value);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601. +00:00 is `'Z'`)\nexport class ISOTimezoneWithZParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"X\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"XX\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"XXXX\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"XXXXX\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"XXX\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"x\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601)\nexport class ISOTimezoneParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"x\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"xx\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"xxxx\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"xxxxx\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"xxx\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"X\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampSecondsParser extends Parser {\n priority = 40;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value * 1000), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampMillisecondsParser extends Parser {\n priority = 20;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getDefaultOptions } from \"./getDefaultOptions.mjs\";\nimport { enUS as defaultLocale } from \"./locale/en-US.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { parsers } from \"./parse/_lib/parsers.mjs\";\nimport { DateToSystemTimezoneSetter } from \"./parse/_lib/Setter.mjs\";\n\n/**\n * The {@link parse} function options.\n */\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\n\nconst notWhitespaceRegExp = /\\S/;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)\n * and [setWeekYear](https://date-fns.org/docs/setWeekYear)).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateStr - The string to parse\n * @param formatStr - The string of tokens\n * @param referenceDate - defines values missing from the parsed dateString\n * @param options - An object with options.\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @returns The parsed date\n *\n * @throws `options.locale` must contain `match` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\nexport function parse(dateStr, formatStr, referenceDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n if (formatStr === \"\") {\n if (dateStr === \"\") {\n return toDate(referenceDate);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n\n const subFnOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n // If timezone isn't specified, it will be set to the system timezone\n const setters = [new DateToSystemTimezoneSetter()];\n\n const tokens = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter in longFormatters) {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp);\n\n const usedTokens = [];\n\n for (let token of tokens) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n\n const firstCharacter = token[0];\n const parser = parsers[firstCharacter];\n if (parser) {\n const { incompatibleTokens } = parser;\n if (Array.isArray(incompatibleTokens)) {\n const incompatibleToken = usedTokens.find(\n (usedToken) =>\n incompatibleTokens.includes(usedToken.token) ||\n usedToken.token === firstCharacter,\n );\n if (incompatibleToken) {\n throw new RangeError(\n `The format string mustn't contain \\`${incompatibleToken.fullToken}\\` and \\`${token}\\` at the same time`,\n );\n }\n } else if (parser.incompatibleTokens === \"*\" && usedTokens.length > 0) {\n throw new RangeError(\n `The format string mustn't contain \\`${token}\\` and any other token at the same time`,\n );\n }\n\n usedTokens.push({ token: firstCharacter, fullToken: token });\n\n const parseResult = parser.run(\n dateStr,\n token,\n locale.match,\n subFnOptions,\n );\n\n if (!parseResult) {\n return constructFrom(referenceDate, NaN);\n }\n\n setters.push(parseResult.setter);\n\n dateStr = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n // Replace two single quote characters with one single quote character\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n }\n\n // Cut token from string, or, if string doesn't match the token, return Invalid Date\n if (dateStr.indexOf(token) === 0) {\n dateStr = dateStr.slice(token.length);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n }\n\n // Check if the remaining input contains something other than whitespace\n if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const uniquePrioritySetters = setters\n .map((setter) => setter.priority)\n .sort((a, b) => b - a)\n .filter((priority, index, array) => array.indexOf(priority) === index)\n .map((priority) =>\n setters\n .filter((setter) => setter.priority === priority)\n .sort((a, b) => b.subPriority - a.subPriority),\n )\n .map((setterArray) => setterArray[0]);\n\n let date = toDate(referenceDate);\n\n if (isNaN(date.getTime())) {\n return constructFrom(referenceDate, NaN);\n }\n\n const flags = {};\n for (const setter of uniquePrioritySetters) {\n if (!setter.validate(date, subFnOptions)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const result = setter.set(date, flags, subFnOptions);\n // Result is tuple (date, flags)\n if (Array.isArray(result)) {\n date = result[0];\n Object.assign(flags, result[1]);\n // Result is date\n } else {\n date = result;\n }\n }\n\n return constructFrom(referenceDate, date);\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default parse;\n","import { getDefaultOptions as getInternalDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * @name getDefaultOptions\n * @category Common Helpers\n * @summary Get default options.\n * @pure false\n *\n * @description\n * Returns an object that contains defaults for\n * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`\n * arguments for all functions.\n *\n * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).\n *\n * @returns The default options\n *\n * @example\n * const result = getDefaultOptions()\n * //=> {}\n *\n * @example\n * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })\n * const result = getDefaultOptions()\n * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }\n */\nexport function getDefaultOptions() {\n return Object.assign({}, getInternalDefaultOptions());\n}\n\n// Fallback for modularized imports:\nexport default getDefaultOptions;\n","import Resource from '../resource';\nimport { format, parse, isValid } from 'date-fns';\n\nexport default class StoreHour extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-hour', options);\n }\n\n get day() {\n return this.getAttribute('day');\n }\n\n get isClosed() {\n return this.getAttribute('start') === null && this.getAttribute('end') === null;\n }\n\n get is24Hours() {\n const start = this.startDateInstance;\n const end = this.endDateInstance;\n const diff = Math.abs(start - end);\n const hours = Math.floor(diff / 1000 / 60) / 60;\n\n return hours > 23;\n }\n\n get startDateInstance() {\n if (!this.hasAttribute('start')) {\n return null;\n }\n\n const start = this.getAttribute('start');\n const includesSeconds = start.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(start, format, new Date());\n }\n\n get endDateInstance() {\n if (!this.hasAttribute('end')) {\n return null;\n }\n\n const end = this.getAttribute('end');\n const includesSeconds = end.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(end, format, new Date());\n }\n\n get humanReadableHoursRange() {\n if (!isValid(this.startDateInstance) || !isValid(this.endDateInstance)) {\n return `${this.start} - ${this.end}`;\n }\n\n return `${format(this.startDateInstance, 'p')} - ${format(this.endDateInstance, 'p')}`;\n }\n\n get humanReadableHours() {\n if (this.isClosed) {\n return 'Closed';\n }\n\n if (this.is24Hours) {\n return '24 Hours';\n }\n\n return this.humanReadableHoursRange;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreHour from './store-hour';\nimport { Collection } from '@fleetbase/sdk';\nimport { format } from 'date-fns';\n\nexport default class StoreLocation extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-location', options);\n }\n\n get latitude() {\n return this.getAttribute('place.location.coordinates.1');\n }\n\n get longitude() {\n return this.getAttribute('place.location.coordinates.0');\n }\n\n get hours() {\n return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes)));\n }\n\n get isAlwaysOpen() {\n return this.hours.every((hour) => hour?.is24Hours);\n }\n\n get today() {\n const today = format(new Date(), 'EEEE');\n\n return this.schedule[today];\n }\n\n get schedule() {\n const schedule = {};\n const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\n for (let i = 0; i < week.length; i++) {\n const day = week[i];\n\n schedule[day] = new Collection();\n }\n\n for (let i = 0; i < this.hours.length; i++) {\n const hour = this.hours.objectAt(i);\n\n schedule[hour.day].pushObject(hour);\n }\n\n return schedule;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Review from './review';\nimport { Collection, Place } from '@fleetbase/sdk';\n\nexport default class Store extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store', options);\n }\n\n getReviews(params = {}) {\n return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n\n getLocations(params = {}) {\n return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {\n return new Collection(\n storeLocations.map((attributes) => {\n if (attributes.place) {\n attributes.place = new Place(attributes.place);\n }\n\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getLocation(id) {\n return this.adapter.get(`locations/${id}`, { store: this.id }).then((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n });\n }\n\n getPaymentGateways(params = {}) {\n return this.adapter.get('gateways', params).then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateway(id) {\n return this.adapter.get(`gateways/${id}`).then((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n });\n }\n}\n","import { Collection } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport PaymentGateway from './payment-gateway';\nimport Store from './store';\nimport StoreLocation from './store-location';\n\nexport default class Network extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'network', options);\n }\n\n getTags(params = {}) {\n return this.adapter.get('tags', params);\n }\n\n async getResourceCollection(endpoint, ResourceClass, params = {}) {\n try {\n const resources = await this.adapter.get(endpoint, params);\n return new Collection(resources.map((attributes) => new ResourceClass(attributes, this.adapter)));\n } catch (error) {\n console.error(`Error fetching ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getStores(params = {}) {\n return this.getResourceCollection('stores', Store, params);\n }\n\n async getStoreLocations(params = {}) {\n return this.getResourceCollection('store-locations', StoreLocation, params);\n }\n\n async getPaymentGateways() {\n return this.getResourceCollection('gateways', PaymentGateway);\n }\n}\n","import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk';\nimport StorefrontStore from '../store';\nimport { formatCurrency, isEmpty } from '../utils';\n\nconst { isArray } = Array;\n\nexport default class DeliveryServiceQuote extends ServiceQuote {\n constructor(attributes = {}, adapter, options = {}) {\n if (attributes instanceof Adapter) {\n return super({}, attributes, 'service-quote', options);\n }\n\n super(attributes, adapter, 'service-quote', options);\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get formattedAmount() {\n const { amount, currency } = this.getAttributes(['amount', 'currency']);\n\n if (isEmpty(amount) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(amount / 100, currency);\n }\n\n async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n if (destination?.id) {\n destination = destination.id;\n }\n if (cart?.id) {\n cart = cart.id;\n }\n\n try {\n const serviceQuotes = await this.adapter.get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n });\n\n if (isArray(serviceQuotes)) {\n return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter)));\n }\n\n return new DeliveryServiceQuote(serviceQuotes, this.adapter);\n } catch (error) {\n console.error('Error fetching service quotes:', error);\n throw error;\n }\n }\n\n static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) {\n const quote = new DeliveryServiceQuote(adapter);\n return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all);\n }\n}\n","import { Order, StoreActions, isResource } from '@fleetbase/sdk';\nimport Resource from '../resource';\n\nconst checkoutActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n initialize: function (customer, cart, serviceQuote, gateway, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n if (isResource(gateway)) {\n gateway = gateway.getAttribute('code');\n }\n\n return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options);\n },\n\n captureOrder: function (token, transactionDetails = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson));\n },\n});\n\nexport default class Checkout extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'checkout', options);\n }\n\n initialize() {\n return this.store.initialize(...arguments);\n }\n\n captureOrder() {\n return this.store.captureOrder(...arguments);\n }\n}\n\nexport { checkoutActions };\n","import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources';\nimport { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk';\n\nconst resources = {\n Product,\n Category,\n Customer,\n Cart,\n DeliveryServiceQuote,\n Store,\n StoreLocation,\n StoreHour,\n Checkout,\n Review,\n};\n\nconst adapters = {\n BrowserAdapter,\n NodeAdapter,\n};\n\nclass Resolver {\n constructor() {\n this.resources = resources;\n this.adapters = adapters;\n\n return this.lookup(...arguments);\n }\n\n lookup(type, className) {\n const key = pluralize(type);\n const params = [...arguments].slice(2);\n\n if (!this[key]) {\n throw new Error('Attempted to resolve invalid type');\n }\n\n if (!this[key][className]) {\n throw new Error(`No ${singularize(type)} named ${className} to resolve`);\n }\n\n return new this[key][className](...params);\n }\n}\n\nconst lookup = function () {\n return new Resolver(...arguments);\n};\n\nexport { Resolver, lookup };\n","import { Store, classify, extendStoreActions } from '@fleetbase/sdk';\nimport { lookup } from './resolver';\n\nexport default class StorefrontStore extends Store {\n constructor() {\n super(...arguments);\n }\n\n extendActions(actions = []) {\n return extendStoreActions(this, actions);\n }\n\n serialize(json) {\n return lookup('resource', classify(this.resource), json, this.adapter);\n }\n}\n","import StorefrontStore from './store';\nimport { detectAdapter, isKeyValid } from './utils';\nimport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network } from './resources';\nimport { cartActions } from './resources/cart';\nimport { customerActions } from './resources/customer';\nimport { checkoutActions } from './resources/checkout';\nimport { reviewActions } from './resources/review';\nimport { Collection } from '@fleetbase/sdk';\n\n/**\n * // instance\n * const storefront = new Storefront();\n *\n */\n\nexport default class Storefront {\n /**\n * Builds an instance of the Fleetbase Storefront SDK\n *\n * @param {String} storeKey The access key for the storefront store\n * @param {Object} config The config object\n * @param {Boolean} debug Enable debug mode\n * @return {Storefront} Instance\n */\n constructor(storeKey, config = {}, debug = false) {\n this.version = config.version || 'v1';\n this.options = {\n version: this.version,\n host: config.host || 'https://api.fleetbase.io',\n namespace: `storefront/${this.version}` || config.namespace,\n publicKey: storeKey,\n debug,\n };\n\n if (!isKeyValid(storeKey)) {\n throw new Error('⚠️ Invalid Storefront key given to Storefront SDK');\n }\n\n this.adapter = config.adapter || detectAdapter(this.options);\n\n this.products = new StorefrontStore('product', this.adapter);\n this.categories = new StorefrontStore('category', this.adapter);\n this.reviews = new StorefrontStore('review', this.adapter).extendActions(reviewActions);\n this.customers = new StorefrontStore('customer', this.adapter).extendActions(customerActions);\n this.cart = new StorefrontStore('cart', this.adapter).extendActions(cartActions);\n this.checkout = new StorefrontStore('checkout', this.adapter).extendActions(checkoutActions);\n }\n\n /** loads information about this storefront */\n about() {\n return this.adapter.get('about');\n }\n\n /** search products in store or network */\n search(query, options = {}) {\n return this.adapter.get('search', { query, ...options }).then((products) => {\n return new Collection(products.map((product) => new Product(product)));\n });\n }\n\n static newInstance() {\n return new Storefront(...arguments);\n }\n\n setAdapter(adapter) {\n this.adapter = adapter;\n }\n\n getAdapter() {\n return this.adapter;\n }\n}\n\nexport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network };\n","import { lookup } from '../resolver';\nimport { isNodeEnvironment } from '@fleetbase/sdk';\n\nconst detectAdapter = (options = {}) => {\n if (isNodeEnvironment()) {\n return lookup('adapter', 'NodeAdapter', options);\n }\n\n return lookup('adapter', 'BrowserAdapter', options);\n};\n\nexport default detectAdapter;\n"],"names":["StorefrontResource","_Resource","_inherits","Resource","_super","_createSuper","_classCallCheck","apply","this","arguments","_createClass","key","value","adapter","_this$options","store","StorefrontStore","resource","onAfterFetch","syncAttributes","bind","actions","options","reviewActions","StoreActions","count","storeId","length","undefined","params","get","concat","namespace","Review","attributes","call","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isEmpty","obj","none","size","objectType","_typeof","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","_this","id","then","reviews","Collection","map","Category","category","products","customerActions","login","identity","password","test","isPhone","post","phone","Error","_objectSpread","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","_getOrderHistory","_getSavedPlaces","_performAuthorizedRequest","_syncDevice","_asyncToGenerator","_regeneratorRuntime","mark","_callee","token","wrap","_context","prev","next","abrupt","setHeaders","stop","_x","_callee2","endpoint","method","headers","response","_args2","_context2","toLowerCase","sent","t0","console","error","_x2","_callee3","places","_this2","_context3","performAuthorizedRequest","Place","_callee4","orders","_this3","_args4","_context4","Order","isArray","Array","cartActions","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","PaymentGateway","type","toDate","argument","argStr","Object","prototype","toString","Date","constructor","NaN","constructFrom","date","addDays","_date","isNaN","setDate","getDate","millisecondsInWeek","millisecondsInDay","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","locale","day","getDay","diff","setHours","startOfISOWeek","getISOWeekYear","year","getFullYear","fourthOfJanuaryOfNextYear","setFullYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTime","startOfDay","getTimezoneOffsetInMilliseconds","utcDate","UTC","getMonth","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isValid","Number","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","buildFormatLongFn","args","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","valuesArray","context","formattingValues","defaultFormattingWidth","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","array","predicate","pattern","object","hasOwnProperty","findKey","valueCallback","rest","slice","enUS","formatDistance","result","tokenValue","replace","addSuffix","comparison","formatRelative","_baseDate","_options","localize","ordinalNumber","dirtyNumber","number","rem100","era","narrow","abbreviated","wide","quarter","month","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","firstWeekContainsDate","getDayOfYear","dateLeft","dateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","Math","round","differenceInCalendarDays","cleanDate","startOfYear","getISOWeek","fourthOfJanuary","startOfISOWeekYear","getWeekYear","firstWeekOfNextYear","firstWeekOfThisYear","getWeek","firstWeek","startOfWeekYear","addLeadingZeros","targetLength","abs","padStart","lightFormatters","y","signedYear","M","d","a","dayPeriodEnumValue","toUpperCase","h","H","m","s","S","numberOfDigits","milliseconds","floor","pow","dayPeriodEnum","formatters","G","unit","Y","signedWeekYear","weekYear","R","u","Q","ceil","q","L","w","week","I","isoWeek","D","dayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","b","hours","B","K","k","X","_localize","timezoneOffset","_originalDate","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","originalDate","T","offset","delimiter","sign","absOffset","minutes","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeLongFormatter","datePattern","timePattern","dateTimeFormat","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","indexOf","isProtectedWeekYearToken","throwProtectedError","input","RangeError","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","defaultLocale","formatterOptions","substring","firstCharacter","longFormatter","join","matched","cleanEscapedString","formatter","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","Setter","subPriority","validate","_utcDate","ValueSetter","validateValue","setValue","priority","super","set","flags","DateToSystemTimezoneSetter","timestampIsSet","fromDate","transpose","Parser","run","dateString","parse","setter","_value","numericPatterns","timezonePatterns","mapValue","parseFnResult","mapFn","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","isLeapYearIndex","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","setDay","currentDay","delta","setISODay","getISODay","parsers","incompatibleTokens","isTwoDigitYear","normalizedTwoDigitYear","_flags","firstWeekOfYear","setMonth","setWeek","setISOWeek","isLeapYear","subpriority","wholeWeekDays","isPM","setMinutes","setSeconds","setMilliseconds","notWhitespaceRegExp","dateStr","referenceDate","assign","getInternalDefaultOptions","subFnOptions","setters","tokens","usedTokens","parser","incompatibleToken","find","usedToken","includes","fullToken","push","uniquePrioritySetters","sort","filter","setterArray","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","Store","storeLocations","place","_this4","gateways","_this5","Network","_getPaymentGateways","_getStoreLocations","_getStores","_getResourceCollection","ResourceClass","resources","_args","getResourceCollection","_args3","DeliveryServiceQuote","_ServiceQuote","ServiceQuote","_getFromCart","_fetchServiceQuotesFromCart","Adapter","_possibleConstructorReturn","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","_x3","quote","fetchServiceQuotesFromCart","_x4","_x5","_x6","_x7","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","_this$store","_this$store2","adapters","BrowserAdapter","NodeAdapter","Resolver","lookup","className","pluralize","singularize","_construct","_toConsumableArray","_Store","extendStoreActions","json","classify","Storefront","storeKey","debug","version","host","publicKey","startsWith","isNodeEnvironment","detectAdapter","categories","extendActions","customers","checkout","product"],"mappings":"stVACsC,IAEjBA,WAAkBC,GAAAC,EAAAF,EAASG,GAAT,IAAAC,EAAAC,EAAAL,GAAA,SAAAA,IAAA,OAAAM,OAAAN,GAAAI,EAAAG,MAAAC,KAAAC,UAAA,CAelC,OAfkCC,EAAAV,EAAA,CAAA,CAAAW,IAAA,aAAAC,MAOnC,SAAWC,GAAS,IAAAC,EAOhB,OANAN,KAAKK,QAAUA,EACfL,KAAKO,MAAQ,IAAIC,GAAgBR,KAAKS,SAAUJ,EAAS,CACrDK,aAAcV,KAAKW,eAAeC,KAAKZ,MACvCa,QAAqBP,QAAdA,EAAEN,KAAK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iB,IAAI,QAC5B,GAEA,CAAAnB,IAAA,SAAAC,MACA,SAAOuH,GAAqB,IAAd7G,EAAOb,UAAAkB,OAAA,QAAAC,IAAAnB,UAAA,GAAAA,UAAA,GAAG,CAAA,EACpB,OAAOD,KAAKK,QAAQiB,IAAI,SAAQ6C,EAAA,CAAIwD,MAAAA,GAAU7G,IAAWqC,MAAK,SAACM,GAC3D,OAAO,IAAIJ,EAAWI,EAASH,KAAI,SAACiiB,GAAO,OAAK,IAAI7iB,EAAQ6iB,EAAQ,IACxE,GACJ,GAAC,CAAAplB,IAAA,aAAAC,MAMD,SAAWC,GACPL,KAAKK,QAAUA,CACnB,GAAC,CAAAF,IAAA,aAAAC,MAED,WACI,OAAOJ,KAAKK,OAChB,IAAC,CAAA,CAAAF,IAAA,cAAAC,MAVD,WACI,OAAAgkB,EAAWM,EAAUld,MAAA4B,UAAA4G,MAAArO,KAAI1B,WAC7B,KAACykB,CAAA,CA/C0B","x_google_ignoreList":[11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90]} \ No newline at end of file diff --git a/package.json b/package.json index a2a7b40..67d9717 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fleetbase/storefront", - "version": "1.1.8", + "version": "1.1.9", "description": "Fleetbase Storefront JS & Node SDK", "main": "dist/cjs/storefront.js", "module": "dist/esm/storefront.js",