From 34ed23aa216f6b17755a9a9cf7e4ac4a362042c4 Mon Sep 17 00:00:00 2001 From: Turtuvshin Date: Wed, 20 Dec 2023 11:33:12 +0800 Subject: [PATCH 1/7] added prettier --- .eslintrc.json | 2 +- .gitignore | 6 +- .husky/pre-commit | 5 + .prettierignore | 9 + .prettierrc.js | 9 + LICENSE.md | 8 +- README.md | 11 +- dist/@fleetbase/storefront.min.js | 7103 ++++++++++++++++++++++- dist/cjs/storefront.js | 5591 +++++++++++++++++- dist/esm/storefront.js | 6924 +++++++++++++++++++++- package.json | 122 +- pnpm-lock.yaml | 4559 +++++++++++++++ rollup.config.js | 14 +- src/cart-store.js | 4 +- src/customer-store.js | 16 +- src/resolver.js | 24 +- src/resource.js | 4 +- src/resources.js | 15 +- src/resources/cart.js | 1 + src/resources/category.js | 2 - src/resources/checkout.js | 8 +- src/resources/customer.js | 10 +- src/resources/delivery-service-quote.js | 24 +- src/resources/network.js | 28 +- src/resources/payment-gateway.js | 4 +- src/resources/product.js | 3 +- src/resources/review.js | 4 +- src/resources/store-hour.js | 1 - src/resources/store-location.js | 6 +- src/store.js | 2 +- src/storefront.js | 20 +- src/utils/detect-adapter.js | 4 +- src/utils/format-currency.js | 8 +- src/utils/index.js | 9 +- src/utils/is-email.js | 4 +- src/utils/is-key-valid.js | 2 +- src/utils/is-phone.js | 4 +- tests/storefront.test.js | 8 +- 38 files changed, 24400 insertions(+), 178 deletions(-) create mode 100755 .husky/pre-commit create mode 100644 .prettierignore create mode 100644 .prettierrc.js create mode 100644 pnpm-lock.yaml diff --git a/.eslintrc.json b/.eslintrc.json index 20ffc17..5626472 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -26,4 +26,4 @@ "space-before-function-paren": 0, "comma-dangle": 0 } -} \ No newline at end of file +} diff --git a/.gitignore b/.gitignore index 76d0ee8..e828eb1 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,8 @@ /.reify-cache /yarn.lock /package-lock.json -.DS_Store \ No newline at end of file +.DS_Store + +# Ignore artifacts: +build +coverage \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..72d9525 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +pnpm exec lint-staged +pnpm exec lint-staged diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..49274e0 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,9 @@ +# compiled output +/dist/ +dist/ +/tmp/ + +# dependencies +/node_modules/ +LICENSE.md +README.md \ No newline at end of file diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..9ca6026 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = { + trailingComma: 'es5', + tabWidth: 4, + semi: true, + singleQuote: true, + printWidth: 190, +}; diff --git a/LICENSE.md b/LICENSE.md index 2c0aacf..4957748 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -2,8 +2,8 @@ Copyright (c) 2021 Fleetbase Pte Ltd, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -3) Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 29e1e1e..5ff4577 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,9 @@ If you would like to make contributions to the Fleetbase Javascript SDK document ## Quick Start for Browser ```js -import Storefront, { Product } from '@fleetbase/storefront'; +import Storefront, { Product } from "@fleetbase/storefront"; -const storefront = new Storefront('Your Store Key'); +const storefront = new Storefront("Your Store Key"); // list products storefront.products.findAll(); @@ -52,8 +52,8 @@ storefront.products.findAll(); const product = new Product({ name, description, price }); // retrieve cart & add item -storefront.cart.retrieve().then(cart => { - cart.add('product_xyxyxyx', 1); +storefront.cart.retrieve().then((cart) => { + cart.add("product_xyxyxyx", 1); // empty cart cart.empty(); @@ -63,9 +63,8 @@ storefront.cart.retrieve().then(cart => { storefront.checkout.capture(); ``` - ## Create a custom adapter Storefront will eventually allow you to bring your own ecommerce adapter. -```@todo``` +`@todo` diff --git a/dist/@fleetbase/storefront.min.js b/dist/@fleetbase/storefront.min.js index 944ed0f..e3a1f4b 100644 --- a/dist/@fleetbase/storefront.min.js +++ b/dist/@fleetbase/storefront.min.js @@ -1,2 +1,7103 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("axios")):"function"==typeof define&&define.amd?define(["exports","axios"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@fleetbase/storefront"]={},t.t)}(this,(function(t,e){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=n(e);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:[];if(Q(t))if(r.length<=6e4)t.splice.apply(t,[e,n].concat(W(r)));else{t.splice(e,n);for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:0,r=t.length,i=n;i2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=t.length;n<0&&(n+=i);var a=r&&e!=e?function(t){return t!=t}:function(t){return t===e};return V(t,a,n)},it=function(t,e,n){return G(t,e,0,[n]),n},at=function(t){j(n,Y(Array));var e=F(n);function n(){for(var t=arguments.length,r=new Array(t),i=0;i0}},{key:"empty",get:function(){return 0===this.length}},{key:"first",get:function(){return J(this,0)}},{key:"last",get:function(){return J(this,this.length-1)}},{key:"replace",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return G(this,t,e,n),this}},{key:"objectsAt",value:function(t){var e=this;return t.map((function(t){return J(e,t)}))}},{key:"objectAt",value:function(t){return J(this,t)}},{key:"indexOf",value:function(t,e){return rt(this,t,e,!1)}},{key:"lastIndexOf",value:function(t,e){var n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(var r=e;r>=0;r--)if(J(this,r)===t)return r;return-1}},{key:"includes",value:function(t,e){return-1!==rt(this,t,e,!0)}},{key:"findBy",value:function(){return tt(this,Z.apply(void 0,arguments))}},{key:"findIndexBy",value:function(){return V(this,Z.apply(void 0,arguments))}},{key:"isEvery",value:function(){return nt(this,Z.apply(void 0,arguments))}},{key:"isAny",value:function(){return et(this,Z.apply(void 0,arguments))}},{key:"invoke",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:X,n=[],r=new Set,i="function"==typeof e?e:function(t){return get(t,e)};return t.forEach((function(t){var e=i(t);r.has(e)||(r.add(e),n.push(t))})),n}(this,t)}},{key:"without",value:function(t){if(!this.includes(t))return this;var e=t==t?function(e){return e!==t}:function(t){return t==t};return this.filter(e)}},{key:"clear",value:function(){var t=this.length;return 0===t||this.replace(0,t,[]),this}},{key:"insertAt",value:function(t,e){return it(this,t,e),this}},{key:"replaceAt",value:function(t,e){return this.replace(t,1,[e])}},{key:"removeAt",value:function(t,e){return function(t,e){return G(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,[]),t}(this,t,e)}},{key:"pushObject",value:function(t){return this.insertAt(this.length,t)}},{key:"pushObjects",value:function(t){return this.replace(this.length,0,t),this}},{key:"popObject",value:function(){var t=this.length;if(0===t)return null;var e=J(this,t-1);return this.removeAt(t-1,1),e}},{key:"shiftObject",value:function(){if(0===this.length)return null;var t=J(this,0);return this.removeAt(0),t}},{key:"unshiftObject",value:function(t){return it(this,0,t)}},{key:"unshiftObjects",value:function(t){return this.replace(0,0,t),this}},{key:"reverseObjects",value:function(){var t=this.length;if(0===t)return this;var e=this.toArray().reverse();return this.replace(0,t,e),this}},{key:"setObjects",value:function(t){if(0===t.length)return this.clear();var e=this.length;return this.replace(0,e,t),this}},{key:"removeObject",value:function(t){for(var e=this.length||0;--e>=0;)J(this,e)===t&&this.removeAt(e);return this}},{key:"removeObjects",value:function(t){for(var e=t.length-1;e>=0;e--)this.removeObject(t[e]);return this}},{key:"addObject",value:function(t){return this.includes(t)||this.pushObject(t),this}},{key:"addObjects",value:function(t){var e=this;return t.forEach((function(t){return e.addObject(t)})),this}}]),n}(),ot=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var n=E(t);if("object"===n){var r=t.size;if("number"==typeof r)return!r}if("number"==typeof t.length&&"function"!==n)return!t.length;if("object"===n){var i=t.length;if("number"==typeof i)return!i}return!1},ut=function(t){return ot(t)||"string"==typeof t&&!1===/\S/.test(t)};function st(t){return t instanceof yt}var ct=function(){var t,e,n,r,i;return!("undefined"==typeof process||"object"!==E(null===(t=process)||void 0===t?void 0:t.env)&&-1===(null===(e=process.release)||void 0===e||null===(n=e.name)||void 0===n?void 0:n.search(/node|io.js/))||"undefined"!=typeof window&&"ReactNative"!==(null===(r=window)||void 0===r||null===(i=r.navigator)||void 0===i?void 0:i.product))},ht=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ct()?jt("adapter","NodeAdapter",t):jt("adapter","BrowserAdapter",t)},lt=Array.isArray;!function(){function t(e){P(this,t),this.place=e,this.geometry=null==e?void 0:e.geometry,this.components=this.parseComponents(),this.attributes=this.parseProperties()}U(t,[{key:"parse",value:function(){this.parseComponents(),this.parseProperties()}},{key:"parseComponents",value:function(){var t;return((null===(t=this.place)||void 0===t?void 0:t.address_components)||[]).reduce((function(t,e){return e.types.forEach((function(n){t[n]=e})),t}),{})}},{key:"parseProperties",value:function(){var t,e={streetNumber:this.get("street_number"),streetName:this.get("route"),coordinates:null!==(t=this.geometry)&&void 0!==t&&t.location?Object.values(this.geometry.location):[0,0],city:this.or(["locality","sublocality","sublocality_level_1","neighborhood","administrative_area_level_3","administrative_area_level_2"]),county:this.get("administrative_area_level_2"),stateShort:this.get("administrative_area_level_1",!0),stateLong:this.get("administrative_area_level_1"),countryShort:this.get("country",!0),country:this.get("country",!0),countryLong:this.get("country"),postalCode:this.get("postal_code")};return e.address=[e.streetNumber,e.streetName].filter(Boolean).join(" "),e}},{key:"all",value:function(){return this.attributes}},{key:"or",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=0;e1&&void 0!==arguments[1]&&arguments[1];return t in this.components?e?this.components[t].short_name:this.components[t].long_name:null}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.attributes=D(D({},this.attributes),t),this}},{key:"setAttribute",value:function(t,e){return this.attributes[t]=e,this}},{key:"getAttribute",value:function(t){return this.attributes[t]||null}}])}();var dt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;P(this,t),this.type="Point",this.coordinates=[n,e]}return U(t,[{key:"latitude",get:function(){return this.coordinates[1]}},{key:"longitude",get:function(){return this.coordinates[0]}},{key:"lat",value:function(){return this.latitude}},{key:"lng",value:function(){return this.longitude}},{key:"serialize",value:function(){return{type:"Point",coorindates:[this.lat(),this.lng()]}}},{key:"toJson",value:function(){return this.serialize()}},{key:"toString",value:function(){return"(".concat(this.latitude,", ").concat(this.longitude,")")}}],[{key:"fromGeoJson",value:function(e){var n=_(e.coordinates,2);return longitude=n[0],latitude=n[1],new t(latitude,longitude)}}]),t}(),ft=function(t,e){var n=t();return Array.isArray(n)||"object"===E(n)?vt(n,e):null},vt=function t(e,n){var r,i=e,a=E(e),o="object"===a,u="function"===a,s=Array.isArray(e),c="string"===E(n)&&n.includes(".")?n.split("."):[n];if(s||o){for(var h=0;h0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;P(this,t),this.actions=e,this.bind=n}return U(t,[{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=t||this.bind;if(!e)return this;if(null!=this&&this.actions&&"object"===E(this.actions))for(var n in this.actions){var r=this.actions[n];gt(e,n,"function"==typeof r?r.bind(e):r)}return this}}]),t}(),yt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};P(this,t),this.attributes=e,this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isDestroying=!1,this.isReloading=!1,this.resource=r,this.options=i,this.version=i.version||"v1",this.setAdapter(n)}return U(t,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new $t(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"id",get:function(){return this.getAttribute("id")}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.mergeAttributes(e);return this.setFlags(["isLoading","isSaving"]),this.store.create(n).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setFlags(["isLoading","isSaving"]),this.store.update(this.attributes.id,e).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"destroy",value:function(){var t=this;return this.setFlags(["isLoading","isDestroying"]),this.store.destroy(this.attributes.id).then((function(e){return t.setFlags(["isLoading","isDestroying"],!1),e}))}},{key:"reload",value:function(){var t=this;return this.setFlags(["isLoading","isReloading"]),this.store.findRecord(this.attributes.id).then((function(e){return t.reset(),e}))}},{key:"setFlags",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=["isLoading","isSaving","isReloading","isDestroying"],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAttributes();return ot(this.id)?this.create(e):!0===t.onlyDirty?this.savedirty():this.update(e)}},{key:"saveDirty",value:function(){for(var t=Object.keys(this.dirtyAttributes),e={},n=0;n0}},{key:"mutate",value:function(t,e){this.attributes[t]=e}},{key:"setAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===n&&"object"===E(t))return this.setAttributes(t);var r=null!==(e=null==this?void 0:this.attributes[t])&&void 0!==e?e:null;return gt(this.attributes,t,n),gt(this.dirtyAttributes,t,r),Q(null==this?void 0:this.changes[t])||(this.changes[t]=[]),this.changes[t].push({property:t,previousValue:r,value:n,changedAt:new Date}),this}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)this.setAttribute(e,t[e]);return this}},{key:"getAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=vt(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{},t);return void 0===r?n:r}},{key:"hasAttribute",value:function(t){if(Q(t)){var e,n=t,r=Object.keys(null!==(e=this.attributes)&&void 0!==e?e:{});return n.every((function(t){return r.includes(t)}))}return!(null==this||!this.attributes)&&t in this.attributes}},{key:"hasAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.hasAttribute(t)}},{key:"isAttributeFilled",value:function(t){var e=this;return Q(t)?this.hasAttribute(t)&&t.every((function(t){return!ot(e.getAttribute(t))})):this.hasAttribute(t)&&!ot(this.getAttribute(t))}},{key:"getAttributes",value:function(t){var e={};if(null==t)return this.getAttributes(Object.keys(this.attributes));if("string"==typeof t)return this.getAttribute(Array.prototype.slice.call(arguments));if(!Q(t))throw new Error("No attribute properties provided!");for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=null!==(t=null==this?void 0:this.attributes)&&void 0!==t?t:{};return this.attributes=D(D({},n),e),this.attributes}},{key:"syncAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attributes=t}}]),t}(),mt=new pt({getDistanceAndTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("".concat(this.namespace,"/").concat(t,"/distance-and-time"),{},e)}}),wt=function(t){j(n,yt);var e=F(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P(this,n),e.call(this,t,r,"order",D({actions:mt},i))}return U(n,[{key:"getDistanceAndTime",value:function(){return this.store.getDistanceAndTime(this.id)}}]),n}(),bt=function(t){j(n,yt);var e=F(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P(this,n),e.call(this,t,r,"payload",i)}return U(n,[{key:"attach",value:function(t){}},{key:"entities",get:function(){}},{key:"dropoff",get:function(){}},{key:"pickup",get:function(){}},{key:"waypoints",get:function(){return new at(this.waypoints)}}]),n}();!function(t){j(n,yt);var e=F(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P(this,n),e.call(this,t,r,"entity",i)}}();var kt=function(t){j(n,yt);var e=F(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P(this,n),e.call(this,t,r,"place",i)}return U(n,[{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new dt))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new dt))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}},{key:"setOwner",value:function(t){return st(t)&&this.setAttribute("owner",t.id),"string"==typeof t&&this.setAttribute("owner",t),this}}],[{key:"fromGoogleAddress",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.getAttribute("coordinates"),a=_(i,2),o=a[0],u=a[1],s={name:null,address:t.getAttribute("address"),location:new dt(o,u),street1:t.getAttribute("streetName"),street2:null,city:t.getAttribute("city"),province:t.getAttribute("stateLong"),postal_code:t.getAttribute("postalCode"),neighborhood:t.get("neighborhood"),district:t.getAttribute("county"),building:t.get("building"),country:t.getAttribute("countryShort"),phone:null,security_access_code:null};return new n(s,e,r)}}]),n}();!function(t){j(n,kt);var e=F(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P(this,n),e.call(this,t,r,"waypoint",i)}}(),function(t){j(n,yt);var e=F(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P(this,n),e.call(this,t,r,"tracking-status",i)}}(),function(t){j(n,yt);var e=F(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P(this,n),e.call(this,t,r,"vehicle",i)}}(),function(t){j(n,yt);var e=F(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P(this,n),e.call(this,t,r,"driver",i)}}(),function(t){j(n,yt);var e=F(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P(this,n),e.call(this,t,r,"vendor",i)}}(),function(t){j(n,yt);var e=F(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P(this,n),e.call(this,t,r,"contact",i)}}(),function(t){j(n,yt);var e=F(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P(this,n),e.call(this,t,r,"zone",i)}}(),function(t){j(n,yt);var e=F(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P(this,n),e.call(this,t,r,"service-area",i)}}(),function(t){j(n,yt);var e=F(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P(this,n),e.call(this,t,r,"service-rate",i)}}();var Tt=function(t){j(n,yt);var e=F(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return P(this,n),e.call(this,t,r,"service-quote",i)}return U(n,[{key:"fromPreliminary",value:function(){}},{key:"fromPayload",value:function(){}}]),n}(),xt=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};P(this,t),this.version=e.version||"v1",this.host=e.host||null,this.namespace=e.namespace||null,this.headers=e.headers||{}},Ct=function(t){j(n,xt);var e=F(n);function n(t){var r;return P(this,n),(r=e.call(this,t)).setHeaders({Authorization:"Bearer ".concat(t.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;browser"}),r}return U(n,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.headers=D(D({},this.headers),t),this}},{key:"parseJSON",value:function(t){return new Promise((function(e,n){return t.json().then((function(n){return e({statusText:t.statusText,status:t.status,ok:t.ok,json:n})})).catch((function(){n(new Error("Oops! Something went wrong when handling your request."))}))}))}},{key:"request",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(a,o){return fetch(i.url||"".concat(e.host,"/").concat(e.namespace,"/").concat(t),D({method:n,mode:i.mode||"cors",headers:new Headers(D(D({},e.headers||{}),i.headers||{}))},r)).then(e.parseJSON).then((function(t){return t.ok?a(t.json):o(new Error(t.json.errors?t.json.errors[0]:t.statusText))})).catch((function(t){o(t)}))}))}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=ut(e)?"":new URLSearchParams(e).toString();return this.request("".concat(t).concat(r?"?".concat(r):""),"GET",{},n)}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"POST",{body:JSON.stringify(e)},n)}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PUT",{body:JSON.stringify(e)},n)}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(t,"DELETE",{},e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PATCH",{body:JSON.stringify(e)},n)}}]),n}(),At=function(t){j(n,xt);var e=F(n);function n(t){var i;return P(this,n),(i=e.call(this,t)).axios=r.default.create({baseURL:"".concat(i.host,"/").concat(i.namespace),headers:{Authorization:"Bearer ".concat(t.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;node"}}),i}return U(n,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.axios.defaults.headers.common;return this.axios.defaults.headers.common=D(D({},e),t),this}},{key:"transform",value:function(t){return t.data}},{key:"handleError",value:function(t){if(t.response){var e=t.response.data;if(Q(e.errors))throw new Error(e.errors[0]);if(e.error)throw new Error(e.error)}throw t}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=ut(e)?"":new URLSearchParams(e).toString();return this.axios.get("".concat(t).concat(r?"?".concat(r):""),n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.post(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.put(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.axios.delete(t,e).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.patch(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}}]),n}(),Dt=function(t){j(n,xt);var e=F(n);function n(){return P(this,n),e.apply(this,arguments)}return n}(),Et=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];P(this,t),M(this,"uncountableWords",["equipment","information","rice","money","species","series","fish","sheep","moose","deer","news"]),M(this,"pluralRules",[[new RegExp("(m)an$","gi"),"$1en"],[new RegExp("(pe)rson$","gi"),"$1ople"],[new RegExp("(child)$","gi"),"$1ren"],[new RegExp("^(ox)$","gi"),"$1en"],[new RegExp("(ax|test)is$","gi"),"$1es"],[new RegExp("(octop|vir)us$","gi"),"$1i"],[new RegExp("(alias|status)$","gi"),"$1es"],[new RegExp("(bu)s$","gi"),"$1ses"],[new RegExp("(buffal|tomat|potat)o$","gi"),"$1oes"],[new RegExp("([ti])um$","gi"),"$1a"],[new RegExp("sis$","gi"),"ses"],[new RegExp("(?:([^f])fe|([lr])f)$","gi"),"$1$2ves"],[new RegExp("(hive)$","gi"),"$1s"],[new RegExp("([^aeiouy]|qu)y$","gi"),"$1ies"],[new RegExp("(x|ch|ss|sh)$","gi"),"$1es"],[new RegExp("(matr|vert|ind)ix|ex$","gi"),"$1ices"],[new RegExp("([m|l])ouse$","gi"),"$1ice"],[new RegExp("(quiz)$","gi"),"$1zes"],[new RegExp("s$","gi"),"s"],[new RegExp("$","gi"),"s"]]),M(this,"singularRules",[[new RegExp("(m)en$","gi"),"$1an"],[new RegExp("(pe)ople$","gi"),"$1rson"],[new RegExp("(child)ren$","gi"),"$1"],[new RegExp("([ti])a$","gi"),"$1um"],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi"),"$1$2sis"],[new RegExp("(hive)s$","gi"),"$1"],[new RegExp("(tive)s$","gi"),"$1"],[new RegExp("(curve)s$","gi"),"$1"],[new RegExp("([lr])ves$","gi"),"$1f"],[new RegExp("([^fo])ves$","gi"),"$1fe"],[new RegExp("([^aeiouy]|qu)ies$","gi"),"$1y"],[new RegExp("(s)eries$","gi"),"$1eries"],[new RegExp("(m)ovies$","gi"),"$1ovie"],[new RegExp("(x|ch|ss|sh)es$","gi"),"$1"],[new RegExp("([m|l])ice$","gi"),"$1ouse"],[new RegExp("(bus)es$","gi"),"$1"],[new RegExp("(o)es$","gi"),"$1"],[new RegExp("(shoe)s$","gi"),"$1"],[new RegExp("(cris|ax|test)es$","gi"),"$1is"],[new RegExp("(octop|vir)i$","gi"),"$1us"],[new RegExp("(alias|status)es$","gi"),"$1"],[new RegExp("^(ox)en","gi"),"$1"],[new RegExp("(vert|ind)ices$","gi"),"$1ex"],[new RegExp("(matr)ices$","gi"),"$1ix"],[new RegExp("(quiz)zes$","gi"),"$1"],[new RegExp("s$","gi"),""]]),M(this,"nonTitlecasedWords",["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"]),M(this,"idSuffix",new RegExp("(_ids|_id)$","g")),M(this,"underbar",new RegExp("_","g")),M(this,"spaceOrUnderbar",new RegExp("[ _]","g")),M(this,"uppercase",new RegExp("([A-Z])","g")),M(this,"underbarPrefix",new RegExp("^_")),this.str=e,this.chain=n}return U(t,[{key:"get",value:function(){return this.str}},{key:"applyRules",value:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:null;return t=t||this.str,this.applyRules(t,this.pluralRules,this.uncountableWords,e)}},{key:"singularize",value:function(t,e){return t=t||this.str,this.applyRules(t,this.singularRules,this.uncountableWords,e)}},{key:"camelize",value:function(t,e){for(var n=(t=t||this.str).split("/"),r=0;r1&&void 0!==arguments[1]&&arguments[1];return t=t||this.str,t=this.underscore(this.demodulize(t))+(e?"":"_")+"id",this.str=t,!0===this.chain?this:t}},{key:"ordinalize",value:function(t){for(var e=(t=t||this.str).split(" "),n=0;n1&&void 0!==arguments[1]?arguments[1]:[];if(t.actions=Q(e)?e:[e],!Q(e))return e instanceof pt&&e.extend(t),t;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};P(this,t),this.resource=e,this.adapter=n||ht(),this.namespace=St(e),this.storage=new at,this.options=r,this.extendActions(r.actions)}return U(t,[{key:"extendActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return qt(this,t)}},{key:"deposit",value:function(t){return t}},{key:"serialize",value:function(t){return jt("resource",Pt(this.resource),t,this.adapter)}},{key:"afterFetch",value:function(t){return function(t,e){if("function"==typeof t.options.onAfterFetch&&t.options.onAfterFetch(e),Q(e)){for(var n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=O(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.post("".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"update",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(function(){var i=O(regeneratorRuntime.mark((function i(a,o){var u;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,e.adapter.put("".concat(e.namespace,"/").concat(t),n,r).then(e.afterFetch.bind(e)).catch(o);case 2:u=i.sent,a(u);case 4:case"end":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}())}},{key:"findRecord",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=O(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.adapter.get("".concat(e.namespace,"/").concat(t),{},n).then(e.afterFetch.bind(e)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"findAll",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var n=O(regeneratorRuntime.mark((function n(r,i){var a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.adapter.get("".concat(t.namespace),{},e).then(t.afterFetch.bind(t)).catch(i);case 2:a=n.sent,r(a);case 4:case"end":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}())}},{key:"query",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=O(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get("".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"queryRecord",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.single=!0,new Promise(function(){var r=O(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get("".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"destroy",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=st(t)?t.getAttribute("id"):t;return new Promise(function(){var t=O(regeneratorRuntime.mark((function t(i,a){var o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.adapter.delete("".concat(e.namespace,"/").concat(r),{},n).then(e.afterFetch.bind(e)).catch(a);case 2:o=t.sent,i(o);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())}}]),t}();!function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(P(this,t),this.version=n.version||"v1",this.options={version:this.version,host:n.host||"https://api.fleetbase.io",namespace:this.version||n.namespace,debug:r,publicKey:e},"string"!=typeof e||0===e.length)throw new Error("⚠️ Invalid public key given to Fleetbase SDK");if(!ct()&&e.toLowerCase().startsWith("$"))throw new Error("Secret key provided. You must use a public key with Fleetbase Javascript SDK!");this.adapter=n.adapter||ht(this.options),this.orders=new $t("order",this.adapter).extendActions(mt),this.entities=new $t("entity",this.adapter),this.places=new $t("place",this.adapter),this.drivers=new $t("driver",this.adapter),this.vehicles=new $t("vehicle",this.adapter),this.vendors=new $t("vendor",this.adapter),this.contacts=new $t("contact",this.adapter)}U(t,[{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return H(t,Array.prototype.slice.call(arguments))}}])}();var Nt=function(t){l(n,t);var e=m(n);function n(){return u(this,n),e.apply(this,arguments)}return c(n,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Cr(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}}]),n}(yt),Ht=new pt({count:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};return t&&(n.store=t),this.adapter.get("".concat(this.namespace,"/count"),n,e)}}),Yt=function(t){l(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"review",i)}return c(n,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),n}(Nt),Lt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ct()?xr("adapter","NodeAdapter",t):xr("adapter","BrowserAdapter",t)},Ft=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(t)};function _t(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:n}).format(t)}var Wt=function(t){return"string"==typeof t&&t.length>30&&(t.startsWith("store_")||t.startsWith("network_"))},zt=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var n=o(t);if("object"===n){var r=t.size;if("number"==typeof r)return!r}if("number"==typeof t.length&&"function"!==n)return!t.length;if("object"===n){var i=t.length;if("number"==typeof i)return!i}return!1},It=function(t){l(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"product",i)}return c(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,n=t.sale_price,r=t.currency;return this.isOnSale?zt(n)||zt(r)?null:_t(n/100,r):zt(e)||zt(r)?null:_t(e/100,r)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(e){return new at(e.map((function(e){return new Yt(e,t.adapter)})))}))}}]),n}(Nt),Qt=function(t){l(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"category",i)}return c(n,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(e){return new at(e.map((function(e){return new It(e,t.adapter)})))}))}}]),n}(Nt),Bt=new pt({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(Ft(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",a({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",a({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",a({identity:t,code:e},n)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),Gt=function(t){l(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"customer",a({actions:Bt},i))}return c(n,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Cr(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:function(t){var e=this;return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",t).then((function(){return e}))}},{key:"getSavedPlaces",value:function(){var t=this;return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/places").then((function(e){return new at(e.map((function(e){return new kt(e,t.adapter)})))}))}},{key:"getOrderHistory",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/orders",e).then((function(e){return new at(e.map((function(e){return new wt(e,t.adapter)})))}))}}]),n}(Nt),Xt=Array.isArray,Kt=new pt({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,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),a(a({},r),{},{quantity:n}),i).then(this.afterFetch.bind(this))},update:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),a(a({},r),{},{quantity:n}),i).then(this.afterFetch.bind(this))},remove:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},n).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)}}),Jt=function(t){l(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"cart",a({actions:Kt},i))}return c(n,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof It&&(t=t.id),this.store.add(this.id,t,e,n,r)}},{key:"update",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,n,r)}},{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!Xt(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),n}(Nt);function Zt(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Vt(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function te(t){Vt(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function ee(t,e){Vt(2,arguments);var n=te(t).getTime(),r=Zt(e);return new Date(n+r)}function ne(t){var 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 re(t){return Vt(1,arguments),t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}function ie(t){if(Vt(1,arguments),!re(t)&&"number"!=typeof t)return!1;var e=te(t);return!isNaN(Number(e))}var ae={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"}},oe=function(t,e,n){var r,i=ae[t];return r="string"==typeof i?i:1===e?i.one:i.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},ue=oe;function se(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var ce={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},he={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},le={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},de={date:se({formats:ce,defaultWidth:"full"}),time:se({formats:he,defaultWidth:"full"}),dateTime:se({formats:le,defaultWidth:"full"})},fe=de,ve={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ge=function(t,e,n,r){return ve[t]},pe=ge;function ye(t){return function(e,n){var r,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,o=i.width?String(i.width):a;r=t.formattingValues[o]||t.formattingValues[a]}else{var u=t.defaultWidth,s=i.width?String(i.width):t.defaultWidth;r=t.values[s]||t.values[u]}return r[t.argumentCallback?t.argumentCallback(e):e]}}var me={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},we={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},be={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"]},ke={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"]},Te={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"}},xe={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"}},Ce=function(t,e){var n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Ae={ordinalNumber:Ce,era:ye({values:me,defaultWidth:"wide"}),quarter:ye({values:we,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:ye({values:be,defaultWidth:"wide"}),day:ye({values:ke,defaultWidth:"wide"}),dayPeriod:ye({values:Te,defaultWidth:"wide",formattingValues:xe,defaultFormattingWidth:"wide"})},De=Ae;function Ee(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],a=e.match(i);if(!a)return null;var o,u=a[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(s)?Oe(s,(function(t){return t.test(u)})):Se(s,(function(t){return t.test(u)}));o=t.valueCallback?t.valueCallback(c):c,o=n.valueCallback?n.valueCallback(o):o;var h=e.slice(u.length);return{value:o,rest:h}}}function Se(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function Oe(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=e.match(t.matchPattern);if(!r)return null;var i=r[0],a=e.match(t.parsePattern);if(!a)return null;var o=t.valueCallback?t.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;var u=e.slice(i.length);return{value:o,rest:u}}}var Re=/^(\d+)(th|st|nd|rd)?/i,Ue=/\d+/i,Me={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},je={any:[/^b/i,/^(a|c)/i]},qe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},$e={any:[/1/i,/2/i,/3/i,/4/i]},Ne={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},He={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]},Ye={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},Le={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]},Fe={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},_e={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}},We={ordinalNumber:Pe({matchPattern:Re,parsePattern:Ue,valueCallback:function(t){return parseInt(t,10)}}),era:Ee({matchPatterns:Me,defaultMatchWidth:"wide",parsePatterns:je,defaultParseWidth:"any"}),quarter:Ee({matchPatterns:qe,defaultMatchWidth:"wide",parsePatterns:$e,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Ee({matchPatterns:Ne,defaultMatchWidth:"wide",parsePatterns:He,defaultParseWidth:"any"}),day:Ee({matchPatterns:Ye,defaultMatchWidth:"wide",parsePatterns:Le,defaultParseWidth:"any"}),dayPeriod:Ee({matchPatterns:Fe,defaultMatchWidth:"any",parsePatterns:_e,defaultParseWidth:"any"})},ze=We,Ie={code:"en-US",formatDistance:ue,formatLong:fe,formatRelative:pe,localize:De,match:ze,options:{weekStartsOn:0,firstWeekContainsDate:1}},Qe=Ie;function Be(t,e){Vt(2,arguments);var n=Zt(e);return ee(t,-n)}function Ge(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?n:1-n;return Ge("yy"===e?r%100:r,e.length)},M:function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):Ge(n+1,2)},d:function(t,e){return Ge(t.getUTCDate(),e.length)},a:function(t,e){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(t,e){return Ge(t.getUTCHours()%12||12,e.length)},H:function(t,e){return Ge(t.getUTCHours(),e.length)},m:function(t,e){return Ge(t.getUTCMinutes(),e.length)},s:function(t,e){return Ge(t.getUTCSeconds(),e.length)},S:function(t,e){var n=e.length,r=t.getUTCMilliseconds();return Ge(Math.floor(r*Math.pow(10,n-3)),e.length)}},Ke=Xe,Je=864e5;function Ze(t){Vt(1,arguments);var e=te(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),i=n-r;return Math.floor(i/Je)+1}function Ve(t){Vt(1,arguments);var e=1,n=te(t),r=n.getUTCDay(),i=(r=i.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function en(t){Vt(1,arguments);var e=tn(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=Ve(n);return r}var nn=6048e5;function rn(t){Vt(1,arguments);var e=te(t),n=Ve(e).getTime()-en(e).getTime();return Math.round(n/nn)+1}function an(t,e){Vt(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.weekStartsOn,a=null==i?0:Zt(i),o=null==n.weekStartsOn?a:Zt(n.weekStartsOn);if(!(o>=0&&o<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=te(t),s=u.getUTCDay(),c=(s=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(r+1,0,s),c.setUTCHours(0,0,0,0);var h=an(c,e),l=new Date(0);l.setUTCFullYear(r,0,s),l.setUTCHours(0,0,0,0);var d=an(l,e);return n.getTime()>=h.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function un(t,e){Vt(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.firstWeekContainsDate,a=null==i?1:Zt(i),o=null==n.firstWeekContainsDate?a:Zt(n.firstWeekContainsDate),u=on(t,e),s=new Date(0);s.setUTCFullYear(u,0,o),s.setUTCHours(0,0,0,0);var c=an(s,e);return c}var sn=6048e5;function cn(t,e){Vt(1,arguments);var n=te(t),r=an(n,e).getTime()-un(n,e).getTime();return Math.round(r/sn)+1}var hn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ln={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Ke.y(t,e)},Y:function(t,e,n,r){var i=on(t,r),a=i>0?i:1-i;return"YY"===e?Ge(a%100,2):"Yo"===e?n.ordinalNumber(a,{unit:"year"}):Ge(a,e.length)},R:function(t,e){return Ge(tn(t),e.length)},u:function(t,e){return Ge(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Ge(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Ge(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return Ke.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return Ge(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var i=cn(t,r);return"wo"===e?n.ordinalNumber(i,{unit:"week"}):Ge(i,e.length)},I:function(t,e,n){var r=rn(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):Ge(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):Ke.d(t,e)},D:function(t,e,n){var r=Ze(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):Ge(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return Ge(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return Ge(a,e.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),i=0===r?7:r;switch(e){case"i":return String(i);case"ii":return Ge(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,i=t.getUTCHours();switch(r=12===i?hn.noon:0===i?hn.midnight:i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,i=t.getUTCHours();switch(r=i>=17?hn.evening:i>=12?hn.afternoon:i>=4?hn.morning:hn.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ke.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Ke.H(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):Ge(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):Ge(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Ke.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Ke.s(t,e)},S:function(t,e){return Ke.S(t,e)},X:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return fn(i);case"XXXX":case"XX":return vn(i);default:return vn(i,":")}},x:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return fn(i);case"xxxx":case"xx":return vn(i);default:return vn(i,":")}},O:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+dn(i,":");default:return"GMT"+vn(i,":")}},z:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+dn(i,":");default:return"GMT"+vn(i,":")}},t:function(t,e,n,r){var i=r._originalDate||t;return Ge(Math.floor(i.getTime()/1e3),e.length)},T:function(t,e,n,r){return Ge((r._originalDate||t).getTime(),e.length)}};function dn(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),a=r%60;if(0===a)return n+String(i);var o=e||"";return n+String(i)+o+Ge(a,2)}function fn(t,e){return t%60==0?(t>0?"-":"+")+Ge(Math.abs(t)/60,2):vn(t,e)}function vn(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t);return r+Ge(Math.floor(i/60),2)+n+Ge(i%60,2)}var gn=ln;function pn(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"})}}function yn(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"})}}function mn(t,e){var n,r=t.match(/(P+)(p+)?/),i=r[1],a=r[2];if(!a)return pn(t,e);switch(i){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",pn(i,e)).replace("{{time}}",yn(a,e))}var wn={p:yn,P:mn},bn=wn,kn=["D","DD"],Tn=["YY","YYYY"];function xn(t){return-1!==kn.indexOf(t)}function Cn(t){return-1!==Tn.indexOf(t)}function An(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var Dn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,En=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sn=/^'([^]*?)'?$/,On=/''/g,Pn=/[a-zA-Z]/;function Rn(t,e,n){Vt(2,arguments);var r=String(e),i=n||{},a=i.locale||Qe,o=a.options&&a.options.firstWeekContainsDate,u=null==o?1:Zt(o),s=null==i.firstWeekContainsDate?u:Zt(i.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=a.options&&a.options.weekStartsOn,h=null==c?0:Zt(c),l=null==i.weekStartsOn?h:Zt(i.weekStartsOn);if(!(l>=0&&l<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var d=te(t);if(!ie(d))throw new RangeError("Invalid time value");var f=ne(d),v=Be(d,f),g={firstWeekContainsDate:s,weekStartsOn:l,locale:a,_originalDate:d},p=r.match(En).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,bn[e])(t,a.formatLong,g):t})).join("").match(Dn).map((function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return Un(n);var o=gn[r];if(o)return!i.useAdditionalWeekYearTokens&&Cn(n)&&An(n,e,t),!i.useAdditionalDayOfYearTokens&&xn(n)&&An(n,e,t),o(v,n,a.localize,g);if(r.match(Pn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n})).join("");return p}function Un(t){return t.match(Sn)[1].replace(On,"'")}function Mn(t,e){if(null==t)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e=e||{})Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function jn(t,e,n){Vt(2,arguments);var r=n||{},i=r.locale,a=i&&i.options&&i.options.weekStartsOn,o=null==a?0:Zt(a),u=null==r.weekStartsOn?o:Zt(r.weekStartsOn);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=te(t),c=Zt(e),h=s.getUTCDay(),l=c%7,d=(l+7)%7,f=(d0,i=r?e:1-e;if(i<=50)n=t||100;else{var a=i+50;n=t+100*Math.floor(a/100)-(t>=a%100?100:0)}return r?n:1-n}var Kn=[31,28,31,30,31,30,31,31,30,31,30,31],Jn=[31,29,31,30,31,30,31,31,30,31,30,31];function Zn(t){return t%400==0||t%4==0&&t%100!=0}var Vn={G:{priority:140,parse:function(t,e,n,r){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}},set:function(t,e,n,r){return e.era=n,t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["R","u","t","T"]},y:{priority:130,parse:function(t,e,n,r){var i=function(t){return{year:t,isTwoDigitYear:"yy"===e}};switch(e){case"y":return Qn(4,t,i);case"yo":return n.ordinalNumber(t,{unit:"year",valueCallback:i});default:return Qn(e.length,t,i)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,r){var i=t.getUTCFullYear();if(n.isTwoDigitYear){var a=Xn(n.year,i);return t.setUTCFullYear(a,0,1),t.setUTCHours(0,0,0,0),t}var o="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(o,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","u","w","I","i","e","c","t","T"]},Y:{priority:130,parse:function(t,e,n,r){var i=function(t){return{year:t,isTwoDigitYear:"YY"===e}};switch(e){case"Y":return Qn(4,t,i);case"Yo":return n.ordinalNumber(t,{unit:"year",valueCallback:i});default:return Qn(e.length,t,i)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,r){var i=on(t,r);if(n.isTwoDigitYear){var a=Xn(n.year,i);return t.setUTCFullYear(a,0,r.firstWeekContainsDate),t.setUTCHours(0,0,0,0),an(t,r)}var o="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(o,0,r.firstWeekContainsDate),t.setUTCHours(0,0,0,0),an(t,r)},incompatibleTokens:["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:{priority:130,parse:function(t,e,n,r){return Bn("R"===e?4:e.length,t)},set:function(t,e,n,r){var i=new Date(0);return i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0),Ve(i)},incompatibleTokens:["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:{priority:130,parse:function(t,e,n,r){return Bn("u"===e?4:e.length,t)},set:function(t,e,n,r){return t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["G","y","Y","R","w","I","i","e","c","t","T"]},Q:{priority:120,parse:function(t,e,n,r){switch(e){case"Q":case"QQ":return Qn(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,r){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:{priority:120,parse:function(t,e,n,r){switch(e){case"q":case"qq":return Qn(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,r){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:{priority:110,parse:function(t,e,n,r){var i=function(t){return t-1};switch(e){case"M":return Wn(Fn.month,t,i);case"MM":return Qn(2,t,i);case"Mo":return n.ordinalNumber(t,{unit:"month",valueCallback:i});case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]},L:{priority:110,parse:function(t,e,n,r){var i=function(t){return t-1};switch(e){case"L":return Wn(Fn.month,t,i);case"LL":return Qn(2,t,i);case"Lo":return n.ordinalNumber(t,{unit:"month",valueCallback:i});case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:{priority:100,parse:function(t,e,n,r){switch(e){case"w":return Wn(Fn.week,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return Qn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,r){return an(Nn(t,n,r),r)},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:{priority:100,parse:function(t,e,n,r){switch(e){case"I":return Wn(Fn.week,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return Qn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,r){return Ve($n(t,n,r),r)},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:{priority:90,subPriority:1,parse:function(t,e,n,r){switch(e){case"d":return Wn(Fn.date,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return Qn(e.length,t)}},validate:function(t,e,n){var r=Zn(t.getUTCFullYear()),i=t.getUTCMonth();return r?e>=1&&e<=Jn[i]:e>=1&&e<=Kn[i]},set:function(t,e,n,r){return t.setUTCDate(n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:{priority:90,subPriority:1,parse:function(t,e,n,r){switch(e){case"D":case"DD":return Wn(Fn.dayOfYear,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return Qn(e.length,t)}},validate:function(t,e,n){return Zn(t.getUTCFullYear())?e>=1&&e<=366:e>=1&&e<=365},set:function(t,e,n,r){return t.setUTCMonth(0,n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:{priority:90,parse:function(t,e,n,r){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=jn(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["D","i","e","c","t","T"]},e:{priority:90,parse:function(t,e,n,r){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return Qn(e.length,t,i);case"eo":return n.ordinalNumber(t,{unit:"day",valueCallback:i});case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=jn(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:{priority:90,parse:function(t,e,n,r){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return Qn(e.length,t,i);case"co":return n.ordinalNumber(t,{unit:"day",valueCallback:i});case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=jn(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:{priority:90,parse:function(t,e,n,r){var i=function(t){return 0===t?7:t};switch(e){case"i":case"ii":return Qn(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return n.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiii":return n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiiii":return n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i});default:return n.day(t,{width:"wide",context:"formatting",valueCallback:i})||n.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i})}},validate:function(t,e,n){return e>=1&&e<=7},set:function(t,e,n,r){return(t=qn(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:{priority:80,parse:function(t,e,n,r){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n,r){return t.setUTCHours(Gn(n),0,0,0),t},incompatibleTokens:["b","B","H","K","k","t","T"]},b:{priority:80,parse:function(t,e,n,r){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n,r){return t.setUTCHours(Gn(n),0,0,0),t},incompatibleTokens:["a","B","H","K","k","t","T"]},B:{priority:80,parse:function(t,e,n,r){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n,r){return t.setUTCHours(Gn(n),0,0,0),t},incompatibleTokens:["a","b","t","T"]},h:{priority:70,parse:function(t,e,n,r){switch(e){case"h":return Wn(Fn.hour12h,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return Qn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=12},set:function(t,e,n,r){var i=t.getUTCHours()>=12;return i&&n<12?t.setUTCHours(n+12,0,0,0):i||12!==n?t.setUTCHours(n,0,0,0):t.setUTCHours(0,0,0,0),t},incompatibleTokens:["H","K","k","t","T"]},H:{priority:70,parse:function(t,e,n,r){switch(e){case"H":return Wn(Fn.hour23h,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return Qn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=23},set:function(t,e,n,r){return t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","K","k","t","T"]},K:{priority:70,parse:function(t,e,n,r){switch(e){case"K":return Wn(Fn.hour11h,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return Qn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.getUTCHours()>=12&&n<12?t.setUTCHours(n+12,0,0,0):t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","H","k","t","T"]},k:{priority:70,parse:function(t,e,n,r){switch(e){case"k":return Wn(Fn.hour24h,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return Qn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=24},set:function(t,e,n,r){var i=n<=24?n%24:n;return t.setUTCHours(i,0,0,0),t},incompatibleTokens:["a","b","h","H","K","t","T"]},m:{priority:60,parse:function(t,e,n,r){switch(e){case"m":return Wn(Fn.minute,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return Qn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,r){return t.setUTCMinutes(n,0,0),t},incompatibleTokens:["t","T"]},s:{priority:50,parse:function(t,e,n,r){switch(e){case"s":return Wn(Fn.second,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return Qn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,r){return t.setUTCSeconds(n,0),t},incompatibleTokens:["t","T"]},S:{priority:30,parse:function(t,e,n,r){return Qn(e.length,t,(function(t){return Math.floor(t*Math.pow(10,3-e.length))}))},set:function(t,e,n,r){return t.setUTCMilliseconds(n),t},incompatibleTokens:["t","T"]},X:{priority:10,parse:function(t,e,n,r){switch(e){case"X":return zn(_n.basicOptionalMinutes,t);case"XX":return zn(_n.basic,t);case"XXXX":return zn(_n.basicOptionalSeconds,t);case"XXXXX":return zn(_n.extendedOptionalSeconds,t);default:return zn(_n.extended,t)}},set:function(t,e,n,r){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","x"]},x:{priority:10,parse:function(t,e,n,r){switch(e){case"x":return zn(_n.basicOptionalMinutes,t);case"xx":return zn(_n.basic,t);case"xxxx":return zn(_n.basicOptionalSeconds,t);case"xxxxx":return zn(_n.extendedOptionalSeconds,t);default:return zn(_n.extended,t)}},set:function(t,e,n,r){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","X"]},t:{priority:40,parse:function(t,e,n,r){return In(t)},set:function(t,e,n,r){return[new Date(1e3*n),{timestampIsSet:!0}]},incompatibleTokens:"*"},T:{priority:20,parse:function(t,e,n,r){return In(t)},set:function(t,e,n,r){return[new Date(n),{timestampIsSet:!0}]},incompatibleTokens:"*"}},tr=Vn,er=10,nr=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rr=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ir=/^'([^]*?)'?$/,ar=/''/g,or=/\S/,ur=/[a-zA-Z]/;function sr(t,e,n,r){Vt(3,arguments);var i=String(t),a=String(e),o=r||{},u=o.locale||Qe;if(!u.match)throw new RangeError("locale must contain match property");var s=u.options&&u.options.firstWeekContainsDate,c=null==s?1:Zt(s),h=null==o.firstWeekContainsDate?c:Zt(o.firstWeekContainsDate);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var l=u.options&&u.options.weekStartsOn,d=null==l?0:Zt(l),f=null==o.weekStartsOn?d:Zt(o.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===a)return""===i?te(n):new Date(NaN);var v,g={firstWeekContainsDate:h,weekStartsOn:f,locale:u},p=[{priority:er,subPriority:-1,set:cr,index:0}],y=a.match(rr).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,bn[e])(t,u.formatLong,g):t})).join("").match(nr),m=[];for(v=0;v0&&or.test(i))return new Date(NaN);var E=p.map((function(t){return t.priority})).sort((function(t,e){return e-t})).filter((function(t,e,n){return n.indexOf(t)===e})).map((function(t){return p.filter((function(e){return e.priority===t})).sort((function(t,e){return e.subPriority-t.subPriority}))})).map((function(t){return t[0]})),S=te(n);if(isNaN(S))return new Date(NaN);var O=Be(S,ne(S)),P={};for(v=0;v0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"store-hour",i)}return c(n,[{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,n=Math.abs(t-e);return Math.floor(n/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 sr(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 sr(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return ie(this.startDateInstance)&&ie(this.endDateInstance)?"".concat(Rn(this.startDateInstance,"p")," - ").concat(Rn(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!")}}]),n}(Nt),dr=function(t){l(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"store-location",i)}return c(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 at(this.getAttribute("hours").map((function(t){return new lr(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=Rn(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},e=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"payment-gateway",i)}return c(n,[{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!")}}]),n}(Nt),vr=function(t){l(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"store",i)}return c(n,[{key:"getReviews",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",a({store:this.id},e)).then((function(e){return new at(e.map((function(e){return new Yt(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",a({store:this.id},e)).then((function(e){return new at(e.map((function(e){return e.place&&(e.place=new kt(e.place)),new dr(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 dr(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 at(e.map((function(e){return new fr(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new fr(t,e.adapter)}))}}]),n}(Nt),gr=function(t){l(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"network",i)}return c(n,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getStores",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("stores",e).then((function(e){return new at(e.map((function(e){return new vr(e,t.adapter)})))}))}},{key:"getStoreLocations",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("store-locations",e).then((function(e){return new at(e.map((function(e){return new dr(e,t.adapter)})))}))}},{key:"getPaymentGateways",value:function(){var t=this;return this.adapter.get("gateways").then((function(e){return new at(e.map((function(e){return new fr(e,t.adapter)})))}))}}]),n}(Nt),pr=Array.isArray,yr=function(t){l(n,t);var e=m(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),r instanceof xt?y(t,t=e.call(this,{},r,"service-quote",a)):e.call(this,r,i,"service-quote",a)}return c(n,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Cr(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,n=t.currency;return zt(e)||zt(n)?null:_t(e/100,n)}},{key:"fromCart",value:function(t,e,r){var i,a,o,u=this,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"storefront",c=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return null!==(i=t)&&void 0!==i&&i.id&&(t=t.id),null!==(a=e)&&void 0!==a&&a.id&&(e=e.id),null!==(o=r)&&void 0!==o&&o.id&&(r=r.id),this.adapter.get("service-quotes/from-cart",{origin:t,destination:e,cart:r,config:s,all:c}).then((function(t){return pr(t)?new at(t.map((function(t){return new n(t,u.adapter)}))):new n(t,u.adapter)}))}}],[{key:"getFromCart",value:function(t){for(var e=new n(t),r=arguments.length,i=new Array(r>1?r-1:0),a=1;a4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return st(t)&&(t=t.id),st(e)&&(e=e.id),st(n)&&(n=n.id),st(r)&&(r=r.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),a(a({},i),{},{customer:t,cart:e,serviceQuote:n,gateway:r}),o)},captureOrder:function(t){var e=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:e},n).then((function(t){return new wt(t)}))}}),wr=function(t){l(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"checkout",i)}return c(n,[{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)}}]),n}(Nt),br={Product:It,Category:Qt,Customer:Gt,Cart:Jt,DeliveryServiceQuote:yr,Store:vr,StoreLocation:dr,StoreHour:lr,Checkout:wr,Review:Yt},kr={BrowserAdapter:Ct,NodeAdapter:At},Tr=function(){function t(){return u(this,t),this.resources=br,this.adapters=kr,this.lookup.apply(this,arguments)}return c(t,[{key:"lookup",value:function(t,e){var n=St(t),r=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][e])throw new Error("No ".concat(Ot(t)," named ").concat(e," to resolve"));return g(this[n][e],w(r))}}]),t}(),xr=function(){return g(Tr,Array.prototype.slice.call(arguments))},Cr=function(t){l(n,t);var e=m(n);function n(){return u(this,n),e.apply(this,arguments)}return c(n,[{key:"extendActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return qt(this,t)}},{key:"serialize",value:function(t){return xr("resource",Pt(this.resource),t,this.adapter)}}]),n}($t),Ar=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(u(this,t),this.version=n.version||"v1",this.options={version:this.version,host:n.host||"https://api.fleetbase.io",namespace:"storefront/".concat(this.version)||n.namespace,publicKey:e,debug:r},!Wt(e))throw new Error("⚠️ Invalid Storefront key given to Storefront SDK");this.adapter=n.adapter||Lt(this.options),this.products=new Cr("product",this.adapter),this.categories=new Cr("category",this.adapter),this.reviews=new Cr("review",this.adapter).extendActions(Ht),this.customers=new Cr("customer",this.adapter).extendActions(Bt),this.cart=new Cr("cart",this.adapter).extendActions(Kt),this.checkout=new Cr("checkout",this.adapter).extendActions(mr)}return c(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",a({query:t},e)).then((function(t){return new at(t.map((function(t){return new It(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return g(t,Array.prototype.slice.call(arguments))}}]),t}();t.Cart=Jt,t.Category=Qt,t.Checkout=wr,t.Customer=Gt,t.DeliveryServiceQuote=yr,t.Network=gr,t.PaymentGateway=fr,t.Product=It,t.Review=Yt,t.Store=vr,t.StoreHour=lr,t.StoreLocation=dr,t.default=Ar})); +!(function (t, e) { + "object" == typeof exports && "undefined" != typeof module + ? e(exports, require("axios")) + : "function" == typeof define && define.amd + ? define(["exports", "axios"], e) + : e( + ((t = "undefined" != typeof globalThis ? globalThis : t || self)[ + "@fleetbase/storefront" + ] = {}), + t.t, + ); +})(this, function (t, e) { + "use strict"; + function n(t) { + return t && "object" == typeof t && "default" in t ? t : { default: t }; + } + var r = n(e); + function i(t, e) { + var n = Object.keys(t); + if (Object.getOwnPropertySymbols) { + var r = Object.getOwnPropertySymbols(t); + e && + (r = r.filter(function (e) { + return Object.getOwnPropertyDescriptor(t, e).enumerable; + })), + n.push.apply(n, r); + } + return n; + } + function a(t) { + for (var e = 1; e < arguments.length; e++) { + var n = null != arguments[e] ? arguments[e] : {}; + e % 2 + ? i(Object(n), !0).forEach(function (e) { + h(t, e, n[e]); + }) + : Object.getOwnPropertyDescriptors + ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) + : i(Object(n)).forEach(function (e) { + Object.defineProperty( + t, + e, + Object.getOwnPropertyDescriptor(n, e), + ); + }); + } + return t; + } + function o(t) { + return ( + (o = + "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; + }), + o(t) + ); + } + function u(t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + } + function s(t, e) { + for (var n = 0; n < e.length; n++) { + var r = e[n]; + (r.enumerable = r.enumerable || !1), + (r.configurable = !0), + "value" in r && (r.writable = !0), + Object.defineProperty(t, r.key, r); + } + } + function c(t, e, n) { + return e && s(t.prototype, e), n && s(t, n), t; + } + function h(t, e, n) { + return ( + e in t + ? Object.defineProperty(t, e, { + value: n, + enumerable: !0, + configurable: !0, + writable: !0, + }) + : (t[e] = n), + t + ); + } + function l(t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError("Super expression must either be null or a function"); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && f(t, e); + } + function d(t) { + return ( + (d = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + }), + d(t) + ); + } + function f(t, e) { + return ( + (f = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + }), + f(t, e) + ); + } + function v() { + if ("undefined" == typeof Reflect || !Reflect.construct) return !1; + if (Reflect.construct.sham) return !1; + if ("function" == typeof Proxy) return !0; + try { + return ( + Boolean.prototype.valueOf.call( + Reflect.construct(Boolean, [], function () {}), + ), + !0 + ); + } catch (t) { + return !1; + } + } + function g(t, e, n) { + return ( + (g = v() + ? Reflect.construct + : function (t, e, n) { + var r = [null]; + r.push.apply(r, e); + var i = new (Function.bind.apply(t, r))(); + return n && f(i, n.prototype), i; + }), + g.apply(null, arguments) + ); + } + function p(t) { + if (void 0 === t) + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + return t; + } + function y(t, e) { + if (e && ("object" == typeof e || "function" == typeof e)) return e; + if (void 0 !== e) + throw new TypeError( + "Derived constructors may only return object or undefined", + ); + return p(t); + } + function m(t) { + var e = v(); + return function () { + var n, + r = d(t); + if (e) { + var i = d(this).constructor; + n = Reflect.construct(r, arguments, i); + } else n = r.apply(this, arguments); + return y(this, n); + }; + } + function w(t) { + return b(t) || k(t) || T(t) || C(); + } + function b(t) { + if (Array.isArray(t)) return x(t); + } + function k(t) { + if ( + ("undefined" != typeof Symbol && null != t[Symbol.iterator]) || + null != t["@@iterator"] + ) + return Array.from(t); + } + function T(t, e) { + if (t) { + if ("string" == typeof t) return x(t, e); + var n = Object.prototype.toString.call(t).slice(8, -1); + return ( + "Object" === n && t.constructor && (n = t.constructor.name), + "Map" === n || "Set" === n + ? Array.from(t) + : "Arguments" === n || + /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) + ? x(t, e) + : void 0 + ); + } + } + function x(t, e) { + (null == e || e > t.length) && (e = t.length); + for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; + return r; + } + function C() { + throw new TypeError( + "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.", + ); + } + function A(t, e) { + var n = Object.keys(t); + if (Object.getOwnPropertySymbols) { + var r = Object.getOwnPropertySymbols(t); + e && + (r = r.filter(function (e) { + return Object.getOwnPropertyDescriptor(t, e).enumerable; + })), + n.push.apply(n, r); + } + return n; + } + function D(t) { + for (var e = 1; e < arguments.length; e++) { + var n = null != arguments[e] ? arguments[e] : {}; + e % 2 + ? A(Object(n), !0).forEach(function (e) { + M(t, e, n[e]); + }) + : Object.getOwnPropertyDescriptors + ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) + : A(Object(n)).forEach(function (e) { + Object.defineProperty( + t, + e, + Object.getOwnPropertyDescriptor(n, e), + ); + }); + } + return t; + } + function E(t) { + return (E = + "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; + })(t); + } + function S(t, e, n, r, i, a, o) { + try { + var u = t[a](o), + s = u.value; + } catch (t) { + return void n(t); + } + u.done ? e(s) : Promise.resolve(s).then(r, i); + } + function O(t) { + return function () { + var e = this, + n = arguments; + return new Promise(function (r, i) { + var a = t.apply(e, n); + function o(t) { + S(a, r, i, o, u, "next", t); + } + function u(t) { + S(a, r, i, o, u, "throw", t); + } + o(void 0); + }); + }; + } + function P(t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + } + function R(t, e) { + for (var n = 0; n < e.length; n++) { + var r = e[n]; + (r.enumerable = r.enumerable || !1), + (r.configurable = !0), + "value" in r && (r.writable = !0), + Object.defineProperty(t, r.key, r); + } + } + function U(t, e, n) { + return e && R(t.prototype, e), n && R(t, n), t; + } + function M(t, e, n) { + return ( + e in t + ? Object.defineProperty(t, e, { + value: n, + enumerable: !0, + configurable: !0, + writable: !0, + }) + : (t[e] = n), + t + ); + } + function j(t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError("Super expression must either be null or a function"); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && $(t, e); + } + function q(t) { + return (q = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + })(t); + } + function $(t, e) { + return ($ = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + })(t, e); + } + function N() { + if ("undefined" == typeof Reflect || !Reflect.construct) return !1; + if (Reflect.construct.sham) return !1; + if ("function" == typeof Proxy) return !0; + try { + return ( + Boolean.prototype.valueOf.call( + Reflect.construct(Boolean, [], function () {}), + ), + !0 + ); + } catch (t) { + return !1; + } + } + function H(t, e, n) { + return (H = N() + ? Reflect.construct + : function (t, e, n) { + var r = [null]; + r.push.apply(r, e); + var i = new (Function.bind.apply(t, r))(); + return n && $(i, n.prototype), i; + }).apply(null, arguments); + } + function Y(t) { + var e = "function" == typeof Map ? new Map() : void 0; + return (Y = function (t) { + if ( + null === t || + ((n = t), -1 === Function.toString.call(n).indexOf("[native code]")) + ) + return t; + var n; + if ("function" != typeof t) + throw new TypeError( + "Super expression must either be null or a function", + ); + if (void 0 !== e) { + if (e.has(t)) return e.get(t); + e.set(t, r); + } + function r() { + return H(t, arguments, q(this).constructor); + } + return ( + (r.prototype = Object.create(t.prototype, { + constructor: { + value: r, + enumerable: !1, + writable: !0, + configurable: !0, + }, + })), + $(r, t) + ); + })(t); + } + function L(t, e) { + return !e || ("object" != typeof e && "function" != typeof e) + ? (function (t) { + if (void 0 === t) + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + return t; + })(t) + : e; + } + function F(t) { + var e = N(); + return function () { + var n, + r = q(t); + if (e) { + var i = q(this).constructor; + n = Reflect.construct(r, arguments, i); + } else n = r.apply(this, arguments); + return L(this, n); + }; + } + function _(t, e) { + return ( + (function (t) { + if (Array.isArray(t)) return t; + })(t) || + (function (t, e) { + var n = + null == t + ? null + : ("undefined" != typeof Symbol && t[Symbol.iterator]) || + t["@@iterator"]; + if (null != n) { + var r, + i, + a = [], + o = !0, + u = !1; + try { + for ( + n = n.call(t); + !(o = (r = n.next()).done) && + (a.push(r.value), !e || a.length !== e); + o = !0 + ); + } catch (t) { + (u = !0), (i = t); + } finally { + try { + o || null == n.return || n.return(); + } finally { + if (u) throw i; + } + } + return a; + } + })(t, e) || + z(t, e) || + (function () { + throw new TypeError( + "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.", + ); + })() + ); + } + function W(t) { + return ( + (function (t) { + if (Array.isArray(t)) return I(t); + })(t) || + (function (t) { + if ( + ("undefined" != typeof Symbol && null != t[Symbol.iterator]) || + null != t["@@iterator"] + ) + return Array.from(t); + })(t) || + z(t) || + (function () { + throw new TypeError( + "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.", + ); + })() + ); + } + function z(t, e) { + if (t) { + if ("string" == typeof t) return I(t, e); + var n = Object.prototype.toString.call(t).slice(8, -1); + return ( + "Object" === n && t.constructor && (n = t.constructor.name), + "Map" === n || "Set" === n + ? Array.from(t) + : "Arguments" === n || + /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) + ? I(t, e) + : void 0 + ); + } + } + function I(t, e) { + (null == e || e > t.length) && (e = t.length); + for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; + return r; + } + var Q = Array.isArray, + B = void 0 === arguments ? void 0 : arguments, + G = function (t, e, n) { + var r = + arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : []; + if (Q(t)) + if (r.length <= 6e4) t.splice.apply(t, [e, n].concat(W(r))); + else { + t.splice(e, n); + for (var i = 0; i < r.length; i += 6e4) { + var a = r.slice(i, i + 6e4); + t.splice.apply(t, [e + i, 0].concat(W(a))); + } + } + else K(arr) && t.replace(e, n, r); + }, + X = function (t) { + return t; + }, + K = function (t) { + return t instanceof at; + }, + J = function (t, e) { + return Q(t) ? t[e] : K(t) ? t.objectAt(e) : null; + }, + Z = function (t, e) { + return 2 === B.length + ? function (n) { + return e === n[t]; + } + : function (e) { + return Boolean(e[t]); + }; + }, + V = function (t, e) { + for ( + var n = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, + r = t.length, + i = n; + i < r; + i++ + ) { + var a = J(t, i); + if (e(a, i, t)) return i; + } + return -1; + }, + tt = function (t, e, n) { + var r = e.bind(n), + i = V(t, r, 0); + return -1 === i ? void 0 : J(t, i); + }, + et = function (t, e, n) { + var r = e.bind(n); + return -1 !== V(t, r, 0); + }, + nt = function (t, e, n) { + var r = e.bind(n); + return ( + -1 === + V( + t, + function (t, e, n) { + return !r(t, e, n); + }, + 0, + ) + ); + }, + rt = function (t, e) { + var n = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, + r = arguments.length > 3 ? arguments[3] : void 0, + i = t.length; + n < 0 && (n += i); + var a = + r && e != e + ? function (t) { + return t != t; + } + : function (t) { + return t === e; + }; + return V(t, a, n); + }, + it = function (t, e, n) { + return G(t, e, 0, [n]), n; + }, + at = (function (t) { + j(n, Y(Array)); + var e = F(n); + function n() { + for (var t = arguments.length, r = new Array(t), i = 0; i < t; i++) + r[i] = arguments[i]; + return ( + P(this, n), + L( + Q(arguments[0]) + ? e.call.apply(e, [this].concat(W(arguments[0]))) + : e.apply(this, arguments), + ) + ); + } + return ( + U(n, [ + { + key: "notEmpty", + get: function () { + return this.length > 0; + }, + }, + { + key: "empty", + get: function () { + return 0 === this.length; + }, + }, + { + key: "first", + get: function () { + return J(this, 0); + }, + }, + { + key: "last", + get: function () { + return J(this, this.length - 1); + }, + }, + { + key: "replace", + value: function (t, e) { + var n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : []; + return G(this, t, e, n), this; + }, + }, + { + key: "objectsAt", + value: function (t) { + var e = this; + return t.map(function (t) { + return J(e, t); + }); + }, + }, + { + key: "objectAt", + value: function (t) { + return J(this, t); + }, + }, + { + key: "indexOf", + value: function (t, e) { + return rt(this, t, e, !1); + }, + }, + { + key: "lastIndexOf", + value: function (t, e) { + var n = this.length; + (void 0 === e || e >= n) && (e = n - 1), e < 0 && (e += n); + for (var r = e; r >= 0; r--) if (J(this, r) === t) return r; + return -1; + }, + }, + { + key: "includes", + value: function (t, e) { + return -1 !== rt(this, t, e, !0); + }, + }, + { + key: "findBy", + value: function () { + return tt(this, Z.apply(void 0, arguments)); + }, + }, + { + key: "findIndexBy", + value: function () { + return V(this, Z.apply(void 0, arguments)); + }, + }, + { + key: "isEvery", + value: function () { + return nt(this, Z.apply(void 0, arguments)); + }, + }, + { + key: "isAny", + value: function () { + return et(this, Z.apply(void 0, arguments)); + }, + }, + { + key: "invoke", + value: function (t) { + for ( + var e = arguments.length, + n = new Array(e > 1 ? e - 1 : 0), + r = 1; + r < e; + r++ + ) + n[r - 1] = arguments[r]; + var i = []; + return ( + this.forEach(function (e) { + var r; + return i.push( + null === (r = e[t]) || void 0 === r + ? void 0 + : r.call.apply(r, [e].concat(n)), + ); + }), + i + ); + }, + }, + { + key: "toArray", + value: function () { + return this.map(function (t) { + return t; + }); + }, + }, + { + key: "compact", + value: function () { + return this.filter(function (t) { + return null != t; + }); + }, + }, + { + key: "sortBy", + value: function () { + var t = arguments; + return this.sort(function (e, n) { + for (var r = 0; r < t.length; r++) { + var i = t[r], + a = e[i], + o = n[i], + u = compare(a, o); + if (u) return u; + } + return 0; + }); + }, + }, + { + key: "uniqBy", + value: function (t) { + return (function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : X, + n = [], + r = new Set(), + i = + "function" == typeof e + ? e + : function (t) { + return get(t, e); + }; + return ( + t.forEach(function (t) { + var e = i(t); + r.has(e) || (r.add(e), n.push(t)); + }), + n + ); + })(this, t); + }, + }, + { + key: "without", + value: function (t) { + if (!this.includes(t)) return this; + var e = + t == t + ? function (e) { + return e !== t; + } + : function (t) { + return t == t; + }; + return this.filter(e); + }, + }, + { + key: "clear", + value: function () { + var t = this.length; + return 0 === t || this.replace(0, t, []), this; + }, + }, + { + key: "insertAt", + value: function (t, e) { + return it(this, t, e), this; + }, + }, + { + key: "replaceAt", + value: function (t, e) { + return this.replace(t, 1, [e]); + }, + }, + { + key: "removeAt", + value: function (t, e) { + return (function (t, e) { + return ( + G( + t, + e, + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : 1, + [], + ), + t + ); + })(this, t, e); + }, + }, + { + key: "pushObject", + value: function (t) { + return this.insertAt(this.length, t); + }, + }, + { + key: "pushObjects", + value: function (t) { + return this.replace(this.length, 0, t), this; + }, + }, + { + key: "popObject", + value: function () { + var t = this.length; + if (0 === t) return null; + var e = J(this, t - 1); + return this.removeAt(t - 1, 1), e; + }, + }, + { + key: "shiftObject", + value: function () { + if (0 === this.length) return null; + var t = J(this, 0); + return this.removeAt(0), t; + }, + }, + { + key: "unshiftObject", + value: function (t) { + return it(this, 0, t); + }, + }, + { + key: "unshiftObjects", + value: function (t) { + return this.replace(0, 0, t), this; + }, + }, + { + key: "reverseObjects", + value: function () { + var t = this.length; + if (0 === t) return this; + var e = this.toArray().reverse(); + return this.replace(0, t, e), this; + }, + }, + { + key: "setObjects", + value: function (t) { + if (0 === t.length) return this.clear(); + var e = this.length; + return this.replace(0, e, t), this; + }, + }, + { + key: "removeObject", + value: function (t) { + for (var e = this.length || 0; --e >= 0; ) + J(this, e) === t && this.removeAt(e); + return this; + }, + }, + { + key: "removeObjects", + value: function (t) { + for (var e = t.length - 1; e >= 0; e--) this.removeObject(t[e]); + return this; + }, + }, + { + key: "addObject", + value: function (t) { + return this.includes(t) || this.pushObject(t), this; + }, + }, + { + key: "addObjects", + value: function (t) { + var e = this; + return ( + t.forEach(function (t) { + return e.addObject(t); + }), + this + ); + }, + }, + ]), + n + ); + })(), + ot = function (t) { + var e = null == t; + if (e) return e; + if ("number" == typeof t.size) return !t.size; + var n = E(t); + if ("object" === n) { + var r = t.size; + if ("number" == typeof r) return !r; + } + if ("number" == typeof t.length && "function" !== n) return !t.length; + if ("object" === n) { + var i = t.length; + if ("number" == typeof i) return !i; + } + return !1; + }, + ut = function (t) { + return ot(t) || ("string" == typeof t && !1 === /\S/.test(t)); + }; + function st(t) { + return t instanceof yt; + } + var ct = function () { + var t, e, n, r, i; + return !( + "undefined" == typeof process || + ("object" !== + E(null === (t = process) || void 0 === t ? void 0 : t.env) && + -1 === + (null === (e = process.release) || + void 0 === e || + null === (n = e.name) || + void 0 === n + ? void 0 + : n.search(/node|io.js/))) || + ("undefined" != typeof window && + "ReactNative" !== + (null === (r = window) || + void 0 === r || + null === (i = r.navigator) || + void 0 === i + ? void 0 + : i.product)) + ); + }, + ht = function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return ct() + ? jt("adapter", "NodeAdapter", t) + : jt("adapter", "BrowserAdapter", t); + }, + lt = Array.isArray; + !(function () { + function t(e) { + P(this, t), + (this.place = e), + (this.geometry = null == e ? void 0 : e.geometry), + (this.components = this.parseComponents()), + (this.attributes = this.parseProperties()); + } + U(t, [ + { + key: "parse", + value: function () { + this.parseComponents(), this.parseProperties(); + }, + }, + { + key: "parseComponents", + value: function () { + var t; + return ( + (null === (t = this.place) || void 0 === t + ? void 0 + : t.address_components) || [] + ).reduce(function (t, e) { + return ( + e.types.forEach(function (n) { + t[n] = e; + }), + t + ); + }, {}); + }, + }, + { + key: "parseProperties", + value: function () { + var t, + e = { + streetNumber: this.get("street_number"), + streetName: this.get("route"), + coordinates: + null !== (t = this.geometry) && void 0 !== t && t.location + ? Object.values(this.geometry.location) + : [0, 0], + city: this.or([ + "locality", + "sublocality", + "sublocality_level_1", + "neighborhood", + "administrative_area_level_3", + "administrative_area_level_2", + ]), + county: this.get("administrative_area_level_2"), + stateShort: this.get("administrative_area_level_1", !0), + stateLong: this.get("administrative_area_level_1"), + countryShort: this.get("country", !0), + country: this.get("country", !0), + countryLong: this.get("country"), + postalCode: this.get("postal_code"), + }; + return ( + (e.address = [e.streetNumber, e.streetName] + .filter(Boolean) + .join(" ")), + e + ); + }, + }, + { + key: "all", + value: function () { + return this.attributes; + }, + }, + { + key: "or", + value: function () { + for ( + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : [], + e = 0; + e < t.length; + e++ + ) { + var n = t[e]; + if (lt(n)) { + var r = n[0], + i = n[1]; + if (this.has(r)) return this.get(r, i); + } else if (this.has(n)) return this.get(n); + } + return null; + }, + }, + { + key: "has", + value: function (t) { + return t in this.components; + }, + }, + { + key: "get", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; + return t in this.components + ? e + ? this.components[t].short_name + : this.components[t].long_name + : null; + }, + }, + { + key: "setAttributes", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return (this.attributes = D(D({}, this.attributes), t)), this; + }, + }, + { + key: "setAttribute", + value: function (t, e) { + return (this.attributes[t] = e), this; + }, + }, + { + key: "getAttribute", + value: function (t) { + return this.attributes[t] || null; + }, + }, + ]); + })(); + var dt = (function () { + function t() { + var e = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, + n = + arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; + P(this, t), (this.type = "Point"), (this.coordinates = [n, e]); + } + return ( + U( + t, + [ + { + key: "latitude", + get: function () { + return this.coordinates[1]; + }, + }, + { + key: "longitude", + get: function () { + return this.coordinates[0]; + }, + }, + { + key: "lat", + value: function () { + return this.latitude; + }, + }, + { + key: "lng", + value: function () { + return this.longitude; + }, + }, + { + key: "serialize", + value: function () { + return { type: "Point", coorindates: [this.lat(), this.lng()] }; + }, + }, + { + key: "toJson", + value: function () { + return this.serialize(); + }, + }, + { + key: "toString", + value: function () { + return "(" + .concat(this.latitude, ", ") + .concat(this.longitude, ")"); + }, + }, + ], + [ + { + key: "fromGeoJson", + value: function (e) { + var n = _(e.coordinates, 2); + return ( + (longitude = n[0]), + (latitude = n[1]), + new t(latitude, longitude) + ); + }, + }, + ], + ), + t + ); + })(), + ft = function (t, e) { + var n = t(); + return Array.isArray(n) || "object" === E(n) ? vt(n, e) : null; + }, + vt = function t(e, n) { + var r, + i = e, + a = E(e), + o = "object" === a, + u = "function" === a, + s = Array.isArray(e), + c = "string" === E(n) && n.includes(".") ? n.split(".") : [n]; + if (s || o) { + for (var h = 0; h < c.length; h++) { + if (i && void 0 === i[c[h]]) return null; + if (i) { + if ( + "object" === E((r = i = i[c[h]])) && + !ot(null == r ? void 0 : r.attributes) && + "object" === E(null == r ? void 0 : r.attributes) && + void 0 !== c[h + 1] + ) { + var l = c.slice(h + 1).join("."); + return t(i.attributes, l); + } + if ("function" == typeof i) { + var d = c.slice(h + 1).join("."); + return ft(i, d); + } + } + } + return i; + } + if (u) return ft(e, n); + }, + gt = function (t, e, n) { + var r = t, + i = "object" === E(t), + a = Array.isArray(t), + o = "string" === E(e) && e.includes(".") ? e.split(".") : [e], + u = o.length; + if (a || i) { + for (var s = 0; s < u - 1; s++) + r[o[s]] || (r[o[s]] = {}), (r = r[o[s]]); + r[o[u - 1]] = n; + } + return n; + }, + pt = (function () { + function t() { + var e = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : null; + P(this, t), (this.actions = e), (this.bind = n); + } + return ( + U(t, [ + { + key: "extend", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : null, + e = t || this.bind; + if (!e) return this; + if (null != this && this.actions && "object" === E(this.actions)) + for (var n in this.actions) { + var r = this.actions[n]; + gt(e, n, "function" == typeof r ? r.bind(e) : r); + } + return this; + }, + }, + ]), + t + ); + })(), + yt = (function () { + function t() { + var e = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = arguments.length > 1 ? arguments[1] : void 0, + r = arguments.length > 2 ? arguments[2] : void 0, + i = + arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; + P(this, t), + (this.attributes = e), + (this.dirtyAttributes = {}), + (this.changes = {}), + (this.isLoading = !1), + (this.isSaving = !1), + (this.isDestroying = !1), + (this.isReloading = !1), + (this.resource = r), + (this.options = i), + (this.version = i.version || "v1"), + this.setAdapter(n); + } + return ( + U(t, [ + { + key: "setAdapter", + value: function (t) { + var e; + return ( + (this.adapter = t), + (this.store = new $t(this.resource, t, { + onAfterFetch: this.syncAttributes.bind(this), + actions: + null === (e = this.options) || void 0 === e + ? void 0 + : e.actions, + })), + this + ); + }, + }, + { + key: "id", + get: function () { + return this.getAttribute("id"); + }, + }, + { + key: "create", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}, + n = this.mergeAttributes(e); + return ( + this.setFlags(["isLoading", "isSaving"]), + this.store.create(n).then(function (e) { + return t.setFlags(["isLoading", "isSaving"], !1), e; + }) + ); + }, + }, + { + key: "update", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return ( + this.setFlags(["isLoading", "isSaving"]), + this.store.update(this.attributes.id, e).then(function (e) { + return t.setFlags(["isLoading", "isSaving"], !1), e; + }) + ); + }, + }, + { + key: "destroy", + value: function () { + var t = this; + return ( + this.setFlags(["isLoading", "isDestroying"]), + this.store.destroy(this.attributes.id).then(function (e) { + return t.setFlags(["isLoading", "isDestroying"], !1), e; + }) + ); + }, + }, + { + key: "reload", + value: function () { + var t = this; + return ( + this.setFlags(["isLoading", "isReloading"]), + this.store.findRecord(this.attributes.id).then(function (e) { + return t.reset(), e; + }) + ); + }, + }, + { + key: "setFlags", + value: function () { + for ( + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : [], + e = + !(arguments.length > 1 && void 0 !== arguments[1]) || + arguments[1], + n = ["isLoading", "isSaving", "isReloading", "isDestroying"], + r = 0; + r < t.length; + r++ + ) { + var i = t[r]; + if ("string" != typeof i || !n.includes(i)) + throw new Error("".concat(i, " is not a valid flag!")); + this[i] = e; + } + return this; + }, + }, + { + key: "reset", + value: function () { + return ( + (this.dirtyAttributes = {}), + (this.changes = {}), + (this.isLoading = !1), + (this.isSaving = !1), + (this.isReloading = !1), + this + ); + }, + }, + { + key: "empty", + value: function () { + return this.reset(), (this.attribues = {}), this; + }, + }, + { + key: "save", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}, + e = this.getAttributes(); + return ot(this.id) + ? this.create(e) + : !0 === t.onlyDirty + ? this.savedirty() + : this.update(e); + }, + }, + { + key: "saveDirty", + value: function () { + for ( + var t = Object.keys(this.dirtyAttributes), e = {}, n = 0; + n < t.length; + n++ + ) { + var r = t[n]; + e[r] = this.getAttribute(r); + } + return this.update(e); + }, + }, + { + key: "createdAt", + get: function () { + return this.hasAttribute("created_at") + ? new Date(this.getAttribute("created_at")) + : null; + }, + }, + { + key: "updatedAt", + get: function () { + return this.hasAttribute("updated_at") + ? new Date(this.getAttribute("updated_at")) + : null; + }, + }, + { + key: "isLoaded", + get: function () { + return this.hasAttributes(["created_at", "id"]); + }, + }, + { + key: "isEmpty", + get: function () { + return ( + 0 === + Object.values(null == this ? void 0 : this.attributes).length + ); + }, + }, + { + key: "isNew", + get: function () { + return !this.id; + }, + }, + { + key: "isSaved", + get: function () { + return !this.isNew && this.isLoaded; + }, + }, + { + key: "isDeleted", + get: function () { + return this.hasAttributes(["deleted", "time"]); + }, + }, + { + key: "eachAttribute", + value: function (t) { + var e, + n = this; + return ( + "function" != typeof t || + Object.keys( + null !== (e = null == this ? void 0 : this.attributes) && + void 0 !== e + ? e + : {}, + ).forEach(function (e) { + var r = n.getAttribute(e); + t.call(n, r, e); + }), + this + ); + }, + }, + { + key: "changes", + value: function () { + return this.changes; + }, + }, + { + key: "getDirtyAttributes", + value: function () { + return this.dirtyAttributes; + }, + }, + { + key: "isDirty", + value: function (t) { + return t in this.dirtyAttributes; + }, + }, + { + key: "hasDirtyAttributes", + value: function () { + var t; + return ( + Object.keys( + null !== (t = null == this ? void 0 : this.dirtyAttributes) && + void 0 !== t + ? t + : {}, + ).length > 0 + ); + }, + }, + { + key: "mutate", + value: function (t, e) { + this.attributes[t] = e; + }, + }, + { + key: "setAttribute", + value: function (t) { + var e, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : null; + if (null === n && "object" === E(t)) return this.setAttributes(t); + var r = + null !== (e = null == this ? void 0 : this.attributes[t]) && + void 0 !== e + ? e + : null; + return ( + gt(this.attributes, t, n), + gt(this.dirtyAttributes, t, r), + Q(null == this ? void 0 : this.changes[t]) || + (this.changes[t] = []), + this.changes[t].push({ + property: t, + previousValue: r, + value: n, + changedAt: new Date(), + }), + this + ); + }, + }, + { + key: "setAttributes", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + for (var e in t) this.setAttribute(e, t[e]); + return this; + }, + }, + { + key: "getAttribute", + value: function (t) { + var e, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : null, + r = vt( + null !== (e = null == this ? void 0 : this.attributes) && + void 0 !== e + ? e + : {}, + t, + ); + return void 0 === r ? n : r; + }, + }, + { + key: "hasAttribute", + value: function (t) { + if (Q(t)) { + var e, + n = t, + r = Object.keys( + null !== (e = this.attributes) && void 0 !== e ? e : {}, + ); + return n.every(function (t) { + return r.includes(t); + }); + } + return ( + !(null == this || !this.attributes) && t in this.attributes + ); + }, + }, + { + key: "hasAttributes", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : []; + return this.hasAttribute(t); + }, + }, + { + key: "isAttributeFilled", + value: function (t) { + var e = this; + return Q(t) + ? this.hasAttribute(t) && + t.every(function (t) { + return !ot(e.getAttribute(t)); + }) + : this.hasAttribute(t) && !ot(this.getAttribute(t)); + }, + }, + { + key: "getAttributes", + value: function (t) { + var e = {}; + if (null == t) + return this.getAttributes(Object.keys(this.attributes)); + if ("string" == typeof t) + return this.getAttribute(Array.prototype.slice.call(arguments)); + if (!Q(t)) throw new Error("No attribute properties provided!"); + for (var n = 0; n < t.length; n++) { + var r, + i, + a = t[n]; + if ("string" == typeof a) { + var o = this.getAttribute(a); + "object" !== + E( + null === (r = o) || void 0 === r ? void 0 : r.attributes, + ) || + Q( + null === (i = o) || void 0 === i ? void 0 : i.attributes, + ) || + (o = o.attributes), + (e[a] = o); + } + } + return e; + }, + }, + { + key: "serialize", + value: function () { + return this.getAttributes(); + }, + }, + { + key: "mergeAttributes", + value: function () { + var t, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}, + n = + null !== (t = null == this ? void 0 : this.attributes) && + void 0 !== t + ? t + : {}; + return (this.attributes = D(D({}, n), e)), this.attributes; + }, + }, + { + key: "syncAttributes", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + this.attributes = t; + }, + }, + ]), + t + ); + })(), + mt = new pt({ + getDistanceAndTime: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + return this.adapter.get( + "".concat(this.namespace, "/").concat(t, "/distance-and-time"), + {}, + e, + ); + }, + }), + wt = (function (t) { + j(n, yt); + var e = F(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return P(this, n), e.call(this, t, r, "order", D({ actions: mt }, i)); + } + return ( + U(n, [ + { + key: "getDistanceAndTime", + value: function () { + return this.store.getDistanceAndTime(this.id); + }, + }, + ]), + n + ); + })(), + bt = (function (t) { + j(n, yt); + var e = F(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return P(this, n), e.call(this, t, r, "payload", i); + } + return ( + U(n, [ + { key: "attach", value: function (t) {} }, + { key: "entities", get: function () {} }, + { key: "dropoff", get: function () {} }, + { key: "pickup", get: function () {} }, + { + key: "waypoints", + get: function () { + return new at(this.waypoints); + }, + }, + ]), + n + ); + })(); + !(function (t) { + j(n, yt); + var e = F(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return P(this, n), e.call(this, t, r, "entity", i); + } + })(); + var kt = (function (t) { + j(n, yt); + var e = F(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return P(this, n), e.call(this, t, r, "place", i); + } + return ( + U( + n, + [ + { + key: "latitude", + get: function () { + var t; + return null === (t = this.getAttribute("location", new dt())) || + void 0 === t + ? void 0 + : t.coordinates[1]; + }, + }, + { + key: "longitude", + get: function () { + var t; + return null === (t = this.getAttribute("location", new dt())) || + void 0 === t + ? void 0 + : t.coordinates[0]; + }, + }, + { + key: "coordinates", + get: function () { + return [this.latitude, this.longitude]; + }, + }, + { + key: "setOwner", + value: function (t) { + return ( + st(t) && this.setAttribute("owner", t.id), + "string" == typeof t && this.setAttribute("owner", t), + this + ); + }, + }, + ], + [ + { + key: "fromGoogleAddress", + value: function (t, e) { + var r = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}, + i = t.getAttribute("coordinates"), + a = _(i, 2), + o = a[0], + u = a[1], + s = { + name: null, + address: t.getAttribute("address"), + location: new dt(o, u), + street1: t.getAttribute("streetName"), + street2: null, + city: t.getAttribute("city"), + province: t.getAttribute("stateLong"), + postal_code: t.getAttribute("postalCode"), + neighborhood: t.get("neighborhood"), + district: t.getAttribute("county"), + building: t.get("building"), + country: t.getAttribute("countryShort"), + phone: null, + security_access_code: null, + }; + return new n(s, e, r); + }, + }, + ], + ), + n + ); + })(); + !(function (t) { + j(n, kt); + var e = F(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return P(this, n), e.call(this, t, r, "waypoint", i); + } + })(), + (function (t) { + j(n, yt); + var e = F(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return P(this, n), e.call(this, t, r, "tracking-status", i); + } + })(), + (function (t) { + j(n, yt); + var e = F(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return P(this, n), e.call(this, t, r, "vehicle", i); + } + })(), + (function (t) { + j(n, yt); + var e = F(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return P(this, n), e.call(this, t, r, "driver", i); + } + })(), + (function (t) { + j(n, yt); + var e = F(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return P(this, n), e.call(this, t, r, "vendor", i); + } + })(), + (function (t) { + j(n, yt); + var e = F(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return P(this, n), e.call(this, t, r, "contact", i); + } + })(), + (function (t) { + j(n, yt); + var e = F(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return P(this, n), e.call(this, t, r, "zone", i); + } + })(), + (function (t) { + j(n, yt); + var e = F(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return P(this, n), e.call(this, t, r, "service-area", i); + } + })(), + (function (t) { + j(n, yt); + var e = F(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return P(this, n), e.call(this, t, r, "service-rate", i); + } + })(); + var Tt = (function (t) { + j(n, yt); + var e = F(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return P(this, n), e.call(this, t, r, "service-quote", i); + } + return ( + U(n, [ + { key: "fromPreliminary", value: function () {} }, + { key: "fromPayload", value: function () {} }, + ]), + n + ); + })(), + xt = function t() { + var e = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + P(this, t), + (this.version = e.version || "v1"), + (this.host = e.host || null), + (this.namespace = e.namespace || null), + (this.headers = e.headers || {}); + }, + Ct = (function (t) { + j(n, xt); + var e = F(n); + function n(t) { + var r; + return ( + P(this, n), + (r = e.call(this, t)).setHeaders({ + Authorization: "Bearer ".concat(t.publicKey), + "Content-Type": "application/json", + "User-Agent": "@fleetbase/sdk;browser", + }), + r + ); + } + return ( + U(n, [ + { + key: "setHeaders", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return (this.headers = D(D({}, this.headers), t)), this; + }, + }, + { + key: "parseJSON", + value: function (t) { + return new Promise(function (e, n) { + return t + .json() + .then(function (n) { + return e({ + statusText: t.statusText, + status: t.status, + ok: t.ok, + json: n, + }); + }) + .catch(function () { + n( + new Error( + "Oops! Something went wrong when handling your request.", + ), + ); + }); + }); + }, + }, + { + key: "request", + value: function (t) { + var e = this, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : "GET", + r = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}, + i = + arguments.length > 3 && void 0 !== arguments[3] + ? arguments[3] + : {}; + return new Promise(function (a, o) { + return fetch( + i.url || + "".concat(e.host, "/").concat(e.namespace, "/").concat(t), + D( + { + method: n, + mode: i.mode || "cors", + headers: new Headers( + D(D({}, e.headers || {}), i.headers || {}), + ), + }, + r, + ), + ) + .then(e.parseJSON) + .then(function (t) { + return t.ok + ? a(t.json) + : o( + new Error( + t.json.errors ? t.json.errors[0] : t.statusText, + ), + ); + }) + .catch(function (t) { + o(t); + }); + }); + }, + }, + { + key: "get", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}, + r = ut(e) ? "" : new URLSearchParams(e).toString(); + return this.request( + "".concat(t).concat(r ? "?".concat(r) : ""), + "GET", + {}, + n, + ); + }, + }, + { + key: "post", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}; + return this.request(t, "POST", { body: JSON.stringify(e) }, n); + }, + }, + { + key: "put", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}; + return this.request(t, "PUT", { body: JSON.stringify(e) }, n); + }, + }, + { + key: "delete", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}; + return this.request(t, "DELETE", {}, e); + }, + }, + { + key: "patch", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}; + return this.request(t, "PATCH", { body: JSON.stringify(e) }, n); + }, + }, + ]), + n + ); + })(), + At = (function (t) { + j(n, xt); + var e = F(n); + function n(t) { + var i; + return ( + P(this, n), + ((i = e.call(this, t)).axios = r.default.create({ + baseURL: "".concat(i.host, "/").concat(i.namespace), + headers: { + Authorization: "Bearer ".concat(t.publicKey), + "Content-Type": "application/json", + "User-Agent": "@fleetbase/sdk;node", + }, + })), + i + ); + } + return ( + U(n, [ + { + key: "setHeaders", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}, + e = this.axios.defaults.headers.common; + return ( + (this.axios.defaults.headers.common = D(D({}, e), t)), this + ); + }, + }, + { + key: "transform", + value: function (t) { + return t.data; + }, + }, + { + key: "handleError", + value: function (t) { + if (t.response) { + var e = t.response.data; + if (Q(e.errors)) throw new Error(e.errors[0]); + if (e.error) throw new Error(e.error); + } + throw t; + }, + }, + { + key: "get", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}, + r = ut(e) ? "" : new URLSearchParams(e).toString(); + return this.axios + .get("".concat(t).concat(r ? "?".concat(r) : ""), n) + .then(this.transform.bind(this)) + .catch(this.handleError.bind(this)); + }, + }, + { + key: "post", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}; + return this.axios + .post(t, e, n) + .then(this.transform.bind(this)) + .catch(this.handleError.bind(this)); + }, + }, + { + key: "put", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}; + return this.axios + .put(t, e, n) + .then(this.transform.bind(this)) + .catch(this.handleError.bind(this)); + }, + }, + { + key: "delete", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}; + return this.axios + .delete(t, e) + .then(this.transform.bind(this)) + .catch(this.handleError.bind(this)); + }, + }, + { + key: "patch", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}; + return this.axios + .patch(t, e, n) + .then(this.transform.bind(this)) + .catch(this.handleError.bind(this)); + }, + }, + ]), + n + ); + })(), + Dt = (function (t) { + j(n, xt); + var e = F(n); + function n() { + return P(this, n), e.apply(this, arguments); + } + return n; + })(), + Et = (function () { + function t(e) { + var n = + !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; + P(this, t), + M(this, "uncountableWords", [ + "equipment", + "information", + "rice", + "money", + "species", + "series", + "fish", + "sheep", + "moose", + "deer", + "news", + ]), + M(this, "pluralRules", [ + [new RegExp("(m)an$", "gi"), "$1en"], + [new RegExp("(pe)rson$", "gi"), "$1ople"], + [new RegExp("(child)$", "gi"), "$1ren"], + [new RegExp("^(ox)$", "gi"), "$1en"], + [new RegExp("(ax|test)is$", "gi"), "$1es"], + [new RegExp("(octop|vir)us$", "gi"), "$1i"], + [new RegExp("(alias|status)$", "gi"), "$1es"], + [new RegExp("(bu)s$", "gi"), "$1ses"], + [new RegExp("(buffal|tomat|potat)o$", "gi"), "$1oes"], + [new RegExp("([ti])um$", "gi"), "$1a"], + [new RegExp("sis$", "gi"), "ses"], + [new RegExp("(?:([^f])fe|([lr])f)$", "gi"), "$1$2ves"], + [new RegExp("(hive)$", "gi"), "$1s"], + [new RegExp("([^aeiouy]|qu)y$", "gi"), "$1ies"], + [new RegExp("(x|ch|ss|sh)$", "gi"), "$1es"], + [new RegExp("(matr|vert|ind)ix|ex$", "gi"), "$1ices"], + [new RegExp("([m|l])ouse$", "gi"), "$1ice"], + [new RegExp("(quiz)$", "gi"), "$1zes"], + [new RegExp("s$", "gi"), "s"], + [new RegExp("$", "gi"), "s"], + ]), + M(this, "singularRules", [ + [new RegExp("(m)en$", "gi"), "$1an"], + [new RegExp("(pe)ople$", "gi"), "$1rson"], + [new RegExp("(child)ren$", "gi"), "$1"], + [new RegExp("([ti])a$", "gi"), "$1um"], + [ + new RegExp( + "((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$", + "gi", + ), + "$1$2sis", + ], + [new RegExp("(hive)s$", "gi"), "$1"], + [new RegExp("(tive)s$", "gi"), "$1"], + [new RegExp("(curve)s$", "gi"), "$1"], + [new RegExp("([lr])ves$", "gi"), "$1f"], + [new RegExp("([^fo])ves$", "gi"), "$1fe"], + [new RegExp("([^aeiouy]|qu)ies$", "gi"), "$1y"], + [new RegExp("(s)eries$", "gi"), "$1eries"], + [new RegExp("(m)ovies$", "gi"), "$1ovie"], + [new RegExp("(x|ch|ss|sh)es$", "gi"), "$1"], + [new RegExp("([m|l])ice$", "gi"), "$1ouse"], + [new RegExp("(bus)es$", "gi"), "$1"], + [new RegExp("(o)es$", "gi"), "$1"], + [new RegExp("(shoe)s$", "gi"), "$1"], + [new RegExp("(cris|ax|test)es$", "gi"), "$1is"], + [new RegExp("(octop|vir)i$", "gi"), "$1us"], + [new RegExp("(alias|status)es$", "gi"), "$1"], + [new RegExp("^(ox)en", "gi"), "$1"], + [new RegExp("(vert|ind)ices$", "gi"), "$1ex"], + [new RegExp("(matr)ices$", "gi"), "$1ix"], + [new RegExp("(quiz)zes$", "gi"), "$1"], + [new RegExp("s$", "gi"), ""], + ]), + M(this, "nonTitlecasedWords", [ + "and", + "or", + "nor", + "a", + "an", + "the", + "so", + "but", + "to", + "of", + "at", + "by", + "from", + "into", + "on", + "onto", + "off", + "out", + "in", + "over", + "with", + "for", + ]), + M(this, "idSuffix", new RegExp("(_ids|_id)$", "g")), + M(this, "underbar", new RegExp("_", "g")), + M(this, "spaceOrUnderbar", new RegExp("[ _]", "g")), + M(this, "uppercase", new RegExp("([A-Z])", "g")), + M(this, "underbarPrefix", new RegExp("^_")), + (this.str = e), + (this.chain = n); + } + return ( + U( + t, + [ + { + key: "get", + value: function () { + return this.str; + }, + }, + { + key: "applyRules", + value: function (t, e, n, r) { + if (r) t = r; + else if (!(n.indexOf(t.toLowerCase()) > -1)) + for (var i = 0; i < e.length; i++) + if (t.match(e[i][0])) { + t = t.replace(e[i][0], e[i][1]); + break; + } + return (this.str = t), !0 === this.chain ? this : t; + }, + }, + { + key: "pluralize", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : null; + return ( + (t = t || this.str), + this.applyRules(t, this.pluralRules, this.uncountableWords, e) + ); + }, + }, + { + key: "singularize", + value: function (t, e) { + return ( + (t = t || this.str), + this.applyRules( + t, + this.singularRules, + this.uncountableWords, + e, + ) + ); + }, + }, + { + key: "camelize", + value: function (t, e) { + for ( + var n = (t = t || this.str).split("/"), r = 0; + r < n.length; + r++ + ) { + for ( + var i = n[r].split("_"), + a = e && r + 1 === n.length ? 1 : 0; + a < i.length; + a++ + ) + i[a] = i[a].charAt(0).toUpperCase() + i[a].substring(1); + n[r] = i.join(""); + } + if (((t = n.join("::")), !0 === e)) { + var o = t.charAt(0).toLowerCase(), + u = t.slice(1); + t = o + u; + } + return (this.str = t), !0 === this.chain ? this : t; + }, + }, + { + key: "underscore", + value: function (t) { + for ( + var e = (t = t || this.str).split("::"), n = 0; + n < e.length; + n++ + ) + (e[n] = e[n].replace(this.uppercase, "_$1")), + (e[n] = e[n].replace(this.underbarPrefix, "")); + return ( + (t = e.join("/").toLowerCase()), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "humanize", + value: function (t, e) { + return ( + (t = (t = (t = (t = t || this.str).toLowerCase()).replace( + this.idSuffix, + "", + )).replace(this.underbar, " ")), + e || (t = this.capitalize(t)), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "capitalize", + value: function (t) { + return ( + (t = + (t = (t = t || this.str).toLowerCase()) + .substring(0, 1) + .toUpperCase() + t.substring(1)), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "dasherize", + value: function (t) { + return ( + (t = (t = (t = t || this.str).replace( + this.spaceOrUnderbar, + "-", + )).toLowerCase()), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "normify", + value: function (t, e) { + (t = t || this.str), + !0 === e + ? ((t = this.camelize(t)), (t = this.underscore(t))) + : (t = t.toLowerCase()); + for ( + var n = (t = t.replace(this.underbar, " ")).split(" "), r = 0; + r < n.length; + r++ + ) { + for (var i = n[r].split("-"), a = 0; a < i.length; a++) + this.nonTitlecasedWords.indexOf(i[a].toLowerCase()) < 0 && + (i[a] = this.capitalize(i[a])); + n[r] = i.join("-"); + } + return ( + (t = + (t = n.join(" ")).substring(0, 1).toUpperCase() + + t.substring(1)), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "demodulize", + value: function (t) { + var e = (t = t || this.str).split("::"); + return ( + (t = e[e.length - 1]), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "tableize", + value: function (t) { + return ( + (t = t || this.str), + (t = this.pluralize(this.underscore(t))), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "classify", + value: function (t) { + return ( + (t = t || this.str), + (t = this.singularize(this.camelize(t))), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "foreignKey", + value: function (t) { + var e = + arguments.length > 1 && + void 0 !== arguments[1] && + arguments[1]; + return ( + (t = t || this.str), + (t = + this.underscore(this.demodulize(t)) + + (e ? "" : "_") + + "id"), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "ordinalize", + value: function (t) { + for ( + var e = (t = t || this.str).split(" "), n = 0; + n < e.length; + n++ + ) + if (NaN === parseInt(e[n])) { + var r = e[n].substring(e[n].length - 2), + i = e[n].substring(e[n].length - 1), + a = "th"; + "11" != r && + "12" != r && + "13" != r && + ("1" === i + ? (a = "st") + : "2" === i + ? (a = "nd") + : "3" === i && (a = "rd")), + (e[n] += a); + } + return ( + (t = e.join(" ")), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + ], + [ + { + key: "invoke", + value: function () { + var e = Object.values(arguments), + n = new t(null, !1), + r = arguments[0]; + return ( + e.shift(), + "function" == typeof n[r] ? n[r].apply(n, W(e)) : null + ); + }, + }, + ], + ), + t + ); + })(), + St = function () { + var t = ["pluralize"].concat(Array.prototype.slice.call(arguments)); + return Et.invoke.apply(Et, W(t)); + }, + Ot = function () { + var t = ["singularize"].concat(Array.prototype.slice.call(arguments)); + return Et.invoke.apply(Et, W(t)); + }, + Pt = function () { + var t = ["classify"].concat(Array.prototype.slice.call(arguments)); + return Et.invoke.apply(Et, W(t)); + }, + Rt = { Place: kt, Payload: bt, Order: wt }, + Ut = { BrowserAdapter: Ct, NodeAdapter: At, EmberJsAdapter: Dt }, + Mt = (function () { + function t() { + return ( + P(this, t), + (this.resources = Rt), + (this.adapters = Ut), + this.lookup.apply(this, arguments) + ); + } + return ( + U(t, [ + { + key: "lookup", + value: function (t, e) { + var n = St(t), + r = Array.prototype.slice.call(arguments).slice(2); + if (!this[n]) + throw new Error("Attempted to resolve invalid type"); + if (!this[n][e]) + throw new Error( + "No ".concat(Ot(t), " named ").concat(e, " to resolve"), + ); + return H(this[n][e], W(r)); + }, + }, + ]), + t + ); + })(), + jt = function () { + return H(Mt, Array.prototype.slice.call(arguments)); + }, + qt = function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : []; + if (((t.actions = Q(e) ? e : [e]), !Q(e))) + return e instanceof pt && e.extend(t), t; + for (var n = 0; n < e.length; n++) { + var r = e[n]; + t.extendActions(r); + } + }, + $t = (function () { + function t(e, n) { + var r = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + P(this, t), + (this.resource = e), + (this.adapter = n || ht()), + (this.namespace = St(e)), + (this.storage = new at()), + (this.options = r), + this.extendActions(r.actions); + } + return ( + U(t, [ + { + key: "extendActions", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : []; + return qt(this, t); + }, + }, + { + key: "deposit", + value: function (t) { + return t; + }, + }, + { + key: "serialize", + value: function (t) { + return jt("resource", Pt(this.resource), t, this.adapter); + }, + }, + { + key: "afterFetch", + value: function (t) { + return (function (t, e) { + if ( + ("function" == typeof t.options.onAfterFetch && + t.options.onAfterFetch(e), + Q(e)) + ) { + for (var n = [], r = 0; r < e.length; r++) + n.push(t.afterFetch(e[r])); + return H(at, n); + } + var i = t.serialize(e); + return t.deposit(i); + })(this, t); + }, + }, + { + key: "create", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}; + return new Promise( + (function () { + var r = O( + regeneratorRuntime.mark(function r(i, a) { + var o; + return regeneratorRuntime.wrap(function (r) { + for (;;) + switch ((r.prev = r.next)) { + case 0: + return ( + (r.next = 2), + t.adapter + .post("".concat(t.namespace), e, n) + .then(t.afterFetch.bind(t)) + .catch(a) + ); + case 2: + (o = r.sent), i(o); + case 4: + case "end": + return r.stop(); + } + }, r); + }), + ); + return function (t, e) { + return r.apply(this, arguments); + }; + })(), + ); + }, + }, + { + key: "update", + value: function (t) { + var e = this, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + r = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}; + return new Promise( + (function () { + var i = O( + regeneratorRuntime.mark(function i(a, o) { + var u; + return regeneratorRuntime.wrap(function (i) { + for (;;) + switch ((i.prev = i.next)) { + case 0: + return ( + (i.next = 2), + e.adapter + .put( + "".concat(e.namespace, "/").concat(t), + n, + r, + ) + .then(e.afterFetch.bind(e)) + .catch(o) + ); + case 2: + (u = i.sent), a(u); + case 4: + case "end": + return i.stop(); + } + }, i); + }), + ); + return function (t, e) { + return i.apply(this, arguments); + }; + })(), + ); + }, + }, + { + key: "findRecord", + value: function (t) { + var e = this, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}; + return new Promise( + (function () { + var r = O( + regeneratorRuntime.mark(function r(i, a) { + var o; + return regeneratorRuntime.wrap(function (r) { + for (;;) + switch ((r.prev = r.next)) { + case 0: + return ( + (r.next = 2), + e.adapter + .get( + "".concat(e.namespace, "/").concat(t), + {}, + n, + ) + .then(e.afterFetch.bind(e)) + .catch(a) + ); + case 2: + (o = r.sent), i(o); + case 4: + case "end": + return r.stop(); + } + }, r); + }), + ); + return function (t, e) { + return r.apply(this, arguments); + }; + })(), + ); + }, + }, + { + key: "findAll", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return new Promise( + (function () { + var n = O( + regeneratorRuntime.mark(function n(r, i) { + var a; + return regeneratorRuntime.wrap(function (n) { + for (;;) + switch ((n.prev = n.next)) { + case 0: + return ( + (n.next = 2), + t.adapter + .get("".concat(t.namespace), {}, e) + .then(t.afterFetch.bind(t)) + .catch(i) + ); + case 2: + (a = n.sent), r(a); + case 4: + case "end": + return n.stop(); + } + }, n); + }), + ); + return function (t, e) { + return n.apply(this, arguments); + }; + })(), + ); + }, + }, + { + key: "query", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}; + return new Promise( + (function () { + var r = O( + regeneratorRuntime.mark(function r(i, a) { + var o; + return regeneratorRuntime.wrap(function (r) { + for (;;) + switch ((r.prev = r.next)) { + case 0: + return ( + (r.next = 2), + t.adapter + .get("".concat(t.namespace), e, n) + .then(t.afterFetch.bind(t)) + .catch(a) + ); + case 2: + (o = r.sent), i(o); + case 4: + case "end": + return r.stop(); + } + }, r); + }), + ); + return function (t, e) { + return r.apply(this, arguments); + }; + })(), + ); + }, + }, + { + key: "queryRecord", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}; + return ( + (e.single = !0), + new Promise( + (function () { + var r = O( + regeneratorRuntime.mark(function r(i, a) { + var o; + return regeneratorRuntime.wrap(function (r) { + for (;;) + switch ((r.prev = r.next)) { + case 0: + return ( + (r.next = 2), + t.adapter + .get("".concat(t.namespace), e, n) + .then(t.afterFetch.bind(t)) + .catch(a) + ); + case 2: + (o = r.sent), i(o); + case 4: + case "end": + return r.stop(); + } + }, r); + }), + ); + return function (t, e) { + return r.apply(this, arguments); + }; + })(), + ) + ); + }, + }, + { + key: "destroy", + value: function (t) { + var e = this, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + r = st(t) ? t.getAttribute("id") : t; + return new Promise( + (function () { + var t = O( + regeneratorRuntime.mark(function t(i, a) { + var o; + return regeneratorRuntime.wrap(function (t) { + for (;;) + switch ((t.prev = t.next)) { + case 0: + return ( + (t.next = 2), + e.adapter + .delete( + "".concat(e.namespace, "/").concat(r), + {}, + n, + ) + .then(e.afterFetch.bind(e)) + .catch(a) + ); + case 2: + (o = t.sent), i(o); + case 4: + case "end": + return t.stop(); + } + }, t); + }), + ); + return function (e, n) { + return t.apply(this, arguments); + }; + })(), + ); + }, + }, + ]), + t + ); + })(); + !(function () { + function t(e) { + var n = + arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; + if ( + (P(this, t), + (this.version = n.version || "v1"), + (this.options = { + version: this.version, + host: n.host || "https://api.fleetbase.io", + namespace: this.version || n.namespace, + debug: r, + publicKey: e, + }), + "string" != typeof e || 0 === e.length) + ) + throw new Error("⚠️ Invalid public key given to Fleetbase SDK"); + if (!ct() && e.toLowerCase().startsWith("$")) + throw new Error( + "Secret key provided. You must use a public key with Fleetbase Javascript SDK!", + ); + (this.adapter = n.adapter || ht(this.options)), + (this.orders = new $t("order", this.adapter).extendActions(mt)), + (this.entities = new $t("entity", this.adapter)), + (this.places = new $t("place", this.adapter)), + (this.drivers = new $t("driver", this.adapter)), + (this.vehicles = new $t("vehicle", this.adapter)), + (this.vendors = new $t("vendor", this.adapter)), + (this.contacts = new $t("contact", this.adapter)); + } + U( + t, + [ + { + key: "setAdapter", + value: function (t) { + this.adapter = t; + }, + }, + { + key: "getAdapter", + value: function () { + return this.adapter; + }, + }, + ], + [ + { + key: "newInstance", + value: function () { + return H(t, Array.prototype.slice.call(arguments)); + }, + }, + ], + ); + })(); + var Nt = (function (t) { + l(n, t); + var e = m(n); + function n() { + return u(this, n), e.apply(this, arguments); + } + return ( + c(n, [ + { + key: "setAdapter", + value: function (t) { + var e; + return ( + (this.adapter = t), + (this.store = new Cr(this.resource, t, { + onAfterFetch: this.syncAttributes.bind(this), + actions: + null === (e = this.options) || void 0 === e + ? void 0 + : e.actions, + })), + this + ); + }, + }, + ]), + n + ); + })(yt), + Ht = new pt({ + count: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + n = {}; + return ( + t && (n.store = t), + this.adapter.get("".concat(this.namespace, "/count"), n, e) + ); + }, + }), + Yt = (function (t) { + l(n, t); + var e = m(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return u(this, n), e.call(this, t, r, "review", i); + } + return ( + c(n, [ + { key: "getMedia", value: function () {} }, + { key: "getPhotos", value: function () {} }, + { key: "getVideos", value: function () {} }, + ]), + n + ); + })(Nt), + Lt = function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return ct() + ? xr("adapter", "NodeAdapter", t) + : xr("adapter", "BrowserAdapter", t); + }, + Ft = function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""; + return /^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(t); + }; + function _t() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, + e = + arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "USD", + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : "symbol"; + return new Intl.NumberFormat("en-US", { + style: "currency", + currency: e, + currencyDisplay: n, + }).format(t); + } + var Wt = function (t) { + return ( + "string" == typeof t && + t.length > 30 && + (t.startsWith("store_") || t.startsWith("network_")) + ); + }, + zt = function (t) { + var e = null == t; + if (e) return e; + if ("number" == typeof t.size) return !t.size; + var n = o(t); + if ("object" === n) { + var r = t.size; + if ("number" == typeof r) return !r; + } + if ("number" == typeof t.length && "function" !== n) return !t.length; + if ("object" === n) { + var i = t.length; + if ("number" == typeof i) return !i; + } + return !1; + }, + It = (function (t) { + l(n, t); + var e = m(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return u(this, n), e.call(this, t, r, "product", i); + } + return ( + c(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, + n = t.sale_price, + r = t.currency; + return this.isOnSale + ? zt(n) || zt(r) + ? null + : _t(n / 100, r) + : zt(e) || zt(r) + ? null + : _t(e / 100, r); + }, + }, + { + key: "getReviews", + value: function () { + var t = this; + return this.adapter + .get("reviews", { store: this.id }) + .then(function (e) { + return new at( + e.map(function (e) { + return new Yt(e, t.adapter); + }), + ); + }); + }, + }, + ]), + n + ); + })(Nt), + Qt = (function (t) { + l(n, t); + var e = m(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return u(this, n), e.call(this, t, r, "category", i); + } + return ( + c(n, [ + { + key: "getProducts", + value: function () { + var t = this; + return this.adapter + .get("products", { category: this.id }) + .then(function (e) { + return new at( + e.map(function (e) { + return new It(e, t.adapter); + }), + ); + }); + }, + }, + ]), + n + ); + })(Nt), + Bt = new pt({ + 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 (Ft(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", a({ 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", a({ 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", a({ identity: t, code: e }, n)) + .then(this.afterFetch.bind(this)); + }, + retrieve: function (t) { + return this.findRecord(t); + }, + }), + Gt = (function (t) { + l(n, t); + var e = m(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return ( + u(this, n), e.call(this, t, r, "customer", a({ actions: Bt }, i)) + ); + } + return ( + c(n, [ + { + key: "setAdapter", + value: function (t) { + var e; + return ( + (this.adapter = t), + (this.store = new Cr(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: function (t) { + var e = this; + return this.adapter + .setHeaders({ "Customer-Token": this.token }) + .post("customers/register-device", t) + .then(function () { + return e; + }); + }, + }, + { + key: "getSavedPlaces", + value: function () { + var t = this; + return this.adapter + .setHeaders({ "Customer-Token": this.token }) + .get("customers/places") + .then(function (e) { + return new at( + e.map(function (e) { + return new kt(e, t.adapter); + }), + ); + }); + }, + }, + { + key: "getOrderHistory", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return this.adapter + .setHeaders({ "Customer-Token": this.token }) + .get("customers/orders", e) + .then(function (e) { + return new at( + e.map(function (e) { + return new wt(e, t.adapter); + }), + ); + }); + }, + }, + ]), + n + ); + })(Nt), + Xt = Array.isArray, + Kt = new pt({ + 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, + r = + arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, + i = + arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {}; + return this.adapter + .post( + "".concat(this.namespace, "/").concat(t, "/").concat(e), + a(a({}, r), {}, { quantity: n }), + i, + ) + .then(this.afterFetch.bind(this)); + }, + update: function (t, e, n) { + var r = + arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, + i = + arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {}; + return this.adapter + .put( + "".concat(this.namespace, "/").concat(t, "/").concat(e), + a(a({}, r), {}, { quantity: n }), + i, + ) + .then(this.afterFetch.bind(this)); + }, + remove: function (t, e) { + var n = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return this.adapter + .delete( + "".concat(this.namespace, "/").concat(t, "/").concat(e), + {}, + n, + ) + .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); + }, + }), + Jt = (function (t) { + l(n, t); + var e = m(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return u(this, n), e.call(this, t, r, "cart", a({ actions: Kt }, i)); + } + return ( + c(n, [ + { + key: "add", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : 1, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}, + r = + arguments.length > 3 && void 0 !== arguments[3] + ? arguments[3] + : {}; + return ( + t instanceof It && (t = t.id), + this.store.add(this.id, t, e, n, r) + ); + }, + }, + { + key: "update", + value: function (t, e) { + var n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}, + r = + arguments.length > 3 && void 0 !== arguments[3] + ? arguments[3] + : {}; + return this.store.update(this.id, t, e, n, r); + }, + }, + { + 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 !Xt(t) || 0 === t.length; + }, + }, + { + key: "isNotEmpty", + get: function () { + return !this.isEmpty; + }, + }, + ]), + n + ); + })(Nt); + function Zt(t) { + if (null === t || !0 === t || !1 === t) return NaN; + var e = Number(t); + return isNaN(e) ? e : e < 0 ? Math.ceil(e) : Math.floor(e); + } + function Vt(t, e) { + if (e.length < t) + throw new TypeError( + t + + " argument" + + (t > 1 ? "s" : "") + + " required, but only " + + e.length + + " present", + ); + } + function te(t) { + Vt(1, arguments); + var e = Object.prototype.toString.call(t); + return t instanceof Date || ("object" == typeof t && "[object Date]" === e) + ? new Date(t.getTime()) + : "number" == typeof t || "[object Number]" === e + ? new Date(t) + : (("string" != typeof t && "[object String]" !== e) || + "undefined" == typeof console || + (console.warn( + "Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule", + ), + console.warn(new Error().stack)), + new Date(NaN)); + } + function ee(t, e) { + Vt(2, arguments); + var n = te(t).getTime(), + r = Zt(e); + return new Date(n + r); + } + function ne(t) { + var 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 re(t) { + return ( + Vt(1, arguments), + t instanceof Date || + ("object" == typeof t && + "[object Date]" === Object.prototype.toString.call(t)) + ); + } + function ie(t) { + if ((Vt(1, arguments), !re(t) && "number" != typeof t)) return !1; + var e = te(t); + return !isNaN(Number(e)); + } + var ae = { + 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" }, + }, + oe = function (t, e, n) { + var r, + i = ae[t]; + return ( + (r = + "string" == typeof i + ? i + : 1 === e + ? i.one + : i.other.replace("{{count}}", e.toString())), + null != n && n.addSuffix + ? n.comparison && n.comparison > 0 + ? "in " + r + : r + " ago" + : r + ); + }, + ue = oe; + function se(t) { + return function () { + var e = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = e.width ? String(e.width) : t.defaultWidth, + r = t.formats[n] || t.formats[t.defaultWidth]; + return r; + }; + } + var ce = { + full: "EEEE, MMMM do, y", + long: "MMMM do, y", + medium: "MMM d, y", + short: "MM/dd/yyyy", + }, + he = { + full: "h:mm:ss a zzzz", + long: "h:mm:ss a z", + medium: "h:mm:ss a", + short: "h:mm a", + }, + le = { + full: "{{date}} 'at' {{time}}", + long: "{{date}} 'at' {{time}}", + medium: "{{date}}, {{time}}", + short: "{{date}}, {{time}}", + }, + de = { + date: se({ formats: ce, defaultWidth: "full" }), + time: se({ formats: he, defaultWidth: "full" }), + dateTime: se({ formats: le, defaultWidth: "full" }), + }, + fe = de, + ve = { + lastWeek: "'last' eeee 'at' p", + yesterday: "'yesterday at' p", + today: "'today at' p", + tomorrow: "'tomorrow at' p", + nextWeek: "eeee 'at' p", + other: "P", + }, + ge = function (t, e, n, r) { + return ve[t]; + }, + pe = ge; + function ye(t) { + return function (e, n) { + var r, + i = n || {}; + if ( + "formatting" === (i.context ? String(i.context) : "standalone") && + t.formattingValues + ) { + var a = t.defaultFormattingWidth || t.defaultWidth, + o = i.width ? String(i.width) : a; + r = t.formattingValues[o] || t.formattingValues[a]; + } else { + var u = t.defaultWidth, + s = i.width ? String(i.width) : t.defaultWidth; + r = t.values[s] || t.values[u]; + } + return r[t.argumentCallback ? t.argumentCallback(e) : e]; + }; + } + var me = { + narrow: ["B", "A"], + abbreviated: ["BC", "AD"], + wide: ["Before Christ", "Anno Domini"], + }, + we = { + narrow: ["1", "2", "3", "4"], + abbreviated: ["Q1", "Q2", "Q3", "Q4"], + wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"], + }, + be = { + 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", + ], + }, + ke = { + 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", + ], + }, + Te = { + 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", + }, + }, + xe = { + 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", + }, + }, + Ce = function (t, e) { + var n = Number(t), + r = n % 100; + if (r > 20 || r < 10) + switch (r % 10) { + case 1: + return n + "st"; + case 2: + return n + "nd"; + case 3: + return n + "rd"; + } + return n + "th"; + }, + Ae = { + ordinalNumber: Ce, + era: ye({ values: me, defaultWidth: "wide" }), + quarter: ye({ + values: we, + defaultWidth: "wide", + argumentCallback: function (t) { + return t - 1; + }, + }), + month: ye({ values: be, defaultWidth: "wide" }), + day: ye({ values: ke, defaultWidth: "wide" }), + dayPeriod: ye({ + values: Te, + defaultWidth: "wide", + formattingValues: xe, + defaultFormattingWidth: "wide", + }), + }, + De = Ae; + function Ee(t) { + return function (e) { + var n = + arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + r = n.width, + i = (r && t.matchPatterns[r]) || t.matchPatterns[t.defaultMatchWidth], + a = e.match(i); + if (!a) return null; + var o, + u = a[0], + s = (r && t.parsePatterns[r]) || t.parsePatterns[t.defaultParseWidth], + c = Array.isArray(s) + ? Oe(s, function (t) { + return t.test(u); + }) + : Se(s, function (t) { + return t.test(u); + }); + (o = t.valueCallback ? t.valueCallback(c) : c), + (o = n.valueCallback ? n.valueCallback(o) : o); + var h = e.slice(u.length); + return { value: o, rest: h }; + }; + } + function Se(t, e) { + for (var n in t) if (t.hasOwnProperty(n) && e(t[n])) return n; + } + function Oe(t, e) { + for (var n = 0; n < t.length; n++) if (e(t[n])) return n; + } + function Pe(t) { + return function (e) { + var n = + arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + r = e.match(t.matchPattern); + if (!r) return null; + var i = r[0], + a = e.match(t.parsePattern); + if (!a) return null; + var o = t.valueCallback ? t.valueCallback(a[0]) : a[0]; + o = n.valueCallback ? n.valueCallback(o) : o; + var u = e.slice(i.length); + return { value: o, rest: u }; + }; + } + var Re = /^(\d+)(th|st|nd|rd)?/i, + Ue = /\d+/i, + Me = { + 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, + }, + je = { any: [/^b/i, /^(a|c)/i] }, + qe = { + narrow: /^[1234]/i, + abbreviated: /^q[1234]/i, + wide: /^[1234](th|st|nd|rd)? quarter/i, + }, + $e = { any: [/1/i, /2/i, /3/i, /4/i] }, + Ne = { + 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, + }, + He = { + 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, + ], + }, + Ye = { + 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, + }, + Le = { + 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], + }, + Fe = { + 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, + }, + _e = { + 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, + }, + }, + We = { + ordinalNumber: Pe({ + matchPattern: Re, + parsePattern: Ue, + valueCallback: function (t) { + return parseInt(t, 10); + }, + }), + era: Ee({ + matchPatterns: Me, + defaultMatchWidth: "wide", + parsePatterns: je, + defaultParseWidth: "any", + }), + quarter: Ee({ + matchPatterns: qe, + defaultMatchWidth: "wide", + parsePatterns: $e, + defaultParseWidth: "any", + valueCallback: function (t) { + return t + 1; + }, + }), + month: Ee({ + matchPatterns: Ne, + defaultMatchWidth: "wide", + parsePatterns: He, + defaultParseWidth: "any", + }), + day: Ee({ + matchPatterns: Ye, + defaultMatchWidth: "wide", + parsePatterns: Le, + defaultParseWidth: "any", + }), + dayPeriod: Ee({ + matchPatterns: Fe, + defaultMatchWidth: "any", + parsePatterns: _e, + defaultParseWidth: "any", + }), + }, + ze = We, + Ie = { + code: "en-US", + formatDistance: ue, + formatLong: fe, + formatRelative: pe, + localize: De, + match: ze, + options: { weekStartsOn: 0, firstWeekContainsDate: 1 }, + }, + Qe = Ie; + function Be(t, e) { + Vt(2, arguments); + var n = Zt(e); + return ee(t, -n); + } + function Ge(t, e) { + for (var n = t < 0 ? "-" : "", r = Math.abs(t).toString(); r.length < e; ) + r = "0" + r; + return n + r; + } + var Xe = { + y: function (t, e) { + var n = t.getUTCFullYear(), + r = n > 0 ? n : 1 - n; + return Ge("yy" === e ? r % 100 : r, e.length); + }, + M: function (t, e) { + var n = t.getUTCMonth(); + return "M" === e ? String(n + 1) : Ge(n + 1, 2); + }, + d: function (t, e) { + return Ge(t.getUTCDate(), e.length); + }, + a: function (t, e) { + var n = t.getUTCHours() / 12 >= 1 ? "pm" : "am"; + switch (e) { + case "a": + case "aa": + return n.toUpperCase(); + case "aaa": + return n; + case "aaaaa": + return n[0]; + default: + return "am" === n ? "a.m." : "p.m."; + } + }, + h: function (t, e) { + return Ge(t.getUTCHours() % 12 || 12, e.length); + }, + H: function (t, e) { + return Ge(t.getUTCHours(), e.length); + }, + m: function (t, e) { + return Ge(t.getUTCMinutes(), e.length); + }, + s: function (t, e) { + return Ge(t.getUTCSeconds(), e.length); + }, + S: function (t, e) { + var n = e.length, + r = t.getUTCMilliseconds(); + return Ge(Math.floor(r * Math.pow(10, n - 3)), e.length); + }, + }, + Ke = Xe, + Je = 864e5; + function Ze(t) { + Vt(1, arguments); + var e = te(t), + n = e.getTime(); + e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0); + var r = e.getTime(), + i = n - r; + return Math.floor(i / Je) + 1; + } + function Ve(t) { + Vt(1, arguments); + var e = 1, + n = te(t), + r = n.getUTCDay(), + i = (r < e ? 7 : 0) + r - e; + return n.setUTCDate(n.getUTCDate() - i), n.setUTCHours(0, 0, 0, 0), n; + } + function tn(t) { + Vt(1, arguments); + var e = te(t), + n = e.getUTCFullYear(), + r = new Date(0); + r.setUTCFullYear(n + 1, 0, 4), r.setUTCHours(0, 0, 0, 0); + var i = Ve(r), + a = new Date(0); + a.setUTCFullYear(n, 0, 4), a.setUTCHours(0, 0, 0, 0); + var o = Ve(a); + return e.getTime() >= i.getTime() + ? n + 1 + : e.getTime() >= o.getTime() + ? n + : n - 1; + } + function en(t) { + Vt(1, arguments); + var e = tn(t), + n = new Date(0); + n.setUTCFullYear(e, 0, 4), n.setUTCHours(0, 0, 0, 0); + var r = Ve(n); + return r; + } + var nn = 6048e5; + function rn(t) { + Vt(1, arguments); + var e = te(t), + n = Ve(e).getTime() - en(e).getTime(); + return Math.round(n / nn) + 1; + } + function an(t, e) { + Vt(1, arguments); + var n = e || {}, + r = n.locale, + i = r && r.options && r.options.weekStartsOn, + a = null == i ? 0 : Zt(i), + o = null == n.weekStartsOn ? a : Zt(n.weekStartsOn); + if (!(o >= 0 && o <= 6)) + throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); + var u = te(t), + s = u.getUTCDay(), + c = (s < o ? 7 : 0) + s - o; + return u.setUTCDate(u.getUTCDate() - c), u.setUTCHours(0, 0, 0, 0), u; + } + function on(t, e) { + Vt(1, arguments); + var n = te(t, e), + r = n.getUTCFullYear(), + i = e || {}, + a = i.locale, + o = a && a.options && a.options.firstWeekContainsDate, + u = null == o ? 1 : Zt(o), + s = null == i.firstWeekContainsDate ? u : Zt(i.firstWeekContainsDate); + if (!(s >= 1 && s <= 7)) + throw new RangeError( + "firstWeekContainsDate must be between 1 and 7 inclusively", + ); + var c = new Date(0); + c.setUTCFullYear(r + 1, 0, s), c.setUTCHours(0, 0, 0, 0); + var h = an(c, e), + l = new Date(0); + l.setUTCFullYear(r, 0, s), l.setUTCHours(0, 0, 0, 0); + var d = an(l, e); + return n.getTime() >= h.getTime() + ? r + 1 + : n.getTime() >= d.getTime() + ? r + : r - 1; + } + function un(t, e) { + Vt(1, arguments); + var n = e || {}, + r = n.locale, + i = r && r.options && r.options.firstWeekContainsDate, + a = null == i ? 1 : Zt(i), + o = null == n.firstWeekContainsDate ? a : Zt(n.firstWeekContainsDate), + u = on(t, e), + s = new Date(0); + s.setUTCFullYear(u, 0, o), s.setUTCHours(0, 0, 0, 0); + var c = an(s, e); + return c; + } + var sn = 6048e5; + function cn(t, e) { + Vt(1, arguments); + var n = te(t), + r = an(n, e).getTime() - un(n, e).getTime(); + return Math.round(r / sn) + 1; + } + var hn = { + am: "am", + pm: "pm", + midnight: "midnight", + noon: "noon", + morning: "morning", + afternoon: "afternoon", + evening: "evening", + night: "night", + }, + ln = { + G: function (t, e, n) { + var r = t.getUTCFullYear() > 0 ? 1 : 0; + switch (e) { + case "G": + case "GG": + case "GGG": + return n.era(r, { width: "abbreviated" }); + case "GGGGG": + return n.era(r, { width: "narrow" }); + default: + return n.era(r, { width: "wide" }); + } + }, + y: function (t, e, n) { + if ("yo" === e) { + var r = t.getUTCFullYear(), + i = r > 0 ? r : 1 - r; + return n.ordinalNumber(i, { unit: "year" }); + } + return Ke.y(t, e); + }, + Y: function (t, e, n, r) { + var i = on(t, r), + a = i > 0 ? i : 1 - i; + return "YY" === e + ? Ge(a % 100, 2) + : "Yo" === e + ? n.ordinalNumber(a, { unit: "year" }) + : Ge(a, e.length); + }, + R: function (t, e) { + return Ge(tn(t), e.length); + }, + u: function (t, e) { + return Ge(t.getUTCFullYear(), e.length); + }, + Q: function (t, e, n) { + var r = Math.ceil((t.getUTCMonth() + 1) / 3); + switch (e) { + case "Q": + return String(r); + case "QQ": + return Ge(r, 2); + case "Qo": + return n.ordinalNumber(r, { unit: "quarter" }); + case "QQQ": + return n.quarter(r, { + width: "abbreviated", + context: "formatting", + }); + case "QQQQQ": + return n.quarter(r, { width: "narrow", context: "formatting" }); + default: + return n.quarter(r, { width: "wide", context: "formatting" }); + } + }, + q: function (t, e, n) { + var r = Math.ceil((t.getUTCMonth() + 1) / 3); + switch (e) { + case "q": + return String(r); + case "qq": + return Ge(r, 2); + case "qo": + return n.ordinalNumber(r, { unit: "quarter" }); + case "qqq": + return n.quarter(r, { + width: "abbreviated", + context: "standalone", + }); + case "qqqqq": + return n.quarter(r, { width: "narrow", context: "standalone" }); + default: + return n.quarter(r, { width: "wide", context: "standalone" }); + } + }, + M: function (t, e, n) { + var r = t.getUTCMonth(); + switch (e) { + case "M": + case "MM": + return Ke.M(t, e); + case "Mo": + return n.ordinalNumber(r + 1, { unit: "month" }); + case "MMM": + return n.month(r, { width: "abbreviated", context: "formatting" }); + case "MMMMM": + return n.month(r, { width: "narrow", context: "formatting" }); + default: + return n.month(r, { width: "wide", context: "formatting" }); + } + }, + L: function (t, e, n) { + var r = t.getUTCMonth(); + switch (e) { + case "L": + return String(r + 1); + case "LL": + return Ge(r + 1, 2); + case "Lo": + return n.ordinalNumber(r + 1, { unit: "month" }); + case "LLL": + return n.month(r, { width: "abbreviated", context: "standalone" }); + case "LLLLL": + return n.month(r, { width: "narrow", context: "standalone" }); + default: + return n.month(r, { width: "wide", context: "standalone" }); + } + }, + w: function (t, e, n, r) { + var i = cn(t, r); + return "wo" === e + ? n.ordinalNumber(i, { unit: "week" }) + : Ge(i, e.length); + }, + I: function (t, e, n) { + var r = rn(t); + return "Io" === e + ? n.ordinalNumber(r, { unit: "week" }) + : Ge(r, e.length); + }, + d: function (t, e, n) { + return "do" === e + ? n.ordinalNumber(t.getUTCDate(), { unit: "date" }) + : Ke.d(t, e); + }, + D: function (t, e, n) { + var r = Ze(t); + return "Do" === e + ? n.ordinalNumber(r, { unit: "dayOfYear" }) + : Ge(r, e.length); + }, + E: function (t, e, n) { + var r = t.getUTCDay(); + switch (e) { + case "E": + case "EE": + case "EEE": + return n.day(r, { width: "abbreviated", context: "formatting" }); + case "EEEEE": + return n.day(r, { width: "narrow", context: "formatting" }); + case "EEEEEE": + return n.day(r, { width: "short", context: "formatting" }); + default: + return n.day(r, { width: "wide", context: "formatting" }); + } + }, + e: function (t, e, n, r) { + var i = t.getUTCDay(), + a = (i - r.weekStartsOn + 8) % 7 || 7; + switch (e) { + case "e": + return String(a); + case "ee": + return Ge(a, 2); + case "eo": + return n.ordinalNumber(a, { unit: "day" }); + case "eee": + return n.day(i, { width: "abbreviated", context: "formatting" }); + case "eeeee": + return n.day(i, { width: "narrow", context: "formatting" }); + case "eeeeee": + return n.day(i, { width: "short", context: "formatting" }); + default: + return n.day(i, { width: "wide", context: "formatting" }); + } + }, + c: function (t, e, n, r) { + var i = t.getUTCDay(), + a = (i - r.weekStartsOn + 8) % 7 || 7; + switch (e) { + case "c": + return String(a); + case "cc": + return Ge(a, e.length); + case "co": + return n.ordinalNumber(a, { unit: "day" }); + case "ccc": + return n.day(i, { width: "abbreviated", context: "standalone" }); + case "ccccc": + return n.day(i, { width: "narrow", context: "standalone" }); + case "cccccc": + return n.day(i, { width: "short", context: "standalone" }); + default: + return n.day(i, { width: "wide", context: "standalone" }); + } + }, + i: function (t, e, n) { + var r = t.getUTCDay(), + i = 0 === r ? 7 : r; + switch (e) { + case "i": + return String(i); + case "ii": + return Ge(i, e.length); + case "io": + return n.ordinalNumber(i, { unit: "day" }); + case "iii": + return n.day(r, { width: "abbreviated", context: "formatting" }); + case "iiiii": + return n.day(r, { width: "narrow", context: "formatting" }); + case "iiiiii": + return n.day(r, { width: "short", context: "formatting" }); + default: + return n.day(r, { width: "wide", context: "formatting" }); + } + }, + a: function (t, e, n) { + var r = t.getUTCHours() / 12 >= 1 ? "pm" : "am"; + switch (e) { + case "a": + case "aa": + return n.dayPeriod(r, { + width: "abbreviated", + context: "formatting", + }); + case "aaa": + return n + .dayPeriod(r, { width: "abbreviated", context: "formatting" }) + .toLowerCase(); + case "aaaaa": + return n.dayPeriod(r, { width: "narrow", context: "formatting" }); + default: + return n.dayPeriod(r, { width: "wide", context: "formatting" }); + } + }, + b: function (t, e, n) { + var r, + i = t.getUTCHours(); + switch ( + ((r = + 12 === i + ? hn.noon + : 0 === i + ? hn.midnight + : i / 12 >= 1 + ? "pm" + : "am"), + e) + ) { + case "b": + case "bb": + return n.dayPeriod(r, { + width: "abbreviated", + context: "formatting", + }); + case "bbb": + return n + .dayPeriod(r, { width: "abbreviated", context: "formatting" }) + .toLowerCase(); + case "bbbbb": + return n.dayPeriod(r, { width: "narrow", context: "formatting" }); + default: + return n.dayPeriod(r, { width: "wide", context: "formatting" }); + } + }, + B: function (t, e, n) { + var r, + i = t.getUTCHours(); + switch ( + ((r = + i >= 17 + ? hn.evening + : i >= 12 + ? hn.afternoon + : i >= 4 + ? hn.morning + : hn.night), + e) + ) { + case "B": + case "BB": + case "BBB": + return n.dayPeriod(r, { + width: "abbreviated", + context: "formatting", + }); + case "BBBBB": + return n.dayPeriod(r, { width: "narrow", context: "formatting" }); + default: + return n.dayPeriod(r, { width: "wide", context: "formatting" }); + } + }, + h: function (t, e, n) { + if ("ho" === e) { + var r = t.getUTCHours() % 12; + return 0 === r && (r = 12), n.ordinalNumber(r, { unit: "hour" }); + } + return Ke.h(t, e); + }, + H: function (t, e, n) { + return "Ho" === e + ? n.ordinalNumber(t.getUTCHours(), { unit: "hour" }) + : Ke.H(t, e); + }, + K: function (t, e, n) { + var r = t.getUTCHours() % 12; + return "Ko" === e + ? n.ordinalNumber(r, { unit: "hour" }) + : Ge(r, e.length); + }, + k: function (t, e, n) { + var r = t.getUTCHours(); + return ( + 0 === r && (r = 24), + "ko" === e ? n.ordinalNumber(r, { unit: "hour" }) : Ge(r, e.length) + ); + }, + m: function (t, e, n) { + return "mo" === e + ? n.ordinalNumber(t.getUTCMinutes(), { unit: "minute" }) + : Ke.m(t, e); + }, + s: function (t, e, n) { + return "so" === e + ? n.ordinalNumber(t.getUTCSeconds(), { unit: "second" }) + : Ke.s(t, e); + }, + S: function (t, e) { + return Ke.S(t, e); + }, + X: function (t, e, n, r) { + var i = (r._originalDate || t).getTimezoneOffset(); + if (0 === i) return "Z"; + switch (e) { + case "X": + return fn(i); + case "XXXX": + case "XX": + return vn(i); + default: + return vn(i, ":"); + } + }, + x: function (t, e, n, r) { + var i = (r._originalDate || t).getTimezoneOffset(); + switch (e) { + case "x": + return fn(i); + case "xxxx": + case "xx": + return vn(i); + default: + return vn(i, ":"); + } + }, + O: function (t, e, n, r) { + var i = (r._originalDate || t).getTimezoneOffset(); + switch (e) { + case "O": + case "OO": + case "OOO": + return "GMT" + dn(i, ":"); + default: + return "GMT" + vn(i, ":"); + } + }, + z: function (t, e, n, r) { + var i = (r._originalDate || t).getTimezoneOffset(); + switch (e) { + case "z": + case "zz": + case "zzz": + return "GMT" + dn(i, ":"); + default: + return "GMT" + vn(i, ":"); + } + }, + t: function (t, e, n, r) { + var i = r._originalDate || t; + return Ge(Math.floor(i.getTime() / 1e3), e.length); + }, + T: function (t, e, n, r) { + return Ge((r._originalDate || t).getTime(), e.length); + }, + }; + function dn(t, e) { + var n = t > 0 ? "-" : "+", + r = Math.abs(t), + i = Math.floor(r / 60), + a = r % 60; + if (0 === a) return n + String(i); + var o = e || ""; + return n + String(i) + o + Ge(a, 2); + } + function fn(t, e) { + return t % 60 == 0 + ? (t > 0 ? "-" : "+") + Ge(Math.abs(t) / 60, 2) + : vn(t, e); + } + function vn(t, e) { + var n = e || "", + r = t > 0 ? "-" : "+", + i = Math.abs(t); + return r + Ge(Math.floor(i / 60), 2) + n + Ge(i % 60, 2); + } + var gn = ln; + function pn(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" }); + } + } + function yn(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" }); + } + } + function mn(t, e) { + var n, + r = t.match(/(P+)(p+)?/), + i = r[1], + a = r[2]; + if (!a) return pn(t, e); + switch (i) { + case "P": + n = e.dateTime({ width: "short" }); + break; + case "PP": + n = e.dateTime({ width: "medium" }); + break; + case "PPP": + n = e.dateTime({ width: "long" }); + break; + default: + n = e.dateTime({ width: "full" }); + } + return n.replace("{{date}}", pn(i, e)).replace("{{time}}", yn(a, e)); + } + var wn = { p: yn, P: mn }, + bn = wn, + kn = ["D", "DD"], + Tn = ["YY", "YYYY"]; + function xn(t) { + return -1 !== kn.indexOf(t); + } + function Cn(t) { + return -1 !== Tn.indexOf(t); + } + function An(t, e, n) { + if ("YYYY" === t) + throw new RangeError( + "Use `yyyy` instead of `YYYY` (in `" + .concat(e, "`) for formatting years to the input `") + .concat(n, "`; see: https://git.io/fxCyr"), + ); + if ("YY" === t) + throw new RangeError( + "Use `yy` instead of `YY` (in `" + .concat(e, "`) for formatting years to the input `") + .concat(n, "`; see: https://git.io/fxCyr"), + ); + if ("D" === t) + throw new RangeError( + "Use `d` instead of `D` (in `" + .concat(e, "`) for formatting days of the month to the input `") + .concat(n, "`; see: https://git.io/fxCyr"), + ); + if ("DD" === t) + throw new RangeError( + "Use `dd` instead of `DD` (in `" + .concat(e, "`) for formatting days of the month to the input `") + .concat(n, "`; see: https://git.io/fxCyr"), + ); + } + var Dn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, + En = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, + Sn = /^'([^]*?)'?$/, + On = /''/g, + Pn = /[a-zA-Z]/; + function Rn(t, e, n) { + Vt(2, arguments); + var r = String(e), + i = n || {}, + a = i.locale || Qe, + o = a.options && a.options.firstWeekContainsDate, + u = null == o ? 1 : Zt(o), + s = null == i.firstWeekContainsDate ? u : Zt(i.firstWeekContainsDate); + if (!(s >= 1 && s <= 7)) + throw new RangeError( + "firstWeekContainsDate must be between 1 and 7 inclusively", + ); + var c = a.options && a.options.weekStartsOn, + h = null == c ? 0 : Zt(c), + l = null == i.weekStartsOn ? h : Zt(i.weekStartsOn); + if (!(l >= 0 && l <= 6)) + throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); + if (!a.localize) + throw new RangeError("locale must contain localize property"); + if (!a.formatLong) + throw new RangeError("locale must contain formatLong property"); + var d = te(t); + if (!ie(d)) throw new RangeError("Invalid time value"); + var f = ne(d), + v = Be(d, f), + g = { + firstWeekContainsDate: s, + weekStartsOn: l, + locale: a, + _originalDate: d, + }, + p = r + .match(En) + .map(function (t) { + var e = t[0]; + return "p" === e || "P" === e ? (0, bn[e])(t, a.formatLong, g) : t; + }) + .join("") + .match(Dn) + .map(function (n) { + if ("''" === n) return "'"; + var r = n[0]; + if ("'" === r) return Un(n); + var o = gn[r]; + if (o) + return ( + !i.useAdditionalWeekYearTokens && Cn(n) && An(n, e, t), + !i.useAdditionalDayOfYearTokens && xn(n) && An(n, e, t), + o(v, n, a.localize, g) + ); + if (r.match(Pn)) + throw new RangeError( + "Format string contains an unescaped latin alphabet character `" + + r + + "`", + ); + return n; + }) + .join(""); + return p; + } + function Un(t) { + return t.match(Sn)[1].replace(On, "'"); + } + function Mn(t, e) { + if (null == t) + throw new TypeError( + "assign requires that input parameter not be null or undefined", + ); + for (var n in (e = e || {})) + Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); + return t; + } + function jn(t, e, n) { + Vt(2, arguments); + var r = n || {}, + i = r.locale, + a = i && i.options && i.options.weekStartsOn, + o = null == a ? 0 : Zt(a), + u = null == r.weekStartsOn ? o : Zt(r.weekStartsOn); + if (!(u >= 0 && u <= 6)) + throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); + var s = te(t), + c = Zt(e), + h = s.getUTCDay(), + l = c % 7, + d = (l + 7) % 7, + f = (d < u ? 7 : 0) + c - h; + return s.setUTCDate(s.getUTCDate() + f), s; + } + function qn(t, e) { + Vt(2, arguments); + var n = Zt(e); + n % 7 == 0 && (n -= 7); + var r = 1, + i = te(t), + a = i.getUTCDay(), + o = n % 7, + u = (o + 7) % 7, + s = (u < r ? 7 : 0) + n - a; + return i.setUTCDate(i.getUTCDate() + s), i; + } + function $n(t, e) { + Vt(2, arguments); + var n = te(t), + r = Zt(e), + i = rn(n) - r; + return n.setUTCDate(n.getUTCDate() - 7 * i), n; + } + function Nn(t, e, n) { + Vt(2, arguments); + var r = te(t), + i = Zt(e), + a = cn(r, n) - i; + return r.setUTCDate(r.getUTCDate() - 7 * a), r; + } + var Hn = 36e5, + Yn = 6e4, + Ln = 1e3, + Fn = { + month: /^(1[0-2]|0?\d)/, + date: /^(3[0-1]|[0-2]?\d)/, + dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, + week: /^(5[0-3]|[0-4]?\d)/, + hour23h: /^(2[0-3]|[0-1]?\d)/, + hour24h: /^(2[0-4]|[0-1]?\d)/, + hour11h: /^(1[0-1]|0?\d)/, + hour12h: /^(1[0-2]|0?\d)/, + minute: /^[0-5]?\d/, + second: /^[0-5]?\d/, + singleDigit: /^\d/, + twoDigits: /^\d{1,2}/, + threeDigits: /^\d{1,3}/, + fourDigits: /^\d{1,4}/, + anyDigitsSigned: /^-?\d+/, + singleDigitSigned: /^-?\d/, + twoDigitsSigned: /^-?\d{1,2}/, + threeDigitsSigned: /^-?\d{1,3}/, + fourDigitsSigned: /^-?\d{1,4}/, + }, + _n = { + basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/, + basic: /^([+-])(\d{2})(\d{2})|Z/, + basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, + extended: /^([+-])(\d{2}):(\d{2})|Z/, + extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/, + }; + function Wn(t, e, n) { + var r = e.match(t); + if (!r) return null; + var i = parseInt(r[0], 10); + return { value: n ? n(i) : i, rest: e.slice(r[0].length) }; + } + function zn(t, e) { + var n = e.match(t); + if (!n) return null; + if ("Z" === n[0]) return { value: 0, rest: e.slice(1) }; + var r = "+" === n[1] ? 1 : -1, + i = n[2] ? parseInt(n[2], 10) : 0, + a = n[3] ? parseInt(n[3], 10) : 0, + o = n[5] ? parseInt(n[5], 10) : 0; + return { + value: r * (i * Hn + a * Yn + o * Ln), + rest: e.slice(n[0].length), + }; + } + function In(t, e) { + return Wn(Fn.anyDigitsSigned, t, e); + } + function Qn(t, e, n) { + switch (t) { + case 1: + return Wn(Fn.singleDigit, e, n); + case 2: + return Wn(Fn.twoDigits, e, n); + case 3: + return Wn(Fn.threeDigits, e, n); + case 4: + return Wn(Fn.fourDigits, e, n); + default: + return Wn(new RegExp("^\\d{1," + t + "}"), e, n); + } + } + function Bn(t, e, n) { + switch (t) { + case 1: + return Wn(Fn.singleDigitSigned, e, n); + case 2: + return Wn(Fn.twoDigitsSigned, e, n); + case 3: + return Wn(Fn.threeDigitsSigned, e, n); + case 4: + return Wn(Fn.fourDigitsSigned, e, n); + default: + return Wn(new RegExp("^-?\\d{1," + t + "}"), e, n); + } + } + function Gn(t) { + switch (t) { + case "morning": + return 4; + case "evening": + return 17; + case "pm": + case "noon": + case "afternoon": + return 12; + default: + return 0; + } + } + function Xn(t, e) { + var n, + r = e > 0, + i = r ? e : 1 - e; + if (i <= 50) n = t || 100; + else { + var a = i + 50; + n = t + 100 * Math.floor(a / 100) - (t >= a % 100 ? 100 : 0); + } + return r ? n : 1 - n; + } + var Kn = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], + Jn = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + function Zn(t) { + return t % 400 == 0 || (t % 4 == 0 && t % 100 != 0); + } + var Vn = { + G: { + priority: 140, + parse: function (t, e, n, r) { + switch (e) { + case "G": + case "GG": + case "GGG": + return ( + n.era(t, { width: "abbreviated" }) || + n.era(t, { width: "narrow" }) + ); + case "GGGGG": + return n.era(t, { width: "narrow" }); + default: + return ( + n.era(t, { width: "wide" }) || + n.era(t, { width: "abbreviated" }) || + n.era(t, { width: "narrow" }) + ); + } + }, + set: function (t, e, n, r) { + return ( + (e.era = n), t.setUTCFullYear(n, 0, 1), t.setUTCHours(0, 0, 0, 0), t + ); + }, + incompatibleTokens: ["R", "u", "t", "T"], + }, + y: { + priority: 130, + parse: function (t, e, n, r) { + var i = function (t) { + return { year: t, isTwoDigitYear: "yy" === e }; + }; + switch (e) { + case "y": + return Qn(4, t, i); + case "yo": + return n.ordinalNumber(t, { unit: "year", valueCallback: i }); + default: + return Qn(e.length, t, i); + } + }, + validate: function (t, e, n) { + return e.isTwoDigitYear || e.year > 0; + }, + set: function (t, e, n, r) { + var i = t.getUTCFullYear(); + if (n.isTwoDigitYear) { + var a = Xn(n.year, i); + return t.setUTCFullYear(a, 0, 1), t.setUTCHours(0, 0, 0, 0), t; + } + var o = "era" in e && 1 !== e.era ? 1 - n.year : n.year; + return t.setUTCFullYear(o, 0, 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"], + }, + Y: { + priority: 130, + parse: function (t, e, n, r) { + var i = function (t) { + return { year: t, isTwoDigitYear: "YY" === e }; + }; + switch (e) { + case "Y": + return Qn(4, t, i); + case "Yo": + return n.ordinalNumber(t, { unit: "year", valueCallback: i }); + default: + return Qn(e.length, t, i); + } + }, + validate: function (t, e, n) { + return e.isTwoDigitYear || e.year > 0; + }, + set: function (t, e, n, r) { + var i = on(t, r); + if (n.isTwoDigitYear) { + var a = Xn(n.year, i); + return ( + t.setUTCFullYear(a, 0, r.firstWeekContainsDate), + t.setUTCHours(0, 0, 0, 0), + an(t, r) + ); + } + var o = "era" in e && 1 !== e.era ? 1 - n.year : n.year; + return ( + t.setUTCFullYear(o, 0, r.firstWeekContainsDate), + t.setUTCHours(0, 0, 0, 0), + an(t, r) + ); + }, + incompatibleTokens: [ + "y", + "R", + "u", + "Q", + "q", + "M", + "L", + "I", + "d", + "D", + "i", + "t", + "T", + ], + }, + R: { + priority: 130, + parse: function (t, e, n, r) { + return Bn("R" === e ? 4 : e.length, t); + }, + set: function (t, e, n, r) { + var i = new Date(0); + return i.setUTCFullYear(n, 0, 4), i.setUTCHours(0, 0, 0, 0), Ve(i); + }, + incompatibleTokens: [ + "G", + "y", + "Y", + "u", + "Q", + "q", + "M", + "L", + "w", + "d", + "D", + "e", + "c", + "t", + "T", + ], + }, + u: { + priority: 130, + parse: function (t, e, n, r) { + return Bn("u" === e ? 4 : e.length, t); + }, + set: function (t, e, n, r) { + return t.setUTCFullYear(n, 0, 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "G", + "y", + "Y", + "R", + "w", + "I", + "i", + "e", + "c", + "t", + "T", + ], + }, + Q: { + priority: 120, + parse: function (t, e, n, r) { + switch (e) { + case "Q": + case "QQ": + return Qn(e.length, t); + case "Qo": + return n.ordinalNumber(t, { unit: "quarter" }); + case "QQQ": + return ( + n.quarter(t, { width: "abbreviated", context: "formatting" }) || + n.quarter(t, { width: "narrow", context: "formatting" }) + ); + case "QQQQQ": + return n.quarter(t, { width: "narrow", context: "formatting" }); + default: + return ( + n.quarter(t, { width: "wide", context: "formatting" }) || + n.quarter(t, { width: "abbreviated", context: "formatting" }) || + n.quarter(t, { width: "narrow", context: "formatting" }) + ); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 4; + }, + set: function (t, e, n, r) { + return t.setUTCMonth(3 * (n - 1), 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "Y", + "R", + "q", + "M", + "L", + "w", + "I", + "d", + "D", + "i", + "e", + "c", + "t", + "T", + ], + }, + q: { + priority: 120, + parse: function (t, e, n, r) { + switch (e) { + case "q": + case "qq": + return Qn(e.length, t); + case "qo": + return n.ordinalNumber(t, { unit: "quarter" }); + case "qqq": + return ( + n.quarter(t, { width: "abbreviated", context: "standalone" }) || + n.quarter(t, { width: "narrow", context: "standalone" }) + ); + case "qqqqq": + return n.quarter(t, { width: "narrow", context: "standalone" }); + default: + return ( + n.quarter(t, { width: "wide", context: "standalone" }) || + n.quarter(t, { width: "abbreviated", context: "standalone" }) || + n.quarter(t, { width: "narrow", context: "standalone" }) + ); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 4; + }, + set: function (t, e, n, r) { + return t.setUTCMonth(3 * (n - 1), 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "Y", + "R", + "Q", + "M", + "L", + "w", + "I", + "d", + "D", + "i", + "e", + "c", + "t", + "T", + ], + }, + M: { + priority: 110, + parse: function (t, e, n, r) { + var i = function (t) { + return t - 1; + }; + switch (e) { + case "M": + return Wn(Fn.month, t, i); + case "MM": + return Qn(2, t, i); + case "Mo": + return n.ordinalNumber(t, { unit: "month", valueCallback: i }); + case "MMM": + return ( + n.month(t, { width: "abbreviated", context: "formatting" }) || + n.month(t, { width: "narrow", context: "formatting" }) + ); + case "MMMMM": + return n.month(t, { width: "narrow", context: "formatting" }); + default: + return ( + n.month(t, { width: "wide", context: "formatting" }) || + n.month(t, { width: "abbreviated", context: "formatting" }) || + n.month(t, { width: "narrow", context: "formatting" }) + ); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 11; + }, + set: function (t, e, n, r) { + return t.setUTCMonth(n, 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "Y", + "R", + "q", + "Q", + "L", + "w", + "I", + "D", + "i", + "e", + "c", + "t", + "T", + ], + }, + L: { + priority: 110, + parse: function (t, e, n, r) { + var i = function (t) { + return t - 1; + }; + switch (e) { + case "L": + return Wn(Fn.month, t, i); + case "LL": + return Qn(2, t, i); + case "Lo": + return n.ordinalNumber(t, { unit: "month", valueCallback: i }); + case "LLL": + return ( + n.month(t, { width: "abbreviated", context: "standalone" }) || + n.month(t, { width: "narrow", context: "standalone" }) + ); + case "LLLLL": + return n.month(t, { width: "narrow", context: "standalone" }); + default: + return ( + n.month(t, { width: "wide", context: "standalone" }) || + n.month(t, { width: "abbreviated", context: "standalone" }) || + n.month(t, { width: "narrow", context: "standalone" }) + ); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 11; + }, + set: function (t, e, n, r) { + return t.setUTCMonth(n, 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "Y", + "R", + "q", + "Q", + "M", + "w", + "I", + "D", + "i", + "e", + "c", + "t", + "T", + ], + }, + w: { + priority: 100, + parse: function (t, e, n, r) { + switch (e) { + case "w": + return Wn(Fn.week, t); + case "wo": + return n.ordinalNumber(t, { unit: "week" }); + default: + return Qn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 53; + }, + set: function (t, e, n, r) { + return an(Nn(t, n, r), r); + }, + incompatibleTokens: [ + "y", + "R", + "u", + "q", + "Q", + "M", + "L", + "I", + "d", + "D", + "i", + "t", + "T", + ], + }, + I: { + priority: 100, + parse: function (t, e, n, r) { + switch (e) { + case "I": + return Wn(Fn.week, t); + case "Io": + return n.ordinalNumber(t, { unit: "week" }); + default: + return Qn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 53; + }, + set: function (t, e, n, r) { + return Ve($n(t, n, r), r); + }, + incompatibleTokens: [ + "y", + "Y", + "u", + "q", + "Q", + "M", + "L", + "w", + "d", + "D", + "e", + "c", + "t", + "T", + ], + }, + d: { + priority: 90, + subPriority: 1, + parse: function (t, e, n, r) { + switch (e) { + case "d": + return Wn(Fn.date, t); + case "do": + return n.ordinalNumber(t, { unit: "date" }); + default: + return Qn(e.length, t); + } + }, + validate: function (t, e, n) { + var r = Zn(t.getUTCFullYear()), + i = t.getUTCMonth(); + return r ? e >= 1 && e <= Jn[i] : e >= 1 && e <= Kn[i]; + }, + set: function (t, e, n, r) { + return t.setUTCDate(n), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "Y", + "R", + "q", + "Q", + "w", + "I", + "D", + "i", + "e", + "c", + "t", + "T", + ], + }, + D: { + priority: 90, + subPriority: 1, + parse: function (t, e, n, r) { + switch (e) { + case "D": + case "DD": + return Wn(Fn.dayOfYear, t); + case "Do": + return n.ordinalNumber(t, { unit: "date" }); + default: + return Qn(e.length, t); + } + }, + validate: function (t, e, n) { + return Zn(t.getUTCFullYear()) + ? e >= 1 && e <= 366 + : e >= 1 && e <= 365; + }, + set: function (t, e, n, r) { + return t.setUTCMonth(0, n), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "Y", + "R", + "q", + "Q", + "M", + "L", + "w", + "I", + "d", + "E", + "i", + "e", + "c", + "t", + "T", + ], + }, + E: { + priority: 90, + parse: function (t, e, n, r) { + switch (e) { + case "E": + case "EE": + case "EEE": + return ( + n.day(t, { width: "abbreviated", context: "formatting" }) || + n.day(t, { width: "short", context: "formatting" }) || + n.day(t, { width: "narrow", context: "formatting" }) + ); + case "EEEEE": + return n.day(t, { width: "narrow", context: "formatting" }); + case "EEEEEE": + return ( + n.day(t, { width: "short", context: "formatting" }) || + n.day(t, { width: "narrow", context: "formatting" }) + ); + default: + return ( + n.day(t, { width: "wide", context: "formatting" }) || + n.day(t, { width: "abbreviated", context: "formatting" }) || + n.day(t, { width: "short", context: "formatting" }) || + n.day(t, { width: "narrow", context: "formatting" }) + ); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 6; + }, + set: function (t, e, n, r) { + return (t = jn(t, n, r)).setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ["D", "i", "e", "c", "t", "T"], + }, + e: { + priority: 90, + parse: function (t, e, n, r) { + var i = function (t) { + var e = 7 * Math.floor((t - 1) / 7); + return ((t + r.weekStartsOn + 6) % 7) + e; + }; + switch (e) { + case "e": + case "ee": + return Qn(e.length, t, i); + case "eo": + return n.ordinalNumber(t, { unit: "day", valueCallback: i }); + case "eee": + return ( + n.day(t, { width: "abbreviated", context: "formatting" }) || + n.day(t, { width: "short", context: "formatting" }) || + n.day(t, { width: "narrow", context: "formatting" }) + ); + case "eeeee": + return n.day(t, { width: "narrow", context: "formatting" }); + case "eeeeee": + return ( + n.day(t, { width: "short", context: "formatting" }) || + n.day(t, { width: "narrow", context: "formatting" }) + ); + default: + return ( + n.day(t, { width: "wide", context: "formatting" }) || + n.day(t, { width: "abbreviated", context: "formatting" }) || + n.day(t, { width: "short", context: "formatting" }) || + n.day(t, { width: "narrow", context: "formatting" }) + ); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 6; + }, + set: function (t, e, n, r) { + return (t = jn(t, n, r)).setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "y", + "R", + "u", + "q", + "Q", + "M", + "L", + "I", + "d", + "D", + "E", + "i", + "c", + "t", + "T", + ], + }, + c: { + priority: 90, + parse: function (t, e, n, r) { + var i = function (t) { + var e = 7 * Math.floor((t - 1) / 7); + return ((t + r.weekStartsOn + 6) % 7) + e; + }; + switch (e) { + case "c": + case "cc": + return Qn(e.length, t, i); + case "co": + return n.ordinalNumber(t, { unit: "day", valueCallback: i }); + case "ccc": + return ( + n.day(t, { width: "abbreviated", context: "standalone" }) || + n.day(t, { width: "short", context: "standalone" }) || + n.day(t, { width: "narrow", context: "standalone" }) + ); + case "ccccc": + return n.day(t, { width: "narrow", context: "standalone" }); + case "cccccc": + return ( + n.day(t, { width: "short", context: "standalone" }) || + n.day(t, { width: "narrow", context: "standalone" }) + ); + default: + return ( + n.day(t, { width: "wide", context: "standalone" }) || + n.day(t, { width: "abbreviated", context: "standalone" }) || + n.day(t, { width: "short", context: "standalone" }) || + n.day(t, { width: "narrow", context: "standalone" }) + ); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 6; + }, + set: function (t, e, n, r) { + return (t = jn(t, n, r)).setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "y", + "R", + "u", + "q", + "Q", + "M", + "L", + "I", + "d", + "D", + "E", + "i", + "e", + "t", + "T", + ], + }, + i: { + priority: 90, + parse: function (t, e, n, r) { + var i = function (t) { + return 0 === t ? 7 : t; + }; + switch (e) { + case "i": + case "ii": + return Qn(e.length, t); + case "io": + return n.ordinalNumber(t, { unit: "day" }); + case "iii": + return ( + n.day(t, { + width: "abbreviated", + context: "formatting", + valueCallback: i, + }) || + n.day(t, { + width: "short", + context: "formatting", + valueCallback: i, + }) || + n.day(t, { + width: "narrow", + context: "formatting", + valueCallback: i, + }) + ); + case "iiiii": + return n.day(t, { + width: "narrow", + context: "formatting", + valueCallback: i, + }); + case "iiiiii": + return ( + n.day(t, { + width: "short", + context: "formatting", + valueCallback: i, + }) || + n.day(t, { + width: "narrow", + context: "formatting", + valueCallback: i, + }) + ); + default: + return ( + n.day(t, { + width: "wide", + context: "formatting", + valueCallback: i, + }) || + n.day(t, { + width: "abbreviated", + context: "formatting", + valueCallback: i, + }) || + n.day(t, { + width: "short", + context: "formatting", + valueCallback: i, + }) || + n.day(t, { + width: "narrow", + context: "formatting", + valueCallback: i, + }) + ); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 7; + }, + set: function (t, e, n, r) { + return (t = qn(t, n, r)).setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "y", + "Y", + "u", + "q", + "Q", + "M", + "L", + "w", + "d", + "D", + "E", + "e", + "c", + "t", + "T", + ], + }, + a: { + priority: 80, + parse: function (t, e, n, r) { + switch (e) { + case "a": + case "aa": + case "aaa": + return ( + n.dayPeriod(t, { + width: "abbreviated", + context: "formatting", + }) || n.dayPeriod(t, { width: "narrow", context: "formatting" }) + ); + case "aaaaa": + return n.dayPeriod(t, { width: "narrow", context: "formatting" }); + default: + return ( + n.dayPeriod(t, { width: "wide", context: "formatting" }) || + n.dayPeriod(t, { + width: "abbreviated", + context: "formatting", + }) || + n.dayPeriod(t, { width: "narrow", context: "formatting" }) + ); + } + }, + set: function (t, e, n, r) { + return t.setUTCHours(Gn(n), 0, 0, 0), t; + }, + incompatibleTokens: ["b", "B", "H", "K", "k", "t", "T"], + }, + b: { + priority: 80, + parse: function (t, e, n, r) { + switch (e) { + case "b": + case "bb": + case "bbb": + return ( + n.dayPeriod(t, { + width: "abbreviated", + context: "formatting", + }) || n.dayPeriod(t, { width: "narrow", context: "formatting" }) + ); + case "bbbbb": + return n.dayPeriod(t, { width: "narrow", context: "formatting" }); + default: + return ( + n.dayPeriod(t, { width: "wide", context: "formatting" }) || + n.dayPeriod(t, { + width: "abbreviated", + context: "formatting", + }) || + n.dayPeriod(t, { width: "narrow", context: "formatting" }) + ); + } + }, + set: function (t, e, n, r) { + return t.setUTCHours(Gn(n), 0, 0, 0), t; + }, + incompatibleTokens: ["a", "B", "H", "K", "k", "t", "T"], + }, + B: { + priority: 80, + parse: function (t, e, n, r) { + switch (e) { + case "B": + case "BB": + case "BBB": + return ( + n.dayPeriod(t, { + width: "abbreviated", + context: "formatting", + }) || n.dayPeriod(t, { width: "narrow", context: "formatting" }) + ); + case "BBBBB": + return n.dayPeriod(t, { width: "narrow", context: "formatting" }); + default: + return ( + n.dayPeriod(t, { width: "wide", context: "formatting" }) || + n.dayPeriod(t, { + width: "abbreviated", + context: "formatting", + }) || + n.dayPeriod(t, { width: "narrow", context: "formatting" }) + ); + } + }, + set: function (t, e, n, r) { + return t.setUTCHours(Gn(n), 0, 0, 0), t; + }, + incompatibleTokens: ["a", "b", "t", "T"], + }, + h: { + priority: 70, + parse: function (t, e, n, r) { + switch (e) { + case "h": + return Wn(Fn.hour12h, t); + case "ho": + return n.ordinalNumber(t, { unit: "hour" }); + default: + return Qn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 12; + }, + set: function (t, e, n, r) { + var i = t.getUTCHours() >= 12; + return ( + i && n < 12 + ? t.setUTCHours(n + 12, 0, 0, 0) + : i || 12 !== n + ? t.setUTCHours(n, 0, 0, 0) + : t.setUTCHours(0, 0, 0, 0), + t + ); + }, + incompatibleTokens: ["H", "K", "k", "t", "T"], + }, + H: { + priority: 70, + parse: function (t, e, n, r) { + switch (e) { + case "H": + return Wn(Fn.hour23h, t); + case "Ho": + return n.ordinalNumber(t, { unit: "hour" }); + default: + return Qn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 23; + }, + set: function (t, e, n, r) { + return t.setUTCHours(n, 0, 0, 0), t; + }, + incompatibleTokens: ["a", "b", "h", "K", "k", "t", "T"], + }, + K: { + priority: 70, + parse: function (t, e, n, r) { + switch (e) { + case "K": + return Wn(Fn.hour11h, t); + case "Ko": + return n.ordinalNumber(t, { unit: "hour" }); + default: + return Qn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 11; + }, + set: function (t, e, n, r) { + return ( + t.getUTCHours() >= 12 && n < 12 + ? t.setUTCHours(n + 12, 0, 0, 0) + : t.setUTCHours(n, 0, 0, 0), + t + ); + }, + incompatibleTokens: ["a", "b", "h", "H", "k", "t", "T"], + }, + k: { + priority: 70, + parse: function (t, e, n, r) { + switch (e) { + case "k": + return Wn(Fn.hour24h, t); + case "ko": + return n.ordinalNumber(t, { unit: "hour" }); + default: + return Qn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 24; + }, + set: function (t, e, n, r) { + var i = n <= 24 ? n % 24 : n; + return t.setUTCHours(i, 0, 0, 0), t; + }, + incompatibleTokens: ["a", "b", "h", "H", "K", "t", "T"], + }, + m: { + priority: 60, + parse: function (t, e, n, r) { + switch (e) { + case "m": + return Wn(Fn.minute, t); + case "mo": + return n.ordinalNumber(t, { unit: "minute" }); + default: + return Qn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 59; + }, + set: function (t, e, n, r) { + return t.setUTCMinutes(n, 0, 0), t; + }, + incompatibleTokens: ["t", "T"], + }, + s: { + priority: 50, + parse: function (t, e, n, r) { + switch (e) { + case "s": + return Wn(Fn.second, t); + case "so": + return n.ordinalNumber(t, { unit: "second" }); + default: + return Qn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 59; + }, + set: function (t, e, n, r) { + return t.setUTCSeconds(n, 0), t; + }, + incompatibleTokens: ["t", "T"], + }, + S: { + priority: 30, + parse: function (t, e, n, r) { + return Qn(e.length, t, function (t) { + return Math.floor(t * Math.pow(10, 3 - e.length)); + }); + }, + set: function (t, e, n, r) { + return t.setUTCMilliseconds(n), t; + }, + incompatibleTokens: ["t", "T"], + }, + X: { + priority: 10, + parse: function (t, e, n, r) { + switch (e) { + case "X": + return zn(_n.basicOptionalMinutes, t); + case "XX": + return zn(_n.basic, t); + case "XXXX": + return zn(_n.basicOptionalSeconds, t); + case "XXXXX": + return zn(_n.extendedOptionalSeconds, t); + default: + return zn(_n.extended, t); + } + }, + set: function (t, e, n, r) { + return e.timestampIsSet ? t : new Date(t.getTime() - n); + }, + incompatibleTokens: ["t", "T", "x"], + }, + x: { + priority: 10, + parse: function (t, e, n, r) { + switch (e) { + case "x": + return zn(_n.basicOptionalMinutes, t); + case "xx": + return zn(_n.basic, t); + case "xxxx": + return zn(_n.basicOptionalSeconds, t); + case "xxxxx": + return zn(_n.extendedOptionalSeconds, t); + default: + return zn(_n.extended, t); + } + }, + set: function (t, e, n, r) { + return e.timestampIsSet ? t : new Date(t.getTime() - n); + }, + incompatibleTokens: ["t", "T", "X"], + }, + t: { + priority: 40, + parse: function (t, e, n, r) { + return In(t); + }, + set: function (t, e, n, r) { + return [new Date(1e3 * n), { timestampIsSet: !0 }]; + }, + incompatibleTokens: "*", + }, + T: { + priority: 20, + parse: function (t, e, n, r) { + return In(t); + }, + set: function (t, e, n, r) { + return [new Date(n), { timestampIsSet: !0 }]; + }, + incompatibleTokens: "*", + }, + }, + tr = Vn, + er = 10, + nr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, + rr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, + ir = /^'([^]*?)'?$/, + ar = /''/g, + or = /\S/, + ur = /[a-zA-Z]/; + function sr(t, e, n, r) { + Vt(3, arguments); + var i = String(t), + a = String(e), + o = r || {}, + u = o.locale || Qe; + if (!u.match) throw new RangeError("locale must contain match property"); + var s = u.options && u.options.firstWeekContainsDate, + c = null == s ? 1 : Zt(s), + h = null == o.firstWeekContainsDate ? c : Zt(o.firstWeekContainsDate); + if (!(h >= 1 && h <= 7)) + throw new RangeError( + "firstWeekContainsDate must be between 1 and 7 inclusively", + ); + var l = u.options && u.options.weekStartsOn, + d = null == l ? 0 : Zt(l), + f = null == o.weekStartsOn ? d : Zt(o.weekStartsOn); + if (!(f >= 0 && f <= 6)) + throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); + if ("" === a) return "" === i ? te(n) : new Date(NaN); + var v, + g = { firstWeekContainsDate: h, weekStartsOn: f, locale: u }, + p = [{ priority: er, subPriority: -1, set: cr, index: 0 }], + y = a + .match(rr) + .map(function (t) { + var e = t[0]; + return "p" === e || "P" === e ? (0, bn[e])(t, u.formatLong, g) : t; + }) + .join("") + .match(nr), + m = []; + for (v = 0; v < y.length; v++) { + var w = y[v]; + !o.useAdditionalWeekYearTokens && Cn(w) && An(w, a, t), + !o.useAdditionalDayOfYearTokens && xn(w) && An(w, a, t); + var b = w[0], + k = tr[b]; + if (k) { + var T = k.incompatibleTokens; + if (Array.isArray(T)) { + for (var x = void 0, C = 0; C < m.length; C++) { + var A = m[C].token; + if (-1 !== T.indexOf(A) || A === b) { + x = m[C]; + break; + } + } + if (x) + throw new RangeError( + "The format string mustn't contain `" + .concat(x.fullToken, "` and `") + .concat(w, "` at the same time"), + ); + } else if ("*" === k.incompatibleTokens && m.length) + throw new RangeError( + "The format string mustn't contain `".concat( + w, + "` and any other token at the same time", + ), + ); + m.push({ token: b, fullToken: w }); + var D = k.parse(i, w, u.match, g); + if (!D) return new Date(NaN); + p.push({ + priority: k.priority, + subPriority: k.subPriority || 0, + set: k.set, + validate: k.validate, + value: D.value, + index: p.length, + }), + (i = D.rest); + } else { + if (b.match(ur)) + throw new RangeError( + "Format string contains an unescaped latin alphabet character `" + + b + + "`", + ); + if ( + ("''" === w ? (w = "'") : "'" === b && (w = hr(w)), + 0 !== i.indexOf(w)) + ) + return new Date(NaN); + i = i.slice(w.length); + } + } + if (i.length > 0 && or.test(i)) return new Date(NaN); + var E = p + .map(function (t) { + return t.priority; + }) + .sort(function (t, e) { + return e - t; + }) + .filter(function (t, e, n) { + return n.indexOf(t) === e; + }) + .map(function (t) { + return p + .filter(function (e) { + return e.priority === t; + }) + .sort(function (t, e) { + return e.subPriority - t.subPriority; + }); + }) + .map(function (t) { + return t[0]; + }), + S = te(n); + if (isNaN(S)) return new Date(NaN); + var O = Be(S, ne(S)), + P = {}; + for (v = 0; v < E.length; v++) { + var R = E[v]; + if (R.validate && !R.validate(O, R.value, g)) return new Date(NaN); + var U = R.set(O, P, R.value, g); + U[0] ? ((O = U[0]), Mn(P, U[1])) : (O = U); + } + return O; + } + function cr(t, e) { + if (e.timestampIsSet) return t; + var n = new Date(0); + return ( + n.setFullYear(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()), + n.setHours( + t.getUTCHours(), + t.getUTCMinutes(), + t.getUTCSeconds(), + t.getUTCMilliseconds(), + ), + n + ); + } + function hr(t) { + return t.match(ir)[1].replace(ar, "'"); + } + var lr = (function (t) { + l(n, t); + var e = m(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return u(this, n), e.call(this, t, r, "store-hour", i); + } + return ( + c(n, [ + { + 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, + n = Math.abs(t - e); + return Math.floor(n / 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 sr(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 sr(t, e ? "HH:mm:ss" : "HH:mm", new Date()); + }, + }, + { + key: "humanReadableHoursRange", + get: function () { + return ie(this.startDateInstance) && ie(this.endDateInstance) + ? "" + .concat(Rn(this.startDateInstance, "p"), " - ") + .concat(Rn(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!"); + }, + }, + ]), + n + ); + })(Nt), + dr = (function (t) { + l(n, t); + var e = m(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return u(this, n), e.call(this, t, r, "store-location", i); + } + return ( + c(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 at( + this.getAttribute("hours").map(function (t) { + return new lr(t); + }), + ); + }, + }, + { + key: "isAlwaysOpen", + get: function () { + return this.hours.every(function (t) { + return null == t ? void 0 : t.is24Hours; + }); + }, + }, + { + key: "today", + get: function () { + var t = Rn(new Date(), "EEEE"); + return this.schedule[t]; + }, + }, + { + key: "schedule", + get: function () { + for ( + var t = {}, + e = [ + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday", + ], + n = 0; + n < e.length; + n++ + ) { + t[e[n]] = new at(); + } + for (var r = 0; r < this.hours.length; r++) { + var i = this.hours.objectAt(r); + t[i.day].pushObject(i); + } + return t; + }, + }, + { + 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!"); + }, + }, + ]), + n + ); + })(Nt), + fr = (function (t) { + l(n, t); + var e = m(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return u(this, n), e.call(this, t, r, "payment-gateway", i); + } + return ( + c(n, [ + { + 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!", + ); + }, + }, + ]), + n + ); + })(Nt), + vr = (function (t) { + l(n, t); + var e = m(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return u(this, n), e.call(this, t, r, "store", i); + } + return ( + c(n, [ + { + key: "getReviews", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return this.adapter + .get("reviews", a({ store: this.id }, e)) + .then(function (e) { + return new at( + e.map(function (e) { + return new Yt(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", a({ store: this.id }, e)) + .then(function (e) { + return new at( + e.map(function (e) { + return ( + e.place && (e.place = new kt(e.place)), + new dr(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 dr(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 at( + e.map(function (e) { + return new fr(e, t.adapter); + }), + ); + }); + }, + }, + { + key: "getPaymentGateway", + value: function (t) { + var e = this; + return this.adapter.get("gateways/".concat(t)).then(function (t) { + return new fr(t, e.adapter); + }); + }, + }, + ]), + n + ); + })(Nt), + gr = (function (t) { + l(n, t); + var e = m(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return u(this, n), e.call(this, t, r, "network", i); + } + return ( + c(n, [ + { + key: "getTags", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return this.adapter.get("tags", t); + }, + }, + { + key: "getStores", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return this.adapter.get("stores", e).then(function (e) { + return new at( + e.map(function (e) { + return new vr(e, t.adapter); + }), + ); + }); + }, + }, + { + key: "getStoreLocations", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return this.adapter.get("store-locations", e).then(function (e) { + return new at( + e.map(function (e) { + return new dr(e, t.adapter); + }), + ); + }); + }, + }, + { + key: "getPaymentGateways", + value: function () { + var t = this; + return this.adapter.get("gateways").then(function (e) { + return new at( + e.map(function (e) { + return new fr(e, t.adapter); + }), + ); + }); + }, + }, + ]), + n + ); + })(Nt), + pr = Array.isArray, + yr = (function (t) { + l(n, t); + var e = m(n); + function n() { + var t, + r = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + i = arguments.length > 1 ? arguments[1] : void 0, + a = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return ( + u(this, n), + r instanceof xt + ? y(t, (t = e.call(this, {}, r, "service-quote", a))) + : e.call(this, r, i, "service-quote", a) + ); + } + return ( + c( + n, + [ + { + key: "setAdapter", + value: function (t) { + var e; + return ( + (this.adapter = t), + (this.store = new Cr(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, + n = t.currency; + return zt(e) || zt(n) ? null : _t(e / 100, n); + }, + }, + { + key: "fromCart", + value: function (t, e, r) { + var i, + a, + o, + u = this, + s = + arguments.length > 3 && void 0 !== arguments[3] + ? arguments[3] + : "storefront", + c = + arguments.length > 4 && + void 0 !== arguments[4] && + arguments[4]; + return ( + null !== (i = t) && void 0 !== i && i.id && (t = t.id), + null !== (a = e) && void 0 !== a && a.id && (e = e.id), + null !== (o = r) && void 0 !== o && o.id && (r = r.id), + this.adapter + .get("service-quotes/from-cart", { + origin: t, + destination: e, + cart: r, + config: s, + all: c, + }) + .then(function (t) { + return pr(t) + ? new at( + t.map(function (t) { + return new n(t, u.adapter); + }), + ) + : new n(t, u.adapter); + }) + ); + }, + }, + ], + [ + { + key: "getFromCart", + value: function (t) { + for ( + var e = new n(t), + r = arguments.length, + i = new Array(r > 1 ? r - 1 : 0), + a = 1; + a < r; + a++ + ) + i[a - 1] = arguments[a]; + return e.fromCart.apply(e, i); + }, + }, + ], + ), + n + ); + })(Tt), + mr = new pt({ + create: void 0, + findAll: void 0, + query: void 0, + queryRecord: void 0, + initialize: function (t, e, n, r) { + var i = + arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {}, + o = + arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : {}; + return ( + st(t) && (t = t.id), + st(e) && (e = e.id), + st(n) && (n = n.id), + st(r) && (r = r.getAttribute("code")), + this.adapter.get( + "".concat(this.namespace, "/before"), + a( + a({}, i), + {}, + { customer: t, cart: e, serviceQuote: n, gateway: r }, + ), + o, + ) + ); + }, + captureOrder: function (t) { + var e = + 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: e }, + n, + ) + .then(function (t) { + return new wt(t); + }); + }, + }), + wr = (function (t) { + l(n, t); + var e = m(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return u(this, n), e.call(this, t, r, "checkout", i); + } + return ( + c(n, [ + { + 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); + }, + }, + ]), + n + ); + })(Nt), + br = { + Product: It, + Category: Qt, + Customer: Gt, + Cart: Jt, + DeliveryServiceQuote: yr, + Store: vr, + StoreLocation: dr, + StoreHour: lr, + Checkout: wr, + Review: Yt, + }, + kr = { BrowserAdapter: Ct, NodeAdapter: At }, + Tr = (function () { + function t() { + return ( + u(this, t), + (this.resources = br), + (this.adapters = kr), + this.lookup.apply(this, arguments) + ); + } + return ( + c(t, [ + { + key: "lookup", + value: function (t, e) { + var n = St(t), + r = Array.prototype.slice.call(arguments).slice(2); + if (!this[n]) + throw new Error("Attempted to resolve invalid type"); + if (!this[n][e]) + throw new Error( + "No ".concat(Ot(t), " named ").concat(e, " to resolve"), + ); + return g(this[n][e], w(r)); + }, + }, + ]), + t + ); + })(), + xr = function () { + return g(Tr, Array.prototype.slice.call(arguments)); + }, + Cr = (function (t) { + l(n, t); + var e = m(n); + function n() { + return u(this, n), e.apply(this, arguments); + } + return ( + c(n, [ + { + key: "extendActions", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : []; + return qt(this, t); + }, + }, + { + key: "serialize", + value: function (t) { + return xr("resource", Pt(this.resource), t, this.adapter); + }, + }, + ]), + n + ); + })($t), + Ar = (function () { + function t(e) { + var n = + arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; + if ( + (u(this, t), + (this.version = n.version || "v1"), + (this.options = { + version: this.version, + host: n.host || "https://api.fleetbase.io", + namespace: "storefront/".concat(this.version) || n.namespace, + publicKey: e, + debug: r, + }), + !Wt(e)) + ) + throw new Error("⚠️ Invalid Storefront key given to Storefront SDK"); + (this.adapter = n.adapter || Lt(this.options)), + (this.products = new Cr("product", this.adapter)), + (this.categories = new Cr("category", this.adapter)), + (this.reviews = new Cr("review", this.adapter).extendActions(Ht)), + (this.customers = new Cr("customer", this.adapter).extendActions(Bt)), + (this.cart = new Cr("cart", this.adapter).extendActions(Kt)), + (this.checkout = new Cr("checkout", this.adapter).extendActions(mr)); + } + return ( + c( + 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", a({ query: t }, e)) + .then(function (t) { + return new at( + t.map(function (t) { + return new It(t); + }), + ); + }); + }, + }, + { + key: "setAdapter", + value: function (t) { + this.adapter = t; + }, + }, + { + key: "getAdapter", + value: function () { + return this.adapter; + }, + }, + ], + [ + { + key: "newInstance", + value: function () { + return g(t, Array.prototype.slice.call(arguments)); + }, + }, + ], + ), + t + ); + })(); + (t.Cart = Jt), + (t.Category = Qt), + (t.Checkout = wr), + (t.Customer = Gt), + (t.DeliveryServiceQuote = yr), + (t.Network = gr), + (t.PaymentGateway = fr), + (t.Product = It), + (t.Review = Yt), + (t.Store = vr), + (t.StoreHour = lr), + (t.StoreLocation = dr), + (t.default = Ar); +}); //# sourceMappingURL=storefront.min.js.map diff --git a/dist/cjs/storefront.js b/dist/cjs/storefront.js index 6e74a04..8274470 100644 --- a/dist/cjs/storefront.js +++ b/dist/cjs/storefront.js @@ -1,2 +1,5591 @@ -"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("axios"));function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function r(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:[];if(Y(t))if(r.length<=6e4)t.splice.apply(t,[e,n].concat($(r)));else{t.splice(e,n);for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:0,r=t.length,i=n;i2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=t.length;n<0&&(n+=i);var a=r&&e!=e?function(t){return t!=t}:function(t){return t===e};return Q(t,a,n)},J=function(t,e,n){return F(t,e,0,[n]),n},Z=function(t){D(n,U(Array));var e=j(n);function n(){for(var t=arguments.length,r=new Array(t),i=0;i0}},{key:"empty",get:function(){return 0===this.length}},{key:"first",get:function(){return z(this,0)}},{key:"last",get:function(){return z(this,this.length-1)}},{key:"replace",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return F(this,t,e,n),this}},{key:"objectsAt",value:function(t){var e=this;return t.map((function(t){return z(e,t)}))}},{key:"objectAt",value:function(t){return z(this,t)}},{key:"indexOf",value:function(t,e){return K(this,t,e,!1)}},{key:"lastIndexOf",value:function(t,e){var n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(var r=e;r>=0;r--)if(z(this,r)===t)return r;return-1}},{key:"includes",value:function(t,e){return-1!==K(this,t,e,!0)}},{key:"findBy",value:function(){return B(this,I.apply(void 0,arguments))}},{key:"findIndexBy",value:function(){return Q(this,I.apply(void 0,arguments))}},{key:"isEvery",value:function(){return X(this,I.apply(void 0,arguments))}},{key:"isAny",value:function(){return G(this,I.apply(void 0,arguments))}},{key:"invoke",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:_,n=[],r=new Set,i="function"==typeof e?e:function(t){return get(t,e)};return t.forEach((function(t){var e=i(t);r.has(e)||(r.add(e),n.push(t))})),n}(this,t)}},{key:"without",value:function(t){if(!this.includes(t))return this;var e=t==t?function(e){return e!==t}:function(t){return t==t};return this.filter(e)}},{key:"clear",value:function(){var t=this.length;return 0===t||this.replace(0,t,[]),this}},{key:"insertAt",value:function(t,e){return J(this,t,e),this}},{key:"replaceAt",value:function(t,e){return this.replace(t,1,[e])}},{key:"removeAt",value:function(t,e){return function(t,e){return F(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,[]),t}(this,t,e)}},{key:"pushObject",value:function(t){return this.insertAt(this.length,t)}},{key:"pushObjects",value:function(t){return this.replace(this.length,0,t),this}},{key:"popObject",value:function(){var t=this.length;if(0===t)return null;var e=z(this,t-1);return this.removeAt(t-1,1),e}},{key:"shiftObject",value:function(){if(0===this.length)return null;var t=z(this,0);return this.removeAt(0),t}},{key:"unshiftObject",value:function(t){return J(this,0,t)}},{key:"unshiftObjects",value:function(t){return this.replace(0,0,t),this}},{key:"reverseObjects",value:function(){var t=this.length;if(0===t)return this;var e=this.toArray().reverse();return this.replace(0,t,e),this}},{key:"setObjects",value:function(t){if(0===t.length)return this.clear();var e=this.length;return this.replace(0,e,t),this}},{key:"removeObject",value:function(t){for(var e=this.length||0;--e>=0;)z(this,e)===t&&this.removeAt(e);return this}},{key:"removeObjects",value:function(t){for(var e=t.length-1;e>=0;e--)this.removeObject(t[e]);return this}},{key:"addObject",value:function(t){return this.includes(t)||this.pushObject(t),this}},{key:"addObjects",value:function(t){var e=this;return t.forEach((function(t){return e.addObject(t)})),this}}]),n}(),V=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var n=b(t);if("object"===n){var r=t.size;if("number"==typeof r)return!r}if("number"==typeof t.length&&"function"!==n)return!t.length;if("object"===n){var i=t.length;if("number"==typeof i)return!i}return!1},tt=function(t){return V(t)||"string"==typeof t&&!1===/\S/.test(t)};function et(t){return t instanceof ht}var nt=function(){var t,e,n,r,i;return!("undefined"==typeof process||"object"!==b(null===(t=process)||void 0===t?void 0:t.env)&&-1===(null===(e=process.release)||void 0===e||null===(n=e.name)||void 0===n?void 0:n.search(/node|io.js/))||"undefined"!=typeof window&&"ReactNative"!==(null===(r=window)||void 0===r||null===(i=r.navigator)||void 0===i?void 0:i.product))},rt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nt()?Dt("adapter","NodeAdapter",t):Dt("adapter","BrowserAdapter",t)},it=Array.isArray;!function(){function t(e){T(this,t),this.place=e,this.geometry=null==e?void 0:e.geometry,this.components=this.parseComponents(),this.attributes=this.parseProperties()}A(t,[{key:"parse",value:function(){this.parseComponents(),this.parseProperties()}},{key:"parseComponents",value:function(){var t;return((null===(t=this.place)||void 0===t?void 0:t.address_components)||[]).reduce((function(t,e){return e.types.forEach((function(n){t[n]=e})),t}),{})}},{key:"parseProperties",value:function(){var t,e={streetNumber:this.get("street_number"),streetName:this.get("route"),coordinates:null!==(t=this.geometry)&&void 0!==t&&t.location?Object.values(this.geometry.location):[0,0],city:this.or(["locality","sublocality","sublocality_level_1","neighborhood","administrative_area_level_3","administrative_area_level_2"]),county:this.get("administrative_area_level_2"),stateShort:this.get("administrative_area_level_1",!0),stateLong:this.get("administrative_area_level_1"),countryShort:this.get("country",!0),country:this.get("country",!0),countryLong:this.get("country"),postalCode:this.get("postal_code")};return e.address=[e.streetNumber,e.streetName].filter(Boolean).join(" "),e}},{key:"all",value:function(){return this.attributes}},{key:"or",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=0;e1&&void 0!==arguments[1]&&arguments[1];return t in this.components?e?this.components[t].short_name:this.components[t].long_name:null}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.attributes=w(w({},this.attributes),t),this}},{key:"setAttribute",value:function(t,e){return this.attributes[t]=e,this}},{key:"getAttribute",value:function(t){return this.attributes[t]||null}}])}();var at=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;T(this,t),this.type="Point",this.coordinates=[n,e]}return A(t,[{key:"latitude",get:function(){return this.coordinates[1]}},{key:"longitude",get:function(){return this.coordinates[0]}},{key:"lat",value:function(){return this.latitude}},{key:"lng",value:function(){return this.longitude}},{key:"serialize",value:function(){return{type:"Point",coorindates:[this.lat(),this.lng()]}}},{key:"toJson",value:function(){return this.serialize()}},{key:"toString",value:function(){return"(".concat(this.latitude,", ").concat(this.longitude,")")}}],[{key:"fromGeoJson",value:function(e){var n=q(e.coordinates,2);return longitude=n[0],latitude=n[1],new t(latitude,longitude)}}]),t}();"undefined"==typeof arguments||arguments;var ot=function(t,e){var n=t();return Array.isArray(n)||"object"===b(n)?ut(n,e):null},ut=function t(e,n){var r,i=e,a=b(e),o="object"===a,u="function"===a,s=Array.isArray(e),c="string"===b(n)&&n.includes(".")?n.split("."):[n];if(s||o){for(var h=0;h0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;T(this,t),this.actions=e,this.bind=n}return A(t,[{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=t||this.bind;if(!e)return this;if(null!=this&&this.actions&&"object"===b(this.actions))for(var n in this.actions){var r=this.actions[n];st(e,n,"function"==typeof r?r.bind(e):r)}return this}}]),t}(),ht=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};T(this,t),this.attributes=e,this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isDestroying=!1,this.isReloading=!1,this.resource=r,this.options=i,this.version=i.version||"v1",this.setAdapter(n)}return A(t,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new St(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"id",get:function(){return this.getAttribute("id")}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.mergeAttributes(e);return this.setFlags(["isLoading","isSaving"]),this.store.create(n).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setFlags(["isLoading","isSaving"]),this.store.update(this.attributes.id,e).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"destroy",value:function(){var t=this;return this.setFlags(["isLoading","isDestroying"]),this.store.destroy(this.attributes.id).then((function(e){return t.setFlags(["isLoading","isDestroying"],!1),e}))}},{key:"reload",value:function(){var t=this;return this.setFlags(["isLoading","isReloading"]),this.store.findRecord(this.attributes.id).then((function(e){return t.reset(),e}))}},{key:"setFlags",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=["isLoading","isSaving","isReloading","isDestroying"],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAttributes();return V(this.id)?this.create(e):!0===t.onlyDirty?this.savedirty():this.update(e)}},{key:"saveDirty",value:function(){for(var t=Object.keys(this.dirtyAttributes),e={},n=0;n0}},{key:"mutate",value:function(t,e){this.attributes[t]=e}},{key:"setAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===n&&"object"===b(t))return this.setAttributes(t);var r=null!==(e=null==this?void 0:this.attributes[t])&&void 0!==e?e:null;return st(this.attributes,t,n),st(this.dirtyAttributes,t,r),Y(null==this?void 0:this.changes[t])||(this.changes[t]=[]),this.changes[t].push({property:t,previousValue:r,value:n,changedAt:new Date}),this}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)this.setAttribute(e,t[e]);return this}},{key:"getAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=ut(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{},t);return void 0===r?n:r}},{key:"hasAttribute",value:function(t){if(Y(t)){var e,n=t,r=Object.keys(null!==(e=this.attributes)&&void 0!==e?e:{});return n.every((function(t){return r.includes(t)}))}return!(null==this||!this.attributes)&&t in this.attributes}},{key:"hasAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.hasAttribute(t)}},{key:"isAttributeFilled",value:function(t){var e=this;return Y(t)?this.hasAttribute(t)&&t.every((function(t){return!V(e.getAttribute(t))})):this.hasAttribute(t)&&!V(this.getAttribute(t))}},{key:"getAttributes",value:function(t){var e={};if(null==t)return this.getAttributes(Object.keys(this.attributes));if("string"==typeof t)return this.getAttribute(Array.prototype.slice.call(arguments));if(!Y(t))throw new Error("No attribute properties provided!");for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=null!==(t=null==this?void 0:this.attributes)&&void 0!==t?t:{};return this.attributes=w(w({},n),e),this.attributes}},{key:"syncAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attributes=t}}]),t}(),lt=new ct({getDistanceAndTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("".concat(this.namespace,"/").concat(t,"/distance-and-time"),{},e)}}),dt=function(t){D(n,ht);var e=j(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"order",w({actions:lt},i))}return A(n,[{key:"getDistanceAndTime",value:function(){return this.store.getDistanceAndTime(this.id)}}]),n}(),ft=function(t){D(n,ht);var e=j(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"payload",i)}return A(n,[{key:"attach",value:function(t){}},{key:"entities",get:function(){}},{key:"dropoff",get:function(){}},{key:"pickup",get:function(){}},{key:"waypoints",get:function(){return new Z(this.waypoints)}}]),n}();!function(t){D(n,ht);var e=j(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"entity",i)}}();var vt=function(t){D(n,ht);var e=j(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"place",i)}return A(n,[{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new at))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new at))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}},{key:"setOwner",value:function(t){return et(t)&&this.setAttribute("owner",t.id),"string"==typeof t&&this.setAttribute("owner",t),this}}],[{key:"fromGoogleAddress",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.getAttribute("coordinates"),a=q(i,2),o=a[0],u=a[1],s={name:null,address:t.getAttribute("address"),location:new at(o,u),street1:t.getAttribute("streetName"),street2:null,city:t.getAttribute("city"),province:t.getAttribute("stateLong"),postal_code:t.getAttribute("postalCode"),neighborhood:t.get("neighborhood"),district:t.getAttribute("county"),building:t.get("building"),country:t.getAttribute("countryShort"),phone:null,security_access_code:null};return new n(s,e,r)}}]),n}();!function(t){D(n,vt);var e=j(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"waypoint",i)}}(),function(t){D(n,ht);var e=j(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"tracking-status",i)}}(),function(t){D(n,ht);var e=j(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"vehicle",i)}}(),function(t){D(n,ht);var e=j(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"driver",i)}}(),function(t){D(n,ht);var e=j(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"vendor",i)}}(),function(t){D(n,ht);var e=j(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"contact",i)}}(),function(t){D(n,ht);var e=j(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"zone",i)}}(),function(t){D(n,ht);var e=j(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"service-area",i)}}(),function(t){D(n,ht);var e=j(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"service-rate",i)}}();var gt=function(t){D(n,ht);var e=j(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"service-quote",i)}return A(n,[{key:"fromPreliminary",value:function(){}},{key:"fromPayload",value:function(){}}]),n}(),pt=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};T(this,t),this.version=e.version||"v1",this.host=e.host||null,this.namespace=e.namespace||null,this.headers=e.headers||{}},yt=function(t){D(n,pt);var e=j(n);function n(t){var r;return T(this,n),(r=e.call(this,t)).setHeaders({Authorization:"Bearer ".concat(t.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;browser"}),r}return A(n,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.headers=w(w({},this.headers),t),this}},{key:"parseJSON",value:function(t){return new Promise((function(e,n){return t.json().then((function(n){return e({statusText:t.statusText,status:t.status,ok:t.ok,json:n})})).catch((function(){n(new Error("Oops! Something went wrong when handling your request."))}))}))}},{key:"request",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(a,o){return fetch(i.url||"".concat(e.host,"/").concat(e.namespace,"/").concat(t),w({method:n,mode:i.mode||"cors",headers:new Headers(w(w({},e.headers||{}),i.headers||{}))},r)).then(e.parseJSON).then((function(t){return t.ok?a(t.json):o(new Error(t.json.errors?t.json.errors[0]:t.statusText))})).catch((function(t){o(t)}))}))}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=tt(e)?"":new URLSearchParams(e).toString();return this.request("".concat(t).concat(r?"?".concat(r):""),"GET",{},n)}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"POST",{body:JSON.stringify(e)},n)}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PUT",{body:JSON.stringify(e)},n)}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(t,"DELETE",{},e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PATCH",{body:JSON.stringify(e)},n)}}]),n}(),mt=function(t){D(r,pt);var n=j(r);function r(t){var i;return T(this,r),(i=n.call(this,t)).axios=e.default.create({baseURL:"".concat(i.host,"/").concat(i.namespace),headers:{Authorization:"Bearer ".concat(t.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;node"}}),i}return A(r,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.axios.defaults.headers.common;return this.axios.defaults.headers.common=w(w({},e),t),this}},{key:"transform",value:function(t){return t.data}},{key:"handleError",value:function(t){if(t.response){var e=t.response.data;if(Y(e.errors))throw new Error(e.errors[0]);if(e.error)throw new Error(e.error)}throw t}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=tt(e)?"":new URLSearchParams(e).toString();return this.axios.get("".concat(t).concat(r?"?".concat(r):""),n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.post(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.put(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.axios.delete(t,e).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.patch(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}}]),r}(),wt=function(t){D(n,pt);var e=j(n);function n(){return T(this,n),e.apply(this,arguments)}return n}(),bt=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];T(this,t),E(this,"uncountableWords",["equipment","information","rice","money","species","series","fish","sheep","moose","deer","news"]),E(this,"pluralRules",[[new RegExp("(m)an$","gi"),"$1en"],[new RegExp("(pe)rson$","gi"),"$1ople"],[new RegExp("(child)$","gi"),"$1ren"],[new RegExp("^(ox)$","gi"),"$1en"],[new RegExp("(ax|test)is$","gi"),"$1es"],[new RegExp("(octop|vir)us$","gi"),"$1i"],[new RegExp("(alias|status)$","gi"),"$1es"],[new RegExp("(bu)s$","gi"),"$1ses"],[new RegExp("(buffal|tomat|potat)o$","gi"),"$1oes"],[new RegExp("([ti])um$","gi"),"$1a"],[new RegExp("sis$","gi"),"ses"],[new RegExp("(?:([^f])fe|([lr])f)$","gi"),"$1$2ves"],[new RegExp("(hive)$","gi"),"$1s"],[new RegExp("([^aeiouy]|qu)y$","gi"),"$1ies"],[new RegExp("(x|ch|ss|sh)$","gi"),"$1es"],[new RegExp("(matr|vert|ind)ix|ex$","gi"),"$1ices"],[new RegExp("([m|l])ouse$","gi"),"$1ice"],[new RegExp("(quiz)$","gi"),"$1zes"],[new RegExp("s$","gi"),"s"],[new RegExp("$","gi"),"s"]]),E(this,"singularRules",[[new RegExp("(m)en$","gi"),"$1an"],[new RegExp("(pe)ople$","gi"),"$1rson"],[new RegExp("(child)ren$","gi"),"$1"],[new RegExp("([ti])a$","gi"),"$1um"],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi"),"$1$2sis"],[new RegExp("(hive)s$","gi"),"$1"],[new RegExp("(tive)s$","gi"),"$1"],[new RegExp("(curve)s$","gi"),"$1"],[new RegExp("([lr])ves$","gi"),"$1f"],[new RegExp("([^fo])ves$","gi"),"$1fe"],[new RegExp("([^aeiouy]|qu)ies$","gi"),"$1y"],[new RegExp("(s)eries$","gi"),"$1eries"],[new RegExp("(m)ovies$","gi"),"$1ovie"],[new RegExp("(x|ch|ss|sh)es$","gi"),"$1"],[new RegExp("([m|l])ice$","gi"),"$1ouse"],[new RegExp("(bus)es$","gi"),"$1"],[new RegExp("(o)es$","gi"),"$1"],[new RegExp("(shoe)s$","gi"),"$1"],[new RegExp("(cris|ax|test)es$","gi"),"$1is"],[new RegExp("(octop|vir)i$","gi"),"$1us"],[new RegExp("(alias|status)es$","gi"),"$1"],[new RegExp("^(ox)en","gi"),"$1"],[new RegExp("(vert|ind)ices$","gi"),"$1ex"],[new RegExp("(matr)ices$","gi"),"$1ix"],[new RegExp("(quiz)zes$","gi"),"$1"],[new RegExp("s$","gi"),""]]),E(this,"nonTitlecasedWords",["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"]),E(this,"idSuffix",new RegExp("(_ids|_id)$","g")),E(this,"underbar",new RegExp("_","g")),E(this,"spaceOrUnderbar",new RegExp("[ _]","g")),E(this,"uppercase",new RegExp("([A-Z])","g")),E(this,"underbarPrefix",new RegExp("^_")),this.str=e,this.chain=n}return A(t,[{key:"get",value:function(){return this.str}},{key:"applyRules",value:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:null;return t=t||this.str,this.applyRules(t,this.pluralRules,this.uncountableWords,e)}},{key:"singularize",value:function(t,e){return t=t||this.str,this.applyRules(t,this.singularRules,this.uncountableWords,e)}},{key:"camelize",value:function(t,e){for(var n=(t=t||this.str).split("/"),r=0;r1&&void 0!==arguments[1]&&arguments[1];return t=t||this.str,t=this.underscore(this.demodulize(t))+(e?"":"_")+"id",this.str=t,!0===this.chain?this:t}},{key:"ordinalize",value:function(t){for(var e=(t=t||this.str).split(" "),n=0;n1&&void 0!==arguments[1]?arguments[1]:[];if(t.actions=Y(e)?e:[e],!Y(e))return e instanceof ct&&e.extend(t),t;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};T(this,t),this.resource=e,this.adapter=n||rt(),this.namespace=kt(e),this.storage=new Z,this.options=r,this.extendActions(r.actions)}return A(t,[{key:"extendActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Ot(this,t)}},{key:"deposit",value:function(t){return t}},{key:"serialize",value:function(t){return Dt("resource",Tt(this.resource),t,this.adapter)}},{key:"afterFetch",value:function(t){return function(t,e){if("function"==typeof t.options.onAfterFetch&&t.options.onAfterFetch(e),Y(e)){for(var n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=x(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.post("".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"update",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(function(){var i=x(regeneratorRuntime.mark((function i(a,o){var u;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,e.adapter.put("".concat(e.namespace,"/").concat(t),n,r).then(e.afterFetch.bind(e)).catch(o);case 2:u=i.sent,a(u);case 4:case"end":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}())}},{key:"findRecord",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=x(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.adapter.get("".concat(e.namespace,"/").concat(t),{},n).then(e.afterFetch.bind(e)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"findAll",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var n=x(regeneratorRuntime.mark((function n(r,i){var a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.adapter.get("".concat(t.namespace),{},e).then(t.afterFetch.bind(t)).catch(i);case 2:a=n.sent,r(a);case 4:case"end":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}())}},{key:"query",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=x(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get("".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"queryRecord",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.single=!0,new Promise(function(){var r=x(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get("".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"destroy",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=et(t)?t.getAttribute("id"):t;return new Promise(function(){var t=x(regeneratorRuntime.mark((function t(i,a){var o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.adapter.delete("".concat(e.namespace,"/").concat(r),{},n).then(e.afterFetch.bind(e)).catch(a);case 2:o=t.sent,i(o);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())}}]),t}();!function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(T(this,t),this.version=n.version||"v1",this.options={version:this.version,host:n.host||"https://api.fleetbase.io",namespace:this.version||n.namespace,debug:r,publicKey:e},"string"!=typeof e||0===e.length)throw new Error("⚠️ Invalid public key given to Fleetbase SDK");if(!nt()&&e.toLowerCase().startsWith("$"))throw new Error("Secret key provided. You must use a public key with Fleetbase Javascript SDK!");this.adapter=n.adapter||rt(this.options),this.orders=new St("order",this.adapter).extendActions(lt),this.entities=new St("entity",this.adapter),this.places=new St("place",this.adapter),this.drivers=new St("driver",this.adapter),this.vehicles=new St("vehicle",this.adapter),this.vendors=new St("vendor",this.adapter),this.contacts=new St("contact",this.adapter)}A(t,[{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return R(t,Array.prototype.slice.call(arguments))}}])}();var Pt=function(t){c(n,ht);var e=g(n);function n(){return a(this,n),e.apply(this,arguments)}return u(n,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new tr(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}}]),n}(),Rt=new ct({count:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};return t&&(n.store=t),this.adapter.get("".concat(this.namespace,"/count"),n,e)}}),Ut=function(t){c(n,Pt);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"review",i)}return u(n,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),n}(),Mt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nt()?Vn("adapter","NodeAdapter",t):Vn("adapter","BrowserAdapter",t)},jt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(t)};function qt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:n}).format(t)}var $t=function(t){return"string"==typeof t&&t.length>30&&(t.startsWith("store_")||t.startsWith("network_"))},Nt=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var n=i(t);if("object"===n){var r=t.size;if("number"==typeof r)return!r}if("number"==typeof t.length&&"function"!==n)return!t.length;if("object"===n){var a=t.length;if("number"==typeof a)return!a}return!1},Ht=function(t){c(n,Pt);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"product",i)}return u(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,n=t.sale_price,r=t.currency;return this.isOnSale?Nt(n)||Nt(r)?null:qt(n/100,r):Nt(e)||Nt(r)?null:qt(e/100,r)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(e){return new Z(e.map((function(e){return new Ut(e,t.adapter)})))}))}}]),n}(),Yt=function(t){c(n,Pt);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"category",i)}return u(n,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(e){return new Z(e.map((function(e){return new Ht(e,t.adapter)})))}))}}]),n}(),Lt=new ct({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(jt(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)}}),Ft=function(t){c(n,Pt);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,i,"customer",r({actions:Lt},o))}return u(n,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new tr(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:function(t){var e=this;return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",t).then((function(){return e}))}},{key:"getSavedPlaces",value:function(){var t=this;return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/places").then((function(e){return new Z(e.map((function(e){return new vt(e,t.adapter)})))}))}},{key:"getOrderHistory",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/orders",e).then((function(e){return new Z(e.map((function(e){return new dt(e,t.adapter)})))}))}}]),n}(),_t=Array.isArray,Wt=new ct({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,i=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({},i),{},{quantity:n}),a).then(this.afterFetch.bind(this))},update:function(t,e,n){var i=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({},i),{},{quantity:n}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},n).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)}}),zt=function(t){c(n,Pt);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,i,"cart",r({actions:Wt},o))}return u(n,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof Ht&&(t=t.id),this.store.add(this.id,t,e,n,r)}},{key:"update",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,n,r)}},{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!_t(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),n}();function It(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Qt(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function Bt(t){Qt(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function Gt(t,e){Qt(2,arguments);var n=Bt(t).getTime(),r=It(e);return new Date(n+r)}function Xt(t){var 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 Kt(t){return Qt(1,arguments),t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}function Jt(t){if(Qt(1,arguments),!Kt(t)&&"number"!=typeof t)return!1;var e=Bt(t);return!isNaN(Number(e))}var Zt={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"}},Vt=function(t,e,n){var r,i=Zt[t];return r="string"==typeof i?i:1===e?i.one:i.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function te(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var ee={date:te({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:te({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:te({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ne={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function re(t){return function(e,n){var r,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,o=i.width?String(i.width):a;r=t.formattingValues[o]||t.formattingValues[a]}else{var u=t.defaultWidth,s=i.width?String(i.width):t.defaultWidth;r=t.values[s]||t.values[u]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function ie(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],a=e.match(i);if(!a)return null;var o,u=a[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(s)?oe(s,(function(t){return t.test(u)})):ae(s,(function(t){return t.test(u)}));o=t.valueCallback?t.valueCallback(c):c,o=n.valueCallback?n.valueCallback(o):o;var h=e.slice(u.length);return{value:o,rest:h}}}function ae(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function oe(t,e){for(var n=0;n20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:re({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:re({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:re({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:re({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:re({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:(ue={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(ue.matchPattern);if(!n)return null;var r=n[0],i=t.match(ue.parsePattern);if(!i)return null;var a=ue.valueCallback?ue.valueCallback(i[0]):i[0];a=e.valueCallback?e.valueCallback(a):a;var o=t.slice(r.length);return{value:a,rest:o}}),era:ie({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:ie({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:function(t){return t+1}}),month:ie({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:ie({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:ie({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 ce(t,e){Qt(2,arguments);var n=It(e);return Gt(t,-n)}function he(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?n:1-n;return he("yy"===e?r%100:r,e.length)},M:function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):he(n+1,2)},d:function(t,e){return he(t.getUTCDate(),e.length)},a:function(t,e){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(t,e){return he(t.getUTCHours()%12||12,e.length)},H:function(t,e){return he(t.getUTCHours(),e.length)},m:function(t,e){return he(t.getUTCMinutes(),e.length)},s:function(t,e){return he(t.getUTCSeconds(),e.length)},S:function(t,e){var n=e.length,r=t.getUTCMilliseconds();return he(Math.floor(r*Math.pow(10,n-3)),e.length)}};function de(t){Qt(1,arguments);var e=1,n=Bt(t),r=n.getUTCDay(),i=(r=i.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function ve(t){Qt(1,arguments);var e=fe(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=de(n);return r}function ge(t){Qt(1,arguments);var e=Bt(t),n=de(e).getTime()-ve(e).getTime();return Math.round(n/6048e5)+1}function pe(t,e){Qt(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.weekStartsOn,a=null==i?0:It(i),o=null==n.weekStartsOn?a:It(n.weekStartsOn);if(!(o>=0&&o<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Bt(t),s=u.getUTCDay(),c=(s=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(r+1,0,s),c.setUTCHours(0,0,0,0);var h=pe(c,e),l=new Date(0);l.setUTCFullYear(r,0,s),l.setUTCHours(0,0,0,0);var d=pe(l,e);return n.getTime()>=h.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function me(t,e){Qt(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.firstWeekContainsDate,a=null==i?1:It(i),o=null==n.firstWeekContainsDate?a:It(n.firstWeekContainsDate),u=ye(t,e),s=new Date(0);s.setUTCFullYear(u,0,o),s.setUTCHours(0,0,0,0);var c=pe(s,e);return c}function we(t,e){Qt(1,arguments);var n=Bt(t),r=pe(n,e).getTime()-me(n,e).getTime();return Math.round(r/6048e5)+1}var be="midnight",ke="noon",xe="morning",Te="afternoon",Ce="evening",Ae="night",Ee={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return le.y(t,e)},Y:function(t,e,n,r){var i=ye(t,r),a=i>0?i:1-i;return"YY"===e?he(a%100,2):"Yo"===e?n.ordinalNumber(a,{unit:"year"}):he(a,e.length)},R:function(t,e){return he(fe(t),e.length)},u:function(t,e){return he(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return he(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return he(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return le.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return he(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var i=we(t,r);return"wo"===e?n.ordinalNumber(i,{unit:"week"}):he(i,e.length)},I:function(t,e,n){var r=ge(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):he(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):le.d(t,e)},D:function(t,e,n){var r=function(t){Qt(1,arguments);var e=Bt(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),i=n-r;return Math.floor(i/864e5)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):he(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return he(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return he(a,e.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),i=0===r?7:r;switch(e){case"i":return String(i);case"ii":return he(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,i=t.getUTCHours();switch(r=12===i?ke:0===i?be:i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,i=t.getUTCHours();switch(r=i>=17?Ce:i>=12?Te:i>=4?xe:Ae,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return le.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):le.H(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):he(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):he(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):le.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):le.s(t,e)},S:function(t,e){return le.S(t,e)},X:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return Oe(i);case"XXXX":case"XX":return Se(i);default:return Se(i,":")}},x:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return Oe(i);case"xxxx":case"xx":return Se(i);default:return Se(i,":")}},O:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+De(i,":");default:return"GMT"+Se(i,":")}},z:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+De(i,":");default:return"GMT"+Se(i,":")}},t:function(t,e,n,r){var i=r._originalDate||t;return he(Math.floor(i.getTime()/1e3),e.length)},T:function(t,e,n,r){return he((r._originalDate||t).getTime(),e.length)}};function De(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),a=r%60;if(0===a)return n+String(i);var o=e||"";return n+String(i)+o+he(a,2)}function Oe(t,e){return t%60==0?(t>0?"-":"+")+he(Math.abs(t)/60,2):Se(t,e)}function Se(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t);return r+he(Math.floor(i/60),2)+n+he(i%60,2)}var Pe=Ee;function Re(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"})}}function Ue(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"})}}var Me={p:Ue,P:function(t,e){var n,r=t.match(/(P+)(p+)?/),i=r[1],a=r[2];if(!a)return Re(t,e);switch(i){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",Re(i,e)).replace("{{time}}",Ue(a,e))}},je=Me,qe=["D","DD"],$e=["YY","YYYY"];function Ne(t){return-1!==qe.indexOf(t)}function He(t){return-1!==$e.indexOf(t)}function Ye(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var Le=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_e=/^'([^]*?)'?$/,We=/''/g,ze=/[a-zA-Z]/;function Ie(t,e,n){Qt(2,arguments);var r=String(e),i=n||{},a=i.locale||se,o=a.options&&a.options.firstWeekContainsDate,u=null==o?1:It(o),s=null==i.firstWeekContainsDate?u:It(i.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=a.options&&a.options.weekStartsOn,h=null==c?0:It(c),l=null==i.weekStartsOn?h:It(i.weekStartsOn);if(!(l>=0&&l<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var d=Bt(t);if(!Jt(d))throw new RangeError("Invalid time value");var f=Xt(d),v=ce(d,f),g={firstWeekContainsDate:s,weekStartsOn:l,locale:a,_originalDate:d},p=r.match(Fe).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,je[e])(t,a.formatLong,g):t})).join("").match(Le).map((function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return Qe(n);var o=Pe[r];if(o)return!i.useAdditionalWeekYearTokens&&He(n)&&Ye(n,e,t),!i.useAdditionalDayOfYearTokens&&Ne(n)&&Ye(n,e,t),o(v,n,a.localize,g);if(r.match(ze))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n})).join("");return p}function Qe(t){return t.match(_e)[1].replace(We,"'")}function Be(t,e){if(null==t)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e=e||{})Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function Ge(t,e,n){Qt(2,arguments);var r=n||{},i=r.locale,a=i&&i.options&&i.options.weekStartsOn,o=null==a?0:It(a),u=null==r.weekStartsOn?o:It(r.weekStartsOn);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=Bt(t),c=It(e),h=s.getUTCDay(),l=c%7,d=(l+7)%7,f=(d0,i=r?e:1-e;if(i<=50)n=t||100;else{var a=i+50;n=t+100*Math.floor(a/100)-(t>=a%100?100:0)}return r?n:1-n}var Dn=[31,28,31,30,31,30,31,31,30,31,30,31],On=[31,29,31,30,31,30,31,31,30,31,30,31];function Sn(t){return t%400==0||t%4==0&&t%100!=0}var Pn={G:{priority:140,parse:function(t,e,n,r){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}},set:function(t,e,n,r){return e.era=n,t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["R","u","t","T"]},y:{priority:130,parse:function(t,e,n,r){var i=function(t){return{year:t,isTwoDigitYear:"yy"===e}};switch(e){case"y":return Tn(4,t,i);case"yo":return n.ordinalNumber(t,{unit:"year",valueCallback:i});default:return Tn(e.length,t,i)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,r){var i=t.getUTCFullYear();if(n.isTwoDigitYear){var a=En(n.year,i);return t.setUTCFullYear(a,0,1),t.setUTCHours(0,0,0,0),t}var o="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(o,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","u","w","I","i","e","c","t","T"]},Y:{priority:130,parse:function(t,e,n,r){var i=function(t){return{year:t,isTwoDigitYear:"YY"===e}};switch(e){case"Y":return Tn(4,t,i);case"Yo":return n.ordinalNumber(t,{unit:"year",valueCallback:i});default:return Tn(e.length,t,i)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,r){var i=ye(t,r);if(n.isTwoDigitYear){var a=En(n.year,i);return t.setUTCFullYear(a,0,r.firstWeekContainsDate),t.setUTCHours(0,0,0,0),pe(t,r)}var o="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(o,0,r.firstWeekContainsDate),t.setUTCHours(0,0,0,0),pe(t,r)},incompatibleTokens:["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:{priority:130,parse:function(t,e,n,r){return Cn("R"===e?4:e.length,t)},set:function(t,e,n,r){var i=new Date(0);return i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0),de(i)},incompatibleTokens:["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:{priority:130,parse:function(t,e,n,r){return Cn("u"===e?4:e.length,t)},set:function(t,e,n,r){return t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["G","y","Y","R","w","I","i","e","c","t","T"]},Q:{priority:120,parse:function(t,e,n,r){switch(e){case"Q":case"QQ":return Tn(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,r){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:{priority:120,parse:function(t,e,n,r){switch(e){case"q":case"qq":return Tn(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,r){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:{priority:110,parse:function(t,e,n,r){var i=function(t){return t-1};switch(e){case"M":return bn(Xe,t,i);case"MM":return Tn(2,t,i);case"Mo":return n.ordinalNumber(t,{unit:"month",valueCallback:i});case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]},L:{priority:110,parse:function(t,e,n,r){var i=function(t){return t-1};switch(e){case"L":return bn(Xe,t,i);case"LL":return Tn(2,t,i);case"Lo":return n.ordinalNumber(t,{unit:"month",valueCallback:i});case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:{priority:100,parse:function(t,e,n,r){switch(e){case"w":return bn(Ze,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return Tn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,r){return pe(function(t,e,n){Qt(2,arguments);var r=Bt(t),i=It(e),a=we(r,n)-i;return r.setUTCDate(r.getUTCDate()-7*a),r}(t,n,r),r)},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:{priority:100,parse:function(t,e,n,r){switch(e){case"I":return bn(Ze,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return Tn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,r){return de(function(t,e){Qt(2,arguments);var n=Bt(t),r=It(e),i=ge(n)-r;return n.setUTCDate(n.getUTCDate()-7*i),n}(t,n,r),r)},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:{priority:90,subPriority:1,parse:function(t,e,n,r){switch(e){case"d":return bn(Ke,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return Tn(e.length,t)}},validate:function(t,e,n){var r=Sn(t.getUTCFullYear()),i=t.getUTCMonth();return r?e>=1&&e<=On[i]:e>=1&&e<=Dn[i]},set:function(t,e,n,r){return t.setUTCDate(n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:{priority:90,subPriority:1,parse:function(t,e,n,r){switch(e){case"D":case"DD":return bn(Je,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return Tn(e.length,t)}},validate:function(t,e,n){return Sn(t.getUTCFullYear())?e>=1&&e<=366:e>=1&&e<=365},set:function(t,e,n,r){return t.setUTCMonth(0,n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:{priority:90,parse:function(t,e,n,r){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=Ge(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["D","i","e","c","t","T"]},e:{priority:90,parse:function(t,e,n,r){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return Tn(e.length,t,i);case"eo":return n.ordinalNumber(t,{unit:"day",valueCallback:i});case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=Ge(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:{priority:90,parse:function(t,e,n,r){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return Tn(e.length,t,i);case"co":return n.ordinalNumber(t,{unit:"day",valueCallback:i});case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=Ge(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:{priority:90,parse:function(t,e,n,r){var i=function(t){return 0===t?7:t};switch(e){case"i":case"ii":return Tn(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return n.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiii":return n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiiii":return n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i});default:return n.day(t,{width:"wide",context:"formatting",valueCallback:i})||n.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i})}},validate:function(t,e,n){return e>=1&&e<=7},set:function(t,e,n,r){return t=function(t,e){Qt(2,arguments);var n=It(e);n%7==0&&(n-=7);var r=1,i=Bt(t),a=i.getUTCDay(),o=((n%7+7)%7=1&&e<=12},set:function(t,e,n,r){var i=t.getUTCHours()>=12;return i&&n<12?t.setUTCHours(n+12,0,0,0):i||12!==n?t.setUTCHours(n,0,0,0):t.setUTCHours(0,0,0,0),t},incompatibleTokens:["H","K","k","t","T"]},H:{priority:70,parse:function(t,e,n,r){switch(e){case"H":return bn(Ve,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return Tn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=23},set:function(t,e,n,r){return t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","K","k","t","T"]},K:{priority:70,parse:function(t,e,n,r){switch(e){case"K":return bn(en,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return Tn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.getUTCHours()>=12&&n<12?t.setUTCHours(n+12,0,0,0):t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","H","k","t","T"]},k:{priority:70,parse:function(t,e,n,r){switch(e){case"k":return bn(tn,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return Tn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=24},set:function(t,e,n,r){var i=n<=24?n%24:n;return t.setUTCHours(i,0,0,0),t},incompatibleTokens:["a","b","h","H","K","t","T"]},m:{priority:60,parse:function(t,e,n,r){switch(e){case"m":return bn(rn,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return Tn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,r){return t.setUTCMinutes(n,0,0),t},incompatibleTokens:["t","T"]},s:{priority:50,parse:function(t,e,n,r){switch(e){case"s":return bn(an,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return Tn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,r){return t.setUTCSeconds(n,0),t},incompatibleTokens:["t","T"]},S:{priority:30,parse:function(t,e,n,r){return Tn(e.length,t,(function(t){return Math.floor(t*Math.pow(10,3-e.length))}))},set:function(t,e,n,r){return t.setUTCMilliseconds(n),t},incompatibleTokens:["t","T"]},X:{priority:10,parse:function(t,e,n,r){switch(e){case"X":return kn(gn,t);case"XX":return kn(pn,t);case"XXXX":return kn(yn,t);case"XXXXX":return kn(wn,t);default:return kn(mn,t)}},set:function(t,e,n,r){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","x"]},x:{priority:10,parse:function(t,e,n,r){switch(e){case"x":return kn(gn,t);case"xx":return kn(pn,t);case"xxxx":return kn(yn,t);case"xxxxx":return kn(wn,t);default:return kn(mn,t)}},set:function(t,e,n,r){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","X"]},t:{priority:40,parse:function(t,e,n,r){return xn(t)},set:function(t,e,n,r){return[new Date(1e3*n),{timestampIsSet:!0}]},incompatibleTokens:"*"},T:{priority:20,parse:function(t,e,n,r){return xn(t)},set:function(t,e,n,r){return[new Date(n),{timestampIsSet:!0}]},incompatibleTokens:"*"}},Rn=Pn,Un=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Mn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,jn=/^'([^]*?)'?$/,qn=/''/g,$n=/\S/,Nn=/[a-zA-Z]/;function Hn(t,e,n,r){Qt(3,arguments);var i=String(t),a=String(e),o=r||{},u=o.locale||se;if(!u.match)throw new RangeError("locale must contain match property");var s=u.options&&u.options.firstWeekContainsDate,c=null==s?1:It(s),h=null==o.firstWeekContainsDate?c:It(o.firstWeekContainsDate);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var l=u.options&&u.options.weekStartsOn,d=null==l?0:It(l),f=null==o.weekStartsOn?d:It(o.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===a)return""===i?Bt(n):new Date(NaN);var v,g={firstWeekContainsDate:h,weekStartsOn:f,locale:u},p=[{priority:10,subPriority:-1,set:Yn,index:0}],y=a.match(Mn).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,je[e])(t,u.formatLong,g):t})).join("").match(Un),m=[];for(v=0;v0&&$n.test(i))return new Date(NaN);var D=p.map((function(t){return t.priority})).sort((function(t,e){return e-t})).filter((function(t,e,n){return n.indexOf(t)===e})).map((function(t){return p.filter((function(e){return e.priority===t})).sort((function(t,e){return e.subPriority-t.subPriority}))})).map((function(t){return t[0]})),O=Bt(n);if(isNaN(O))return new Date(NaN);var S=ce(O,Xt(O)),P={};for(v=0;v0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"store-hour",i)}return u(n,[{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,n=Math.abs(t-e);return Math.floor(n/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 Hn(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 Hn(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return Jt(this.startDateInstance)&&Jt(this.endDateInstance)?"".concat(Ie(this.startDateInstance,"p")," - ").concat(Ie(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!")}}]),n}(),_n=function(t){c(n,Pt);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"store-location",i)}return u(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 Z(this.getAttribute("hours").map((function(t){return new Fn(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=Ie(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},e=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"payment-gateway",i)}return u(n,[{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!")}}]),n}(),zn=function(t){c(n,Pt);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"store",i)}return u(n,[{key:"getReviews",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",r({store:this.id},e)).then((function(e){return new Z(e.map((function(e){return new Ut(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",r({store:this.id},e)).then((function(e){return new Z(e.map((function(e){return e.place&&(e.place=new vt(e.place)),new _n(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 _n(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 Z(e.map((function(e){return new Wn(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new Wn(t,e.adapter)}))}}]),n}(),In=function(t){c(n,Pt);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"network",i)}return u(n,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getStores",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("stores",e).then((function(e){return new Z(e.map((function(e){return new zn(e,t.adapter)})))}))}},{key:"getStoreLocations",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("store-locations",e).then((function(e){return new Z(e.map((function(e){return new _n(e,t.adapter)})))}))}},{key:"getPaymentGateways",value:function(){var t=this;return this.adapter.get("gateways").then((function(e){return new Z(e.map((function(e){return new Wn(e,t.adapter)})))}))}}]),n}(),Qn=Array.isArray,Bn=function(t){c(n,gt);var e=g(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),r instanceof pt?v(t,t=e.call(this,{},r,"service-quote",o)):e.call(this,r,i,"service-quote",o)}return u(n,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new tr(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,n=t.currency;return Nt(e)||Nt(n)?null:qt(e/100,n)}},{key:"fromCart",value:function(t,e,r){var i,a,o,u=this,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"storefront",c=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return null!==(i=t)&&void 0!==i&&i.id&&(t=t.id),null!==(a=e)&&void 0!==a&&a.id&&(e=e.id),null!==(o=r)&&void 0!==o&&o.id&&(r=r.id),this.adapter.get("service-quotes/from-cart",{origin:t,destination:e,cart:r,config:s,all:c}).then((function(t){return Qn(t)?new Z(t.map((function(t){return new n(t,u.adapter)}))):new n(t,u.adapter)}))}}],[{key:"getFromCart",value:function(t){for(var e=new n(t),r=arguments.length,i=new Array(r>1?r-1:0),a=1;a4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return et(t)&&(t=t.id),et(e)&&(e=e.id),et(n)&&(n=n.id),et(i)&&(i=i.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),r(r({},a),{},{customer:t,cart:e,serviceQuote:n,gateway:i}),o)},captureOrder:function(t){var e=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:e},n).then((function(t){return new dt(t)}))}}),Xn=function(t){c(n,Pt);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"checkout",i)}return u(n,[{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)}}]),n}(),Kn={Product:Ht,Category:Yt,Customer:Ft,Cart:zt,DeliveryServiceQuote:Bn,Store:zn,StoreLocation:_n,StoreHour:Fn,Checkout:Xn,Review:Ut},Jn={BrowserAdapter:yt,NodeAdapter:mt},Zn=function(){function t(){return a(this,t),this.resources=Kn,this.adapters=Jn,this.lookup.apply(this,arguments)}return u(t,[{key:"lookup",value:function(t,e){var n=kt(t),r=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][e])throw new Error("No ".concat(xt(t)," named ").concat(e," to resolve"));return f(this[n][e],p(r))}}]),t}(),Vn=function(){return f(Zn,Array.prototype.slice.call(arguments))},tr=function(t){c(n,St);var e=g(n);function n(){return a(this,n),e.apply(this,arguments)}return u(n,[{key:"extendActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Ot(this,t)}},{key:"serialize",value:function(t){return Vn("resource",Tt(this.resource),t,this.adapter)}}]),n}(),er=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(a(this,t),this.version=n.version||"v1",this.options={version:this.version,host:n.host||"https://api.fleetbase.io",namespace:"storefront/".concat(this.version)||n.namespace,publicKey:e,debug:r},!$t(e))throw new Error("⚠️ Invalid Storefront key given to Storefront SDK");this.adapter=n.adapter||Mt(this.options),this.products=new tr("product",this.adapter),this.categories=new tr("category",this.adapter),this.reviews=new tr("review",this.adapter).extendActions(Rt),this.customers=new tr("customer",this.adapter).extendActions(Lt),this.cart=new tr("cart",this.adapter).extendActions(Wt),this.checkout=new tr("checkout",this.adapter).extendActions(Gn)}return u(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",r({query:t},e)).then((function(t){return new Z(t.map((function(t){return new Ht(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return f(t,Array.prototype.slice.call(arguments))}}]),t}();exports.Cart=zt,exports.Category=Yt,exports.Checkout=Xn,exports.Customer=Ft,exports.DeliveryServiceQuote=Bn,exports.Network=In,exports.PaymentGateway=Wn,exports.Product=Ht,exports.Review=Ut,exports.Store=zn,exports.StoreHour=Fn,exports.StoreLocation=_n,exports.default=er; +'use strict'; +function t(t) { + return t && 'object' == typeof t && 'default' in t ? t : { default: t }; +} +Object.defineProperty(exports, '__esModule', { value: !0 }); +var e = t(require('axios')); +function n(t, e) { + var n = Object.keys(t); + if (Object.getOwnPropertySymbols) { + var r = Object.getOwnPropertySymbols(t); + e && + (r = r.filter(function (e) { + return Object.getOwnPropertyDescriptor(t, e).enumerable; + })), + n.push.apply(n, r); + } + return n; +} +function r(t) { + for (var e = 1; e < arguments.length; e++) { + var r = null != arguments[e] ? arguments[e] : {}; + e % 2 + ? n(Object(r), !0).forEach(function (e) { + s(t, e, r[e]); + }) + : Object.getOwnPropertyDescriptors + ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) + : n(Object(r)).forEach(function (e) { + Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e)); + }); + } + return t; +} +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 a(t, e) { + if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function'); +} +function o(t, e) { + for (var n = 0; n < e.length; n++) { + var r = e[n]; + (r.enumerable = r.enumerable || !1), (r.configurable = !0), 'value' in r && (r.writable = !0), Object.defineProperty(t, r.key, r); + } +} +function u(t, e, n) { + return e && o(t.prototype, e), n && o(t, n), t; +} +function s(t, e, n) { + return ( + e in t + ? Object.defineProperty(t, e, { + value: n, + enumerable: !0, + configurable: !0, + writable: !0, + }) + : (t[e] = n), + t + ); +} +function c(t, e) { + if ('function' != typeof e && null !== e) throw new TypeError('Super expression must either be null or a function'); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && l(t, e); +} +function h(t) { + return ( + (h = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + }), + h(t) + ); +} +function l(t, e) { + return ( + (l = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + }), + l(t, e) + ); +} +function d() { + if ('undefined' == typeof Reflect || !Reflect.construct) return !1; + if (Reflect.construct.sham) return !1; + if ('function' == typeof Proxy) return !0; + try { + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0; + } catch (t) { + return !1; + } +} +function f(t, e, n) { + return ( + (f = d() + ? Reflect.construct + : function (t, e, n) { + var r = [null]; + r.push.apply(r, e); + var i = new (Function.bind.apply(t, r))(); + return n && l(i, n.prototype), i; + }), + f.apply(null, arguments) + ); +} +function v(t, e) { + if (e && ('object' == typeof e || 'function' == typeof e)) return e; + if (void 0 !== e) throw new TypeError('Derived constructors may only return object or undefined'); + return (function (t) { + if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return t; + })(t); +} +function g(t) { + var e = d(); + return function () { + var n, + r = h(t); + if (e) { + var i = h(this).constructor; + n = Reflect.construct(r, arguments, i); + } else n = r.apply(this, arguments); + return v(this, n); + }; +} +function p(t) { + return ( + (function (t) { + if (Array.isArray(t)) return y(t); + })(t) || + (function (t) { + if (('undefined' != typeof Symbol && null != t[Symbol.iterator]) || null != t['@@iterator']) return Array.from(t); + })(t) || + (function (t, e) { + if (!t) return; + if ('string' == typeof t) return y(t, e); + var n = Object.prototype.toString.call(t).slice(8, -1); + 'Object' === n && t.constructor && (n = t.constructor.name); + if ('Map' === n || 'Set' === n) return Array.from(t); + if ('Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return y(t, e); + })(t) || + (function () { + throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); + })() + ); +} +function y(t, e) { + (null == e || e > t.length) && (e = t.length); + for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; + return r; +} +function m(t, e) { + var n = Object.keys(t); + if (Object.getOwnPropertySymbols) { + var r = Object.getOwnPropertySymbols(t); + e && + (r = r.filter(function (e) { + return Object.getOwnPropertyDescriptor(t, e).enumerable; + })), + n.push.apply(n, r); + } + return n; +} +function w(t) { + for (var e = 1; e < arguments.length; e++) { + var n = null != arguments[e] ? arguments[e] : {}; + e % 2 + ? m(Object(n), !0).forEach(function (e) { + E(t, e, n[e]); + }) + : Object.getOwnPropertyDescriptors + ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) + : m(Object(n)).forEach(function (e) { + Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e)); + }); + } + return t; +} +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; + })(t); +} +function k(t, e, n, r, i, a, o) { + try { + var u = t[a](o), + s = u.value; + } catch (t) { + return void n(t); + } + u.done ? e(s) : Promise.resolve(s).then(r, i); +} +function x(t) { + return function () { + var e = this, + n = arguments; + return new Promise(function (r, i) { + var a = t.apply(e, n); + function o(t) { + k(a, r, i, o, u, 'next', t); + } + function u(t) { + k(a, r, i, o, u, 'throw', t); + } + o(void 0); + }); + }; +} +function T(t, e) { + if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function'); +} +function C(t, e) { + for (var n = 0; n < e.length; n++) { + var r = e[n]; + (r.enumerable = r.enumerable || !1), (r.configurable = !0), 'value' in r && (r.writable = !0), Object.defineProperty(t, r.key, r); + } +} +function A(t, e, n) { + return e && C(t.prototype, e), n && C(t, n), t; +} +function E(t, e, n) { + return ( + e in t + ? Object.defineProperty(t, e, { + value: n, + enumerable: !0, + configurable: !0, + writable: !0, + }) + : (t[e] = n), + t + ); +} +function D(t, e) { + if ('function' != typeof e && null !== e) throw new TypeError('Super expression must either be null or a function'); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && S(t, e); +} +function O(t) { + return (O = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + })(t); +} +function S(t, e) { + return (S = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + })(t, e); +} +function P() { + if ('undefined' == typeof Reflect || !Reflect.construct) return !1; + if (Reflect.construct.sham) return !1; + if ('function' == typeof Proxy) return !0; + try { + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0; + } catch (t) { + return !1; + } +} +function R(t, e, n) { + return (R = P() + ? Reflect.construct + : function (t, e, n) { + var r = [null]; + r.push.apply(r, e); + var i = new (Function.bind.apply(t, r))(); + return n && S(i, n.prototype), i; + }).apply(null, arguments); +} +function U(t) { + var e = 'function' == typeof Map ? new Map() : void 0; + return (U = function (t) { + if (null === t || ((n = t), -1 === Function.toString.call(n).indexOf('[native code]'))) return t; + var n; + if ('function' != typeof t) throw new TypeError('Super expression must either be null or a function'); + if (void 0 !== e) { + if (e.has(t)) return e.get(t); + e.set(t, r); + } + function r() { + return R(t, arguments, O(this).constructor); + } + return ( + (r.prototype = Object.create(t.prototype, { + constructor: { + value: r, + enumerable: !1, + writable: !0, + configurable: !0, + }, + })), + S(r, t) + ); + })(t); +} +function M(t, e) { + return !e || ('object' != typeof e && 'function' != typeof e) + ? (function (t) { + if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return t; + })(t) + : e; +} +function j(t) { + var e = P(); + return function () { + var n, + r = O(t); + if (e) { + var i = O(this).constructor; + n = Reflect.construct(r, arguments, i); + } else n = r.apply(this, arguments); + return M(this, n); + }; +} +function q(t, e) { + return ( + (function (t) { + if (Array.isArray(t)) return t; + })(t) || + (function (t, e) { + var n = null == t ? null : ('undefined' != typeof Symbol && t[Symbol.iterator]) || t['@@iterator']; + if (null != n) { + var r, + i, + a = [], + o = !0, + u = !1; + try { + for (n = n.call(t); !(o = (r = n.next()).done) && (a.push(r.value), !e || a.length !== e); o = !0); + } catch (t) { + (u = !0), (i = t); + } finally { + try { + o || null == n.return || n.return(); + } finally { + if (u) throw i; + } + } + return a; + } + })(t, e) || + N(t, e) || + (function () { + throw new TypeError('Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); + })() + ); +} +function $(t) { + return ( + (function (t) { + if (Array.isArray(t)) return H(t); + })(t) || + (function (t) { + if (('undefined' != typeof Symbol && null != t[Symbol.iterator]) || null != t['@@iterator']) return Array.from(t); + })(t) || + N(t) || + (function () { + throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); + })() + ); +} +function N(t, e) { + if (t) { + if ('string' == typeof t) return H(t, e); + var n = Object.prototype.toString.call(t).slice(8, -1); + return ( + 'Object' === n && t.constructor && (n = t.constructor.name), + 'Map' === n || 'Set' === n ? Array.from(t) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? H(t, e) : void 0 + ); + } +} +function H(t, e) { + (null == e || e > t.length) && (e = t.length); + for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; + return r; +} +var Y = Array.isArray, + L = 'undefined' == typeof arguments ? void 0 : arguments, + F = function (t, e, n) { + var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : []; + if (Y(t)) + if (r.length <= 6e4) t.splice.apply(t, [e, n].concat($(r))); + else { + t.splice(e, n); + for (var i = 0; i < r.length; i += 6e4) { + var a = r.slice(i, i + 6e4); + t.splice.apply(t, [e + i, 0].concat($(a))); + } + } + else W(arr) && t.replace(e, n, r); + }, + _ = function (t) { + return t; + }, + W = function (t) { + return t instanceof Z; + }, + z = function (t, e) { + return Y(t) ? t[e] : W(t) ? t.objectAt(e) : null; + }, + I = function (t, e) { + return 2 === L.length + ? function (n) { + return e === n[t]; + } + : function (e) { + return Boolean(e[t]); + }; + }, + Q = function (t, e) { + for (var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, r = t.length, i = n; i < r; i++) { + var a = z(t, i); + if (e(a, i, t)) return i; + } + return -1; + }, + B = function (t, e, n) { + var r = e.bind(n), + i = Q(t, r, 0); + return -1 === i ? void 0 : z(t, i); + }, + G = function (t, e, n) { + var r = e.bind(n); + return -1 !== Q(t, r, 0); + }, + X = function (t, e, n) { + var r = e.bind(n); + return ( + -1 === + Q( + t, + function (t, e, n) { + return !r(t, e, n); + }, + 0 + ) + ); + }, + K = function (t, e) { + var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, + r = arguments.length > 3 ? arguments[3] : void 0, + i = t.length; + n < 0 && (n += i); + var a = + r && e != e + ? function (t) { + return t != t; + } + : function (t) { + return t === e; + }; + return Q(t, a, n); + }, + J = function (t, e, n) { + return F(t, e, 0, [n]), n; + }, + Z = (function (t) { + D(n, U(Array)); + var e = j(n); + function n() { + for (var t = arguments.length, r = new Array(t), i = 0; i < t; i++) r[i] = arguments[i]; + return T(this, n), M(Y(arguments[0]) ? e.call.apply(e, [this].concat($(arguments[0]))) : e.apply(this, arguments)); + } + return ( + A(n, [ + { + key: 'notEmpty', + get: function () { + return this.length > 0; + }, + }, + { + key: 'empty', + get: function () { + return 0 === this.length; + }, + }, + { + key: 'first', + get: function () { + return z(this, 0); + }, + }, + { + key: 'last', + get: function () { + return z(this, this.length - 1); + }, + }, + { + key: 'replace', + value: function (t, e) { + var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : []; + return F(this, t, e, n), this; + }, + }, + { + key: 'objectsAt', + value: function (t) { + var e = this; + return t.map(function (t) { + return z(e, t); + }); + }, + }, + { + key: 'objectAt', + value: function (t) { + return z(this, t); + }, + }, + { + key: 'indexOf', + value: function (t, e) { + return K(this, t, e, !1); + }, + }, + { + key: 'lastIndexOf', + value: function (t, e) { + var n = this.length; + (void 0 === e || e >= n) && (e = n - 1), e < 0 && (e += n); + for (var r = e; r >= 0; r--) if (z(this, r) === t) return r; + return -1; + }, + }, + { + key: 'includes', + value: function (t, e) { + return -1 !== K(this, t, e, !0); + }, + }, + { + key: 'findBy', + value: function () { + return B(this, I.apply(void 0, arguments)); + }, + }, + { + key: 'findIndexBy', + value: function () { + return Q(this, I.apply(void 0, arguments)); + }, + }, + { + key: 'isEvery', + value: function () { + return X(this, I.apply(void 0, arguments)); + }, + }, + { + key: 'isAny', + value: function () { + return G(this, I.apply(void 0, arguments)); + }, + }, + { + key: 'invoke', + value: function (t) { + for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) n[r - 1] = arguments[r]; + var i = []; + return ( + this.forEach(function (e) { + var r; + return i.push(null === (r = e[t]) || void 0 === r ? void 0 : r.call.apply(r, [e].concat(n))); + }), + i + ); + }, + }, + { + key: 'toArray', + value: function () { + return this.map(function (t) { + return t; + }); + }, + }, + { + key: 'compact', + value: function () { + return this.filter(function (t) { + return null != t; + }); + }, + }, + { + key: 'sortBy', + value: function () { + var t = arguments; + return this.sort(function (e, n) { + for (var r = 0; r < t.length; r++) { + var i = t[r], + a = e[i], + o = n[i], + u = compare(a, o); + if (u) return u; + } + return 0; + }); + }, + }, + { + key: 'uniqBy', + value: function (t) { + return (function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : _, + n = [], + r = new Set(), + i = + 'function' == typeof e + ? e + : function (t) { + return get(t, e); + }; + return ( + t.forEach(function (t) { + var e = i(t); + r.has(e) || (r.add(e), n.push(t)); + }), + n + ); + })(this, t); + }, + }, + { + key: 'without', + value: function (t) { + if (!this.includes(t)) return this; + var e = + t == t + ? function (e) { + return e !== t; + } + : function (t) { + return t == t; + }; + return this.filter(e); + }, + }, + { + key: 'clear', + value: function () { + var t = this.length; + return 0 === t || this.replace(0, t, []), this; + }, + }, + { + key: 'insertAt', + value: function (t, e) { + return J(this, t, e), this; + }, + }, + { + key: 'replaceAt', + value: function (t, e) { + return this.replace(t, 1, [e]); + }, + }, + { + key: 'removeAt', + value: function (t, e) { + return (function (t, e) { + return F(t, e, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, []), t; + })(this, t, e); + }, + }, + { + key: 'pushObject', + value: function (t) { + return this.insertAt(this.length, t); + }, + }, + { + key: 'pushObjects', + value: function (t) { + return this.replace(this.length, 0, t), this; + }, + }, + { + key: 'popObject', + value: function () { + var t = this.length; + if (0 === t) return null; + var e = z(this, t - 1); + return this.removeAt(t - 1, 1), e; + }, + }, + { + key: 'shiftObject', + value: function () { + if (0 === this.length) return null; + var t = z(this, 0); + return this.removeAt(0), t; + }, + }, + { + key: 'unshiftObject', + value: function (t) { + return J(this, 0, t); + }, + }, + { + key: 'unshiftObjects', + value: function (t) { + return this.replace(0, 0, t), this; + }, + }, + { + key: 'reverseObjects', + value: function () { + var t = this.length; + if (0 === t) return this; + var e = this.toArray().reverse(); + return this.replace(0, t, e), this; + }, + }, + { + key: 'setObjects', + value: function (t) { + if (0 === t.length) return this.clear(); + var e = this.length; + return this.replace(0, e, t), this; + }, + }, + { + key: 'removeObject', + value: function (t) { + for (var e = this.length || 0; --e >= 0; ) z(this, e) === t && this.removeAt(e); + return this; + }, + }, + { + key: 'removeObjects', + value: function (t) { + for (var e = t.length - 1; e >= 0; e--) this.removeObject(t[e]); + return this; + }, + }, + { + key: 'addObject', + value: function (t) { + return this.includes(t) || this.pushObject(t), this; + }, + }, + { + key: 'addObjects', + value: function (t) { + var e = this; + return ( + t.forEach(function (t) { + return e.addObject(t); + }), + this + ); + }, + }, + ]), + n + ); + })(), + V = function (t) { + var e = null == t; + if (e) return e; + if ('number' == typeof t.size) return !t.size; + var n = b(t); + if ('object' === n) { + var r = t.size; + if ('number' == typeof r) return !r; + } + if ('number' == typeof t.length && 'function' !== n) return !t.length; + if ('object' === n) { + var i = t.length; + if ('number' == typeof i) return !i; + } + return !1; + }, + tt = function (t) { + return V(t) || ('string' == typeof t && !1 === /\S/.test(t)); + }; +function et(t) { + return t instanceof ht; +} +var nt = function () { + var t, e, n, r, i; + return !( + 'undefined' == typeof process || + ('object' !== b(null === (t = process) || void 0 === t ? void 0 : t.env) && + -1 === (null === (e = process.release) || void 0 === e || null === (n = e.name) || void 0 === n ? void 0 : n.search(/node|io.js/))) || + ('undefined' != typeof window && 'ReactNative' !== (null === (r = window) || void 0 === r || null === (i = r.navigator) || void 0 === i ? void 0 : i.product)) + ); + }, + rt = function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return nt() ? Dt('adapter', 'NodeAdapter', t) : Dt('adapter', 'BrowserAdapter', t); + }, + it = Array.isArray; +!(function () { + function t(e) { + T(this, t), (this.place = e), (this.geometry = null == e ? void 0 : e.geometry), (this.components = this.parseComponents()), (this.attributes = this.parseProperties()); + } + A(t, [ + { + key: 'parse', + value: function () { + this.parseComponents(), this.parseProperties(); + }, + }, + { + key: 'parseComponents', + value: function () { + var t; + return ((null === (t = this.place) || void 0 === t ? void 0 : t.address_components) || []).reduce(function (t, e) { + return ( + e.types.forEach(function (n) { + t[n] = e; + }), + t + ); + }, {}); + }, + }, + { + key: 'parseProperties', + value: function () { + var t, + e = { + streetNumber: this.get('street_number'), + streetName: this.get('route'), + coordinates: null !== (t = this.geometry) && void 0 !== t && t.location ? Object.values(this.geometry.location) : [0, 0], + city: this.or(['locality', 'sublocality', 'sublocality_level_1', 'neighborhood', 'administrative_area_level_3', 'administrative_area_level_2']), + county: this.get('administrative_area_level_2'), + stateShort: this.get('administrative_area_level_1', !0), + stateLong: this.get('administrative_area_level_1'), + countryShort: this.get('country', !0), + country: this.get('country', !0), + countryLong: this.get('country'), + postalCode: this.get('postal_code'), + }; + return (e.address = [e.streetNumber, e.streetName].filter(Boolean).join(' ')), e; + }, + }, + { + key: 'all', + value: function () { + return this.attributes; + }, + }, + { + key: 'or', + value: function () { + for (var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], e = 0; e < t.length; e++) { + var n = t[e]; + if (it(n)) { + var r = n[0], + i = n[1]; + if (this.has(r)) return this.get(r, i); + } else if (this.has(n)) return this.get(n); + } + return null; + }, + }, + { + key: 'has', + value: function (t) { + return t in this.components; + }, + }, + { + key: 'get', + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; + return t in this.components ? (e ? this.components[t].short_name : this.components[t].long_name) : null; + }, + }, + { + key: 'setAttributes', + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return (this.attributes = w(w({}, this.attributes), t)), this; + }, + }, + { + key: 'setAttribute', + value: function (t, e) { + return (this.attributes[t] = e), this; + }, + }, + { + key: 'getAttribute', + value: function (t) { + return this.attributes[t] || null; + }, + }, + ]); +})(); +var at = (function () { + function t() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, + n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; + T(this, t), (this.type = 'Point'), (this.coordinates = [n, e]); + } + return ( + A( + t, + [ + { + key: 'latitude', + get: function () { + return this.coordinates[1]; + }, + }, + { + key: 'longitude', + get: function () { + return this.coordinates[0]; + }, + }, + { + key: 'lat', + value: function () { + return this.latitude; + }, + }, + { + key: 'lng', + value: function () { + return this.longitude; + }, + }, + { + key: 'serialize', + value: function () { + return { type: 'Point', coorindates: [this.lat(), this.lng()] }; + }, + }, + { + key: 'toJson', + value: function () { + return this.serialize(); + }, + }, + { + key: 'toString', + value: function () { + return '('.concat(this.latitude, ', ').concat(this.longitude, ')'); + }, + }, + ], + [ + { + key: 'fromGeoJson', + value: function (e) { + var n = q(e.coordinates, 2); + return (longitude = n[0]), (latitude = n[1]), new t(latitude, longitude); + }, + }, + ] + ), + t + ); +})(); +'undefined' == typeof arguments || arguments; +var ot = function (t, e) { + var n = t(); + return Array.isArray(n) || 'object' === b(n) ? ut(n, e) : null; + }, + ut = function t(e, n) { + var r, + i = e, + a = b(e), + o = 'object' === a, + u = 'function' === a, + s = Array.isArray(e), + c = 'string' === b(n) && n.includes('.') ? n.split('.') : [n]; + if (s || o) { + for (var h = 0; h < c.length; h++) { + if (i && void 0 === i[c[h]]) return null; + if (i) { + if ('object' === b((r = i = i[c[h]])) && !V(null == r ? void 0 : r.attributes) && 'object' === b(null == r ? void 0 : r.attributes) && void 0 !== c[h + 1]) { + var l = c.slice(h + 1).join('.'); + return t(i.attributes, l); + } + if ('function' == typeof i) { + var d = c.slice(h + 1).join('.'); + return ot(i, d); + } + } + } + return i; + } + if (u) return ot(e, n); + }, + st = function (t, e, n) { + var r = t, + i = 'object' === b(t), + a = Array.isArray(t), + o = 'string' === b(e) && e.includes('.') ? e.split('.') : [e], + u = o.length; + if (a || i) { + for (var s = 0; s < u - 1; s++) r[o[s]] || (r[o[s]] = {}), (r = r[o[s]]); + r[o[u - 1]] = n; + } + return n; + }, + ct = (function () { + function t() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; + T(this, t), (this.actions = e), (this.bind = n); + } + return ( + A(t, [ + { + key: 'extend', + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null, + e = t || this.bind; + if (!e) return this; + if (null != this && this.actions && 'object' === b(this.actions)) + for (var n in this.actions) { + var r = this.actions[n]; + st(e, n, 'function' == typeof r ? r.bind(e) : r); + } + return this; + }, + }, + ]), + t + ); + })(), + ht = (function () { + function t() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = arguments.length > 1 ? arguments[1] : void 0, + r = arguments.length > 2 ? arguments[2] : void 0, + i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; + T(this, t), + (this.attributes = e), + (this.dirtyAttributes = {}), + (this.changes = {}), + (this.isLoading = !1), + (this.isSaving = !1), + (this.isDestroying = !1), + (this.isReloading = !1), + (this.resource = r), + (this.options = i), + (this.version = i.version || 'v1'), + this.setAdapter(n); + } + return ( + A(t, [ + { + key: 'setAdapter', + value: function (t) { + var e; + return ( + (this.adapter = t), + (this.store = new St(this.resource, t, { + onAfterFetch: this.syncAttributes.bind(this), + actions: null === (e = this.options) || void 0 === e ? void 0 : e.actions, + })), + this + ); + }, + }, + { + key: 'id', + get: function () { + return this.getAttribute('id'); + }, + }, + { + key: 'create', + value: function () { + var t = this, + e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = this.mergeAttributes(e); + return ( + this.setFlags(['isLoading', 'isSaving']), + this.store.create(n).then(function (e) { + return t.setFlags(['isLoading', 'isSaving'], !1), e; + }) + ); + }, + }, + { + key: 'update', + value: function () { + var t = this, + e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return ( + this.setFlags(['isLoading', 'isSaving']), + this.store.update(this.attributes.id, e).then(function (e) { + return t.setFlags(['isLoading', 'isSaving'], !1), e; + }) + ); + }, + }, + { + key: 'destroy', + value: function () { + var t = this; + return ( + this.setFlags(['isLoading', 'isDestroying']), + this.store.destroy(this.attributes.id).then(function (e) { + return t.setFlags(['isLoading', 'isDestroying'], !1), e; + }) + ); + }, + }, + { + key: 'reload', + value: function () { + var t = this; + return ( + this.setFlags(['isLoading', 'isReloading']), + this.store.findRecord(this.attributes.id).then(function (e) { + return t.reset(), e; + }) + ); + }, + }, + { + key: 'setFlags', + value: function () { + for ( + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], + e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], + n = ['isLoading', 'isSaving', 'isReloading', 'isDestroying'], + r = 0; + r < t.length; + r++ + ) { + var i = t[r]; + if ('string' != typeof i || !n.includes(i)) throw new Error(''.concat(i, ' is not a valid flag!')); + this[i] = e; + } + return this; + }, + }, + { + key: 'reset', + value: function () { + return (this.dirtyAttributes = {}), (this.changes = {}), (this.isLoading = !1), (this.isSaving = !1), (this.isReloading = !1), this; + }, + }, + { + key: 'empty', + value: function () { + return this.reset(), (this.attribues = {}), this; + }, + }, + { + key: 'save', + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + e = this.getAttributes(); + return V(this.id) ? this.create(e) : !0 === t.onlyDirty ? this.savedirty() : this.update(e); + }, + }, + { + key: 'saveDirty', + value: function () { + for (var t = Object.keys(this.dirtyAttributes), e = {}, n = 0; n < t.length; n++) { + var r = t[n]; + e[r] = this.getAttribute(r); + } + return this.update(e); + }, + }, + { + key: 'createdAt', + get: function () { + return this.hasAttribute('created_at') ? new Date(this.getAttribute('created_at')) : null; + }, + }, + { + key: 'updatedAt', + get: function () { + return this.hasAttribute('updated_at') ? new Date(this.getAttribute('updated_at')) : null; + }, + }, + { + key: 'isLoaded', + get: function () { + return this.hasAttributes(['created_at', 'id']); + }, + }, + { + key: 'isEmpty', + get: function () { + return 0 === Object.values(null == this ? void 0 : this.attributes).length; + }, + }, + { + key: 'isNew', + get: function () { + return !this.id; + }, + }, + { + key: 'isSaved', + get: function () { + return !this.isNew && this.isLoaded; + }, + }, + { + key: 'isDeleted', + get: function () { + return this.hasAttributes(['deleted', 'time']); + }, + }, + { + key: 'eachAttribute', + value: function (t) { + var e, + n = this; + return ( + 'function' != typeof t || + Object.keys(null !== (e = null == this ? void 0 : this.attributes) && void 0 !== e ? e : {}).forEach(function (e) { + var r = n.getAttribute(e); + t.call(n, r, e); + }), + this + ); + }, + }, + { + key: 'changes', + value: function () { + return this.changes; + }, + }, + { + key: 'getDirtyAttributes', + value: function () { + return this.dirtyAttributes; + }, + }, + { + key: 'isDirty', + value: function (t) { + return t in this.dirtyAttributes; + }, + }, + { + key: 'hasDirtyAttributes', + value: function () { + var t; + return Object.keys(null !== (t = null == this ? void 0 : this.dirtyAttributes) && void 0 !== t ? t : {}).length > 0; + }, + }, + { + key: 'mutate', + value: function (t, e) { + this.attributes[t] = e; + }, + }, + { + key: 'setAttribute', + value: function (t) { + var e, + n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; + if (null === n && 'object' === b(t)) return this.setAttributes(t); + var r = null !== (e = null == this ? void 0 : this.attributes[t]) && void 0 !== e ? e : null; + return ( + st(this.attributes, t, n), + st(this.dirtyAttributes, t, r), + Y(null == this ? void 0 : this.changes[t]) || (this.changes[t] = []), + this.changes[t].push({ + property: t, + previousValue: r, + value: n, + changedAt: new Date(), + }), + this + ); + }, + }, + { + key: 'setAttributes', + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + for (var e in t) this.setAttribute(e, t[e]); + return this; + }, + }, + { + key: 'getAttribute', + value: function (t) { + var e, + n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, + r = ut(null !== (e = null == this ? void 0 : this.attributes) && void 0 !== e ? e : {}, t); + return void 0 === r ? n : r; + }, + }, + { + key: 'hasAttribute', + value: function (t) { + if (Y(t)) { + var e, + n = t, + r = Object.keys(null !== (e = this.attributes) && void 0 !== e ? e : {}); + return n.every(function (t) { + return r.includes(t); + }); + } + return !(null == this || !this.attributes) && t in this.attributes; + }, + }, + { + key: 'hasAttributes', + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; + return this.hasAttribute(t); + }, + }, + { + key: 'isAttributeFilled', + value: function (t) { + var e = this; + return Y(t) + ? this.hasAttribute(t) && + t.every(function (t) { + return !V(e.getAttribute(t)); + }) + : this.hasAttribute(t) && !V(this.getAttribute(t)); + }, + }, + { + key: 'getAttributes', + value: function (t) { + var e = {}; + if (null == t) return this.getAttributes(Object.keys(this.attributes)); + if ('string' == typeof t) return this.getAttribute(Array.prototype.slice.call(arguments)); + if (!Y(t)) throw new Error('No attribute properties provided!'); + for (var n = 0; n < t.length; n++) { + var r, + i, + a = t[n]; + if ('string' == typeof a) { + var o = this.getAttribute(a); + 'object' !== b(null === (r = o) || void 0 === r ? void 0 : r.attributes) || Y(null === (i = o) || void 0 === i ? void 0 : i.attributes) || (o = o.attributes), + (e[a] = o); + } + } + return e; + }, + }, + { + key: 'serialize', + value: function () { + return this.getAttributes(); + }, + }, + { + key: 'mergeAttributes', + value: function () { + var t, + e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = null !== (t = null == this ? void 0 : this.attributes) && void 0 !== t ? t : {}; + return (this.attributes = w(w({}, n), e)), this.attributes; + }, + }, + { + key: 'syncAttributes', + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + this.attributes = t; + }, + }, + ]), + t + ); + })(), + lt = new ct({ + getDistanceAndTime: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + return this.adapter.get(''.concat(this.namespace, '/').concat(t, '/distance-and-time'), {}, e); + }, + }), + dt = (function (t) { + D(n, ht); + var e = j(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, 'order', w({ actions: lt }, i)); + } + return ( + A(n, [ + { + key: 'getDistanceAndTime', + value: function () { + return this.store.getDistanceAndTime(this.id); + }, + }, + ]), + n + ); + })(), + ft = (function (t) { + D(n, ht); + var e = j(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, 'payload', i); + } + return ( + A(n, [ + { key: 'attach', value: function (t) {} }, + { key: 'entities', get: function () {} }, + { key: 'dropoff', get: function () {} }, + { key: 'pickup', get: function () {} }, + { + key: 'waypoints', + get: function () { + return new Z(this.waypoints); + }, + }, + ]), + n + ); + })(); +!(function (t) { + D(n, ht); + var e = j(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, 'entity', i); + } +})(); +var vt = (function (t) { + D(n, ht); + var e = j(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, 'place', i); + } + return ( + A( + n, + [ + { + key: 'latitude', + get: function () { + var t; + return null === (t = this.getAttribute('location', new at())) || void 0 === t ? void 0 : t.coordinates[1]; + }, + }, + { + key: 'longitude', + get: function () { + var t; + return null === (t = this.getAttribute('location', new at())) || void 0 === t ? void 0 : t.coordinates[0]; + }, + }, + { + key: 'coordinates', + get: function () { + return [this.latitude, this.longitude]; + }, + }, + { + key: 'setOwner', + value: function (t) { + return et(t) && this.setAttribute('owner', t.id), 'string' == typeof t && this.setAttribute('owner', t), this; + }, + }, + ], + [ + { + key: 'fromGoogleAddress', + value: function (t, e) { + var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, + i = t.getAttribute('coordinates'), + a = q(i, 2), + o = a[0], + u = a[1], + s = { + name: null, + address: t.getAttribute('address'), + location: new at(o, u), + street1: t.getAttribute('streetName'), + street2: null, + city: t.getAttribute('city'), + province: t.getAttribute('stateLong'), + postal_code: t.getAttribute('postalCode'), + neighborhood: t.get('neighborhood'), + district: t.getAttribute('county'), + building: t.get('building'), + country: t.getAttribute('countryShort'), + phone: null, + security_access_code: null, + }; + return new n(s, e, r); + }, + }, + ] + ), + n + ); +})(); +!(function (t) { + D(n, vt); + var e = j(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, 'waypoint', i); + } +})(), + (function (t) { + D(n, ht); + var e = j(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, 'tracking-status', i); + } + })(), + (function (t) { + D(n, ht); + var e = j(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, 'vehicle', i); + } + })(), + (function (t) { + D(n, ht); + var e = j(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, 'driver', i); + } + })(), + (function (t) { + D(n, ht); + var e = j(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, 'vendor', i); + } + })(), + (function (t) { + D(n, ht); + var e = j(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, 'contact', i); + } + })(), + (function (t) { + D(n, ht); + var e = j(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, 'zone', i); + } + })(), + (function (t) { + D(n, ht); + var e = j(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, 'service-area', i); + } + })(), + (function (t) { + D(n, ht); + var e = j(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, 'service-rate', i); + } + })(); +var gt = (function (t) { + D(n, ht); + var e = j(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, 'service-quote', i); + } + return ( + A(n, [ + { key: 'fromPreliminary', value: function () {} }, + { key: 'fromPayload', value: function () {} }, + ]), + n + ); + })(), + pt = function t() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + T(this, t), (this.version = e.version || 'v1'), (this.host = e.host || null), (this.namespace = e.namespace || null), (this.headers = e.headers || {}); + }, + yt = (function (t) { + D(n, pt); + var e = j(n); + function n(t) { + var r; + return ( + T(this, n), + (r = e.call(this, t)).setHeaders({ + Authorization: 'Bearer '.concat(t.publicKey), + 'Content-Type': 'application/json', + 'User-Agent': '@fleetbase/sdk;browser', + }), + r + ); + } + return ( + A(n, [ + { + key: 'setHeaders', + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return (this.headers = w(w({}, this.headers), t)), this; + }, + }, + { + key: 'parseJSON', + value: function (t) { + return new Promise(function (e, n) { + return t + .json() + .then(function (n) { + return e({ + statusText: t.statusText, + status: t.status, + ok: t.ok, + json: n, + }); + }) + .catch(function () { + n(new Error('Oops! Something went wrong when handling your request.')); + }); + }); + }, + }, + { + key: 'request', + value: function (t) { + var e = this, + n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'GET', + r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, + i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; + return new Promise(function (a, o) { + return fetch( + i.url || ''.concat(e.host, '/').concat(e.namespace, '/').concat(t), + w( + { + method: n, + mode: i.mode || 'cors', + headers: new Headers(w(w({}, e.headers || {}), i.headers || {})), + }, + r + ) + ) + .then(e.parseJSON) + .then(function (t) { + return t.ok ? a(t.json) : o(new Error(t.json.errors ? t.json.errors[0] : t.statusText)); + }) + .catch(function (t) { + o(t); + }); + }); + }, + }, + { + key: 'get', + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, + r = tt(e) ? '' : new URLSearchParams(e).toString(); + return this.request(''.concat(t).concat(r ? '?'.concat(r) : ''), 'GET', {}, n); + }, + }, + { + key: 'post', + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return this.request(t, 'POST', { body: JSON.stringify(e) }, n); + }, + }, + { + key: 'put', + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return this.request(t, 'PUT', { body: JSON.stringify(e) }, n); + }, + }, + { + key: 'delete', + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + return this.request(t, 'DELETE', {}, e); + }, + }, + { + key: 'patch', + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return this.request(t, 'PATCH', { body: JSON.stringify(e) }, n); + }, + }, + ]), + n + ); + })(), + mt = (function (t) { + D(r, pt); + var n = j(r); + function r(t) { + var i; + return ( + T(this, r), + ((i = n.call(this, t)).axios = e.default.create({ + baseURL: ''.concat(i.host, '/').concat(i.namespace), + headers: { + Authorization: 'Bearer '.concat(t.publicKey), + 'Content-Type': 'application/json', + 'User-Agent': '@fleetbase/sdk;node', + }, + })), + i + ); + } + return ( + A(r, [ + { + key: 'setHeaders', + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + e = this.axios.defaults.headers.common; + return (this.axios.defaults.headers.common = w(w({}, e), t)), this; + }, + }, + { + key: 'transform', + value: function (t) { + return t.data; + }, + }, + { + key: 'handleError', + value: function (t) { + if (t.response) { + var e = t.response.data; + if (Y(e.errors)) throw new Error(e.errors[0]); + if (e.error) throw new Error(e.error); + } + throw t; + }, + }, + { + key: 'get', + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, + r = tt(e) ? '' : new URLSearchParams(e).toString(); + return this.axios + .get(''.concat(t).concat(r ? '?'.concat(r) : ''), n) + .then(this.transform.bind(this)) + .catch(this.handleError.bind(this)); + }, + }, + { + key: 'post', + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return this.axios.post(t, e, n).then(this.transform.bind(this)).catch(this.handleError.bind(this)); + }, + }, + { + key: 'put', + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return this.axios.put(t, e, n).then(this.transform.bind(this)).catch(this.handleError.bind(this)); + }, + }, + { + key: 'delete', + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + return this.axios.delete(t, e).then(this.transform.bind(this)).catch(this.handleError.bind(this)); + }, + }, + { + key: 'patch', + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return this.axios.patch(t, e, n).then(this.transform.bind(this)).catch(this.handleError.bind(this)); + }, + }, + ]), + r + ); + })(), + wt = (function (t) { + D(n, pt); + var e = j(n); + function n() { + return T(this, n), e.apply(this, arguments); + } + return n; + })(), + bt = (function () { + function t(e) { + var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; + T(this, t), + E(this, 'uncountableWords', ['equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep', 'moose', 'deer', 'news']), + E(this, 'pluralRules', [ + [new RegExp('(m)an$', 'gi'), '$1en'], + [new RegExp('(pe)rson$', 'gi'), '$1ople'], + [new RegExp('(child)$', 'gi'), '$1ren'], + [new RegExp('^(ox)$', 'gi'), '$1en'], + [new RegExp('(ax|test)is$', 'gi'), '$1es'], + [new RegExp('(octop|vir)us$', 'gi'), '$1i'], + [new RegExp('(alias|status)$', 'gi'), '$1es'], + [new RegExp('(bu)s$', 'gi'), '$1ses'], + [new RegExp('(buffal|tomat|potat)o$', 'gi'), '$1oes'], + [new RegExp('([ti])um$', 'gi'), '$1a'], + [new RegExp('sis$', 'gi'), 'ses'], + [new RegExp('(?:([^f])fe|([lr])f)$', 'gi'), '$1$2ves'], + [new RegExp('(hive)$', 'gi'), '$1s'], + [new RegExp('([^aeiouy]|qu)y$', 'gi'), '$1ies'], + [new RegExp('(x|ch|ss|sh)$', 'gi'), '$1es'], + [new RegExp('(matr|vert|ind)ix|ex$', 'gi'), '$1ices'], + [new RegExp('([m|l])ouse$', 'gi'), '$1ice'], + [new RegExp('(quiz)$', 'gi'), '$1zes'], + [new RegExp('s$', 'gi'), 's'], + [new RegExp('$', 'gi'), 's'], + ]), + E(this, 'singularRules', [ + [new RegExp('(m)en$', 'gi'), '$1an'], + [new RegExp('(pe)ople$', 'gi'), '$1rson'], + [new RegExp('(child)ren$', 'gi'), '$1'], + [new RegExp('([ti])a$', 'gi'), '$1um'], + [new RegExp('((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$', 'gi'), '$1$2sis'], + [new RegExp('(hive)s$', 'gi'), '$1'], + [new RegExp('(tive)s$', 'gi'), '$1'], + [new RegExp('(curve)s$', 'gi'), '$1'], + [new RegExp('([lr])ves$', 'gi'), '$1f'], + [new RegExp('([^fo])ves$', 'gi'), '$1fe'], + [new RegExp('([^aeiouy]|qu)ies$', 'gi'), '$1y'], + [new RegExp('(s)eries$', 'gi'), '$1eries'], + [new RegExp('(m)ovies$', 'gi'), '$1ovie'], + [new RegExp('(x|ch|ss|sh)es$', 'gi'), '$1'], + [new RegExp('([m|l])ice$', 'gi'), '$1ouse'], + [new RegExp('(bus)es$', 'gi'), '$1'], + [new RegExp('(o)es$', 'gi'), '$1'], + [new RegExp('(shoe)s$', 'gi'), '$1'], + [new RegExp('(cris|ax|test)es$', 'gi'), '$1is'], + [new RegExp('(octop|vir)i$', 'gi'), '$1us'], + [new RegExp('(alias|status)es$', 'gi'), '$1'], + [new RegExp('^(ox)en', 'gi'), '$1'], + [new RegExp('(vert|ind)ices$', 'gi'), '$1ex'], + [new RegExp('(matr)ices$', 'gi'), '$1ix'], + [new RegExp('(quiz)zes$', 'gi'), '$1'], + [new RegExp('s$', 'gi'), ''], + ]), + E(this, 'nonTitlecasedWords', [ + 'and', + 'or', + 'nor', + 'a', + 'an', + 'the', + 'so', + 'but', + 'to', + 'of', + 'at', + 'by', + 'from', + 'into', + 'on', + 'onto', + 'off', + 'out', + 'in', + 'over', + 'with', + 'for', + ]), + E(this, 'idSuffix', new RegExp('(_ids|_id)$', 'g')), + E(this, 'underbar', new RegExp('_', 'g')), + E(this, 'spaceOrUnderbar', new RegExp('[ _]', 'g')), + E(this, 'uppercase', new RegExp('([A-Z])', 'g')), + E(this, 'underbarPrefix', new RegExp('^_')), + (this.str = e), + (this.chain = n); + } + return ( + A( + t, + [ + { + key: 'get', + value: function () { + return this.str; + }, + }, + { + key: 'applyRules', + value: function (t, e, n, r) { + if (r) t = r; + else if (!(n.indexOf(t.toLowerCase()) > -1)) + for (var i = 0; i < e.length; i++) + if (t.match(e[i][0])) { + t = t.replace(e[i][0], e[i][1]); + break; + } + return (this.str = t), !0 === this.chain ? this : t; + }, + }, + { + key: 'pluralize', + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; + return (t = t || this.str), this.applyRules(t, this.pluralRules, this.uncountableWords, e); + }, + }, + { + key: 'singularize', + value: function (t, e) { + return (t = t || this.str), this.applyRules(t, this.singularRules, this.uncountableWords, e); + }, + }, + { + key: 'camelize', + value: function (t, e) { + for (var n = (t = t || this.str).split('/'), r = 0; r < n.length; r++) { + for (var i = n[r].split('_'), a = e && r + 1 === n.length ? 1 : 0; a < i.length; a++) i[a] = i[a].charAt(0).toUpperCase() + i[a].substring(1); + n[r] = i.join(''); + } + if (((t = n.join('::')), !0 === e)) { + var o = t.charAt(0).toLowerCase(), + u = t.slice(1); + t = o + u; + } + return (this.str = t), !0 === this.chain ? this : t; + }, + }, + { + key: 'underscore', + value: function (t) { + for (var e = (t = t || this.str).split('::'), n = 0; n < e.length; n++) + (e[n] = e[n].replace(this.uppercase, '_$1')), (e[n] = e[n].replace(this.underbarPrefix, '')); + return (t = e.join('/').toLowerCase()), (this.str = t), !0 === this.chain ? this : t; + }, + }, + { + key: 'humanize', + value: function (t, e) { + return ( + (t = (t = (t = (t = t || this.str).toLowerCase()).replace(this.idSuffix, '')).replace(this.underbar, ' ')), + e || (t = this.capitalize(t)), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: 'capitalize', + value: function (t) { + return (t = (t = (t = t || this.str).toLowerCase()).substring(0, 1).toUpperCase() + t.substring(1)), (this.str = t), !0 === this.chain ? this : t; + }, + }, + { + key: 'dasherize', + value: function (t) { + return (t = (t = (t = t || this.str).replace(this.spaceOrUnderbar, '-')).toLowerCase()), (this.str = t), !0 === this.chain ? this : t; + }, + }, + { + key: 'normify', + value: function (t, e) { + (t = t || this.str), !0 === e ? ((t = this.camelize(t)), (t = this.underscore(t))) : (t = t.toLowerCase()); + for (var n = (t = t.replace(this.underbar, ' ')).split(' '), r = 0; r < n.length; r++) { + for (var i = n[r].split('-'), a = 0; a < i.length; a++) this.nonTitlecasedWords.indexOf(i[a].toLowerCase()) < 0 && (i[a] = this.capitalize(i[a])); + n[r] = i.join('-'); + } + return (t = (t = n.join(' ')).substring(0, 1).toUpperCase() + t.substring(1)), (this.str = t), !0 === this.chain ? this : t; + }, + }, + { + key: 'demodulize', + value: function (t) { + var e = (t = t || this.str).split('::'); + return (t = e[e.length - 1]), (this.str = t), !0 === this.chain ? this : t; + }, + }, + { + key: 'tableize', + value: function (t) { + return (t = t || this.str), (t = this.pluralize(this.underscore(t))), (this.str = t), !0 === this.chain ? this : t; + }, + }, + { + key: 'classify', + value: function (t) { + return (t = t || this.str), (t = this.singularize(this.camelize(t))), (this.str = t), !0 === this.chain ? this : t; + }, + }, + { + key: 'foreignKey', + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; + return (t = t || this.str), (t = this.underscore(this.demodulize(t)) + (e ? '' : '_') + 'id'), (this.str = t), !0 === this.chain ? this : t; + }, + }, + { + key: 'ordinalize', + value: function (t) { + for (var e = (t = t || this.str).split(' '), n = 0; n < e.length; n++) + if (NaN === parseInt(e[n])) { + var r = e[n].substring(e[n].length - 2), + i = e[n].substring(e[n].length - 1), + a = 'th'; + '11' != r && '12' != r && '13' != r && ('1' === i ? (a = 'st') : '2' === i ? (a = 'nd') : '3' === i && (a = 'rd')), (e[n] += a); + } + return (t = e.join(' ')), (this.str = t), !0 === this.chain ? this : t; + }, + }, + ], + [ + { + key: 'invoke', + value: function () { + var e = Object.values(arguments), + n = new t(null, !1), + r = arguments[0]; + return e.shift(), 'function' == typeof n[r] ? n[r].apply(n, $(e)) : null; + }, + }, + ] + ), + t + ); + })(), + kt = function () { + var t = ['pluralize'].concat(Array.prototype.slice.call(arguments)); + return bt.invoke.apply(bt, $(t)); + }, + xt = function () { + var t = ['singularize'].concat(Array.prototype.slice.call(arguments)); + return bt.invoke.apply(bt, $(t)); + }, + Tt = function () { + var t = ['classify'].concat(Array.prototype.slice.call(arguments)); + return bt.invoke.apply(bt, $(t)); + }, + Ct = { Place: vt, Payload: ft, Order: dt }, + At = { BrowserAdapter: yt, NodeAdapter: mt, EmberJsAdapter: wt }, + Et = (function () { + function t() { + return T(this, t), (this.resources = Ct), (this.adapters = At), this.lookup.apply(this, arguments); + } + return ( + A(t, [ + { + key: 'lookup', + value: function (t, e) { + var n = kt(t), + r = Array.prototype.slice.call(arguments).slice(2); + if (!this[n]) throw new Error('Attempted to resolve invalid type'); + if (!this[n][e]) throw new Error('No '.concat(xt(t), ' named ').concat(e, ' to resolve')); + return R(this[n][e], $(r)); + }, + }, + ]), + t + ); + })(), + Dt = function () { + return R(Et, Array.prototype.slice.call(arguments)); + }, + Ot = function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : []; + if (((t.actions = Y(e) ? e : [e]), !Y(e))) return e instanceof ct && e.extend(t), t; + for (var n = 0; n < e.length; n++) { + var r = e[n]; + t.extendActions(r); + } + }, + St = (function () { + function t(e, n) { + var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + T(this, t), (this.resource = e), (this.adapter = n || rt()), (this.namespace = kt(e)), (this.storage = new Z()), (this.options = r), this.extendActions(r.actions); + } + return ( + A(t, [ + { + key: 'extendActions', + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; + return Ot(this, t); + }, + }, + { + key: 'deposit', + value: function (t) { + return t; + }, + }, + { + key: 'serialize', + value: function (t) { + return Dt('resource', Tt(this.resource), t, this.adapter); + }, + }, + { + key: 'afterFetch', + value: function (t) { + return (function (t, e) { + if (('function' == typeof t.options.onAfterFetch && t.options.onAfterFetch(e), Y(e))) { + for (var n = [], r = 0; r < e.length; r++) n.push(t.afterFetch(e[r])); + return R(Z, n); + } + var i = t.serialize(e); + return t.deposit(i); + })(this, t); + }, + }, + { + key: 'create', + value: function () { + var t = this, + e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + return new Promise( + (function () { + var r = x( + regeneratorRuntime.mark(function r(i, a) { + var o; + return regeneratorRuntime.wrap(function (r) { + for (;;) + switch ((r.prev = r.next)) { + case 0: + return (r.next = 2), t.adapter.post(''.concat(t.namespace), e, n).then(t.afterFetch.bind(t)).catch(a); + case 2: + (o = r.sent), i(o); + case 4: + case 'end': + return r.stop(); + } + }, r); + }) + ); + return function (t, e) { + return r.apply(this, arguments); + }; + })() + ); + }, + }, + { + key: 'update', + value: function (t) { + var e = this, + n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return new Promise( + (function () { + var i = x( + regeneratorRuntime.mark(function i(a, o) { + var u; + return regeneratorRuntime.wrap(function (i) { + for (;;) + switch ((i.prev = i.next)) { + case 0: + return (i.next = 2), e.adapter.put(''.concat(e.namespace, '/').concat(t), n, r).then(e.afterFetch.bind(e)).catch(o); + case 2: + (u = i.sent), a(u); + case 4: + case 'end': + return i.stop(); + } + }, i); + }) + ); + return function (t, e) { + return i.apply(this, arguments); + }; + })() + ); + }, + }, + { + key: 'findRecord', + value: function (t) { + var e = this, + n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + return new Promise( + (function () { + var r = x( + regeneratorRuntime.mark(function r(i, a) { + var o; + return regeneratorRuntime.wrap(function (r) { + for (;;) + switch ((r.prev = r.next)) { + case 0: + return (r.next = 2), e.adapter.get(''.concat(e.namespace, '/').concat(t), {}, n).then(e.afterFetch.bind(e)).catch(a); + case 2: + (o = r.sent), i(o); + case 4: + case 'end': + return r.stop(); + } + }, r); + }) + ); + return function (t, e) { + return r.apply(this, arguments); + }; + })() + ); + }, + }, + { + key: 'findAll', + value: function () { + var t = this, + e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return new Promise( + (function () { + var n = x( + regeneratorRuntime.mark(function n(r, i) { + var a; + return regeneratorRuntime.wrap(function (n) { + for (;;) + switch ((n.prev = n.next)) { + case 0: + return (n.next = 2), t.adapter.get(''.concat(t.namespace), {}, e).then(t.afterFetch.bind(t)).catch(i); + case 2: + (a = n.sent), r(a); + case 4: + case 'end': + return n.stop(); + } + }, n); + }) + ); + return function (t, e) { + return n.apply(this, arguments); + }; + })() + ); + }, + }, + { + key: 'query', + value: function () { + var t = this, + e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + return new Promise( + (function () { + var r = x( + regeneratorRuntime.mark(function r(i, a) { + var o; + return regeneratorRuntime.wrap(function (r) { + for (;;) + switch ((r.prev = r.next)) { + case 0: + return (r.next = 2), t.adapter.get(''.concat(t.namespace), e, n).then(t.afterFetch.bind(t)).catch(a); + case 2: + (o = r.sent), i(o); + case 4: + case 'end': + return r.stop(); + } + }, r); + }) + ); + return function (t, e) { + return r.apply(this, arguments); + }; + })() + ); + }, + }, + { + key: 'queryRecord', + value: function () { + var t = this, + e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + return ( + (e.single = !0), + new Promise( + (function () { + var r = x( + regeneratorRuntime.mark(function r(i, a) { + var o; + return regeneratorRuntime.wrap(function (r) { + for (;;) + switch ((r.prev = r.next)) { + case 0: + return (r.next = 2), t.adapter.get(''.concat(t.namespace), e, n).then(t.afterFetch.bind(t)).catch(a); + case 2: + (o = r.sent), i(o); + case 4: + case 'end': + return r.stop(); + } + }, r); + }) + ); + return function (t, e) { + return r.apply(this, arguments); + }; + })() + ) + ); + }, + }, + { + key: 'destroy', + value: function (t) { + var e = this, + n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + r = et(t) ? t.getAttribute('id') : t; + return new Promise( + (function () { + var t = x( + regeneratorRuntime.mark(function t(i, a) { + var o; + return regeneratorRuntime.wrap(function (t) { + for (;;) + switch ((t.prev = t.next)) { + case 0: + return (t.next = 2), e.adapter.delete(''.concat(e.namespace, '/').concat(r), {}, n).then(e.afterFetch.bind(e)).catch(a); + case 2: + (o = t.sent), i(o); + case 4: + case 'end': + return t.stop(); + } + }, t); + }) + ); + return function (e, n) { + return t.apply(this, arguments); + }; + })() + ); + }, + }, + ]), + t + ); + })(); +!(function () { + function t(e) { + var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; + if ( + (T(this, t), + (this.version = n.version || 'v1'), + (this.options = { + version: this.version, + host: n.host || 'https://api.fleetbase.io', + namespace: this.version || n.namespace, + debug: r, + publicKey: e, + }), + 'string' != typeof e || 0 === e.length) + ) + throw new Error('⚠️ Invalid public key given to Fleetbase SDK'); + if (!nt() && e.toLowerCase().startsWith('$')) throw new Error('Secret key provided. You must use a public key with Fleetbase Javascript SDK!'); + (this.adapter = n.adapter || rt(this.options)), + (this.orders = new St('order', this.adapter).extendActions(lt)), + (this.entities = new St('entity', this.adapter)), + (this.places = new St('place', this.adapter)), + (this.drivers = new St('driver', this.adapter)), + (this.vehicles = new St('vehicle', this.adapter)), + (this.vendors = new St('vendor', this.adapter)), + (this.contacts = new St('contact', this.adapter)); + } + A( + t, + [ + { + key: 'setAdapter', + value: function (t) { + this.adapter = t; + }, + }, + { + key: 'getAdapter', + value: function () { + return this.adapter; + }, + }, + ], + [ + { + key: 'newInstance', + value: function () { + return R(t, Array.prototype.slice.call(arguments)); + }, + }, + ] + ); +})(); +var Pt = (function (t) { + c(n, ht); + var e = g(n); + function n() { + return a(this, n), e.apply(this, arguments); + } + return ( + u(n, [ + { + key: 'setAdapter', + value: function (t) { + var e; + return ( + (this.adapter = t), + (this.store = new tr(this.resource, t, { + onAfterFetch: this.syncAttributes.bind(this), + actions: null === (e = this.options) || void 0 === e ? void 0 : e.actions, + })), + this + ); + }, + }, + ]), + n + ); + })(), + Rt = new ct({ + count: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + n = {}; + return t && (n.store = t), this.adapter.get(''.concat(this.namespace, '/count'), n, e); + }, + }), + Ut = (function (t) { + c(n, Pt); + var e = g(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return a(this, n), e.call(this, t, r, 'review', i); + } + return ( + u(n, [ + { key: 'getMedia', value: function () {} }, + { key: 'getPhotos', value: function () {} }, + { key: 'getVideos', value: function () {} }, + ]), + n + ); + })(), + Mt = function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return nt() ? Vn('adapter', 'NodeAdapter', t) : Vn('adapter', 'BrowserAdapter', t); + }, + jt = function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ''; + return /^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(t); + }; +function qt() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, + e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'USD', + n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 'symbol'; + return new Intl.NumberFormat('en-US', { + style: 'currency', + currency: e, + currencyDisplay: n, + }).format(t); +} +var $t = function (t) { + return 'string' == typeof t && t.length > 30 && (t.startsWith('store_') || t.startsWith('network_')); + }, + Nt = function (t) { + var e = null == t; + if (e) return e; + if ('number' == typeof t.size) return !t.size; + var n = i(t); + if ('object' === n) { + var r = t.size; + if ('number' == typeof r) return !r; + } + if ('number' == typeof t.length && 'function' !== n) return !t.length; + if ('object' === n) { + var a = t.length; + if ('number' == typeof a) return !a; + } + return !1; + }, + Ht = (function (t) { + c(n, Pt); + var e = g(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return a(this, n), e.call(this, t, r, 'product', i); + } + return ( + u(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, + n = t.sale_price, + r = t.currency; + return this.isOnSale ? (Nt(n) || Nt(r) ? null : qt(n / 100, r)) : Nt(e) || Nt(r) ? null : qt(e / 100, r); + }, + }, + { + key: 'getReviews', + value: function () { + var t = this; + return this.adapter.get('reviews', { store: this.id }).then(function (e) { + return new Z( + e.map(function (e) { + return new Ut(e, t.adapter); + }) + ); + }); + }, + }, + ]), + n + ); + })(), + Yt = (function (t) { + c(n, Pt); + var e = g(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return a(this, n), e.call(this, t, r, 'category', i); + } + return ( + u(n, [ + { + key: 'getProducts', + value: function () { + var t = this; + return this.adapter.get('products', { category: this.id }).then(function (e) { + return new Z( + e.map(function (e) { + return new Ht(e, t.adapter); + }) + ); + }); + }, + }, + ]), + n + ); + })(), + Lt = new ct({ + 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 (jt(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); + }, + }), + Ft = (function (t) { + c(n, Pt); + var e = g(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + i = arguments.length > 1 ? arguments[1] : void 0, + o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return a(this, n), e.call(this, t, i, 'customer', r({ actions: Lt }, o)); + } + return ( + u(n, [ + { + key: 'setAdapter', + value: function (t) { + var e; + return ( + (this.adapter = t), + (this.store = new tr(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: function (t) { + var e = this; + return this.adapter + .setHeaders({ 'Customer-Token': this.token }) + .post('customers/register-device', t) + .then(function () { + return e; + }); + }, + }, + { + key: 'getSavedPlaces', + value: function () { + var t = this; + return this.adapter + .setHeaders({ 'Customer-Token': this.token }) + .get('customers/places') + .then(function (e) { + return new Z( + e.map(function (e) { + return new vt(e, t.adapter); + }) + ); + }); + }, + }, + { + key: 'getOrderHistory', + value: function () { + var t = this, + e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return this.adapter + .setHeaders({ 'Customer-Token': this.token }) + .get('customers/orders', e) + .then(function (e) { + return new Z( + e.map(function (e) { + return new dt(e, t.adapter); + }) + ); + }); + }, + }, + ]), + n + ); + })(), + _t = Array.isArray, + Wt = new ct({ + 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, + i = 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({}, i), {}, { quantity: n }), a).then(this.afterFetch.bind(this)); + }, + update: function (t, e, n) { + var i = 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({}, i), {}, { quantity: n }), a).then(this.afterFetch.bind(this)); + }, + remove: function (t, e) { + var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return this.adapter.delete(''.concat(this.namespace, '/').concat(t, '/').concat(e), {}, n).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); + }, + }), + zt = (function (t) { + c(n, Pt); + var e = g(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + i = arguments.length > 1 ? arguments[1] : void 0, + o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return a(this, n), e.call(this, t, i, 'cart', r({ actions: Wt }, o)); + } + return ( + u(n, [ + { + key: 'add', + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, + n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, + r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; + return t instanceof Ht && (t = t.id), this.store.add(this.id, t, e, n, r); + }, + }, + { + key: 'update', + value: function (t, e) { + var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, + r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; + return this.store.update(this.id, t, e, n, r); + }, + }, + { + 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 !_t(t) || 0 === t.length; + }, + }, + { + key: 'isNotEmpty', + get: function () { + return !this.isEmpty; + }, + }, + ]), + n + ); + })(); +function It(t) { + if (null === t || !0 === t || !1 === t) return NaN; + var e = Number(t); + return isNaN(e) ? e : e < 0 ? Math.ceil(e) : Math.floor(e); +} +function Qt(t, e) { + if (e.length < t) throw new TypeError(t + ' argument' + (t > 1 ? 's' : '') + ' required, but only ' + e.length + ' present'); +} +function Bt(t) { + Qt(1, arguments); + var e = Object.prototype.toString.call(t); + return t instanceof Date || ('object' == typeof t && '[object Date]' === e) + ? new Date(t.getTime()) + : 'number' == typeof t || '[object Number]' === e + ? new Date(t) + : (('string' != typeof t && '[object String]' !== e) || + 'undefined' == typeof console || + (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"), + console.warn(new Error().stack)), + new Date(NaN)); +} +function Gt(t, e) { + Qt(2, arguments); + var n = Bt(t).getTime(), + r = It(e); + return new Date(n + r); +} +function Xt(t) { + var 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 Kt(t) { + return Qt(1, arguments), t instanceof Date || ('object' == typeof t && '[object Date]' === Object.prototype.toString.call(t)); +} +function Jt(t) { + if ((Qt(1, arguments), !Kt(t) && 'number' != typeof t)) return !1; + var e = Bt(t); + return !isNaN(Number(e)); +} +var Zt = { + 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' }, + }, + Vt = function (t, e, n) { + var r, + i = Zt[t]; + return ( + (r = 'string' == typeof i ? i : 1 === e ? i.one : i.other.replace('{{count}}', e.toString())), + null != n && n.addSuffix ? (n.comparison && n.comparison > 0 ? 'in ' + r : r + ' ago') : r + ); + }; +function te(t) { + return function () { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = e.width ? String(e.width) : t.defaultWidth, + r = t.formats[n] || t.formats[t.defaultWidth]; + return r; + }; +} +var ee = { + date: te({ + formats: { + full: 'EEEE, MMMM do, y', + long: 'MMMM do, y', + medium: 'MMM d, y', + short: 'MM/dd/yyyy', + }, + defaultWidth: 'full', + }), + time: te({ + 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: te({ + formats: { + full: "{{date}} 'at' {{time}}", + long: "{{date}} 'at' {{time}}", + medium: '{{date}}, {{time}}', + short: '{{date}}, {{time}}', + }, + defaultWidth: 'full', + }), + }, + ne = { + lastWeek: "'last' eeee 'at' p", + yesterday: "'yesterday at' p", + today: "'today at' p", + tomorrow: "'tomorrow at' p", + nextWeek: "eeee 'at' p", + other: 'P', + }; +function re(t) { + return function (e, n) { + var r, + i = n || {}; + if ('formatting' === (i.context ? String(i.context) : 'standalone') && t.formattingValues) { + var a = t.defaultFormattingWidth || t.defaultWidth, + o = i.width ? String(i.width) : a; + r = t.formattingValues[o] || t.formattingValues[a]; + } else { + var u = t.defaultWidth, + s = i.width ? String(i.width) : t.defaultWidth; + r = t.values[s] || t.values[u]; + } + return r[t.argumentCallback ? t.argumentCallback(e) : e]; + }; +} +function ie(t) { + return function (e) { + var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + r = n.width, + i = (r && t.matchPatterns[r]) || t.matchPatterns[t.defaultMatchWidth], + a = e.match(i); + if (!a) return null; + var o, + u = a[0], + s = (r && t.parsePatterns[r]) || t.parsePatterns[t.defaultParseWidth], + c = Array.isArray(s) + ? oe(s, function (t) { + return t.test(u); + }) + : ae(s, function (t) { + return t.test(u); + }); + (o = t.valueCallback ? t.valueCallback(c) : c), (o = n.valueCallback ? n.valueCallback(o) : o); + var h = e.slice(u.length); + return { value: o, rest: h }; + }; +} +function ae(t, e) { + for (var n in t) if (t.hasOwnProperty(n) && e(t[n])) return n; +} +function oe(t, e) { + for (var n = 0; n < t.length; n++) if (e(t[n])) return n; +} +var ue, + se = { + code: 'en-US', + formatDistance: Vt, + formatLong: ee, + formatRelative: function (t, e, n, r) { + return ne[t]; + }, + localize: { + ordinalNumber: function (t, e) { + var n = Number(t), + r = n % 100; + if (r > 20 || r < 10) + switch (r % 10) { + case 1: + return n + 'st'; + case 2: + return n + 'nd'; + case 3: + return n + 'rd'; + } + return n + 'th'; + }, + era: re({ + values: { + narrow: ['B', 'A'], + abbreviated: ['BC', 'AD'], + wide: ['Before Christ', 'Anno Domini'], + }, + defaultWidth: 'wide', + }), + quarter: re({ + values: { + narrow: ['1', '2', '3', '4'], + abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'], + wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'], + }, + defaultWidth: 'wide', + argumentCallback: function (t) { + return t - 1; + }, + }), + month: re({ + 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: re({ + 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: re({ + 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: + ((ue = { + matchPattern: /^(\d+)(th|st|nd|rd)?/i, + parsePattern: /\d+/i, + valueCallback: function (t) { + return parseInt(t, 10); + }, + }), + function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + n = t.match(ue.matchPattern); + if (!n) return null; + var r = n[0], + i = t.match(ue.parsePattern); + if (!i) return null; + var a = ue.valueCallback ? ue.valueCallback(i[0]) : i[0]; + a = e.valueCallback ? e.valueCallback(a) : a; + var o = t.slice(r.length); + return { value: a, rest: o }; + }), + era: ie({ + 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: ie({ + 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: function (t) { + return t + 1; + }, + }), + month: ie({ + 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: ie({ + 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: ie({ + 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 ce(t, e) { + Qt(2, arguments); + var n = It(e); + return Gt(t, -n); +} +function he(t, e) { + for (var n = t < 0 ? '-' : '', r = Math.abs(t).toString(); r.length < e; ) r = '0' + r; + return n + r; +} +var le = { + y: function (t, e) { + var n = t.getUTCFullYear(), + r = n > 0 ? n : 1 - n; + return he('yy' === e ? r % 100 : r, e.length); + }, + M: function (t, e) { + var n = t.getUTCMonth(); + return 'M' === e ? String(n + 1) : he(n + 1, 2); + }, + d: function (t, e) { + return he(t.getUTCDate(), e.length); + }, + a: function (t, e) { + var n = t.getUTCHours() / 12 >= 1 ? 'pm' : 'am'; + switch (e) { + case 'a': + case 'aa': + return n.toUpperCase(); + case 'aaa': + return n; + case 'aaaaa': + return n[0]; + default: + return 'am' === n ? 'a.m.' : 'p.m.'; + } + }, + h: function (t, e) { + return he(t.getUTCHours() % 12 || 12, e.length); + }, + H: function (t, e) { + return he(t.getUTCHours(), e.length); + }, + m: function (t, e) { + return he(t.getUTCMinutes(), e.length); + }, + s: function (t, e) { + return he(t.getUTCSeconds(), e.length); + }, + S: function (t, e) { + var n = e.length, + r = t.getUTCMilliseconds(); + return he(Math.floor(r * Math.pow(10, n - 3)), e.length); + }, +}; +function de(t) { + Qt(1, arguments); + var e = 1, + n = Bt(t), + r = n.getUTCDay(), + i = (r < e ? 7 : 0) + r - e; + return n.setUTCDate(n.getUTCDate() - i), n.setUTCHours(0, 0, 0, 0), n; +} +function fe(t) { + Qt(1, arguments); + var e = Bt(t), + n = e.getUTCFullYear(), + r = new Date(0); + r.setUTCFullYear(n + 1, 0, 4), r.setUTCHours(0, 0, 0, 0); + var i = de(r), + a = new Date(0); + a.setUTCFullYear(n, 0, 4), a.setUTCHours(0, 0, 0, 0); + var o = de(a); + return e.getTime() >= i.getTime() ? n + 1 : e.getTime() >= o.getTime() ? n : n - 1; +} +function ve(t) { + Qt(1, arguments); + var e = fe(t), + n = new Date(0); + n.setUTCFullYear(e, 0, 4), n.setUTCHours(0, 0, 0, 0); + var r = de(n); + return r; +} +function ge(t) { + Qt(1, arguments); + var e = Bt(t), + n = de(e).getTime() - ve(e).getTime(); + return Math.round(n / 6048e5) + 1; +} +function pe(t, e) { + Qt(1, arguments); + var n = e || {}, + r = n.locale, + i = r && r.options && r.options.weekStartsOn, + a = null == i ? 0 : It(i), + o = null == n.weekStartsOn ? a : It(n.weekStartsOn); + if (!(o >= 0 && o <= 6)) throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); + var u = Bt(t), + s = u.getUTCDay(), + c = (s < o ? 7 : 0) + s - o; + return u.setUTCDate(u.getUTCDate() - c), u.setUTCHours(0, 0, 0, 0), u; +} +function ye(t, e) { + Qt(1, arguments); + var n = Bt(t, e), + r = n.getUTCFullYear(), + i = e || {}, + a = i.locale, + o = a && a.options && a.options.firstWeekContainsDate, + u = null == o ? 1 : It(o), + s = null == i.firstWeekContainsDate ? u : It(i.firstWeekContainsDate); + if (!(s >= 1 && s <= 7)) throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); + var c = new Date(0); + c.setUTCFullYear(r + 1, 0, s), c.setUTCHours(0, 0, 0, 0); + var h = pe(c, e), + l = new Date(0); + l.setUTCFullYear(r, 0, s), l.setUTCHours(0, 0, 0, 0); + var d = pe(l, e); + return n.getTime() >= h.getTime() ? r + 1 : n.getTime() >= d.getTime() ? r : r - 1; +} +function me(t, e) { + Qt(1, arguments); + var n = e || {}, + r = n.locale, + i = r && r.options && r.options.firstWeekContainsDate, + a = null == i ? 1 : It(i), + o = null == n.firstWeekContainsDate ? a : It(n.firstWeekContainsDate), + u = ye(t, e), + s = new Date(0); + s.setUTCFullYear(u, 0, o), s.setUTCHours(0, 0, 0, 0); + var c = pe(s, e); + return c; +} +function we(t, e) { + Qt(1, arguments); + var n = Bt(t), + r = pe(n, e).getTime() - me(n, e).getTime(); + return Math.round(r / 6048e5) + 1; +} +var be = 'midnight', + ke = 'noon', + xe = 'morning', + Te = 'afternoon', + Ce = 'evening', + Ae = 'night', + Ee = { + G: function (t, e, n) { + var r = t.getUTCFullYear() > 0 ? 1 : 0; + switch (e) { + case 'G': + case 'GG': + case 'GGG': + return n.era(r, { width: 'abbreviated' }); + case 'GGGGG': + return n.era(r, { width: 'narrow' }); + default: + return n.era(r, { width: 'wide' }); + } + }, + y: function (t, e, n) { + if ('yo' === e) { + var r = t.getUTCFullYear(), + i = r > 0 ? r : 1 - r; + return n.ordinalNumber(i, { unit: 'year' }); + } + return le.y(t, e); + }, + Y: function (t, e, n, r) { + var i = ye(t, r), + a = i > 0 ? i : 1 - i; + return 'YY' === e ? he(a % 100, 2) : 'Yo' === e ? n.ordinalNumber(a, { unit: 'year' }) : he(a, e.length); + }, + R: function (t, e) { + return he(fe(t), e.length); + }, + u: function (t, e) { + return he(t.getUTCFullYear(), e.length); + }, + Q: function (t, e, n) { + var r = Math.ceil((t.getUTCMonth() + 1) / 3); + switch (e) { + case 'Q': + return String(r); + case 'QQ': + return he(r, 2); + case 'Qo': + return n.ordinalNumber(r, { unit: 'quarter' }); + case 'QQQ': + return n.quarter(r, { width: 'abbreviated', context: 'formatting' }); + case 'QQQQQ': + return n.quarter(r, { width: 'narrow', context: 'formatting' }); + default: + return n.quarter(r, { width: 'wide', context: 'formatting' }); + } + }, + q: function (t, e, n) { + var r = Math.ceil((t.getUTCMonth() + 1) / 3); + switch (e) { + case 'q': + return String(r); + case 'qq': + return he(r, 2); + case 'qo': + return n.ordinalNumber(r, { unit: 'quarter' }); + case 'qqq': + return n.quarter(r, { width: 'abbreviated', context: 'standalone' }); + case 'qqqqq': + return n.quarter(r, { width: 'narrow', context: 'standalone' }); + default: + return n.quarter(r, { width: 'wide', context: 'standalone' }); + } + }, + M: function (t, e, n) { + var r = t.getUTCMonth(); + switch (e) { + case 'M': + case 'MM': + return le.M(t, e); + case 'Mo': + return n.ordinalNumber(r + 1, { unit: 'month' }); + case 'MMM': + return n.month(r, { width: 'abbreviated', context: 'formatting' }); + case 'MMMMM': + return n.month(r, { width: 'narrow', context: 'formatting' }); + default: + return n.month(r, { width: 'wide', context: 'formatting' }); + } + }, + L: function (t, e, n) { + var r = t.getUTCMonth(); + switch (e) { + case 'L': + return String(r + 1); + case 'LL': + return he(r + 1, 2); + case 'Lo': + return n.ordinalNumber(r + 1, { unit: 'month' }); + case 'LLL': + return n.month(r, { width: 'abbreviated', context: 'standalone' }); + case 'LLLLL': + return n.month(r, { width: 'narrow', context: 'standalone' }); + default: + return n.month(r, { width: 'wide', context: 'standalone' }); + } + }, + w: function (t, e, n, r) { + var i = we(t, r); + return 'wo' === e ? n.ordinalNumber(i, { unit: 'week' }) : he(i, e.length); + }, + I: function (t, e, n) { + var r = ge(t); + return 'Io' === e ? n.ordinalNumber(r, { unit: 'week' }) : he(r, e.length); + }, + d: function (t, e, n) { + return 'do' === e ? n.ordinalNumber(t.getUTCDate(), { unit: 'date' }) : le.d(t, e); + }, + D: function (t, e, n) { + var r = (function (t) { + Qt(1, arguments); + var e = Bt(t), + n = e.getTime(); + e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0); + var r = e.getTime(), + i = n - r; + return Math.floor(i / 864e5) + 1; + })(t); + return 'Do' === e ? n.ordinalNumber(r, { unit: 'dayOfYear' }) : he(r, e.length); + }, + E: function (t, e, n) { + var r = t.getUTCDay(); + switch (e) { + case 'E': + case 'EE': + case 'EEE': + return n.day(r, { width: 'abbreviated', context: 'formatting' }); + case 'EEEEE': + return n.day(r, { width: 'narrow', context: 'formatting' }); + case 'EEEEEE': + return n.day(r, { width: 'short', context: 'formatting' }); + default: + return n.day(r, { width: 'wide', context: 'formatting' }); + } + }, + e: function (t, e, n, r) { + var i = t.getUTCDay(), + a = (i - r.weekStartsOn + 8) % 7 || 7; + switch (e) { + case 'e': + return String(a); + case 'ee': + return he(a, 2); + case 'eo': + return n.ordinalNumber(a, { unit: 'day' }); + case 'eee': + return n.day(i, { width: 'abbreviated', context: 'formatting' }); + case 'eeeee': + return n.day(i, { width: 'narrow', context: 'formatting' }); + case 'eeeeee': + return n.day(i, { width: 'short', context: 'formatting' }); + default: + return n.day(i, { width: 'wide', context: 'formatting' }); + } + }, + c: function (t, e, n, r) { + var i = t.getUTCDay(), + a = (i - r.weekStartsOn + 8) % 7 || 7; + switch (e) { + case 'c': + return String(a); + case 'cc': + return he(a, e.length); + case 'co': + return n.ordinalNumber(a, { unit: 'day' }); + case 'ccc': + return n.day(i, { width: 'abbreviated', context: 'standalone' }); + case 'ccccc': + return n.day(i, { width: 'narrow', context: 'standalone' }); + case 'cccccc': + return n.day(i, { width: 'short', context: 'standalone' }); + default: + return n.day(i, { width: 'wide', context: 'standalone' }); + } + }, + i: function (t, e, n) { + var r = t.getUTCDay(), + i = 0 === r ? 7 : r; + switch (e) { + case 'i': + return String(i); + case 'ii': + return he(i, e.length); + case 'io': + return n.ordinalNumber(i, { unit: 'day' }); + case 'iii': + return n.day(r, { width: 'abbreviated', context: 'formatting' }); + case 'iiiii': + return n.day(r, { width: 'narrow', context: 'formatting' }); + case 'iiiiii': + return n.day(r, { width: 'short', context: 'formatting' }); + default: + return n.day(r, { width: 'wide', context: 'formatting' }); + } + }, + a: function (t, e, n) { + var r = t.getUTCHours() / 12 >= 1 ? 'pm' : 'am'; + switch (e) { + case 'a': + case 'aa': + return n.dayPeriod(r, { + width: 'abbreviated', + context: 'formatting', + }); + case 'aaa': + return n.dayPeriod(r, { width: 'abbreviated', context: 'formatting' }).toLowerCase(); + case 'aaaaa': + return n.dayPeriod(r, { width: 'narrow', context: 'formatting' }); + default: + return n.dayPeriod(r, { width: 'wide', context: 'formatting' }); + } + }, + b: function (t, e, n) { + var r, + i = t.getUTCHours(); + switch (((r = 12 === i ? ke : 0 === i ? be : i / 12 >= 1 ? 'pm' : 'am'), e)) { + case 'b': + case 'bb': + return n.dayPeriod(r, { + width: 'abbreviated', + context: 'formatting', + }); + case 'bbb': + return n.dayPeriod(r, { width: 'abbreviated', context: 'formatting' }).toLowerCase(); + case 'bbbbb': + return n.dayPeriod(r, { width: 'narrow', context: 'formatting' }); + default: + return n.dayPeriod(r, { width: 'wide', context: 'formatting' }); + } + }, + B: function (t, e, n) { + var r, + i = t.getUTCHours(); + switch (((r = i >= 17 ? Ce : i >= 12 ? Te : i >= 4 ? xe : Ae), e)) { + case 'B': + case 'BB': + case 'BBB': + return n.dayPeriod(r, { + width: 'abbreviated', + context: 'formatting', + }); + case 'BBBBB': + return n.dayPeriod(r, { width: 'narrow', context: 'formatting' }); + default: + return n.dayPeriod(r, { width: 'wide', context: 'formatting' }); + } + }, + h: function (t, e, n) { + if ('ho' === e) { + var r = t.getUTCHours() % 12; + return 0 === r && (r = 12), n.ordinalNumber(r, { unit: 'hour' }); + } + return le.h(t, e); + }, + H: function (t, e, n) { + return 'Ho' === e ? n.ordinalNumber(t.getUTCHours(), { unit: 'hour' }) : le.H(t, e); + }, + K: function (t, e, n) { + var r = t.getUTCHours() % 12; + return 'Ko' === e ? n.ordinalNumber(r, { unit: 'hour' }) : he(r, e.length); + }, + k: function (t, e, n) { + var r = t.getUTCHours(); + return 0 === r && (r = 24), 'ko' === e ? n.ordinalNumber(r, { unit: 'hour' }) : he(r, e.length); + }, + m: function (t, e, n) { + return 'mo' === e ? n.ordinalNumber(t.getUTCMinutes(), { unit: 'minute' }) : le.m(t, e); + }, + s: function (t, e, n) { + return 'so' === e ? n.ordinalNumber(t.getUTCSeconds(), { unit: 'second' }) : le.s(t, e); + }, + S: function (t, e) { + return le.S(t, e); + }, + X: function (t, e, n, r) { + var i = (r._originalDate || t).getTimezoneOffset(); + if (0 === i) return 'Z'; + switch (e) { + case 'X': + return Oe(i); + case 'XXXX': + case 'XX': + return Se(i); + default: + return Se(i, ':'); + } + }, + x: function (t, e, n, r) { + var i = (r._originalDate || t).getTimezoneOffset(); + switch (e) { + case 'x': + return Oe(i); + case 'xxxx': + case 'xx': + return Se(i); + default: + return Se(i, ':'); + } + }, + O: function (t, e, n, r) { + var i = (r._originalDate || t).getTimezoneOffset(); + switch (e) { + case 'O': + case 'OO': + case 'OOO': + return 'GMT' + De(i, ':'); + default: + return 'GMT' + Se(i, ':'); + } + }, + z: function (t, e, n, r) { + var i = (r._originalDate || t).getTimezoneOffset(); + switch (e) { + case 'z': + case 'zz': + case 'zzz': + return 'GMT' + De(i, ':'); + default: + return 'GMT' + Se(i, ':'); + } + }, + t: function (t, e, n, r) { + var i = r._originalDate || t; + return he(Math.floor(i.getTime() / 1e3), e.length); + }, + T: function (t, e, n, r) { + return he((r._originalDate || t).getTime(), e.length); + }, + }; +function De(t, e) { + var n = t > 0 ? '-' : '+', + r = Math.abs(t), + i = Math.floor(r / 60), + a = r % 60; + if (0 === a) return n + String(i); + var o = e || ''; + return n + String(i) + o + he(a, 2); +} +function Oe(t, e) { + return t % 60 == 0 ? (t > 0 ? '-' : '+') + he(Math.abs(t) / 60, 2) : Se(t, e); +} +function Se(t, e) { + var n = e || '', + r = t > 0 ? '-' : '+', + i = Math.abs(t); + return r + he(Math.floor(i / 60), 2) + n + he(i % 60, 2); +} +var Pe = Ee; +function Re(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' }); + } +} +function Ue(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' }); + } +} +var Me = { + p: Ue, + P: function (t, e) { + var n, + r = t.match(/(P+)(p+)?/), + i = r[1], + a = r[2]; + if (!a) return Re(t, e); + switch (i) { + case 'P': + n = e.dateTime({ width: 'short' }); + break; + case 'PP': + n = e.dateTime({ width: 'medium' }); + break; + case 'PPP': + n = e.dateTime({ width: 'long' }); + break; + default: + n = e.dateTime({ width: 'full' }); + } + return n.replace('{{date}}', Re(i, e)).replace('{{time}}', Ue(a, e)); + }, + }, + je = Me, + qe = ['D', 'DD'], + $e = ['YY', 'YYYY']; +function Ne(t) { + return -1 !== qe.indexOf(t); +} +function He(t) { + return -1 !== $e.indexOf(t); +} +function Ye(t, e, n) { + if ('YYYY' === t) throw new RangeError('Use `yyyy` instead of `YYYY` (in `'.concat(e, '`) for formatting years to the input `').concat(n, '`; see: https://git.io/fxCyr')); + if ('YY' === t) throw new RangeError('Use `yy` instead of `YY` (in `'.concat(e, '`) for formatting years to the input `').concat(n, '`; see: https://git.io/fxCyr')); + if ('D' === t) throw new RangeError('Use `d` instead of `D` (in `'.concat(e, '`) for formatting days of the month to the input `').concat(n, '`; see: https://git.io/fxCyr')); + if ('DD' === t) throw new RangeError('Use `dd` instead of `DD` (in `'.concat(e, '`) for formatting days of the month to the input `').concat(n, '`; see: https://git.io/fxCyr')); +} +var Le = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, + Fe = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, + _e = /^'([^]*?)'?$/, + We = /''/g, + ze = /[a-zA-Z]/; +function Ie(t, e, n) { + Qt(2, arguments); + var r = String(e), + i = n || {}, + a = i.locale || se, + o = a.options && a.options.firstWeekContainsDate, + u = null == o ? 1 : It(o), + s = null == i.firstWeekContainsDate ? u : It(i.firstWeekContainsDate); + if (!(s >= 1 && s <= 7)) throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); + var c = a.options && a.options.weekStartsOn, + h = null == c ? 0 : It(c), + l = null == i.weekStartsOn ? h : It(i.weekStartsOn); + if (!(l >= 0 && l <= 6)) throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); + if (!a.localize) throw new RangeError('locale must contain localize property'); + if (!a.formatLong) throw new RangeError('locale must contain formatLong property'); + var d = Bt(t); + if (!Jt(d)) throw new RangeError('Invalid time value'); + var f = Xt(d), + v = ce(d, f), + g = { + firstWeekContainsDate: s, + weekStartsOn: l, + locale: a, + _originalDate: d, + }, + p = r + .match(Fe) + .map(function (t) { + var e = t[0]; + return 'p' === e || 'P' === e ? (0, je[e])(t, a.formatLong, g) : t; + }) + .join('') + .match(Le) + .map(function (n) { + if ("''" === n) return "'"; + var r = n[0]; + if ("'" === r) return Qe(n); + var o = Pe[r]; + if (o) return !i.useAdditionalWeekYearTokens && He(n) && Ye(n, e, t), !i.useAdditionalDayOfYearTokens && Ne(n) && Ye(n, e, t), o(v, n, a.localize, g); + if (r.match(ze)) throw new RangeError('Format string contains an unescaped latin alphabet character `' + r + '`'); + return n; + }) + .join(''); + return p; +} +function Qe(t) { + return t.match(_e)[1].replace(We, "'"); +} +function Be(t, e) { + if (null == t) throw new TypeError('assign requires that input parameter not be null or undefined'); + for (var n in (e = e || {})) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); + return t; +} +function Ge(t, e, n) { + Qt(2, arguments); + var r = n || {}, + i = r.locale, + a = i && i.options && i.options.weekStartsOn, + o = null == a ? 0 : It(a), + u = null == r.weekStartsOn ? o : It(r.weekStartsOn); + if (!(u >= 0 && u <= 6)) throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); + var s = Bt(t), + c = It(e), + h = s.getUTCDay(), + l = c % 7, + d = (l + 7) % 7, + f = (d < u ? 7 : 0) + c - h; + return s.setUTCDate(s.getUTCDate() + f), s; +} +var Xe = /^(1[0-2]|0?\d)/, + Ke = /^(3[0-1]|[0-2]?\d)/, + Je = /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, + Ze = /^(5[0-3]|[0-4]?\d)/, + Ve = /^(2[0-3]|[0-1]?\d)/, + tn = /^(2[0-4]|[0-1]?\d)/, + en = /^(1[0-1]|0?\d)/, + nn = /^(1[0-2]|0?\d)/, + rn = /^[0-5]?\d/, + an = /^[0-5]?\d/, + on = /^\d/, + un = /^\d{1,2}/, + sn = /^\d{1,3}/, + cn = /^\d{1,4}/, + hn = /^-?\d+/, + ln = /^-?\d/, + dn = /^-?\d{1,2}/, + fn = /^-?\d{1,3}/, + vn = /^-?\d{1,4}/, + gn = /^([+-])(\d{2})(\d{2})?|Z/, + pn = /^([+-])(\d{2})(\d{2})|Z/, + yn = /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, + mn = /^([+-])(\d{2}):(\d{2})|Z/, + wn = /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/; +function bn(t, e, n) { + var r = e.match(t); + if (!r) return null; + var i = parseInt(r[0], 10); + return { value: n ? n(i) : i, rest: e.slice(r[0].length) }; +} +function kn(t, e) { + var n = e.match(t); + return n + ? 'Z' === n[0] + ? { value: 0, rest: e.slice(1) } + : { + value: ('+' === n[1] ? 1 : -1) * (36e5 * (n[2] ? parseInt(n[2], 10) : 0) + 6e4 * (n[3] ? parseInt(n[3], 10) : 0) + 1e3 * (n[5] ? parseInt(n[5], 10) : 0)), + rest: e.slice(n[0].length), + } + : null; +} +function xn(t, e) { + return bn(hn, t, e); +} +function Tn(t, e, n) { + switch (t) { + case 1: + return bn(on, e, n); + case 2: + return bn(un, e, n); + case 3: + return bn(sn, e, n); + case 4: + return bn(cn, e, n); + default: + return bn(new RegExp('^\\d{1,' + t + '}'), e, n); + } +} +function Cn(t, e, n) { + switch (t) { + case 1: + return bn(ln, e, n); + case 2: + return bn(dn, e, n); + case 3: + return bn(fn, e, n); + case 4: + return bn(vn, e, n); + default: + return bn(new RegExp('^-?\\d{1,' + t + '}'), e, n); + } +} +function An(t) { + switch (t) { + case 'morning': + return 4; + case 'evening': + return 17; + case 'pm': + case 'noon': + case 'afternoon': + return 12; + default: + return 0; + } +} +function En(t, e) { + var n, + r = e > 0, + i = r ? e : 1 - e; + if (i <= 50) n = t || 100; + else { + var a = i + 50; + n = t + 100 * Math.floor(a / 100) - (t >= a % 100 ? 100 : 0); + } + return r ? n : 1 - n; +} +var Dn = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], + On = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +function Sn(t) { + return t % 400 == 0 || (t % 4 == 0 && t % 100 != 0); +} +var Pn = { + G: { + priority: 140, + parse: function (t, e, n, r) { + switch (e) { + case 'G': + case 'GG': + case 'GGG': + return n.era(t, { width: 'abbreviated' }) || n.era(t, { width: 'narrow' }); + case 'GGGGG': + return n.era(t, { width: 'narrow' }); + default: + return n.era(t, { width: 'wide' }) || n.era(t, { width: 'abbreviated' }) || n.era(t, { width: 'narrow' }); + } + }, + set: function (t, e, n, r) { + return (e.era = n), t.setUTCFullYear(n, 0, 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ['R', 'u', 't', 'T'], + }, + y: { + priority: 130, + parse: function (t, e, n, r) { + var i = function (t) { + return { year: t, isTwoDigitYear: 'yy' === e }; + }; + switch (e) { + case 'y': + return Tn(4, t, i); + case 'yo': + return n.ordinalNumber(t, { unit: 'year', valueCallback: i }); + default: + return Tn(e.length, t, i); + } + }, + validate: function (t, e, n) { + return e.isTwoDigitYear || e.year > 0; + }, + set: function (t, e, n, r) { + var i = t.getUTCFullYear(); + if (n.isTwoDigitYear) { + var a = En(n.year, i); + return t.setUTCFullYear(a, 0, 1), t.setUTCHours(0, 0, 0, 0), t; + } + var o = 'era' in e && 1 !== e.era ? 1 - n.year : n.year; + return t.setUTCFullYear(o, 0, 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T'], + }, + Y: { + priority: 130, + parse: function (t, e, n, r) { + var i = function (t) { + return { year: t, isTwoDigitYear: 'YY' === e }; + }; + switch (e) { + case 'Y': + return Tn(4, t, i); + case 'Yo': + return n.ordinalNumber(t, { unit: 'year', valueCallback: i }); + default: + return Tn(e.length, t, i); + } + }, + validate: function (t, e, n) { + return e.isTwoDigitYear || e.year > 0; + }, + set: function (t, e, n, r) { + var i = ye(t, r); + if (n.isTwoDigitYear) { + var a = En(n.year, i); + return t.setUTCFullYear(a, 0, r.firstWeekContainsDate), t.setUTCHours(0, 0, 0, 0), pe(t, r); + } + var o = 'era' in e && 1 !== e.era ? 1 - n.year : n.year; + return t.setUTCFullYear(o, 0, r.firstWeekContainsDate), t.setUTCHours(0, 0, 0, 0), pe(t, r); + }, + incompatibleTokens: ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T'], + }, + R: { + priority: 130, + parse: function (t, e, n, r) { + return Cn('R' === e ? 4 : e.length, t); + }, + set: function (t, e, n, r) { + var i = new Date(0); + return i.setUTCFullYear(n, 0, 4), i.setUTCHours(0, 0, 0, 0), de(i); + }, + incompatibleTokens: ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T'], + }, + u: { + priority: 130, + parse: function (t, e, n, r) { + return Cn('u' === e ? 4 : e.length, t); + }, + set: function (t, e, n, r) { + return t.setUTCFullYear(n, 0, 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T'], + }, + Q: { + priority: 120, + parse: function (t, e, n, r) { + switch (e) { + case 'Q': + case 'QQ': + return Tn(e.length, t); + case 'Qo': + return n.ordinalNumber(t, { unit: 'quarter' }); + case 'QQQ': + return n.quarter(t, { width: 'abbreviated', context: 'formatting' }) || n.quarter(t, { width: 'narrow', context: 'formatting' }); + case 'QQQQQ': + return n.quarter(t, { width: 'narrow', context: 'formatting' }); + default: + return ( + n.quarter(t, { width: 'wide', context: 'formatting' }) || + n.quarter(t, { width: 'abbreviated', context: 'formatting' }) || + n.quarter(t, { width: 'narrow', context: 'formatting' }) + ); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 4; + }, + set: function (t, e, n, r) { + return t.setUTCMonth(3 * (n - 1), 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T'], + }, + q: { + priority: 120, + parse: function (t, e, n, r) { + switch (e) { + case 'q': + case 'qq': + return Tn(e.length, t); + case 'qo': + return n.ordinalNumber(t, { unit: 'quarter' }); + case 'qqq': + return n.quarter(t, { width: 'abbreviated', context: 'standalone' }) || n.quarter(t, { width: 'narrow', context: 'standalone' }); + case 'qqqqq': + return n.quarter(t, { width: 'narrow', context: 'standalone' }); + default: + return ( + n.quarter(t, { width: 'wide', context: 'standalone' }) || + n.quarter(t, { width: 'abbreviated', context: 'standalone' }) || + n.quarter(t, { width: 'narrow', context: 'standalone' }) + ); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 4; + }, + set: function (t, e, n, r) { + return t.setUTCMonth(3 * (n - 1), 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T'], + }, + M: { + priority: 110, + parse: function (t, e, n, r) { + var i = function (t) { + return t - 1; + }; + switch (e) { + case 'M': + return bn(Xe, t, i); + case 'MM': + return Tn(2, t, i); + case 'Mo': + return n.ordinalNumber(t, { unit: 'month', valueCallback: i }); + case 'MMM': + return n.month(t, { width: 'abbreviated', context: 'formatting' }) || n.month(t, { width: 'narrow', context: 'formatting' }); + case 'MMMMM': + return n.month(t, { width: 'narrow', context: 'formatting' }); + default: + return ( + n.month(t, { width: 'wide', context: 'formatting' }) || + n.month(t, { width: 'abbreviated', context: 'formatting' }) || + n.month(t, { width: 'narrow', context: 'formatting' }) + ); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 11; + }, + set: function (t, e, n, r) { + return t.setUTCMonth(n, 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T'], + }, + L: { + priority: 110, + parse: function (t, e, n, r) { + var i = function (t) { + return t - 1; + }; + switch (e) { + case 'L': + return bn(Xe, t, i); + case 'LL': + return Tn(2, t, i); + case 'Lo': + return n.ordinalNumber(t, { unit: 'month', valueCallback: i }); + case 'LLL': + return n.month(t, { width: 'abbreviated', context: 'standalone' }) || n.month(t, { width: 'narrow', context: 'standalone' }); + case 'LLLLL': + return n.month(t, { width: 'narrow', context: 'standalone' }); + default: + return ( + n.month(t, { width: 'wide', context: 'standalone' }) || + n.month(t, { width: 'abbreviated', context: 'standalone' }) || + n.month(t, { width: 'narrow', context: 'standalone' }) + ); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 11; + }, + set: function (t, e, n, r) { + return t.setUTCMonth(n, 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T'], + }, + w: { + priority: 100, + parse: function (t, e, n, r) { + switch (e) { + case 'w': + return bn(Ze, t); + case 'wo': + return n.ordinalNumber(t, { unit: 'week' }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 53; + }, + set: function (t, e, n, r) { + return pe( + (function (t, e, n) { + Qt(2, arguments); + var r = Bt(t), + i = It(e), + a = we(r, n) - i; + return r.setUTCDate(r.getUTCDate() - 7 * a), r; + })(t, n, r), + r + ); + }, + incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T'], + }, + I: { + priority: 100, + parse: function (t, e, n, r) { + switch (e) { + case 'I': + return bn(Ze, t); + case 'Io': + return n.ordinalNumber(t, { unit: 'week' }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 53; + }, + set: function (t, e, n, r) { + return de( + (function (t, e) { + Qt(2, arguments); + var n = Bt(t), + r = It(e), + i = ge(n) - r; + return n.setUTCDate(n.getUTCDate() - 7 * i), n; + })(t, n, r), + r + ); + }, + incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T'], + }, + d: { + priority: 90, + subPriority: 1, + parse: function (t, e, n, r) { + switch (e) { + case 'd': + return bn(Ke, t); + case 'do': + return n.ordinalNumber(t, { unit: 'date' }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + var r = Sn(t.getUTCFullYear()), + i = t.getUTCMonth(); + return r ? e >= 1 && e <= On[i] : e >= 1 && e <= Dn[i]; + }, + set: function (t, e, n, r) { + return t.setUTCDate(n), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T'], + }, + D: { + priority: 90, + subPriority: 1, + parse: function (t, e, n, r) { + switch (e) { + case 'D': + case 'DD': + return bn(Je, t); + case 'Do': + return n.ordinalNumber(t, { unit: 'date' }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return Sn(t.getUTCFullYear()) ? e >= 1 && e <= 366 : e >= 1 && e <= 365; + }, + set: function (t, e, n, r) { + return t.setUTCMonth(0, n), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T'], + }, + E: { + priority: 90, + parse: function (t, e, n, r) { + switch (e) { + case 'E': + case 'EE': + case 'EEE': + return ( + n.day(t, { width: 'abbreviated', context: 'formatting' }) || + n.day(t, { width: 'short', context: 'formatting' }) || + n.day(t, { width: 'narrow', context: 'formatting' }) + ); + case 'EEEEE': + return n.day(t, { width: 'narrow', context: 'formatting' }); + case 'EEEEEE': + return n.day(t, { width: 'short', context: 'formatting' }) || n.day(t, { width: 'narrow', context: 'formatting' }); + default: + return ( + n.day(t, { width: 'wide', context: 'formatting' }) || + n.day(t, { width: 'abbreviated', context: 'formatting' }) || + n.day(t, { width: 'short', context: 'formatting' }) || + n.day(t, { width: 'narrow', context: 'formatting' }) + ); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 6; + }, + set: function (t, e, n, r) { + return (t = Ge(t, n, r)).setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T'], + }, + e: { + priority: 90, + parse: function (t, e, n, r) { + var i = function (t) { + var e = 7 * Math.floor((t - 1) / 7); + return ((t + r.weekStartsOn + 6) % 7) + e; + }; + switch (e) { + case 'e': + case 'ee': + return Tn(e.length, t, i); + case 'eo': + return n.ordinalNumber(t, { unit: 'day', valueCallback: i }); + case 'eee': + return ( + n.day(t, { width: 'abbreviated', context: 'formatting' }) || + n.day(t, { width: 'short', context: 'formatting' }) || + n.day(t, { width: 'narrow', context: 'formatting' }) + ); + case 'eeeee': + return n.day(t, { width: 'narrow', context: 'formatting' }); + case 'eeeeee': + return n.day(t, { width: 'short', context: 'formatting' }) || n.day(t, { width: 'narrow', context: 'formatting' }); + default: + return ( + n.day(t, { width: 'wide', context: 'formatting' }) || + n.day(t, { width: 'abbreviated', context: 'formatting' }) || + n.day(t, { width: 'short', context: 'formatting' }) || + n.day(t, { width: 'narrow', context: 'formatting' }) + ); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 6; + }, + set: function (t, e, n, r) { + return (t = Ge(t, n, r)).setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T'], + }, + c: { + priority: 90, + parse: function (t, e, n, r) { + var i = function (t) { + var e = 7 * Math.floor((t - 1) / 7); + return ((t + r.weekStartsOn + 6) % 7) + e; + }; + switch (e) { + case 'c': + case 'cc': + return Tn(e.length, t, i); + case 'co': + return n.ordinalNumber(t, { unit: 'day', valueCallback: i }); + case 'ccc': + return ( + n.day(t, { width: 'abbreviated', context: 'standalone' }) || + n.day(t, { width: 'short', context: 'standalone' }) || + n.day(t, { width: 'narrow', context: 'standalone' }) + ); + case 'ccccc': + return n.day(t, { width: 'narrow', context: 'standalone' }); + case 'cccccc': + return n.day(t, { width: 'short', context: 'standalone' }) || n.day(t, { width: 'narrow', context: 'standalone' }); + default: + return ( + n.day(t, { width: 'wide', context: 'standalone' }) || + n.day(t, { width: 'abbreviated', context: 'standalone' }) || + n.day(t, { width: 'short', context: 'standalone' }) || + n.day(t, { width: 'narrow', context: 'standalone' }) + ); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 6; + }, + set: function (t, e, n, r) { + return (t = Ge(t, n, r)).setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T'], + }, + i: { + priority: 90, + parse: function (t, e, n, r) { + var i = function (t) { + return 0 === t ? 7 : t; + }; + switch (e) { + case 'i': + case 'ii': + return Tn(e.length, t); + case 'io': + return n.ordinalNumber(t, { unit: 'day' }); + case 'iii': + return ( + n.day(t, { + width: 'abbreviated', + context: 'formatting', + valueCallback: i, + }) || + n.day(t, { + width: 'short', + context: 'formatting', + valueCallback: i, + }) || + n.day(t, { + width: 'narrow', + context: 'formatting', + valueCallback: i, + }) + ); + case 'iiiii': + return n.day(t, { + width: 'narrow', + context: 'formatting', + valueCallback: i, + }); + case 'iiiiii': + return ( + n.day(t, { + width: 'short', + context: 'formatting', + valueCallback: i, + }) || + n.day(t, { + width: 'narrow', + context: 'formatting', + valueCallback: i, + }) + ); + default: + return ( + n.day(t, { + width: 'wide', + context: 'formatting', + valueCallback: i, + }) || + n.day(t, { + width: 'abbreviated', + context: 'formatting', + valueCallback: i, + }) || + n.day(t, { + width: 'short', + context: 'formatting', + valueCallback: i, + }) || + n.day(t, { + width: 'narrow', + context: 'formatting', + valueCallback: i, + }) + ); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 7; + }, + set: function (t, e, n, r) { + return ( + (t = (function (t, e) { + Qt(2, arguments); + var n = It(e); + n % 7 == 0 && (n -= 7); + var r = 1, + i = Bt(t), + a = i.getUTCDay(), + o = (((n % 7) + 7) % 7 < r ? 7 : 0) + n - a; + return i.setUTCDate(i.getUTCDate() + o), i; + })(t, n, r)), + t.setUTCHours(0, 0, 0, 0), + t + ); + }, + incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T'], + }, + a: { + priority: 80, + parse: function (t, e, n, r) { + switch (e) { + case 'a': + case 'aa': + case 'aaa': + return n.dayPeriod(t, { width: 'abbreviated', context: 'formatting' }) || n.dayPeriod(t, { width: 'narrow', context: 'formatting' }); + case 'aaaaa': + return n.dayPeriod(t, { width: 'narrow', context: 'formatting' }); + default: + return ( + n.dayPeriod(t, { width: 'wide', context: 'formatting' }) || + n.dayPeriod(t, { width: 'abbreviated', context: 'formatting' }) || + n.dayPeriod(t, { width: 'narrow', context: 'formatting' }) + ); + } + }, + set: function (t, e, n, r) { + return t.setUTCHours(An(n), 0, 0, 0), t; + }, + incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T'], + }, + b: { + priority: 80, + parse: function (t, e, n, r) { + switch (e) { + case 'b': + case 'bb': + case 'bbb': + return n.dayPeriod(t, { width: 'abbreviated', context: 'formatting' }) || n.dayPeriod(t, { width: 'narrow', context: 'formatting' }); + case 'bbbbb': + return n.dayPeriod(t, { width: 'narrow', context: 'formatting' }); + default: + return ( + n.dayPeriod(t, { width: 'wide', context: 'formatting' }) || + n.dayPeriod(t, { width: 'abbreviated', context: 'formatting' }) || + n.dayPeriod(t, { width: 'narrow', context: 'formatting' }) + ); + } + }, + set: function (t, e, n, r) { + return t.setUTCHours(An(n), 0, 0, 0), t; + }, + incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T'], + }, + B: { + priority: 80, + parse: function (t, e, n, r) { + switch (e) { + case 'B': + case 'BB': + case 'BBB': + return n.dayPeriod(t, { width: 'abbreviated', context: 'formatting' }) || n.dayPeriod(t, { width: 'narrow', context: 'formatting' }); + case 'BBBBB': + return n.dayPeriod(t, { width: 'narrow', context: 'formatting' }); + default: + return ( + n.dayPeriod(t, { width: 'wide', context: 'formatting' }) || + n.dayPeriod(t, { width: 'abbreviated', context: 'formatting' }) || + n.dayPeriod(t, { width: 'narrow', context: 'formatting' }) + ); + } + }, + set: function (t, e, n, r) { + return t.setUTCHours(An(n), 0, 0, 0), t; + }, + incompatibleTokens: ['a', 'b', 't', 'T'], + }, + h: { + priority: 70, + parse: function (t, e, n, r) { + switch (e) { + case 'h': + return bn(nn, t); + case 'ho': + return n.ordinalNumber(t, { unit: 'hour' }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 12; + }, + set: function (t, e, n, r) { + var i = t.getUTCHours() >= 12; + return i && n < 12 ? t.setUTCHours(n + 12, 0, 0, 0) : i || 12 !== n ? t.setUTCHours(n, 0, 0, 0) : t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ['H', 'K', 'k', 't', 'T'], + }, + H: { + priority: 70, + parse: function (t, e, n, r) { + switch (e) { + case 'H': + return bn(Ve, t); + case 'Ho': + return n.ordinalNumber(t, { unit: 'hour' }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 23; + }, + set: function (t, e, n, r) { + return t.setUTCHours(n, 0, 0, 0), t; + }, + incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T'], + }, + K: { + priority: 70, + parse: function (t, e, n, r) { + switch (e) { + case 'K': + return bn(en, t); + case 'Ko': + return n.ordinalNumber(t, { unit: 'hour' }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 11; + }, + set: function (t, e, n, r) { + return t.getUTCHours() >= 12 && n < 12 ? t.setUTCHours(n + 12, 0, 0, 0) : t.setUTCHours(n, 0, 0, 0), t; + }, + incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T'], + }, + k: { + priority: 70, + parse: function (t, e, n, r) { + switch (e) { + case 'k': + return bn(tn, t); + case 'ko': + return n.ordinalNumber(t, { unit: 'hour' }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 24; + }, + set: function (t, e, n, r) { + var i = n <= 24 ? n % 24 : n; + return t.setUTCHours(i, 0, 0, 0), t; + }, + incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T'], + }, + m: { + priority: 60, + parse: function (t, e, n, r) { + switch (e) { + case 'm': + return bn(rn, t); + case 'mo': + return n.ordinalNumber(t, { unit: 'minute' }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 59; + }, + set: function (t, e, n, r) { + return t.setUTCMinutes(n, 0, 0), t; + }, + incompatibleTokens: ['t', 'T'], + }, + s: { + priority: 50, + parse: function (t, e, n, r) { + switch (e) { + case 's': + return bn(an, t); + case 'so': + return n.ordinalNumber(t, { unit: 'second' }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 59; + }, + set: function (t, e, n, r) { + return t.setUTCSeconds(n, 0), t; + }, + incompatibleTokens: ['t', 'T'], + }, + S: { + priority: 30, + parse: function (t, e, n, r) { + return Tn(e.length, t, function (t) { + return Math.floor(t * Math.pow(10, 3 - e.length)); + }); + }, + set: function (t, e, n, r) { + return t.setUTCMilliseconds(n), t; + }, + incompatibleTokens: ['t', 'T'], + }, + X: { + priority: 10, + parse: function (t, e, n, r) { + switch (e) { + case 'X': + return kn(gn, t); + case 'XX': + return kn(pn, t); + case 'XXXX': + return kn(yn, t); + case 'XXXXX': + return kn(wn, t); + default: + return kn(mn, t); + } + }, + set: function (t, e, n, r) { + return e.timestampIsSet ? t : new Date(t.getTime() - n); + }, + incompatibleTokens: ['t', 'T', 'x'], + }, + x: { + priority: 10, + parse: function (t, e, n, r) { + switch (e) { + case 'x': + return kn(gn, t); + case 'xx': + return kn(pn, t); + case 'xxxx': + return kn(yn, t); + case 'xxxxx': + return kn(wn, t); + default: + return kn(mn, t); + } + }, + set: function (t, e, n, r) { + return e.timestampIsSet ? t : new Date(t.getTime() - n); + }, + incompatibleTokens: ['t', 'T', 'X'], + }, + t: { + priority: 40, + parse: function (t, e, n, r) { + return xn(t); + }, + set: function (t, e, n, r) { + return [new Date(1e3 * n), { timestampIsSet: !0 }]; + }, + incompatibleTokens: '*', + }, + T: { + priority: 20, + parse: function (t, e, n, r) { + return xn(t); + }, + set: function (t, e, n, r) { + return [new Date(n), { timestampIsSet: !0 }]; + }, + incompatibleTokens: '*', + }, + }, + Rn = Pn, + Un = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, + Mn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, + jn = /^'([^]*?)'?$/, + qn = /''/g, + $n = /\S/, + Nn = /[a-zA-Z]/; +function Hn(t, e, n, r) { + Qt(3, arguments); + var i = String(t), + a = String(e), + o = r || {}, + u = o.locale || se; + if (!u.match) throw new RangeError('locale must contain match property'); + var s = u.options && u.options.firstWeekContainsDate, + c = null == s ? 1 : It(s), + h = null == o.firstWeekContainsDate ? c : It(o.firstWeekContainsDate); + if (!(h >= 1 && h <= 7)) throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); + var l = u.options && u.options.weekStartsOn, + d = null == l ? 0 : It(l), + f = null == o.weekStartsOn ? d : It(o.weekStartsOn); + if (!(f >= 0 && f <= 6)) throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); + if ('' === a) return '' === i ? Bt(n) : new Date(NaN); + var v, + g = { firstWeekContainsDate: h, weekStartsOn: f, locale: u }, + p = [{ priority: 10, subPriority: -1, set: Yn, index: 0 }], + y = a + .match(Mn) + .map(function (t) { + var e = t[0]; + return 'p' === e || 'P' === e ? (0, je[e])(t, u.formatLong, g) : t; + }) + .join('') + .match(Un), + m = []; + for (v = 0; v < y.length; v++) { + var w = y[v]; + !o.useAdditionalWeekYearTokens && He(w) && Ye(w, a, t), !o.useAdditionalDayOfYearTokens && Ne(w) && Ye(w, a, t); + var b = w[0], + k = Rn[b]; + if (k) { + var x = k.incompatibleTokens; + if (Array.isArray(x)) { + for (var T = void 0, C = 0; C < m.length; C++) { + var A = m[C].token; + if (-1 !== x.indexOf(A) || A === b) { + T = m[C]; + break; + } + } + if (T) throw new RangeError("The format string mustn't contain `".concat(T.fullToken, '` and `').concat(w, '` at the same time')); + } else if ('*' === k.incompatibleTokens && m.length) throw new RangeError("The format string mustn't contain `".concat(w, '` and any other token at the same time')); + m.push({ token: b, fullToken: w }); + var E = k.parse(i, w, u.match, g); + if (!E) return new Date(NaN); + p.push({ + priority: k.priority, + subPriority: k.subPriority || 0, + set: k.set, + validate: k.validate, + value: E.value, + index: p.length, + }), + (i = E.rest); + } else { + if (b.match(Nn)) throw new RangeError('Format string contains an unescaped latin alphabet character `' + b + '`'); + if (("''" === w ? (w = "'") : "'" === b && (w = Ln(w)), 0 !== i.indexOf(w))) return new Date(NaN); + i = i.slice(w.length); + } + } + if (i.length > 0 && $n.test(i)) return new Date(NaN); + var D = p + .map(function (t) { + return t.priority; + }) + .sort(function (t, e) { + return e - t; + }) + .filter(function (t, e, n) { + return n.indexOf(t) === e; + }) + .map(function (t) { + return p + .filter(function (e) { + return e.priority === t; + }) + .sort(function (t, e) { + return e.subPriority - t.subPriority; + }); + }) + .map(function (t) { + return t[0]; + }), + O = Bt(n); + if (isNaN(O)) return new Date(NaN); + var S = ce(O, Xt(O)), + P = {}; + for (v = 0; v < D.length; v++) { + var R = D[v]; + if (R.validate && !R.validate(S, R.value, g)) return new Date(NaN); + var U = R.set(S, P, R.value, g); + U[0] ? ((S = U[0]), Be(P, U[1])) : (S = U); + } + return S; +} +function Yn(t, e) { + if (e.timestampIsSet) return t; + var n = new Date(0); + return n.setFullYear(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()), n.setHours(t.getUTCHours(), t.getUTCMinutes(), t.getUTCSeconds(), t.getUTCMilliseconds()), n; +} +function Ln(t) { + return t.match(jn)[1].replace(qn, "'"); +} +var Fn = (function (t) { + c(n, Pt); + var e = g(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return a(this, n), e.call(this, t, r, 'store-hour', i); + } + return ( + u(n, [ + { + 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, + n = Math.abs(t - e); + return Math.floor(n / 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 Hn(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 Hn(t, e ? 'HH:mm:ss' : 'HH:mm', new Date()); + }, + }, + { + key: 'humanReadableHoursRange', + get: function () { + return Jt(this.startDateInstance) && Jt(this.endDateInstance) + ? ''.concat(Ie(this.startDateInstance, 'p'), ' - ').concat(Ie(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!'); + }, + }, + ]), + n + ); + })(), + _n = (function (t) { + c(n, Pt); + var e = g(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return a(this, n), e.call(this, t, r, 'store-location', i); + } + return ( + u(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 Z( + this.getAttribute('hours').map(function (t) { + return new Fn(t); + }) + ); + }, + }, + { + key: 'isAlwaysOpen', + get: function () { + return this.hours.every(function (t) { + return null == t ? void 0 : t.is24Hours; + }); + }, + }, + { + key: 'today', + get: function () { + var t = Ie(new Date(), 'EEEE'); + return this.schedule[t]; + }, + }, + { + key: 'schedule', + get: function () { + for (var t = {}, e = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'], n = 0; n < e.length; n++) { + t[e[n]] = new Z(); + } + for (var r = 0; r < this.hours.length; r++) { + var i = this.hours.objectAt(r); + t[i.day].pushObject(i); + } + return t; + }, + }, + { + 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!'); + }, + }, + ]), + n + ); + })(), + Wn = (function (t) { + c(n, Pt); + var e = g(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return a(this, n), e.call(this, t, r, 'payment-gateway', i); + } + return ( + u(n, [ + { + 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!'); + }, + }, + ]), + n + ); + })(), + zn = (function (t) { + c(n, Pt); + var e = g(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return a(this, n), e.call(this, t, r, 'store', i); + } + return ( + u(n, [ + { + key: 'getReviews', + value: function () { + var t = this, + e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return this.adapter.get('reviews', r({ store: this.id }, e)).then(function (e) { + return new Z( + e.map(function (e) { + return new Ut(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', r({ store: this.id }, e)).then(function (e) { + return new Z( + e.map(function (e) { + return e.place && (e.place = new vt(e.place)), new _n(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 _n(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 Z( + e.map(function (e) { + return new Wn(e, t.adapter); + }) + ); + }); + }, + }, + { + key: 'getPaymentGateway', + value: function (t) { + var e = this; + return this.adapter.get('gateways/'.concat(t)).then(function (t) { + return new Wn(t, e.adapter); + }); + }, + }, + ]), + n + ); + })(), + In = (function (t) { + c(n, Pt); + var e = g(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return a(this, n), e.call(this, t, r, 'network', i); + } + return ( + u(n, [ + { + key: 'getTags', + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return this.adapter.get('tags', t); + }, + }, + { + key: 'getStores', + value: function () { + var t = this, + e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return this.adapter.get('stores', e).then(function (e) { + return new Z( + e.map(function (e) { + return new zn(e, t.adapter); + }) + ); + }); + }, + }, + { + key: 'getStoreLocations', + value: function () { + var t = this, + e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return this.adapter.get('store-locations', e).then(function (e) { + return new Z( + e.map(function (e) { + return new _n(e, t.adapter); + }) + ); + }); + }, + }, + { + key: 'getPaymentGateways', + value: function () { + var t = this; + return this.adapter.get('gateways').then(function (e) { + return new Z( + e.map(function (e) { + return new Wn(e, t.adapter); + }) + ); + }); + }, + }, + ]), + n + ); + })(), + Qn = Array.isArray, + Bn = (function (t) { + c(n, gt); + var e = g(n); + function n() { + var t, + r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + i = arguments.length > 1 ? arguments[1] : void 0, + o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return a(this, n), r instanceof pt ? v(t, (t = e.call(this, {}, r, 'service-quote', o))) : e.call(this, r, i, 'service-quote', o); + } + return ( + u( + n, + [ + { + key: 'setAdapter', + value: function (t) { + var e; + return ( + (this.adapter = t), + (this.store = new tr(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, + n = t.currency; + return Nt(e) || Nt(n) ? null : qt(e / 100, n); + }, + }, + { + key: 'fromCart', + value: function (t, e, r) { + var i, + a, + o, + u = this, + s = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 'storefront', + c = arguments.length > 4 && void 0 !== arguments[4] && arguments[4]; + return ( + null !== (i = t) && void 0 !== i && i.id && (t = t.id), + null !== (a = e) && void 0 !== a && a.id && (e = e.id), + null !== (o = r) && void 0 !== o && o.id && (r = r.id), + this.adapter + .get('service-quotes/from-cart', { + origin: t, + destination: e, + cart: r, + config: s, + all: c, + }) + .then(function (t) { + return Qn(t) + ? new Z( + t.map(function (t) { + return new n(t, u.adapter); + }) + ) + : new n(t, u.adapter); + }) + ); + }, + }, + ], + [ + { + key: 'getFromCart', + value: function (t) { + for (var e = new n(t), r = arguments.length, i = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++) i[a - 1] = arguments[a]; + return e.fromCart.apply(e, i); + }, + }, + ] + ), + n + ); + })(), + Gn = new ct({ + create: void 0, + findAll: void 0, + query: void 0, + queryRecord: void 0, + initialize: function (t, e, n, i) { + var a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {}, + o = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : {}; + return ( + et(t) && (t = t.id), + et(e) && (e = e.id), + et(n) && (n = n.id), + et(i) && (i = i.getAttribute('code')), + this.adapter.get(''.concat(this.namespace, '/before'), r(r({}, a), {}, { customer: t, cart: e, serviceQuote: n, gateway: i }), o) + ); + }, + captureOrder: function (t) { + var e = 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: e }, n).then(function (t) { + return new dt(t); + }); + }, + }), + Xn = (function (t) { + c(n, Pt); + var e = g(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return a(this, n), e.call(this, t, r, 'checkout', i); + } + return ( + u(n, [ + { + 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); + }, + }, + ]), + n + ); + })(), + Kn = { + Product: Ht, + Category: Yt, + Customer: Ft, + Cart: zt, + DeliveryServiceQuote: Bn, + Store: zn, + StoreLocation: _n, + StoreHour: Fn, + Checkout: Xn, + Review: Ut, + }, + Jn = { BrowserAdapter: yt, NodeAdapter: mt }, + Zn = (function () { + function t() { + return a(this, t), (this.resources = Kn), (this.adapters = Jn), this.lookup.apply(this, arguments); + } + return ( + u(t, [ + { + key: 'lookup', + value: function (t, e) { + var n = kt(t), + r = Array.prototype.slice.call(arguments).slice(2); + if (!this[n]) throw new Error('Attempted to resolve invalid type'); + if (!this[n][e]) throw new Error('No '.concat(xt(t), ' named ').concat(e, ' to resolve')); + return f(this[n][e], p(r)); + }, + }, + ]), + t + ); + })(), + Vn = function () { + return f(Zn, Array.prototype.slice.call(arguments)); + }, + tr = (function (t) { + c(n, St); + var e = g(n); + function n() { + return a(this, n), e.apply(this, arguments); + } + return ( + u(n, [ + { + key: 'extendActions', + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; + return Ot(this, t); + }, + }, + { + key: 'serialize', + value: function (t) { + return Vn('resource', Tt(this.resource), t, this.adapter); + }, + }, + ]), + n + ); + })(), + er = (function () { + function t(e) { + var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; + if ( + (a(this, t), + (this.version = n.version || 'v1'), + (this.options = { + version: this.version, + host: n.host || 'https://api.fleetbase.io', + namespace: 'storefront/'.concat(this.version) || n.namespace, + publicKey: e, + debug: r, + }), + !$t(e)) + ) + throw new Error('⚠️ Invalid Storefront key given to Storefront SDK'); + (this.adapter = n.adapter || Mt(this.options)), + (this.products = new tr('product', this.adapter)), + (this.categories = new tr('category', this.adapter)), + (this.reviews = new tr('review', this.adapter).extendActions(Rt)), + (this.customers = new tr('customer', this.adapter).extendActions(Lt)), + (this.cart = new tr('cart', this.adapter).extendActions(Wt)), + (this.checkout = new tr('checkout', this.adapter).extendActions(Gn)); + } + return ( + u( + 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', r({ query: t }, e)).then(function (t) { + return new Z( + t.map(function (t) { + return new Ht(t); + }) + ); + }); + }, + }, + { + key: 'setAdapter', + value: function (t) { + this.adapter = t; + }, + }, + { + key: 'getAdapter', + value: function () { + return this.adapter; + }, + }, + ], + [ + { + key: 'newInstance', + value: function () { + return f(t, Array.prototype.slice.call(arguments)); + }, + }, + ] + ), + t + ); + })(); +(exports.Cart = zt), + (exports.Category = Yt), + (exports.Checkout = Xn), + (exports.Customer = Ft), + (exports.DeliveryServiceQuote = Bn), + (exports.Network = In), + (exports.PaymentGateway = Wn), + (exports.Product = Ht), + (exports.Review = Ut), + (exports.Store = zn), + (exports.StoreHour = Fn), + (exports.StoreLocation = _n), + (exports.default = er); //# sourceMappingURL=storefront.js.map diff --git a/dist/esm/storefront.js b/dist/esm/storefront.js index 141c5ef..5510ba5 100644 --- a/dist/esm/storefront.js +++ b/dist/esm/storefront.js @@ -1,2 +1,6924 @@ -import t from"axios";function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:[];if(H(t))if(r.length<=6e4)t.splice.apply(t,[e,n].concat(q(r)));else{t.splice(e,n);for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:0,r=t.length,i=n;i2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=t.length;n<0&&(n+=i);var a=r&&e!=e?function(t){return t!=t}:function(t){return t===e};return I(t,a,n)},K=function(t,e,n){return L(t,e,0,[n]),n},J=function(t){E(n,R(Array));var e=M(n);function n(){for(var t=arguments.length,r=new Array(t),i=0;i0}},{key:"empty",get:function(){return 0===this.length}},{key:"first",get:function(){return W(this,0)}},{key:"last",get:function(){return W(this,this.length-1)}},{key:"replace",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return L(this,t,e,n),this}},{key:"objectsAt",value:function(t){var e=this;return t.map((function(t){return W(e,t)}))}},{key:"objectAt",value:function(t){return W(this,t)}},{key:"indexOf",value:function(t,e){return X(this,t,e,!1)}},{key:"lastIndexOf",value:function(t,e){var n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(var r=e;r>=0;r--)if(W(this,r)===t)return r;return-1}},{key:"includes",value:function(t,e){return-1!==X(this,t,e,!0)}},{key:"findBy",value:function(){return Q(this,z.apply(void 0,arguments))}},{key:"findIndexBy",value:function(){return I(this,z.apply(void 0,arguments))}},{key:"isEvery",value:function(){return G(this,z.apply(void 0,arguments))}},{key:"isAny",value:function(){return B(this,z.apply(void 0,arguments))}},{key:"invoke",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:F,n=[],r=new Set,i="function"==typeof e?e:function(t){return get(t,e)};return t.forEach((function(t){var e=i(t);r.has(e)||(r.add(e),n.push(t))})),n}(this,t)}},{key:"without",value:function(t){if(!this.includes(t))return this;var e=t==t?function(e){return e!==t}:function(t){return t==t};return this.filter(e)}},{key:"clear",value:function(){var t=this.length;return 0===t||this.replace(0,t,[]),this}},{key:"insertAt",value:function(t,e){return K(this,t,e),this}},{key:"replaceAt",value:function(t,e){return this.replace(t,1,[e])}},{key:"removeAt",value:function(t,e){return function(t,e){return L(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,[]),t}(this,t,e)}},{key:"pushObject",value:function(t){return this.insertAt(this.length,t)}},{key:"pushObjects",value:function(t){return this.replace(this.length,0,t),this}},{key:"popObject",value:function(){var t=this.length;if(0===t)return null;var e=W(this,t-1);return this.removeAt(t-1,1),e}},{key:"shiftObject",value:function(){if(0===this.length)return null;var t=W(this,0);return this.removeAt(0),t}},{key:"unshiftObject",value:function(t){return K(this,0,t)}},{key:"unshiftObjects",value:function(t){return this.replace(0,0,t),this}},{key:"reverseObjects",value:function(){var t=this.length;if(0===t)return this;var e=this.toArray().reverse();return this.replace(0,t,e),this}},{key:"setObjects",value:function(t){if(0===t.length)return this.clear();var e=this.length;return this.replace(0,e,t),this}},{key:"removeObject",value:function(t){for(var e=this.length||0;--e>=0;)W(this,e)===t&&this.removeAt(e);return this}},{key:"removeObjects",value:function(t){for(var e=t.length-1;e>=0;e--)this.removeObject(t[e]);return this}},{key:"addObject",value:function(t){return this.includes(t)||this.pushObject(t),this}},{key:"addObjects",value:function(t){var e=this;return t.forEach((function(t){return e.addObject(t)})),this}}]),n}(),Z=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var n=w(t);if("object"===n){var r=t.size;if("number"==typeof r)return!r}if("number"==typeof t.length&&"function"!==n)return!t.length;if("object"===n){var i=t.length;if("number"==typeof i)return!i}return!1},V=function(t){return Z(t)||"string"==typeof t&&!1===/\S/.test(t)};function tt(t){return t instanceof ct}var et=function(){var t,e,n,r,i;return!("undefined"==typeof process||"object"!==w(null===(t=process)||void 0===t?void 0:t.env)&&-1===(null===(e=process.release)||void 0===e||null===(n=e.name)||void 0===n?void 0:n.search(/node|io.js/))||"undefined"!=typeof window&&"ReactNative"!==(null===(r=window)||void 0===r||null===(i=r.navigator)||void 0===i?void 0:i.product))},nt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return et()?Et("adapter","NodeAdapter",t):Et("adapter","BrowserAdapter",t)},rt=Array.isArray;!function(){function t(e){T(this,t),this.place=e,this.geometry=null==e?void 0:e.geometry,this.components=this.parseComponents(),this.attributes=this.parseProperties()}C(t,[{key:"parse",value:function(){this.parseComponents(),this.parseProperties()}},{key:"parseComponents",value:function(){var t;return((null===(t=this.place)||void 0===t?void 0:t.address_components)||[]).reduce((function(t,e){return e.types.forEach((function(n){t[n]=e})),t}),{})}},{key:"parseProperties",value:function(){var t,e={streetNumber:this.get("street_number"),streetName:this.get("route"),coordinates:null!==(t=this.geometry)&&void 0!==t&&t.location?Object.values(this.geometry.location):[0,0],city:this.or(["locality","sublocality","sublocality_level_1","neighborhood","administrative_area_level_3","administrative_area_level_2"]),county:this.get("administrative_area_level_2"),stateShort:this.get("administrative_area_level_1",!0),stateLong:this.get("administrative_area_level_1"),countryShort:this.get("country",!0),country:this.get("country",!0),countryLong:this.get("country"),postalCode:this.get("postal_code")};return e.address=[e.streetNumber,e.streetName].filter(Boolean).join(" "),e}},{key:"all",value:function(){return this.attributes}},{key:"or",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=0;e1&&void 0!==arguments[1]&&arguments[1];return t in this.components?e?this.components[t].short_name:this.components[t].long_name:null}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.attributes=m(m({},this.attributes),t),this}},{key:"setAttribute",value:function(t,e){return this.attributes[t]=e,this}},{key:"getAttribute",value:function(t){return this.attributes[t]||null}}])}();var it=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;T(this,t),this.type="Point",this.coordinates=[n,e]}return C(t,[{key:"latitude",get:function(){return this.coordinates[1]}},{key:"longitude",get:function(){return this.coordinates[0]}},{key:"lat",value:function(){return this.latitude}},{key:"lng",value:function(){return this.longitude}},{key:"serialize",value:function(){return{type:"Point",coorindates:[this.lat(),this.lng()]}}},{key:"toJson",value:function(){return this.serialize()}},{key:"toString",value:function(){return"(".concat(this.latitude,", ").concat(this.longitude,")")}}],[{key:"fromGeoJson",value:function(e){var n=j(e.coordinates,2);return longitude=n[0],latitude=n[1],new t(latitude,longitude)}}]),t}();"undefined"==typeof arguments||arguments;var at=function(t,e){var n=t();return Array.isArray(n)||"object"===w(n)?ot(n,e):null},ot=function t(e,n){var r,i=e,a=w(e),o="object"===a,u="function"===a,s=Array.isArray(e),c="string"===w(n)&&n.includes(".")?n.split("."):[n];if(s||o){for(var h=0;h0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;T(this,t),this.actions=e,this.bind=n}return C(t,[{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=t||this.bind;if(!e)return this;if(null!=this&&this.actions&&"object"===w(this.actions))for(var n in this.actions){var r=this.actions[n];ut(e,n,"function"==typeof r?r.bind(e):r)}return this}}]),t}(),ct=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};T(this,t),this.attributes=e,this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isDestroying=!1,this.isReloading=!1,this.resource=r,this.options=i,this.version=i.version||"v1",this.setAdapter(n)}return C(t,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ot(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"id",get:function(){return this.getAttribute("id")}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.mergeAttributes(e);return this.setFlags(["isLoading","isSaving"]),this.store.create(n).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setFlags(["isLoading","isSaving"]),this.store.update(this.attributes.id,e).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"destroy",value:function(){var t=this;return this.setFlags(["isLoading","isDestroying"]),this.store.destroy(this.attributes.id).then((function(e){return t.setFlags(["isLoading","isDestroying"],!1),e}))}},{key:"reload",value:function(){var t=this;return this.setFlags(["isLoading","isReloading"]),this.store.findRecord(this.attributes.id).then((function(e){return t.reset(),e}))}},{key:"setFlags",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=["isLoading","isSaving","isReloading","isDestroying"],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAttributes();return Z(this.id)?this.create(e):!0===t.onlyDirty?this.savedirty():this.update(e)}},{key:"saveDirty",value:function(){for(var t=Object.keys(this.dirtyAttributes),e={},n=0;n0}},{key:"mutate",value:function(t,e){this.attributes[t]=e}},{key:"setAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===n&&"object"===w(t))return this.setAttributes(t);var r=null!==(e=null==this?void 0:this.attributes[t])&&void 0!==e?e:null;return ut(this.attributes,t,n),ut(this.dirtyAttributes,t,r),H(null==this?void 0:this.changes[t])||(this.changes[t]=[]),this.changes[t].push({property:t,previousValue:r,value:n,changedAt:new Date}),this}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)this.setAttribute(e,t[e]);return this}},{key:"getAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=ot(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{},t);return void 0===r?n:r}},{key:"hasAttribute",value:function(t){if(H(t)){var e,n=t,r=Object.keys(null!==(e=this.attributes)&&void 0!==e?e:{});return n.every((function(t){return r.includes(t)}))}return!(null==this||!this.attributes)&&t in this.attributes}},{key:"hasAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.hasAttribute(t)}},{key:"isAttributeFilled",value:function(t){var e=this;return H(t)?this.hasAttribute(t)&&t.every((function(t){return!Z(e.getAttribute(t))})):this.hasAttribute(t)&&!Z(this.getAttribute(t))}},{key:"getAttributes",value:function(t){var e={};if(null==t)return this.getAttributes(Object.keys(this.attributes));if("string"==typeof t)return this.getAttribute(Array.prototype.slice.call(arguments));if(!H(t))throw new Error("No attribute properties provided!");for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=null!==(t=null==this?void 0:this.attributes)&&void 0!==t?t:{};return this.attributes=m(m({},n),e),this.attributes}},{key:"syncAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attributes=t}}]),t}(),ht=new st({getDistanceAndTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("".concat(this.namespace,"/").concat(t,"/distance-and-time"),{},e)}}),lt=function(t){E(n,ct);var e=M(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"order",m({actions:ht},i))}return C(n,[{key:"getDistanceAndTime",value:function(){return this.store.getDistanceAndTime(this.id)}}]),n}(),dt=function(t){E(n,ct);var e=M(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"payload",i)}return C(n,[{key:"attach",value:function(t){}},{key:"entities",get:function(){}},{key:"dropoff",get:function(){}},{key:"pickup",get:function(){}},{key:"waypoints",get:function(){return new J(this.waypoints)}}]),n}();!function(t){E(n,ct);var e=M(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"entity",i)}}();var ft=function(t){E(n,ct);var e=M(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"place",i)}return C(n,[{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new it))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new it))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}},{key:"setOwner",value:function(t){return tt(t)&&this.setAttribute("owner",t.id),"string"==typeof t&&this.setAttribute("owner",t),this}}],[{key:"fromGoogleAddress",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.getAttribute("coordinates"),a=j(i,2),o=a[0],u=a[1],s={name:null,address:t.getAttribute("address"),location:new it(o,u),street1:t.getAttribute("streetName"),street2:null,city:t.getAttribute("city"),province:t.getAttribute("stateLong"),postal_code:t.getAttribute("postalCode"),neighborhood:t.get("neighborhood"),district:t.getAttribute("county"),building:t.get("building"),country:t.getAttribute("countryShort"),phone:null,security_access_code:null};return new n(s,e,r)}}]),n}();!function(t){E(n,ft);var e=M(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"waypoint",i)}}(),function(t){E(n,ct);var e=M(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"tracking-status",i)}}(),function(t){E(n,ct);var e=M(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"vehicle",i)}}(),function(t){E(n,ct);var e=M(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"driver",i)}}(),function(t){E(n,ct);var e=M(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"vendor",i)}}(),function(t){E(n,ct);var e=M(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"contact",i)}}(),function(t){E(n,ct);var e=M(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"zone",i)}}(),function(t){E(n,ct);var e=M(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"service-area",i)}}(),function(t){E(n,ct);var e=M(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"service-rate",i)}}();var vt=function(t){E(n,ct);var e=M(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,n),e.call(this,t,r,"service-quote",i)}return C(n,[{key:"fromPreliminary",value:function(){}},{key:"fromPayload",value:function(){}}]),n}(),gt=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};T(this,t),this.version=e.version||"v1",this.host=e.host||null,this.namespace=e.namespace||null,this.headers=e.headers||{}},pt=function(t){E(n,gt);var e=M(n);function n(t){var r;return T(this,n),(r=e.call(this,t)).setHeaders({Authorization:"Bearer ".concat(t.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;browser"}),r}return C(n,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.headers=m(m({},this.headers),t),this}},{key:"parseJSON",value:function(t){return new Promise((function(e,n){return t.json().then((function(n){return e({statusText:t.statusText,status:t.status,ok:t.ok,json:n})})).catch((function(){n(new Error("Oops! Something went wrong when handling your request."))}))}))}},{key:"request",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(a,o){return fetch(i.url||"".concat(e.host,"/").concat(e.namespace,"/").concat(t),m({method:n,mode:i.mode||"cors",headers:new Headers(m(m({},e.headers||{}),i.headers||{}))},r)).then(e.parseJSON).then((function(t){return t.ok?a(t.json):o(new Error(t.json.errors?t.json.errors[0]:t.statusText))})).catch((function(t){o(t)}))}))}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=V(e)?"":new URLSearchParams(e).toString();return this.request("".concat(t).concat(r?"?".concat(r):""),"GET",{},n)}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"POST",{body:JSON.stringify(e)},n)}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PUT",{body:JSON.stringify(e)},n)}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(t,"DELETE",{},e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PATCH",{body:JSON.stringify(e)},n)}}]),n}(),yt=function(e){E(r,gt);var n=M(r);function r(e){var i;return T(this,r),(i=n.call(this,e)).axios=t.create({baseURL:"".concat(i.host,"/").concat(i.namespace),headers:{Authorization:"Bearer ".concat(e.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;node"}}),i}return C(r,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.axios.defaults.headers.common;return this.axios.defaults.headers.common=m(m({},e),t),this}},{key:"transform",value:function(t){return t.data}},{key:"handleError",value:function(t){if(t.response){var e=t.response.data;if(H(e.errors))throw new Error(e.errors[0]);if(e.error)throw new Error(e.error)}throw t}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=V(e)?"":new URLSearchParams(e).toString();return this.axios.get("".concat(t).concat(r?"?".concat(r):""),n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.post(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.put(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.axios.delete(t,e).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.patch(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}}]),r}(),mt=function(t){E(n,gt);var e=M(n);function n(){return T(this,n),e.apply(this,arguments)}return n}(),wt=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];T(this,t),A(this,"uncountableWords",["equipment","information","rice","money","species","series","fish","sheep","moose","deer","news"]),A(this,"pluralRules",[[new RegExp("(m)an$","gi"),"$1en"],[new RegExp("(pe)rson$","gi"),"$1ople"],[new RegExp("(child)$","gi"),"$1ren"],[new RegExp("^(ox)$","gi"),"$1en"],[new RegExp("(ax|test)is$","gi"),"$1es"],[new RegExp("(octop|vir)us$","gi"),"$1i"],[new RegExp("(alias|status)$","gi"),"$1es"],[new RegExp("(bu)s$","gi"),"$1ses"],[new RegExp("(buffal|tomat|potat)o$","gi"),"$1oes"],[new RegExp("([ti])um$","gi"),"$1a"],[new RegExp("sis$","gi"),"ses"],[new RegExp("(?:([^f])fe|([lr])f)$","gi"),"$1$2ves"],[new RegExp("(hive)$","gi"),"$1s"],[new RegExp("([^aeiouy]|qu)y$","gi"),"$1ies"],[new RegExp("(x|ch|ss|sh)$","gi"),"$1es"],[new RegExp("(matr|vert|ind)ix|ex$","gi"),"$1ices"],[new RegExp("([m|l])ouse$","gi"),"$1ice"],[new RegExp("(quiz)$","gi"),"$1zes"],[new RegExp("s$","gi"),"s"],[new RegExp("$","gi"),"s"]]),A(this,"singularRules",[[new RegExp("(m)en$","gi"),"$1an"],[new RegExp("(pe)ople$","gi"),"$1rson"],[new RegExp("(child)ren$","gi"),"$1"],[new RegExp("([ti])a$","gi"),"$1um"],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi"),"$1$2sis"],[new RegExp("(hive)s$","gi"),"$1"],[new RegExp("(tive)s$","gi"),"$1"],[new RegExp("(curve)s$","gi"),"$1"],[new RegExp("([lr])ves$","gi"),"$1f"],[new RegExp("([^fo])ves$","gi"),"$1fe"],[new RegExp("([^aeiouy]|qu)ies$","gi"),"$1y"],[new RegExp("(s)eries$","gi"),"$1eries"],[new RegExp("(m)ovies$","gi"),"$1ovie"],[new RegExp("(x|ch|ss|sh)es$","gi"),"$1"],[new RegExp("([m|l])ice$","gi"),"$1ouse"],[new RegExp("(bus)es$","gi"),"$1"],[new RegExp("(o)es$","gi"),"$1"],[new RegExp("(shoe)s$","gi"),"$1"],[new RegExp("(cris|ax|test)es$","gi"),"$1is"],[new RegExp("(octop|vir)i$","gi"),"$1us"],[new RegExp("(alias|status)es$","gi"),"$1"],[new RegExp("^(ox)en","gi"),"$1"],[new RegExp("(vert|ind)ices$","gi"),"$1ex"],[new RegExp("(matr)ices$","gi"),"$1ix"],[new RegExp("(quiz)zes$","gi"),"$1"],[new RegExp("s$","gi"),""]]),A(this,"nonTitlecasedWords",["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"]),A(this,"idSuffix",new RegExp("(_ids|_id)$","g")),A(this,"underbar",new RegExp("_","g")),A(this,"spaceOrUnderbar",new RegExp("[ _]","g")),A(this,"uppercase",new RegExp("([A-Z])","g")),A(this,"underbarPrefix",new RegExp("^_")),this.str=e,this.chain=n}return C(t,[{key:"get",value:function(){return this.str}},{key:"applyRules",value:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:null;return t=t||this.str,this.applyRules(t,this.pluralRules,this.uncountableWords,e)}},{key:"singularize",value:function(t,e){return t=t||this.str,this.applyRules(t,this.singularRules,this.uncountableWords,e)}},{key:"camelize",value:function(t,e){for(var n=(t=t||this.str).split("/"),r=0;r1&&void 0!==arguments[1]&&arguments[1];return t=t||this.str,t=this.underscore(this.demodulize(t))+(e?"":"_")+"id",this.str=t,!0===this.chain?this:t}},{key:"ordinalize",value:function(t){for(var e=(t=t||this.str).split(" "),n=0;n1&&void 0!==arguments[1]?arguments[1]:[];if(t.actions=H(e)?e:[e],!H(e))return e instanceof st&&e.extend(t),t;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};T(this,t),this.resource=e,this.adapter=n||nt(),this.namespace=bt(e),this.storage=new J,this.options=r,this.extendActions(r.actions)}return C(t,[{key:"extendActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Dt(this,t)}},{key:"deposit",value:function(t){return t}},{key:"serialize",value:function(t){return Et("resource",Tt(this.resource),t,this.adapter)}},{key:"afterFetch",value:function(t){return function(t,e){if("function"==typeof t.options.onAfterFetch&&t.options.onAfterFetch(e),H(e)){for(var n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=k(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.post("".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"update",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(function(){var i=k(regeneratorRuntime.mark((function i(a,o){var u;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,e.adapter.put("".concat(e.namespace,"/").concat(t),n,r).then(e.afterFetch.bind(e)).catch(o);case 2:u=i.sent,a(u);case 4:case"end":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}())}},{key:"findRecord",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=k(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.adapter.get("".concat(e.namespace,"/").concat(t),{},n).then(e.afterFetch.bind(e)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"findAll",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var n=k(regeneratorRuntime.mark((function n(r,i){var a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.adapter.get("".concat(t.namespace),{},e).then(t.afterFetch.bind(t)).catch(i);case 2:a=n.sent,r(a);case 4:case"end":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}())}},{key:"query",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=k(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get("".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"queryRecord",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.single=!0,new Promise(function(){var r=k(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get("".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"destroy",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=tt(t)?t.getAttribute("id"):t;return new Promise(function(){var t=k(regeneratorRuntime.mark((function t(i,a){var o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.adapter.delete("".concat(e.namespace,"/").concat(r),{},n).then(e.afterFetch.bind(e)).catch(a);case 2:o=t.sent,i(o);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())}}]),t}();!function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(T(this,t),this.version=n.version||"v1",this.options={version:this.version,host:n.host||"https://api.fleetbase.io",namespace:this.version||n.namespace,debug:r,publicKey:e},"string"!=typeof e||0===e.length)throw new Error("⚠️ Invalid public key given to Fleetbase SDK");if(!et()&&e.toLowerCase().startsWith("$"))throw new Error("Secret key provided. You must use a public key with Fleetbase Javascript SDK!");this.adapter=n.adapter||nt(this.options),this.orders=new Ot("order",this.adapter).extendActions(ht),this.entities=new Ot("entity",this.adapter),this.places=new Ot("place",this.adapter),this.drivers=new Ot("driver",this.adapter),this.vehicles=new Ot("vehicle",this.adapter),this.vendors=new Ot("vendor",this.adapter),this.contacts=new Ot("contact",this.adapter)}C(t,[{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return P(t,Array.prototype.slice.call(arguments))}}])}();var St=function(t){s(n,ct);var e=v(n);function n(){return i(this,n),e.apply(this,arguments)}return o(n,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Vn(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}}]),n}(),Pt=new st({count:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};return t&&(n.store=t),this.adapter.get("".concat(this.namespace,"/count"),n,e)}}),Rt=function(t){s(n,St);var e=v(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,n),e.call(this,t,r,"review",a)}return o(n,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),n}(),Ut=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return et()?Zn("adapter","NodeAdapter",t):Zn("adapter","BrowserAdapter",t)},Mt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(t)};function jt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:n}).format(t)}var qt=function(t){return"string"==typeof t&&t.length>30&&(t.startsWith("store_")||t.startsWith("network_"))},$t=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var n=r(t);if("object"===n){var i=t.size;if("number"==typeof i)return!i}if("number"==typeof t.length&&"function"!==n)return!t.length;if("object"===n){var a=t.length;if("number"==typeof a)return!a}return!1},Nt=function(t){s(n,St);var e=v(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,n),e.call(this,t,r,"product",a)}return o(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,n=t.sale_price,r=t.currency;return this.isOnSale?$t(n)||$t(r)?null:jt(n/100,r):$t(e)||$t(r)?null:jt(e/100,r)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(e){return new J(e.map((function(e){return new Rt(e,t.adapter)})))}))}}]),n}(),Ht=function(t){s(n,St);var e=v(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,n),e.call(this,t,r,"category",a)}return o(n,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(e){return new J(e.map((function(e){return new Nt(e,t.adapter)})))}))}}]),n}(),Yt=new st({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(Mt(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)}}),Lt=function(t){s(r,St);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),e.call(this,t,a,"customer",n({actions:Yt},o))}return o(r,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Vn(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:function(t){var e=this;return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",t).then((function(){return e}))}},{key:"getSavedPlaces",value:function(){var t=this;return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/places").then((function(e){return new J(e.map((function(e){return new ft(e,t.adapter)})))}))}},{key:"getOrderHistory",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/orders",e).then((function(e){return new J(e.map((function(e){return new lt(e,t.adapter)})))}))}}]),r}(),Ft=Array.isArray,_t=new st({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,i=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({},i),{},{quantity:r}),a).then(this.afterFetch.bind(this))},update:function(t,e,r){var i=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({},i),{},{quantity:r}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},n).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)}}),Wt=function(t){s(r,St);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),e.call(this,t,a,"cart",n({actions:_t},o))}return o(r,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof Nt&&(t=t.id),this.store.add(this.id,t,e,n,r)}},{key:"update",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,n,r)}},{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!Ft(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),r}();function zt(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function It(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function Qt(t){It(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function Bt(t,e){It(2,arguments);var n=Qt(t).getTime(),r=zt(e);return new Date(n+r)}function Gt(t){var 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 Xt(t){return It(1,arguments),t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}function Kt(t){if(It(1,arguments),!Xt(t)&&"number"!=typeof t)return!1;var e=Qt(t);return!isNaN(Number(e))}var Jt={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"}},Zt=function(t,e,n){var r,i=Jt[t];return r="string"==typeof i?i:1===e?i.one:i.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Vt(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var te={date:Vt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Vt({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:Vt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ee={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ne(t){return function(e,n){var r,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,o=i.width?String(i.width):a;r=t.formattingValues[o]||t.formattingValues[a]}else{var u=t.defaultWidth,s=i.width?String(i.width):t.defaultWidth;r=t.values[s]||t.values[u]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function re(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],a=e.match(i);if(!a)return null;var o,u=a[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(s)?ae(s,(function(t){return t.test(u)})):ie(s,(function(t){return t.test(u)}));o=t.valueCallback?t.valueCallback(c):c,o=n.valueCallback?n.valueCallback(o):o;var h=e.slice(u.length);return{value:o,rest:h}}}function ie(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function ae(t,e){for(var n=0;n20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:ne({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ne({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:ne({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:ne({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:ne({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:(oe={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(oe.matchPattern);if(!n)return null;var r=n[0],i=t.match(oe.parsePattern);if(!i)return null;var a=oe.valueCallback?oe.valueCallback(i[0]):i[0];a=e.valueCallback?e.valueCallback(a):a;var o=t.slice(r.length);return{value:a,rest:o}}),era:re({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:re({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:function(t){return t+1}}),month:re({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:re({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:re({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 se(t,e){It(2,arguments);var n=zt(e);return Bt(t,-n)}function ce(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?n:1-n;return ce("yy"===e?r%100:r,e.length)},M:function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):ce(n+1,2)},d:function(t,e){return ce(t.getUTCDate(),e.length)},a:function(t,e){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(t,e){return ce(t.getUTCHours()%12||12,e.length)},H:function(t,e){return ce(t.getUTCHours(),e.length)},m:function(t,e){return ce(t.getUTCMinutes(),e.length)},s:function(t,e){return ce(t.getUTCSeconds(),e.length)},S:function(t,e){var n=e.length,r=t.getUTCMilliseconds();return ce(Math.floor(r*Math.pow(10,n-3)),e.length)}};function le(t){It(1,arguments);var e=1,n=Qt(t),r=n.getUTCDay(),i=(r=i.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function fe(t){It(1,arguments);var e=de(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=le(n);return r}function ve(t){It(1,arguments);var e=Qt(t),n=le(e).getTime()-fe(e).getTime();return Math.round(n/6048e5)+1}function ge(t,e){It(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.weekStartsOn,a=null==i?0:zt(i),o=null==n.weekStartsOn?a:zt(n.weekStartsOn);if(!(o>=0&&o<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Qt(t),s=u.getUTCDay(),c=(s=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(r+1,0,s),c.setUTCHours(0,0,0,0);var h=ge(c,e),l=new Date(0);l.setUTCFullYear(r,0,s),l.setUTCHours(0,0,0,0);var d=ge(l,e);return n.getTime()>=h.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function ye(t,e){It(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.firstWeekContainsDate,a=null==i?1:zt(i),o=null==n.firstWeekContainsDate?a:zt(n.firstWeekContainsDate),u=pe(t,e),s=new Date(0);s.setUTCFullYear(u,0,o),s.setUTCHours(0,0,0,0);var c=ge(s,e);return c}function me(t,e){It(1,arguments);var n=Qt(t),r=ge(n,e).getTime()-ye(n,e).getTime();return Math.round(r/6048e5)+1}var we="midnight",be="noon",ke="morning",Te="afternoon",xe="evening",Ce="night",Ae={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return he.y(t,e)},Y:function(t,e,n,r){var i=pe(t,r),a=i>0?i:1-i;return"YY"===e?ce(a%100,2):"Yo"===e?n.ordinalNumber(a,{unit:"year"}):ce(a,e.length)},R:function(t,e){return ce(de(t),e.length)},u:function(t,e){return ce(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return ce(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return ce(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return he.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return ce(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var i=me(t,r);return"wo"===e?n.ordinalNumber(i,{unit:"week"}):ce(i,e.length)},I:function(t,e,n){var r=ve(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):ce(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):he.d(t,e)},D:function(t,e,n){var r=function(t){It(1,arguments);var e=Qt(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),i=n-r;return Math.floor(i/864e5)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):ce(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return ce(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return ce(a,e.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),i=0===r?7:r;switch(e){case"i":return String(i);case"ii":return ce(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,i=t.getUTCHours();switch(r=12===i?be:0===i?we:i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,i=t.getUTCHours();switch(r=i>=17?xe:i>=12?Te:i>=4?ke:Ce,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return he.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):he.H(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):ce(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):ce(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):he.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):he.s(t,e)},S:function(t,e){return he.S(t,e)},X:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return De(i);case"XXXX":case"XX":return Oe(i);default:return Oe(i,":")}},x:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return De(i);case"xxxx":case"xx":return Oe(i);default:return Oe(i,":")}},O:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ee(i,":");default:return"GMT"+Oe(i,":")}},z:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ee(i,":");default:return"GMT"+Oe(i,":")}},t:function(t,e,n,r){var i=r._originalDate||t;return ce(Math.floor(i.getTime()/1e3),e.length)},T:function(t,e,n,r){return ce((r._originalDate||t).getTime(),e.length)}};function Ee(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),a=r%60;if(0===a)return n+String(i);var o=e||"";return n+String(i)+o+ce(a,2)}function De(t,e){return t%60==0?(t>0?"-":"+")+ce(Math.abs(t)/60,2):Oe(t,e)}function Oe(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t);return r+ce(Math.floor(i/60),2)+n+ce(i%60,2)}var Se=Ae;function Pe(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"})}}function Re(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"})}}var Ue={p:Re,P:function(t,e){var n,r=t.match(/(P+)(p+)?/),i=r[1],a=r[2];if(!a)return Pe(t,e);switch(i){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",Pe(i,e)).replace("{{time}}",Re(a,e))}},Me=Ue,je=["D","DD"],qe=["YY","YYYY"];function $e(t){return-1!==je.indexOf(t)}function Ne(t){return-1!==qe.indexOf(t)}function He(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var Ye=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Le=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Fe=/^'([^]*?)'?$/,_e=/''/g,We=/[a-zA-Z]/;function ze(t,e,n){It(2,arguments);var r=String(e),i=n||{},a=i.locale||ue,o=a.options&&a.options.firstWeekContainsDate,u=null==o?1:zt(o),s=null==i.firstWeekContainsDate?u:zt(i.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=a.options&&a.options.weekStartsOn,h=null==c?0:zt(c),l=null==i.weekStartsOn?h:zt(i.weekStartsOn);if(!(l>=0&&l<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var d=Qt(t);if(!Kt(d))throw new RangeError("Invalid time value");var f=Gt(d),v=se(d,f),g={firstWeekContainsDate:s,weekStartsOn:l,locale:a,_originalDate:d},p=r.match(Le).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,Me[e])(t,a.formatLong,g):t})).join("").match(Ye).map((function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return Ie(n);var o=Se[r];if(o)return!i.useAdditionalWeekYearTokens&&Ne(n)&&He(n,e,t),!i.useAdditionalDayOfYearTokens&&$e(n)&&He(n,e,t),o(v,n,a.localize,g);if(r.match(We))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n})).join("");return p}function Ie(t){return t.match(Fe)[1].replace(_e,"'")}function Qe(t,e){if(null==t)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e=e||{})Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function Be(t,e,n){It(2,arguments);var r=n||{},i=r.locale,a=i&&i.options&&i.options.weekStartsOn,o=null==a?0:zt(a),u=null==r.weekStartsOn?o:zt(r.weekStartsOn);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=Qt(t),c=zt(e),h=s.getUTCDay(),l=c%7,d=(l+7)%7,f=(d0,i=r?e:1-e;if(i<=50)n=t||100;else{var a=i+50;n=t+100*Math.floor(a/100)-(t>=a%100?100:0)}return r?n:1-n}var En=[31,28,31,30,31,30,31,31,30,31,30,31],Dn=[31,29,31,30,31,30,31,31,30,31,30,31];function On(t){return t%400==0||t%4==0&&t%100!=0}var Sn={G:{priority:140,parse:function(t,e,n,r){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}},set:function(t,e,n,r){return e.era=n,t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["R","u","t","T"]},y:{priority:130,parse:function(t,e,n,r){var i=function(t){return{year:t,isTwoDigitYear:"yy"===e}};switch(e){case"y":return Tn(4,t,i);case"yo":return n.ordinalNumber(t,{unit:"year",valueCallback:i});default:return Tn(e.length,t,i)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,r){var i=t.getUTCFullYear();if(n.isTwoDigitYear){var a=An(n.year,i);return t.setUTCFullYear(a,0,1),t.setUTCHours(0,0,0,0),t}var o="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(o,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","u","w","I","i","e","c","t","T"]},Y:{priority:130,parse:function(t,e,n,r){var i=function(t){return{year:t,isTwoDigitYear:"YY"===e}};switch(e){case"Y":return Tn(4,t,i);case"Yo":return n.ordinalNumber(t,{unit:"year",valueCallback:i});default:return Tn(e.length,t,i)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,r){var i=pe(t,r);if(n.isTwoDigitYear){var a=An(n.year,i);return t.setUTCFullYear(a,0,r.firstWeekContainsDate),t.setUTCHours(0,0,0,0),ge(t,r)}var o="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(o,0,r.firstWeekContainsDate),t.setUTCHours(0,0,0,0),ge(t,r)},incompatibleTokens:["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:{priority:130,parse:function(t,e,n,r){return xn("R"===e?4:e.length,t)},set:function(t,e,n,r){var i=new Date(0);return i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0),le(i)},incompatibleTokens:["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:{priority:130,parse:function(t,e,n,r){return xn("u"===e?4:e.length,t)},set:function(t,e,n,r){return t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["G","y","Y","R","w","I","i","e","c","t","T"]},Q:{priority:120,parse:function(t,e,n,r){switch(e){case"Q":case"QQ":return Tn(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,r){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:{priority:120,parse:function(t,e,n,r){switch(e){case"q":case"qq":return Tn(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,r){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:{priority:110,parse:function(t,e,n,r){var i=function(t){return t-1};switch(e){case"M":return wn(Ge,t,i);case"MM":return Tn(2,t,i);case"Mo":return n.ordinalNumber(t,{unit:"month",valueCallback:i});case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]},L:{priority:110,parse:function(t,e,n,r){var i=function(t){return t-1};switch(e){case"L":return wn(Ge,t,i);case"LL":return Tn(2,t,i);case"Lo":return n.ordinalNumber(t,{unit:"month",valueCallback:i});case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:{priority:100,parse:function(t,e,n,r){switch(e){case"w":return wn(Je,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return Tn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,r){return ge(function(t,e,n){It(2,arguments);var r=Qt(t),i=zt(e),a=me(r,n)-i;return r.setUTCDate(r.getUTCDate()-7*a),r}(t,n,r),r)},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:{priority:100,parse:function(t,e,n,r){switch(e){case"I":return wn(Je,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return Tn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,r){return le(function(t,e){It(2,arguments);var n=Qt(t),r=zt(e),i=ve(n)-r;return n.setUTCDate(n.getUTCDate()-7*i),n}(t,n,r),r)},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:{priority:90,subPriority:1,parse:function(t,e,n,r){switch(e){case"d":return wn(Xe,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return Tn(e.length,t)}},validate:function(t,e,n){var r=On(t.getUTCFullYear()),i=t.getUTCMonth();return r?e>=1&&e<=Dn[i]:e>=1&&e<=En[i]},set:function(t,e,n,r){return t.setUTCDate(n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:{priority:90,subPriority:1,parse:function(t,e,n,r){switch(e){case"D":case"DD":return wn(Ke,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return Tn(e.length,t)}},validate:function(t,e,n){return On(t.getUTCFullYear())?e>=1&&e<=366:e>=1&&e<=365},set:function(t,e,n,r){return t.setUTCMonth(0,n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:{priority:90,parse:function(t,e,n,r){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=Be(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["D","i","e","c","t","T"]},e:{priority:90,parse:function(t,e,n,r){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return Tn(e.length,t,i);case"eo":return n.ordinalNumber(t,{unit:"day",valueCallback:i});case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=Be(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:{priority:90,parse:function(t,e,n,r){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return Tn(e.length,t,i);case"co":return n.ordinalNumber(t,{unit:"day",valueCallback:i});case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=Be(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:{priority:90,parse:function(t,e,n,r){var i=function(t){return 0===t?7:t};switch(e){case"i":case"ii":return Tn(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return n.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiii":return n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiiii":return n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i});default:return n.day(t,{width:"wide",context:"formatting",valueCallback:i})||n.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i})}},validate:function(t,e,n){return e>=1&&e<=7},set:function(t,e,n,r){return t=function(t,e){It(2,arguments);var n=zt(e);n%7==0&&(n-=7);var r=1,i=Qt(t),a=i.getUTCDay(),o=((n%7+7)%7=1&&e<=12},set:function(t,e,n,r){var i=t.getUTCHours()>=12;return i&&n<12?t.setUTCHours(n+12,0,0,0):i||12!==n?t.setUTCHours(n,0,0,0):t.setUTCHours(0,0,0,0),t},incompatibleTokens:["H","K","k","t","T"]},H:{priority:70,parse:function(t,e,n,r){switch(e){case"H":return wn(Ze,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return Tn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=23},set:function(t,e,n,r){return t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","K","k","t","T"]},K:{priority:70,parse:function(t,e,n,r){switch(e){case"K":return wn(tn,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return Tn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.getUTCHours()>=12&&n<12?t.setUTCHours(n+12,0,0,0):t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","H","k","t","T"]},k:{priority:70,parse:function(t,e,n,r){switch(e){case"k":return wn(Ve,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return Tn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=24},set:function(t,e,n,r){var i=n<=24?n%24:n;return t.setUTCHours(i,0,0,0),t},incompatibleTokens:["a","b","h","H","K","t","T"]},m:{priority:60,parse:function(t,e,n,r){switch(e){case"m":return wn(nn,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return Tn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,r){return t.setUTCMinutes(n,0,0),t},incompatibleTokens:["t","T"]},s:{priority:50,parse:function(t,e,n,r){switch(e){case"s":return wn(rn,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return Tn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,r){return t.setUTCSeconds(n,0),t},incompatibleTokens:["t","T"]},S:{priority:30,parse:function(t,e,n,r){return Tn(e.length,t,(function(t){return Math.floor(t*Math.pow(10,3-e.length))}))},set:function(t,e,n,r){return t.setUTCMilliseconds(n),t},incompatibleTokens:["t","T"]},X:{priority:10,parse:function(t,e,n,r){switch(e){case"X":return bn(vn,t);case"XX":return bn(gn,t);case"XXXX":return bn(pn,t);case"XXXXX":return bn(mn,t);default:return bn(yn,t)}},set:function(t,e,n,r){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","x"]},x:{priority:10,parse:function(t,e,n,r){switch(e){case"x":return bn(vn,t);case"xx":return bn(gn,t);case"xxxx":return bn(pn,t);case"xxxxx":return bn(mn,t);default:return bn(yn,t)}},set:function(t,e,n,r){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","X"]},t:{priority:40,parse:function(t,e,n,r){return kn(t)},set:function(t,e,n,r){return[new Date(1e3*n),{timestampIsSet:!0}]},incompatibleTokens:"*"},T:{priority:20,parse:function(t,e,n,r){return kn(t)},set:function(t,e,n,r){return[new Date(n),{timestampIsSet:!0}]},incompatibleTokens:"*"}},Pn=Sn,Rn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Un=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Mn=/^'([^]*?)'?$/,jn=/''/g,qn=/\S/,$n=/[a-zA-Z]/;function Nn(t,e,n,r){It(3,arguments);var i=String(t),a=String(e),o=r||{},u=o.locale||ue;if(!u.match)throw new RangeError("locale must contain match property");var s=u.options&&u.options.firstWeekContainsDate,c=null==s?1:zt(s),h=null==o.firstWeekContainsDate?c:zt(o.firstWeekContainsDate);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var l=u.options&&u.options.weekStartsOn,d=null==l?0:zt(l),f=null==o.weekStartsOn?d:zt(o.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===a)return""===i?Qt(n):new Date(NaN);var v,g={firstWeekContainsDate:h,weekStartsOn:f,locale:u},p=[{priority:10,subPriority:-1,set:Hn,index:0}],y=a.match(Un).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,Me[e])(t,u.formatLong,g):t})).join("").match(Rn),m=[];for(v=0;v0&&qn.test(i))return new Date(NaN);var D=p.map((function(t){return t.priority})).sort((function(t,e){return e-t})).filter((function(t,e,n){return n.indexOf(t)===e})).map((function(t){return p.filter((function(e){return e.priority===t})).sort((function(t,e){return e.subPriority-t.subPriority}))})).map((function(t){return t[0]})),O=Qt(n);if(isNaN(O))return new Date(NaN);var S=se(O,Gt(O)),P={};for(v=0;v0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,n),e.call(this,t,r,"store-hour",a)}return o(n,[{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,n=Math.abs(t-e);return Math.floor(n/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 Nn(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 Nn(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return Kt(this.startDateInstance)&&Kt(this.endDateInstance)?"".concat(ze(this.startDateInstance,"p")," - ").concat(ze(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!")}}]),n}(),Fn=function(t){s(n,St);var e=v(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,n),e.call(this,t,r,"store-location",a)}return o(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 J(this.getAttribute("hours").map((function(t){return new Ln(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=ze(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},e=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,n),e.call(this,t,r,"payment-gateway",a)}return o(n,[{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!")}}]),n}(),Wn=function(t){s(r,St);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,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),e.call(this,t,n,"store",a)}return o(r,[{key:"getReviews",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",n({store:this.id},e)).then((function(e){return new J(e.map((function(e){return new Rt(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",n({store:this.id},e)).then((function(e){return new J(e.map((function(e){return e.place&&(e.place=new ft(e.place)),new Fn(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 Fn(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 J(e.map((function(e){return new _n(e,t.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)}))}}]),r}(),zn=function(t){s(n,St);var e=v(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,n),e.call(this,t,r,"network",a)}return o(n,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getStores",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("stores",e).then((function(e){return new J(e.map((function(e){return new Wn(e,t.adapter)})))}))}},{key:"getStoreLocations",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("store-locations",e).then((function(e){return new J(e.map((function(e){return new Fn(e,t.adapter)})))}))}},{key:"getPaymentGateways",value:function(){var t=this;return this.adapter.get("gateways").then((function(e){return new J(e.map((function(e){return new _n(e,t.adapter)})))}))}}]),n}(),In=Array.isArray,Qn=function(t){s(n,vt);var e=v(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,n),r instanceof gt?f(t,t=e.call(this,{},r,"service-quote",o)):e.call(this,r,a,"service-quote",o)}return o(n,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Vn(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,n=t.currency;return $t(e)||$t(n)?null:jt(e/100,n)}},{key:"fromCart",value:function(t,e,r){var i,a,o,u=this,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"storefront",c=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return null!==(i=t)&&void 0!==i&&i.id&&(t=t.id),null!==(a=e)&&void 0!==a&&a.id&&(e=e.id),null!==(o=r)&&void 0!==o&&o.id&&(r=r.id),this.adapter.get("service-quotes/from-cart",{origin:t,destination:e,cart:r,config:s,all:c}).then((function(t){return In(t)?new J(t.map((function(t){return new n(t,u.adapter)}))):new n(t,u.adapter)}))}}],[{key:"getFromCart",value:function(t){for(var e=new n(t),r=arguments.length,i=new Array(r>1?r-1:0),a=1;a4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return tt(t)&&(t=t.id),tt(e)&&(e=e.id),tt(r)&&(r=r.id),tt(i)&&(i=i.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),n(n({},a),{},{customer:t,cart:e,serviceQuote:r,gateway:i}),o)},captureOrder:function(t){var e=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:e},n).then((function(t){return new lt(t)}))}}),Gn=function(t){s(n,St);var e=v(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,n),e.call(this,t,r,"checkout",a)}return o(n,[{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)}}]),n}(),Xn={Product:Nt,Category:Ht,Customer:Lt,Cart:Wt,DeliveryServiceQuote:Qn,Store:Wn,StoreLocation:Fn,StoreHour:Ln,Checkout:Gn,Review:Rt},Kn={BrowserAdapter:pt,NodeAdapter:yt},Jn=function(){function t(){return i(this,t),this.resources=Xn,this.adapters=Kn,this.lookup.apply(this,arguments)}return o(t,[{key:"lookup",value:function(t,e){var n=bt(t),r=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][e])throw new Error("No ".concat(kt(t)," named ").concat(e," to resolve"));return d(this[n][e],g(r))}}]),t}(),Zn=function(){return d(Jn,Array.prototype.slice.call(arguments))},Vn=function(t){s(n,Ot);var e=v(n);function n(){return i(this,n),e.apply(this,arguments)}return o(n,[{key:"extendActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Dt(this,t)}},{key:"serialize",value:function(t){return Zn("resource",Tt(this.resource),t,this.adapter)}}]),n}(),tr=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(i(this,t),this.version=n.version||"v1",this.options={version:this.version,host:n.host||"https://api.fleetbase.io",namespace:"storefront/".concat(this.version)||n.namespace,publicKey:e,debug:r},!qt(e))throw new Error("⚠️ Invalid Storefront key given to Storefront SDK");this.adapter=n.adapter||Ut(this.options),this.products=new Vn("product",this.adapter),this.categories=new Vn("category",this.adapter),this.reviews=new Vn("review",this.adapter).extendActions(Pt),this.customers=new Vn("customer",this.adapter).extendActions(Yt),this.cart=new Vn("cart",this.adapter).extendActions(_t),this.checkout=new Vn("checkout",this.adapter).extendActions(Bn)}return o(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",n({query:t},e)).then((function(t){return new J(t.map((function(t){return new Nt(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return d(t,Array.prototype.slice.call(arguments))}}]),t}();export{Wt as Cart,Ht as Category,Gn as Checkout,Lt as Customer,Qn as DeliveryServiceQuote,zn as Network,_n as PaymentGateway,Nt as Product,Rt as Review,Wn as Store,Ln as StoreHour,Fn as StoreLocation,tr as default}; +import t from "axios"; +function e(t, e) { + var n = Object.keys(t); + if (Object.getOwnPropertySymbols) { + var r = Object.getOwnPropertySymbols(t); + e && + (r = r.filter(function (e) { + return Object.getOwnPropertyDescriptor(t, e).enumerable; + })), + n.push.apply(n, r); + } + return n; +} +function n(t) { + for (var n = 1; n < arguments.length; n++) { + var r = null != arguments[n] ? arguments[n] : {}; + n % 2 + ? e(Object(r), !0).forEach(function (e) { + u(t, e, r[e]); + }) + : Object.getOwnPropertyDescriptors + ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) + : e(Object(r)).forEach(function (e) { + Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e)); + }); + } + return t; +} +function r(t) { + return ( + (r = + "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; + }), + r(t) + ); +} +function i(t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); +} +function a(t, e) { + for (var n = 0; n < e.length; n++) { + var r = e[n]; + (r.enumerable = r.enumerable || !1), + (r.configurable = !0), + "value" in r && (r.writable = !0), + Object.defineProperty(t, r.key, r); + } +} +function o(t, e, n) { + return e && a(t.prototype, e), n && a(t, n), t; +} +function u(t, e, n) { + return ( + e in t + ? Object.defineProperty(t, e, { + value: n, + enumerable: !0, + configurable: !0, + writable: !0, + }) + : (t[e] = n), + t + ); +} +function s(t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError("Super expression must either be null or a function"); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && h(t, e); +} +function c(t) { + return ( + (c = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + }), + c(t) + ); +} +function h(t, e) { + return ( + (h = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + }), + h(t, e) + ); +} +function l() { + if ("undefined" == typeof Reflect || !Reflect.construct) return !1; + if (Reflect.construct.sham) return !1; + if ("function" == typeof Proxy) return !0; + try { + return ( + Boolean.prototype.valueOf.call( + Reflect.construct(Boolean, [], function () {}), + ), + !0 + ); + } catch (t) { + return !1; + } +} +function d(t, e, n) { + return ( + (d = l() + ? Reflect.construct + : function (t, e, n) { + var r = [null]; + r.push.apply(r, e); + var i = new (Function.bind.apply(t, r))(); + return n && h(i, n.prototype), i; + }), + d.apply(null, arguments) + ); +} +function f(t, e) { + if (e && ("object" == typeof e || "function" == typeof e)) return e; + if (void 0 !== e) + throw new TypeError( + "Derived constructors may only return object or undefined", + ); + return (function (t) { + if (void 0 === t) + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + return t; + })(t); +} +function v(t) { + var e = l(); + return function () { + var n, + r = c(t); + if (e) { + var i = c(this).constructor; + n = Reflect.construct(r, arguments, i); + } else n = r.apply(this, arguments); + return f(this, n); + }; +} +function g(t) { + return ( + (function (t) { + if (Array.isArray(t)) return p(t); + })(t) || + (function (t) { + if ( + ("undefined" != typeof Symbol && null != t[Symbol.iterator]) || + null != t["@@iterator"] + ) + return Array.from(t); + })(t) || + (function (t, e) { + if (!t) return; + if ("string" == typeof t) return p(t, e); + var n = Object.prototype.toString.call(t).slice(8, -1); + "Object" === n && t.constructor && (n = t.constructor.name); + if ("Map" === n || "Set" === n) return Array.from(t); + if ( + "Arguments" === n || + /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) + ) + return p(t, e); + })(t) || + (function () { + throw new TypeError( + "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.", + ); + })() + ); +} +function p(t, e) { + (null == e || e > t.length) && (e = t.length); + for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; + return r; +} +function y(t, e) { + var n = Object.keys(t); + if (Object.getOwnPropertySymbols) { + var r = Object.getOwnPropertySymbols(t); + e && + (r = r.filter(function (e) { + return Object.getOwnPropertyDescriptor(t, e).enumerable; + })), + n.push.apply(n, r); + } + return n; +} +function m(t) { + for (var e = 1; e < arguments.length; e++) { + var n = null != arguments[e] ? arguments[e] : {}; + e % 2 + ? y(Object(n), !0).forEach(function (e) { + A(t, e, n[e]); + }) + : Object.getOwnPropertyDescriptors + ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) + : y(Object(n)).forEach(function (e) { + Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e)); + }); + } + return t; +} +function w(t) { + return (w = + "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; + })(t); +} +function b(t, e, n, r, i, a, o) { + try { + var u = t[a](o), + s = u.value; + } catch (t) { + return void n(t); + } + u.done ? e(s) : Promise.resolve(s).then(r, i); +} +function k(t) { + return function () { + var e = this, + n = arguments; + return new Promise(function (r, i) { + var a = t.apply(e, n); + function o(t) { + b(a, r, i, o, u, "next", t); + } + function u(t) { + b(a, r, i, o, u, "throw", t); + } + o(void 0); + }); + }; +} +function T(t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); +} +function x(t, e) { + for (var n = 0; n < e.length; n++) { + var r = e[n]; + (r.enumerable = r.enumerable || !1), + (r.configurable = !0), + "value" in r && (r.writable = !0), + Object.defineProperty(t, r.key, r); + } +} +function C(t, e, n) { + return e && x(t.prototype, e), n && x(t, n), t; +} +function A(t, e, n) { + return ( + e in t + ? Object.defineProperty(t, e, { + value: n, + enumerable: !0, + configurable: !0, + writable: !0, + }) + : (t[e] = n), + t + ); +} +function E(t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError("Super expression must either be null or a function"); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && O(t, e); +} +function D(t) { + return (D = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + })(t); +} +function O(t, e) { + return (O = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + })(t, e); +} +function S() { + if ("undefined" == typeof Reflect || !Reflect.construct) return !1; + if (Reflect.construct.sham) return !1; + if ("function" == typeof Proxy) return !0; + try { + return ( + Boolean.prototype.valueOf.call( + Reflect.construct(Boolean, [], function () {}), + ), + !0 + ); + } catch (t) { + return !1; + } +} +function P(t, e, n) { + return (P = S() + ? Reflect.construct + : function (t, e, n) { + var r = [null]; + r.push.apply(r, e); + var i = new (Function.bind.apply(t, r))(); + return n && O(i, n.prototype), i; + }).apply(null, arguments); +} +function R(t) { + var e = "function" == typeof Map ? new Map() : void 0; + return (R = function (t) { + if ( + null === t || + ((n = t), -1 === Function.toString.call(n).indexOf("[native code]")) + ) + return t; + var n; + if ("function" != typeof t) + throw new TypeError("Super expression must either be null or a function"); + if (void 0 !== e) { + if (e.has(t)) return e.get(t); + e.set(t, r); + } + function r() { + return P(t, arguments, D(this).constructor); + } + return ( + (r.prototype = Object.create(t.prototype, { + constructor: { + value: r, + enumerable: !1, + writable: !0, + configurable: !0, + }, + })), + O(r, t) + ); + })(t); +} +function U(t, e) { + return !e || ("object" != typeof e && "function" != typeof e) + ? (function (t) { + if (void 0 === t) + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + return t; + })(t) + : e; +} +function M(t) { + var e = S(); + return function () { + var n, + r = D(t); + if (e) { + var i = D(this).constructor; + n = Reflect.construct(r, arguments, i); + } else n = r.apply(this, arguments); + return U(this, n); + }; +} +function j(t, e) { + return ( + (function (t) { + if (Array.isArray(t)) return t; + })(t) || + (function (t, e) { + var n = + null == t + ? null + : ("undefined" != typeof Symbol && t[Symbol.iterator]) || + t["@@iterator"]; + if (null != n) { + var r, + i, + a = [], + o = !0, + u = !1; + try { + for ( + n = n.call(t); + !(o = (r = n.next()).done) && + (a.push(r.value), !e || a.length !== e); + o = !0 + ); + } catch (t) { + (u = !0), (i = t); + } finally { + try { + o || null == n.return || n.return(); + } finally { + if (u) throw i; + } + } + return a; + } + })(t, e) || + $(t, e) || + (function () { + throw new TypeError( + "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.", + ); + })() + ); +} +function q(t) { + return ( + (function (t) { + if (Array.isArray(t)) return N(t); + })(t) || + (function (t) { + if ( + ("undefined" != typeof Symbol && null != t[Symbol.iterator]) || + null != t["@@iterator"] + ) + return Array.from(t); + })(t) || + $(t) || + (function () { + throw new TypeError( + "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.", + ); + })() + ); +} +function $(t, e) { + if (t) { + if ("string" == typeof t) return N(t, e); + var n = Object.prototype.toString.call(t).slice(8, -1); + return ( + "Object" === n && t.constructor && (n = t.constructor.name), + "Map" === n || "Set" === n + ? Array.from(t) + : "Arguments" === n || + /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) + ? N(t, e) + : void 0 + ); + } +} +function N(t, e) { + (null == e || e > t.length) && (e = t.length); + for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; + return r; +} +var H = Array.isArray, + Y = "undefined" == typeof arguments ? void 0 : arguments, + L = function (t, e, n) { + var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : []; + if (H(t)) + if (r.length <= 6e4) t.splice.apply(t, [e, n].concat(q(r))); + else { + t.splice(e, n); + for (var i = 0; i < r.length; i += 6e4) { + var a = r.slice(i, i + 6e4); + t.splice.apply(t, [e + i, 0].concat(q(a))); + } + } + else _(arr) && t.replace(e, n, r); + }, + F = function (t) { + return t; + }, + _ = function (t) { + return t instanceof J; + }, + W = function (t, e) { + return H(t) ? t[e] : _(t) ? t.objectAt(e) : null; + }, + z = function (t, e) { + return 2 === Y.length + ? function (n) { + return e === n[t]; + } + : function (e) { + return Boolean(e[t]); + }; + }, + I = function (t, e) { + for ( + var n = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, + r = t.length, + i = n; + i < r; + i++ + ) { + var a = W(t, i); + if (e(a, i, t)) return i; + } + return -1; + }, + Q = function (t, e, n) { + var r = e.bind(n), + i = I(t, r, 0); + return -1 === i ? void 0 : W(t, i); + }, + B = function (t, e, n) { + var r = e.bind(n); + return -1 !== I(t, r, 0); + }, + G = function (t, e, n) { + var r = e.bind(n); + return ( + -1 === + I( + t, + function (t, e, n) { + return !r(t, e, n); + }, + 0, + ) + ); + }, + X = function (t, e) { + var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, + r = arguments.length > 3 ? arguments[3] : void 0, + i = t.length; + n < 0 && (n += i); + var a = + r && e != e + ? function (t) { + return t != t; + } + : function (t) { + return t === e; + }; + return I(t, a, n); + }, + K = function (t, e, n) { + return L(t, e, 0, [n]), n; + }, + J = (function (t) { + E(n, R(Array)); + var e = M(n); + function n() { + for (var t = arguments.length, r = new Array(t), i = 0; i < t; i++) + r[i] = arguments[i]; + return ( + T(this, n), + U( + H(arguments[0]) + ? e.call.apply(e, [this].concat(q(arguments[0]))) + : e.apply(this, arguments), + ) + ); + } + return ( + C(n, [ + { + key: "notEmpty", + get: function () { + return this.length > 0; + }, + }, + { + key: "empty", + get: function () { + return 0 === this.length; + }, + }, + { + key: "first", + get: function () { + return W(this, 0); + }, + }, + { + key: "last", + get: function () { + return W(this, this.length - 1); + }, + }, + { + key: "replace", + value: function (t, e) { + var n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : []; + return L(this, t, e, n), this; + }, + }, + { + key: "objectsAt", + value: function (t) { + var e = this; + return t.map(function (t) { + return W(e, t); + }); + }, + }, + { + key: "objectAt", + value: function (t) { + return W(this, t); + }, + }, + { + key: "indexOf", + value: function (t, e) { + return X(this, t, e, !1); + }, + }, + { + key: "lastIndexOf", + value: function (t, e) { + var n = this.length; + (void 0 === e || e >= n) && (e = n - 1), e < 0 && (e += n); + for (var r = e; r >= 0; r--) if (W(this, r) === t) return r; + return -1; + }, + }, + { + key: "includes", + value: function (t, e) { + return -1 !== X(this, t, e, !0); + }, + }, + { + key: "findBy", + value: function () { + return Q(this, z.apply(void 0, arguments)); + }, + }, + { + key: "findIndexBy", + value: function () { + return I(this, z.apply(void 0, arguments)); + }, + }, + { + key: "isEvery", + value: function () { + return G(this, z.apply(void 0, arguments)); + }, + }, + { + key: "isAny", + value: function () { + return B(this, z.apply(void 0, arguments)); + }, + }, + { + key: "invoke", + value: function (t) { + for ( + var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; + r < e; + r++ + ) + n[r - 1] = arguments[r]; + var i = []; + return ( + this.forEach(function (e) { + var r; + return i.push( + null === (r = e[t]) || void 0 === r + ? void 0 + : r.call.apply(r, [e].concat(n)), + ); + }), + i + ); + }, + }, + { + key: "toArray", + value: function () { + return this.map(function (t) { + return t; + }); + }, + }, + { + key: "compact", + value: function () { + return this.filter(function (t) { + return null != t; + }); + }, + }, + { + key: "sortBy", + value: function () { + var t = arguments; + return this.sort(function (e, n) { + for (var r = 0; r < t.length; r++) { + var i = t[r], + a = e[i], + o = n[i], + u = compare(a, o); + if (u) return u; + } + return 0; + }); + }, + }, + { + key: "uniqBy", + value: function (t) { + return (function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : F, + n = [], + r = new Set(), + i = + "function" == typeof e + ? e + : function (t) { + return get(t, e); + }; + return ( + t.forEach(function (t) { + var e = i(t); + r.has(e) || (r.add(e), n.push(t)); + }), + n + ); + })(this, t); + }, + }, + { + key: "without", + value: function (t) { + if (!this.includes(t)) return this; + var e = + t == t + ? function (e) { + return e !== t; + } + : function (t) { + return t == t; + }; + return this.filter(e); + }, + }, + { + key: "clear", + value: function () { + var t = this.length; + return 0 === t || this.replace(0, t, []), this; + }, + }, + { + key: "insertAt", + value: function (t, e) { + return K(this, t, e), this; + }, + }, + { + key: "replaceAt", + value: function (t, e) { + return this.replace(t, 1, [e]); + }, + }, + { + key: "removeAt", + value: function (t, e) { + return (function (t, e) { + return ( + L( + t, + e, + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : 1, + [], + ), + t + ); + })(this, t, e); + }, + }, + { + key: "pushObject", + value: function (t) { + return this.insertAt(this.length, t); + }, + }, + { + key: "pushObjects", + value: function (t) { + return this.replace(this.length, 0, t), this; + }, + }, + { + key: "popObject", + value: function () { + var t = this.length; + if (0 === t) return null; + var e = W(this, t - 1); + return this.removeAt(t - 1, 1), e; + }, + }, + { + key: "shiftObject", + value: function () { + if (0 === this.length) return null; + var t = W(this, 0); + return this.removeAt(0), t; + }, + }, + { + key: "unshiftObject", + value: function (t) { + return K(this, 0, t); + }, + }, + { + key: "unshiftObjects", + value: function (t) { + return this.replace(0, 0, t), this; + }, + }, + { + key: "reverseObjects", + value: function () { + var t = this.length; + if (0 === t) return this; + var e = this.toArray().reverse(); + return this.replace(0, t, e), this; + }, + }, + { + key: "setObjects", + value: function (t) { + if (0 === t.length) return this.clear(); + var e = this.length; + return this.replace(0, e, t), this; + }, + }, + { + key: "removeObject", + value: function (t) { + for (var e = this.length || 0; --e >= 0; ) + W(this, e) === t && this.removeAt(e); + return this; + }, + }, + { + key: "removeObjects", + value: function (t) { + for (var e = t.length - 1; e >= 0; e--) this.removeObject(t[e]); + return this; + }, + }, + { + key: "addObject", + value: function (t) { + return this.includes(t) || this.pushObject(t), this; + }, + }, + { + key: "addObjects", + value: function (t) { + var e = this; + return ( + t.forEach(function (t) { + return e.addObject(t); + }), + this + ); + }, + }, + ]), + n + ); + })(), + Z = function (t) { + var e = null == t; + if (e) return e; + if ("number" == typeof t.size) return !t.size; + var n = w(t); + if ("object" === n) { + var r = t.size; + if ("number" == typeof r) return !r; + } + if ("number" == typeof t.length && "function" !== n) return !t.length; + if ("object" === n) { + var i = t.length; + if ("number" == typeof i) return !i; + } + return !1; + }, + V = function (t) { + return Z(t) || ("string" == typeof t && !1 === /\S/.test(t)); + }; +function tt(t) { + return t instanceof ct; +} +var et = function () { + var t, e, n, r, i; + return !( + "undefined" == typeof process || + ("object" !== + w(null === (t = process) || void 0 === t ? void 0 : t.env) && + -1 === + (null === (e = process.release) || + void 0 === e || + null === (n = e.name) || + void 0 === n + ? void 0 + : n.search(/node|io.js/))) || + ("undefined" != typeof window && + "ReactNative" !== + (null === (r = window) || + void 0 === r || + null === (i = r.navigator) || + void 0 === i + ? void 0 + : i.product)) + ); + }, + nt = function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return et() + ? Et("adapter", "NodeAdapter", t) + : Et("adapter", "BrowserAdapter", t); + }, + rt = Array.isArray; +!(function () { + function t(e) { + T(this, t), + (this.place = e), + (this.geometry = null == e ? void 0 : e.geometry), + (this.components = this.parseComponents()), + (this.attributes = this.parseProperties()); + } + C(t, [ + { + key: "parse", + value: function () { + this.parseComponents(), this.parseProperties(); + }, + }, + { + key: "parseComponents", + value: function () { + var t; + return ( + (null === (t = this.place) || void 0 === t + ? void 0 + : t.address_components) || [] + ).reduce(function (t, e) { + return ( + e.types.forEach(function (n) { + t[n] = e; + }), + t + ); + }, {}); + }, + }, + { + key: "parseProperties", + value: function () { + var t, + e = { + streetNumber: this.get("street_number"), + streetName: this.get("route"), + coordinates: + null !== (t = this.geometry) && void 0 !== t && t.location + ? Object.values(this.geometry.location) + : [0, 0], + city: this.or([ + "locality", + "sublocality", + "sublocality_level_1", + "neighborhood", + "administrative_area_level_3", + "administrative_area_level_2", + ]), + county: this.get("administrative_area_level_2"), + stateShort: this.get("administrative_area_level_1", !0), + stateLong: this.get("administrative_area_level_1"), + countryShort: this.get("country", !0), + country: this.get("country", !0), + countryLong: this.get("country"), + postalCode: this.get("postal_code"), + }; + return ( + (e.address = [e.streetNumber, e.streetName] + .filter(Boolean) + .join(" ")), + e + ); + }, + }, + { + key: "all", + value: function () { + return this.attributes; + }, + }, + { + key: "or", + value: function () { + for ( + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : [], + e = 0; + e < t.length; + e++ + ) { + var n = t[e]; + if (rt(n)) { + var r = n[0], + i = n[1]; + if (this.has(r)) return this.get(r, i); + } else if (this.has(n)) return this.get(n); + } + return null; + }, + }, + { + key: "has", + value: function (t) { + return t in this.components; + }, + }, + { + key: "get", + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; + return t in this.components + ? e + ? this.components[t].short_name + : this.components[t].long_name + : null; + }, + }, + { + key: "setAttributes", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return (this.attributes = m(m({}, this.attributes), t)), this; + }, + }, + { + key: "setAttribute", + value: function (t, e) { + return (this.attributes[t] = e), this; + }, + }, + { + key: "getAttribute", + value: function (t) { + return this.attributes[t] || null; + }, + }, + ]); +})(); +var it = (function () { + function t() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, + n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; + T(this, t), (this.type = "Point"), (this.coordinates = [n, e]); + } + return ( + C( + t, + [ + { + key: "latitude", + get: function () { + return this.coordinates[1]; + }, + }, + { + key: "longitude", + get: function () { + return this.coordinates[0]; + }, + }, + { + key: "lat", + value: function () { + return this.latitude; + }, + }, + { + key: "lng", + value: function () { + return this.longitude; + }, + }, + { + key: "serialize", + value: function () { + return { type: "Point", coorindates: [this.lat(), this.lng()] }; + }, + }, + { + key: "toJson", + value: function () { + return this.serialize(); + }, + }, + { + key: "toString", + value: function () { + return "(".concat(this.latitude, ", ").concat(this.longitude, ")"); + }, + }, + ], + [ + { + key: "fromGeoJson", + value: function (e) { + var n = j(e.coordinates, 2); + return ( + (longitude = n[0]), (latitude = n[1]), new t(latitude, longitude) + ); + }, + }, + ], + ), + t + ); +})(); +"undefined" == typeof arguments || arguments; +var at = function (t, e) { + var n = t(); + return Array.isArray(n) || "object" === w(n) ? ot(n, e) : null; + }, + ot = function t(e, n) { + var r, + i = e, + a = w(e), + o = "object" === a, + u = "function" === a, + s = Array.isArray(e), + c = "string" === w(n) && n.includes(".") ? n.split(".") : [n]; + if (s || o) { + for (var h = 0; h < c.length; h++) { + if (i && void 0 === i[c[h]]) return null; + if (i) { + if ( + "object" === w((r = i = i[c[h]])) && + !Z(null == r ? void 0 : r.attributes) && + "object" === w(null == r ? void 0 : r.attributes) && + void 0 !== c[h + 1] + ) { + var l = c.slice(h + 1).join("."); + return t(i.attributes, l); + } + if ("function" == typeof i) { + var d = c.slice(h + 1).join("."); + return at(i, d); + } + } + } + return i; + } + if (u) return at(e, n); + }, + ut = function (t, e, n) { + var r = t, + i = "object" === w(t), + a = Array.isArray(t), + o = "string" === w(e) && e.includes(".") ? e.split(".") : [e], + u = o.length; + if (a || i) { + for (var s = 0; s < u - 1; s++) r[o[s]] || (r[o[s]] = {}), (r = r[o[s]]); + r[o[u - 1]] = n; + } + return n; + }, + st = (function () { + function t() { + var e = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = + arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; + T(this, t), (this.actions = e), (this.bind = n); + } + return ( + C(t, [ + { + key: "extend", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : null, + e = t || this.bind; + if (!e) return this; + if (null != this && this.actions && "object" === w(this.actions)) + for (var n in this.actions) { + var r = this.actions[n]; + ut(e, n, "function" == typeof r ? r.bind(e) : r); + } + return this; + }, + }, + ]), + t + ); + })(), + ct = (function () { + function t() { + var e = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = arguments.length > 1 ? arguments[1] : void 0, + r = arguments.length > 2 ? arguments[2] : void 0, + i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; + T(this, t), + (this.attributes = e), + (this.dirtyAttributes = {}), + (this.changes = {}), + (this.isLoading = !1), + (this.isSaving = !1), + (this.isDestroying = !1), + (this.isReloading = !1), + (this.resource = r), + (this.options = i), + (this.version = i.version || "v1"), + this.setAdapter(n); + } + return ( + C(t, [ + { + key: "setAdapter", + value: function (t) { + var e; + return ( + (this.adapter = t), + (this.store = new Ot(this.resource, t, { + onAfterFetch: this.syncAttributes.bind(this), + actions: + null === (e = this.options) || void 0 === e + ? void 0 + : e.actions, + })), + this + ); + }, + }, + { + key: "id", + get: function () { + return this.getAttribute("id"); + }, + }, + { + key: "create", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}, + n = this.mergeAttributes(e); + return ( + this.setFlags(["isLoading", "isSaving"]), + this.store.create(n).then(function (e) { + return t.setFlags(["isLoading", "isSaving"], !1), e; + }) + ); + }, + }, + { + key: "update", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return ( + this.setFlags(["isLoading", "isSaving"]), + this.store.update(this.attributes.id, e).then(function (e) { + return t.setFlags(["isLoading", "isSaving"], !1), e; + }) + ); + }, + }, + { + key: "destroy", + value: function () { + var t = this; + return ( + this.setFlags(["isLoading", "isDestroying"]), + this.store.destroy(this.attributes.id).then(function (e) { + return t.setFlags(["isLoading", "isDestroying"], !1), e; + }) + ); + }, + }, + { + key: "reload", + value: function () { + var t = this; + return ( + this.setFlags(["isLoading", "isReloading"]), + this.store.findRecord(this.attributes.id).then(function (e) { + return t.reset(), e; + }) + ); + }, + }, + { + key: "setFlags", + value: function () { + for ( + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : [], + e = + !(arguments.length > 1 && void 0 !== arguments[1]) || + arguments[1], + n = ["isLoading", "isSaving", "isReloading", "isDestroying"], + r = 0; + r < t.length; + r++ + ) { + var i = t[r]; + if ("string" != typeof i || !n.includes(i)) + throw new Error("".concat(i, " is not a valid flag!")); + this[i] = e; + } + return this; + }, + }, + { + key: "reset", + value: function () { + return ( + (this.dirtyAttributes = {}), + (this.changes = {}), + (this.isLoading = !1), + (this.isSaving = !1), + (this.isReloading = !1), + this + ); + }, + }, + { + key: "empty", + value: function () { + return this.reset(), (this.attribues = {}), this; + }, + }, + { + key: "save", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}, + e = this.getAttributes(); + return Z(this.id) + ? this.create(e) + : !0 === t.onlyDirty + ? this.savedirty() + : this.update(e); + }, + }, + { + key: "saveDirty", + value: function () { + for ( + var t = Object.keys(this.dirtyAttributes), e = {}, n = 0; + n < t.length; + n++ + ) { + var r = t[n]; + e[r] = this.getAttribute(r); + } + return this.update(e); + }, + }, + { + key: "createdAt", + get: function () { + return this.hasAttribute("created_at") + ? new Date(this.getAttribute("created_at")) + : null; + }, + }, + { + key: "updatedAt", + get: function () { + return this.hasAttribute("updated_at") + ? new Date(this.getAttribute("updated_at")) + : null; + }, + }, + { + key: "isLoaded", + get: function () { + return this.hasAttributes(["created_at", "id"]); + }, + }, + { + key: "isEmpty", + get: function () { + return ( + 0 === + Object.values(null == this ? void 0 : this.attributes).length + ); + }, + }, + { + key: "isNew", + get: function () { + return !this.id; + }, + }, + { + key: "isSaved", + get: function () { + return !this.isNew && this.isLoaded; + }, + }, + { + key: "isDeleted", + get: function () { + return this.hasAttributes(["deleted", "time"]); + }, + }, + { + key: "eachAttribute", + value: function (t) { + var e, + n = this; + return ( + "function" != typeof t || + Object.keys( + null !== (e = null == this ? void 0 : this.attributes) && + void 0 !== e + ? e + : {}, + ).forEach(function (e) { + var r = n.getAttribute(e); + t.call(n, r, e); + }), + this + ); + }, + }, + { + key: "changes", + value: function () { + return this.changes; + }, + }, + { + key: "getDirtyAttributes", + value: function () { + return this.dirtyAttributes; + }, + }, + { + key: "isDirty", + value: function (t) { + return t in this.dirtyAttributes; + }, + }, + { + key: "hasDirtyAttributes", + value: function () { + var t; + return ( + Object.keys( + null !== (t = null == this ? void 0 : this.dirtyAttributes) && + void 0 !== t + ? t + : {}, + ).length > 0 + ); + }, + }, + { + key: "mutate", + value: function (t, e) { + this.attributes[t] = e; + }, + }, + { + key: "setAttribute", + value: function (t) { + var e, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : null; + if (null === n && "object" === w(t)) return this.setAttributes(t); + var r = + null !== (e = null == this ? void 0 : this.attributes[t]) && + void 0 !== e + ? e + : null; + return ( + ut(this.attributes, t, n), + ut(this.dirtyAttributes, t, r), + H(null == this ? void 0 : this.changes[t]) || + (this.changes[t] = []), + this.changes[t].push({ + property: t, + previousValue: r, + value: n, + changedAt: new Date(), + }), + this + ); + }, + }, + { + key: "setAttributes", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + for (var e in t) this.setAttribute(e, t[e]); + return this; + }, + }, + { + key: "getAttribute", + value: function (t) { + var e, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : null, + r = ot( + null !== (e = null == this ? void 0 : this.attributes) && + void 0 !== e + ? e + : {}, + t, + ); + return void 0 === r ? n : r; + }, + }, + { + key: "hasAttribute", + value: function (t) { + if (H(t)) { + var e, + n = t, + r = Object.keys( + null !== (e = this.attributes) && void 0 !== e ? e : {}, + ); + return n.every(function (t) { + return r.includes(t); + }); + } + return !(null == this || !this.attributes) && t in this.attributes; + }, + }, + { + key: "hasAttributes", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : []; + return this.hasAttribute(t); + }, + }, + { + key: "isAttributeFilled", + value: function (t) { + var e = this; + return H(t) + ? this.hasAttribute(t) && + t.every(function (t) { + return !Z(e.getAttribute(t)); + }) + : this.hasAttribute(t) && !Z(this.getAttribute(t)); + }, + }, + { + key: "getAttributes", + value: function (t) { + var e = {}; + if (null == t) + return this.getAttributes(Object.keys(this.attributes)); + if ("string" == typeof t) + return this.getAttribute(Array.prototype.slice.call(arguments)); + if (!H(t)) throw new Error("No attribute properties provided!"); + for (var n = 0; n < t.length; n++) { + var r, + i, + a = t[n]; + if ("string" == typeof a) { + var o = this.getAttribute(a); + "object" !== + w(null === (r = o) || void 0 === r ? void 0 : r.attributes) || + H(null === (i = o) || void 0 === i ? void 0 : i.attributes) || + (o = o.attributes), + (e[a] = o); + } + } + return e; + }, + }, + { + key: "serialize", + value: function () { + return this.getAttributes(); + }, + }, + { + key: "mergeAttributes", + value: function () { + var t, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}, + n = + null !== (t = null == this ? void 0 : this.attributes) && + void 0 !== t + ? t + : {}; + return (this.attributes = m(m({}, n), e)), this.attributes; + }, + }, + { + key: "syncAttributes", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + this.attributes = t; + }, + }, + ]), + t + ); + })(), + ht = new st({ + getDistanceAndTime: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + return this.adapter.get( + "".concat(this.namespace, "/").concat(t, "/distance-and-time"), + {}, + e, + ); + }, + }), + lt = (function (t) { + E(n, ct); + var e = M(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, "order", m({ actions: ht }, i)); + } + return ( + C(n, [ + { + key: "getDistanceAndTime", + value: function () { + return this.store.getDistanceAndTime(this.id); + }, + }, + ]), + n + ); + })(), + dt = (function (t) { + E(n, ct); + var e = M(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, "payload", i); + } + return ( + C(n, [ + { key: "attach", value: function (t) {} }, + { key: "entities", get: function () {} }, + { key: "dropoff", get: function () {} }, + { key: "pickup", get: function () {} }, + { + key: "waypoints", + get: function () { + return new J(this.waypoints); + }, + }, + ]), + n + ); + })(); +!(function (t) { + E(n, ct); + var e = M(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, "entity", i); + } +})(); +var ft = (function (t) { + E(n, ct); + var e = M(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, "place", i); + } + return ( + C( + n, + [ + { + key: "latitude", + get: function () { + var t; + return null === (t = this.getAttribute("location", new it())) || + void 0 === t + ? void 0 + : t.coordinates[1]; + }, + }, + { + key: "longitude", + get: function () { + var t; + return null === (t = this.getAttribute("location", new it())) || + void 0 === t + ? void 0 + : t.coordinates[0]; + }, + }, + { + key: "coordinates", + get: function () { + return [this.latitude, this.longitude]; + }, + }, + { + key: "setOwner", + value: function (t) { + return ( + tt(t) && this.setAttribute("owner", t.id), + "string" == typeof t && this.setAttribute("owner", t), + this + ); + }, + }, + ], + [ + { + key: "fromGoogleAddress", + value: function (t, e) { + var r = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}, + i = t.getAttribute("coordinates"), + a = j(i, 2), + o = a[0], + u = a[1], + s = { + name: null, + address: t.getAttribute("address"), + location: new it(o, u), + street1: t.getAttribute("streetName"), + street2: null, + city: t.getAttribute("city"), + province: t.getAttribute("stateLong"), + postal_code: t.getAttribute("postalCode"), + neighborhood: t.get("neighborhood"), + district: t.getAttribute("county"), + building: t.get("building"), + country: t.getAttribute("countryShort"), + phone: null, + security_access_code: null, + }; + return new n(s, e, r); + }, + }, + ], + ), + n + ); +})(); +!(function (t) { + E(n, ft); + var e = M(n); + function n() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, "waypoint", i); + } +})(), + (function (t) { + E(n, ct); + var e = M(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, "tracking-status", i); + } + })(), + (function (t) { + E(n, ct); + var e = M(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, "vehicle", i); + } + })(), + (function (t) { + E(n, ct); + var e = M(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, "driver", i); + } + })(), + (function (t) { + E(n, ct); + var e = M(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, "vendor", i); + } + })(), + (function (t) { + E(n, ct); + var e = M(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, "contact", i); + } + })(), + (function (t) { + E(n, ct); + var e = M(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, "zone", i); + } + })(), + (function (t) { + E(n, ct); + var e = M(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, "service-area", i); + } + })(), + (function (t) { + E(n, ct); + var e = M(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, "service-rate", i); + } + })(); +var vt = (function (t) { + E(n, ct); + var e = M(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return T(this, n), e.call(this, t, r, "service-quote", i); + } + return ( + C(n, [ + { key: "fromPreliminary", value: function () {} }, + { key: "fromPayload", value: function () {} }, + ]), + n + ); + })(), + gt = function t() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + T(this, t), + (this.version = e.version || "v1"), + (this.host = e.host || null), + (this.namespace = e.namespace || null), + (this.headers = e.headers || {}); + }, + pt = (function (t) { + E(n, gt); + var e = M(n); + function n(t) { + var r; + return ( + T(this, n), + (r = e.call(this, t)).setHeaders({ + Authorization: "Bearer ".concat(t.publicKey), + "Content-Type": "application/json", + "User-Agent": "@fleetbase/sdk;browser", + }), + r + ); + } + return ( + C(n, [ + { + key: "setHeaders", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return (this.headers = m(m({}, this.headers), t)), this; + }, + }, + { + key: "parseJSON", + value: function (t) { + return new Promise(function (e, n) { + return t + .json() + .then(function (n) { + return e({ + statusText: t.statusText, + status: t.status, + ok: t.ok, + json: n, + }); + }) + .catch(function () { + n( + new Error( + "Oops! Something went wrong when handling your request.", + ), + ); + }); + }); + }, + }, + { + key: "request", + value: function (t) { + var e = this, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : "GET", + r = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}, + i = + arguments.length > 3 && void 0 !== arguments[3] + ? arguments[3] + : {}; + return new Promise(function (a, o) { + return fetch( + i.url || + "".concat(e.host, "/").concat(e.namespace, "/").concat(t), + m( + { + method: n, + mode: i.mode || "cors", + headers: new Headers( + m(m({}, e.headers || {}), i.headers || {}), + ), + }, + r, + ), + ) + .then(e.parseJSON) + .then(function (t) { + return t.ok + ? a(t.json) + : o( + new Error( + t.json.errors ? t.json.errors[0] : t.statusText, + ), + ); + }) + .catch(function (t) { + o(t); + }); + }); + }, + }, + { + key: "get", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}, + r = V(e) ? "" : new URLSearchParams(e).toString(); + return this.request( + "".concat(t).concat(r ? "?".concat(r) : ""), + "GET", + {}, + n, + ); + }, + }, + { + key: "post", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}; + return this.request(t, "POST", { body: JSON.stringify(e) }, n); + }, + }, + { + key: "put", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}; + return this.request(t, "PUT", { body: JSON.stringify(e) }, n); + }, + }, + { + key: "delete", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}; + return this.request(t, "DELETE", {}, e); + }, + }, + { + key: "patch", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}; + return this.request(t, "PATCH", { body: JSON.stringify(e) }, n); + }, + }, + ]), + n + ); + })(), + yt = (function (e) { + E(r, gt); + var n = M(r); + function r(e) { + var i; + return ( + T(this, r), + ((i = n.call(this, e)).axios = t.create({ + baseURL: "".concat(i.host, "/").concat(i.namespace), + headers: { + Authorization: "Bearer ".concat(e.publicKey), + "Content-Type": "application/json", + "User-Agent": "@fleetbase/sdk;node", + }, + })), + i + ); + } + return ( + C(r, [ + { + key: "setHeaders", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}, + e = this.axios.defaults.headers.common; + return (this.axios.defaults.headers.common = m(m({}, e), t)), this; + }, + }, + { + key: "transform", + value: function (t) { + return t.data; + }, + }, + { + key: "handleError", + value: function (t) { + if (t.response) { + var e = t.response.data; + if (H(e.errors)) throw new Error(e.errors[0]); + if (e.error) throw new Error(e.error); + } + throw t; + }, + }, + { + key: "get", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}, + r = V(e) ? "" : new URLSearchParams(e).toString(); + return this.axios + .get("".concat(t).concat(r ? "?".concat(r) : ""), n) + .then(this.transform.bind(this)) + .catch(this.handleError.bind(this)); + }, + }, + { + key: "post", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}; + return this.axios + .post(t, e, n) + .then(this.transform.bind(this)) + .catch(this.handleError.bind(this)); + }, + }, + { + key: "put", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}; + return this.axios + .put(t, e, n) + .then(this.transform.bind(this)) + .catch(this.handleError.bind(this)); + }, + }, + { + key: "delete", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}; + return this.axios + .delete(t, e) + .then(this.transform.bind(this)) + .catch(this.handleError.bind(this)); + }, + }, + { + key: "patch", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}; + return this.axios + .patch(t, e, n) + .then(this.transform.bind(this)) + .catch(this.handleError.bind(this)); + }, + }, + ]), + r + ); + })(), + mt = (function (t) { + E(n, gt); + var e = M(n); + function n() { + return T(this, n), e.apply(this, arguments); + } + return n; + })(), + wt = (function () { + function t(e) { + var n = + !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; + T(this, t), + A(this, "uncountableWords", [ + "equipment", + "information", + "rice", + "money", + "species", + "series", + "fish", + "sheep", + "moose", + "deer", + "news", + ]), + A(this, "pluralRules", [ + [new RegExp("(m)an$", "gi"), "$1en"], + [new RegExp("(pe)rson$", "gi"), "$1ople"], + [new RegExp("(child)$", "gi"), "$1ren"], + [new RegExp("^(ox)$", "gi"), "$1en"], + [new RegExp("(ax|test)is$", "gi"), "$1es"], + [new RegExp("(octop|vir)us$", "gi"), "$1i"], + [new RegExp("(alias|status)$", "gi"), "$1es"], + [new RegExp("(bu)s$", "gi"), "$1ses"], + [new RegExp("(buffal|tomat|potat)o$", "gi"), "$1oes"], + [new RegExp("([ti])um$", "gi"), "$1a"], + [new RegExp("sis$", "gi"), "ses"], + [new RegExp("(?:([^f])fe|([lr])f)$", "gi"), "$1$2ves"], + [new RegExp("(hive)$", "gi"), "$1s"], + [new RegExp("([^aeiouy]|qu)y$", "gi"), "$1ies"], + [new RegExp("(x|ch|ss|sh)$", "gi"), "$1es"], + [new RegExp("(matr|vert|ind)ix|ex$", "gi"), "$1ices"], + [new RegExp("([m|l])ouse$", "gi"), "$1ice"], + [new RegExp("(quiz)$", "gi"), "$1zes"], + [new RegExp("s$", "gi"), "s"], + [new RegExp("$", "gi"), "s"], + ]), + A(this, "singularRules", [ + [new RegExp("(m)en$", "gi"), "$1an"], + [new RegExp("(pe)ople$", "gi"), "$1rson"], + [new RegExp("(child)ren$", "gi"), "$1"], + [new RegExp("([ti])a$", "gi"), "$1um"], + [ + new RegExp( + "((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$", + "gi", + ), + "$1$2sis", + ], + [new RegExp("(hive)s$", "gi"), "$1"], + [new RegExp("(tive)s$", "gi"), "$1"], + [new RegExp("(curve)s$", "gi"), "$1"], + [new RegExp("([lr])ves$", "gi"), "$1f"], + [new RegExp("([^fo])ves$", "gi"), "$1fe"], + [new RegExp("([^aeiouy]|qu)ies$", "gi"), "$1y"], + [new RegExp("(s)eries$", "gi"), "$1eries"], + [new RegExp("(m)ovies$", "gi"), "$1ovie"], + [new RegExp("(x|ch|ss|sh)es$", "gi"), "$1"], + [new RegExp("([m|l])ice$", "gi"), "$1ouse"], + [new RegExp("(bus)es$", "gi"), "$1"], + [new RegExp("(o)es$", "gi"), "$1"], + [new RegExp("(shoe)s$", "gi"), "$1"], + [new RegExp("(cris|ax|test)es$", "gi"), "$1is"], + [new RegExp("(octop|vir)i$", "gi"), "$1us"], + [new RegExp("(alias|status)es$", "gi"), "$1"], + [new RegExp("^(ox)en", "gi"), "$1"], + [new RegExp("(vert|ind)ices$", "gi"), "$1ex"], + [new RegExp("(matr)ices$", "gi"), "$1ix"], + [new RegExp("(quiz)zes$", "gi"), "$1"], + [new RegExp("s$", "gi"), ""], + ]), + A(this, "nonTitlecasedWords", [ + "and", + "or", + "nor", + "a", + "an", + "the", + "so", + "but", + "to", + "of", + "at", + "by", + "from", + "into", + "on", + "onto", + "off", + "out", + "in", + "over", + "with", + "for", + ]), + A(this, "idSuffix", new RegExp("(_ids|_id)$", "g")), + A(this, "underbar", new RegExp("_", "g")), + A(this, "spaceOrUnderbar", new RegExp("[ _]", "g")), + A(this, "uppercase", new RegExp("([A-Z])", "g")), + A(this, "underbarPrefix", new RegExp("^_")), + (this.str = e), + (this.chain = n); + } + return ( + C( + t, + [ + { + key: "get", + value: function () { + return this.str; + }, + }, + { + key: "applyRules", + value: function (t, e, n, r) { + if (r) t = r; + else if (!(n.indexOf(t.toLowerCase()) > -1)) + for (var i = 0; i < e.length; i++) + if (t.match(e[i][0])) { + t = t.replace(e[i][0], e[i][1]); + break; + } + return (this.str = t), !0 === this.chain ? this : t; + }, + }, + { + key: "pluralize", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : null; + return ( + (t = t || this.str), + this.applyRules(t, this.pluralRules, this.uncountableWords, e) + ); + }, + }, + { + key: "singularize", + value: function (t, e) { + return ( + (t = t || this.str), + this.applyRules(t, this.singularRules, this.uncountableWords, e) + ); + }, + }, + { + key: "camelize", + value: function (t, e) { + for ( + var n = (t = t || this.str).split("/"), r = 0; + r < n.length; + r++ + ) { + for ( + var i = n[r].split("_"), a = e && r + 1 === n.length ? 1 : 0; + a < i.length; + a++ + ) + i[a] = i[a].charAt(0).toUpperCase() + i[a].substring(1); + n[r] = i.join(""); + } + if (((t = n.join("::")), !0 === e)) { + var o = t.charAt(0).toLowerCase(), + u = t.slice(1); + t = o + u; + } + return (this.str = t), !0 === this.chain ? this : t; + }, + }, + { + key: "underscore", + value: function (t) { + for ( + var e = (t = t || this.str).split("::"), n = 0; + n < e.length; + n++ + ) + (e[n] = e[n].replace(this.uppercase, "_$1")), + (e[n] = e[n].replace(this.underbarPrefix, "")); + return ( + (t = e.join("/").toLowerCase()), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "humanize", + value: function (t, e) { + return ( + (t = (t = (t = (t = t || this.str).toLowerCase()).replace( + this.idSuffix, + "", + )).replace(this.underbar, " ")), + e || (t = this.capitalize(t)), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "capitalize", + value: function (t) { + return ( + (t = + (t = (t = t || this.str).toLowerCase()) + .substring(0, 1) + .toUpperCase() + t.substring(1)), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "dasherize", + value: function (t) { + return ( + (t = (t = (t = t || this.str).replace( + this.spaceOrUnderbar, + "-", + )).toLowerCase()), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "normify", + value: function (t, e) { + (t = t || this.str), + !0 === e + ? ((t = this.camelize(t)), (t = this.underscore(t))) + : (t = t.toLowerCase()); + for ( + var n = (t = t.replace(this.underbar, " ")).split(" "), r = 0; + r < n.length; + r++ + ) { + for (var i = n[r].split("-"), a = 0; a < i.length; a++) + this.nonTitlecasedWords.indexOf(i[a].toLowerCase()) < 0 && + (i[a] = this.capitalize(i[a])); + n[r] = i.join("-"); + } + return ( + (t = + (t = n.join(" ")).substring(0, 1).toUpperCase() + + t.substring(1)), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "demodulize", + value: function (t) { + var e = (t = t || this.str).split("::"); + return ( + (t = e[e.length - 1]), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "tableize", + value: function (t) { + return ( + (t = t || this.str), + (t = this.pluralize(this.underscore(t))), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "classify", + value: function (t) { + return ( + (t = t || this.str), + (t = this.singularize(this.camelize(t))), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "foreignKey", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; + return ( + (t = t || this.str), + (t = + this.underscore(this.demodulize(t)) + (e ? "" : "_") + "id"), + (this.str = t), + !0 === this.chain ? this : t + ); + }, + }, + { + key: "ordinalize", + value: function (t) { + for ( + var e = (t = t || this.str).split(" "), n = 0; + n < e.length; + n++ + ) + if (NaN === parseInt(e[n])) { + var r = e[n].substring(e[n].length - 2), + i = e[n].substring(e[n].length - 1), + a = "th"; + "11" != r && + "12" != r && + "13" != r && + ("1" === i + ? (a = "st") + : "2" === i + ? (a = "nd") + : "3" === i && (a = "rd")), + (e[n] += a); + } + return ( + (t = e.join(" ")), (this.str = t), !0 === this.chain ? this : t + ); + }, + }, + ], + [ + { + key: "invoke", + value: function () { + var e = Object.values(arguments), + n = new t(null, !1), + r = arguments[0]; + return ( + e.shift(), + "function" == typeof n[r] ? n[r].apply(n, q(e)) : null + ); + }, + }, + ], + ), + t + ); + })(), + bt = function () { + var t = ["pluralize"].concat(Array.prototype.slice.call(arguments)); + return wt.invoke.apply(wt, q(t)); + }, + kt = function () { + var t = ["singularize"].concat(Array.prototype.slice.call(arguments)); + return wt.invoke.apply(wt, q(t)); + }, + Tt = function () { + var t = ["classify"].concat(Array.prototype.slice.call(arguments)); + return wt.invoke.apply(wt, q(t)); + }, + xt = { Place: ft, Payload: dt, Order: lt }, + Ct = { BrowserAdapter: pt, NodeAdapter: yt, EmberJsAdapter: mt }, + At = (function () { + function t() { + return ( + T(this, t), + (this.resources = xt), + (this.adapters = Ct), + this.lookup.apply(this, arguments) + ); + } + return ( + C(t, [ + { + key: "lookup", + value: function (t, e) { + var n = bt(t), + r = Array.prototype.slice.call(arguments).slice(2); + if (!this[n]) throw new Error("Attempted to resolve invalid type"); + if (!this[n][e]) + throw new Error( + "No ".concat(kt(t), " named ").concat(e, " to resolve"), + ); + return P(this[n][e], q(r)); + }, + }, + ]), + t + ); + })(), + Et = function () { + return P(At, Array.prototype.slice.call(arguments)); + }, + Dt = function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : []; + if (((t.actions = H(e) ? e : [e]), !H(e))) + return e instanceof st && e.extend(t), t; + for (var n = 0; n < e.length; n++) { + var r = e[n]; + t.extendActions(r); + } + }, + Ot = (function () { + function t(e, n) { + var r = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + T(this, t), + (this.resource = e), + (this.adapter = n || nt()), + (this.namespace = bt(e)), + (this.storage = new J()), + (this.options = r), + this.extendActions(r.actions); + } + return ( + C(t, [ + { + key: "extendActions", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : []; + return Dt(this, t); + }, + }, + { + key: "deposit", + value: function (t) { + return t; + }, + }, + { + key: "serialize", + value: function (t) { + return Et("resource", Tt(this.resource), t, this.adapter); + }, + }, + { + key: "afterFetch", + value: function (t) { + return (function (t, e) { + if ( + ("function" == typeof t.options.onAfterFetch && + t.options.onAfterFetch(e), + H(e)) + ) { + for (var n = [], r = 0; r < e.length; r++) + n.push(t.afterFetch(e[r])); + return P(J, n); + } + var i = t.serialize(e); + return t.deposit(i); + })(this, t); + }, + }, + { + key: "create", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}; + return new Promise( + (function () { + var r = k( + regeneratorRuntime.mark(function r(i, a) { + var o; + return regeneratorRuntime.wrap(function (r) { + for (;;) + switch ((r.prev = r.next)) { + case 0: + return ( + (r.next = 2), + t.adapter + .post("".concat(t.namespace), e, n) + .then(t.afterFetch.bind(t)) + .catch(a) + ); + case 2: + (o = r.sent), i(o); + case 4: + case "end": + return r.stop(); + } + }, r); + }), + ); + return function (t, e) { + return r.apply(this, arguments); + }; + })(), + ); + }, + }, + { + key: "update", + value: function (t) { + var e = this, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + r = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}; + return new Promise( + (function () { + var i = k( + regeneratorRuntime.mark(function i(a, o) { + var u; + return regeneratorRuntime.wrap(function (i) { + for (;;) + switch ((i.prev = i.next)) { + case 0: + return ( + (i.next = 2), + e.adapter + .put( + "".concat(e.namespace, "/").concat(t), + n, + r, + ) + .then(e.afterFetch.bind(e)) + .catch(o) + ); + case 2: + (u = i.sent), a(u); + case 4: + case "end": + return i.stop(); + } + }, i); + }), + ); + return function (t, e) { + return i.apply(this, arguments); + }; + })(), + ); + }, + }, + { + key: "findRecord", + value: function (t) { + var e = this, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}; + return new Promise( + (function () { + var r = k( + regeneratorRuntime.mark(function r(i, a) { + var o; + return regeneratorRuntime.wrap(function (r) { + for (;;) + switch ((r.prev = r.next)) { + case 0: + return ( + (r.next = 2), + e.adapter + .get( + "".concat(e.namespace, "/").concat(t), + {}, + n, + ) + .then(e.afterFetch.bind(e)) + .catch(a) + ); + case 2: + (o = r.sent), i(o); + case 4: + case "end": + return r.stop(); + } + }, r); + }), + ); + return function (t, e) { + return r.apply(this, arguments); + }; + })(), + ); + }, + }, + { + key: "findAll", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return new Promise( + (function () { + var n = k( + regeneratorRuntime.mark(function n(r, i) { + var a; + return regeneratorRuntime.wrap(function (n) { + for (;;) + switch ((n.prev = n.next)) { + case 0: + return ( + (n.next = 2), + t.adapter + .get("".concat(t.namespace), {}, e) + .then(t.afterFetch.bind(t)) + .catch(i) + ); + case 2: + (a = n.sent), r(a); + case 4: + case "end": + return n.stop(); + } + }, n); + }), + ); + return function (t, e) { + return n.apply(this, arguments); + }; + })(), + ); + }, + }, + { + key: "query", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}; + return new Promise( + (function () { + var r = k( + regeneratorRuntime.mark(function r(i, a) { + var o; + return regeneratorRuntime.wrap(function (r) { + for (;;) + switch ((r.prev = r.next)) { + case 0: + return ( + (r.next = 2), + t.adapter + .get("".concat(t.namespace), e, n) + .then(t.afterFetch.bind(t)) + .catch(a) + ); + case 2: + (o = r.sent), i(o); + case 4: + case "end": + return r.stop(); + } + }, r); + }), + ); + return function (t, e) { + return r.apply(this, arguments); + }; + })(), + ); + }, + }, + { + key: "queryRecord", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}; + return ( + (e.single = !0), + new Promise( + (function () { + var r = k( + regeneratorRuntime.mark(function r(i, a) { + var o; + return regeneratorRuntime.wrap(function (r) { + for (;;) + switch ((r.prev = r.next)) { + case 0: + return ( + (r.next = 2), + t.adapter + .get("".concat(t.namespace), e, n) + .then(t.afterFetch.bind(t)) + .catch(a) + ); + case 2: + (o = r.sent), i(o); + case 4: + case "end": + return r.stop(); + } + }, r); + }), + ); + return function (t, e) { + return r.apply(this, arguments); + }; + })(), + ) + ); + }, + }, + { + key: "destroy", + value: function (t) { + var e = this, + n = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + r = tt(t) ? t.getAttribute("id") : t; + return new Promise( + (function () { + var t = k( + regeneratorRuntime.mark(function t(i, a) { + var o; + return regeneratorRuntime.wrap(function (t) { + for (;;) + switch ((t.prev = t.next)) { + case 0: + return ( + (t.next = 2), + e.adapter + .delete( + "".concat(e.namespace, "/").concat(r), + {}, + n, + ) + .then(e.afterFetch.bind(e)) + .catch(a) + ); + case 2: + (o = t.sent), i(o); + case 4: + case "end": + return t.stop(); + } + }, t); + }), + ); + return function (e, n) { + return t.apply(this, arguments); + }; + })(), + ); + }, + }, + ]), + t + ); + })(); +!(function () { + function t(e) { + var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; + if ( + (T(this, t), + (this.version = n.version || "v1"), + (this.options = { + version: this.version, + host: n.host || "https://api.fleetbase.io", + namespace: this.version || n.namespace, + debug: r, + publicKey: e, + }), + "string" != typeof e || 0 === e.length) + ) + throw new Error("⚠️ Invalid public key given to Fleetbase SDK"); + if (!et() && e.toLowerCase().startsWith("$")) + throw new Error( + "Secret key provided. You must use a public key with Fleetbase Javascript SDK!", + ); + (this.adapter = n.adapter || nt(this.options)), + (this.orders = new Ot("order", this.adapter).extendActions(ht)), + (this.entities = new Ot("entity", this.adapter)), + (this.places = new Ot("place", this.adapter)), + (this.drivers = new Ot("driver", this.adapter)), + (this.vehicles = new Ot("vehicle", this.adapter)), + (this.vendors = new Ot("vendor", this.adapter)), + (this.contacts = new Ot("contact", this.adapter)); + } + C( + t, + [ + { + key: "setAdapter", + value: function (t) { + this.adapter = t; + }, + }, + { + key: "getAdapter", + value: function () { + return this.adapter; + }, + }, + ], + [ + { + key: "newInstance", + value: function () { + return P(t, Array.prototype.slice.call(arguments)); + }, + }, + ], + ); +})(); +var St = (function (t) { + s(n, ct); + var e = v(n); + function n() { + return i(this, n), e.apply(this, arguments); + } + return ( + o(n, [ + { + key: "setAdapter", + value: function (t) { + var e; + return ( + (this.adapter = t), + (this.store = new Vn(this.resource, t, { + onAfterFetch: this.syncAttributes.bind(this), + actions: + null === (e = this.options) || void 0 === e + ? void 0 + : e.actions, + })), + this + ); + }, + }, + ]), + n + ); + })(), + Pt = new st({ + count: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + n = {}; + return ( + t && (n.store = t), + this.adapter.get("".concat(this.namespace, "/count"), n, e) + ); + }, + }), + Rt = (function (t) { + s(n, St); + var e = v(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return i(this, n), e.call(this, t, r, "review", a); + } + return ( + o(n, [ + { key: "getMedia", value: function () {} }, + { key: "getPhotos", value: function () {} }, + { key: "getVideos", value: function () {} }, + ]), + n + ); + })(), + Ut = function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return et() + ? Zn("adapter", "NodeAdapter", t) + : Zn("adapter", "BrowserAdapter", t); + }, + Mt = function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""; + return /^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(t); + }; +function jt() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, + e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "USD", + n = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "symbol"; + return new Intl.NumberFormat("en-US", { + style: "currency", + currency: e, + currencyDisplay: n, + }).format(t); +} +var qt = function (t) { + return ( + "string" == typeof t && + t.length > 30 && + (t.startsWith("store_") || t.startsWith("network_")) + ); + }, + $t = function (t) { + var e = null == t; + if (e) return e; + if ("number" == typeof t.size) return !t.size; + var n = r(t); + if ("object" === n) { + var i = t.size; + if ("number" == typeof i) return !i; + } + if ("number" == typeof t.length && "function" !== n) return !t.length; + if ("object" === n) { + var a = t.length; + if ("number" == typeof a) return !a; + } + return !1; + }, + Nt = (function (t) { + s(n, St); + var e = v(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return i(this, n), e.call(this, t, r, "product", a); + } + return ( + o(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, + n = t.sale_price, + r = t.currency; + return this.isOnSale + ? $t(n) || $t(r) + ? null + : jt(n / 100, r) + : $t(e) || $t(r) + ? null + : jt(e / 100, r); + }, + }, + { + key: "getReviews", + value: function () { + var t = this; + return this.adapter + .get("reviews", { store: this.id }) + .then(function (e) { + return new J( + e.map(function (e) { + return new Rt(e, t.adapter); + }), + ); + }); + }, + }, + ]), + n + ); + })(), + Ht = (function (t) { + s(n, St); + var e = v(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return i(this, n), e.call(this, t, r, "category", a); + } + return ( + o(n, [ + { + key: "getProducts", + value: function () { + var t = this; + return this.adapter + .get("products", { category: this.id }) + .then(function (e) { + return new J( + e.map(function (e) { + return new Nt(e, t.adapter); + }), + ); + }); + }, + }, + ]), + n + ); + })(), + Yt = new st({ + 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 (Mt(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); + }, + }), + Lt = (function (t) { + s(r, St); + var e = v(r); + function r() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + a = arguments.length > 1 ? arguments[1] : void 0, + o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return i(this, r), e.call(this, t, a, "customer", n({ actions: Yt }, o)); + } + return ( + o(r, [ + { + key: "setAdapter", + value: function (t) { + var e; + return ( + (this.adapter = t), + (this.store = new Vn(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: function (t) { + var e = this; + return this.adapter + .setHeaders({ "Customer-Token": this.token }) + .post("customers/register-device", t) + .then(function () { + return e; + }); + }, + }, + { + key: "getSavedPlaces", + value: function () { + var t = this; + return this.adapter + .setHeaders({ "Customer-Token": this.token }) + .get("customers/places") + .then(function (e) { + return new J( + e.map(function (e) { + return new ft(e, t.adapter); + }), + ); + }); + }, + }, + { + key: "getOrderHistory", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return this.adapter + .setHeaders({ "Customer-Token": this.token }) + .get("customers/orders", e) + .then(function (e) { + return new J( + e.map(function (e) { + return new lt(e, t.adapter); + }), + ); + }); + }, + }, + ]), + r + ); + })(), + Ft = Array.isArray, + _t = new st({ + 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, + i = 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({}, i), {}, { quantity: r }), + a, + ) + .then(this.afterFetch.bind(this)); + }, + update: function (t, e, r) { + var i = + 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({}, i), {}, { quantity: r }), + a, + ) + .then(this.afterFetch.bind(this)); + }, + remove: function (t, e) { + var n = + arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return this.adapter + .delete("".concat(this.namespace, "/").concat(t, "/").concat(e), {}, n) + .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); + }, + }), + Wt = (function (t) { + s(r, St); + var e = v(r); + function r() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + a = arguments.length > 1 ? arguments[1] : void 0, + o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return i(this, r), e.call(this, t, a, "cart", n({ actions: _t }, o)); + } + return ( + o(r, [ + { + key: "add", + value: function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : 1, + n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}, + r = + arguments.length > 3 && void 0 !== arguments[3] + ? arguments[3] + : {}; + return ( + t instanceof Nt && (t = t.id), this.store.add(this.id, t, e, n, r) + ); + }, + }, + { + key: "update", + value: function (t, e) { + var n = + arguments.length > 2 && void 0 !== arguments[2] + ? arguments[2] + : {}, + r = + arguments.length > 3 && void 0 !== arguments[3] + ? arguments[3] + : {}; + return this.store.update(this.id, t, e, n, r); + }, + }, + { + 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 !Ft(t) || 0 === t.length; + }, + }, + { + key: "isNotEmpty", + get: function () { + return !this.isEmpty; + }, + }, + ]), + r + ); + })(); +function zt(t) { + if (null === t || !0 === t || !1 === t) return NaN; + var e = Number(t); + return isNaN(e) ? e : e < 0 ? Math.ceil(e) : Math.floor(e); +} +function It(t, e) { + if (e.length < t) + throw new TypeError( + t + + " argument" + + (t > 1 ? "s" : "") + + " required, but only " + + e.length + + " present", + ); +} +function Qt(t) { + It(1, arguments); + var e = Object.prototype.toString.call(t); + return t instanceof Date || ("object" == typeof t && "[object Date]" === e) + ? new Date(t.getTime()) + : "number" == typeof t || "[object Number]" === e + ? new Date(t) + : (("string" != typeof t && "[object String]" !== e) || + "undefined" == typeof console || + (console.warn( + "Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule", + ), + console.warn(new Error().stack)), + new Date(NaN)); +} +function Bt(t, e) { + It(2, arguments); + var n = Qt(t).getTime(), + r = zt(e); + return new Date(n + r); +} +function Gt(t) { + var 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 Xt(t) { + return ( + It(1, arguments), + t instanceof Date || + ("object" == typeof t && + "[object Date]" === Object.prototype.toString.call(t)) + ); +} +function Kt(t) { + if ((It(1, arguments), !Xt(t) && "number" != typeof t)) return !1; + var e = Qt(t); + return !isNaN(Number(e)); +} +var Jt = { + 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" }, + }, + Zt = function (t, e, n) { + var r, + i = Jt[t]; + return ( + (r = + "string" == typeof i + ? i + : 1 === e + ? i.one + : i.other.replace("{{count}}", e.toString())), + null != n && n.addSuffix + ? n.comparison && n.comparison > 0 + ? "in " + r + : r + " ago" + : r + ); + }; +function Vt(t) { + return function () { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = e.width ? String(e.width) : t.defaultWidth, + r = t.formats[n] || t.formats[t.defaultWidth]; + return r; + }; +} +var te = { + date: Vt({ + formats: { + full: "EEEE, MMMM do, y", + long: "MMMM do, y", + medium: "MMM d, y", + short: "MM/dd/yyyy", + }, + defaultWidth: "full", + }), + time: Vt({ + 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: Vt({ + formats: { + full: "{{date}} 'at' {{time}}", + long: "{{date}} 'at' {{time}}", + medium: "{{date}}, {{time}}", + short: "{{date}}, {{time}}", + }, + defaultWidth: "full", + }), + }, + ee = { + lastWeek: "'last' eeee 'at' p", + yesterday: "'yesterday at' p", + today: "'today at' p", + tomorrow: "'tomorrow at' p", + nextWeek: "eeee 'at' p", + other: "P", + }; +function ne(t) { + return function (e, n) { + var r, + i = n || {}; + if ( + "formatting" === (i.context ? String(i.context) : "standalone") && + t.formattingValues + ) { + var a = t.defaultFormattingWidth || t.defaultWidth, + o = i.width ? String(i.width) : a; + r = t.formattingValues[o] || t.formattingValues[a]; + } else { + var u = t.defaultWidth, + s = i.width ? String(i.width) : t.defaultWidth; + r = t.values[s] || t.values[u]; + } + return r[t.argumentCallback ? t.argumentCallback(e) : e]; + }; +} +function re(t) { + return function (e) { + var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + r = n.width, + i = (r && t.matchPatterns[r]) || t.matchPatterns[t.defaultMatchWidth], + a = e.match(i); + if (!a) return null; + var o, + u = a[0], + s = (r && t.parsePatterns[r]) || t.parsePatterns[t.defaultParseWidth], + c = Array.isArray(s) + ? ae(s, function (t) { + return t.test(u); + }) + : ie(s, function (t) { + return t.test(u); + }); + (o = t.valueCallback ? t.valueCallback(c) : c), + (o = n.valueCallback ? n.valueCallback(o) : o); + var h = e.slice(u.length); + return { value: o, rest: h }; + }; +} +function ie(t, e) { + for (var n in t) if (t.hasOwnProperty(n) && e(t[n])) return n; +} +function ae(t, e) { + for (var n = 0; n < t.length; n++) if (e(t[n])) return n; +} +var oe, + ue = { + code: "en-US", + formatDistance: Zt, + formatLong: te, + formatRelative: function (t, e, n, r) { + return ee[t]; + }, + localize: { + ordinalNumber: function (t, e) { + var n = Number(t), + r = n % 100; + if (r > 20 || r < 10) + switch (r % 10) { + case 1: + return n + "st"; + case 2: + return n + "nd"; + case 3: + return n + "rd"; + } + return n + "th"; + }, + era: ne({ + values: { + narrow: ["B", "A"], + abbreviated: ["BC", "AD"], + wide: ["Before Christ", "Anno Domini"], + }, + defaultWidth: "wide", + }), + quarter: ne({ + values: { + narrow: ["1", "2", "3", "4"], + abbreviated: ["Q1", "Q2", "Q3", "Q4"], + wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"], + }, + defaultWidth: "wide", + argumentCallback: function (t) { + return t - 1; + }, + }), + month: ne({ + 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: ne({ + 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: ne({ + 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: + ((oe = { + matchPattern: /^(\d+)(th|st|nd|rd)?/i, + parsePattern: /\d+/i, + valueCallback: function (t) { + return parseInt(t, 10); + }, + }), + function (t) { + var e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : {}, + n = t.match(oe.matchPattern); + if (!n) return null; + var r = n[0], + i = t.match(oe.parsePattern); + if (!i) return null; + var a = oe.valueCallback ? oe.valueCallback(i[0]) : i[0]; + a = e.valueCallback ? e.valueCallback(a) : a; + var o = t.slice(r.length); + return { value: a, rest: o }; + }), + era: re({ + 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: re({ + 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: function (t) { + return t + 1; + }, + }), + month: re({ + 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: re({ + 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: re({ + 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 se(t, e) { + It(2, arguments); + var n = zt(e); + return Bt(t, -n); +} +function ce(t, e) { + for (var n = t < 0 ? "-" : "", r = Math.abs(t).toString(); r.length < e; ) + r = "0" + r; + return n + r; +} +var he = { + y: function (t, e) { + var n = t.getUTCFullYear(), + r = n > 0 ? n : 1 - n; + return ce("yy" === e ? r % 100 : r, e.length); + }, + M: function (t, e) { + var n = t.getUTCMonth(); + return "M" === e ? String(n + 1) : ce(n + 1, 2); + }, + d: function (t, e) { + return ce(t.getUTCDate(), e.length); + }, + a: function (t, e) { + var n = t.getUTCHours() / 12 >= 1 ? "pm" : "am"; + switch (e) { + case "a": + case "aa": + return n.toUpperCase(); + case "aaa": + return n; + case "aaaaa": + return n[0]; + default: + return "am" === n ? "a.m." : "p.m."; + } + }, + h: function (t, e) { + return ce(t.getUTCHours() % 12 || 12, e.length); + }, + H: function (t, e) { + return ce(t.getUTCHours(), e.length); + }, + m: function (t, e) { + return ce(t.getUTCMinutes(), e.length); + }, + s: function (t, e) { + return ce(t.getUTCSeconds(), e.length); + }, + S: function (t, e) { + var n = e.length, + r = t.getUTCMilliseconds(); + return ce(Math.floor(r * Math.pow(10, n - 3)), e.length); + }, +}; +function le(t) { + It(1, arguments); + var e = 1, + n = Qt(t), + r = n.getUTCDay(), + i = (r < e ? 7 : 0) + r - e; + return n.setUTCDate(n.getUTCDate() - i), n.setUTCHours(0, 0, 0, 0), n; +} +function de(t) { + It(1, arguments); + var e = Qt(t), + n = e.getUTCFullYear(), + r = new Date(0); + r.setUTCFullYear(n + 1, 0, 4), r.setUTCHours(0, 0, 0, 0); + var i = le(r), + a = new Date(0); + a.setUTCFullYear(n, 0, 4), a.setUTCHours(0, 0, 0, 0); + var o = le(a); + return e.getTime() >= i.getTime() + ? n + 1 + : e.getTime() >= o.getTime() + ? n + : n - 1; +} +function fe(t) { + It(1, arguments); + var e = de(t), + n = new Date(0); + n.setUTCFullYear(e, 0, 4), n.setUTCHours(0, 0, 0, 0); + var r = le(n); + return r; +} +function ve(t) { + It(1, arguments); + var e = Qt(t), + n = le(e).getTime() - fe(e).getTime(); + return Math.round(n / 6048e5) + 1; +} +function ge(t, e) { + It(1, arguments); + var n = e || {}, + r = n.locale, + i = r && r.options && r.options.weekStartsOn, + a = null == i ? 0 : zt(i), + o = null == n.weekStartsOn ? a : zt(n.weekStartsOn); + if (!(o >= 0 && o <= 6)) + throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); + var u = Qt(t), + s = u.getUTCDay(), + c = (s < o ? 7 : 0) + s - o; + return u.setUTCDate(u.getUTCDate() - c), u.setUTCHours(0, 0, 0, 0), u; +} +function pe(t, e) { + It(1, arguments); + var n = Qt(t, e), + r = n.getUTCFullYear(), + i = e || {}, + a = i.locale, + o = a && a.options && a.options.firstWeekContainsDate, + u = null == o ? 1 : zt(o), + s = null == i.firstWeekContainsDate ? u : zt(i.firstWeekContainsDate); + if (!(s >= 1 && s <= 7)) + throw new RangeError( + "firstWeekContainsDate must be between 1 and 7 inclusively", + ); + var c = new Date(0); + c.setUTCFullYear(r + 1, 0, s), c.setUTCHours(0, 0, 0, 0); + var h = ge(c, e), + l = new Date(0); + l.setUTCFullYear(r, 0, s), l.setUTCHours(0, 0, 0, 0); + var d = ge(l, e); + return n.getTime() >= h.getTime() + ? r + 1 + : n.getTime() >= d.getTime() + ? r + : r - 1; +} +function ye(t, e) { + It(1, arguments); + var n = e || {}, + r = n.locale, + i = r && r.options && r.options.firstWeekContainsDate, + a = null == i ? 1 : zt(i), + o = null == n.firstWeekContainsDate ? a : zt(n.firstWeekContainsDate), + u = pe(t, e), + s = new Date(0); + s.setUTCFullYear(u, 0, o), s.setUTCHours(0, 0, 0, 0); + var c = ge(s, e); + return c; +} +function me(t, e) { + It(1, arguments); + var n = Qt(t), + r = ge(n, e).getTime() - ye(n, e).getTime(); + return Math.round(r / 6048e5) + 1; +} +var we = "midnight", + be = "noon", + ke = "morning", + Te = "afternoon", + xe = "evening", + Ce = "night", + Ae = { + G: function (t, e, n) { + var r = t.getUTCFullYear() > 0 ? 1 : 0; + switch (e) { + case "G": + case "GG": + case "GGG": + return n.era(r, { width: "abbreviated" }); + case "GGGGG": + return n.era(r, { width: "narrow" }); + default: + return n.era(r, { width: "wide" }); + } + }, + y: function (t, e, n) { + if ("yo" === e) { + var r = t.getUTCFullYear(), + i = r > 0 ? r : 1 - r; + return n.ordinalNumber(i, { unit: "year" }); + } + return he.y(t, e); + }, + Y: function (t, e, n, r) { + var i = pe(t, r), + a = i > 0 ? i : 1 - i; + return "YY" === e + ? ce(a % 100, 2) + : "Yo" === e + ? n.ordinalNumber(a, { unit: "year" }) + : ce(a, e.length); + }, + R: function (t, e) { + return ce(de(t), e.length); + }, + u: function (t, e) { + return ce(t.getUTCFullYear(), e.length); + }, + Q: function (t, e, n) { + var r = Math.ceil((t.getUTCMonth() + 1) / 3); + switch (e) { + case "Q": + return String(r); + case "QQ": + return ce(r, 2); + case "Qo": + return n.ordinalNumber(r, { unit: "quarter" }); + case "QQQ": + return n.quarter(r, { width: "abbreviated", context: "formatting" }); + case "QQQQQ": + return n.quarter(r, { width: "narrow", context: "formatting" }); + default: + return n.quarter(r, { width: "wide", context: "formatting" }); + } + }, + q: function (t, e, n) { + var r = Math.ceil((t.getUTCMonth() + 1) / 3); + switch (e) { + case "q": + return String(r); + case "qq": + return ce(r, 2); + case "qo": + return n.ordinalNumber(r, { unit: "quarter" }); + case "qqq": + return n.quarter(r, { width: "abbreviated", context: "standalone" }); + case "qqqqq": + return n.quarter(r, { width: "narrow", context: "standalone" }); + default: + return n.quarter(r, { width: "wide", context: "standalone" }); + } + }, + M: function (t, e, n) { + var r = t.getUTCMonth(); + switch (e) { + case "M": + case "MM": + return he.M(t, e); + case "Mo": + return n.ordinalNumber(r + 1, { unit: "month" }); + case "MMM": + return n.month(r, { width: "abbreviated", context: "formatting" }); + case "MMMMM": + return n.month(r, { width: "narrow", context: "formatting" }); + default: + return n.month(r, { width: "wide", context: "formatting" }); + } + }, + L: function (t, e, n) { + var r = t.getUTCMonth(); + switch (e) { + case "L": + return String(r + 1); + case "LL": + return ce(r + 1, 2); + case "Lo": + return n.ordinalNumber(r + 1, { unit: "month" }); + case "LLL": + return n.month(r, { width: "abbreviated", context: "standalone" }); + case "LLLLL": + return n.month(r, { width: "narrow", context: "standalone" }); + default: + return n.month(r, { width: "wide", context: "standalone" }); + } + }, + w: function (t, e, n, r) { + var i = me(t, r); + return "wo" === e + ? n.ordinalNumber(i, { unit: "week" }) + : ce(i, e.length); + }, + I: function (t, e, n) { + var r = ve(t); + return "Io" === e + ? n.ordinalNumber(r, { unit: "week" }) + : ce(r, e.length); + }, + d: function (t, e, n) { + return "do" === e + ? n.ordinalNumber(t.getUTCDate(), { unit: "date" }) + : he.d(t, e); + }, + D: function (t, e, n) { + var r = (function (t) { + It(1, arguments); + var e = Qt(t), + n = e.getTime(); + e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0); + var r = e.getTime(), + i = n - r; + return Math.floor(i / 864e5) + 1; + })(t); + return "Do" === e + ? n.ordinalNumber(r, { unit: "dayOfYear" }) + : ce(r, e.length); + }, + E: function (t, e, n) { + var r = t.getUTCDay(); + switch (e) { + case "E": + case "EE": + case "EEE": + return n.day(r, { width: "abbreviated", context: "formatting" }); + case "EEEEE": + return n.day(r, { width: "narrow", context: "formatting" }); + case "EEEEEE": + return n.day(r, { width: "short", context: "formatting" }); + default: + return n.day(r, { width: "wide", context: "formatting" }); + } + }, + e: function (t, e, n, r) { + var i = t.getUTCDay(), + a = (i - r.weekStartsOn + 8) % 7 || 7; + switch (e) { + case "e": + return String(a); + case "ee": + return ce(a, 2); + case "eo": + return n.ordinalNumber(a, { unit: "day" }); + case "eee": + return n.day(i, { width: "abbreviated", context: "formatting" }); + case "eeeee": + return n.day(i, { width: "narrow", context: "formatting" }); + case "eeeeee": + return n.day(i, { width: "short", context: "formatting" }); + default: + return n.day(i, { width: "wide", context: "formatting" }); + } + }, + c: function (t, e, n, r) { + var i = t.getUTCDay(), + a = (i - r.weekStartsOn + 8) % 7 || 7; + switch (e) { + case "c": + return String(a); + case "cc": + return ce(a, e.length); + case "co": + return n.ordinalNumber(a, { unit: "day" }); + case "ccc": + return n.day(i, { width: "abbreviated", context: "standalone" }); + case "ccccc": + return n.day(i, { width: "narrow", context: "standalone" }); + case "cccccc": + return n.day(i, { width: "short", context: "standalone" }); + default: + return n.day(i, { width: "wide", context: "standalone" }); + } + }, + i: function (t, e, n) { + var r = t.getUTCDay(), + i = 0 === r ? 7 : r; + switch (e) { + case "i": + return String(i); + case "ii": + return ce(i, e.length); + case "io": + return n.ordinalNumber(i, { unit: "day" }); + case "iii": + return n.day(r, { width: "abbreviated", context: "formatting" }); + case "iiiii": + return n.day(r, { width: "narrow", context: "formatting" }); + case "iiiiii": + return n.day(r, { width: "short", context: "formatting" }); + default: + return n.day(r, { width: "wide", context: "formatting" }); + } + }, + a: function (t, e, n) { + var r = t.getUTCHours() / 12 >= 1 ? "pm" : "am"; + switch (e) { + case "a": + case "aa": + return n.dayPeriod(r, { + width: "abbreviated", + context: "formatting", + }); + case "aaa": + return n + .dayPeriod(r, { width: "abbreviated", context: "formatting" }) + .toLowerCase(); + case "aaaaa": + return n.dayPeriod(r, { width: "narrow", context: "formatting" }); + default: + return n.dayPeriod(r, { width: "wide", context: "formatting" }); + } + }, + b: function (t, e, n) { + var r, + i = t.getUTCHours(); + switch ( + ((r = 12 === i ? be : 0 === i ? we : i / 12 >= 1 ? "pm" : "am"), e) + ) { + case "b": + case "bb": + return n.dayPeriod(r, { + width: "abbreviated", + context: "formatting", + }); + case "bbb": + return n + .dayPeriod(r, { width: "abbreviated", context: "formatting" }) + .toLowerCase(); + case "bbbbb": + return n.dayPeriod(r, { width: "narrow", context: "formatting" }); + default: + return n.dayPeriod(r, { width: "wide", context: "formatting" }); + } + }, + B: function (t, e, n) { + var r, + i = t.getUTCHours(); + switch (((r = i >= 17 ? xe : i >= 12 ? Te : i >= 4 ? ke : Ce), e)) { + case "B": + case "BB": + case "BBB": + return n.dayPeriod(r, { + width: "abbreviated", + context: "formatting", + }); + case "BBBBB": + return n.dayPeriod(r, { width: "narrow", context: "formatting" }); + default: + return n.dayPeriod(r, { width: "wide", context: "formatting" }); + } + }, + h: function (t, e, n) { + if ("ho" === e) { + var r = t.getUTCHours() % 12; + return 0 === r && (r = 12), n.ordinalNumber(r, { unit: "hour" }); + } + return he.h(t, e); + }, + H: function (t, e, n) { + return "Ho" === e + ? n.ordinalNumber(t.getUTCHours(), { unit: "hour" }) + : he.H(t, e); + }, + K: function (t, e, n) { + var r = t.getUTCHours() % 12; + return "Ko" === e + ? n.ordinalNumber(r, { unit: "hour" }) + : ce(r, e.length); + }, + k: function (t, e, n) { + var r = t.getUTCHours(); + return ( + 0 === r && (r = 24), + "ko" === e ? n.ordinalNumber(r, { unit: "hour" }) : ce(r, e.length) + ); + }, + m: function (t, e, n) { + return "mo" === e + ? n.ordinalNumber(t.getUTCMinutes(), { unit: "minute" }) + : he.m(t, e); + }, + s: function (t, e, n) { + return "so" === e + ? n.ordinalNumber(t.getUTCSeconds(), { unit: "second" }) + : he.s(t, e); + }, + S: function (t, e) { + return he.S(t, e); + }, + X: function (t, e, n, r) { + var i = (r._originalDate || t).getTimezoneOffset(); + if (0 === i) return "Z"; + switch (e) { + case "X": + return De(i); + case "XXXX": + case "XX": + return Oe(i); + default: + return Oe(i, ":"); + } + }, + x: function (t, e, n, r) { + var i = (r._originalDate || t).getTimezoneOffset(); + switch (e) { + case "x": + return De(i); + case "xxxx": + case "xx": + return Oe(i); + default: + return Oe(i, ":"); + } + }, + O: function (t, e, n, r) { + var i = (r._originalDate || t).getTimezoneOffset(); + switch (e) { + case "O": + case "OO": + case "OOO": + return "GMT" + Ee(i, ":"); + default: + return "GMT" + Oe(i, ":"); + } + }, + z: function (t, e, n, r) { + var i = (r._originalDate || t).getTimezoneOffset(); + switch (e) { + case "z": + case "zz": + case "zzz": + return "GMT" + Ee(i, ":"); + default: + return "GMT" + Oe(i, ":"); + } + }, + t: function (t, e, n, r) { + var i = r._originalDate || t; + return ce(Math.floor(i.getTime() / 1e3), e.length); + }, + T: function (t, e, n, r) { + return ce((r._originalDate || t).getTime(), e.length); + }, + }; +function Ee(t, e) { + var n = t > 0 ? "-" : "+", + r = Math.abs(t), + i = Math.floor(r / 60), + a = r % 60; + if (0 === a) return n + String(i); + var o = e || ""; + return n + String(i) + o + ce(a, 2); +} +function De(t, e) { + return t % 60 == 0 ? (t > 0 ? "-" : "+") + ce(Math.abs(t) / 60, 2) : Oe(t, e); +} +function Oe(t, e) { + var n = e || "", + r = t > 0 ? "-" : "+", + i = Math.abs(t); + return r + ce(Math.floor(i / 60), 2) + n + ce(i % 60, 2); +} +var Se = Ae; +function Pe(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" }); + } +} +function Re(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" }); + } +} +var Ue = { + p: Re, + P: function (t, e) { + var n, + r = t.match(/(P+)(p+)?/), + i = r[1], + a = r[2]; + if (!a) return Pe(t, e); + switch (i) { + case "P": + n = e.dateTime({ width: "short" }); + break; + case "PP": + n = e.dateTime({ width: "medium" }); + break; + case "PPP": + n = e.dateTime({ width: "long" }); + break; + default: + n = e.dateTime({ width: "full" }); + } + return n.replace("{{date}}", Pe(i, e)).replace("{{time}}", Re(a, e)); + }, + }, + Me = Ue, + je = ["D", "DD"], + qe = ["YY", "YYYY"]; +function $e(t) { + return -1 !== je.indexOf(t); +} +function Ne(t) { + return -1 !== qe.indexOf(t); +} +function He(t, e, n) { + if ("YYYY" === t) + throw new RangeError( + "Use `yyyy` instead of `YYYY` (in `" + .concat(e, "`) for formatting years to the input `") + .concat(n, "`; see: https://git.io/fxCyr"), + ); + if ("YY" === t) + throw new RangeError( + "Use `yy` instead of `YY` (in `" + .concat(e, "`) for formatting years to the input `") + .concat(n, "`; see: https://git.io/fxCyr"), + ); + if ("D" === t) + throw new RangeError( + "Use `d` instead of `D` (in `" + .concat(e, "`) for formatting days of the month to the input `") + .concat(n, "`; see: https://git.io/fxCyr"), + ); + if ("DD" === t) + throw new RangeError( + "Use `dd` instead of `DD` (in `" + .concat(e, "`) for formatting days of the month to the input `") + .concat(n, "`; see: https://git.io/fxCyr"), + ); +} +var Ye = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, + Le = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, + Fe = /^'([^]*?)'?$/, + _e = /''/g, + We = /[a-zA-Z]/; +function ze(t, e, n) { + It(2, arguments); + var r = String(e), + i = n || {}, + a = i.locale || ue, + o = a.options && a.options.firstWeekContainsDate, + u = null == o ? 1 : zt(o), + s = null == i.firstWeekContainsDate ? u : zt(i.firstWeekContainsDate); + if (!(s >= 1 && s <= 7)) + throw new RangeError( + "firstWeekContainsDate must be between 1 and 7 inclusively", + ); + var c = a.options && a.options.weekStartsOn, + h = null == c ? 0 : zt(c), + l = null == i.weekStartsOn ? h : zt(i.weekStartsOn); + if (!(l >= 0 && l <= 6)) + throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); + if (!a.localize) + throw new RangeError("locale must contain localize property"); + if (!a.formatLong) + throw new RangeError("locale must contain formatLong property"); + var d = Qt(t); + if (!Kt(d)) throw new RangeError("Invalid time value"); + var f = Gt(d), + v = se(d, f), + g = { + firstWeekContainsDate: s, + weekStartsOn: l, + locale: a, + _originalDate: d, + }, + p = r + .match(Le) + .map(function (t) { + var e = t[0]; + return "p" === e || "P" === e ? (0, Me[e])(t, a.formatLong, g) : t; + }) + .join("") + .match(Ye) + .map(function (n) { + if ("''" === n) return "'"; + var r = n[0]; + if ("'" === r) return Ie(n); + var o = Se[r]; + if (o) + return ( + !i.useAdditionalWeekYearTokens && Ne(n) && He(n, e, t), + !i.useAdditionalDayOfYearTokens && $e(n) && He(n, e, t), + o(v, n, a.localize, g) + ); + if (r.match(We)) + throw new RangeError( + "Format string contains an unescaped latin alphabet character `" + + r + + "`", + ); + return n; + }) + .join(""); + return p; +} +function Ie(t) { + return t.match(Fe)[1].replace(_e, "'"); +} +function Qe(t, e) { + if (null == t) + throw new TypeError( + "assign requires that input parameter not be null or undefined", + ); + for (var n in (e = e || {})) + Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); + return t; +} +function Be(t, e, n) { + It(2, arguments); + var r = n || {}, + i = r.locale, + a = i && i.options && i.options.weekStartsOn, + o = null == a ? 0 : zt(a), + u = null == r.weekStartsOn ? o : zt(r.weekStartsOn); + if (!(u >= 0 && u <= 6)) + throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); + var s = Qt(t), + c = zt(e), + h = s.getUTCDay(), + l = c % 7, + d = (l + 7) % 7, + f = (d < u ? 7 : 0) + c - h; + return s.setUTCDate(s.getUTCDate() + f), s; +} +var Ge = /^(1[0-2]|0?\d)/, + Xe = /^(3[0-1]|[0-2]?\d)/, + Ke = /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, + Je = /^(5[0-3]|[0-4]?\d)/, + Ze = /^(2[0-3]|[0-1]?\d)/, + Ve = /^(2[0-4]|[0-1]?\d)/, + tn = /^(1[0-1]|0?\d)/, + en = /^(1[0-2]|0?\d)/, + nn = /^[0-5]?\d/, + rn = /^[0-5]?\d/, + an = /^\d/, + on = /^\d{1,2}/, + un = /^\d{1,3}/, + sn = /^\d{1,4}/, + cn = /^-?\d+/, + hn = /^-?\d/, + ln = /^-?\d{1,2}/, + dn = /^-?\d{1,3}/, + fn = /^-?\d{1,4}/, + vn = /^([+-])(\d{2})(\d{2})?|Z/, + gn = /^([+-])(\d{2})(\d{2})|Z/, + pn = /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, + yn = /^([+-])(\d{2}):(\d{2})|Z/, + mn = /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/; +function wn(t, e, n) { + var r = e.match(t); + if (!r) return null; + var i = parseInt(r[0], 10); + return { value: n ? n(i) : i, rest: e.slice(r[0].length) }; +} +function bn(t, e) { + var n = e.match(t); + return n + ? "Z" === n[0] + ? { value: 0, rest: e.slice(1) } + : { + value: + ("+" === n[1] ? 1 : -1) * + (36e5 * (n[2] ? parseInt(n[2], 10) : 0) + + 6e4 * (n[3] ? parseInt(n[3], 10) : 0) + + 1e3 * (n[5] ? parseInt(n[5], 10) : 0)), + rest: e.slice(n[0].length), + } + : null; +} +function kn(t, e) { + return wn(cn, t, e); +} +function Tn(t, e, n) { + switch (t) { + case 1: + return wn(an, e, n); + case 2: + return wn(on, e, n); + case 3: + return wn(un, e, n); + case 4: + return wn(sn, e, n); + default: + return wn(new RegExp("^\\d{1," + t + "}"), e, n); + } +} +function xn(t, e, n) { + switch (t) { + case 1: + return wn(hn, e, n); + case 2: + return wn(ln, e, n); + case 3: + return wn(dn, e, n); + case 4: + return wn(fn, e, n); + default: + return wn(new RegExp("^-?\\d{1," + t + "}"), e, n); + } +} +function Cn(t) { + switch (t) { + case "morning": + return 4; + case "evening": + return 17; + case "pm": + case "noon": + case "afternoon": + return 12; + default: + return 0; + } +} +function An(t, e) { + var n, + r = e > 0, + i = r ? e : 1 - e; + if (i <= 50) n = t || 100; + else { + var a = i + 50; + n = t + 100 * Math.floor(a / 100) - (t >= a % 100 ? 100 : 0); + } + return r ? n : 1 - n; +} +var En = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], + Dn = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +function On(t) { + return t % 400 == 0 || (t % 4 == 0 && t % 100 != 0); +} +var Sn = { + G: { + priority: 140, + parse: function (t, e, n, r) { + switch (e) { + case "G": + case "GG": + case "GGG": + return ( + n.era(t, { width: "abbreviated" }) || + n.era(t, { width: "narrow" }) + ); + case "GGGGG": + return n.era(t, { width: "narrow" }); + default: + return ( + n.era(t, { width: "wide" }) || + n.era(t, { width: "abbreviated" }) || + n.era(t, { width: "narrow" }) + ); + } + }, + set: function (t, e, n, r) { + return ( + (e.era = n), t.setUTCFullYear(n, 0, 1), t.setUTCHours(0, 0, 0, 0), t + ); + }, + incompatibleTokens: ["R", "u", "t", "T"], + }, + y: { + priority: 130, + parse: function (t, e, n, r) { + var i = function (t) { + return { year: t, isTwoDigitYear: "yy" === e }; + }; + switch (e) { + case "y": + return Tn(4, t, i); + case "yo": + return n.ordinalNumber(t, { unit: "year", valueCallback: i }); + default: + return Tn(e.length, t, i); + } + }, + validate: function (t, e, n) { + return e.isTwoDigitYear || e.year > 0; + }, + set: function (t, e, n, r) { + var i = t.getUTCFullYear(); + if (n.isTwoDigitYear) { + var a = An(n.year, i); + return t.setUTCFullYear(a, 0, 1), t.setUTCHours(0, 0, 0, 0), t; + } + var o = "era" in e && 1 !== e.era ? 1 - n.year : n.year; + return t.setUTCFullYear(o, 0, 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"], + }, + Y: { + priority: 130, + parse: function (t, e, n, r) { + var i = function (t) { + return { year: t, isTwoDigitYear: "YY" === e }; + }; + switch (e) { + case "Y": + return Tn(4, t, i); + case "Yo": + return n.ordinalNumber(t, { unit: "year", valueCallback: i }); + default: + return Tn(e.length, t, i); + } + }, + validate: function (t, e, n) { + return e.isTwoDigitYear || e.year > 0; + }, + set: function (t, e, n, r) { + var i = pe(t, r); + if (n.isTwoDigitYear) { + var a = An(n.year, i); + return ( + t.setUTCFullYear(a, 0, r.firstWeekContainsDate), + t.setUTCHours(0, 0, 0, 0), + ge(t, r) + ); + } + var o = "era" in e && 1 !== e.era ? 1 - n.year : n.year; + return ( + t.setUTCFullYear(o, 0, r.firstWeekContainsDate), + t.setUTCHours(0, 0, 0, 0), + ge(t, r) + ); + }, + incompatibleTokens: [ + "y", + "R", + "u", + "Q", + "q", + "M", + "L", + "I", + "d", + "D", + "i", + "t", + "T", + ], + }, + R: { + priority: 130, + parse: function (t, e, n, r) { + return xn("R" === e ? 4 : e.length, t); + }, + set: function (t, e, n, r) { + var i = new Date(0); + return i.setUTCFullYear(n, 0, 4), i.setUTCHours(0, 0, 0, 0), le(i); + }, + incompatibleTokens: [ + "G", + "y", + "Y", + "u", + "Q", + "q", + "M", + "L", + "w", + "d", + "D", + "e", + "c", + "t", + "T", + ], + }, + u: { + priority: 130, + parse: function (t, e, n, r) { + return xn("u" === e ? 4 : e.length, t); + }, + set: function (t, e, n, r) { + return t.setUTCFullYear(n, 0, 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "G", + "y", + "Y", + "R", + "w", + "I", + "i", + "e", + "c", + "t", + "T", + ], + }, + Q: { + priority: 120, + parse: function (t, e, n, r) { + switch (e) { + case "Q": + case "QQ": + return Tn(e.length, t); + case "Qo": + return n.ordinalNumber(t, { unit: "quarter" }); + case "QQQ": + return ( + n.quarter(t, { width: "abbreviated", context: "formatting" }) || + n.quarter(t, { width: "narrow", context: "formatting" }) + ); + case "QQQQQ": + return n.quarter(t, { width: "narrow", context: "formatting" }); + default: + return ( + n.quarter(t, { width: "wide", context: "formatting" }) || + n.quarter(t, { width: "abbreviated", context: "formatting" }) || + n.quarter(t, { width: "narrow", context: "formatting" }) + ); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 4; + }, + set: function (t, e, n, r) { + return t.setUTCMonth(3 * (n - 1), 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "Y", + "R", + "q", + "M", + "L", + "w", + "I", + "d", + "D", + "i", + "e", + "c", + "t", + "T", + ], + }, + q: { + priority: 120, + parse: function (t, e, n, r) { + switch (e) { + case "q": + case "qq": + return Tn(e.length, t); + case "qo": + return n.ordinalNumber(t, { unit: "quarter" }); + case "qqq": + return ( + n.quarter(t, { width: "abbreviated", context: "standalone" }) || + n.quarter(t, { width: "narrow", context: "standalone" }) + ); + case "qqqqq": + return n.quarter(t, { width: "narrow", context: "standalone" }); + default: + return ( + n.quarter(t, { width: "wide", context: "standalone" }) || + n.quarter(t, { width: "abbreviated", context: "standalone" }) || + n.quarter(t, { width: "narrow", context: "standalone" }) + ); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 4; + }, + set: function (t, e, n, r) { + return t.setUTCMonth(3 * (n - 1), 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "Y", + "R", + "Q", + "M", + "L", + "w", + "I", + "d", + "D", + "i", + "e", + "c", + "t", + "T", + ], + }, + M: { + priority: 110, + parse: function (t, e, n, r) { + var i = function (t) { + return t - 1; + }; + switch (e) { + case "M": + return wn(Ge, t, i); + case "MM": + return Tn(2, t, i); + case "Mo": + return n.ordinalNumber(t, { unit: "month", valueCallback: i }); + case "MMM": + return ( + n.month(t, { width: "abbreviated", context: "formatting" }) || + n.month(t, { width: "narrow", context: "formatting" }) + ); + case "MMMMM": + return n.month(t, { width: "narrow", context: "formatting" }); + default: + return ( + n.month(t, { width: "wide", context: "formatting" }) || + n.month(t, { width: "abbreviated", context: "formatting" }) || + n.month(t, { width: "narrow", context: "formatting" }) + ); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 11; + }, + set: function (t, e, n, r) { + return t.setUTCMonth(n, 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "Y", + "R", + "q", + "Q", + "L", + "w", + "I", + "D", + "i", + "e", + "c", + "t", + "T", + ], + }, + L: { + priority: 110, + parse: function (t, e, n, r) { + var i = function (t) { + return t - 1; + }; + switch (e) { + case "L": + return wn(Ge, t, i); + case "LL": + return Tn(2, t, i); + case "Lo": + return n.ordinalNumber(t, { unit: "month", valueCallback: i }); + case "LLL": + return ( + n.month(t, { width: "abbreviated", context: "standalone" }) || + n.month(t, { width: "narrow", context: "standalone" }) + ); + case "LLLLL": + return n.month(t, { width: "narrow", context: "standalone" }); + default: + return ( + n.month(t, { width: "wide", context: "standalone" }) || + n.month(t, { width: "abbreviated", context: "standalone" }) || + n.month(t, { width: "narrow", context: "standalone" }) + ); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 11; + }, + set: function (t, e, n, r) { + return t.setUTCMonth(n, 1), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "Y", + "R", + "q", + "Q", + "M", + "w", + "I", + "D", + "i", + "e", + "c", + "t", + "T", + ], + }, + w: { + priority: 100, + parse: function (t, e, n, r) { + switch (e) { + case "w": + return wn(Je, t); + case "wo": + return n.ordinalNumber(t, { unit: "week" }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 53; + }, + set: function (t, e, n, r) { + return ge( + (function (t, e, n) { + It(2, arguments); + var r = Qt(t), + i = zt(e), + a = me(r, n) - i; + return r.setUTCDate(r.getUTCDate() - 7 * a), r; + })(t, n, r), + r, + ); + }, + incompatibleTokens: [ + "y", + "R", + "u", + "q", + "Q", + "M", + "L", + "I", + "d", + "D", + "i", + "t", + "T", + ], + }, + I: { + priority: 100, + parse: function (t, e, n, r) { + switch (e) { + case "I": + return wn(Je, t); + case "Io": + return n.ordinalNumber(t, { unit: "week" }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 53; + }, + set: function (t, e, n, r) { + return le( + (function (t, e) { + It(2, arguments); + var n = Qt(t), + r = zt(e), + i = ve(n) - r; + return n.setUTCDate(n.getUTCDate() - 7 * i), n; + })(t, n, r), + r, + ); + }, + incompatibleTokens: [ + "y", + "Y", + "u", + "q", + "Q", + "M", + "L", + "w", + "d", + "D", + "e", + "c", + "t", + "T", + ], + }, + d: { + priority: 90, + subPriority: 1, + parse: function (t, e, n, r) { + switch (e) { + case "d": + return wn(Xe, t); + case "do": + return n.ordinalNumber(t, { unit: "date" }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + var r = On(t.getUTCFullYear()), + i = t.getUTCMonth(); + return r ? e >= 1 && e <= Dn[i] : e >= 1 && e <= En[i]; + }, + set: function (t, e, n, r) { + return t.setUTCDate(n), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "Y", + "R", + "q", + "Q", + "w", + "I", + "D", + "i", + "e", + "c", + "t", + "T", + ], + }, + D: { + priority: 90, + subPriority: 1, + parse: function (t, e, n, r) { + switch (e) { + case "D": + case "DD": + return wn(Ke, t); + case "Do": + return n.ordinalNumber(t, { unit: "date" }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return On(t.getUTCFullYear()) ? e >= 1 && e <= 366 : e >= 1 && e <= 365; + }, + set: function (t, e, n, r) { + return t.setUTCMonth(0, n), t.setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "Y", + "R", + "q", + "Q", + "M", + "L", + "w", + "I", + "d", + "E", + "i", + "e", + "c", + "t", + "T", + ], + }, + E: { + priority: 90, + parse: function (t, e, n, r) { + switch (e) { + case "E": + case "EE": + case "EEE": + return ( + n.day(t, { width: "abbreviated", context: "formatting" }) || + n.day(t, { width: "short", context: "formatting" }) || + n.day(t, { width: "narrow", context: "formatting" }) + ); + case "EEEEE": + return n.day(t, { width: "narrow", context: "formatting" }); + case "EEEEEE": + return ( + n.day(t, { width: "short", context: "formatting" }) || + n.day(t, { width: "narrow", context: "formatting" }) + ); + default: + return ( + n.day(t, { width: "wide", context: "formatting" }) || + n.day(t, { width: "abbreviated", context: "formatting" }) || + n.day(t, { width: "short", context: "formatting" }) || + n.day(t, { width: "narrow", context: "formatting" }) + ); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 6; + }, + set: function (t, e, n, r) { + return (t = Be(t, n, r)).setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: ["D", "i", "e", "c", "t", "T"], + }, + e: { + priority: 90, + parse: function (t, e, n, r) { + var i = function (t) { + var e = 7 * Math.floor((t - 1) / 7); + return ((t + r.weekStartsOn + 6) % 7) + e; + }; + switch (e) { + case "e": + case "ee": + return Tn(e.length, t, i); + case "eo": + return n.ordinalNumber(t, { unit: "day", valueCallback: i }); + case "eee": + return ( + n.day(t, { width: "abbreviated", context: "formatting" }) || + n.day(t, { width: "short", context: "formatting" }) || + n.day(t, { width: "narrow", context: "formatting" }) + ); + case "eeeee": + return n.day(t, { width: "narrow", context: "formatting" }); + case "eeeeee": + return ( + n.day(t, { width: "short", context: "formatting" }) || + n.day(t, { width: "narrow", context: "formatting" }) + ); + default: + return ( + n.day(t, { width: "wide", context: "formatting" }) || + n.day(t, { width: "abbreviated", context: "formatting" }) || + n.day(t, { width: "short", context: "formatting" }) || + n.day(t, { width: "narrow", context: "formatting" }) + ); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 6; + }, + set: function (t, e, n, r) { + return (t = Be(t, n, r)).setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "y", + "R", + "u", + "q", + "Q", + "M", + "L", + "I", + "d", + "D", + "E", + "i", + "c", + "t", + "T", + ], + }, + c: { + priority: 90, + parse: function (t, e, n, r) { + var i = function (t) { + var e = 7 * Math.floor((t - 1) / 7); + return ((t + r.weekStartsOn + 6) % 7) + e; + }; + switch (e) { + case "c": + case "cc": + return Tn(e.length, t, i); + case "co": + return n.ordinalNumber(t, { unit: "day", valueCallback: i }); + case "ccc": + return ( + n.day(t, { width: "abbreviated", context: "standalone" }) || + n.day(t, { width: "short", context: "standalone" }) || + n.day(t, { width: "narrow", context: "standalone" }) + ); + case "ccccc": + return n.day(t, { width: "narrow", context: "standalone" }); + case "cccccc": + return ( + n.day(t, { width: "short", context: "standalone" }) || + n.day(t, { width: "narrow", context: "standalone" }) + ); + default: + return ( + n.day(t, { width: "wide", context: "standalone" }) || + n.day(t, { width: "abbreviated", context: "standalone" }) || + n.day(t, { width: "short", context: "standalone" }) || + n.day(t, { width: "narrow", context: "standalone" }) + ); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 6; + }, + set: function (t, e, n, r) { + return (t = Be(t, n, r)).setUTCHours(0, 0, 0, 0), t; + }, + incompatibleTokens: [ + "y", + "R", + "u", + "q", + "Q", + "M", + "L", + "I", + "d", + "D", + "E", + "i", + "e", + "t", + "T", + ], + }, + i: { + priority: 90, + parse: function (t, e, n, r) { + var i = function (t) { + return 0 === t ? 7 : t; + }; + switch (e) { + case "i": + case "ii": + return Tn(e.length, t); + case "io": + return n.ordinalNumber(t, { unit: "day" }); + case "iii": + return ( + n.day(t, { + width: "abbreviated", + context: "formatting", + valueCallback: i, + }) || + n.day(t, { + width: "short", + context: "formatting", + valueCallback: i, + }) || + n.day(t, { + width: "narrow", + context: "formatting", + valueCallback: i, + }) + ); + case "iiiii": + return n.day(t, { + width: "narrow", + context: "formatting", + valueCallback: i, + }); + case "iiiiii": + return ( + n.day(t, { + width: "short", + context: "formatting", + valueCallback: i, + }) || + n.day(t, { + width: "narrow", + context: "formatting", + valueCallback: i, + }) + ); + default: + return ( + n.day(t, { + width: "wide", + context: "formatting", + valueCallback: i, + }) || + n.day(t, { + width: "abbreviated", + context: "formatting", + valueCallback: i, + }) || + n.day(t, { + width: "short", + context: "formatting", + valueCallback: i, + }) || + n.day(t, { + width: "narrow", + context: "formatting", + valueCallback: i, + }) + ); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 7; + }, + set: function (t, e, n, r) { + return ( + (t = (function (t, e) { + It(2, arguments); + var n = zt(e); + n % 7 == 0 && (n -= 7); + var r = 1, + i = Qt(t), + a = i.getUTCDay(), + o = (((n % 7) + 7) % 7 < r ? 7 : 0) + n - a; + return i.setUTCDate(i.getUTCDate() + o), i; + })(t, n, r)), + t.setUTCHours(0, 0, 0, 0), + t + ); + }, + incompatibleTokens: [ + "y", + "Y", + "u", + "q", + "Q", + "M", + "L", + "w", + "d", + "D", + "E", + "e", + "c", + "t", + "T", + ], + }, + a: { + priority: 80, + parse: function (t, e, n, r) { + switch (e) { + case "a": + case "aa": + case "aaa": + return ( + n.dayPeriod(t, { width: "abbreviated", context: "formatting" }) || + n.dayPeriod(t, { width: "narrow", context: "formatting" }) + ); + case "aaaaa": + return n.dayPeriod(t, { width: "narrow", context: "formatting" }); + default: + return ( + n.dayPeriod(t, { width: "wide", context: "formatting" }) || + n.dayPeriod(t, { width: "abbreviated", context: "formatting" }) || + n.dayPeriod(t, { width: "narrow", context: "formatting" }) + ); + } + }, + set: function (t, e, n, r) { + return t.setUTCHours(Cn(n), 0, 0, 0), t; + }, + incompatibleTokens: ["b", "B", "H", "K", "k", "t", "T"], + }, + b: { + priority: 80, + parse: function (t, e, n, r) { + switch (e) { + case "b": + case "bb": + case "bbb": + return ( + n.dayPeriod(t, { width: "abbreviated", context: "formatting" }) || + n.dayPeriod(t, { width: "narrow", context: "formatting" }) + ); + case "bbbbb": + return n.dayPeriod(t, { width: "narrow", context: "formatting" }); + default: + return ( + n.dayPeriod(t, { width: "wide", context: "formatting" }) || + n.dayPeriod(t, { width: "abbreviated", context: "formatting" }) || + n.dayPeriod(t, { width: "narrow", context: "formatting" }) + ); + } + }, + set: function (t, e, n, r) { + return t.setUTCHours(Cn(n), 0, 0, 0), t; + }, + incompatibleTokens: ["a", "B", "H", "K", "k", "t", "T"], + }, + B: { + priority: 80, + parse: function (t, e, n, r) { + switch (e) { + case "B": + case "BB": + case "BBB": + return ( + n.dayPeriod(t, { width: "abbreviated", context: "formatting" }) || + n.dayPeriod(t, { width: "narrow", context: "formatting" }) + ); + case "BBBBB": + return n.dayPeriod(t, { width: "narrow", context: "formatting" }); + default: + return ( + n.dayPeriod(t, { width: "wide", context: "formatting" }) || + n.dayPeriod(t, { width: "abbreviated", context: "formatting" }) || + n.dayPeriod(t, { width: "narrow", context: "formatting" }) + ); + } + }, + set: function (t, e, n, r) { + return t.setUTCHours(Cn(n), 0, 0, 0), t; + }, + incompatibleTokens: ["a", "b", "t", "T"], + }, + h: { + priority: 70, + parse: function (t, e, n, r) { + switch (e) { + case "h": + return wn(en, t); + case "ho": + return n.ordinalNumber(t, { unit: "hour" }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 12; + }, + set: function (t, e, n, r) { + var i = t.getUTCHours() >= 12; + return ( + i && n < 12 + ? t.setUTCHours(n + 12, 0, 0, 0) + : i || 12 !== n + ? t.setUTCHours(n, 0, 0, 0) + : t.setUTCHours(0, 0, 0, 0), + t + ); + }, + incompatibleTokens: ["H", "K", "k", "t", "T"], + }, + H: { + priority: 70, + parse: function (t, e, n, r) { + switch (e) { + case "H": + return wn(Ze, t); + case "Ho": + return n.ordinalNumber(t, { unit: "hour" }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 23; + }, + set: function (t, e, n, r) { + return t.setUTCHours(n, 0, 0, 0), t; + }, + incompatibleTokens: ["a", "b", "h", "K", "k", "t", "T"], + }, + K: { + priority: 70, + parse: function (t, e, n, r) { + switch (e) { + case "K": + return wn(tn, t); + case "Ko": + return n.ordinalNumber(t, { unit: "hour" }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 11; + }, + set: function (t, e, n, r) { + return ( + t.getUTCHours() >= 12 && n < 12 + ? t.setUTCHours(n + 12, 0, 0, 0) + : t.setUTCHours(n, 0, 0, 0), + t + ); + }, + incompatibleTokens: ["a", "b", "h", "H", "k", "t", "T"], + }, + k: { + priority: 70, + parse: function (t, e, n, r) { + switch (e) { + case "k": + return wn(Ve, t); + case "ko": + return n.ordinalNumber(t, { unit: "hour" }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 1 && e <= 24; + }, + set: function (t, e, n, r) { + var i = n <= 24 ? n % 24 : n; + return t.setUTCHours(i, 0, 0, 0), t; + }, + incompatibleTokens: ["a", "b", "h", "H", "K", "t", "T"], + }, + m: { + priority: 60, + parse: function (t, e, n, r) { + switch (e) { + case "m": + return wn(nn, t); + case "mo": + return n.ordinalNumber(t, { unit: "minute" }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 59; + }, + set: function (t, e, n, r) { + return t.setUTCMinutes(n, 0, 0), t; + }, + incompatibleTokens: ["t", "T"], + }, + s: { + priority: 50, + parse: function (t, e, n, r) { + switch (e) { + case "s": + return wn(rn, t); + case "so": + return n.ordinalNumber(t, { unit: "second" }); + default: + return Tn(e.length, t); + } + }, + validate: function (t, e, n) { + return e >= 0 && e <= 59; + }, + set: function (t, e, n, r) { + return t.setUTCSeconds(n, 0), t; + }, + incompatibleTokens: ["t", "T"], + }, + S: { + priority: 30, + parse: function (t, e, n, r) { + return Tn(e.length, t, function (t) { + return Math.floor(t * Math.pow(10, 3 - e.length)); + }); + }, + set: function (t, e, n, r) { + return t.setUTCMilliseconds(n), t; + }, + incompatibleTokens: ["t", "T"], + }, + X: { + priority: 10, + parse: function (t, e, n, r) { + switch (e) { + case "X": + return bn(vn, t); + case "XX": + return bn(gn, t); + case "XXXX": + return bn(pn, t); + case "XXXXX": + return bn(mn, t); + default: + return bn(yn, t); + } + }, + set: function (t, e, n, r) { + return e.timestampIsSet ? t : new Date(t.getTime() - n); + }, + incompatibleTokens: ["t", "T", "x"], + }, + x: { + priority: 10, + parse: function (t, e, n, r) { + switch (e) { + case "x": + return bn(vn, t); + case "xx": + return bn(gn, t); + case "xxxx": + return bn(pn, t); + case "xxxxx": + return bn(mn, t); + default: + return bn(yn, t); + } + }, + set: function (t, e, n, r) { + return e.timestampIsSet ? t : new Date(t.getTime() - n); + }, + incompatibleTokens: ["t", "T", "X"], + }, + t: { + priority: 40, + parse: function (t, e, n, r) { + return kn(t); + }, + set: function (t, e, n, r) { + return [new Date(1e3 * n), { timestampIsSet: !0 }]; + }, + incompatibleTokens: "*", + }, + T: { + priority: 20, + parse: function (t, e, n, r) { + return kn(t); + }, + set: function (t, e, n, r) { + return [new Date(n), { timestampIsSet: !0 }]; + }, + incompatibleTokens: "*", + }, + }, + Pn = Sn, + Rn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, + Un = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, + Mn = /^'([^]*?)'?$/, + jn = /''/g, + qn = /\S/, + $n = /[a-zA-Z]/; +function Nn(t, e, n, r) { + It(3, arguments); + var i = String(t), + a = String(e), + o = r || {}, + u = o.locale || ue; + if (!u.match) throw new RangeError("locale must contain match property"); + var s = u.options && u.options.firstWeekContainsDate, + c = null == s ? 1 : zt(s), + h = null == o.firstWeekContainsDate ? c : zt(o.firstWeekContainsDate); + if (!(h >= 1 && h <= 7)) + throw new RangeError( + "firstWeekContainsDate must be between 1 and 7 inclusively", + ); + var l = u.options && u.options.weekStartsOn, + d = null == l ? 0 : zt(l), + f = null == o.weekStartsOn ? d : zt(o.weekStartsOn); + if (!(f >= 0 && f <= 6)) + throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); + if ("" === a) return "" === i ? Qt(n) : new Date(NaN); + var v, + g = { firstWeekContainsDate: h, weekStartsOn: f, locale: u }, + p = [{ priority: 10, subPriority: -1, set: Hn, index: 0 }], + y = a + .match(Un) + .map(function (t) { + var e = t[0]; + return "p" === e || "P" === e ? (0, Me[e])(t, u.formatLong, g) : t; + }) + .join("") + .match(Rn), + m = []; + for (v = 0; v < y.length; v++) { + var w = y[v]; + !o.useAdditionalWeekYearTokens && Ne(w) && He(w, a, t), + !o.useAdditionalDayOfYearTokens && $e(w) && He(w, a, t); + var b = w[0], + k = Pn[b]; + if (k) { + var T = k.incompatibleTokens; + if (Array.isArray(T)) { + for (var x = void 0, C = 0; C < m.length; C++) { + var A = m[C].token; + if (-1 !== T.indexOf(A) || A === b) { + x = m[C]; + break; + } + } + if (x) + throw new RangeError( + "The format string mustn't contain `" + .concat(x.fullToken, "` and `") + .concat(w, "` at the same time"), + ); + } else if ("*" === k.incompatibleTokens && m.length) + throw new RangeError( + "The format string mustn't contain `".concat( + w, + "` and any other token at the same time", + ), + ); + m.push({ token: b, fullToken: w }); + var E = k.parse(i, w, u.match, g); + if (!E) return new Date(NaN); + p.push({ + priority: k.priority, + subPriority: k.subPriority || 0, + set: k.set, + validate: k.validate, + value: E.value, + index: p.length, + }), + (i = E.rest); + } else { + if (b.match($n)) + throw new RangeError( + "Format string contains an unescaped latin alphabet character `" + + b + + "`", + ); + if ( + ("''" === w ? (w = "'") : "'" === b && (w = Yn(w)), 0 !== i.indexOf(w)) + ) + return new Date(NaN); + i = i.slice(w.length); + } + } + if (i.length > 0 && qn.test(i)) return new Date(NaN); + var D = p + .map(function (t) { + return t.priority; + }) + .sort(function (t, e) { + return e - t; + }) + .filter(function (t, e, n) { + return n.indexOf(t) === e; + }) + .map(function (t) { + return p + .filter(function (e) { + return e.priority === t; + }) + .sort(function (t, e) { + return e.subPriority - t.subPriority; + }); + }) + .map(function (t) { + return t[0]; + }), + O = Qt(n); + if (isNaN(O)) return new Date(NaN); + var S = se(O, Gt(O)), + P = {}; + for (v = 0; v < D.length; v++) { + var R = D[v]; + if (R.validate && !R.validate(S, R.value, g)) return new Date(NaN); + var U = R.set(S, P, R.value, g); + U[0] ? ((S = U[0]), Qe(P, U[1])) : (S = U); + } + return S; +} +function Hn(t, e) { + if (e.timestampIsSet) return t; + var n = new Date(0); + return ( + n.setFullYear(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()), + n.setHours( + t.getUTCHours(), + t.getUTCMinutes(), + t.getUTCSeconds(), + t.getUTCMilliseconds(), + ), + n + ); +} +function Yn(t) { + return t.match(Mn)[1].replace(jn, "'"); +} +var Ln = (function (t) { + s(n, St); + var e = v(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return i(this, n), e.call(this, t, r, "store-hour", a); + } + return ( + o(n, [ + { + 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, + n = Math.abs(t - e); + return Math.floor(n / 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 Nn(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 Nn(t, e ? "HH:mm:ss" : "HH:mm", new Date()); + }, + }, + { + key: "humanReadableHoursRange", + get: function () { + return Kt(this.startDateInstance) && Kt(this.endDateInstance) + ? "" + .concat(ze(this.startDateInstance, "p"), " - ") + .concat(ze(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!"); + }, + }, + ]), + n + ); + })(), + Fn = (function (t) { + s(n, St); + var e = v(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return i(this, n), e.call(this, t, r, "store-location", a); + } + return ( + o(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 J( + this.getAttribute("hours").map(function (t) { + return new Ln(t); + }), + ); + }, + }, + { + key: "isAlwaysOpen", + get: function () { + return this.hours.every(function (t) { + return null == t ? void 0 : t.is24Hours; + }); + }, + }, + { + key: "today", + get: function () { + var t = ze(new Date(), "EEEE"); + return this.schedule[t]; + }, + }, + { + key: "schedule", + get: function () { + for ( + var t = {}, + e = [ + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday", + ], + n = 0; + n < e.length; + n++ + ) { + t[e[n]] = new J(); + } + for (var r = 0; r < this.hours.length; r++) { + var i = this.hours.objectAt(r); + t[i.day].pushObject(i); + } + return t; + }, + }, + { + 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!"); + }, + }, + ]), + n + ); + })(), + _n = (function (t) { + s(n, St); + var e = v(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return i(this, n), e.call(this, t, r, "payment-gateway", a); + } + return ( + o(n, [ + { + 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!", + ); + }, + }, + ]), + n + ); + })(), + Wn = (function (t) { + s(r, St); + 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, + a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return i(this, r), e.call(this, t, n, "store", a); + } + return ( + o(r, [ + { + key: "getReviews", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return this.adapter + .get("reviews", n({ store: this.id }, e)) + .then(function (e) { + return new J( + e.map(function (e) { + return new Rt(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", n({ store: this.id }, e)) + .then(function (e) { + return new J( + e.map(function (e) { + return ( + e.place && (e.place = new ft(e.place)), + new Fn(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 Fn(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 J( + e.map(function (e) { + return new _n(e, t.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); + }); + }, + }, + ]), + r + ); + })(), + zn = (function (t) { + s(n, St); + var e = v(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return i(this, n), e.call(this, t, r, "network", a); + } + return ( + o(n, [ + { + key: "getTags", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return this.adapter.get("tags", t); + }, + }, + { + key: "getStores", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return this.adapter.get("stores", e).then(function (e) { + return new J( + e.map(function (e) { + return new Wn(e, t.adapter); + }), + ); + }); + }, + }, + { + key: "getStoreLocations", + value: function () { + var t = this, + e = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : {}; + return this.adapter.get("store-locations", e).then(function (e) { + return new J( + e.map(function (e) { + return new Fn(e, t.adapter); + }), + ); + }); + }, + }, + { + key: "getPaymentGateways", + value: function () { + var t = this; + return this.adapter.get("gateways").then(function (e) { + return new J( + e.map(function (e) { + return new _n(e, t.adapter); + }), + ); + }); + }, + }, + ]), + n + ); + })(), + In = Array.isArray, + Qn = (function (t) { + s(n, vt); + var e = v(n); + function n() { + var t, + r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + a = arguments.length > 1 ? arguments[1] : void 0, + o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return ( + i(this, n), + r instanceof gt + ? f(t, (t = e.call(this, {}, r, "service-quote", o))) + : e.call(this, r, a, "service-quote", o) + ); + } + return ( + o( + n, + [ + { + key: "setAdapter", + value: function (t) { + var e; + return ( + (this.adapter = t), + (this.store = new Vn(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, + n = t.currency; + return $t(e) || $t(n) ? null : jt(e / 100, n); + }, + }, + { + key: "fromCart", + value: function (t, e, r) { + var i, + a, + o, + u = this, + s = + arguments.length > 3 && void 0 !== arguments[3] + ? arguments[3] + : "storefront", + c = + arguments.length > 4 && + void 0 !== arguments[4] && + arguments[4]; + return ( + null !== (i = t) && void 0 !== i && i.id && (t = t.id), + null !== (a = e) && void 0 !== a && a.id && (e = e.id), + null !== (o = r) && void 0 !== o && o.id && (r = r.id), + this.adapter + .get("service-quotes/from-cart", { + origin: t, + destination: e, + cart: r, + config: s, + all: c, + }) + .then(function (t) { + return In(t) + ? new J( + t.map(function (t) { + return new n(t, u.adapter); + }), + ) + : new n(t, u.adapter); + }) + ); + }, + }, + ], + [ + { + key: "getFromCart", + value: function (t) { + for ( + var e = new n(t), + r = arguments.length, + i = new Array(r > 1 ? r - 1 : 0), + a = 1; + a < r; + a++ + ) + i[a - 1] = arguments[a]; + return e.fromCart.apply(e, i); + }, + }, + ], + ), + n + ); + })(), + Bn = new st({ + create: void 0, + findAll: void 0, + query: void 0, + queryRecord: void 0, + initialize: function (t, e, r, i) { + var a = + arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {}, + o = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : {}; + return ( + tt(t) && (t = t.id), + tt(e) && (e = e.id), + tt(r) && (r = r.id), + tt(i) && (i = i.getAttribute("code")), + this.adapter.get( + "".concat(this.namespace, "/before"), + n( + n({}, a), + {}, + { customer: t, cart: e, serviceQuote: r, gateway: i }, + ), + o, + ) + ); + }, + captureOrder: function (t) { + var e = + 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: e }, + n, + ) + .then(function (t) { + return new lt(t); + }); + }, + }), + Gn = (function (t) { + s(n, St); + var e = v(n); + function n() { + var t = + arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + r = arguments.length > 1 ? arguments[1] : void 0, + a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return i(this, n), e.call(this, t, r, "checkout", a); + } + return ( + o(n, [ + { + 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); + }, + }, + ]), + n + ); + })(), + Xn = { + Product: Nt, + Category: Ht, + Customer: Lt, + Cart: Wt, + DeliveryServiceQuote: Qn, + Store: Wn, + StoreLocation: Fn, + StoreHour: Ln, + Checkout: Gn, + Review: Rt, + }, + Kn = { BrowserAdapter: pt, NodeAdapter: yt }, + Jn = (function () { + function t() { + return ( + i(this, t), + (this.resources = Xn), + (this.adapters = Kn), + this.lookup.apply(this, arguments) + ); + } + return ( + o(t, [ + { + key: "lookup", + value: function (t, e) { + var n = bt(t), + r = Array.prototype.slice.call(arguments).slice(2); + if (!this[n]) throw new Error("Attempted to resolve invalid type"); + if (!this[n][e]) + throw new Error( + "No ".concat(kt(t), " named ").concat(e, " to resolve"), + ); + return d(this[n][e], g(r)); + }, + }, + ]), + t + ); + })(), + Zn = function () { + return d(Jn, Array.prototype.slice.call(arguments)); + }, + Vn = (function (t) { + s(n, Ot); + var e = v(n); + function n() { + return i(this, n), e.apply(this, arguments); + } + return ( + o(n, [ + { + key: "extendActions", + value: function () { + var t = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : []; + return Dt(this, t); + }, + }, + { + key: "serialize", + value: function (t) { + return Zn("resource", Tt(this.resource), t, this.adapter); + }, + }, + ]), + n + ); + })(), + tr = (function () { + function t(e) { + var n = + arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; + if ( + (i(this, t), + (this.version = n.version || "v1"), + (this.options = { + version: this.version, + host: n.host || "https://api.fleetbase.io", + namespace: "storefront/".concat(this.version) || n.namespace, + publicKey: e, + debug: r, + }), + !qt(e)) + ) + throw new Error("⚠️ Invalid Storefront key given to Storefront SDK"); + (this.adapter = n.adapter || Ut(this.options)), + (this.products = new Vn("product", this.adapter)), + (this.categories = new Vn("category", this.adapter)), + (this.reviews = new Vn("review", this.adapter).extendActions(Pt)), + (this.customers = new Vn("customer", this.adapter).extendActions(Yt)), + (this.cart = new Vn("cart", this.adapter).extendActions(_t)), + (this.checkout = new Vn("checkout", this.adapter).extendActions(Bn)); + } + return ( + o( + 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", n({ query: t }, e)) + .then(function (t) { + return new J( + t.map(function (t) { + return new Nt(t); + }), + ); + }); + }, + }, + { + key: "setAdapter", + value: function (t) { + this.adapter = t; + }, + }, + { + key: "getAdapter", + value: function () { + return this.adapter; + }, + }, + ], + [ + { + key: "newInstance", + value: function () { + return d(t, Array.prototype.slice.call(arguments)); + }, + }, + ], + ), + t + ); + })(); +export { + Wt as Cart, + Ht as Category, + Gn as Checkout, + Lt as Customer, + Qn as DeliveryServiceQuote, + zn as Network, + _n as PaymentGateway, + Nt as Product, + Rt as Review, + Wn as Store, + Ln as StoreHour, + Fn as StoreLocation, + tr as default, +}; //# sourceMappingURL=storefront.js.map diff --git a/package.json b/package.json index 3e6e29e..2d09a2a 100644 --- a/package.json +++ b/package.json @@ -1,59 +1,67 @@ { - "name": "@fleetbase/storefront", - "version": "1.1.5", - "description": "Fleetbase Storefront JS & Node SDK", - "main": "dist/cjs/storefront.js", - "module": "dist/esm/storefront.js", - "files": [ - "dist", - "src" - ], - "scripts": { - "prebuild": "npm run lint", - "lint": "eslint src", - "lint:fix": "eslint src --fix", - "lint:tests": "eslint tests", - "bundle": "rollup -c", - "dev": "rollup -c -w", - "test": "mocha --require @babel/polyfill --require @babel/register --require source-map-support/register tests/*.test.js" - }, - "keywords": [ - "fleetbase", - "ecommerce", - "api", - "ondemand", - "ecommerce", - "last", - "mile", - "delivery", - "logistics", - "ecommerce", - "app" - ], - "author": "Ronald A. Richardson (https://ron.dev)", - "license": "BSD-3-Clause", - "devDependencies": { - "@babel/core": "^7.14.0", - "@babel/plugin-proposal-class-properties": "^7.13.0", - "@babel/plugin-proposal-decorators": "^7.13.15", - "@babel/plugin-transform-spread": "^7.13.0", - "@babel/polyfill": "^7.12.1", - "@babel/preset-env": "^7.14.1", - "@babel/register": "^7.13.16", - "@rollup/plugin-babel": "^5.3.0", - "@rollup/plugin-node-resolve": "^13.0.5", - "chai": "^4.3.4", - "eslint": "^7.26.0", - "eslint-config-airbnb-base": "^14.2.1", - "eslint-plugin-import": "^2.16.0", - "mocha": "^8.4.0", - "rollup": "^2.61.0", - "rollup-plugin-eslint": "^5.1.0", - "rollup-plugin-terser": "^7.0.2", - "source-map-support": "^0.5.19" - }, - "dependencies": { - "@fleetbase/sdk": "1.2.1", - "date-fns": "^2.22.1" - } + "name": "@fleetbase/storefront", + "version": "1.1.5", + "description": "Fleetbase Storefront JS & Node SDK", + "main": "dist/cjs/storefront.js", + "module": "dist/esm/storefront.js", + "files": [ + "dist", + "src" + ], + "scripts": { + "prebuild": "npm run lint", + "lint": "eslint src", + "lint:fix": "eslint src --fix", + "lint:tests": "eslint tests", + "bundle": "rollup -c", + "dev": "rollup -c -w", + "test": "mocha --require @babel/polyfill --require @babel/register --require source-map-support/register tests/*.test.js", + "prepare": "husky install", + "format": "prettier . --write" + }, + "lint-staged": { + "**/*": "prettier --write --ignore-unknown" + }, + "keywords": [ + "fleetbase", + "ecommerce", + "api", + "ondemand", + "ecommerce", + "last", + "mile", + "delivery", + "logistics", + "ecommerce", + "app" + ], + "author": "Ronald A. Richardson (https://ron.dev)", + "license": "BSD-3-Clause", + "devDependencies": { + "@babel/core": "^7.23.6", + "@babel/plugin-proposal-class-properties": "^7.18.6", + "@babel/plugin-proposal-decorators": "^7.23.6", + "@babel/plugin-transform-spread": "^7.23.3", + "@babel/polyfill": "^7.12.1", + "@babel/preset-env": "^7.23.6", + "@babel/register": "^7.22.15", + "@rollup/plugin-babel": "^6.0.4", + "@rollup/plugin-node-resolve": "^15.2.3", + "chai": "^4.3.10", + "eslint": "^8.56.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.29.1", + "husky": "^8.0.3", + "lint-staged": "^15.2.0", + "mocha": "^10.2.0", + "prettier": "3.1.1", + "rollup": "^4.9.1", + "rollup-plugin-eslint": "^7.0.0", + "rollup-plugin-terser": "^7.0.2", + "source-map-support": "^0.5.21" + }, + "dependencies": { + "@fleetbase/sdk": "1.2.7", + "date-fns": "^3.0.1" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..7324e84 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,4559 @@ +lockfileVersion: '6.0' + +dependencies: + '@fleetbase/sdk': + specifier: 1.2.7 + version: 1.2.7 + date-fns: + specifier: ^3.0.1 + version: 3.0.1 + +devDependencies: + '@babel/core': + specifier: ^7.23.6 + version: 7.23.6 + '@babel/plugin-proposal-class-properties': + specifier: ^7.18.6 + version: 7.18.6(@babel/core@7.23.6) + '@babel/plugin-proposal-decorators': + specifier: ^7.23.6 + version: 7.23.6(@babel/core@7.23.6) + '@babel/plugin-transform-spread': + specifier: ^7.23.3 + version: 7.23.3(@babel/core@7.23.6) + '@babel/polyfill': + specifier: ^7.12.1 + version: 7.12.1 + '@babel/preset-env': + specifier: ^7.23.6 + version: 7.23.6(@babel/core@7.23.6) + '@babel/register': + specifier: ^7.22.15 + version: 7.22.15(@babel/core@7.23.6) + '@rollup/plugin-babel': + specifier: ^6.0.4 + version: 6.0.4(@babel/core@7.23.6)(rollup@4.9.1) + '@rollup/plugin-node-resolve': + specifier: ^15.2.3 + version: 15.2.3(rollup@4.9.1) + chai: + specifier: ^4.3.10 + version: 4.3.10 + eslint: + specifier: ^8.56.0 + version: 8.56.0 + eslint-config-airbnb-base: + specifier: ^15.0.0 + version: 15.0.0(eslint-plugin-import@2.29.1)(eslint@8.56.0) + eslint-plugin-import: + specifier: ^2.29.1 + version: 2.29.1(eslint@8.56.0) + husky: + specifier: ^8.0.3 + version: 8.0.3 + lint-staged: + specifier: ^15.2.0 + version: 15.2.0 + mocha: + specifier: ^10.2.0 + version: 10.2.0 + prettier: + specifier: 3.1.1 + version: 3.1.1 + rollup: + specifier: ^4.9.1 + version: 4.9.1 + rollup-plugin-eslint: + specifier: ^7.0.0 + version: 7.0.0 + rollup-plugin-terser: + specifier: ^7.0.2 + version: 7.0.2(rollup@4.9.1) + source-map-support: + specifier: ^0.5.21 + version: 0.5.21 + +packages: + /@aashutoshrathi/word-wrap@1.2.6: + resolution: { integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== } + engines: { node: '>=0.10.0' } + dev: true + + /@ampproject/remapping@2.2.1: + resolution: { integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== } + engines: { node: '>=6.0.0' } + dependencies: + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.20 + dev: true + + /@babel/code-frame@7.23.5: + resolution: { integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/highlight': 7.23.4 + chalk: 2.4.2 + dev: true + + /@babel/compat-data@7.23.5: + resolution: { integrity: sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw== } + engines: { node: '>=6.9.0' } + dev: true + + /@babel/core@7.23.6: + resolution: { integrity: sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw== } + engines: { node: '>=6.9.0' } + dependencies: + '@ampproject/remapping': 2.2.1 + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.6 + '@babel/helper-compilation-targets': 7.23.6 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.6) + '@babel/helpers': 7.23.6 + '@babel/parser': 7.23.6 + '@babel/template': 7.22.15 + '@babel/traverse': 7.23.6 + '@babel/types': 7.23.6 + convert-source-map: 2.0.0 + debug: 4.3.4(supports-color@8.1.1) + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/generator@7.23.6: + resolution: { integrity: sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/types': 7.23.6 + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.20 + jsesc: 2.5.2 + dev: true + + /@babel/helper-annotate-as-pure@7.22.5: + resolution: { integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/types': 7.23.6 + dev: true + + /@babel/helper-builder-binary-assignment-operator-visitor@7.22.15: + resolution: { integrity: sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/types': 7.23.6 + dev: true + + /@babel/helper-compilation-targets@7.23.6: + resolution: { integrity: sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/compat-data': 7.23.5 + '@babel/helper-validator-option': 7.23.5 + browserslist: 4.22.2 + lru-cache: 5.1.1 + semver: 6.3.1 + dev: true + + /@babel/helper-create-class-features-plugin@7.23.6(@babel/core@7.23.6): + resolution: { integrity: sha512-cBXU1vZni/CpGF29iTu4YRbOZt3Wat6zCoMDxRF1MayiEc4URxOj31tT65HUM0CRpMowA3HCJaAOVOUnMf96cw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-member-expression-to-functions': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.6) + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + semver: 6.3.1 + dev: true + + /@babel/helper-create-regexp-features-plugin@7.22.15(@babel/core@7.23.6): + resolution: { integrity: sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-annotate-as-pure': 7.22.5 + regexpu-core: 5.3.2 + semver: 6.3.1 + dev: true + + /@babel/helper-define-polyfill-provider@0.4.4(@babel/core@7.23.6): + resolution: { integrity: sha512-QcJMILQCu2jm5TFPGA3lCpJJTeEP+mqeXooG/NZbg/h5FTFi6V0+99ahlRsW8/kRLyb24LZVCCiclDedhLKcBA== } + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-compilation-targets': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + debug: 4.3.4(supports-color@8.1.1) + lodash.debounce: 4.0.8 + resolve: 1.22.8 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-environment-visitor@7.22.20: + resolution: { integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== } + engines: { node: '>=6.9.0' } + dev: true + + /@babel/helper-function-name@7.23.0: + resolution: { integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/template': 7.22.15 + '@babel/types': 7.23.6 + dev: true + + /@babel/helper-hoist-variables@7.22.5: + resolution: { integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/types': 7.23.6 + dev: true + + /@babel/helper-member-expression-to-functions@7.23.0: + resolution: { integrity: sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/types': 7.23.6 + dev: true + + /@babel/helper-module-imports@7.22.15: + resolution: { integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/types': 7.23.6 + dev: true + + /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-simple-access': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-validator-identifier': 7.22.20 + dev: true + + /@babel/helper-optimise-call-expression@7.22.5: + resolution: { integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/types': 7.23.6 + dev: true + + /@babel/helper-plugin-utils@7.22.5: + resolution: { integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== } + engines: { node: '>=6.9.0' } + dev: true + + /@babel/helper-remap-async-to-generator@7.22.20(@babel/core@7.23.6): + resolution: { integrity: sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-wrap-function': 7.22.20 + dev: true + + /@babel/helper-replace-supers@7.22.20(@babel/core@7.23.6): + resolution: { integrity: sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-member-expression-to-functions': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 + dev: true + + /@babel/helper-simple-access@7.22.5: + resolution: { integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/types': 7.23.6 + dev: true + + /@babel/helper-skip-transparent-expression-wrappers@7.22.5: + resolution: { integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/types': 7.23.6 + dev: true + + /@babel/helper-split-export-declaration@7.22.6: + resolution: { integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/types': 7.23.6 + dev: true + + /@babel/helper-string-parser@7.23.4: + resolution: { integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== } + engines: { node: '>=6.9.0' } + dev: true + + /@babel/helper-validator-identifier@7.22.20: + resolution: { integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== } + engines: { node: '>=6.9.0' } + dev: true + + /@babel/helper-validator-option@7.23.5: + resolution: { integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== } + engines: { node: '>=6.9.0' } + dev: true + + /@babel/helper-wrap-function@7.22.20: + resolution: { integrity: sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/helper-function-name': 7.23.0 + '@babel/template': 7.22.15 + '@babel/types': 7.23.6 + dev: true + + /@babel/helpers@7.23.6: + resolution: { integrity: sha512-wCfsbN4nBidDRhpDhvcKlzHWCTlgJYUUdSJfzXb2NuBssDSIjc3xcb+znA7l+zYsFljAcGM0aFkN40cR3lXiGA== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/template': 7.22.15 + '@babel/traverse': 7.23.6 + '@babel/types': 7.23.6 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/highlight@7.23.4: + resolution: { integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/helper-validator-identifier': 7.22.20 + chalk: 2.4.2 + js-tokens: 4.0.0 + dev: true + + /@babel/parser@7.23.6: + resolution: { integrity: sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== } + engines: { node: '>=6.0.0' } + hasBin: true + dependencies: + '@babel/types': 7.23.6 + dev: true + + /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-iRkKcCqb7iGnq9+3G6rZ+Ciz5VywC4XNRHe57lKM+jOeYAoR0lVqdeeDRfh0tQcTfw/+vBhHn926FmQhLtlFLQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-WwlxbfMNdVEpQjZmK5mhm7oSwD3dS6eU+Iwsi4Knl9wAletWem7kaRsGOG+8UEbRyqxY4SS5zvtfXwX+jMxUwQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.13.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/plugin-transform-optional-chaining': 7.23.4(@babel/core@7.23.6) + dev: true + + /@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-XaJak1qcityzrX0/IU5nKHb34VaibwP3saKqG6a/tppelgllOH13LUann4ZCIBcVOeE6H18K4Vx9QKkVww3z/w== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.23.6): + resolution: { integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== } + engines: { node: '>=6.9.0' } + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-create-class-features-plugin': 7.23.6(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-proposal-decorators@7.23.6(@babel/core@7.23.6): + resolution: { integrity: sha512-D7Ccq9LfkBFnow3azZGJvZYgcfeqAw3I1e5LoTpj6UKIFQilh8yqXsIGcRIqbBdsPWIz+Ze7ZZfggSj62Qp+Fg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-create-class-features-plugin': 7.23.6(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.6) + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/plugin-syntax-decorators': 7.23.3(@babel/core@7.23.6) + dev: true + + /@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.23.6): + resolution: { integrity: sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + dev: true + + /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.23.6): + resolution: { integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.23.6): + resolution: { integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.23.6): + resolution: { integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-decorators@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-cf7Niq4/+/juY67E0PbgH0TDhLQ5J7zS8C/Q5FFx+DWyrRa9sUQdTXkjqKu8zGvuqr7vw1muKiukseihU+PJDA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.23.6): + resolution: { integrity: sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.23.6): + resolution: { integrity: sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-import-assertions@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-lPgDSU+SJLK3xmFDTV2ZRQAiM7UuUjGidwBywFavObCiZc1BeAAcMtHJKUya92hPHO+at63JJPLygilZard8jw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-import-attributes@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-pawnE0P9g10xgoP7yKr6CK63K2FMsTE+FZidZO/1PwRdzmAPVs+HS1mAURUsgaoxammTJvULUdIkEK0gOcU2tA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.23.6): + resolution: { integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.23.6): + resolution: { integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.23.6): + resolution: { integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.23.6): + resolution: { integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.23.6): + resolution: { integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.23.6): + resolution: { integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.23.6): + resolution: { integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.23.6): + resolution: { integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.23.6): + resolution: { integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.23.6): + resolution: { integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.23.6): + resolution: { integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-arrow-functions@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-NzQcQrzaQPkaEwoTm4Mhyl8jI1huEL/WWIEvudjTCMJ9aBZNpsJbMASx7EQECtQQPS/DcnFpo0FIh3LvEO9cxQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-async-generator-functions@7.23.4(@babel/core@7.23.6): + resolution: { integrity: sha512-efdkfPhHYTtn0G6n2ddrESE91fgXxjlqLsnUtPWnJs4a4mZIbUaK7ffqKIIUKXSHwcDvaCVX6GXkaJJFqtX7jw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.6) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.6) + dev: true + + /@babel/plugin-transform-async-to-generator@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-A7LFsKi4U4fomjqXJlZg/u0ft/n8/7n7lpffUP/ZULx/DtV9SGlNKZolHH6PE8Xl1ngCc0M11OaeZptXVkfKSw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.6) + dev: true + + /@babel/plugin-transform-block-scoped-functions@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-vI+0sIaPIO6CNuM9Kk5VmXcMVRiOpDh7w2zZt9GXzmE/9KD70CUEVhvPR/etAeNK/FAEkhxQtXOzVF3EuRL41A== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-block-scoping@7.23.4(@babel/core@7.23.6): + resolution: { integrity: sha512-0QqbP6B6HOh7/8iNR4CQU2Th/bbRtBp4KS9vcaZd1fZ0wSh5Fyssg0UCIHwxh+ka+pNDREbVLQnHCMHKZfPwfw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-class-properties@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-uM+AN8yCIjDPccsKGlw271xjJtGii+xQIF/uMPS8H15L12jZTsLfF4o5vNO7d/oUguOyfdikHGc/yi9ge4SGIg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-create-class-features-plugin': 7.23.6(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-class-static-block@7.23.4(@babel/core@7.23.6): + resolution: { integrity: sha512-nsWu/1M+ggti1SOALj3hfx5FXzAY06fwPJsUZD4/A5e1bWi46VUIWtD+kOX6/IdhXGsXBWllLFDSnqSCdUNydQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.12.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-create-class-features-plugin': 7.23.6(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.23.6) + dev: true + + /@babel/plugin-transform-classes@7.23.5(@babel/core@7.23.6): + resolution: { integrity: sha512-jvOTR4nicqYC9yzOHIhXG5emiFEOpappSJAl73SDSEDcybD+Puuze8Tnpb9p9qEyYup24tq891gkaygIFvWDqg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-compilation-targets': 7.23.6 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.6) + '@babel/helper-split-export-declaration': 7.22.6 + globals: 11.12.0 + dev: true + + /@babel/plugin-transform-computed-properties@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-dTj83UVTLw/+nbiHqQSFdwO9CbTtwq1DsDqm3CUEtDrZNET5rT5E6bIdTlOftDTDLMYxvxHNEYO4B9SLl8SLZw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/template': 7.22.15 + dev: true + + /@babel/plugin-transform-destructuring@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-n225npDqjDIr967cMScVKHXJs7rout1q+tt50inyBCPkyZ8KxeI6d+GIbSBTT/w/9WdlWDOej3V9HE5Lgk57gw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-dotall-regex@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-vgnFYDHAKzFaTVp+mneDsIEbnJ2Np/9ng9iviHw3P/KVcgONxpNULEW/51Z/BaFojG2GI2GwwXck5uV1+1NOYQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-duplicate-keys@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-RrqQ+BQmU3Oyav3J+7/myfvRCq7Tbz+kKLLshUmMwNlDHExbGL7ARhajvoBJEvc+fCguPPu887N+3RRXBVKZUA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-dynamic-import@7.23.4(@babel/core@7.23.6): + resolution: { integrity: sha512-V6jIbLhdJK86MaLh4Jpghi8ho5fGzt3imHOBu/x0jlBaPYqDoWz4RDXjmMOfnh+JWNaQleEAByZLV0QzBT4YQQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.6) + dev: true + + /@babel/plugin-transform-exponentiation-operator@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-5fhCsl1odX96u7ILKHBj4/Y8vipoqwsJMh4csSA8qFfxrZDEA4Ssku2DyNvMJSmZNOEBT750LfFPbtrnTP90BQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-builder-binary-assignment-operator-visitor': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-export-namespace-from@7.23.4(@babel/core@7.23.6): + resolution: { integrity: sha512-GzuSBcKkx62dGzZI1WVgTWvkkz84FZO5TC5T8dl/Tht/rAla6Dg/Mz9Yhypg+ezVACf/rgDuQt3kbWEv7LdUDQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.23.6) + dev: true + + /@babel/plugin-transform-for-of@7.23.6(@babel/core@7.23.6): + resolution: { integrity: sha512-aYH4ytZ0qSuBbpfhuofbg/e96oQ7U2w1Aw/UQmKT+1l39uEhUPoFS3fHevDc1G0OvewyDudfMKY1OulczHzWIw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + dev: true + + /@babel/plugin-transform-function-name@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-I1QXp1LxIvt8yLaib49dRW5Okt7Q4oaxao6tFVKS/anCdEOMtYwWVKoiOA1p34GOWIZjUK0E+zCp7+l1pfQyiw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-compilation-targets': 7.23.6 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-json-strings@7.23.4(@babel/core@7.23.6): + resolution: { integrity: sha512-81nTOqM1dMwZ/aRXQ59zVubN9wHGqk6UtqRK+/q+ciXmRy8fSolhGVvG09HHRGo4l6fr/c4ZhXUQH0uFW7PZbg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.6) + dev: true + + /@babel/plugin-transform-literals@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-wZ0PIXRxnwZvl9AYpqNUxpZ5BiTGrYt7kueGQ+N5FiQ7RCOD4cm8iShd6S6ggfVIWaJf2EMk8eRzAh52RfP4rQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-logical-assignment-operators@7.23.4(@babel/core@7.23.6): + resolution: { integrity: sha512-Mc/ALf1rmZTP4JKKEhUwiORU+vcfarFVLfcFiolKUo6sewoxSEgl36ak5t+4WamRsNr6nzjZXQjM35WsU+9vbg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.6) + dev: true + + /@babel/plugin-transform-member-expression-literals@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-sC3LdDBDi5x96LA+Ytekz2ZPk8i/Ck+DEuDbRAll5rknJ5XRTSaPKEYwomLcs1AA8wg9b3KjIQRsnApj+q51Ag== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-modules-amd@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-vJYQGxeKM4t8hYCKVBlZX/gtIY2I7mRGFNcm85sgXGMTBcoV3QdVtdpbcWEbzbfUIUZKwvgFT82mRvaQIebZzw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-modules-commonjs@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-simple-access': 7.22.5 + dev: true + + /@babel/plugin-transform-modules-systemjs@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-ZxyKGTkF9xT9YJuKQRo19ewf3pXpopuYQd8cDXqNzc3mUNbOME0RKMoZxviQk74hwzfQsEe66dE92MaZbdHKNQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-identifier': 7.22.20 + dev: true + + /@babel/plugin-transform-modules-umd@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-zHsy9iXX2nIsCBFPud3jKn1IRPWg3Ing1qOZgeKV39m1ZgIdpJqvlWVeiHBZC6ITRG0MfskhYe9cLgntfSFPIg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-named-capturing-groups-regex@7.22.5(@babel/core@7.23.6): + resolution: { integrity: sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-new-target@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-YJ3xKqtJMAT5/TIZnpAR3I+K+WaDowYbN3xyxI8zxx/Gsypwf9B9h0VB+1Nh6ACAAPRS5NSRje0uVv5i79HYGQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-nullish-coalescing-operator@7.23.4(@babel/core@7.23.6): + resolution: { integrity: sha512-jHE9EVVqHKAQx+VePv5LLGHjmHSJR76vawFPTdlxR/LVJPfOEGxREQwQfjuZEOPTwG92X3LINSh3M40Rv4zpVA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.6) + dev: true + + /@babel/plugin-transform-numeric-separator@7.23.4(@babel/core@7.23.6): + resolution: { integrity: sha512-mps6auzgwjRrwKEZA05cOwuDc9FAzoyFS4ZsG/8F43bTLf/TgkJg7QXOrPO1JO599iA3qgK9MXdMGOEC8O1h6Q== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.6) + dev: true + + /@babel/plugin-transform-object-rest-spread@7.23.4(@babel/core@7.23.6): + resolution: { integrity: sha512-9x9K1YyeQVw0iOXJlIzwm8ltobIIv7j2iLyP2jIhEbqPRQ7ScNgwQufU2I0Gq11VjyG4gI4yMXt2VFags+1N3g== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.23.5 + '@babel/core': 7.23.6 + '@babel/helper-compilation-targets': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.6) + '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.23.6) + dev: true + + /@babel/plugin-transform-object-super@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-BwQ8q0x2JG+3lxCVFohg+KbQM7plfpBwThdW9A6TMtWwLsbDA01Ek2Zb/AgDN39BiZsExm4qrXxjk+P1/fzGrA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.6) + dev: true + + /@babel/plugin-transform-optional-catch-binding@7.23.4(@babel/core@7.23.6): + resolution: { integrity: sha512-XIq8t0rJPHf6Wvmbn9nFxU6ao4c7WhghTR5WyV8SrJfUFzyxhCm4nhC+iAp3HFhbAKLfYpgzhJ6t4XCtVwqO5A== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.6) + dev: true + + /@babel/plugin-transform-optional-chaining@7.23.4(@babel/core@7.23.6): + resolution: { integrity: sha512-ZU8y5zWOfjM5vZ+asjgAPwDaBjJzgufjES89Rs4Lpq63O300R/kOz30WCLo6BxxX6QVEilwSlpClnG5cZaikTA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.6) + dev: true + + /@babel/plugin-transform-parameters@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-09lMt6UsUb3/34BbECKVbVwrT9bO6lILWln237z7sLaWnMsTi7Yc9fhX5DLpkJzAGfaReXI22wP41SZmnAA3Vw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-private-methods@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-UzqRcRtWsDMTLrRWFvUBDwmw06tCQH9Rl1uAjfh6ijMSmGYQ+fpdB+cnqRC8EMh5tuuxSv0/TejGL+7vyj+50g== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-create-class-features-plugin': 7.23.6(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-private-property-in-object@7.23.4(@babel/core@7.23.6): + resolution: { integrity: sha512-9G3K1YqTq3F4Vt88Djx1UZ79PDyj+yKRnUy7cZGSMe+a7jkwD259uKKuUzQlPkGam7R+8RJwh5z4xO27fA1o2A== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-create-class-features-plugin': 7.23.6(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.23.6) + dev: true + + /@babel/plugin-transform-property-literals@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-jR3Jn3y7cZp4oEWPFAlRsSWjxKe4PZILGBSd4nis1TsC5qeSpb+nrtihJuDhNI7QHiVbUaiXa0X2RZY3/TI6Nw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-regenerator@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-KP+75h0KghBMcVpuKisx3XTu9Ncut8Q8TuvGO4IhY+9D5DFEckQefOuIsB/gQ2tG71lCke4NMrtIPS8pOj18BQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + regenerator-transform: 0.15.2 + dev: true + + /@babel/plugin-transform-reserved-words@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-QnNTazY54YqgGxwIexMZva9gqbPa15t/x9VS+0fsEFWplwVpXYZivtgl43Z1vMpc1bdPP2PP8siFeVcnFvA3Cg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-shorthand-properties@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-ED2fgqZLmexWiN+YNFX26fx4gh5qHDhn1O2gvEhreLW2iI63Sqm4llRLCXALKrCnbN4Jy0VcMQZl/SAzqug/jg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-spread@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-VvfVYlrlBVu+77xVTOAoxQ6mZbnIq5FM0aGBSFEcIh03qHf+zNqA4DC/3XMUozTg7bZV3e3mZQ0i13VB6v5yUg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + dev: true + + /@babel/plugin-transform-sticky-regex@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-HZOyN9g+rtvnOU3Yh7kSxXrKbzgrm5X4GncPY1QOquu7epga5MxKHVpYu2hvQnry/H+JjckSYRb93iNfsioAGg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-template-literals@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-Flok06AYNp7GV2oJPZZcP9vZdszev6vPBkHLwxwSpaIqx75wn6mUd3UFWsSsA0l8nXAKkyCmL/sR02m8RYGeHg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-typeof-symbol@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-4t15ViVnaFdrPC74be1gXBSMzXk3B4Us9lP7uLRQHTFpV5Dvt33pn+2MyyNxmN3VTTm3oTrZVMUmuw3oBnQ2oQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-unicode-escapes@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-OMCUx/bU6ChE3r4+ZdylEqAjaQgHAgipgW8nsCfu5pGqDcFytVd91AwRvUJSBZDz0exPGgnjoqhgRYLRjFZc9Q== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-unicode-property-regex@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-KcLIm+pDZkWZQAFJ9pdfmh89EwVfmNovFBcXko8szpBeF8z68kWIPeKlmSOkT9BXJxs2C0uk+5LxoxIv62MROA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-unicode-regex@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-wMHpNA4x2cIA32b/ci3AfwNgheiva2W0WUKWTK7vBHBhDKfPsc5cFGNWm69WBqpwd86u1qwZ9PWevKqm1A3yAw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-unicode-sets-regex@7.23.3(@babel/core@7.23.6): + resolution: { integrity: sha512-W7lliA/v9bNR83Qc3q1ip9CQMZ09CcHDbHfbLRDNuAhn1Mvkr1ZNF7hPmztMQvtTGVLJ9m8IZqWsTkXOml8dbw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/polyfill@7.12.1: + resolution: { integrity: sha512-X0pi0V6gxLi6lFZpGmeNa4zxtwEmCs42isWLNjZZDE0Y8yVfgu0T2OAHlzBbdYlqbW/YXVvoBHpATEM+goCj8g== } + deprecated: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information. + dependencies: + core-js: 2.6.12 + regenerator-runtime: 0.13.11 + dev: true + + /@babel/preset-env@7.23.6(@babel/core@7.23.6): + resolution: { integrity: sha512-2XPn/BqKkZCpzYhUUNZ1ssXw7DcXfKQEjv/uXZUXgaebCMYmkEsfZ2yY+vv+xtXv50WmL5SGhyB6/xsWxIvvOQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.23.5 + '@babel/core': 7.23.6 + '@babel/helper-compilation-targets': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-option': 7.23.5 + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.23.6) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.6) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.23.6) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.23.6) + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.6) + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.23.6) + '@babel/plugin-syntax-import-assertions': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-syntax-import-attributes': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.23.6) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.6) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.6) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.6) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.6) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.6) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.6) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.6) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.23.6) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.23.6) + '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.23.6) + '@babel/plugin-transform-arrow-functions': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-async-generator-functions': 7.23.4(@babel/core@7.23.6) + '@babel/plugin-transform-async-to-generator': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-block-scoped-functions': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-block-scoping': 7.23.4(@babel/core@7.23.6) + '@babel/plugin-transform-class-properties': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-class-static-block': 7.23.4(@babel/core@7.23.6) + '@babel/plugin-transform-classes': 7.23.5(@babel/core@7.23.6) + '@babel/plugin-transform-computed-properties': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-destructuring': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-dotall-regex': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-duplicate-keys': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-dynamic-import': 7.23.4(@babel/core@7.23.6) + '@babel/plugin-transform-exponentiation-operator': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-export-namespace-from': 7.23.4(@babel/core@7.23.6) + '@babel/plugin-transform-for-of': 7.23.6(@babel/core@7.23.6) + '@babel/plugin-transform-function-name': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-json-strings': 7.23.4(@babel/core@7.23.6) + '@babel/plugin-transform-literals': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-logical-assignment-operators': 7.23.4(@babel/core@7.23.6) + '@babel/plugin-transform-member-expression-literals': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-modules-amd': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-modules-commonjs': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-modules-systemjs': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-modules-umd': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-named-capturing-groups-regex': 7.22.5(@babel/core@7.23.6) + '@babel/plugin-transform-new-target': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-nullish-coalescing-operator': 7.23.4(@babel/core@7.23.6) + '@babel/plugin-transform-numeric-separator': 7.23.4(@babel/core@7.23.6) + '@babel/plugin-transform-object-rest-spread': 7.23.4(@babel/core@7.23.6) + '@babel/plugin-transform-object-super': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-optional-catch-binding': 7.23.4(@babel/core@7.23.6) + '@babel/plugin-transform-optional-chaining': 7.23.4(@babel/core@7.23.6) + '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-private-methods': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-private-property-in-object': 7.23.4(@babel/core@7.23.6) + '@babel/plugin-transform-property-literals': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-regenerator': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-reserved-words': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-shorthand-properties': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-spread': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-sticky-regex': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-template-literals': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-typeof-symbol': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-unicode-escapes': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-unicode-property-regex': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-unicode-regex': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-unicode-sets-regex': 7.23.3(@babel/core@7.23.6) + '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.23.6) + babel-plugin-polyfill-corejs2: 0.4.7(@babel/core@7.23.6) + babel-plugin-polyfill-corejs3: 0.8.7(@babel/core@7.23.6) + babel-plugin-polyfill-regenerator: 0.5.4(@babel/core@7.23.6) + core-js-compat: 3.34.0 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.23.6): + resolution: { integrity: sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA== } + peerDependencies: + '@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/types': 7.23.6 + esutils: 2.0.3 + dev: true + + /@babel/register@7.22.15(@babel/core@7.23.6): + resolution: { integrity: sha512-V3Q3EqoQdn65RCgTLwauZaTfd1ShhwPmbBv+1dkZV/HpCGMKVyn6oFcRlI7RaKqiDQjX2Qd3AuoEguBgdjIKlg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.6 + clone-deep: 4.0.1 + find-cache-dir: 2.1.0 + make-dir: 2.1.0 + pirates: 4.0.6 + source-map-support: 0.5.21 + dev: true + + /@babel/regjsgen@0.8.0: + resolution: { integrity: sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== } + dev: true + + /@babel/runtime@7.23.6: + resolution: { integrity: sha512-zHd0eUrf5GZoOWVCXp6koAKQTfZV07eit6bGPmJgnZdnSAvvZee6zniW2XMF7Cmc4ISOOnPy3QaSiIJGJkVEDQ== } + engines: { node: '>=6.9.0' } + dependencies: + regenerator-runtime: 0.14.1 + + /@babel/template@7.22.15: + resolution: { integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/code-frame': 7.23.5 + '@babel/parser': 7.23.6 + '@babel/types': 7.23.6 + dev: true + + /@babel/traverse@7.23.6: + resolution: { integrity: sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.6 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/parser': 7.23.6 + '@babel/types': 7.23.6 + debug: 4.3.4(supports-color@8.1.1) + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/types@7.23.6: + resolution: { integrity: sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg== } + engines: { node: '>=6.9.0' } + dependencies: + '@babel/helper-string-parser': 7.23.4 + '@babel/helper-validator-identifier': 7.22.20 + to-fast-properties: 2.0.0 + dev: true + + /@eslint-community/eslint-utils@4.4.0(eslint@8.56.0): + resolution: { integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.56.0 + eslint-visitor-keys: 3.4.3 + dev: true + + /@eslint-community/regexpp@4.10.0: + resolution: { integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== } + engines: { node: ^12.0.0 || ^14.0.0 || >=16.0.0 } + dev: true + + /@eslint/eslintrc@2.1.4: + resolution: { integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dependencies: + ajv: 6.12.6 + debug: 4.3.4(supports-color@8.1.1) + espree: 9.6.1 + globals: 13.24.0 + ignore: 5.3.0 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@eslint/js@8.56.0: + resolution: { integrity: sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dev: true + + /@fleetbase/sdk@1.2.7: + resolution: { integrity: sha512-SfpMRD6Gz4AitUrhq2sMsDrQwvh9z5hkKRjjzpocD3Q2lcKqkEi3VVmzGm2HUuEKKL+huZ2B3BQwPzUWlWXLaw== } + dependencies: + '@babel/runtime': 7.23.6 + axios: 0.21.1 + cross-fetch: 4.0.0 + global: 4.4.0 + rollup: 4.9.1 + transitivePeerDependencies: + - debug + - encoding + dev: false + + /@humanwhocodes/config-array@0.11.13: + resolution: { integrity: sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ== } + engines: { node: '>=10.10.0' } + dependencies: + '@humanwhocodes/object-schema': 2.0.1 + debug: 4.3.4(supports-color@8.1.1) + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@humanwhocodes/module-importer@1.0.1: + resolution: { integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== } + engines: { node: '>=12.22' } + dev: true + + /@humanwhocodes/object-schema@2.0.1: + resolution: { integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw== } + dev: true + + /@jridgewell/gen-mapping@0.3.3: + resolution: { integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== } + engines: { node: '>=6.0.0' } + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping': 0.3.20 + dev: true + + /@jridgewell/resolve-uri@3.1.1: + resolution: { integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== } + engines: { node: '>=6.0.0' } + dev: true + + /@jridgewell/set-array@1.1.2: + resolution: { integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== } + engines: { node: '>=6.0.0' } + dev: true + + /@jridgewell/source-map@0.3.5: + resolution: { integrity: sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ== } + dependencies: + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.20 + dev: true + + /@jridgewell/sourcemap-codec@1.4.15: + resolution: { integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== } + dev: true + + /@jridgewell/trace-mapping@0.3.20: + resolution: { integrity: sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== } + dependencies: + '@jridgewell/resolve-uri': 3.1.1 + '@jridgewell/sourcemap-codec': 1.4.15 + dev: true + + /@nodelib/fs.scandir@2.1.5: + resolution: { integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== } + engines: { node: '>= 8' } + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + dev: true + + /@nodelib/fs.stat@2.0.5: + resolution: { integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== } + engines: { node: '>= 8' } + dev: true + + /@nodelib/fs.walk@1.2.8: + resolution: { integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== } + engines: { node: '>= 8' } + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.16.0 + dev: true + + /@rollup/plugin-babel@6.0.4(@babel/core@7.23.6)(rollup@4.9.1): + resolution: { integrity: sha512-YF7Y52kFdFT/xVSuVdjkV5ZdX/3YtmX0QulG+x0taQOtJdHYzVU61aSSkAgVJ7NOv6qPkIYiJSgSWWN/DM5sGw== } + engines: { node: '>=14.0.0' } + peerDependencies: + '@babel/core': ^7.0.0 + '@types/babel__core': ^7.1.9 + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + '@types/babel__core': + optional: true + rollup: + optional: true + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-module-imports': 7.22.15 + '@rollup/pluginutils': 5.1.0(rollup@4.9.1) + rollup: 4.9.1 + dev: true + + /@rollup/plugin-node-resolve@15.2.3(rollup@4.9.1): + resolution: { integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ== } + engines: { node: '>=14.0.0' } + peerDependencies: + rollup: ^2.78.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.1.0(rollup@4.9.1) + '@types/resolve': 1.20.2 + deepmerge: 4.3.1 + is-builtin-module: 3.2.1 + is-module: 1.0.0 + resolve: 1.22.8 + rollup: 4.9.1 + dev: true + + /@rollup/pluginutils@5.1.0(rollup@4.9.1): + resolution: { integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g== } + engines: { node: '>=14.0.0' } + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@types/estree': 1.0.5 + estree-walker: 2.0.2 + picomatch: 2.3.1 + rollup: 4.9.1 + dev: true + + /@rollup/rollup-android-arm-eabi@4.9.1: + resolution: { integrity: sha512-6vMdBZqtq1dVQ4CWdhFwhKZL6E4L1dV6jUjuBvsavvNJSppzi6dLBbuV+3+IyUREaj9ZFvQefnQm28v4OCXlig== } + cpu: [arm] + os: [android] + requiresBuild: true + optional: true + + /@rollup/rollup-android-arm64@4.9.1: + resolution: { integrity: sha512-Jto9Fl3YQ9OLsTDWtLFPtaIMSL2kwGyGoVCmPC8Gxvym9TCZm4Sie+cVeblPO66YZsYH8MhBKDMGZ2NDxuk/XQ== } + cpu: [arm64] + os: [android] + requiresBuild: true + optional: true + + /@rollup/rollup-darwin-arm64@4.9.1: + resolution: { integrity: sha512-LtYcLNM+bhsaKAIGwVkh5IOWhaZhjTfNOkGzGqdHvhiCUVuJDalvDxEdSnhFzAn+g23wgsycmZk1vbnaibZwwA== } + cpu: [arm64] + os: [darwin] + requiresBuild: true + optional: true + + /@rollup/rollup-darwin-x64@4.9.1: + resolution: { integrity: sha512-KyP/byeXu9V+etKO6Lw3E4tW4QdcnzDG/ake031mg42lob5tN+5qfr+lkcT/SGZaH2PdW4Z1NX9GHEkZ8xV7og== } + cpu: [x64] + os: [darwin] + requiresBuild: true + optional: true + + /@rollup/rollup-linux-arm-gnueabihf@4.9.1: + resolution: { integrity: sha512-Yqz/Doumf3QTKplwGNrCHe/B2p9xqDghBZSlAY0/hU6ikuDVQuOUIpDP/YcmoT+447tsZTmirmjgG3znvSCR0Q== } + cpu: [arm] + os: [linux] + requiresBuild: true + optional: true + + /@rollup/rollup-linux-arm64-gnu@4.9.1: + resolution: { integrity: sha512-u3XkZVvxcvlAOlQJ3UsD1rFvLWqu4Ef/Ggl40WAVCuogf4S1nJPHh5RTgqYFpCOvuGJ7H5yGHabjFKEZGExk5Q== } + cpu: [arm64] + os: [linux] + requiresBuild: true + optional: true + + /@rollup/rollup-linux-arm64-musl@4.9.1: + resolution: { integrity: sha512-0XSYN/rfWShW+i+qjZ0phc6vZ7UWI8XWNz4E/l+6edFt+FxoEghrJHjX1EY/kcUGCnZzYYRCl31SNdfOi450Aw== } + cpu: [arm64] + os: [linux] + requiresBuild: true + optional: true + + /@rollup/rollup-linux-riscv64-gnu@4.9.1: + resolution: { integrity: sha512-LmYIO65oZVfFt9t6cpYkbC4d5lKHLYv5B4CSHRpnANq0VZUQXGcCPXHzbCXCz4RQnx7jvlYB1ISVNCE/omz5cw== } + cpu: [riscv64] + os: [linux] + requiresBuild: true + optional: true + + /@rollup/rollup-linux-x64-gnu@4.9.1: + resolution: { integrity: sha512-kr8rEPQ6ns/Lmr/hiw8sEVj9aa07gh1/tQF2Y5HrNCCEPiCBGnBUt9tVusrcBBiJfIt1yNaXN6r1CCmpbFEDpg== } + cpu: [x64] + os: [linux] + requiresBuild: true + optional: true + + /@rollup/rollup-linux-x64-musl@4.9.1: + resolution: { integrity: sha512-t4QSR7gN+OEZLG0MiCgPqMWZGwmeHhsM4AkegJ0Kiy6TnJ9vZ8dEIwHw1LcZKhbHxTY32hp9eVCMdR3/I8MGRw== } + cpu: [x64] + os: [linux] + requiresBuild: true + optional: true + + /@rollup/rollup-win32-arm64-msvc@4.9.1: + resolution: { integrity: sha512-7XI4ZCBN34cb+BH557FJPmh0kmNz2c25SCQeT9OiFWEgf8+dL6ZwJ8f9RnUIit+j01u07Yvrsuu1rZGxJCc51g== } + cpu: [arm64] + os: [win32] + requiresBuild: true + optional: true + + /@rollup/rollup-win32-ia32-msvc@4.9.1: + resolution: { integrity: sha512-yE5c2j1lSWOH5jp+Q0qNL3Mdhr8WuqCNVjc6BxbVfS5cAS6zRmdiw7ktb8GNpDCEUJphILY6KACoFoRtKoqNQg== } + cpu: [ia32] + os: [win32] + requiresBuild: true + optional: true + + /@rollup/rollup-win32-x64-msvc@4.9.1: + resolution: { integrity: sha512-PyJsSsafjmIhVgaI1Zdj7m8BB8mMckFah/xbpplObyHfiXzKcI5UOUXRyOdHW7nz4DpMCuzLnF7v5IWHenCwYA== } + cpu: [x64] + os: [win32] + requiresBuild: true + optional: true + + /@types/estree@1.0.5: + resolution: { integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== } + dev: true + + /@types/json5@0.0.29: + resolution: { integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== } + dev: true + + /@types/node@20.10.5: + resolution: { integrity: sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw== } + dependencies: + undici-types: 5.26.5 + dev: true + + /@types/resolve@1.20.2: + resolution: { integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q== } + dev: true + + /@ungap/structured-clone@1.2.0: + resolution: { integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== } + dev: true + + /acorn-jsx@5.3.2(acorn@7.4.1): + resolution: { integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== } + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: 7.4.1 + dev: true + + /acorn-jsx@5.3.2(acorn@8.11.2): + resolution: { integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== } + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: 8.11.2 + dev: true + + /acorn@7.4.1: + resolution: { integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== } + engines: { node: '>=0.4.0' } + hasBin: true + dev: true + + /acorn@8.11.2: + resolution: { integrity: sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w== } + engines: { node: '>=0.4.0' } + hasBin: true + dev: true + + /ajv@6.12.6: + resolution: { integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== } + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + dev: true + + /ansi-colors@4.1.1: + resolution: { integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== } + engines: { node: '>=6' } + dev: true + + /ansi-escapes@4.3.2: + resolution: { integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== } + engines: { node: '>=8' } + dependencies: + type-fest: 0.21.3 + dev: true + + /ansi-escapes@6.2.0: + resolution: { integrity: sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw== } + engines: { node: '>=14.16' } + dependencies: + type-fest: 3.13.1 + dev: true + + /ansi-regex@4.1.1: + resolution: { integrity: sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== } + engines: { node: '>=6' } + dev: true + + /ansi-regex@5.0.1: + resolution: { integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== } + engines: { node: '>=8' } + dev: true + + /ansi-regex@6.0.1: + resolution: { integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== } + engines: { node: '>=12' } + dev: true + + /ansi-styles@3.2.1: + resolution: { integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== } + engines: { node: '>=4' } + dependencies: + color-convert: 1.9.3 + dev: true + + /ansi-styles@4.3.0: + resolution: { integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== } + engines: { node: '>=8' } + dependencies: + color-convert: 2.0.1 + dev: true + + /ansi-styles@6.2.1: + resolution: { integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== } + engines: { node: '>=12' } + dev: true + + /anymatch@3.1.3: + resolution: { integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== } + engines: { node: '>= 8' } + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + dev: true + + /argparse@1.0.10: + resolution: { integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== } + dependencies: + sprintf-js: 1.0.3 + dev: true + + /argparse@2.0.1: + resolution: { integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== } + dev: true + + /array-buffer-byte-length@1.0.0: + resolution: { integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== } + dependencies: + call-bind: 1.0.5 + is-array-buffer: 3.0.2 + dev: true + + /array-includes@3.1.7: + resolution: { integrity: sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + get-intrinsic: 1.2.2 + is-string: 1.0.7 + dev: true + + /array.prototype.findlastindex@1.2.3: + resolution: { integrity: sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + es-shim-unscopables: 1.0.2 + get-intrinsic: 1.2.2 + dev: true + + /array.prototype.flat@1.3.2: + resolution: { integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + es-shim-unscopables: 1.0.2 + dev: true + + /array.prototype.flatmap@1.3.2: + resolution: { integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + es-shim-unscopables: 1.0.2 + dev: true + + /arraybuffer.prototype.slice@1.0.2: + resolution: { integrity: sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw== } + engines: { node: '>= 0.4' } + dependencies: + array-buffer-byte-length: 1.0.0 + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + get-intrinsic: 1.2.2 + is-array-buffer: 3.0.2 + is-shared-array-buffer: 1.0.2 + dev: true + + /assertion-error@1.1.0: + resolution: { integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== } + dev: true + + /astral-regex@1.0.0: + resolution: { integrity: sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== } + engines: { node: '>=4' } + dev: true + + /available-typed-arrays@1.0.5: + resolution: { integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== } + engines: { node: '>= 0.4' } + dev: true + + /axios@0.21.1: + resolution: { integrity: sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== } + dependencies: + follow-redirects: 1.15.3 + transitivePeerDependencies: + - debug + dev: false + + /babel-plugin-polyfill-corejs2@0.4.7(@babel/core@7.23.6): + resolution: { integrity: sha512-LidDk/tEGDfuHW2DWh/Hgo4rmnw3cduK6ZkOI1NPFceSK3n/yAGeOsNT7FLnSGHkXj3RHGSEVkN3FsCTY6w2CQ== } + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + dependencies: + '@babel/compat-data': 7.23.5 + '@babel/core': 7.23.6 + '@babel/helper-define-polyfill-provider': 0.4.4(@babel/core@7.23.6) + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-polyfill-corejs3@0.8.7(@babel/core@7.23.6): + resolution: { integrity: sha512-KyDvZYxAzkC0Aj2dAPyDzi2Ym15e5JKZSK+maI7NAwSqofvuFglbSsxE7wUOvTg9oFVnHMzVzBKcqEb4PJgtOA== } + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-define-polyfill-provider': 0.4.4(@babel/core@7.23.6) + core-js-compat: 3.34.0 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-polyfill-regenerator@0.5.4(@babel/core@7.23.6): + resolution: { integrity: sha512-S/x2iOCvDaCASLYsOOgWOq4bCfKYVqvO/uxjkaYyZ3rVsVE3CeAI/c84NpyuBBymEgNvHgjEot3a9/Z/kXvqsg== } + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-define-polyfill-provider': 0.4.4(@babel/core@7.23.6) + transitivePeerDependencies: + - supports-color + dev: true + + /balanced-match@1.0.2: + resolution: { integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== } + dev: true + + /binary-extensions@2.2.0: + resolution: { integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== } + engines: { node: '>=8' } + dev: true + + /brace-expansion@1.1.11: + resolution: { integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== } + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true + + /brace-expansion@2.0.1: + resolution: { integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== } + dependencies: + balanced-match: 1.0.2 + dev: true + + /braces@3.0.2: + resolution: { integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== } + engines: { node: '>=8' } + dependencies: + fill-range: 7.0.1 + dev: true + + /browser-stdout@1.3.1: + resolution: { integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== } + dev: true + + /browserslist@4.22.2: + resolution: { integrity: sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A== } + engines: { node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7 } + hasBin: true + dependencies: + caniuse-lite: 1.0.30001570 + electron-to-chromium: 1.4.615 + node-releases: 2.0.14 + update-browserslist-db: 1.0.13(browserslist@4.22.2) + dev: true + + /buffer-from@1.1.2: + resolution: { integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== } + dev: true + + /builtin-modules@3.3.0: + resolution: { integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== } + engines: { node: '>=6' } + dev: true + + /call-bind@1.0.5: + resolution: { integrity: sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ== } + dependencies: + function-bind: 1.1.2 + get-intrinsic: 1.2.2 + set-function-length: 1.1.1 + dev: true + + /callsites@3.1.0: + resolution: { integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== } + engines: { node: '>=6' } + dev: true + + /camelcase@6.3.0: + resolution: { integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== } + engines: { node: '>=10' } + dev: true + + /caniuse-lite@1.0.30001570: + resolution: { integrity: sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw== } + dev: true + + /chai@4.3.10: + resolution: { integrity: sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g== } + engines: { node: '>=4' } + dependencies: + assertion-error: 1.1.0 + check-error: 1.0.3 + deep-eql: 4.1.3 + get-func-name: 2.0.2 + loupe: 2.3.7 + pathval: 1.1.1 + type-detect: 4.0.8 + dev: true + + /chalk@2.4.2: + resolution: { integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== } + engines: { node: '>=4' } + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + dev: true + + /chalk@4.1.2: + resolution: { integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== } + engines: { node: '>=10' } + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + + /chalk@5.3.0: + resolution: { integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== } + engines: { node: ^12.17.0 || ^14.13 || >=16.0.0 } + dev: true + + /chardet@0.7.0: + resolution: { integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== } + dev: true + + /check-error@1.0.3: + resolution: { integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg== } + dependencies: + get-func-name: 2.0.2 + dev: true + + /chokidar@3.5.3: + resolution: { integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== } + engines: { node: '>= 8.10.0' } + dependencies: + anymatch: 3.1.3 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + dev: true + + /cli-cursor@3.1.0: + resolution: { integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== } + engines: { node: '>=8' } + dependencies: + restore-cursor: 3.1.0 + dev: true + + /cli-cursor@4.0.0: + resolution: { integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg== } + engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 } + dependencies: + restore-cursor: 4.0.0 + dev: true + + /cli-truncate@4.0.0: + resolution: { integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA== } + engines: { node: '>=18' } + dependencies: + slice-ansi: 5.0.0 + string-width: 7.0.0 + dev: true + + /cli-width@3.0.0: + resolution: { integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== } + engines: { node: '>= 10' } + dev: true + + /cliui@7.0.4: + resolution: { integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== } + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + + /clone-deep@4.0.1: + resolution: { integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== } + engines: { node: '>=6' } + dependencies: + is-plain-object: 2.0.4 + kind-of: 6.0.3 + shallow-clone: 3.0.1 + dev: true + + /color-convert@1.9.3: + resolution: { integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== } + dependencies: + color-name: 1.1.3 + dev: true + + /color-convert@2.0.1: + resolution: { integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== } + engines: { node: '>=7.0.0' } + dependencies: + color-name: 1.1.4 + dev: true + + /color-name@1.1.3: + resolution: { integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== } + dev: true + + /color-name@1.1.4: + resolution: { integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== } + dev: true + + /colorette@2.0.20: + resolution: { integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== } + dev: true + + /commander@11.1.0: + resolution: { integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ== } + engines: { node: '>=16' } + dev: true + + /commander@2.20.3: + resolution: { integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== } + dev: true + + /commondir@1.0.1: + resolution: { integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== } + dev: true + + /concat-map@0.0.1: + resolution: { integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== } + dev: true + + /confusing-browser-globals@1.0.11: + resolution: { integrity: sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== } + dev: true + + /convert-source-map@2.0.0: + resolution: { integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== } + dev: true + + /core-js-compat@3.34.0: + resolution: { integrity: sha512-4ZIyeNbW/Cn1wkMMDy+mvrRUxrwFNjKwbhCfQpDd+eLgYipDqp8oGFGtLmhh18EDPKA0g3VUBYOxQGGwvWLVpA== } + dependencies: + browserslist: 4.22.2 + dev: true + + /core-js@2.6.12: + resolution: { integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== } + deprecated: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. + requiresBuild: true + dev: true + + /cross-fetch@4.0.0: + resolution: { integrity: sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g== } + dependencies: + node-fetch: 2.7.0 + transitivePeerDependencies: + - encoding + dev: false + + /cross-spawn@6.0.5: + resolution: { integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== } + engines: { node: '>=4.8' } + dependencies: + nice-try: 1.0.5 + path-key: 2.0.1 + semver: 5.7.2 + shebang-command: 1.2.0 + which: 1.3.1 + dev: true + + /cross-spawn@7.0.3: + resolution: { integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== } + engines: { node: '>= 8' } + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true + + /date-fns@3.0.1: + resolution: { integrity: sha512-cr9igCUa0QSqgAMj7JOrYTY6Nh1rmyGrFDko7ADqfmaQqP/I2N4rlfrLl7AWuzDaoIpz6MNjoEcTPzgZYIrhnA== } + dev: false + + /debug@3.2.7: + resolution: { integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== } + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.3 + dev: true + + /debug@4.3.4(supports-color@8.1.1): + resolution: { integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== } + engines: { node: '>=6.0' } + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + supports-color: 8.1.1 + dev: true + + /decamelize@4.0.0: + resolution: { integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== } + engines: { node: '>=10' } + dev: true + + /deep-eql@4.1.3: + resolution: { integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== } + engines: { node: '>=6' } + dependencies: + type-detect: 4.0.8 + dev: true + + /deep-is@0.1.4: + resolution: { integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== } + dev: true + + /deepmerge@4.3.1: + resolution: { integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== } + engines: { node: '>=0.10.0' } + dev: true + + /define-data-property@1.1.1: + resolution: { integrity: sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ== } + engines: { node: '>= 0.4' } + dependencies: + get-intrinsic: 1.2.2 + gopd: 1.0.1 + has-property-descriptors: 1.0.1 + dev: true + + /define-properties@1.2.1: + resolution: { integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== } + engines: { node: '>= 0.4' } + dependencies: + define-data-property: 1.1.1 + has-property-descriptors: 1.0.1 + object-keys: 1.1.1 + dev: true + + /diff@5.0.0: + resolution: { integrity: sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== } + engines: { node: '>=0.3.1' } + dev: true + + /doctrine@2.1.0: + resolution: { integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== } + engines: { node: '>=0.10.0' } + dependencies: + esutils: 2.0.3 + dev: true + + /doctrine@3.0.0: + resolution: { integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== } + engines: { node: '>=6.0.0' } + dependencies: + esutils: 2.0.3 + dev: true + + /dom-walk@0.1.2: + resolution: { integrity: sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== } + dev: false + + /electron-to-chromium@1.4.615: + resolution: { integrity: sha512-/bKPPcgZVUziECqDc+0HkT87+0zhaWSZHNXqF8FLd2lQcptpmUFwoCSWjCdOng9Gdq+afKArPdEg/0ZW461Eng== } + dev: true + + /emoji-regex@10.3.0: + resolution: { integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw== } + dev: true + + /emoji-regex@7.0.3: + resolution: { integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== } + dev: true + + /emoji-regex@8.0.0: + resolution: { integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== } + dev: true + + /es-abstract@1.22.3: + resolution: { integrity: sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA== } + engines: { node: '>= 0.4' } + dependencies: + array-buffer-byte-length: 1.0.0 + arraybuffer.prototype.slice: 1.0.2 + available-typed-arrays: 1.0.5 + call-bind: 1.0.5 + es-set-tostringtag: 2.0.2 + es-to-primitive: 1.2.1 + function.prototype.name: 1.1.6 + get-intrinsic: 1.2.2 + get-symbol-description: 1.0.0 + globalthis: 1.0.3 + gopd: 1.0.1 + has-property-descriptors: 1.0.1 + has-proto: 1.0.1 + has-symbols: 1.0.3 + hasown: 2.0.0 + internal-slot: 1.0.6 + is-array-buffer: 3.0.2 + is-callable: 1.2.7 + is-negative-zero: 2.0.2 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.2 + is-string: 1.0.7 + is-typed-array: 1.1.12 + is-weakref: 1.0.2 + object-inspect: 1.13.1 + object-keys: 1.1.1 + object.assign: 4.1.5 + regexp.prototype.flags: 1.5.1 + safe-array-concat: 1.0.1 + safe-regex-test: 1.0.0 + string.prototype.trim: 1.2.8 + string.prototype.trimend: 1.0.7 + string.prototype.trimstart: 1.0.7 + typed-array-buffer: 1.0.0 + typed-array-byte-length: 1.0.0 + typed-array-byte-offset: 1.0.0 + typed-array-length: 1.0.4 + unbox-primitive: 1.0.2 + which-typed-array: 1.1.13 + dev: true + + /es-set-tostringtag@2.0.2: + resolution: { integrity: sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q== } + engines: { node: '>= 0.4' } + dependencies: + get-intrinsic: 1.2.2 + has-tostringtag: 1.0.0 + hasown: 2.0.0 + dev: true + + /es-shim-unscopables@1.0.2: + resolution: { integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw== } + dependencies: + hasown: 2.0.0 + dev: true + + /es-to-primitive@1.2.1: + resolution: { integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== } + engines: { node: '>= 0.4' } + dependencies: + is-callable: 1.2.7 + is-date-object: 1.0.5 + is-symbol: 1.0.4 + dev: true + + /escalade@3.1.1: + resolution: { integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== } + engines: { node: '>=6' } + dev: true + + /escape-string-regexp@1.0.5: + resolution: { integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== } + engines: { node: '>=0.8.0' } + dev: true + + /escape-string-regexp@4.0.0: + resolution: { integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== } + engines: { node: '>=10' } + dev: true + + /eslint-config-airbnb-base@15.0.0(eslint-plugin-import@2.29.1)(eslint@8.56.0): + resolution: { integrity: sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig== } + engines: { node: ^10.12.0 || >=12.0.0 } + peerDependencies: + eslint: ^7.32.0 || ^8.2.0 + eslint-plugin-import: ^2.25.2 + dependencies: + confusing-browser-globals: 1.0.11 + eslint: 8.56.0 + eslint-plugin-import: 2.29.1(eslint@8.56.0) + object.assign: 4.1.5 + object.entries: 1.1.7 + semver: 6.3.1 + dev: true + + /eslint-import-resolver-node@0.3.9: + resolution: { integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g== } + dependencies: + debug: 3.2.7 + is-core-module: 2.13.1 + resolve: 1.22.8 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-module-utils@2.8.0(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): + resolution: { integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw== } + engines: { node: '>=4' } + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + dependencies: + debug: 3.2.7 + eslint: 8.56.0 + eslint-import-resolver-node: 0.3.9 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-plugin-import@2.29.1(eslint@8.56.0): + resolution: { integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw== } + engines: { node: '>=4' } + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + dependencies: + array-includes: 3.1.7 + array.prototype.findlastindex: 1.2.3 + array.prototype.flat: 1.3.2 + array.prototype.flatmap: 1.3.2 + debug: 3.2.7 + doctrine: 2.1.0 + eslint: 8.56.0 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.8.0(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) + hasown: 2.0.0 + is-core-module: 2.13.1 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.fromentries: 2.0.7 + object.groupby: 1.0.1 + object.values: 1.1.7 + semver: 6.3.1 + tsconfig-paths: 3.15.0 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + dev: true + + /eslint-scope@5.1.1: + resolution: { integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== } + engines: { node: '>=8.0.0' } + dependencies: + esrecurse: 4.3.0 + estraverse: 4.3.0 + dev: true + + /eslint-scope@7.2.2: + resolution: { integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: true + + /eslint-utils@1.4.3: + resolution: { integrity: sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== } + engines: { node: '>=6' } + dependencies: + eslint-visitor-keys: 1.3.0 + dev: true + + /eslint-visitor-keys@1.3.0: + resolution: { integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== } + engines: { node: '>=4' } + dev: true + + /eslint-visitor-keys@3.4.3: + resolution: { integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dev: true + + /eslint@6.8.0: + resolution: { integrity: sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== } + engines: { node: ^8.10.0 || ^10.13.0 || >=11.10.1 } + hasBin: true + dependencies: + '@babel/code-frame': 7.23.5 + ajv: 6.12.6 + chalk: 2.4.2 + cross-spawn: 6.0.5 + debug: 4.3.4(supports-color@8.1.1) + doctrine: 3.0.0 + eslint-scope: 5.1.1 + eslint-utils: 1.4.3 + eslint-visitor-keys: 1.3.0 + espree: 6.2.1 + esquery: 1.5.0 + esutils: 2.0.3 + file-entry-cache: 5.0.1 + functional-red-black-tree: 1.0.1 + glob-parent: 5.1.2 + globals: 12.4.0 + ignore: 4.0.6 + import-fresh: 3.3.0 + imurmurhash: 0.1.4 + inquirer: 7.3.3 + is-glob: 4.0.3 + js-yaml: 3.14.1 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.3.0 + lodash: 4.17.21 + minimatch: 3.1.2 + mkdirp: 0.5.6 + natural-compare: 1.4.0 + optionator: 0.8.3 + progress: 2.0.3 + regexpp: 2.0.1 + semver: 6.3.1 + strip-ansi: 5.2.0 + strip-json-comments: 3.1.1 + table: 5.4.6 + text-table: 0.2.0 + v8-compile-cache: 2.4.0 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint@8.56.0: + resolution: { integrity: sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + hasBin: true + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) + '@eslint-community/regexpp': 4.10.0 + '@eslint/eslintrc': 2.1.4 + '@eslint/js': 8.56.0 + '@humanwhocodes/config-array': 0.11.13 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.2.0 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4(supports-color@8.1.1) + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.5.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.24.0 + graphemer: 1.4.0 + ignore: 5.3.0 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.3 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: true + + /espree@6.2.1: + resolution: { integrity: sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw== } + engines: { node: '>=6.0.0' } + dependencies: + acorn: 7.4.1 + acorn-jsx: 5.3.2(acorn@7.4.1) + eslint-visitor-keys: 1.3.0 + dev: true + + /espree@9.6.1: + resolution: { integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dependencies: + acorn: 8.11.2 + acorn-jsx: 5.3.2(acorn@8.11.2) + eslint-visitor-keys: 3.4.3 + dev: true + + /esprima@4.0.1: + resolution: { integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== } + engines: { node: '>=4' } + hasBin: true + dev: true + + /esquery@1.5.0: + resolution: { integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== } + engines: { node: '>=0.10' } + dependencies: + estraverse: 5.3.0 + dev: true + + /esrecurse@4.3.0: + resolution: { integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== } + engines: { node: '>=4.0' } + dependencies: + estraverse: 5.3.0 + dev: true + + /estraverse@4.3.0: + resolution: { integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== } + engines: { node: '>=4.0' } + dev: true + + /estraverse@5.3.0: + resolution: { integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== } + engines: { node: '>=4.0' } + dev: true + + /estree-walker@0.6.1: + resolution: { integrity: sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== } + dev: true + + /estree-walker@2.0.2: + resolution: { integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== } + dev: true + + /esutils@2.0.3: + resolution: { integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== } + engines: { node: '>=0.10.0' } + dev: true + + /eventemitter3@5.0.1: + resolution: { integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== } + dev: true + + /execa@8.0.1: + resolution: { integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg== } + engines: { node: '>=16.17' } + dependencies: + cross-spawn: 7.0.3 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.1.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 + dev: true + + /external-editor@3.1.0: + resolution: { integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== } + engines: { node: '>=4' } + dependencies: + chardet: 0.7.0 + iconv-lite: 0.4.24 + tmp: 0.0.33 + dev: true + + /fast-deep-equal@3.1.3: + resolution: { integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== } + dev: true + + /fast-json-stable-stringify@2.1.0: + resolution: { integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== } + dev: true + + /fast-levenshtein@2.0.6: + resolution: { integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== } + dev: true + + /fastq@1.16.0: + resolution: { integrity: sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA== } + dependencies: + reusify: 1.0.4 + dev: true + + /figures@3.2.0: + resolution: { integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== } + engines: { node: '>=8' } + dependencies: + escape-string-regexp: 1.0.5 + dev: true + + /file-entry-cache@5.0.1: + resolution: { integrity: sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== } + engines: { node: '>=4' } + dependencies: + flat-cache: 2.0.1 + dev: true + + /file-entry-cache@6.0.1: + resolution: { integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== } + engines: { node: ^10.12.0 || >=12.0.0 } + dependencies: + flat-cache: 3.2.0 + dev: true + + /fill-range@7.0.1: + resolution: { integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== } + engines: { node: '>=8' } + dependencies: + to-regex-range: 5.0.1 + dev: true + + /find-cache-dir@2.1.0: + resolution: { integrity: sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== } + engines: { node: '>=6' } + dependencies: + commondir: 1.0.1 + make-dir: 2.1.0 + pkg-dir: 3.0.0 + dev: true + + /find-up@3.0.0: + resolution: { integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== } + engines: { node: '>=6' } + dependencies: + locate-path: 3.0.0 + dev: true + + /find-up@5.0.0: + resolution: { integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== } + engines: { node: '>=10' } + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + dev: true + + /flat-cache@2.0.1: + resolution: { integrity: sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== } + engines: { node: '>=4' } + dependencies: + flatted: 2.0.2 + rimraf: 2.6.3 + write: 1.0.3 + dev: true + + /flat-cache@3.2.0: + resolution: { integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== } + engines: { node: ^10.12.0 || >=12.0.0 } + dependencies: + flatted: 3.2.9 + keyv: 4.5.4 + rimraf: 3.0.2 + dev: true + + /flat@5.0.2: + resolution: { integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== } + hasBin: true + dev: true + + /flatted@2.0.2: + resolution: { integrity: sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== } + dev: true + + /flatted@3.2.9: + resolution: { integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== } + dev: true + + /follow-redirects@1.15.3: + resolution: { integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== } + engines: { node: '>=4.0' } + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: false + + /for-each@0.3.3: + resolution: { integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== } + dependencies: + is-callable: 1.2.7 + dev: true + + /fs.realpath@1.0.0: + resolution: { integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== } + dev: true + + /fsevents@2.3.3: + resolution: { integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== } + engines: { node: ^8.16.0 || ^10.6.0 || >=11.0.0 } + os: [darwin] + requiresBuild: true + optional: true + + /function-bind@1.1.2: + resolution: { integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== } + dev: true + + /function.prototype.name@1.1.6: + resolution: { integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + functions-have-names: 1.2.3 + dev: true + + /functional-red-black-tree@1.0.1: + resolution: { integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== } + dev: true + + /functions-have-names@1.2.3: + resolution: { integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== } + dev: true + + /gensync@1.0.0-beta.2: + resolution: { integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== } + engines: { node: '>=6.9.0' } + dev: true + + /get-caller-file@2.0.5: + resolution: { integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== } + engines: { node: 6.* || 8.* || >= 10.* } + dev: true + + /get-east-asian-width@1.2.0: + resolution: { integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA== } + engines: { node: '>=18' } + dev: true + + /get-func-name@2.0.2: + resolution: { integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== } + dev: true + + /get-intrinsic@1.2.2: + resolution: { integrity: sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA== } + dependencies: + function-bind: 1.1.2 + has-proto: 1.0.1 + has-symbols: 1.0.3 + hasown: 2.0.0 + dev: true + + /get-stream@8.0.1: + resolution: { integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA== } + engines: { node: '>=16' } + dev: true + + /get-symbol-description@1.0.0: + resolution: { integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + dev: true + + /glob-parent@5.1.2: + resolution: { integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== } + engines: { node: '>= 6' } + dependencies: + is-glob: 4.0.3 + dev: true + + /glob-parent@6.0.2: + resolution: { integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== } + engines: { node: '>=10.13.0' } + dependencies: + is-glob: 4.0.3 + dev: true + + /glob@7.2.0: + resolution: { integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== } + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /glob@7.2.3: + resolution: { integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== } + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /global@4.4.0: + resolution: { integrity: sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== } + dependencies: + min-document: 2.19.0 + process: 0.11.10 + dev: false + + /globals@11.12.0: + resolution: { integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== } + engines: { node: '>=4' } + dev: true + + /globals@12.4.0: + resolution: { integrity: sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== } + engines: { node: '>=8' } + dependencies: + type-fest: 0.8.1 + dev: true + + /globals@13.24.0: + resolution: { integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== } + engines: { node: '>=8' } + dependencies: + type-fest: 0.20.2 + dev: true + + /globalthis@1.0.3: + resolution: { integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== } + engines: { node: '>= 0.4' } + dependencies: + define-properties: 1.2.1 + dev: true + + /gopd@1.0.1: + resolution: { integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== } + dependencies: + get-intrinsic: 1.2.2 + dev: true + + /graphemer@1.4.0: + resolution: { integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== } + dev: true + + /has-bigints@1.0.2: + resolution: { integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== } + dev: true + + /has-flag@3.0.0: + resolution: { integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== } + engines: { node: '>=4' } + dev: true + + /has-flag@4.0.0: + resolution: { integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== } + engines: { node: '>=8' } + dev: true + + /has-property-descriptors@1.0.1: + resolution: { integrity: sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg== } + dependencies: + get-intrinsic: 1.2.2 + dev: true + + /has-proto@1.0.1: + resolution: { integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== } + engines: { node: '>= 0.4' } + dev: true + + /has-symbols@1.0.3: + resolution: { integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== } + engines: { node: '>= 0.4' } + dev: true + + /has-tostringtag@1.0.0: + resolution: { integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== } + engines: { node: '>= 0.4' } + dependencies: + has-symbols: 1.0.3 + dev: true + + /hasown@2.0.0: + resolution: { integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA== } + engines: { node: '>= 0.4' } + dependencies: + function-bind: 1.1.2 + dev: true + + /he@1.2.0: + resolution: { integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== } + hasBin: true + dev: true + + /human-signals@5.0.0: + resolution: { integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ== } + engines: { node: '>=16.17.0' } + dev: true + + /husky@8.0.3: + resolution: { integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== } + engines: { node: '>=14' } + hasBin: true + dev: true + + /iconv-lite@0.4.24: + resolution: { integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== } + engines: { node: '>=0.10.0' } + dependencies: + safer-buffer: 2.1.2 + dev: true + + /ignore@4.0.6: + resolution: { integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== } + engines: { node: '>= 4' } + dev: true + + /ignore@5.3.0: + resolution: { integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== } + engines: { node: '>= 4' } + dev: true + + /import-fresh@3.3.0: + resolution: { integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== } + engines: { node: '>=6' } + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + dev: true + + /imurmurhash@0.1.4: + resolution: { integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== } + engines: { node: '>=0.8.19' } + dev: true + + /inflight@1.0.6: + resolution: { integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== } + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + + /inherits@2.0.4: + resolution: { integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== } + dev: true + + /inquirer@7.3.3: + resolution: { integrity: sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== } + engines: { node: '>=8.0.0' } + dependencies: + ansi-escapes: 4.3.2 + chalk: 4.1.2 + cli-cursor: 3.1.0 + cli-width: 3.0.0 + external-editor: 3.1.0 + figures: 3.2.0 + lodash: 4.17.21 + mute-stream: 0.0.8 + run-async: 2.4.1 + rxjs: 6.6.7 + string-width: 4.2.3 + strip-ansi: 6.0.1 + through: 2.3.8 + dev: true + + /internal-slot@1.0.6: + resolution: { integrity: sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg== } + engines: { node: '>= 0.4' } + dependencies: + get-intrinsic: 1.2.2 + hasown: 2.0.0 + side-channel: 1.0.4 + dev: true + + /is-array-buffer@3.0.2: + resolution: { integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== } + dependencies: + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + is-typed-array: 1.1.12 + dev: true + + /is-bigint@1.0.4: + resolution: { integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== } + dependencies: + has-bigints: 1.0.2 + dev: true + + /is-binary-path@2.1.0: + resolution: { integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== } + engines: { node: '>=8' } + dependencies: + binary-extensions: 2.2.0 + dev: true + + /is-boolean-object@1.1.2: + resolution: { integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + has-tostringtag: 1.0.0 + dev: true + + /is-builtin-module@3.2.1: + resolution: { integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A== } + engines: { node: '>=6' } + dependencies: + builtin-modules: 3.3.0 + dev: true + + /is-callable@1.2.7: + resolution: { integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== } + engines: { node: '>= 0.4' } + dev: true + + /is-core-module@2.13.1: + resolution: { integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== } + dependencies: + hasown: 2.0.0 + dev: true + + /is-date-object@1.0.5: + resolution: { integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== } + engines: { node: '>= 0.4' } + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-extglob@2.1.1: + resolution: { integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== } + engines: { node: '>=0.10.0' } + dev: true + + /is-fullwidth-code-point@2.0.0: + resolution: { integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== } + engines: { node: '>=4' } + dev: true + + /is-fullwidth-code-point@3.0.0: + resolution: { integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== } + engines: { node: '>=8' } + dev: true + + /is-fullwidth-code-point@4.0.0: + resolution: { integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ== } + engines: { node: '>=12' } + dev: true + + /is-fullwidth-code-point@5.0.0: + resolution: { integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA== } + engines: { node: '>=18' } + dependencies: + get-east-asian-width: 1.2.0 + dev: true + + /is-glob@4.0.3: + resolution: { integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== } + engines: { node: '>=0.10.0' } + dependencies: + is-extglob: 2.1.1 + dev: true + + /is-module@1.0.0: + resolution: { integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g== } + dev: true + + /is-negative-zero@2.0.2: + resolution: { integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== } + engines: { node: '>= 0.4' } + dev: true + + /is-number-object@1.0.7: + resolution: { integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== } + engines: { node: '>= 0.4' } + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-number@7.0.0: + resolution: { integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== } + engines: { node: '>=0.12.0' } + dev: true + + /is-path-inside@3.0.3: + resolution: { integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== } + engines: { node: '>=8' } + dev: true + + /is-plain-obj@2.1.0: + resolution: { integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== } + engines: { node: '>=8' } + dev: true + + /is-plain-object@2.0.4: + resolution: { integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== } + engines: { node: '>=0.10.0' } + dependencies: + isobject: 3.0.1 + dev: true + + /is-regex@1.1.4: + resolution: { integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + has-tostringtag: 1.0.0 + dev: true + + /is-shared-array-buffer@1.0.2: + resolution: { integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== } + dependencies: + call-bind: 1.0.5 + dev: true + + /is-stream@3.0.0: + resolution: { integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA== } + engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 } + dev: true + + /is-string@1.0.7: + resolution: { integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== } + engines: { node: '>= 0.4' } + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-symbol@1.0.4: + resolution: { integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== } + engines: { node: '>= 0.4' } + dependencies: + has-symbols: 1.0.3 + dev: true + + /is-typed-array@1.1.12: + resolution: { integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== } + engines: { node: '>= 0.4' } + dependencies: + which-typed-array: 1.1.13 + dev: true + + /is-unicode-supported@0.1.0: + resolution: { integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== } + engines: { node: '>=10' } + dev: true + + /is-weakref@1.0.2: + resolution: { integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== } + dependencies: + call-bind: 1.0.5 + dev: true + + /isarray@2.0.5: + resolution: { integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== } + dev: true + + /isexe@2.0.0: + resolution: { integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== } + dev: true + + /isobject@3.0.1: + resolution: { integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== } + engines: { node: '>=0.10.0' } + dev: true + + /jest-worker@26.6.2: + resolution: { integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== } + engines: { node: '>= 10.13.0' } + dependencies: + '@types/node': 20.10.5 + merge-stream: 2.0.0 + supports-color: 7.2.0 + dev: true + + /js-tokens@4.0.0: + resolution: { integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== } + dev: true + + /js-yaml@3.14.1: + resolution: { integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== } + hasBin: true + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + dev: true + + /js-yaml@4.1.0: + resolution: { integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== } + hasBin: true + dependencies: + argparse: 2.0.1 + dev: true + + /jsesc@0.5.0: + resolution: { integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== } + hasBin: true + dev: true + + /jsesc@2.5.2: + resolution: { integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== } + engines: { node: '>=4' } + hasBin: true + dev: true + + /json-buffer@3.0.1: + resolution: { integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== } + dev: true + + /json-schema-traverse@0.4.1: + resolution: { integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== } + dev: true + + /json-stable-stringify-without-jsonify@1.0.1: + resolution: { integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== } + dev: true + + /json5@1.0.2: + resolution: { integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== } + hasBin: true + dependencies: + minimist: 1.2.8 + dev: true + + /json5@2.2.3: + resolution: { integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== } + engines: { node: '>=6' } + hasBin: true + dev: true + + /keyv@4.5.4: + resolution: { integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== } + dependencies: + json-buffer: 3.0.1 + dev: true + + /kind-of@6.0.3: + resolution: { integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== } + engines: { node: '>=0.10.0' } + dev: true + + /levn@0.3.0: + resolution: { integrity: sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== } + engines: { node: '>= 0.8.0' } + dependencies: + prelude-ls: 1.1.2 + type-check: 0.3.2 + dev: true + + /levn@0.4.1: + resolution: { integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== } + engines: { node: '>= 0.8.0' } + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: true + + /lilconfig@3.0.0: + resolution: { integrity: sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g== } + engines: { node: '>=14' } + dev: true + + /lint-staged@15.2.0: + resolution: { integrity: sha512-TFZzUEV00f+2YLaVPWBWGAMq7So6yQx+GG8YRMDeOEIf95Zn5RyiLMsEiX4KTNl9vq/w+NqRJkLA1kPIo15ufQ== } + engines: { node: '>=18.12.0' } + hasBin: true + dependencies: + chalk: 5.3.0 + commander: 11.1.0 + debug: 4.3.4(supports-color@8.1.1) + execa: 8.0.1 + lilconfig: 3.0.0 + listr2: 8.0.0 + micromatch: 4.0.5 + pidtree: 0.6.0 + string-argv: 0.3.2 + yaml: 2.3.4 + transitivePeerDependencies: + - supports-color + dev: true + + /listr2@8.0.0: + resolution: { integrity: sha512-u8cusxAcyqAiQ2RhYvV7kRKNLgUvtObIbhOX2NCXqvp1UU32xIg5CT22ykS2TPKJXZWJwtK3IKLiqAGlGNE+Zg== } + engines: { node: '>=18.0.0' } + dependencies: + cli-truncate: 4.0.0 + colorette: 2.0.20 + eventemitter3: 5.0.1 + log-update: 6.0.0 + rfdc: 1.3.0 + wrap-ansi: 9.0.0 + dev: true + + /locate-path@3.0.0: + resolution: { integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== } + engines: { node: '>=6' } + dependencies: + p-locate: 3.0.0 + path-exists: 3.0.0 + dev: true + + /locate-path@6.0.0: + resolution: { integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== } + engines: { node: '>=10' } + dependencies: + p-locate: 5.0.0 + dev: true + + /lodash.debounce@4.0.8: + resolution: { integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== } + dev: true + + /lodash.merge@4.6.2: + resolution: { integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== } + dev: true + + /lodash@4.17.21: + resolution: { integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== } + dev: true + + /log-symbols@4.1.0: + resolution: { integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== } + engines: { node: '>=10' } + dependencies: + chalk: 4.1.2 + is-unicode-supported: 0.1.0 + dev: true + + /log-update@6.0.0: + resolution: { integrity: sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw== } + engines: { node: '>=18' } + dependencies: + ansi-escapes: 6.2.0 + cli-cursor: 4.0.0 + slice-ansi: 7.1.0 + strip-ansi: 7.1.0 + wrap-ansi: 9.0.0 + dev: true + + /loupe@2.3.7: + resolution: { integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA== } + dependencies: + get-func-name: 2.0.2 + dev: true + + /lru-cache@5.1.1: + resolution: { integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== } + dependencies: + yallist: 3.1.1 + dev: true + + /make-dir@2.1.0: + resolution: { integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== } + engines: { node: '>=6' } + dependencies: + pify: 4.0.1 + semver: 5.7.2 + dev: true + + /merge-stream@2.0.0: + resolution: { integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== } + dev: true + + /micromatch@4.0.5: + resolution: { integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== } + engines: { node: '>=8.6' } + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + dev: true + + /mimic-fn@2.1.0: + resolution: { integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== } + engines: { node: '>=6' } + dev: true + + /mimic-fn@4.0.0: + resolution: { integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== } + engines: { node: '>=12' } + dev: true + + /min-document@2.19.0: + resolution: { integrity: sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ== } + dependencies: + dom-walk: 0.1.2 + dev: false + + /minimatch@3.1.2: + resolution: { integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== } + dependencies: + brace-expansion: 1.1.11 + dev: true + + /minimatch@5.0.1: + resolution: { integrity: sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== } + engines: { node: '>=10' } + dependencies: + brace-expansion: 2.0.1 + dev: true + + /minimist@1.2.8: + resolution: { integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== } + dev: true + + /mkdirp@0.5.6: + resolution: { integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== } + hasBin: true + dependencies: + minimist: 1.2.8 + dev: true + + /mocha@10.2.0: + resolution: { integrity: sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg== } + engines: { node: '>= 14.0.0' } + hasBin: true + dependencies: + ansi-colors: 4.1.1 + browser-stdout: 1.3.1 + chokidar: 3.5.3 + debug: 4.3.4(supports-color@8.1.1) + diff: 5.0.0 + escape-string-regexp: 4.0.0 + find-up: 5.0.0 + glob: 7.2.0 + he: 1.2.0 + js-yaml: 4.1.0 + log-symbols: 4.1.0 + minimatch: 5.0.1 + ms: 2.1.3 + nanoid: 3.3.3 + serialize-javascript: 6.0.0 + strip-json-comments: 3.1.1 + supports-color: 8.1.1 + workerpool: 6.2.1 + yargs: 16.2.0 + yargs-parser: 20.2.4 + yargs-unparser: 2.0.0 + dev: true + + /ms@2.1.2: + resolution: { integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== } + dev: true + + /ms@2.1.3: + resolution: { integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== } + dev: true + + /mute-stream@0.0.8: + resolution: { integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== } + dev: true + + /nanoid@3.3.3: + resolution: { integrity: sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== } + engines: { node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1 } + hasBin: true + dev: true + + /natural-compare@1.4.0: + resolution: { integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== } + dev: true + + /nice-try@1.0.5: + resolution: { integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== } + dev: true + + /node-fetch@2.7.0: + resolution: { integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== } + engines: { node: 4.x || >=6.0.0 } + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + dev: false + + /node-releases@2.0.14: + resolution: { integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== } + dev: true + + /normalize-path@3.0.0: + resolution: { integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== } + engines: { node: '>=0.10.0' } + dev: true + + /npm-run-path@5.1.0: + resolution: { integrity: sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q== } + engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 } + dependencies: + path-key: 4.0.0 + dev: true + + /object-inspect@1.13.1: + resolution: { integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ== } + dev: true + + /object-keys@1.1.1: + resolution: { integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== } + engines: { node: '>= 0.4' } + dev: true + + /object.assign@4.1.5: + resolution: { integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: true + + /object.entries@1.1.7: + resolution: { integrity: sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + dev: true + + /object.fromentries@2.0.7: + resolution: { integrity: sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + dev: true + + /object.groupby@1.0.1: + resolution: { integrity: sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ== } + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + get-intrinsic: 1.2.2 + dev: true + + /object.values@1.1.7: + resolution: { integrity: sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + dev: true + + /once@1.4.0: + resolution: { integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== } + dependencies: + wrappy: 1.0.2 + dev: true + + /onetime@5.1.2: + resolution: { integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== } + engines: { node: '>=6' } + dependencies: + mimic-fn: 2.1.0 + dev: true + + /onetime@6.0.0: + resolution: { integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ== } + engines: { node: '>=12' } + dependencies: + mimic-fn: 4.0.0 + dev: true + + /optionator@0.8.3: + resolution: { integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== } + engines: { node: '>= 0.8.0' } + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.3.0 + prelude-ls: 1.1.2 + type-check: 0.3.2 + word-wrap: 1.2.5 + dev: true + + /optionator@0.9.3: + resolution: { integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== } + engines: { node: '>= 0.8.0' } + dependencies: + '@aashutoshrathi/word-wrap': 1.2.6 + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: true + + /os-tmpdir@1.0.2: + resolution: { integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== } + engines: { node: '>=0.10.0' } + dev: true + + /p-limit@2.3.0: + resolution: { integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== } + engines: { node: '>=6' } + dependencies: + p-try: 2.2.0 + dev: true + + /p-limit@3.1.0: + resolution: { integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== } + engines: { node: '>=10' } + dependencies: + yocto-queue: 0.1.0 + dev: true + + /p-locate@3.0.0: + resolution: { integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== } + engines: { node: '>=6' } + dependencies: + p-limit: 2.3.0 + dev: true + + /p-locate@5.0.0: + resolution: { integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== } + engines: { node: '>=10' } + dependencies: + p-limit: 3.1.0 + dev: true + + /p-try@2.2.0: + resolution: { integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== } + engines: { node: '>=6' } + dev: true + + /parent-module@1.0.1: + resolution: { integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== } + engines: { node: '>=6' } + dependencies: + callsites: 3.1.0 + dev: true + + /path-exists@3.0.0: + resolution: { integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== } + engines: { node: '>=4' } + dev: true + + /path-exists@4.0.0: + resolution: { integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== } + engines: { node: '>=8' } + dev: true + + /path-is-absolute@1.0.1: + resolution: { integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== } + engines: { node: '>=0.10.0' } + dev: true + + /path-key@2.0.1: + resolution: { integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== } + engines: { node: '>=4' } + dev: true + + /path-key@3.1.1: + resolution: { integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== } + engines: { node: '>=8' } + dev: true + + /path-key@4.0.0: + resolution: { integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ== } + engines: { node: '>=12' } + dev: true + + /path-parse@1.0.7: + resolution: { integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== } + dev: true + + /pathval@1.1.1: + resolution: { integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== } + dev: true + + /picocolors@1.0.0: + resolution: { integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== } + dev: true + + /picomatch@2.3.1: + resolution: { integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== } + engines: { node: '>=8.6' } + dev: true + + /pidtree@0.6.0: + resolution: { integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g== } + engines: { node: '>=0.10' } + hasBin: true + dev: true + + /pify@4.0.1: + resolution: { integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== } + engines: { node: '>=6' } + dev: true + + /pirates@4.0.6: + resolution: { integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== } + engines: { node: '>= 6' } + dev: true + + /pkg-dir@3.0.0: + resolution: { integrity: sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== } + engines: { node: '>=6' } + dependencies: + find-up: 3.0.0 + dev: true + + /prelude-ls@1.1.2: + resolution: { integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== } + engines: { node: '>= 0.8.0' } + dev: true + + /prelude-ls@1.2.1: + resolution: { integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== } + engines: { node: '>= 0.8.0' } + dev: true + + /prettier@3.1.1: + resolution: { integrity: sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw== } + engines: { node: '>=14' } + hasBin: true + dev: true + + /process@0.11.10: + resolution: { integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== } + engines: { node: '>= 0.6.0' } + dev: false + + /progress@2.0.3: + resolution: { integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== } + engines: { node: '>=0.4.0' } + dev: true + + /punycode@2.3.1: + resolution: { integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== } + engines: { node: '>=6' } + dev: true + + /queue-microtask@1.2.3: + resolution: { integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== } + dev: true + + /randombytes@2.1.0: + resolution: { integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== } + dependencies: + safe-buffer: 5.2.1 + dev: true + + /readdirp@3.6.0: + resolution: { integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== } + engines: { node: '>=8.10.0' } + dependencies: + picomatch: 2.3.1 + dev: true + + /regenerate-unicode-properties@10.1.1: + resolution: { integrity: sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q== } + engines: { node: '>=4' } + dependencies: + regenerate: 1.4.2 + dev: true + + /regenerate@1.4.2: + resolution: { integrity: sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== } + dev: true + + /regenerator-runtime@0.13.11: + resolution: { integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== } + dev: true + + /regenerator-runtime@0.14.1: + resolution: { integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== } + + /regenerator-transform@0.15.2: + resolution: { integrity: sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== } + dependencies: + '@babel/runtime': 7.23.6 + dev: true + + /regexp.prototype.flags@1.5.1: + resolution: { integrity: sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + set-function-name: 2.0.1 + dev: true + + /regexpp@2.0.1: + resolution: { integrity: sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== } + engines: { node: '>=6.5.0' } + dev: true + + /regexpu-core@5.3.2: + resolution: { integrity: sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ== } + engines: { node: '>=4' } + dependencies: + '@babel/regjsgen': 0.8.0 + regenerate: 1.4.2 + regenerate-unicode-properties: 10.1.1 + regjsparser: 0.9.1 + unicode-match-property-ecmascript: 2.0.0 + unicode-match-property-value-ecmascript: 2.1.0 + dev: true + + /regjsparser@0.9.1: + resolution: { integrity: sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ== } + hasBin: true + dependencies: + jsesc: 0.5.0 + dev: true + + /require-directory@2.1.1: + resolution: { integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== } + engines: { node: '>=0.10.0' } + dev: true + + /resolve-from@4.0.0: + resolution: { integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== } + engines: { node: '>=4' } + dev: true + + /resolve@1.22.8: + resolution: { integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== } + hasBin: true + dependencies: + is-core-module: 2.13.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + + /restore-cursor@3.1.0: + resolution: { integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== } + engines: { node: '>=8' } + dependencies: + onetime: 5.1.2 + signal-exit: 3.0.7 + dev: true + + /restore-cursor@4.0.0: + resolution: { integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg== } + engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 } + dependencies: + onetime: 5.1.2 + signal-exit: 3.0.7 + dev: true + + /reusify@1.0.4: + resolution: { integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== } + engines: { iojs: '>=1.0.0', node: '>=0.10.0' } + dev: true + + /rfdc@1.3.0: + resolution: { integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== } + dev: true + + /rimraf@2.6.3: + resolution: { integrity: sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== } + hasBin: true + dependencies: + glob: 7.2.3 + dev: true + + /rimraf@3.0.2: + resolution: { integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== } + hasBin: true + dependencies: + glob: 7.2.3 + dev: true + + /rollup-plugin-eslint@7.0.0: + resolution: { integrity: sha512-u35kXiY11ULeNQGTlRkYx7uGJ/hS/Dx3wj8f9YVC3oMLTGU9fOqQJsAKYtBFZU3gJ8Vt3gu8ppB1vnKl+7gatQ== } + dependencies: + eslint: 6.8.0 + rollup-pluginutils: 2.8.2 + transitivePeerDependencies: + - supports-color + dev: true + + /rollup-plugin-terser@7.0.2(rollup@4.9.1): + resolution: { integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ== } + deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser + peerDependencies: + rollup: ^2.0.0 + dependencies: + '@babel/code-frame': 7.23.5 + jest-worker: 26.6.2 + rollup: 4.9.1 + serialize-javascript: 4.0.0 + terser: 5.26.0 + dev: true + + /rollup-pluginutils@2.8.2: + resolution: { integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== } + dependencies: + estree-walker: 0.6.1 + dev: true + + /rollup@4.9.1: + resolution: { integrity: sha512-pgPO9DWzLoW/vIhlSoDByCzcpX92bKEorbgXuZrqxByte3JFk2xSW2JEeAcyLc9Ru9pqcNNW+Ob7ntsk2oT/Xw== } + engines: { node: '>=18.0.0', npm: '>=8.0.0' } + hasBin: true + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.9.1 + '@rollup/rollup-android-arm64': 4.9.1 + '@rollup/rollup-darwin-arm64': 4.9.1 + '@rollup/rollup-darwin-x64': 4.9.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.9.1 + '@rollup/rollup-linux-arm64-gnu': 4.9.1 + '@rollup/rollup-linux-arm64-musl': 4.9.1 + '@rollup/rollup-linux-riscv64-gnu': 4.9.1 + '@rollup/rollup-linux-x64-gnu': 4.9.1 + '@rollup/rollup-linux-x64-musl': 4.9.1 + '@rollup/rollup-win32-arm64-msvc': 4.9.1 + '@rollup/rollup-win32-ia32-msvc': 4.9.1 + '@rollup/rollup-win32-x64-msvc': 4.9.1 + fsevents: 2.3.3 + + /run-async@2.4.1: + resolution: { integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== } + engines: { node: '>=0.12.0' } + dev: true + + /run-parallel@1.2.0: + resolution: { integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== } + dependencies: + queue-microtask: 1.2.3 + dev: true + + /rxjs@6.6.7: + resolution: { integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== } + engines: { npm: '>=2.0.0' } + dependencies: + tslib: 1.14.1 + dev: true + + /safe-array-concat@1.0.1: + resolution: { integrity: sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q== } + engines: { node: '>=0.4' } + dependencies: + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + has-symbols: 1.0.3 + isarray: 2.0.5 + dev: true + + /safe-buffer@5.2.1: + resolution: { integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== } + dev: true + + /safe-regex-test@1.0.0: + resolution: { integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== } + dependencies: + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + is-regex: 1.1.4 + dev: true + + /safer-buffer@2.1.2: + resolution: { integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== } + dev: true + + /semver@5.7.2: + resolution: { integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== } + hasBin: true + dev: true + + /semver@6.3.1: + resolution: { integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== } + hasBin: true + dev: true + + /serialize-javascript@4.0.0: + resolution: { integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== } + dependencies: + randombytes: 2.1.0 + dev: true + + /serialize-javascript@6.0.0: + resolution: { integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== } + dependencies: + randombytes: 2.1.0 + dev: true + + /set-function-length@1.1.1: + resolution: { integrity: sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ== } + engines: { node: '>= 0.4' } + dependencies: + define-data-property: 1.1.1 + get-intrinsic: 1.2.2 + gopd: 1.0.1 + has-property-descriptors: 1.0.1 + dev: true + + /set-function-name@2.0.1: + resolution: { integrity: sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA== } + engines: { node: '>= 0.4' } + dependencies: + define-data-property: 1.1.1 + functions-have-names: 1.2.3 + has-property-descriptors: 1.0.1 + dev: true + + /shallow-clone@3.0.1: + resolution: { integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== } + engines: { node: '>=8' } + dependencies: + kind-of: 6.0.3 + dev: true + + /shebang-command@1.2.0: + resolution: { integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== } + engines: { node: '>=0.10.0' } + dependencies: + shebang-regex: 1.0.0 + dev: true + + /shebang-command@2.0.0: + resolution: { integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== } + engines: { node: '>=8' } + dependencies: + shebang-regex: 3.0.0 + dev: true + + /shebang-regex@1.0.0: + resolution: { integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== } + engines: { node: '>=0.10.0' } + dev: true + + /shebang-regex@3.0.0: + resolution: { integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== } + engines: { node: '>=8' } + dev: true + + /side-channel@1.0.4: + resolution: { integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== } + dependencies: + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + object-inspect: 1.13.1 + dev: true + + /signal-exit@3.0.7: + resolution: { integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== } + dev: true + + /signal-exit@4.1.0: + resolution: { integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== } + engines: { node: '>=14' } + dev: true + + /slice-ansi@2.1.0: + resolution: { integrity: sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== } + engines: { node: '>=6' } + dependencies: + ansi-styles: 3.2.1 + astral-regex: 1.0.0 + is-fullwidth-code-point: 2.0.0 + dev: true + + /slice-ansi@5.0.0: + resolution: { integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ== } + engines: { node: '>=12' } + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 4.0.0 + dev: true + + /slice-ansi@7.1.0: + resolution: { integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg== } + engines: { node: '>=18' } + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 5.0.0 + dev: true + + /source-map-support@0.5.21: + resolution: { integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== } + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + dev: true + + /source-map@0.6.1: + resolution: { integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== } + engines: { node: '>=0.10.0' } + dev: true + + /sprintf-js@1.0.3: + resolution: { integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== } + dev: true + + /string-argv@0.3.2: + resolution: { integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== } + engines: { node: '>=0.6.19' } + dev: true + + /string-width@3.1.0: + resolution: { integrity: sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== } + engines: { node: '>=6' } + dependencies: + emoji-regex: 7.0.3 + is-fullwidth-code-point: 2.0.0 + strip-ansi: 5.2.0 + dev: true + + /string-width@4.2.3: + resolution: { integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== } + engines: { node: '>=8' } + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: true + + /string-width@7.0.0: + resolution: { integrity: sha512-GPQHj7row82Hjo9hKZieKcHIhaAIKOJvFSIZXuCU9OASVZrMNUaZuz++SPVrBjnLsnk4k+z9f2EIypgxf2vNFw== } + engines: { node: '>=18' } + dependencies: + emoji-regex: 10.3.0 + get-east-asian-width: 1.2.0 + strip-ansi: 7.1.0 + dev: true + + /string.prototype.trim@1.2.8: + resolution: { integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + dev: true + + /string.prototype.trimend@1.0.7: + resolution: { integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA== } + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + dev: true + + /string.prototype.trimstart@1.0.7: + resolution: { integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg== } + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + dev: true + + /strip-ansi@5.2.0: + resolution: { integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== } + engines: { node: '>=6' } + dependencies: + ansi-regex: 4.1.1 + dev: true + + /strip-ansi@6.0.1: + resolution: { integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== } + engines: { node: '>=8' } + dependencies: + ansi-regex: 5.0.1 + dev: true + + /strip-ansi@7.1.0: + resolution: { integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== } + engines: { node: '>=12' } + dependencies: + ansi-regex: 6.0.1 + dev: true + + /strip-bom@3.0.0: + resolution: { integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== } + engines: { node: '>=4' } + dev: true + + /strip-final-newline@3.0.0: + resolution: { integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw== } + engines: { node: '>=12' } + dev: true + + /strip-json-comments@3.1.1: + resolution: { integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== } + engines: { node: '>=8' } + dev: true + + /supports-color@5.5.0: + resolution: { integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== } + engines: { node: '>=4' } + dependencies: + has-flag: 3.0.0 + dev: true + + /supports-color@7.2.0: + resolution: { integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== } + engines: { node: '>=8' } + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-color@8.1.1: + resolution: { integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== } + engines: { node: '>=10' } + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-preserve-symlinks-flag@1.0.0: + resolution: { integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== } + engines: { node: '>= 0.4' } + dev: true + + /table@5.4.6: + resolution: { integrity: sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== } + engines: { node: '>=6.0.0' } + dependencies: + ajv: 6.12.6 + lodash: 4.17.21 + slice-ansi: 2.1.0 + string-width: 3.1.0 + dev: true + + /terser@5.26.0: + resolution: { integrity: sha512-dytTGoE2oHgbNV9nTzgBEPaqAWvcJNl66VZ0BkJqlvp71IjO8CxdBx/ykCNb47cLnCmCvRZ6ZR0tLkqvZCdVBQ== } + engines: { node: '>=10' } + hasBin: true + dependencies: + '@jridgewell/source-map': 0.3.5 + acorn: 8.11.2 + commander: 2.20.3 + source-map-support: 0.5.21 + dev: true + + /text-table@0.2.0: + resolution: { integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== } + dev: true + + /through@2.3.8: + resolution: { integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== } + dev: true + + /tmp@0.0.33: + resolution: { integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== } + engines: { node: '>=0.6.0' } + dependencies: + os-tmpdir: 1.0.2 + dev: true + + /to-fast-properties@2.0.0: + resolution: { integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== } + engines: { node: '>=4' } + dev: true + + /to-regex-range@5.0.1: + resolution: { integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== } + engines: { node: '>=8.0' } + dependencies: + is-number: 7.0.0 + dev: true + + /tr46@0.0.3: + resolution: { integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== } + dev: false + + /tsconfig-paths@3.15.0: + resolution: { integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg== } + dependencies: + '@types/json5': 0.0.29 + json5: 1.0.2 + minimist: 1.2.8 + strip-bom: 3.0.0 + dev: true + + /tslib@1.14.1: + resolution: { integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== } + dev: true + + /type-check@0.3.2: + resolution: { integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== } + engines: { node: '>= 0.8.0' } + dependencies: + prelude-ls: 1.1.2 + dev: true + + /type-check@0.4.0: + resolution: { integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== } + engines: { node: '>= 0.8.0' } + dependencies: + prelude-ls: 1.2.1 + dev: true + + /type-detect@4.0.8: + resolution: { integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== } + engines: { node: '>=4' } + dev: true + + /type-fest@0.20.2: + resolution: { integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== } + engines: { node: '>=10' } + dev: true + + /type-fest@0.21.3: + resolution: { integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== } + engines: { node: '>=10' } + dev: true + + /type-fest@0.8.1: + resolution: { integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== } + engines: { node: '>=8' } + dev: true + + /type-fest@3.13.1: + resolution: { integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g== } + engines: { node: '>=14.16' } + dev: true + + /typed-array-buffer@1.0.0: + resolution: { integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + is-typed-array: 1.1.12 + dev: true + + /typed-array-byte-length@1.0.0: + resolution: { integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.5 + for-each: 0.3.3 + has-proto: 1.0.1 + is-typed-array: 1.1.12 + dev: true + + /typed-array-byte-offset@1.0.0: + resolution: { integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg== } + engines: { node: '>= 0.4' } + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.5 + for-each: 0.3.3 + has-proto: 1.0.1 + is-typed-array: 1.1.12 + dev: true + + /typed-array-length@1.0.4: + resolution: { integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== } + dependencies: + call-bind: 1.0.5 + for-each: 0.3.3 + is-typed-array: 1.1.12 + dev: true + + /unbox-primitive@1.0.2: + resolution: { integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== } + dependencies: + call-bind: 1.0.5 + has-bigints: 1.0.2 + has-symbols: 1.0.3 + which-boxed-primitive: 1.0.2 + dev: true + + /undici-types@5.26.5: + resolution: { integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== } + dev: true + + /unicode-canonical-property-names-ecmascript@2.0.0: + resolution: { integrity: sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== } + engines: { node: '>=4' } + dev: true + + /unicode-match-property-ecmascript@2.0.0: + resolution: { integrity: sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== } + engines: { node: '>=4' } + dependencies: + unicode-canonical-property-names-ecmascript: 2.0.0 + unicode-property-aliases-ecmascript: 2.1.0 + dev: true + + /unicode-match-property-value-ecmascript@2.1.0: + resolution: { integrity: sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== } + engines: { node: '>=4' } + dev: true + + /unicode-property-aliases-ecmascript@2.1.0: + resolution: { integrity: sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== } + engines: { node: '>=4' } + dev: true + + /update-browserslist-db@1.0.13(browserslist@4.22.2): + resolution: { integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== } + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + dependencies: + browserslist: 4.22.2 + escalade: 3.1.1 + picocolors: 1.0.0 + dev: true + + /uri-js@4.4.1: + resolution: { integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== } + dependencies: + punycode: 2.3.1 + dev: true + + /v8-compile-cache@2.4.0: + resolution: { integrity: sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw== } + dev: true + + /webidl-conversions@3.0.1: + resolution: { integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== } + dev: false + + /whatwg-url@5.0.0: + resolution: { integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== } + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + dev: false + + /which-boxed-primitive@1.0.2: + resolution: { integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== } + dependencies: + is-bigint: 1.0.4 + is-boolean-object: 1.1.2 + is-number-object: 1.0.7 + is-string: 1.0.7 + is-symbol: 1.0.4 + dev: true + + /which-typed-array@1.1.13: + resolution: { integrity: sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow== } + engines: { node: '>= 0.4' } + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.5 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.0 + dev: true + + /which@1.3.1: + resolution: { integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== } + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /which@2.0.2: + resolution: { integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== } + engines: { node: '>= 8' } + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /word-wrap@1.2.5: + resolution: { integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== } + engines: { node: '>=0.10.0' } + dev: true + + /workerpool@6.2.1: + resolution: { integrity: sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== } + dev: true + + /wrap-ansi@7.0.0: + resolution: { integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== } + engines: { node: '>=10' } + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /wrap-ansi@9.0.0: + resolution: { integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q== } + engines: { node: '>=18' } + dependencies: + ansi-styles: 6.2.1 + string-width: 7.0.0 + strip-ansi: 7.1.0 + dev: true + + /wrappy@1.0.2: + resolution: { integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== } + dev: true + + /write@1.0.3: + resolution: { integrity: sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== } + engines: { node: '>=4' } + dependencies: + mkdirp: 0.5.6 + dev: true + + /y18n@5.0.8: + resolution: { integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== } + engines: { node: '>=10' } + dev: true + + /yallist@3.1.1: + resolution: { integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== } + dev: true + + /yaml@2.3.4: + resolution: { integrity: sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA== } + engines: { node: '>= 14' } + dev: true + + /yargs-parser@20.2.4: + resolution: { integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== } + engines: { node: '>=10' } + dev: true + + /yargs-unparser@2.0.0: + resolution: { integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== } + engines: { node: '>=10' } + dependencies: + camelcase: 6.3.0 + decamelize: 4.0.0 + flat: 5.0.2 + is-plain-obj: 2.1.0 + dev: true + + /yargs@16.2.0: + resolution: { integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== } + engines: { node: '>=10' } + dependencies: + cliui: 7.0.4 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.4 + dev: true + + /yocto-queue@0.1.0: + resolution: { integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== } + engines: { node: '>=10' } + dev: true diff --git a/rollup.config.js b/rollup.config.js index 227fdf9..c19e62f 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -17,8 +17,8 @@ export default [ modulesOnly: true, }), babel({ - babelHelpers: 'bundled', - }), + babelHelpers: 'bundled', + }), terser(), ], output: [ @@ -44,10 +44,10 @@ export default [ browser: true, modulesOnly: true, }), - babel({ - babelHelpers: 'bundled', - }), - terser() + babel({ + babelHelpers: 'bundled', + }), + terser(), ], output: [ { @@ -63,6 +63,6 @@ export default [ sourcemap: true, }, ], - external: ['axios'] + external: ['axios'], }, ]; diff --git a/src/cart-store.js b/src/cart-store.js index b705a18..cabd5f1 100644 --- a/src/cart-store.js +++ b/src/cart-store.js @@ -1,6 +1,6 @@ import Store from './store'; -export default class CartStore extends Store { +export default class CartStore extends Store { constructor() { super(...arguments); } @@ -49,4 +49,4 @@ export default class CartStore extends Store { queryRecord() { throw new Error('There is no queryRecord() method for carts!'); } -} \ No newline at end of file +} diff --git a/src/customer-store.js b/src/customer-store.js index 22d4316..d3e842b 100644 --- a/src/customer-store.js +++ b/src/customer-store.js @@ -1,7 +1,7 @@ import Store from './store'; import { isPhone } from './utils'; -export default class CustomerStore extends Store { +export default class CustomerStore extends Store { constructor() { super(...arguments); } @@ -24,14 +24,22 @@ export default class CustomerStore extends Store { throw new Error('Login requires password!'); } - return this.request('post', 'customers/login', { identity, password, ...attributes }); + return this.request('post', 'customers/login', { + identity, + password, + ...attributes, + }); } verifySmsCode(phone, code, attributes = {}) { - return this.request('post', 'customers/verify-sms', { phone, code, ...attributes }); + return this.request('post', 'customers/verify-sms', { + phone, + code, + ...attributes, + }); } retrieve(id) { return this.findRecord(id); } -} \ No newline at end of file +} diff --git a/src/resolver.js b/src/resolver.js index 9cdb389..c050b5b 100644 --- a/src/resolver.js +++ b/src/resolver.js @@ -2,16 +2,25 @@ import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLo import { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk'; const resources = { - Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review + Product, + Category, + Customer, + Cart, + DeliveryServiceQuote, + Store, + StoreLocation, + StoreHour, + Checkout, + Review, }; const adapters = { BrowserAdapter, - NodeAdapter + NodeAdapter, }; class Resolver { - constructor () { + constructor() { this.resources = resources; this.adapters = adapters; @@ -20,7 +29,7 @@ class Resolver { lookup(type, className) { const key = pluralize(type); - const params = [ ...arguments ].slice(2); + const params = [...arguments].slice(2); if (!this[key]) { throw new Error('Attempted to resolve invalid type'); @@ -34,11 +43,8 @@ class Resolver { } } -const lookup = function() { +const lookup = function () { return new Resolver(...arguments); }; -export { - Resolver, - lookup -}; +export { Resolver, lookup }; diff --git a/src/resource.js b/src/resource.js index 5969ec0..91f8aa9 100644 --- a/src/resource.js +++ b/src/resource.js @@ -12,9 +12,9 @@ export default class StorefrontResource extends Resource { this.adapter = adapter; this.store = new StorefrontStore(this.resource, adapter, { onAfterFetch: this.syncAttributes.bind(this), - actions: this.options?.actions + actions: this.options?.actions, }); return this; } -} \ No newline at end of file +} diff --git a/src/resources.js b/src/resources.js index 50ca885..72a9f45 100644 --- a/src/resources.js +++ b/src/resources.js @@ -11,17 +11,4 @@ import Checkout from './resources/checkout'; import PaymentGateway from './resources/payment-gateway'; import Review from './resources/review'; -export { - Product, - Category, - Customer, - Cart, - Network, - Store, - StoreLocation, - StoreHour, - DeliveryServiceQuote, - Checkout, - PaymentGateway, - Review -}; \ No newline at end of file +export { Product, Category, Customer, Cart, Network, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review }; diff --git a/src/resources/cart.js b/src/resources/cart.js index dffda1f..4483871 100644 --- a/src/resources/cart.js +++ b/src/resources/cart.js @@ -3,6 +3,7 @@ import Product from './product'; import { StoreActions } from '@fleetbase/sdk'; const { isArray } = Array; + const cartActions = new StoreActions({ create: undefined, findAll: undefined, diff --git a/src/resources/category.js b/src/resources/category.js index 545422e..67d2b0a 100644 --- a/src/resources/category.js +++ b/src/resources/category.js @@ -2,8 +2,6 @@ import Resource from '../resource'; import Product from './product'; import { Collection } from '@fleetbase/sdk'; -const { isArray } = Array; - export default class Category extends Resource { constructor(attributes = {}, adapter, options = {}) { super(attributes, adapter, 'category', options); diff --git a/src/resources/checkout.js b/src/resources/checkout.js index ad10038..9b72acc 100644 --- a/src/resources/checkout.js +++ b/src/resources/checkout.js @@ -24,13 +24,13 @@ const checkoutActions = new StoreActions({ if (isResource(gateway)) { gateway = gateway.getAttribute('code'); } - - return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway}, options); + + return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options); }, captureOrder: function (token, transactionDetails = {}, options = {}) { - return this.adapter.get(`${this.namespace}/capture`, { token, transactionDetails }, options).then(orderJson => new Order(orderJson)); - } + return this.adapter.get(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson)); + }, }); export default class Checkout extends Resource { diff --git a/src/resources/customer.js b/src/resources/customer.js index d90c72a..678d6a1 100644 --- a/src/resources/customer.js +++ b/src/resources/customer.js @@ -23,7 +23,10 @@ const customerActions = new StoreActions({ }, requestCreationCode(identity, mode = 'email') { - return this.adapter.post('customers/request-creation-code', { identity, mode }); + return this.adapter.post('customers/request-creation-code', { + identity, + mode, + }); }, create(identity, code, attributes = {}) { @@ -37,7 +40,10 @@ const customerActions = new StoreActions({ export default class Customer extends Resource { constructor(attributes = {}, adapter, options = {}) { - super(attributes, adapter, 'customer', { actions: customerActions, ...options }); + super(attributes, adapter, 'customer', { + actions: customerActions, + ...options, + }); } /** diff --git a/src/resources/delivery-service-quote.js b/src/resources/delivery-service-quote.js index 1a50e09..e1f457a 100644 --- a/src/resources/delivery-service-quote.js +++ b/src/resources/delivery-service-quote.js @@ -11,7 +11,7 @@ export default class DeliveryServiceQuote extends ServiceQuote { if (attributes instanceof Adapter) { return super({}, attributes, 'service-quote', options); } - + super(attributes, adapter, 'service-quote', options); } @@ -60,12 +60,20 @@ export default class DeliveryServiceQuote extends ServiceQuote { cart = cart.id; } - return this.adapter.get('service-quotes/from-cart', { origin, destination, cart, config, all }).then(serviceQuotes => { - if (isArray(serviceQuotes)) { - return new Collection(serviceQuotes.map(serviceQuote => new DeliveryServiceQuote(serviceQuote, this.adapter))); - } + return this.adapter + .get('service-quotes/from-cart', { + origin, + destination, + cart, + config, + all, + }) + .then((serviceQuotes) => { + if (isArray(serviceQuotes)) { + return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter))); + } - return new DeliveryServiceQuote(serviceQuotes, this.adapter); - }); + return new DeliveryServiceQuote(serviceQuotes, this.adapter); + }); } -} \ No newline at end of file +} diff --git a/src/resources/network.js b/src/resources/network.js index 60bfb0f..8026bbe 100644 --- a/src/resources/network.js +++ b/src/resources/network.js @@ -15,25 +15,31 @@ export default class Network extends Resource { getStores(params = {}) { return this.adapter.get('stores', params).then((stores) => { - return new Collection(stores.map(attributes => { - return new Store(attributes, this.adapter); - })); + return new Collection( + stores.map((attributes) => { + return new Store(attributes, this.adapter); + }) + ); }); } getStoreLocations(params = {}) { return this.adapter.get('store-locations', params).then((locations) => { - return new Collection(locations.map(attributes => { - return new StoreLocation(attributes, this.adapter); - })); + return new Collection( + locations.map((attributes) => { + return new StoreLocation(attributes, this.adapter); + }) + ); }); } - + getPaymentGateways() { return this.adapter.get('gateways').then((gateways) => { - return new Collection(gateways.map(attributes => { - return new PaymentGateway(attributes, this.adapter); - })); + return new Collection( + gateways.map((attributes) => { + return new PaymentGateway(attributes, this.adapter); + }) + ); }); } -} \ No newline at end of file +} diff --git a/src/resources/payment-gateway.js b/src/resources/payment-gateway.js index 6e379a7..fc6ae7b 100644 --- a/src/resources/payment-gateway.js +++ b/src/resources/payment-gateway.js @@ -20,7 +20,7 @@ export default class PaymentGateway extends Resource { get isStripeGateway() { return this.type === 'stripe'; } - + setCheckoutToken(token) { this.token = token; } @@ -53,4 +53,4 @@ export default class PaymentGateway extends Resource { reload() { throw new Error('There is no reload() method for payment gateways!'); } -} \ No newline at end of file +} diff --git a/src/resources/product.js b/src/resources/product.js index b0f9fe3..0df5ae7 100644 --- a/src/resources/product.js +++ b/src/resources/product.js @@ -28,7 +28,6 @@ export default class Product extends Resource { const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']); if (this.isOnSale) { - if (isEmpty(sale_price) || isEmpty(currency)) { return null; } @@ -48,4 +47,4 @@ export default class Product extends Resource { return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter))); }); } -} \ No newline at end of file +} diff --git a/src/resources/review.js b/src/resources/review.js index 9edd24f..f017fd2 100644 --- a/src/resources/review.js +++ b/src/resources/review.js @@ -10,7 +10,7 @@ const reviewActions = new StoreActions({ } return this.adapter.get(`${this.namespace}/count`, params, options); - } + }, }); export default class Review extends Resource { @@ -31,4 +31,4 @@ export default class Review extends Resource { } } -export { reviewActions }; \ No newline at end of file +export { reviewActions }; diff --git a/src/resources/store-hour.js b/src/resources/store-hour.js index b8f7913..c13fe4f 100644 --- a/src/resources/store-hour.js +++ b/src/resources/store-hour.js @@ -66,7 +66,6 @@ export default class StoreHour extends Resource { return this.humanReadableHoursRange; } - // remove default resource methods create() { diff --git a/src/resources/store-location.js b/src/resources/store-location.js index 52bd624..5ae9353 100644 --- a/src/resources/store-location.js +++ b/src/resources/store-location.js @@ -17,7 +17,7 @@ export default class StoreLocation extends Resource { } get hours() { - return new Collection(this.getAttribute('hours').map(attributes => new StoreHour(attributes))); + return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes))); } get isAlwaysOpen() { @@ -35,7 +35,7 @@ export default class StoreLocation extends Resource { const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']; for (let i = 0; i < week.length; i++) { - const day = week[i] + const day = week[i]; schedule[day] = new Collection(); } @@ -63,4 +63,4 @@ export default class StoreLocation extends Resource { destroy() { throw new Error('There is no destroy() method store location!'); } -} \ No newline at end of file +} diff --git a/src/store.js b/src/store.js index cd58e9c..2ed9c71 100644 --- a/src/store.js +++ b/src/store.js @@ -13,4 +13,4 @@ export default class StorefrontStore extends Store { serialize(json) { return lookup('resource', classify(this.resource), json, this.adapter); } -} \ No newline at end of file +} diff --git a/src/storefront.js b/src/storefront.js index edbfb97..4d3cad7 100644 --- a/src/storefront.js +++ b/src/storefront.js @@ -15,13 +15,13 @@ import { Collection } from '@fleetbase/sdk'; export default class Storefront { /** - * Builds an instance of the Fleetbase Storefront SDK - * - * @param {String} storeKey The access key for the storefront store - * @param {Object} config The config object - * @param {Boolean} debug Enable debug mode - * @return {Storefront} Instance - */ + * Builds an instance of the Fleetbase Storefront SDK + * + * @param {String} storeKey The access key for the storefront store + * @param {Object} config The config object + * @param {Boolean} debug Enable debug mode + * @return {Storefront} Instance + */ constructor(storeKey, config = {}, debug = false) { this.version = config.version || 'v1'; this.options = { @@ -29,7 +29,7 @@ export default class Storefront { host: config.host || 'https://api.fleetbase.io', namespace: `storefront/${this.version}` || config.namespace, publicKey: storeKey, - debug + debug, }; if (!isKeyValid(storeKey)) { @@ -53,8 +53,8 @@ export default class Storefront { /** search products in store or network */ search(query, options = {}) { - return this.adapter.get('search', { query, ...options }).then(products => { - return new Collection(products.map(product => new Product(product))); + return this.adapter.get('search', { query, ...options }).then((products) => { + return new Collection(products.map((product) => new Product(product))); }); } diff --git a/src/utils/detect-adapter.js b/src/utils/detect-adapter.js index 6dc4739..ebbb1cd 100644 --- a/src/utils/detect-adapter.js +++ b/src/utils/detect-adapter.js @@ -7,6 +7,6 @@ const detectAdapter = (options = {}) => { } return lookup('adapter', 'BrowserAdapter', options); -} +}; -export default detectAdapter; \ No newline at end of file +export default detectAdapter; diff --git a/src/utils/format-currency.js b/src/utils/format-currency.js index 5b6a287..3c28b89 100644 --- a/src/utils/format-currency.js +++ b/src/utils/format-currency.js @@ -1,3 +1,7 @@ export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') { - return new Intl.NumberFormat('en-US', { style: 'currency', currency, currencyDisplay }).format(amount); -} \ No newline at end of file + return new Intl.NumberFormat('en-US', { + style: 'currency', + currency, + currencyDisplay, + }).format(amount); +} diff --git a/src/utils/index.js b/src/utils/index.js index 6fefaee..fe688ea 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -5,11 +5,4 @@ import formatCurrency from './format-currency'; import isKeyValid from './is-key-valid'; import isEmpty from './is-empty'; -export { - detectAdapter, - isKeyValid, - isEmail, - isPhone, - isEmpty, - formatCurrency -}; +export { detectAdapter, isKeyValid, isEmail, isPhone, isEmpty, formatCurrency }; diff --git a/src/utils/is-email.js b/src/utils/is-email.js index f418363..db1886d 100644 --- a/src/utils/is-email.js +++ b/src/utils/is-email.js @@ -1,5 +1,5 @@ const isEmail = (email = '') => { return /\S+@\S+\.\S+/.test(email); -} +}; -export default isEmail; \ No newline at end of file +export default isEmail; diff --git a/src/utils/is-key-valid.js b/src/utils/is-key-valid.js index a67acbd..792ec39 100644 --- a/src/utils/is-key-valid.js +++ b/src/utils/is-key-valid.js @@ -2,4 +2,4 @@ const isKeyValid = (key) => { return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_')); }; -export default isKeyValid; \ No newline at end of file +export default isKeyValid; diff --git a/src/utils/is-phone.js b/src/utils/is-phone.js index 509913d..719772a 100644 --- a/src/utils/is-phone.js +++ b/src/utils/is-phone.js @@ -1,5 +1,5 @@ const isPhone = (phone = '') => { return /^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(phone); -} +}; -export default isPhone; \ No newline at end of file +export default isPhone; diff --git a/tests/storefront.test.js b/tests/storefront.test.js index 801db6c..ea5eb73 100644 --- a/tests/storefront.test.js +++ b/tests/storefront.test.js @@ -4,9 +4,11 @@ import 'cross-fetch/polyfill'; // create an instance of the storefront sdk describe('Create a Storefront SDK instance', () => { - const storefront = new Storefront('store_5eb68424f765e387d1ddccb4a0eb0af7', { host: 'https://v2api.fleetbase.engineering' }); - - it('should be an instance of Storefront', () => { + const storefront = new Storefront('store_5eb68424f765e387d1ddccb4a0eb0af7', { + host: 'https://v2api.fleetbase.engineering', + }); + + it('should be an instance of Storefront', () => { assert.instanceOf(storefront, Storefront); }); }); From 5adccbd60dfcc533a3fc5e03ac12dc4717ba386f Mon Sep 17 00:00:00 2001 From: Turtuvshin Date: Fri, 22 Dec 2023 13:25:49 +0800 Subject: [PATCH 2/7] fixed rollup module type --- dist/@fleetbase/storefront.min.js | 7103 +---------------------- dist/@fleetbase/storefront.min.js.map | 2 +- dist/cjs/storefront.js | 5591 +----------------- dist/cjs/storefront.js.map | 2 +- dist/esm/storefront.js | 6924 +--------------------- dist/esm/storefront.js.map | 2 +- package.json | 2 +- pnpm-lock.yaml | 8 +- rollup.config.js | 12 +- src/resources/checkout.js | 3 +- src/resources/customer.js | 4 +- src/resources/delivery-service-quote.js | 4 +- src/resources/network.js | 4 +- 13 files changed, 22 insertions(+), 19639 deletions(-) diff --git a/dist/@fleetbase/storefront.min.js b/dist/@fleetbase/storefront.min.js index e3a1f4b..aab9a64 100644 --- a/dist/@fleetbase/storefront.min.js +++ b/dist/@fleetbase/storefront.min.js @@ -1,7103 +1,2 @@ -!(function (t, e) { - "object" == typeof exports && "undefined" != typeof module - ? e(exports, require("axios")) - : "function" == typeof define && define.amd - ? define(["exports", "axios"], e) - : e( - ((t = "undefined" != typeof globalThis ? globalThis : t || self)[ - "@fleetbase/storefront" - ] = {}), - t.t, - ); -})(this, function (t, e) { - "use strict"; - function n(t) { - return t && "object" == typeof t && "default" in t ? t : { default: t }; - } - var r = n(e); - function i(t, e) { - var n = Object.keys(t); - if (Object.getOwnPropertySymbols) { - var r = Object.getOwnPropertySymbols(t); - e && - (r = r.filter(function (e) { - return Object.getOwnPropertyDescriptor(t, e).enumerable; - })), - n.push.apply(n, r); - } - return n; - } - function a(t) { - for (var e = 1; e < arguments.length; e++) { - var n = null != arguments[e] ? arguments[e] : {}; - e % 2 - ? i(Object(n), !0).forEach(function (e) { - h(t, e, n[e]); - }) - : Object.getOwnPropertyDescriptors - ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) - : i(Object(n)).forEach(function (e) { - Object.defineProperty( - t, - e, - Object.getOwnPropertyDescriptor(n, e), - ); - }); - } - return t; - } - function o(t) { - return ( - (o = - "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; - }), - o(t) - ); - } - function u(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - function s(t, e) { - for (var n = 0; n < e.length; n++) { - var r = e[n]; - (r.enumerable = r.enumerable || !1), - (r.configurable = !0), - "value" in r && (r.writable = !0), - Object.defineProperty(t, r.key, r); - } - } - function c(t, e, n) { - return e && s(t.prototype, e), n && s(t, n), t; - } - function h(t, e, n) { - return ( - e in t - ? Object.defineProperty(t, e, { - value: n, - enumerable: !0, - configurable: !0, - writable: !0, - }) - : (t[e] = n), - t - ); - } - function l(t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError("Super expression must either be null or a function"); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && f(t, e); - } - function d(t) { - return ( - (d = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - }), - d(t) - ); - } - function f(t, e) { - return ( - (f = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - }), - f(t, e) - ); - } - function v() { - if ("undefined" == typeof Reflect || !Reflect.construct) return !1; - if (Reflect.construct.sham) return !1; - if ("function" == typeof Proxy) return !0; - try { - return ( - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}), - ), - !0 - ); - } catch (t) { - return !1; - } - } - function g(t, e, n) { - return ( - (g = v() - ? Reflect.construct - : function (t, e, n) { - var r = [null]; - r.push.apply(r, e); - var i = new (Function.bind.apply(t, r))(); - return n && f(i, n.prototype), i; - }), - g.apply(null, arguments) - ); - } - function p(t) { - if (void 0 === t) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - return t; - } - function y(t, e) { - if (e && ("object" == typeof e || "function" == typeof e)) return e; - if (void 0 !== e) - throw new TypeError( - "Derived constructors may only return object or undefined", - ); - return p(t); - } - function m(t) { - var e = v(); - return function () { - var n, - r = d(t); - if (e) { - var i = d(this).constructor; - n = Reflect.construct(r, arguments, i); - } else n = r.apply(this, arguments); - return y(this, n); - }; - } - function w(t) { - return b(t) || k(t) || T(t) || C(); - } - function b(t) { - if (Array.isArray(t)) return x(t); - } - function k(t) { - if ( - ("undefined" != typeof Symbol && null != t[Symbol.iterator]) || - null != t["@@iterator"] - ) - return Array.from(t); - } - function T(t, e) { - if (t) { - if ("string" == typeof t) return x(t, e); - var n = Object.prototype.toString.call(t).slice(8, -1); - return ( - "Object" === n && t.constructor && (n = t.constructor.name), - "Map" === n || "Set" === n - ? Array.from(t) - : "Arguments" === n || - /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) - ? x(t, e) - : void 0 - ); - } - } - function x(t, e) { - (null == e || e > t.length) && (e = t.length); - for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; - return r; - } - function C() { - throw new TypeError( - "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.", - ); - } - function A(t, e) { - var n = Object.keys(t); - if (Object.getOwnPropertySymbols) { - var r = Object.getOwnPropertySymbols(t); - e && - (r = r.filter(function (e) { - return Object.getOwnPropertyDescriptor(t, e).enumerable; - })), - n.push.apply(n, r); - } - return n; - } - function D(t) { - for (var e = 1; e < arguments.length; e++) { - var n = null != arguments[e] ? arguments[e] : {}; - e % 2 - ? A(Object(n), !0).forEach(function (e) { - M(t, e, n[e]); - }) - : Object.getOwnPropertyDescriptors - ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) - : A(Object(n)).forEach(function (e) { - Object.defineProperty( - t, - e, - Object.getOwnPropertyDescriptor(n, e), - ); - }); - } - return t; - } - function E(t) { - return (E = - "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; - })(t); - } - function S(t, e, n, r, i, a, o) { - try { - var u = t[a](o), - s = u.value; - } catch (t) { - return void n(t); - } - u.done ? e(s) : Promise.resolve(s).then(r, i); - } - function O(t) { - return function () { - var e = this, - n = arguments; - return new Promise(function (r, i) { - var a = t.apply(e, n); - function o(t) { - S(a, r, i, o, u, "next", t); - } - function u(t) { - S(a, r, i, o, u, "throw", t); - } - o(void 0); - }); - }; - } - function P(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - function R(t, e) { - for (var n = 0; n < e.length; n++) { - var r = e[n]; - (r.enumerable = r.enumerable || !1), - (r.configurable = !0), - "value" in r && (r.writable = !0), - Object.defineProperty(t, r.key, r); - } - } - function U(t, e, n) { - return e && R(t.prototype, e), n && R(t, n), t; - } - function M(t, e, n) { - return ( - e in t - ? Object.defineProperty(t, e, { - value: n, - enumerable: !0, - configurable: !0, - writable: !0, - }) - : (t[e] = n), - t - ); - } - function j(t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError("Super expression must either be null or a function"); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && $(t, e); - } - function q(t) { - return (q = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - })(t); - } - function $(t, e) { - return ($ = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - })(t, e); - } - function N() { - if ("undefined" == typeof Reflect || !Reflect.construct) return !1; - if (Reflect.construct.sham) return !1; - if ("function" == typeof Proxy) return !0; - try { - return ( - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}), - ), - !0 - ); - } catch (t) { - return !1; - } - } - function H(t, e, n) { - return (H = N() - ? Reflect.construct - : function (t, e, n) { - var r = [null]; - r.push.apply(r, e); - var i = new (Function.bind.apply(t, r))(); - return n && $(i, n.prototype), i; - }).apply(null, arguments); - } - function Y(t) { - var e = "function" == typeof Map ? new Map() : void 0; - return (Y = function (t) { - if ( - null === t || - ((n = t), -1 === Function.toString.call(n).indexOf("[native code]")) - ) - return t; - var n; - if ("function" != typeof t) - throw new TypeError( - "Super expression must either be null or a function", - ); - if (void 0 !== e) { - if (e.has(t)) return e.get(t); - e.set(t, r); - } - function r() { - return H(t, arguments, q(this).constructor); - } - return ( - (r.prototype = Object.create(t.prototype, { - constructor: { - value: r, - enumerable: !1, - writable: !0, - configurable: !0, - }, - })), - $(r, t) - ); - })(t); - } - function L(t, e) { - return !e || ("object" != typeof e && "function" != typeof e) - ? (function (t) { - if (void 0 === t) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - return t; - })(t) - : e; - } - function F(t) { - var e = N(); - return function () { - var n, - r = q(t); - if (e) { - var i = q(this).constructor; - n = Reflect.construct(r, arguments, i); - } else n = r.apply(this, arguments); - return L(this, n); - }; - } - function _(t, e) { - return ( - (function (t) { - if (Array.isArray(t)) return t; - })(t) || - (function (t, e) { - var n = - null == t - ? null - : ("undefined" != typeof Symbol && t[Symbol.iterator]) || - t["@@iterator"]; - if (null != n) { - var r, - i, - a = [], - o = !0, - u = !1; - try { - for ( - n = n.call(t); - !(o = (r = n.next()).done) && - (a.push(r.value), !e || a.length !== e); - o = !0 - ); - } catch (t) { - (u = !0), (i = t); - } finally { - try { - o || null == n.return || n.return(); - } finally { - if (u) throw i; - } - } - return a; - } - })(t, e) || - z(t, e) || - (function () { - throw new TypeError( - "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.", - ); - })() - ); - } - function W(t) { - return ( - (function (t) { - if (Array.isArray(t)) return I(t); - })(t) || - (function (t) { - if ( - ("undefined" != typeof Symbol && null != t[Symbol.iterator]) || - null != t["@@iterator"] - ) - return Array.from(t); - })(t) || - z(t) || - (function () { - throw new TypeError( - "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.", - ); - })() - ); - } - function z(t, e) { - if (t) { - if ("string" == typeof t) return I(t, e); - var n = Object.prototype.toString.call(t).slice(8, -1); - return ( - "Object" === n && t.constructor && (n = t.constructor.name), - "Map" === n || "Set" === n - ? Array.from(t) - : "Arguments" === n || - /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) - ? I(t, e) - : void 0 - ); - } - } - function I(t, e) { - (null == e || e > t.length) && (e = t.length); - for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; - return r; - } - var Q = Array.isArray, - B = void 0 === arguments ? void 0 : arguments, - G = function (t, e, n) { - var r = - arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : []; - if (Q(t)) - if (r.length <= 6e4) t.splice.apply(t, [e, n].concat(W(r))); - else { - t.splice(e, n); - for (var i = 0; i < r.length; i += 6e4) { - var a = r.slice(i, i + 6e4); - t.splice.apply(t, [e + i, 0].concat(W(a))); - } - } - else K(arr) && t.replace(e, n, r); - }, - X = function (t) { - return t; - }, - K = function (t) { - return t instanceof at; - }, - J = function (t, e) { - return Q(t) ? t[e] : K(t) ? t.objectAt(e) : null; - }, - Z = function (t, e) { - return 2 === B.length - ? function (n) { - return e === n[t]; - } - : function (e) { - return Boolean(e[t]); - }; - }, - V = function (t, e) { - for ( - var n = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, - r = t.length, - i = n; - i < r; - i++ - ) { - var a = J(t, i); - if (e(a, i, t)) return i; - } - return -1; - }, - tt = function (t, e, n) { - var r = e.bind(n), - i = V(t, r, 0); - return -1 === i ? void 0 : J(t, i); - }, - et = function (t, e, n) { - var r = e.bind(n); - return -1 !== V(t, r, 0); - }, - nt = function (t, e, n) { - var r = e.bind(n); - return ( - -1 === - V( - t, - function (t, e, n) { - return !r(t, e, n); - }, - 0, - ) - ); - }, - rt = function (t, e) { - var n = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, - r = arguments.length > 3 ? arguments[3] : void 0, - i = t.length; - n < 0 && (n += i); - var a = - r && e != e - ? function (t) { - return t != t; - } - : function (t) { - return t === e; - }; - return V(t, a, n); - }, - it = function (t, e, n) { - return G(t, e, 0, [n]), n; - }, - at = (function (t) { - j(n, Y(Array)); - var e = F(n); - function n() { - for (var t = arguments.length, r = new Array(t), i = 0; i < t; i++) - r[i] = arguments[i]; - return ( - P(this, n), - L( - Q(arguments[0]) - ? e.call.apply(e, [this].concat(W(arguments[0]))) - : e.apply(this, arguments), - ) - ); - } - return ( - U(n, [ - { - key: "notEmpty", - get: function () { - return this.length > 0; - }, - }, - { - key: "empty", - get: function () { - return 0 === this.length; - }, - }, - { - key: "first", - get: function () { - return J(this, 0); - }, - }, - { - key: "last", - get: function () { - return J(this, this.length - 1); - }, - }, - { - key: "replace", - value: function (t, e) { - var n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : []; - return G(this, t, e, n), this; - }, - }, - { - key: "objectsAt", - value: function (t) { - var e = this; - return t.map(function (t) { - return J(e, t); - }); - }, - }, - { - key: "objectAt", - value: function (t) { - return J(this, t); - }, - }, - { - key: "indexOf", - value: function (t, e) { - return rt(this, t, e, !1); - }, - }, - { - key: "lastIndexOf", - value: function (t, e) { - var n = this.length; - (void 0 === e || e >= n) && (e = n - 1), e < 0 && (e += n); - for (var r = e; r >= 0; r--) if (J(this, r) === t) return r; - return -1; - }, - }, - { - key: "includes", - value: function (t, e) { - return -1 !== rt(this, t, e, !0); - }, - }, - { - key: "findBy", - value: function () { - return tt(this, Z.apply(void 0, arguments)); - }, - }, - { - key: "findIndexBy", - value: function () { - return V(this, Z.apply(void 0, arguments)); - }, - }, - { - key: "isEvery", - value: function () { - return nt(this, Z.apply(void 0, arguments)); - }, - }, - { - key: "isAny", - value: function () { - return et(this, Z.apply(void 0, arguments)); - }, - }, - { - key: "invoke", - value: function (t) { - for ( - var e = arguments.length, - n = new Array(e > 1 ? e - 1 : 0), - r = 1; - r < e; - r++ - ) - n[r - 1] = arguments[r]; - var i = []; - return ( - this.forEach(function (e) { - var r; - return i.push( - null === (r = e[t]) || void 0 === r - ? void 0 - : r.call.apply(r, [e].concat(n)), - ); - }), - i - ); - }, - }, - { - key: "toArray", - value: function () { - return this.map(function (t) { - return t; - }); - }, - }, - { - key: "compact", - value: function () { - return this.filter(function (t) { - return null != t; - }); - }, - }, - { - key: "sortBy", - value: function () { - var t = arguments; - return this.sort(function (e, n) { - for (var r = 0; r < t.length; r++) { - var i = t[r], - a = e[i], - o = n[i], - u = compare(a, o); - if (u) return u; - } - return 0; - }); - }, - }, - { - key: "uniqBy", - value: function (t) { - return (function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : X, - n = [], - r = new Set(), - i = - "function" == typeof e - ? e - : function (t) { - return get(t, e); - }; - return ( - t.forEach(function (t) { - var e = i(t); - r.has(e) || (r.add(e), n.push(t)); - }), - n - ); - })(this, t); - }, - }, - { - key: "without", - value: function (t) { - if (!this.includes(t)) return this; - var e = - t == t - ? function (e) { - return e !== t; - } - : function (t) { - return t == t; - }; - return this.filter(e); - }, - }, - { - key: "clear", - value: function () { - var t = this.length; - return 0 === t || this.replace(0, t, []), this; - }, - }, - { - key: "insertAt", - value: function (t, e) { - return it(this, t, e), this; - }, - }, - { - key: "replaceAt", - value: function (t, e) { - return this.replace(t, 1, [e]); - }, - }, - { - key: "removeAt", - value: function (t, e) { - return (function (t, e) { - return ( - G( - t, - e, - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : 1, - [], - ), - t - ); - })(this, t, e); - }, - }, - { - key: "pushObject", - value: function (t) { - return this.insertAt(this.length, t); - }, - }, - { - key: "pushObjects", - value: function (t) { - return this.replace(this.length, 0, t), this; - }, - }, - { - key: "popObject", - value: function () { - var t = this.length; - if (0 === t) return null; - var e = J(this, t - 1); - return this.removeAt(t - 1, 1), e; - }, - }, - { - key: "shiftObject", - value: function () { - if (0 === this.length) return null; - var t = J(this, 0); - return this.removeAt(0), t; - }, - }, - { - key: "unshiftObject", - value: function (t) { - return it(this, 0, t); - }, - }, - { - key: "unshiftObjects", - value: function (t) { - return this.replace(0, 0, t), this; - }, - }, - { - key: "reverseObjects", - value: function () { - var t = this.length; - if (0 === t) return this; - var e = this.toArray().reverse(); - return this.replace(0, t, e), this; - }, - }, - { - key: "setObjects", - value: function (t) { - if (0 === t.length) return this.clear(); - var e = this.length; - return this.replace(0, e, t), this; - }, - }, - { - key: "removeObject", - value: function (t) { - for (var e = this.length || 0; --e >= 0; ) - J(this, e) === t && this.removeAt(e); - return this; - }, - }, - { - key: "removeObjects", - value: function (t) { - for (var e = t.length - 1; e >= 0; e--) this.removeObject(t[e]); - return this; - }, - }, - { - key: "addObject", - value: function (t) { - return this.includes(t) || this.pushObject(t), this; - }, - }, - { - key: "addObjects", - value: function (t) { - var e = this; - return ( - t.forEach(function (t) { - return e.addObject(t); - }), - this - ); - }, - }, - ]), - n - ); - })(), - ot = function (t) { - var e = null == t; - if (e) return e; - if ("number" == typeof t.size) return !t.size; - var n = E(t); - if ("object" === n) { - var r = t.size; - if ("number" == typeof r) return !r; - } - if ("number" == typeof t.length && "function" !== n) return !t.length; - if ("object" === n) { - var i = t.length; - if ("number" == typeof i) return !i; - } - return !1; - }, - ut = function (t) { - return ot(t) || ("string" == typeof t && !1 === /\S/.test(t)); - }; - function st(t) { - return t instanceof yt; - } - var ct = function () { - var t, e, n, r, i; - return !( - "undefined" == typeof process || - ("object" !== - E(null === (t = process) || void 0 === t ? void 0 : t.env) && - -1 === - (null === (e = process.release) || - void 0 === e || - null === (n = e.name) || - void 0 === n - ? void 0 - : n.search(/node|io.js/))) || - ("undefined" != typeof window && - "ReactNative" !== - (null === (r = window) || - void 0 === r || - null === (i = r.navigator) || - void 0 === i - ? void 0 - : i.product)) - ); - }, - ht = function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return ct() - ? jt("adapter", "NodeAdapter", t) - : jt("adapter", "BrowserAdapter", t); - }, - lt = Array.isArray; - !(function () { - function t(e) { - P(this, t), - (this.place = e), - (this.geometry = null == e ? void 0 : e.geometry), - (this.components = this.parseComponents()), - (this.attributes = this.parseProperties()); - } - U(t, [ - { - key: "parse", - value: function () { - this.parseComponents(), this.parseProperties(); - }, - }, - { - key: "parseComponents", - value: function () { - var t; - return ( - (null === (t = this.place) || void 0 === t - ? void 0 - : t.address_components) || [] - ).reduce(function (t, e) { - return ( - e.types.forEach(function (n) { - t[n] = e; - }), - t - ); - }, {}); - }, - }, - { - key: "parseProperties", - value: function () { - var t, - e = { - streetNumber: this.get("street_number"), - streetName: this.get("route"), - coordinates: - null !== (t = this.geometry) && void 0 !== t && t.location - ? Object.values(this.geometry.location) - : [0, 0], - city: this.or([ - "locality", - "sublocality", - "sublocality_level_1", - "neighborhood", - "administrative_area_level_3", - "administrative_area_level_2", - ]), - county: this.get("administrative_area_level_2"), - stateShort: this.get("administrative_area_level_1", !0), - stateLong: this.get("administrative_area_level_1"), - countryShort: this.get("country", !0), - country: this.get("country", !0), - countryLong: this.get("country"), - postalCode: this.get("postal_code"), - }; - return ( - (e.address = [e.streetNumber, e.streetName] - .filter(Boolean) - .join(" ")), - e - ); - }, - }, - { - key: "all", - value: function () { - return this.attributes; - }, - }, - { - key: "or", - value: function () { - for ( - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : [], - e = 0; - e < t.length; - e++ - ) { - var n = t[e]; - if (lt(n)) { - var r = n[0], - i = n[1]; - if (this.has(r)) return this.get(r, i); - } else if (this.has(n)) return this.get(n); - } - return null; - }, - }, - { - key: "has", - value: function (t) { - return t in this.components; - }, - }, - { - key: "get", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; - return t in this.components - ? e - ? this.components[t].short_name - : this.components[t].long_name - : null; - }, - }, - { - key: "setAttributes", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return (this.attributes = D(D({}, this.attributes), t)), this; - }, - }, - { - key: "setAttribute", - value: function (t, e) { - return (this.attributes[t] = e), this; - }, - }, - { - key: "getAttribute", - value: function (t) { - return this.attributes[t] || null; - }, - }, - ]); - })(); - var dt = (function () { - function t() { - var e = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, - n = - arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; - P(this, t), (this.type = "Point"), (this.coordinates = [n, e]); - } - return ( - U( - t, - [ - { - key: "latitude", - get: function () { - return this.coordinates[1]; - }, - }, - { - key: "longitude", - get: function () { - return this.coordinates[0]; - }, - }, - { - key: "lat", - value: function () { - return this.latitude; - }, - }, - { - key: "lng", - value: function () { - return this.longitude; - }, - }, - { - key: "serialize", - value: function () { - return { type: "Point", coorindates: [this.lat(), this.lng()] }; - }, - }, - { - key: "toJson", - value: function () { - return this.serialize(); - }, - }, - { - key: "toString", - value: function () { - return "(" - .concat(this.latitude, ", ") - .concat(this.longitude, ")"); - }, - }, - ], - [ - { - key: "fromGeoJson", - value: function (e) { - var n = _(e.coordinates, 2); - return ( - (longitude = n[0]), - (latitude = n[1]), - new t(latitude, longitude) - ); - }, - }, - ], - ), - t - ); - })(), - ft = function (t, e) { - var n = t(); - return Array.isArray(n) || "object" === E(n) ? vt(n, e) : null; - }, - vt = function t(e, n) { - var r, - i = e, - a = E(e), - o = "object" === a, - u = "function" === a, - s = Array.isArray(e), - c = "string" === E(n) && n.includes(".") ? n.split(".") : [n]; - if (s || o) { - for (var h = 0; h < c.length; h++) { - if (i && void 0 === i[c[h]]) return null; - if (i) { - if ( - "object" === E((r = i = i[c[h]])) && - !ot(null == r ? void 0 : r.attributes) && - "object" === E(null == r ? void 0 : r.attributes) && - void 0 !== c[h + 1] - ) { - var l = c.slice(h + 1).join("."); - return t(i.attributes, l); - } - if ("function" == typeof i) { - var d = c.slice(h + 1).join("."); - return ft(i, d); - } - } - } - return i; - } - if (u) return ft(e, n); - }, - gt = function (t, e, n) { - var r = t, - i = "object" === E(t), - a = Array.isArray(t), - o = "string" === E(e) && e.includes(".") ? e.split(".") : [e], - u = o.length; - if (a || i) { - for (var s = 0; s < u - 1; s++) - r[o[s]] || (r[o[s]] = {}), (r = r[o[s]]); - r[o[u - 1]] = n; - } - return n; - }, - pt = (function () { - function t() { - var e = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : null; - P(this, t), (this.actions = e), (this.bind = n); - } - return ( - U(t, [ - { - key: "extend", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : null, - e = t || this.bind; - if (!e) return this; - if (null != this && this.actions && "object" === E(this.actions)) - for (var n in this.actions) { - var r = this.actions[n]; - gt(e, n, "function" == typeof r ? r.bind(e) : r); - } - return this; - }, - }, - ]), - t - ); - })(), - yt = (function () { - function t() { - var e = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - n = arguments.length > 1 ? arguments[1] : void 0, - r = arguments.length > 2 ? arguments[2] : void 0, - i = - arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; - P(this, t), - (this.attributes = e), - (this.dirtyAttributes = {}), - (this.changes = {}), - (this.isLoading = !1), - (this.isSaving = !1), - (this.isDestroying = !1), - (this.isReloading = !1), - (this.resource = r), - (this.options = i), - (this.version = i.version || "v1"), - this.setAdapter(n); - } - return ( - U(t, [ - { - key: "setAdapter", - value: function (t) { - var e; - return ( - (this.adapter = t), - (this.store = new $t(this.resource, t, { - onAfterFetch: this.syncAttributes.bind(this), - actions: - null === (e = this.options) || void 0 === e - ? void 0 - : e.actions, - })), - this - ); - }, - }, - { - key: "id", - get: function () { - return this.getAttribute("id"); - }, - }, - { - key: "create", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}, - n = this.mergeAttributes(e); - return ( - this.setFlags(["isLoading", "isSaving"]), - this.store.create(n).then(function (e) { - return t.setFlags(["isLoading", "isSaving"], !1), e; - }) - ); - }, - }, - { - key: "update", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return ( - this.setFlags(["isLoading", "isSaving"]), - this.store.update(this.attributes.id, e).then(function (e) { - return t.setFlags(["isLoading", "isSaving"], !1), e; - }) - ); - }, - }, - { - key: "destroy", - value: function () { - var t = this; - return ( - this.setFlags(["isLoading", "isDestroying"]), - this.store.destroy(this.attributes.id).then(function (e) { - return t.setFlags(["isLoading", "isDestroying"], !1), e; - }) - ); - }, - }, - { - key: "reload", - value: function () { - var t = this; - return ( - this.setFlags(["isLoading", "isReloading"]), - this.store.findRecord(this.attributes.id).then(function (e) { - return t.reset(), e; - }) - ); - }, - }, - { - key: "setFlags", - value: function () { - for ( - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : [], - e = - !(arguments.length > 1 && void 0 !== arguments[1]) || - arguments[1], - n = ["isLoading", "isSaving", "isReloading", "isDestroying"], - r = 0; - r < t.length; - r++ - ) { - var i = t[r]; - if ("string" != typeof i || !n.includes(i)) - throw new Error("".concat(i, " is not a valid flag!")); - this[i] = e; - } - return this; - }, - }, - { - key: "reset", - value: function () { - return ( - (this.dirtyAttributes = {}), - (this.changes = {}), - (this.isLoading = !1), - (this.isSaving = !1), - (this.isReloading = !1), - this - ); - }, - }, - { - key: "empty", - value: function () { - return this.reset(), (this.attribues = {}), this; - }, - }, - { - key: "save", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}, - e = this.getAttributes(); - return ot(this.id) - ? this.create(e) - : !0 === t.onlyDirty - ? this.savedirty() - : this.update(e); - }, - }, - { - key: "saveDirty", - value: function () { - for ( - var t = Object.keys(this.dirtyAttributes), e = {}, n = 0; - n < t.length; - n++ - ) { - var r = t[n]; - e[r] = this.getAttribute(r); - } - return this.update(e); - }, - }, - { - key: "createdAt", - get: function () { - return this.hasAttribute("created_at") - ? new Date(this.getAttribute("created_at")) - : null; - }, - }, - { - key: "updatedAt", - get: function () { - return this.hasAttribute("updated_at") - ? new Date(this.getAttribute("updated_at")) - : null; - }, - }, - { - key: "isLoaded", - get: function () { - return this.hasAttributes(["created_at", "id"]); - }, - }, - { - key: "isEmpty", - get: function () { - return ( - 0 === - Object.values(null == this ? void 0 : this.attributes).length - ); - }, - }, - { - key: "isNew", - get: function () { - return !this.id; - }, - }, - { - key: "isSaved", - get: function () { - return !this.isNew && this.isLoaded; - }, - }, - { - key: "isDeleted", - get: function () { - return this.hasAttributes(["deleted", "time"]); - }, - }, - { - key: "eachAttribute", - value: function (t) { - var e, - n = this; - return ( - "function" != typeof t || - Object.keys( - null !== (e = null == this ? void 0 : this.attributes) && - void 0 !== e - ? e - : {}, - ).forEach(function (e) { - var r = n.getAttribute(e); - t.call(n, r, e); - }), - this - ); - }, - }, - { - key: "changes", - value: function () { - return this.changes; - }, - }, - { - key: "getDirtyAttributes", - value: function () { - return this.dirtyAttributes; - }, - }, - { - key: "isDirty", - value: function (t) { - return t in this.dirtyAttributes; - }, - }, - { - key: "hasDirtyAttributes", - value: function () { - var t; - return ( - Object.keys( - null !== (t = null == this ? void 0 : this.dirtyAttributes) && - void 0 !== t - ? t - : {}, - ).length > 0 - ); - }, - }, - { - key: "mutate", - value: function (t, e) { - this.attributes[t] = e; - }, - }, - { - key: "setAttribute", - value: function (t) { - var e, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : null; - if (null === n && "object" === E(t)) return this.setAttributes(t); - var r = - null !== (e = null == this ? void 0 : this.attributes[t]) && - void 0 !== e - ? e - : null; - return ( - gt(this.attributes, t, n), - gt(this.dirtyAttributes, t, r), - Q(null == this ? void 0 : this.changes[t]) || - (this.changes[t] = []), - this.changes[t].push({ - property: t, - previousValue: r, - value: n, - changedAt: new Date(), - }), - this - ); - }, - }, - { - key: "setAttributes", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - for (var e in t) this.setAttribute(e, t[e]); - return this; - }, - }, - { - key: "getAttribute", - value: function (t) { - var e, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : null, - r = vt( - null !== (e = null == this ? void 0 : this.attributes) && - void 0 !== e - ? e - : {}, - t, - ); - return void 0 === r ? n : r; - }, - }, - { - key: "hasAttribute", - value: function (t) { - if (Q(t)) { - var e, - n = t, - r = Object.keys( - null !== (e = this.attributes) && void 0 !== e ? e : {}, - ); - return n.every(function (t) { - return r.includes(t); - }); - } - return ( - !(null == this || !this.attributes) && t in this.attributes - ); - }, - }, - { - key: "hasAttributes", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : []; - return this.hasAttribute(t); - }, - }, - { - key: "isAttributeFilled", - value: function (t) { - var e = this; - return Q(t) - ? this.hasAttribute(t) && - t.every(function (t) { - return !ot(e.getAttribute(t)); - }) - : this.hasAttribute(t) && !ot(this.getAttribute(t)); - }, - }, - { - key: "getAttributes", - value: function (t) { - var e = {}; - if (null == t) - return this.getAttributes(Object.keys(this.attributes)); - if ("string" == typeof t) - return this.getAttribute(Array.prototype.slice.call(arguments)); - if (!Q(t)) throw new Error("No attribute properties provided!"); - for (var n = 0; n < t.length; n++) { - var r, - i, - a = t[n]; - if ("string" == typeof a) { - var o = this.getAttribute(a); - "object" !== - E( - null === (r = o) || void 0 === r ? void 0 : r.attributes, - ) || - Q( - null === (i = o) || void 0 === i ? void 0 : i.attributes, - ) || - (o = o.attributes), - (e[a] = o); - } - } - return e; - }, - }, - { - key: "serialize", - value: function () { - return this.getAttributes(); - }, - }, - { - key: "mergeAttributes", - value: function () { - var t, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}, - n = - null !== (t = null == this ? void 0 : this.attributes) && - void 0 !== t - ? t - : {}; - return (this.attributes = D(D({}, n), e)), this.attributes; - }, - }, - { - key: "syncAttributes", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - this.attributes = t; - }, - }, - ]), - t - ); - })(), - mt = new pt({ - getDistanceAndTime: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; - return this.adapter.get( - "".concat(this.namespace, "/").concat(t, "/distance-and-time"), - {}, - e, - ); - }, - }), - wt = (function (t) { - j(n, yt); - var e = F(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return P(this, n), e.call(this, t, r, "order", D({ actions: mt }, i)); - } - return ( - U(n, [ - { - key: "getDistanceAndTime", - value: function () { - return this.store.getDistanceAndTime(this.id); - }, - }, - ]), - n - ); - })(), - bt = (function (t) { - j(n, yt); - var e = F(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return P(this, n), e.call(this, t, r, "payload", i); - } - return ( - U(n, [ - { key: "attach", value: function (t) {} }, - { key: "entities", get: function () {} }, - { key: "dropoff", get: function () {} }, - { key: "pickup", get: function () {} }, - { - key: "waypoints", - get: function () { - return new at(this.waypoints); - }, - }, - ]), - n - ); - })(); - !(function (t) { - j(n, yt); - var e = F(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return P(this, n), e.call(this, t, r, "entity", i); - } - })(); - var kt = (function (t) { - j(n, yt); - var e = F(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return P(this, n), e.call(this, t, r, "place", i); - } - return ( - U( - n, - [ - { - key: "latitude", - get: function () { - var t; - return null === (t = this.getAttribute("location", new dt())) || - void 0 === t - ? void 0 - : t.coordinates[1]; - }, - }, - { - key: "longitude", - get: function () { - var t; - return null === (t = this.getAttribute("location", new dt())) || - void 0 === t - ? void 0 - : t.coordinates[0]; - }, - }, - { - key: "coordinates", - get: function () { - return [this.latitude, this.longitude]; - }, - }, - { - key: "setOwner", - value: function (t) { - return ( - st(t) && this.setAttribute("owner", t.id), - "string" == typeof t && this.setAttribute("owner", t), - this - ); - }, - }, - ], - [ - { - key: "fromGoogleAddress", - value: function (t, e) { - var r = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}, - i = t.getAttribute("coordinates"), - a = _(i, 2), - o = a[0], - u = a[1], - s = { - name: null, - address: t.getAttribute("address"), - location: new dt(o, u), - street1: t.getAttribute("streetName"), - street2: null, - city: t.getAttribute("city"), - province: t.getAttribute("stateLong"), - postal_code: t.getAttribute("postalCode"), - neighborhood: t.get("neighborhood"), - district: t.getAttribute("county"), - building: t.get("building"), - country: t.getAttribute("countryShort"), - phone: null, - security_access_code: null, - }; - return new n(s, e, r); - }, - }, - ], - ), - n - ); - })(); - !(function (t) { - j(n, kt); - var e = F(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return P(this, n), e.call(this, t, r, "waypoint", i); - } - })(), - (function (t) { - j(n, yt); - var e = F(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return P(this, n), e.call(this, t, r, "tracking-status", i); - } - })(), - (function (t) { - j(n, yt); - var e = F(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return P(this, n), e.call(this, t, r, "vehicle", i); - } - })(), - (function (t) { - j(n, yt); - var e = F(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return P(this, n), e.call(this, t, r, "driver", i); - } - })(), - (function (t) { - j(n, yt); - var e = F(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return P(this, n), e.call(this, t, r, "vendor", i); - } - })(), - (function (t) { - j(n, yt); - var e = F(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return P(this, n), e.call(this, t, r, "contact", i); - } - })(), - (function (t) { - j(n, yt); - var e = F(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return P(this, n), e.call(this, t, r, "zone", i); - } - })(), - (function (t) { - j(n, yt); - var e = F(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return P(this, n), e.call(this, t, r, "service-area", i); - } - })(), - (function (t) { - j(n, yt); - var e = F(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return P(this, n), e.call(this, t, r, "service-rate", i); - } - })(); - var Tt = (function (t) { - j(n, yt); - var e = F(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return P(this, n), e.call(this, t, r, "service-quote", i); - } - return ( - U(n, [ - { key: "fromPreliminary", value: function () {} }, - { key: "fromPayload", value: function () {} }, - ]), - n - ); - })(), - xt = function t() { - var e = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - P(this, t), - (this.version = e.version || "v1"), - (this.host = e.host || null), - (this.namespace = e.namespace || null), - (this.headers = e.headers || {}); - }, - Ct = (function (t) { - j(n, xt); - var e = F(n); - function n(t) { - var r; - return ( - P(this, n), - (r = e.call(this, t)).setHeaders({ - Authorization: "Bearer ".concat(t.publicKey), - "Content-Type": "application/json", - "User-Agent": "@fleetbase/sdk;browser", - }), - r - ); - } - return ( - U(n, [ - { - key: "setHeaders", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return (this.headers = D(D({}, this.headers), t)), this; - }, - }, - { - key: "parseJSON", - value: function (t) { - return new Promise(function (e, n) { - return t - .json() - .then(function (n) { - return e({ - statusText: t.statusText, - status: t.status, - ok: t.ok, - json: n, - }); - }) - .catch(function () { - n( - new Error( - "Oops! Something went wrong when handling your request.", - ), - ); - }); - }); - }, - }, - { - key: "request", - value: function (t) { - var e = this, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : "GET", - r = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}, - i = - arguments.length > 3 && void 0 !== arguments[3] - ? arguments[3] - : {}; - return new Promise(function (a, o) { - return fetch( - i.url || - "".concat(e.host, "/").concat(e.namespace, "/").concat(t), - D( - { - method: n, - mode: i.mode || "cors", - headers: new Headers( - D(D({}, e.headers || {}), i.headers || {}), - ), - }, - r, - ), - ) - .then(e.parseJSON) - .then(function (t) { - return t.ok - ? a(t.json) - : o( - new Error( - t.json.errors ? t.json.errors[0] : t.statusText, - ), - ); - }) - .catch(function (t) { - o(t); - }); - }); - }, - }, - { - key: "get", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}, - r = ut(e) ? "" : new URLSearchParams(e).toString(); - return this.request( - "".concat(t).concat(r ? "?".concat(r) : ""), - "GET", - {}, - n, - ); - }, - }, - { - key: "post", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}; - return this.request(t, "POST", { body: JSON.stringify(e) }, n); - }, - }, - { - key: "put", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}; - return this.request(t, "PUT", { body: JSON.stringify(e) }, n); - }, - }, - { - key: "delete", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}; - return this.request(t, "DELETE", {}, e); - }, - }, - { - key: "patch", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}; - return this.request(t, "PATCH", { body: JSON.stringify(e) }, n); - }, - }, - ]), - n - ); - })(), - At = (function (t) { - j(n, xt); - var e = F(n); - function n(t) { - var i; - return ( - P(this, n), - ((i = e.call(this, t)).axios = r.default.create({ - baseURL: "".concat(i.host, "/").concat(i.namespace), - headers: { - Authorization: "Bearer ".concat(t.publicKey), - "Content-Type": "application/json", - "User-Agent": "@fleetbase/sdk;node", - }, - })), - i - ); - } - return ( - U(n, [ - { - key: "setHeaders", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}, - e = this.axios.defaults.headers.common; - return ( - (this.axios.defaults.headers.common = D(D({}, e), t)), this - ); - }, - }, - { - key: "transform", - value: function (t) { - return t.data; - }, - }, - { - key: "handleError", - value: function (t) { - if (t.response) { - var e = t.response.data; - if (Q(e.errors)) throw new Error(e.errors[0]); - if (e.error) throw new Error(e.error); - } - throw t; - }, - }, - { - key: "get", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}, - r = ut(e) ? "" : new URLSearchParams(e).toString(); - return this.axios - .get("".concat(t).concat(r ? "?".concat(r) : ""), n) - .then(this.transform.bind(this)) - .catch(this.handleError.bind(this)); - }, - }, - { - key: "post", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}; - return this.axios - .post(t, e, n) - .then(this.transform.bind(this)) - .catch(this.handleError.bind(this)); - }, - }, - { - key: "put", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}; - return this.axios - .put(t, e, n) - .then(this.transform.bind(this)) - .catch(this.handleError.bind(this)); - }, - }, - { - key: "delete", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}; - return this.axios - .delete(t, e) - .then(this.transform.bind(this)) - .catch(this.handleError.bind(this)); - }, - }, - { - key: "patch", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}; - return this.axios - .patch(t, e, n) - .then(this.transform.bind(this)) - .catch(this.handleError.bind(this)); - }, - }, - ]), - n - ); - })(), - Dt = (function (t) { - j(n, xt); - var e = F(n); - function n() { - return P(this, n), e.apply(this, arguments); - } - return n; - })(), - Et = (function () { - function t(e) { - var n = - !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; - P(this, t), - M(this, "uncountableWords", [ - "equipment", - "information", - "rice", - "money", - "species", - "series", - "fish", - "sheep", - "moose", - "deer", - "news", - ]), - M(this, "pluralRules", [ - [new RegExp("(m)an$", "gi"), "$1en"], - [new RegExp("(pe)rson$", "gi"), "$1ople"], - [new RegExp("(child)$", "gi"), "$1ren"], - [new RegExp("^(ox)$", "gi"), "$1en"], - [new RegExp("(ax|test)is$", "gi"), "$1es"], - [new RegExp("(octop|vir)us$", "gi"), "$1i"], - [new RegExp("(alias|status)$", "gi"), "$1es"], - [new RegExp("(bu)s$", "gi"), "$1ses"], - [new RegExp("(buffal|tomat|potat)o$", "gi"), "$1oes"], - [new RegExp("([ti])um$", "gi"), "$1a"], - [new RegExp("sis$", "gi"), "ses"], - [new RegExp("(?:([^f])fe|([lr])f)$", "gi"), "$1$2ves"], - [new RegExp("(hive)$", "gi"), "$1s"], - [new RegExp("([^aeiouy]|qu)y$", "gi"), "$1ies"], - [new RegExp("(x|ch|ss|sh)$", "gi"), "$1es"], - [new RegExp("(matr|vert|ind)ix|ex$", "gi"), "$1ices"], - [new RegExp("([m|l])ouse$", "gi"), "$1ice"], - [new RegExp("(quiz)$", "gi"), "$1zes"], - [new RegExp("s$", "gi"), "s"], - [new RegExp("$", "gi"), "s"], - ]), - M(this, "singularRules", [ - [new RegExp("(m)en$", "gi"), "$1an"], - [new RegExp("(pe)ople$", "gi"), "$1rson"], - [new RegExp("(child)ren$", "gi"), "$1"], - [new RegExp("([ti])a$", "gi"), "$1um"], - [ - new RegExp( - "((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$", - "gi", - ), - "$1$2sis", - ], - [new RegExp("(hive)s$", "gi"), "$1"], - [new RegExp("(tive)s$", "gi"), "$1"], - [new RegExp("(curve)s$", "gi"), "$1"], - [new RegExp("([lr])ves$", "gi"), "$1f"], - [new RegExp("([^fo])ves$", "gi"), "$1fe"], - [new RegExp("([^aeiouy]|qu)ies$", "gi"), "$1y"], - [new RegExp("(s)eries$", "gi"), "$1eries"], - [new RegExp("(m)ovies$", "gi"), "$1ovie"], - [new RegExp("(x|ch|ss|sh)es$", "gi"), "$1"], - [new RegExp("([m|l])ice$", "gi"), "$1ouse"], - [new RegExp("(bus)es$", "gi"), "$1"], - [new RegExp("(o)es$", "gi"), "$1"], - [new RegExp("(shoe)s$", "gi"), "$1"], - [new RegExp("(cris|ax|test)es$", "gi"), "$1is"], - [new RegExp("(octop|vir)i$", "gi"), "$1us"], - [new RegExp("(alias|status)es$", "gi"), "$1"], - [new RegExp("^(ox)en", "gi"), "$1"], - [new RegExp("(vert|ind)ices$", "gi"), "$1ex"], - [new RegExp("(matr)ices$", "gi"), "$1ix"], - [new RegExp("(quiz)zes$", "gi"), "$1"], - [new RegExp("s$", "gi"), ""], - ]), - M(this, "nonTitlecasedWords", [ - "and", - "or", - "nor", - "a", - "an", - "the", - "so", - "but", - "to", - "of", - "at", - "by", - "from", - "into", - "on", - "onto", - "off", - "out", - "in", - "over", - "with", - "for", - ]), - M(this, "idSuffix", new RegExp("(_ids|_id)$", "g")), - M(this, "underbar", new RegExp("_", "g")), - M(this, "spaceOrUnderbar", new RegExp("[ _]", "g")), - M(this, "uppercase", new RegExp("([A-Z])", "g")), - M(this, "underbarPrefix", new RegExp("^_")), - (this.str = e), - (this.chain = n); - } - return ( - U( - t, - [ - { - key: "get", - value: function () { - return this.str; - }, - }, - { - key: "applyRules", - value: function (t, e, n, r) { - if (r) t = r; - else if (!(n.indexOf(t.toLowerCase()) > -1)) - for (var i = 0; i < e.length; i++) - if (t.match(e[i][0])) { - t = t.replace(e[i][0], e[i][1]); - break; - } - return (this.str = t), !0 === this.chain ? this : t; - }, - }, - { - key: "pluralize", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : null; - return ( - (t = t || this.str), - this.applyRules(t, this.pluralRules, this.uncountableWords, e) - ); - }, - }, - { - key: "singularize", - value: function (t, e) { - return ( - (t = t || this.str), - this.applyRules( - t, - this.singularRules, - this.uncountableWords, - e, - ) - ); - }, - }, - { - key: "camelize", - value: function (t, e) { - for ( - var n = (t = t || this.str).split("/"), r = 0; - r < n.length; - r++ - ) { - for ( - var i = n[r].split("_"), - a = e && r + 1 === n.length ? 1 : 0; - a < i.length; - a++ - ) - i[a] = i[a].charAt(0).toUpperCase() + i[a].substring(1); - n[r] = i.join(""); - } - if (((t = n.join("::")), !0 === e)) { - var o = t.charAt(0).toLowerCase(), - u = t.slice(1); - t = o + u; - } - return (this.str = t), !0 === this.chain ? this : t; - }, - }, - { - key: "underscore", - value: function (t) { - for ( - var e = (t = t || this.str).split("::"), n = 0; - n < e.length; - n++ - ) - (e[n] = e[n].replace(this.uppercase, "_$1")), - (e[n] = e[n].replace(this.underbarPrefix, "")); - return ( - (t = e.join("/").toLowerCase()), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "humanize", - value: function (t, e) { - return ( - (t = (t = (t = (t = t || this.str).toLowerCase()).replace( - this.idSuffix, - "", - )).replace(this.underbar, " ")), - e || (t = this.capitalize(t)), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "capitalize", - value: function (t) { - return ( - (t = - (t = (t = t || this.str).toLowerCase()) - .substring(0, 1) - .toUpperCase() + t.substring(1)), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "dasherize", - value: function (t) { - return ( - (t = (t = (t = t || this.str).replace( - this.spaceOrUnderbar, - "-", - )).toLowerCase()), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "normify", - value: function (t, e) { - (t = t || this.str), - !0 === e - ? ((t = this.camelize(t)), (t = this.underscore(t))) - : (t = t.toLowerCase()); - for ( - var n = (t = t.replace(this.underbar, " ")).split(" "), r = 0; - r < n.length; - r++ - ) { - for (var i = n[r].split("-"), a = 0; a < i.length; a++) - this.nonTitlecasedWords.indexOf(i[a].toLowerCase()) < 0 && - (i[a] = this.capitalize(i[a])); - n[r] = i.join("-"); - } - return ( - (t = - (t = n.join(" ")).substring(0, 1).toUpperCase() + - t.substring(1)), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "demodulize", - value: function (t) { - var e = (t = t || this.str).split("::"); - return ( - (t = e[e.length - 1]), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "tableize", - value: function (t) { - return ( - (t = t || this.str), - (t = this.pluralize(this.underscore(t))), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "classify", - value: function (t) { - return ( - (t = t || this.str), - (t = this.singularize(this.camelize(t))), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "foreignKey", - value: function (t) { - var e = - arguments.length > 1 && - void 0 !== arguments[1] && - arguments[1]; - return ( - (t = t || this.str), - (t = - this.underscore(this.demodulize(t)) + - (e ? "" : "_") + - "id"), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "ordinalize", - value: function (t) { - for ( - var e = (t = t || this.str).split(" "), n = 0; - n < e.length; - n++ - ) - if (NaN === parseInt(e[n])) { - var r = e[n].substring(e[n].length - 2), - i = e[n].substring(e[n].length - 1), - a = "th"; - "11" != r && - "12" != r && - "13" != r && - ("1" === i - ? (a = "st") - : "2" === i - ? (a = "nd") - : "3" === i && (a = "rd")), - (e[n] += a); - } - return ( - (t = e.join(" ")), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - ], - [ - { - key: "invoke", - value: function () { - var e = Object.values(arguments), - n = new t(null, !1), - r = arguments[0]; - return ( - e.shift(), - "function" == typeof n[r] ? n[r].apply(n, W(e)) : null - ); - }, - }, - ], - ), - t - ); - })(), - St = function () { - var t = ["pluralize"].concat(Array.prototype.slice.call(arguments)); - return Et.invoke.apply(Et, W(t)); - }, - Ot = function () { - var t = ["singularize"].concat(Array.prototype.slice.call(arguments)); - return Et.invoke.apply(Et, W(t)); - }, - Pt = function () { - var t = ["classify"].concat(Array.prototype.slice.call(arguments)); - return Et.invoke.apply(Et, W(t)); - }, - Rt = { Place: kt, Payload: bt, Order: wt }, - Ut = { BrowserAdapter: Ct, NodeAdapter: At, EmberJsAdapter: Dt }, - Mt = (function () { - function t() { - return ( - P(this, t), - (this.resources = Rt), - (this.adapters = Ut), - this.lookup.apply(this, arguments) - ); - } - return ( - U(t, [ - { - key: "lookup", - value: function (t, e) { - var n = St(t), - r = Array.prototype.slice.call(arguments).slice(2); - if (!this[n]) - throw new Error("Attempted to resolve invalid type"); - if (!this[n][e]) - throw new Error( - "No ".concat(Ot(t), " named ").concat(e, " to resolve"), - ); - return H(this[n][e], W(r)); - }, - }, - ]), - t - ); - })(), - jt = function () { - return H(Mt, Array.prototype.slice.call(arguments)); - }, - qt = function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : []; - if (((t.actions = Q(e) ? e : [e]), !Q(e))) - return e instanceof pt && e.extend(t), t; - for (var n = 0; n < e.length; n++) { - var r = e[n]; - t.extendActions(r); - } - }, - $t = (function () { - function t(e, n) { - var r = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - P(this, t), - (this.resource = e), - (this.adapter = n || ht()), - (this.namespace = St(e)), - (this.storage = new at()), - (this.options = r), - this.extendActions(r.actions); - } - return ( - U(t, [ - { - key: "extendActions", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : []; - return qt(this, t); - }, - }, - { - key: "deposit", - value: function (t) { - return t; - }, - }, - { - key: "serialize", - value: function (t) { - return jt("resource", Pt(this.resource), t, this.adapter); - }, - }, - { - key: "afterFetch", - value: function (t) { - return (function (t, e) { - if ( - ("function" == typeof t.options.onAfterFetch && - t.options.onAfterFetch(e), - Q(e)) - ) { - for (var n = [], r = 0; r < e.length; r++) - n.push(t.afterFetch(e[r])); - return H(at, n); - } - var i = t.serialize(e); - return t.deposit(i); - })(this, t); - }, - }, - { - key: "create", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}; - return new Promise( - (function () { - var r = O( - regeneratorRuntime.mark(function r(i, a) { - var o; - return regeneratorRuntime.wrap(function (r) { - for (;;) - switch ((r.prev = r.next)) { - case 0: - return ( - (r.next = 2), - t.adapter - .post("".concat(t.namespace), e, n) - .then(t.afterFetch.bind(t)) - .catch(a) - ); - case 2: - (o = r.sent), i(o); - case 4: - case "end": - return r.stop(); - } - }, r); - }), - ); - return function (t, e) { - return r.apply(this, arguments); - }; - })(), - ); - }, - }, - { - key: "update", - value: function (t) { - var e = this, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - r = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}; - return new Promise( - (function () { - var i = O( - regeneratorRuntime.mark(function i(a, o) { - var u; - return regeneratorRuntime.wrap(function (i) { - for (;;) - switch ((i.prev = i.next)) { - case 0: - return ( - (i.next = 2), - e.adapter - .put( - "".concat(e.namespace, "/").concat(t), - n, - r, - ) - .then(e.afterFetch.bind(e)) - .catch(o) - ); - case 2: - (u = i.sent), a(u); - case 4: - case "end": - return i.stop(); - } - }, i); - }), - ); - return function (t, e) { - return i.apply(this, arguments); - }; - })(), - ); - }, - }, - { - key: "findRecord", - value: function (t) { - var e = this, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}; - return new Promise( - (function () { - var r = O( - regeneratorRuntime.mark(function r(i, a) { - var o; - return regeneratorRuntime.wrap(function (r) { - for (;;) - switch ((r.prev = r.next)) { - case 0: - return ( - (r.next = 2), - e.adapter - .get( - "".concat(e.namespace, "/").concat(t), - {}, - n, - ) - .then(e.afterFetch.bind(e)) - .catch(a) - ); - case 2: - (o = r.sent), i(o); - case 4: - case "end": - return r.stop(); - } - }, r); - }), - ); - return function (t, e) { - return r.apply(this, arguments); - }; - })(), - ); - }, - }, - { - key: "findAll", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return new Promise( - (function () { - var n = O( - regeneratorRuntime.mark(function n(r, i) { - var a; - return regeneratorRuntime.wrap(function (n) { - for (;;) - switch ((n.prev = n.next)) { - case 0: - return ( - (n.next = 2), - t.adapter - .get("".concat(t.namespace), {}, e) - .then(t.afterFetch.bind(t)) - .catch(i) - ); - case 2: - (a = n.sent), r(a); - case 4: - case "end": - return n.stop(); - } - }, n); - }), - ); - return function (t, e) { - return n.apply(this, arguments); - }; - })(), - ); - }, - }, - { - key: "query", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}; - return new Promise( - (function () { - var r = O( - regeneratorRuntime.mark(function r(i, a) { - var o; - return regeneratorRuntime.wrap(function (r) { - for (;;) - switch ((r.prev = r.next)) { - case 0: - return ( - (r.next = 2), - t.adapter - .get("".concat(t.namespace), e, n) - .then(t.afterFetch.bind(t)) - .catch(a) - ); - case 2: - (o = r.sent), i(o); - case 4: - case "end": - return r.stop(); - } - }, r); - }), - ); - return function (t, e) { - return r.apply(this, arguments); - }; - })(), - ); - }, - }, - { - key: "queryRecord", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}; - return ( - (e.single = !0), - new Promise( - (function () { - var r = O( - regeneratorRuntime.mark(function r(i, a) { - var o; - return regeneratorRuntime.wrap(function (r) { - for (;;) - switch ((r.prev = r.next)) { - case 0: - return ( - (r.next = 2), - t.adapter - .get("".concat(t.namespace), e, n) - .then(t.afterFetch.bind(t)) - .catch(a) - ); - case 2: - (o = r.sent), i(o); - case 4: - case "end": - return r.stop(); - } - }, r); - }), - ); - return function (t, e) { - return r.apply(this, arguments); - }; - })(), - ) - ); - }, - }, - { - key: "destroy", - value: function (t) { - var e = this, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - r = st(t) ? t.getAttribute("id") : t; - return new Promise( - (function () { - var t = O( - regeneratorRuntime.mark(function t(i, a) { - var o; - return regeneratorRuntime.wrap(function (t) { - for (;;) - switch ((t.prev = t.next)) { - case 0: - return ( - (t.next = 2), - e.adapter - .delete( - "".concat(e.namespace, "/").concat(r), - {}, - n, - ) - .then(e.afterFetch.bind(e)) - .catch(a) - ); - case 2: - (o = t.sent), i(o); - case 4: - case "end": - return t.stop(); - } - }, t); - }), - ); - return function (e, n) { - return t.apply(this, arguments); - }; - })(), - ); - }, - }, - ]), - t - ); - })(); - !(function () { - function t(e) { - var n = - arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; - if ( - (P(this, t), - (this.version = n.version || "v1"), - (this.options = { - version: this.version, - host: n.host || "https://api.fleetbase.io", - namespace: this.version || n.namespace, - debug: r, - publicKey: e, - }), - "string" != typeof e || 0 === e.length) - ) - throw new Error("⚠️ Invalid public key given to Fleetbase SDK"); - if (!ct() && e.toLowerCase().startsWith("$")) - throw new Error( - "Secret key provided. You must use a public key with Fleetbase Javascript SDK!", - ); - (this.adapter = n.adapter || ht(this.options)), - (this.orders = new $t("order", this.adapter).extendActions(mt)), - (this.entities = new $t("entity", this.adapter)), - (this.places = new $t("place", this.adapter)), - (this.drivers = new $t("driver", this.adapter)), - (this.vehicles = new $t("vehicle", this.adapter)), - (this.vendors = new $t("vendor", this.adapter)), - (this.contacts = new $t("contact", this.adapter)); - } - U( - t, - [ - { - key: "setAdapter", - value: function (t) { - this.adapter = t; - }, - }, - { - key: "getAdapter", - value: function () { - return this.adapter; - }, - }, - ], - [ - { - key: "newInstance", - value: function () { - return H(t, Array.prototype.slice.call(arguments)); - }, - }, - ], - ); - })(); - var Nt = (function (t) { - l(n, t); - var e = m(n); - function n() { - return u(this, n), e.apply(this, arguments); - } - return ( - c(n, [ - { - key: "setAdapter", - value: function (t) { - var e; - return ( - (this.adapter = t), - (this.store = new Cr(this.resource, t, { - onAfterFetch: this.syncAttributes.bind(this), - actions: - null === (e = this.options) || void 0 === e - ? void 0 - : e.actions, - })), - this - ); - }, - }, - ]), - n - ); - })(yt), - Ht = new pt({ - count: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - n = {}; - return ( - t && (n.store = t), - this.adapter.get("".concat(this.namespace, "/count"), n, e) - ); - }, - }), - Yt = (function (t) { - l(n, t); - var e = m(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return u(this, n), e.call(this, t, r, "review", i); - } - return ( - c(n, [ - { key: "getMedia", value: function () {} }, - { key: "getPhotos", value: function () {} }, - { key: "getVideos", value: function () {} }, - ]), - n - ); - })(Nt), - Lt = function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return ct() - ? xr("adapter", "NodeAdapter", t) - : xr("adapter", "BrowserAdapter", t); - }, - Ft = function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""; - return /^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(t); - }; - function _t() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, - e = - arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "USD", - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : "symbol"; - return new Intl.NumberFormat("en-US", { - style: "currency", - currency: e, - currencyDisplay: n, - }).format(t); - } - var Wt = function (t) { - return ( - "string" == typeof t && - t.length > 30 && - (t.startsWith("store_") || t.startsWith("network_")) - ); - }, - zt = function (t) { - var e = null == t; - if (e) return e; - if ("number" == typeof t.size) return !t.size; - var n = o(t); - if ("object" === n) { - var r = t.size; - if ("number" == typeof r) return !r; - } - if ("number" == typeof t.length && "function" !== n) return !t.length; - if ("object" === n) { - var i = t.length; - if ("number" == typeof i) return !i; - } - return !1; - }, - It = (function (t) { - l(n, t); - var e = m(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return u(this, n), e.call(this, t, r, "product", i); - } - return ( - c(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, - n = t.sale_price, - r = t.currency; - return this.isOnSale - ? zt(n) || zt(r) - ? null - : _t(n / 100, r) - : zt(e) || zt(r) - ? null - : _t(e / 100, r); - }, - }, - { - key: "getReviews", - value: function () { - var t = this; - return this.adapter - .get("reviews", { store: this.id }) - .then(function (e) { - return new at( - e.map(function (e) { - return new Yt(e, t.adapter); - }), - ); - }); - }, - }, - ]), - n - ); - })(Nt), - Qt = (function (t) { - l(n, t); - var e = m(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return u(this, n), e.call(this, t, r, "category", i); - } - return ( - c(n, [ - { - key: "getProducts", - value: function () { - var t = this; - return this.adapter - .get("products", { category: this.id }) - .then(function (e) { - return new at( - e.map(function (e) { - return new It(e, t.adapter); - }), - ); - }); - }, - }, - ]), - n - ); - })(Nt), - Bt = new pt({ - 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 (Ft(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", a({ 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", a({ 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", a({ identity: t, code: e }, n)) - .then(this.afterFetch.bind(this)); - }, - retrieve: function (t) { - return this.findRecord(t); - }, - }), - Gt = (function (t) { - l(n, t); - var e = m(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return ( - u(this, n), e.call(this, t, r, "customer", a({ actions: Bt }, i)) - ); - } - return ( - c(n, [ - { - key: "setAdapter", - value: function (t) { - var e; - return ( - (this.adapter = t), - (this.store = new Cr(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: function (t) { - var e = this; - return this.adapter - .setHeaders({ "Customer-Token": this.token }) - .post("customers/register-device", t) - .then(function () { - return e; - }); - }, - }, - { - key: "getSavedPlaces", - value: function () { - var t = this; - return this.adapter - .setHeaders({ "Customer-Token": this.token }) - .get("customers/places") - .then(function (e) { - return new at( - e.map(function (e) { - return new kt(e, t.adapter); - }), - ); - }); - }, - }, - { - key: "getOrderHistory", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return this.adapter - .setHeaders({ "Customer-Token": this.token }) - .get("customers/orders", e) - .then(function (e) { - return new at( - e.map(function (e) { - return new wt(e, t.adapter); - }), - ); - }); - }, - }, - ]), - n - ); - })(Nt), - Xt = Array.isArray, - Kt = new pt({ - 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, - r = - arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, - i = - arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {}; - return this.adapter - .post( - "".concat(this.namespace, "/").concat(t, "/").concat(e), - a(a({}, r), {}, { quantity: n }), - i, - ) - .then(this.afterFetch.bind(this)); - }, - update: function (t, e, n) { - var r = - arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, - i = - arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {}; - return this.adapter - .put( - "".concat(this.namespace, "/").concat(t, "/").concat(e), - a(a({}, r), {}, { quantity: n }), - i, - ) - .then(this.afterFetch.bind(this)); - }, - remove: function (t, e) { - var n = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return this.adapter - .delete( - "".concat(this.namespace, "/").concat(t, "/").concat(e), - {}, - n, - ) - .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); - }, - }), - Jt = (function (t) { - l(n, t); - var e = m(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return u(this, n), e.call(this, t, r, "cart", a({ actions: Kt }, i)); - } - return ( - c(n, [ - { - key: "add", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : 1, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}, - r = - arguments.length > 3 && void 0 !== arguments[3] - ? arguments[3] - : {}; - return ( - t instanceof It && (t = t.id), - this.store.add(this.id, t, e, n, r) - ); - }, - }, - { - key: "update", - value: function (t, e) { - var n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}, - r = - arguments.length > 3 && void 0 !== arguments[3] - ? arguments[3] - : {}; - return this.store.update(this.id, t, e, n, r); - }, - }, - { - 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 !Xt(t) || 0 === t.length; - }, - }, - { - key: "isNotEmpty", - get: function () { - return !this.isEmpty; - }, - }, - ]), - n - ); - })(Nt); - function Zt(t) { - if (null === t || !0 === t || !1 === t) return NaN; - var e = Number(t); - return isNaN(e) ? e : e < 0 ? Math.ceil(e) : Math.floor(e); - } - function Vt(t, e) { - if (e.length < t) - throw new TypeError( - t + - " argument" + - (t > 1 ? "s" : "") + - " required, but only " + - e.length + - " present", - ); - } - function te(t) { - Vt(1, arguments); - var e = Object.prototype.toString.call(t); - return t instanceof Date || ("object" == typeof t && "[object Date]" === e) - ? new Date(t.getTime()) - : "number" == typeof t || "[object Number]" === e - ? new Date(t) - : (("string" != typeof t && "[object String]" !== e) || - "undefined" == typeof console || - (console.warn( - "Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule", - ), - console.warn(new Error().stack)), - new Date(NaN)); - } - function ee(t, e) { - Vt(2, arguments); - var n = te(t).getTime(), - r = Zt(e); - return new Date(n + r); - } - function ne(t) { - var 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 re(t) { - return ( - Vt(1, arguments), - t instanceof Date || - ("object" == typeof t && - "[object Date]" === Object.prototype.toString.call(t)) - ); - } - function ie(t) { - if ((Vt(1, arguments), !re(t) && "number" != typeof t)) return !1; - var e = te(t); - return !isNaN(Number(e)); - } - var ae = { - 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" }, - }, - oe = function (t, e, n) { - var r, - i = ae[t]; - return ( - (r = - "string" == typeof i - ? i - : 1 === e - ? i.one - : i.other.replace("{{count}}", e.toString())), - null != n && n.addSuffix - ? n.comparison && n.comparison > 0 - ? "in " + r - : r + " ago" - : r - ); - }, - ue = oe; - function se(t) { - return function () { - var e = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - n = e.width ? String(e.width) : t.defaultWidth, - r = t.formats[n] || t.formats[t.defaultWidth]; - return r; - }; - } - var ce = { - full: "EEEE, MMMM do, y", - long: "MMMM do, y", - medium: "MMM d, y", - short: "MM/dd/yyyy", - }, - he = { - full: "h:mm:ss a zzzz", - long: "h:mm:ss a z", - medium: "h:mm:ss a", - short: "h:mm a", - }, - le = { - full: "{{date}} 'at' {{time}}", - long: "{{date}} 'at' {{time}}", - medium: "{{date}}, {{time}}", - short: "{{date}}, {{time}}", - }, - de = { - date: se({ formats: ce, defaultWidth: "full" }), - time: se({ formats: he, defaultWidth: "full" }), - dateTime: se({ formats: le, defaultWidth: "full" }), - }, - fe = de, - ve = { - lastWeek: "'last' eeee 'at' p", - yesterday: "'yesterday at' p", - today: "'today at' p", - tomorrow: "'tomorrow at' p", - nextWeek: "eeee 'at' p", - other: "P", - }, - ge = function (t, e, n, r) { - return ve[t]; - }, - pe = ge; - function ye(t) { - return function (e, n) { - var r, - i = n || {}; - if ( - "formatting" === (i.context ? String(i.context) : "standalone") && - t.formattingValues - ) { - var a = t.defaultFormattingWidth || t.defaultWidth, - o = i.width ? String(i.width) : a; - r = t.formattingValues[o] || t.formattingValues[a]; - } else { - var u = t.defaultWidth, - s = i.width ? String(i.width) : t.defaultWidth; - r = t.values[s] || t.values[u]; - } - return r[t.argumentCallback ? t.argumentCallback(e) : e]; - }; - } - var me = { - narrow: ["B", "A"], - abbreviated: ["BC", "AD"], - wide: ["Before Christ", "Anno Domini"], - }, - we = { - narrow: ["1", "2", "3", "4"], - abbreviated: ["Q1", "Q2", "Q3", "Q4"], - wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"], - }, - be = { - 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", - ], - }, - ke = { - 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", - ], - }, - Te = { - 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", - }, - }, - xe = { - 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", - }, - }, - Ce = function (t, e) { - var n = Number(t), - r = n % 100; - if (r > 20 || r < 10) - switch (r % 10) { - case 1: - return n + "st"; - case 2: - return n + "nd"; - case 3: - return n + "rd"; - } - return n + "th"; - }, - Ae = { - ordinalNumber: Ce, - era: ye({ values: me, defaultWidth: "wide" }), - quarter: ye({ - values: we, - defaultWidth: "wide", - argumentCallback: function (t) { - return t - 1; - }, - }), - month: ye({ values: be, defaultWidth: "wide" }), - day: ye({ values: ke, defaultWidth: "wide" }), - dayPeriod: ye({ - values: Te, - defaultWidth: "wide", - formattingValues: xe, - defaultFormattingWidth: "wide", - }), - }, - De = Ae; - function Ee(t) { - return function (e) { - var n = - arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - r = n.width, - i = (r && t.matchPatterns[r]) || t.matchPatterns[t.defaultMatchWidth], - a = e.match(i); - if (!a) return null; - var o, - u = a[0], - s = (r && t.parsePatterns[r]) || t.parsePatterns[t.defaultParseWidth], - c = Array.isArray(s) - ? Oe(s, function (t) { - return t.test(u); - }) - : Se(s, function (t) { - return t.test(u); - }); - (o = t.valueCallback ? t.valueCallback(c) : c), - (o = n.valueCallback ? n.valueCallback(o) : o); - var h = e.slice(u.length); - return { value: o, rest: h }; - }; - } - function Se(t, e) { - for (var n in t) if (t.hasOwnProperty(n) && e(t[n])) return n; - } - function Oe(t, e) { - for (var n = 0; n < t.length; n++) if (e(t[n])) return n; - } - function Pe(t) { - return function (e) { - var n = - arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - r = e.match(t.matchPattern); - if (!r) return null; - var i = r[0], - a = e.match(t.parsePattern); - if (!a) return null; - var o = t.valueCallback ? t.valueCallback(a[0]) : a[0]; - o = n.valueCallback ? n.valueCallback(o) : o; - var u = e.slice(i.length); - return { value: o, rest: u }; - }; - } - var Re = /^(\d+)(th|st|nd|rd)?/i, - Ue = /\d+/i, - Me = { - 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, - }, - je = { any: [/^b/i, /^(a|c)/i] }, - qe = { - narrow: /^[1234]/i, - abbreviated: /^q[1234]/i, - wide: /^[1234](th|st|nd|rd)? quarter/i, - }, - $e = { any: [/1/i, /2/i, /3/i, /4/i] }, - Ne = { - 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, - }, - He = { - 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, - ], - }, - Ye = { - 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, - }, - Le = { - 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], - }, - Fe = { - 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, - }, - _e = { - 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, - }, - }, - We = { - ordinalNumber: Pe({ - matchPattern: Re, - parsePattern: Ue, - valueCallback: function (t) { - return parseInt(t, 10); - }, - }), - era: Ee({ - matchPatterns: Me, - defaultMatchWidth: "wide", - parsePatterns: je, - defaultParseWidth: "any", - }), - quarter: Ee({ - matchPatterns: qe, - defaultMatchWidth: "wide", - parsePatterns: $e, - defaultParseWidth: "any", - valueCallback: function (t) { - return t + 1; - }, - }), - month: Ee({ - matchPatterns: Ne, - defaultMatchWidth: "wide", - parsePatterns: He, - defaultParseWidth: "any", - }), - day: Ee({ - matchPatterns: Ye, - defaultMatchWidth: "wide", - parsePatterns: Le, - defaultParseWidth: "any", - }), - dayPeriod: Ee({ - matchPatterns: Fe, - defaultMatchWidth: "any", - parsePatterns: _e, - defaultParseWidth: "any", - }), - }, - ze = We, - Ie = { - code: "en-US", - formatDistance: ue, - formatLong: fe, - formatRelative: pe, - localize: De, - match: ze, - options: { weekStartsOn: 0, firstWeekContainsDate: 1 }, - }, - Qe = Ie; - function Be(t, e) { - Vt(2, arguments); - var n = Zt(e); - return ee(t, -n); - } - function Ge(t, e) { - for (var n = t < 0 ? "-" : "", r = Math.abs(t).toString(); r.length < e; ) - r = "0" + r; - return n + r; - } - var Xe = { - y: function (t, e) { - var n = t.getUTCFullYear(), - r = n > 0 ? n : 1 - n; - return Ge("yy" === e ? r % 100 : r, e.length); - }, - M: function (t, e) { - var n = t.getUTCMonth(); - return "M" === e ? String(n + 1) : Ge(n + 1, 2); - }, - d: function (t, e) { - return Ge(t.getUTCDate(), e.length); - }, - a: function (t, e) { - var n = t.getUTCHours() / 12 >= 1 ? "pm" : "am"; - switch (e) { - case "a": - case "aa": - return n.toUpperCase(); - case "aaa": - return n; - case "aaaaa": - return n[0]; - default: - return "am" === n ? "a.m." : "p.m."; - } - }, - h: function (t, e) { - return Ge(t.getUTCHours() % 12 || 12, e.length); - }, - H: function (t, e) { - return Ge(t.getUTCHours(), e.length); - }, - m: function (t, e) { - return Ge(t.getUTCMinutes(), e.length); - }, - s: function (t, e) { - return Ge(t.getUTCSeconds(), e.length); - }, - S: function (t, e) { - var n = e.length, - r = t.getUTCMilliseconds(); - return Ge(Math.floor(r * Math.pow(10, n - 3)), e.length); - }, - }, - Ke = Xe, - Je = 864e5; - function Ze(t) { - Vt(1, arguments); - var e = te(t), - n = e.getTime(); - e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0); - var r = e.getTime(), - i = n - r; - return Math.floor(i / Je) + 1; - } - function Ve(t) { - Vt(1, arguments); - var e = 1, - n = te(t), - r = n.getUTCDay(), - i = (r < e ? 7 : 0) + r - e; - return n.setUTCDate(n.getUTCDate() - i), n.setUTCHours(0, 0, 0, 0), n; - } - function tn(t) { - Vt(1, arguments); - var e = te(t), - n = e.getUTCFullYear(), - r = new Date(0); - r.setUTCFullYear(n + 1, 0, 4), r.setUTCHours(0, 0, 0, 0); - var i = Ve(r), - a = new Date(0); - a.setUTCFullYear(n, 0, 4), a.setUTCHours(0, 0, 0, 0); - var o = Ve(a); - return e.getTime() >= i.getTime() - ? n + 1 - : e.getTime() >= o.getTime() - ? n - : n - 1; - } - function en(t) { - Vt(1, arguments); - var e = tn(t), - n = new Date(0); - n.setUTCFullYear(e, 0, 4), n.setUTCHours(0, 0, 0, 0); - var r = Ve(n); - return r; - } - var nn = 6048e5; - function rn(t) { - Vt(1, arguments); - var e = te(t), - n = Ve(e).getTime() - en(e).getTime(); - return Math.round(n / nn) + 1; - } - function an(t, e) { - Vt(1, arguments); - var n = e || {}, - r = n.locale, - i = r && r.options && r.options.weekStartsOn, - a = null == i ? 0 : Zt(i), - o = null == n.weekStartsOn ? a : Zt(n.weekStartsOn); - if (!(o >= 0 && o <= 6)) - throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); - var u = te(t), - s = u.getUTCDay(), - c = (s < o ? 7 : 0) + s - o; - return u.setUTCDate(u.getUTCDate() - c), u.setUTCHours(0, 0, 0, 0), u; - } - function on(t, e) { - Vt(1, arguments); - var n = te(t, e), - r = n.getUTCFullYear(), - i = e || {}, - a = i.locale, - o = a && a.options && a.options.firstWeekContainsDate, - u = null == o ? 1 : Zt(o), - s = null == i.firstWeekContainsDate ? u : Zt(i.firstWeekContainsDate); - if (!(s >= 1 && s <= 7)) - throw new RangeError( - "firstWeekContainsDate must be between 1 and 7 inclusively", - ); - var c = new Date(0); - c.setUTCFullYear(r + 1, 0, s), c.setUTCHours(0, 0, 0, 0); - var h = an(c, e), - l = new Date(0); - l.setUTCFullYear(r, 0, s), l.setUTCHours(0, 0, 0, 0); - var d = an(l, e); - return n.getTime() >= h.getTime() - ? r + 1 - : n.getTime() >= d.getTime() - ? r - : r - 1; - } - function un(t, e) { - Vt(1, arguments); - var n = e || {}, - r = n.locale, - i = r && r.options && r.options.firstWeekContainsDate, - a = null == i ? 1 : Zt(i), - o = null == n.firstWeekContainsDate ? a : Zt(n.firstWeekContainsDate), - u = on(t, e), - s = new Date(0); - s.setUTCFullYear(u, 0, o), s.setUTCHours(0, 0, 0, 0); - var c = an(s, e); - return c; - } - var sn = 6048e5; - function cn(t, e) { - Vt(1, arguments); - var n = te(t), - r = an(n, e).getTime() - un(n, e).getTime(); - return Math.round(r / sn) + 1; - } - var hn = { - am: "am", - pm: "pm", - midnight: "midnight", - noon: "noon", - morning: "morning", - afternoon: "afternoon", - evening: "evening", - night: "night", - }, - ln = { - G: function (t, e, n) { - var r = t.getUTCFullYear() > 0 ? 1 : 0; - switch (e) { - case "G": - case "GG": - case "GGG": - return n.era(r, { width: "abbreviated" }); - case "GGGGG": - return n.era(r, { width: "narrow" }); - default: - return n.era(r, { width: "wide" }); - } - }, - y: function (t, e, n) { - if ("yo" === e) { - var r = t.getUTCFullYear(), - i = r > 0 ? r : 1 - r; - return n.ordinalNumber(i, { unit: "year" }); - } - return Ke.y(t, e); - }, - Y: function (t, e, n, r) { - var i = on(t, r), - a = i > 0 ? i : 1 - i; - return "YY" === e - ? Ge(a % 100, 2) - : "Yo" === e - ? n.ordinalNumber(a, { unit: "year" }) - : Ge(a, e.length); - }, - R: function (t, e) { - return Ge(tn(t), e.length); - }, - u: function (t, e) { - return Ge(t.getUTCFullYear(), e.length); - }, - Q: function (t, e, n) { - var r = Math.ceil((t.getUTCMonth() + 1) / 3); - switch (e) { - case "Q": - return String(r); - case "QQ": - return Ge(r, 2); - case "Qo": - return n.ordinalNumber(r, { unit: "quarter" }); - case "QQQ": - return n.quarter(r, { - width: "abbreviated", - context: "formatting", - }); - case "QQQQQ": - return n.quarter(r, { width: "narrow", context: "formatting" }); - default: - return n.quarter(r, { width: "wide", context: "formatting" }); - } - }, - q: function (t, e, n) { - var r = Math.ceil((t.getUTCMonth() + 1) / 3); - switch (e) { - case "q": - return String(r); - case "qq": - return Ge(r, 2); - case "qo": - return n.ordinalNumber(r, { unit: "quarter" }); - case "qqq": - return n.quarter(r, { - width: "abbreviated", - context: "standalone", - }); - case "qqqqq": - return n.quarter(r, { width: "narrow", context: "standalone" }); - default: - return n.quarter(r, { width: "wide", context: "standalone" }); - } - }, - M: function (t, e, n) { - var r = t.getUTCMonth(); - switch (e) { - case "M": - case "MM": - return Ke.M(t, e); - case "Mo": - return n.ordinalNumber(r + 1, { unit: "month" }); - case "MMM": - return n.month(r, { width: "abbreviated", context: "formatting" }); - case "MMMMM": - return n.month(r, { width: "narrow", context: "formatting" }); - default: - return n.month(r, { width: "wide", context: "formatting" }); - } - }, - L: function (t, e, n) { - var r = t.getUTCMonth(); - switch (e) { - case "L": - return String(r + 1); - case "LL": - return Ge(r + 1, 2); - case "Lo": - return n.ordinalNumber(r + 1, { unit: "month" }); - case "LLL": - return n.month(r, { width: "abbreviated", context: "standalone" }); - case "LLLLL": - return n.month(r, { width: "narrow", context: "standalone" }); - default: - return n.month(r, { width: "wide", context: "standalone" }); - } - }, - w: function (t, e, n, r) { - var i = cn(t, r); - return "wo" === e - ? n.ordinalNumber(i, { unit: "week" }) - : Ge(i, e.length); - }, - I: function (t, e, n) { - var r = rn(t); - return "Io" === e - ? n.ordinalNumber(r, { unit: "week" }) - : Ge(r, e.length); - }, - d: function (t, e, n) { - return "do" === e - ? n.ordinalNumber(t.getUTCDate(), { unit: "date" }) - : Ke.d(t, e); - }, - D: function (t, e, n) { - var r = Ze(t); - return "Do" === e - ? n.ordinalNumber(r, { unit: "dayOfYear" }) - : Ge(r, e.length); - }, - E: function (t, e, n) { - var r = t.getUTCDay(); - switch (e) { - case "E": - case "EE": - case "EEE": - return n.day(r, { width: "abbreviated", context: "formatting" }); - case "EEEEE": - return n.day(r, { width: "narrow", context: "formatting" }); - case "EEEEEE": - return n.day(r, { width: "short", context: "formatting" }); - default: - return n.day(r, { width: "wide", context: "formatting" }); - } - }, - e: function (t, e, n, r) { - var i = t.getUTCDay(), - a = (i - r.weekStartsOn + 8) % 7 || 7; - switch (e) { - case "e": - return String(a); - case "ee": - return Ge(a, 2); - case "eo": - return n.ordinalNumber(a, { unit: "day" }); - case "eee": - return n.day(i, { width: "abbreviated", context: "formatting" }); - case "eeeee": - return n.day(i, { width: "narrow", context: "formatting" }); - case "eeeeee": - return n.day(i, { width: "short", context: "formatting" }); - default: - return n.day(i, { width: "wide", context: "formatting" }); - } - }, - c: function (t, e, n, r) { - var i = t.getUTCDay(), - a = (i - r.weekStartsOn + 8) % 7 || 7; - switch (e) { - case "c": - return String(a); - case "cc": - return Ge(a, e.length); - case "co": - return n.ordinalNumber(a, { unit: "day" }); - case "ccc": - return n.day(i, { width: "abbreviated", context: "standalone" }); - case "ccccc": - return n.day(i, { width: "narrow", context: "standalone" }); - case "cccccc": - return n.day(i, { width: "short", context: "standalone" }); - default: - return n.day(i, { width: "wide", context: "standalone" }); - } - }, - i: function (t, e, n) { - var r = t.getUTCDay(), - i = 0 === r ? 7 : r; - switch (e) { - case "i": - return String(i); - case "ii": - return Ge(i, e.length); - case "io": - return n.ordinalNumber(i, { unit: "day" }); - case "iii": - return n.day(r, { width: "abbreviated", context: "formatting" }); - case "iiiii": - return n.day(r, { width: "narrow", context: "formatting" }); - case "iiiiii": - return n.day(r, { width: "short", context: "formatting" }); - default: - return n.day(r, { width: "wide", context: "formatting" }); - } - }, - a: function (t, e, n) { - var r = t.getUTCHours() / 12 >= 1 ? "pm" : "am"; - switch (e) { - case "a": - case "aa": - return n.dayPeriod(r, { - width: "abbreviated", - context: "formatting", - }); - case "aaa": - return n - .dayPeriod(r, { width: "abbreviated", context: "formatting" }) - .toLowerCase(); - case "aaaaa": - return n.dayPeriod(r, { width: "narrow", context: "formatting" }); - default: - return n.dayPeriod(r, { width: "wide", context: "formatting" }); - } - }, - b: function (t, e, n) { - var r, - i = t.getUTCHours(); - switch ( - ((r = - 12 === i - ? hn.noon - : 0 === i - ? hn.midnight - : i / 12 >= 1 - ? "pm" - : "am"), - e) - ) { - case "b": - case "bb": - return n.dayPeriod(r, { - width: "abbreviated", - context: "formatting", - }); - case "bbb": - return n - .dayPeriod(r, { width: "abbreviated", context: "formatting" }) - .toLowerCase(); - case "bbbbb": - return n.dayPeriod(r, { width: "narrow", context: "formatting" }); - default: - return n.dayPeriod(r, { width: "wide", context: "formatting" }); - } - }, - B: function (t, e, n) { - var r, - i = t.getUTCHours(); - switch ( - ((r = - i >= 17 - ? hn.evening - : i >= 12 - ? hn.afternoon - : i >= 4 - ? hn.morning - : hn.night), - e) - ) { - case "B": - case "BB": - case "BBB": - return n.dayPeriod(r, { - width: "abbreviated", - context: "formatting", - }); - case "BBBBB": - return n.dayPeriod(r, { width: "narrow", context: "formatting" }); - default: - return n.dayPeriod(r, { width: "wide", context: "formatting" }); - } - }, - h: function (t, e, n) { - if ("ho" === e) { - var r = t.getUTCHours() % 12; - return 0 === r && (r = 12), n.ordinalNumber(r, { unit: "hour" }); - } - return Ke.h(t, e); - }, - H: function (t, e, n) { - return "Ho" === e - ? n.ordinalNumber(t.getUTCHours(), { unit: "hour" }) - : Ke.H(t, e); - }, - K: function (t, e, n) { - var r = t.getUTCHours() % 12; - return "Ko" === e - ? n.ordinalNumber(r, { unit: "hour" }) - : Ge(r, e.length); - }, - k: function (t, e, n) { - var r = t.getUTCHours(); - return ( - 0 === r && (r = 24), - "ko" === e ? n.ordinalNumber(r, { unit: "hour" }) : Ge(r, e.length) - ); - }, - m: function (t, e, n) { - return "mo" === e - ? n.ordinalNumber(t.getUTCMinutes(), { unit: "minute" }) - : Ke.m(t, e); - }, - s: function (t, e, n) { - return "so" === e - ? n.ordinalNumber(t.getUTCSeconds(), { unit: "second" }) - : Ke.s(t, e); - }, - S: function (t, e) { - return Ke.S(t, e); - }, - X: function (t, e, n, r) { - var i = (r._originalDate || t).getTimezoneOffset(); - if (0 === i) return "Z"; - switch (e) { - case "X": - return fn(i); - case "XXXX": - case "XX": - return vn(i); - default: - return vn(i, ":"); - } - }, - x: function (t, e, n, r) { - var i = (r._originalDate || t).getTimezoneOffset(); - switch (e) { - case "x": - return fn(i); - case "xxxx": - case "xx": - return vn(i); - default: - return vn(i, ":"); - } - }, - O: function (t, e, n, r) { - var i = (r._originalDate || t).getTimezoneOffset(); - switch (e) { - case "O": - case "OO": - case "OOO": - return "GMT" + dn(i, ":"); - default: - return "GMT" + vn(i, ":"); - } - }, - z: function (t, e, n, r) { - var i = (r._originalDate || t).getTimezoneOffset(); - switch (e) { - case "z": - case "zz": - case "zzz": - return "GMT" + dn(i, ":"); - default: - return "GMT" + vn(i, ":"); - } - }, - t: function (t, e, n, r) { - var i = r._originalDate || t; - return Ge(Math.floor(i.getTime() / 1e3), e.length); - }, - T: function (t, e, n, r) { - return Ge((r._originalDate || t).getTime(), e.length); - }, - }; - function dn(t, e) { - var n = t > 0 ? "-" : "+", - r = Math.abs(t), - i = Math.floor(r / 60), - a = r % 60; - if (0 === a) return n + String(i); - var o = e || ""; - return n + String(i) + o + Ge(a, 2); - } - function fn(t, e) { - return t % 60 == 0 - ? (t > 0 ? "-" : "+") + Ge(Math.abs(t) / 60, 2) - : vn(t, e); - } - function vn(t, e) { - var n = e || "", - r = t > 0 ? "-" : "+", - i = Math.abs(t); - return r + Ge(Math.floor(i / 60), 2) + n + Ge(i % 60, 2); - } - var gn = ln; - function pn(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" }); - } - } - function yn(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" }); - } - } - function mn(t, e) { - var n, - r = t.match(/(P+)(p+)?/), - i = r[1], - a = r[2]; - if (!a) return pn(t, e); - switch (i) { - case "P": - n = e.dateTime({ width: "short" }); - break; - case "PP": - n = e.dateTime({ width: "medium" }); - break; - case "PPP": - n = e.dateTime({ width: "long" }); - break; - default: - n = e.dateTime({ width: "full" }); - } - return n.replace("{{date}}", pn(i, e)).replace("{{time}}", yn(a, e)); - } - var wn = { p: yn, P: mn }, - bn = wn, - kn = ["D", "DD"], - Tn = ["YY", "YYYY"]; - function xn(t) { - return -1 !== kn.indexOf(t); - } - function Cn(t) { - return -1 !== Tn.indexOf(t); - } - function An(t, e, n) { - if ("YYYY" === t) - throw new RangeError( - "Use `yyyy` instead of `YYYY` (in `" - .concat(e, "`) for formatting years to the input `") - .concat(n, "`; see: https://git.io/fxCyr"), - ); - if ("YY" === t) - throw new RangeError( - "Use `yy` instead of `YY` (in `" - .concat(e, "`) for formatting years to the input `") - .concat(n, "`; see: https://git.io/fxCyr"), - ); - if ("D" === t) - throw new RangeError( - "Use `d` instead of `D` (in `" - .concat(e, "`) for formatting days of the month to the input `") - .concat(n, "`; see: https://git.io/fxCyr"), - ); - if ("DD" === t) - throw new RangeError( - "Use `dd` instead of `DD` (in `" - .concat(e, "`) for formatting days of the month to the input `") - .concat(n, "`; see: https://git.io/fxCyr"), - ); - } - var Dn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, - En = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, - Sn = /^'([^]*?)'?$/, - On = /''/g, - Pn = /[a-zA-Z]/; - function Rn(t, e, n) { - Vt(2, arguments); - var r = String(e), - i = n || {}, - a = i.locale || Qe, - o = a.options && a.options.firstWeekContainsDate, - u = null == o ? 1 : Zt(o), - s = null == i.firstWeekContainsDate ? u : Zt(i.firstWeekContainsDate); - if (!(s >= 1 && s <= 7)) - throw new RangeError( - "firstWeekContainsDate must be between 1 and 7 inclusively", - ); - var c = a.options && a.options.weekStartsOn, - h = null == c ? 0 : Zt(c), - l = null == i.weekStartsOn ? h : Zt(i.weekStartsOn); - if (!(l >= 0 && l <= 6)) - throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); - if (!a.localize) - throw new RangeError("locale must contain localize property"); - if (!a.formatLong) - throw new RangeError("locale must contain formatLong property"); - var d = te(t); - if (!ie(d)) throw new RangeError("Invalid time value"); - var f = ne(d), - v = Be(d, f), - g = { - firstWeekContainsDate: s, - weekStartsOn: l, - locale: a, - _originalDate: d, - }, - p = r - .match(En) - .map(function (t) { - var e = t[0]; - return "p" === e || "P" === e ? (0, bn[e])(t, a.formatLong, g) : t; - }) - .join("") - .match(Dn) - .map(function (n) { - if ("''" === n) return "'"; - var r = n[0]; - if ("'" === r) return Un(n); - var o = gn[r]; - if (o) - return ( - !i.useAdditionalWeekYearTokens && Cn(n) && An(n, e, t), - !i.useAdditionalDayOfYearTokens && xn(n) && An(n, e, t), - o(v, n, a.localize, g) - ); - if (r.match(Pn)) - throw new RangeError( - "Format string contains an unescaped latin alphabet character `" + - r + - "`", - ); - return n; - }) - .join(""); - return p; - } - function Un(t) { - return t.match(Sn)[1].replace(On, "'"); - } - function Mn(t, e) { - if (null == t) - throw new TypeError( - "assign requires that input parameter not be null or undefined", - ); - for (var n in (e = e || {})) - Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); - return t; - } - function jn(t, e, n) { - Vt(2, arguments); - var r = n || {}, - i = r.locale, - a = i && i.options && i.options.weekStartsOn, - o = null == a ? 0 : Zt(a), - u = null == r.weekStartsOn ? o : Zt(r.weekStartsOn); - if (!(u >= 0 && u <= 6)) - throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); - var s = te(t), - c = Zt(e), - h = s.getUTCDay(), - l = c % 7, - d = (l + 7) % 7, - f = (d < u ? 7 : 0) + c - h; - return s.setUTCDate(s.getUTCDate() + f), s; - } - function qn(t, e) { - Vt(2, arguments); - var n = Zt(e); - n % 7 == 0 && (n -= 7); - var r = 1, - i = te(t), - a = i.getUTCDay(), - o = n % 7, - u = (o + 7) % 7, - s = (u < r ? 7 : 0) + n - a; - return i.setUTCDate(i.getUTCDate() + s), i; - } - function $n(t, e) { - Vt(2, arguments); - var n = te(t), - r = Zt(e), - i = rn(n) - r; - return n.setUTCDate(n.getUTCDate() - 7 * i), n; - } - function Nn(t, e, n) { - Vt(2, arguments); - var r = te(t), - i = Zt(e), - a = cn(r, n) - i; - return r.setUTCDate(r.getUTCDate() - 7 * a), r; - } - var Hn = 36e5, - Yn = 6e4, - Ln = 1e3, - Fn = { - month: /^(1[0-2]|0?\d)/, - date: /^(3[0-1]|[0-2]?\d)/, - dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, - week: /^(5[0-3]|[0-4]?\d)/, - hour23h: /^(2[0-3]|[0-1]?\d)/, - hour24h: /^(2[0-4]|[0-1]?\d)/, - hour11h: /^(1[0-1]|0?\d)/, - hour12h: /^(1[0-2]|0?\d)/, - minute: /^[0-5]?\d/, - second: /^[0-5]?\d/, - singleDigit: /^\d/, - twoDigits: /^\d{1,2}/, - threeDigits: /^\d{1,3}/, - fourDigits: /^\d{1,4}/, - anyDigitsSigned: /^-?\d+/, - singleDigitSigned: /^-?\d/, - twoDigitsSigned: /^-?\d{1,2}/, - threeDigitsSigned: /^-?\d{1,3}/, - fourDigitsSigned: /^-?\d{1,4}/, - }, - _n = { - basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/, - basic: /^([+-])(\d{2})(\d{2})|Z/, - basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, - extended: /^([+-])(\d{2}):(\d{2})|Z/, - extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/, - }; - function Wn(t, e, n) { - var r = e.match(t); - if (!r) return null; - var i = parseInt(r[0], 10); - return { value: n ? n(i) : i, rest: e.slice(r[0].length) }; - } - function zn(t, e) { - var n = e.match(t); - if (!n) return null; - if ("Z" === n[0]) return { value: 0, rest: e.slice(1) }; - var r = "+" === n[1] ? 1 : -1, - i = n[2] ? parseInt(n[2], 10) : 0, - a = n[3] ? parseInt(n[3], 10) : 0, - o = n[5] ? parseInt(n[5], 10) : 0; - return { - value: r * (i * Hn + a * Yn + o * Ln), - rest: e.slice(n[0].length), - }; - } - function In(t, e) { - return Wn(Fn.anyDigitsSigned, t, e); - } - function Qn(t, e, n) { - switch (t) { - case 1: - return Wn(Fn.singleDigit, e, n); - case 2: - return Wn(Fn.twoDigits, e, n); - case 3: - return Wn(Fn.threeDigits, e, n); - case 4: - return Wn(Fn.fourDigits, e, n); - default: - return Wn(new RegExp("^\\d{1," + t + "}"), e, n); - } - } - function Bn(t, e, n) { - switch (t) { - case 1: - return Wn(Fn.singleDigitSigned, e, n); - case 2: - return Wn(Fn.twoDigitsSigned, e, n); - case 3: - return Wn(Fn.threeDigitsSigned, e, n); - case 4: - return Wn(Fn.fourDigitsSigned, e, n); - default: - return Wn(new RegExp("^-?\\d{1," + t + "}"), e, n); - } - } - function Gn(t) { - switch (t) { - case "morning": - return 4; - case "evening": - return 17; - case "pm": - case "noon": - case "afternoon": - return 12; - default: - return 0; - } - } - function Xn(t, e) { - var n, - r = e > 0, - i = r ? e : 1 - e; - if (i <= 50) n = t || 100; - else { - var a = i + 50; - n = t + 100 * Math.floor(a / 100) - (t >= a % 100 ? 100 : 0); - } - return r ? n : 1 - n; - } - var Kn = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], - Jn = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - function Zn(t) { - return t % 400 == 0 || (t % 4 == 0 && t % 100 != 0); - } - var Vn = { - G: { - priority: 140, - parse: function (t, e, n, r) { - switch (e) { - case "G": - case "GG": - case "GGG": - return ( - n.era(t, { width: "abbreviated" }) || - n.era(t, { width: "narrow" }) - ); - case "GGGGG": - return n.era(t, { width: "narrow" }); - default: - return ( - n.era(t, { width: "wide" }) || - n.era(t, { width: "abbreviated" }) || - n.era(t, { width: "narrow" }) - ); - } - }, - set: function (t, e, n, r) { - return ( - (e.era = n), t.setUTCFullYear(n, 0, 1), t.setUTCHours(0, 0, 0, 0), t - ); - }, - incompatibleTokens: ["R", "u", "t", "T"], - }, - y: { - priority: 130, - parse: function (t, e, n, r) { - var i = function (t) { - return { year: t, isTwoDigitYear: "yy" === e }; - }; - switch (e) { - case "y": - return Qn(4, t, i); - case "yo": - return n.ordinalNumber(t, { unit: "year", valueCallback: i }); - default: - return Qn(e.length, t, i); - } - }, - validate: function (t, e, n) { - return e.isTwoDigitYear || e.year > 0; - }, - set: function (t, e, n, r) { - var i = t.getUTCFullYear(); - if (n.isTwoDigitYear) { - var a = Xn(n.year, i); - return t.setUTCFullYear(a, 0, 1), t.setUTCHours(0, 0, 0, 0), t; - } - var o = "era" in e && 1 !== e.era ? 1 - n.year : n.year; - return t.setUTCFullYear(o, 0, 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"], - }, - Y: { - priority: 130, - parse: function (t, e, n, r) { - var i = function (t) { - return { year: t, isTwoDigitYear: "YY" === e }; - }; - switch (e) { - case "Y": - return Qn(4, t, i); - case "Yo": - return n.ordinalNumber(t, { unit: "year", valueCallback: i }); - default: - return Qn(e.length, t, i); - } - }, - validate: function (t, e, n) { - return e.isTwoDigitYear || e.year > 0; - }, - set: function (t, e, n, r) { - var i = on(t, r); - if (n.isTwoDigitYear) { - var a = Xn(n.year, i); - return ( - t.setUTCFullYear(a, 0, r.firstWeekContainsDate), - t.setUTCHours(0, 0, 0, 0), - an(t, r) - ); - } - var o = "era" in e && 1 !== e.era ? 1 - n.year : n.year; - return ( - t.setUTCFullYear(o, 0, r.firstWeekContainsDate), - t.setUTCHours(0, 0, 0, 0), - an(t, r) - ); - }, - incompatibleTokens: [ - "y", - "R", - "u", - "Q", - "q", - "M", - "L", - "I", - "d", - "D", - "i", - "t", - "T", - ], - }, - R: { - priority: 130, - parse: function (t, e, n, r) { - return Bn("R" === e ? 4 : e.length, t); - }, - set: function (t, e, n, r) { - var i = new Date(0); - return i.setUTCFullYear(n, 0, 4), i.setUTCHours(0, 0, 0, 0), Ve(i); - }, - incompatibleTokens: [ - "G", - "y", - "Y", - "u", - "Q", - "q", - "M", - "L", - "w", - "d", - "D", - "e", - "c", - "t", - "T", - ], - }, - u: { - priority: 130, - parse: function (t, e, n, r) { - return Bn("u" === e ? 4 : e.length, t); - }, - set: function (t, e, n, r) { - return t.setUTCFullYear(n, 0, 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "G", - "y", - "Y", - "R", - "w", - "I", - "i", - "e", - "c", - "t", - "T", - ], - }, - Q: { - priority: 120, - parse: function (t, e, n, r) { - switch (e) { - case "Q": - case "QQ": - return Qn(e.length, t); - case "Qo": - return n.ordinalNumber(t, { unit: "quarter" }); - case "QQQ": - return ( - n.quarter(t, { width: "abbreviated", context: "formatting" }) || - n.quarter(t, { width: "narrow", context: "formatting" }) - ); - case "QQQQQ": - return n.quarter(t, { width: "narrow", context: "formatting" }); - default: - return ( - n.quarter(t, { width: "wide", context: "formatting" }) || - n.quarter(t, { width: "abbreviated", context: "formatting" }) || - n.quarter(t, { width: "narrow", context: "formatting" }) - ); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 4; - }, - set: function (t, e, n, r) { - return t.setUTCMonth(3 * (n - 1), 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "Y", - "R", - "q", - "M", - "L", - "w", - "I", - "d", - "D", - "i", - "e", - "c", - "t", - "T", - ], - }, - q: { - priority: 120, - parse: function (t, e, n, r) { - switch (e) { - case "q": - case "qq": - return Qn(e.length, t); - case "qo": - return n.ordinalNumber(t, { unit: "quarter" }); - case "qqq": - return ( - n.quarter(t, { width: "abbreviated", context: "standalone" }) || - n.quarter(t, { width: "narrow", context: "standalone" }) - ); - case "qqqqq": - return n.quarter(t, { width: "narrow", context: "standalone" }); - default: - return ( - n.quarter(t, { width: "wide", context: "standalone" }) || - n.quarter(t, { width: "abbreviated", context: "standalone" }) || - n.quarter(t, { width: "narrow", context: "standalone" }) - ); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 4; - }, - set: function (t, e, n, r) { - return t.setUTCMonth(3 * (n - 1), 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "Y", - "R", - "Q", - "M", - "L", - "w", - "I", - "d", - "D", - "i", - "e", - "c", - "t", - "T", - ], - }, - M: { - priority: 110, - parse: function (t, e, n, r) { - var i = function (t) { - return t - 1; - }; - switch (e) { - case "M": - return Wn(Fn.month, t, i); - case "MM": - return Qn(2, t, i); - case "Mo": - return n.ordinalNumber(t, { unit: "month", valueCallback: i }); - case "MMM": - return ( - n.month(t, { width: "abbreviated", context: "formatting" }) || - n.month(t, { width: "narrow", context: "formatting" }) - ); - case "MMMMM": - return n.month(t, { width: "narrow", context: "formatting" }); - default: - return ( - n.month(t, { width: "wide", context: "formatting" }) || - n.month(t, { width: "abbreviated", context: "formatting" }) || - n.month(t, { width: "narrow", context: "formatting" }) - ); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 11; - }, - set: function (t, e, n, r) { - return t.setUTCMonth(n, 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "Y", - "R", - "q", - "Q", - "L", - "w", - "I", - "D", - "i", - "e", - "c", - "t", - "T", - ], - }, - L: { - priority: 110, - parse: function (t, e, n, r) { - var i = function (t) { - return t - 1; - }; - switch (e) { - case "L": - return Wn(Fn.month, t, i); - case "LL": - return Qn(2, t, i); - case "Lo": - return n.ordinalNumber(t, { unit: "month", valueCallback: i }); - case "LLL": - return ( - n.month(t, { width: "abbreviated", context: "standalone" }) || - n.month(t, { width: "narrow", context: "standalone" }) - ); - case "LLLLL": - return n.month(t, { width: "narrow", context: "standalone" }); - default: - return ( - n.month(t, { width: "wide", context: "standalone" }) || - n.month(t, { width: "abbreviated", context: "standalone" }) || - n.month(t, { width: "narrow", context: "standalone" }) - ); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 11; - }, - set: function (t, e, n, r) { - return t.setUTCMonth(n, 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "Y", - "R", - "q", - "Q", - "M", - "w", - "I", - "D", - "i", - "e", - "c", - "t", - "T", - ], - }, - w: { - priority: 100, - parse: function (t, e, n, r) { - switch (e) { - case "w": - return Wn(Fn.week, t); - case "wo": - return n.ordinalNumber(t, { unit: "week" }); - default: - return Qn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 53; - }, - set: function (t, e, n, r) { - return an(Nn(t, n, r), r); - }, - incompatibleTokens: [ - "y", - "R", - "u", - "q", - "Q", - "M", - "L", - "I", - "d", - "D", - "i", - "t", - "T", - ], - }, - I: { - priority: 100, - parse: function (t, e, n, r) { - switch (e) { - case "I": - return Wn(Fn.week, t); - case "Io": - return n.ordinalNumber(t, { unit: "week" }); - default: - return Qn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 53; - }, - set: function (t, e, n, r) { - return Ve($n(t, n, r), r); - }, - incompatibleTokens: [ - "y", - "Y", - "u", - "q", - "Q", - "M", - "L", - "w", - "d", - "D", - "e", - "c", - "t", - "T", - ], - }, - d: { - priority: 90, - subPriority: 1, - parse: function (t, e, n, r) { - switch (e) { - case "d": - return Wn(Fn.date, t); - case "do": - return n.ordinalNumber(t, { unit: "date" }); - default: - return Qn(e.length, t); - } - }, - validate: function (t, e, n) { - var r = Zn(t.getUTCFullYear()), - i = t.getUTCMonth(); - return r ? e >= 1 && e <= Jn[i] : e >= 1 && e <= Kn[i]; - }, - set: function (t, e, n, r) { - return t.setUTCDate(n), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "Y", - "R", - "q", - "Q", - "w", - "I", - "D", - "i", - "e", - "c", - "t", - "T", - ], - }, - D: { - priority: 90, - subPriority: 1, - parse: function (t, e, n, r) { - switch (e) { - case "D": - case "DD": - return Wn(Fn.dayOfYear, t); - case "Do": - return n.ordinalNumber(t, { unit: "date" }); - default: - return Qn(e.length, t); - } - }, - validate: function (t, e, n) { - return Zn(t.getUTCFullYear()) - ? e >= 1 && e <= 366 - : e >= 1 && e <= 365; - }, - set: function (t, e, n, r) { - return t.setUTCMonth(0, n), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "Y", - "R", - "q", - "Q", - "M", - "L", - "w", - "I", - "d", - "E", - "i", - "e", - "c", - "t", - "T", - ], - }, - E: { - priority: 90, - parse: function (t, e, n, r) { - switch (e) { - case "E": - case "EE": - case "EEE": - return ( - n.day(t, { width: "abbreviated", context: "formatting" }) || - n.day(t, { width: "short", context: "formatting" }) || - n.day(t, { width: "narrow", context: "formatting" }) - ); - case "EEEEE": - return n.day(t, { width: "narrow", context: "formatting" }); - case "EEEEEE": - return ( - n.day(t, { width: "short", context: "formatting" }) || - n.day(t, { width: "narrow", context: "formatting" }) - ); - default: - return ( - n.day(t, { width: "wide", context: "formatting" }) || - n.day(t, { width: "abbreviated", context: "formatting" }) || - n.day(t, { width: "short", context: "formatting" }) || - n.day(t, { width: "narrow", context: "formatting" }) - ); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 6; - }, - set: function (t, e, n, r) { - return (t = jn(t, n, r)).setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ["D", "i", "e", "c", "t", "T"], - }, - e: { - priority: 90, - parse: function (t, e, n, r) { - var i = function (t) { - var e = 7 * Math.floor((t - 1) / 7); - return ((t + r.weekStartsOn + 6) % 7) + e; - }; - switch (e) { - case "e": - case "ee": - return Qn(e.length, t, i); - case "eo": - return n.ordinalNumber(t, { unit: "day", valueCallback: i }); - case "eee": - return ( - n.day(t, { width: "abbreviated", context: "formatting" }) || - n.day(t, { width: "short", context: "formatting" }) || - n.day(t, { width: "narrow", context: "formatting" }) - ); - case "eeeee": - return n.day(t, { width: "narrow", context: "formatting" }); - case "eeeeee": - return ( - n.day(t, { width: "short", context: "formatting" }) || - n.day(t, { width: "narrow", context: "formatting" }) - ); - default: - return ( - n.day(t, { width: "wide", context: "formatting" }) || - n.day(t, { width: "abbreviated", context: "formatting" }) || - n.day(t, { width: "short", context: "formatting" }) || - n.day(t, { width: "narrow", context: "formatting" }) - ); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 6; - }, - set: function (t, e, n, r) { - return (t = jn(t, n, r)).setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "y", - "R", - "u", - "q", - "Q", - "M", - "L", - "I", - "d", - "D", - "E", - "i", - "c", - "t", - "T", - ], - }, - c: { - priority: 90, - parse: function (t, e, n, r) { - var i = function (t) { - var e = 7 * Math.floor((t - 1) / 7); - return ((t + r.weekStartsOn + 6) % 7) + e; - }; - switch (e) { - case "c": - case "cc": - return Qn(e.length, t, i); - case "co": - return n.ordinalNumber(t, { unit: "day", valueCallback: i }); - case "ccc": - return ( - n.day(t, { width: "abbreviated", context: "standalone" }) || - n.day(t, { width: "short", context: "standalone" }) || - n.day(t, { width: "narrow", context: "standalone" }) - ); - case "ccccc": - return n.day(t, { width: "narrow", context: "standalone" }); - case "cccccc": - return ( - n.day(t, { width: "short", context: "standalone" }) || - n.day(t, { width: "narrow", context: "standalone" }) - ); - default: - return ( - n.day(t, { width: "wide", context: "standalone" }) || - n.day(t, { width: "abbreviated", context: "standalone" }) || - n.day(t, { width: "short", context: "standalone" }) || - n.day(t, { width: "narrow", context: "standalone" }) - ); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 6; - }, - set: function (t, e, n, r) { - return (t = jn(t, n, r)).setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "y", - "R", - "u", - "q", - "Q", - "M", - "L", - "I", - "d", - "D", - "E", - "i", - "e", - "t", - "T", - ], - }, - i: { - priority: 90, - parse: function (t, e, n, r) { - var i = function (t) { - return 0 === t ? 7 : t; - }; - switch (e) { - case "i": - case "ii": - return Qn(e.length, t); - case "io": - return n.ordinalNumber(t, { unit: "day" }); - case "iii": - return ( - n.day(t, { - width: "abbreviated", - context: "formatting", - valueCallback: i, - }) || - n.day(t, { - width: "short", - context: "formatting", - valueCallback: i, - }) || - n.day(t, { - width: "narrow", - context: "formatting", - valueCallback: i, - }) - ); - case "iiiii": - return n.day(t, { - width: "narrow", - context: "formatting", - valueCallback: i, - }); - case "iiiiii": - return ( - n.day(t, { - width: "short", - context: "formatting", - valueCallback: i, - }) || - n.day(t, { - width: "narrow", - context: "formatting", - valueCallback: i, - }) - ); - default: - return ( - n.day(t, { - width: "wide", - context: "formatting", - valueCallback: i, - }) || - n.day(t, { - width: "abbreviated", - context: "formatting", - valueCallback: i, - }) || - n.day(t, { - width: "short", - context: "formatting", - valueCallback: i, - }) || - n.day(t, { - width: "narrow", - context: "formatting", - valueCallback: i, - }) - ); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 7; - }, - set: function (t, e, n, r) { - return (t = qn(t, n, r)).setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "y", - "Y", - "u", - "q", - "Q", - "M", - "L", - "w", - "d", - "D", - "E", - "e", - "c", - "t", - "T", - ], - }, - a: { - priority: 80, - parse: function (t, e, n, r) { - switch (e) { - case "a": - case "aa": - case "aaa": - return ( - n.dayPeriod(t, { - width: "abbreviated", - context: "formatting", - }) || n.dayPeriod(t, { width: "narrow", context: "formatting" }) - ); - case "aaaaa": - return n.dayPeriod(t, { width: "narrow", context: "formatting" }); - default: - return ( - n.dayPeriod(t, { width: "wide", context: "formatting" }) || - n.dayPeriod(t, { - width: "abbreviated", - context: "formatting", - }) || - n.dayPeriod(t, { width: "narrow", context: "formatting" }) - ); - } - }, - set: function (t, e, n, r) { - return t.setUTCHours(Gn(n), 0, 0, 0), t; - }, - incompatibleTokens: ["b", "B", "H", "K", "k", "t", "T"], - }, - b: { - priority: 80, - parse: function (t, e, n, r) { - switch (e) { - case "b": - case "bb": - case "bbb": - return ( - n.dayPeriod(t, { - width: "abbreviated", - context: "formatting", - }) || n.dayPeriod(t, { width: "narrow", context: "formatting" }) - ); - case "bbbbb": - return n.dayPeriod(t, { width: "narrow", context: "formatting" }); - default: - return ( - n.dayPeriod(t, { width: "wide", context: "formatting" }) || - n.dayPeriod(t, { - width: "abbreviated", - context: "formatting", - }) || - n.dayPeriod(t, { width: "narrow", context: "formatting" }) - ); - } - }, - set: function (t, e, n, r) { - return t.setUTCHours(Gn(n), 0, 0, 0), t; - }, - incompatibleTokens: ["a", "B", "H", "K", "k", "t", "T"], - }, - B: { - priority: 80, - parse: function (t, e, n, r) { - switch (e) { - case "B": - case "BB": - case "BBB": - return ( - n.dayPeriod(t, { - width: "abbreviated", - context: "formatting", - }) || n.dayPeriod(t, { width: "narrow", context: "formatting" }) - ); - case "BBBBB": - return n.dayPeriod(t, { width: "narrow", context: "formatting" }); - default: - return ( - n.dayPeriod(t, { width: "wide", context: "formatting" }) || - n.dayPeriod(t, { - width: "abbreviated", - context: "formatting", - }) || - n.dayPeriod(t, { width: "narrow", context: "formatting" }) - ); - } - }, - set: function (t, e, n, r) { - return t.setUTCHours(Gn(n), 0, 0, 0), t; - }, - incompatibleTokens: ["a", "b", "t", "T"], - }, - h: { - priority: 70, - parse: function (t, e, n, r) { - switch (e) { - case "h": - return Wn(Fn.hour12h, t); - case "ho": - return n.ordinalNumber(t, { unit: "hour" }); - default: - return Qn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 12; - }, - set: function (t, e, n, r) { - var i = t.getUTCHours() >= 12; - return ( - i && n < 12 - ? t.setUTCHours(n + 12, 0, 0, 0) - : i || 12 !== n - ? t.setUTCHours(n, 0, 0, 0) - : t.setUTCHours(0, 0, 0, 0), - t - ); - }, - incompatibleTokens: ["H", "K", "k", "t", "T"], - }, - H: { - priority: 70, - parse: function (t, e, n, r) { - switch (e) { - case "H": - return Wn(Fn.hour23h, t); - case "Ho": - return n.ordinalNumber(t, { unit: "hour" }); - default: - return Qn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 23; - }, - set: function (t, e, n, r) { - return t.setUTCHours(n, 0, 0, 0), t; - }, - incompatibleTokens: ["a", "b", "h", "K", "k", "t", "T"], - }, - K: { - priority: 70, - parse: function (t, e, n, r) { - switch (e) { - case "K": - return Wn(Fn.hour11h, t); - case "Ko": - return n.ordinalNumber(t, { unit: "hour" }); - default: - return Qn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 11; - }, - set: function (t, e, n, r) { - return ( - t.getUTCHours() >= 12 && n < 12 - ? t.setUTCHours(n + 12, 0, 0, 0) - : t.setUTCHours(n, 0, 0, 0), - t - ); - }, - incompatibleTokens: ["a", "b", "h", "H", "k", "t", "T"], - }, - k: { - priority: 70, - parse: function (t, e, n, r) { - switch (e) { - case "k": - return Wn(Fn.hour24h, t); - case "ko": - return n.ordinalNumber(t, { unit: "hour" }); - default: - return Qn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 24; - }, - set: function (t, e, n, r) { - var i = n <= 24 ? n % 24 : n; - return t.setUTCHours(i, 0, 0, 0), t; - }, - incompatibleTokens: ["a", "b", "h", "H", "K", "t", "T"], - }, - m: { - priority: 60, - parse: function (t, e, n, r) { - switch (e) { - case "m": - return Wn(Fn.minute, t); - case "mo": - return n.ordinalNumber(t, { unit: "minute" }); - default: - return Qn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 59; - }, - set: function (t, e, n, r) { - return t.setUTCMinutes(n, 0, 0), t; - }, - incompatibleTokens: ["t", "T"], - }, - s: { - priority: 50, - parse: function (t, e, n, r) { - switch (e) { - case "s": - return Wn(Fn.second, t); - case "so": - return n.ordinalNumber(t, { unit: "second" }); - default: - return Qn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 59; - }, - set: function (t, e, n, r) { - return t.setUTCSeconds(n, 0), t; - }, - incompatibleTokens: ["t", "T"], - }, - S: { - priority: 30, - parse: function (t, e, n, r) { - return Qn(e.length, t, function (t) { - return Math.floor(t * Math.pow(10, 3 - e.length)); - }); - }, - set: function (t, e, n, r) { - return t.setUTCMilliseconds(n), t; - }, - incompatibleTokens: ["t", "T"], - }, - X: { - priority: 10, - parse: function (t, e, n, r) { - switch (e) { - case "X": - return zn(_n.basicOptionalMinutes, t); - case "XX": - return zn(_n.basic, t); - case "XXXX": - return zn(_n.basicOptionalSeconds, t); - case "XXXXX": - return zn(_n.extendedOptionalSeconds, t); - default: - return zn(_n.extended, t); - } - }, - set: function (t, e, n, r) { - return e.timestampIsSet ? t : new Date(t.getTime() - n); - }, - incompatibleTokens: ["t", "T", "x"], - }, - x: { - priority: 10, - parse: function (t, e, n, r) { - switch (e) { - case "x": - return zn(_n.basicOptionalMinutes, t); - case "xx": - return zn(_n.basic, t); - case "xxxx": - return zn(_n.basicOptionalSeconds, t); - case "xxxxx": - return zn(_n.extendedOptionalSeconds, t); - default: - return zn(_n.extended, t); - } - }, - set: function (t, e, n, r) { - return e.timestampIsSet ? t : new Date(t.getTime() - n); - }, - incompatibleTokens: ["t", "T", "X"], - }, - t: { - priority: 40, - parse: function (t, e, n, r) { - return In(t); - }, - set: function (t, e, n, r) { - return [new Date(1e3 * n), { timestampIsSet: !0 }]; - }, - incompatibleTokens: "*", - }, - T: { - priority: 20, - parse: function (t, e, n, r) { - return In(t); - }, - set: function (t, e, n, r) { - return [new Date(n), { timestampIsSet: !0 }]; - }, - incompatibleTokens: "*", - }, - }, - tr = Vn, - er = 10, - nr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, - rr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, - ir = /^'([^]*?)'?$/, - ar = /''/g, - or = /\S/, - ur = /[a-zA-Z]/; - function sr(t, e, n, r) { - Vt(3, arguments); - var i = String(t), - a = String(e), - o = r || {}, - u = o.locale || Qe; - if (!u.match) throw new RangeError("locale must contain match property"); - var s = u.options && u.options.firstWeekContainsDate, - c = null == s ? 1 : Zt(s), - h = null == o.firstWeekContainsDate ? c : Zt(o.firstWeekContainsDate); - if (!(h >= 1 && h <= 7)) - throw new RangeError( - "firstWeekContainsDate must be between 1 and 7 inclusively", - ); - var l = u.options && u.options.weekStartsOn, - d = null == l ? 0 : Zt(l), - f = null == o.weekStartsOn ? d : Zt(o.weekStartsOn); - if (!(f >= 0 && f <= 6)) - throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); - if ("" === a) return "" === i ? te(n) : new Date(NaN); - var v, - g = { firstWeekContainsDate: h, weekStartsOn: f, locale: u }, - p = [{ priority: er, subPriority: -1, set: cr, index: 0 }], - y = a - .match(rr) - .map(function (t) { - var e = t[0]; - return "p" === e || "P" === e ? (0, bn[e])(t, u.formatLong, g) : t; - }) - .join("") - .match(nr), - m = []; - for (v = 0; v < y.length; v++) { - var w = y[v]; - !o.useAdditionalWeekYearTokens && Cn(w) && An(w, a, t), - !o.useAdditionalDayOfYearTokens && xn(w) && An(w, a, t); - var b = w[0], - k = tr[b]; - if (k) { - var T = k.incompatibleTokens; - if (Array.isArray(T)) { - for (var x = void 0, C = 0; C < m.length; C++) { - var A = m[C].token; - if (-1 !== T.indexOf(A) || A === b) { - x = m[C]; - break; - } - } - if (x) - throw new RangeError( - "The format string mustn't contain `" - .concat(x.fullToken, "` and `") - .concat(w, "` at the same time"), - ); - } else if ("*" === k.incompatibleTokens && m.length) - throw new RangeError( - "The format string mustn't contain `".concat( - w, - "` and any other token at the same time", - ), - ); - m.push({ token: b, fullToken: w }); - var D = k.parse(i, w, u.match, g); - if (!D) return new Date(NaN); - p.push({ - priority: k.priority, - subPriority: k.subPriority || 0, - set: k.set, - validate: k.validate, - value: D.value, - index: p.length, - }), - (i = D.rest); - } else { - if (b.match(ur)) - throw new RangeError( - "Format string contains an unescaped latin alphabet character `" + - b + - "`", - ); - if ( - ("''" === w ? (w = "'") : "'" === b && (w = hr(w)), - 0 !== i.indexOf(w)) - ) - return new Date(NaN); - i = i.slice(w.length); - } - } - if (i.length > 0 && or.test(i)) return new Date(NaN); - var E = p - .map(function (t) { - return t.priority; - }) - .sort(function (t, e) { - return e - t; - }) - .filter(function (t, e, n) { - return n.indexOf(t) === e; - }) - .map(function (t) { - return p - .filter(function (e) { - return e.priority === t; - }) - .sort(function (t, e) { - return e.subPriority - t.subPriority; - }); - }) - .map(function (t) { - return t[0]; - }), - S = te(n); - if (isNaN(S)) return new Date(NaN); - var O = Be(S, ne(S)), - P = {}; - for (v = 0; v < E.length; v++) { - var R = E[v]; - if (R.validate && !R.validate(O, R.value, g)) return new Date(NaN); - var U = R.set(O, P, R.value, g); - U[0] ? ((O = U[0]), Mn(P, U[1])) : (O = U); - } - return O; - } - function cr(t, e) { - if (e.timestampIsSet) return t; - var n = new Date(0); - return ( - n.setFullYear(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()), - n.setHours( - t.getUTCHours(), - t.getUTCMinutes(), - t.getUTCSeconds(), - t.getUTCMilliseconds(), - ), - n - ); - } - function hr(t) { - return t.match(ir)[1].replace(ar, "'"); - } - var lr = (function (t) { - l(n, t); - var e = m(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return u(this, n), e.call(this, t, r, "store-hour", i); - } - return ( - c(n, [ - { - 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, - n = Math.abs(t - e); - return Math.floor(n / 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 sr(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 sr(t, e ? "HH:mm:ss" : "HH:mm", new Date()); - }, - }, - { - key: "humanReadableHoursRange", - get: function () { - return ie(this.startDateInstance) && ie(this.endDateInstance) - ? "" - .concat(Rn(this.startDateInstance, "p"), " - ") - .concat(Rn(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!"); - }, - }, - ]), - n - ); - })(Nt), - dr = (function (t) { - l(n, t); - var e = m(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return u(this, n), e.call(this, t, r, "store-location", i); - } - return ( - c(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 at( - this.getAttribute("hours").map(function (t) { - return new lr(t); - }), - ); - }, - }, - { - key: "isAlwaysOpen", - get: function () { - return this.hours.every(function (t) { - return null == t ? void 0 : t.is24Hours; - }); - }, - }, - { - key: "today", - get: function () { - var t = Rn(new Date(), "EEEE"); - return this.schedule[t]; - }, - }, - { - key: "schedule", - get: function () { - for ( - var t = {}, - e = [ - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - "Sunday", - ], - n = 0; - n < e.length; - n++ - ) { - t[e[n]] = new at(); - } - for (var r = 0; r < this.hours.length; r++) { - var i = this.hours.objectAt(r); - t[i.day].pushObject(i); - } - return t; - }, - }, - { - 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!"); - }, - }, - ]), - n - ); - })(Nt), - fr = (function (t) { - l(n, t); - var e = m(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return u(this, n), e.call(this, t, r, "payment-gateway", i); - } - return ( - c(n, [ - { - 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!", - ); - }, - }, - ]), - n - ); - })(Nt), - vr = (function (t) { - l(n, t); - var e = m(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return u(this, n), e.call(this, t, r, "store", i); - } - return ( - c(n, [ - { - key: "getReviews", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return this.adapter - .get("reviews", a({ store: this.id }, e)) - .then(function (e) { - return new at( - e.map(function (e) { - return new Yt(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", a({ store: this.id }, e)) - .then(function (e) { - return new at( - e.map(function (e) { - return ( - e.place && (e.place = new kt(e.place)), - new dr(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 dr(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 at( - e.map(function (e) { - return new fr(e, t.adapter); - }), - ); - }); - }, - }, - { - key: "getPaymentGateway", - value: function (t) { - var e = this; - return this.adapter.get("gateways/".concat(t)).then(function (t) { - return new fr(t, e.adapter); - }); - }, - }, - ]), - n - ); - })(Nt), - gr = (function (t) { - l(n, t); - var e = m(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return u(this, n), e.call(this, t, r, "network", i); - } - return ( - c(n, [ - { - key: "getTags", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return this.adapter.get("tags", t); - }, - }, - { - key: "getStores", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return this.adapter.get("stores", e).then(function (e) { - return new at( - e.map(function (e) { - return new vr(e, t.adapter); - }), - ); - }); - }, - }, - { - key: "getStoreLocations", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return this.adapter.get("store-locations", e).then(function (e) { - return new at( - e.map(function (e) { - return new dr(e, t.adapter); - }), - ); - }); - }, - }, - { - key: "getPaymentGateways", - value: function () { - var t = this; - return this.adapter.get("gateways").then(function (e) { - return new at( - e.map(function (e) { - return new fr(e, t.adapter); - }), - ); - }); - }, - }, - ]), - n - ); - })(Nt), - pr = Array.isArray, - yr = (function (t) { - l(n, t); - var e = m(n); - function n() { - var t, - r = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - i = arguments.length > 1 ? arguments[1] : void 0, - a = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return ( - u(this, n), - r instanceof xt - ? y(t, (t = e.call(this, {}, r, "service-quote", a))) - : e.call(this, r, i, "service-quote", a) - ); - } - return ( - c( - n, - [ - { - key: "setAdapter", - value: function (t) { - var e; - return ( - (this.adapter = t), - (this.store = new Cr(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, - n = t.currency; - return zt(e) || zt(n) ? null : _t(e / 100, n); - }, - }, - { - key: "fromCart", - value: function (t, e, r) { - var i, - a, - o, - u = this, - s = - arguments.length > 3 && void 0 !== arguments[3] - ? arguments[3] - : "storefront", - c = - arguments.length > 4 && - void 0 !== arguments[4] && - arguments[4]; - return ( - null !== (i = t) && void 0 !== i && i.id && (t = t.id), - null !== (a = e) && void 0 !== a && a.id && (e = e.id), - null !== (o = r) && void 0 !== o && o.id && (r = r.id), - this.adapter - .get("service-quotes/from-cart", { - origin: t, - destination: e, - cart: r, - config: s, - all: c, - }) - .then(function (t) { - return pr(t) - ? new at( - t.map(function (t) { - return new n(t, u.adapter); - }), - ) - : new n(t, u.adapter); - }) - ); - }, - }, - ], - [ - { - key: "getFromCart", - value: function (t) { - for ( - var e = new n(t), - r = arguments.length, - i = new Array(r > 1 ? r - 1 : 0), - a = 1; - a < r; - a++ - ) - i[a - 1] = arguments[a]; - return e.fromCart.apply(e, i); - }, - }, - ], - ), - n - ); - })(Tt), - mr = new pt({ - create: void 0, - findAll: void 0, - query: void 0, - queryRecord: void 0, - initialize: function (t, e, n, r) { - var i = - arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {}, - o = - arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : {}; - return ( - st(t) && (t = t.id), - st(e) && (e = e.id), - st(n) && (n = n.id), - st(r) && (r = r.getAttribute("code")), - this.adapter.get( - "".concat(this.namespace, "/before"), - a( - a({}, i), - {}, - { customer: t, cart: e, serviceQuote: n, gateway: r }, - ), - o, - ) - ); - }, - captureOrder: function (t) { - var e = - 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: e }, - n, - ) - .then(function (t) { - return new wt(t); - }); - }, - }), - wr = (function (t) { - l(n, t); - var e = m(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return u(this, n), e.call(this, t, r, "checkout", i); - } - return ( - c(n, [ - { - 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); - }, - }, - ]), - n - ); - })(Nt), - br = { - Product: It, - Category: Qt, - Customer: Gt, - Cart: Jt, - DeliveryServiceQuote: yr, - Store: vr, - StoreLocation: dr, - StoreHour: lr, - Checkout: wr, - Review: Yt, - }, - kr = { BrowserAdapter: Ct, NodeAdapter: At }, - Tr = (function () { - function t() { - return ( - u(this, t), - (this.resources = br), - (this.adapters = kr), - this.lookup.apply(this, arguments) - ); - } - return ( - c(t, [ - { - key: "lookup", - value: function (t, e) { - var n = St(t), - r = Array.prototype.slice.call(arguments).slice(2); - if (!this[n]) - throw new Error("Attempted to resolve invalid type"); - if (!this[n][e]) - throw new Error( - "No ".concat(Ot(t), " named ").concat(e, " to resolve"), - ); - return g(this[n][e], w(r)); - }, - }, - ]), - t - ); - })(), - xr = function () { - return g(Tr, Array.prototype.slice.call(arguments)); - }, - Cr = (function (t) { - l(n, t); - var e = m(n); - function n() { - return u(this, n), e.apply(this, arguments); - } - return ( - c(n, [ - { - key: "extendActions", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : []; - return qt(this, t); - }, - }, - { - key: "serialize", - value: function (t) { - return xr("resource", Pt(this.resource), t, this.adapter); - }, - }, - ]), - n - ); - })($t), - Ar = (function () { - function t(e) { - var n = - arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; - if ( - (u(this, t), - (this.version = n.version || "v1"), - (this.options = { - version: this.version, - host: n.host || "https://api.fleetbase.io", - namespace: "storefront/".concat(this.version) || n.namespace, - publicKey: e, - debug: r, - }), - !Wt(e)) - ) - throw new Error("⚠️ Invalid Storefront key given to Storefront SDK"); - (this.adapter = n.adapter || Lt(this.options)), - (this.products = new Cr("product", this.adapter)), - (this.categories = new Cr("category", this.adapter)), - (this.reviews = new Cr("review", this.adapter).extendActions(Ht)), - (this.customers = new Cr("customer", this.adapter).extendActions(Bt)), - (this.cart = new Cr("cart", this.adapter).extendActions(Kt)), - (this.checkout = new Cr("checkout", this.adapter).extendActions(mr)); - } - return ( - c( - 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", a({ query: t }, e)) - .then(function (t) { - return new at( - t.map(function (t) { - return new It(t); - }), - ); - }); - }, - }, - { - key: "setAdapter", - value: function (t) { - this.adapter = t; - }, - }, - { - key: "getAdapter", - value: function () { - return this.adapter; - }, - }, - ], - [ - { - key: "newInstance", - value: function () { - return g(t, Array.prototype.slice.call(arguments)); - }, - }, - ], - ), - t - ); - })(); - (t.Cart = Jt), - (t.Category = Qt), - (t.Checkout = wr), - (t.Customer = Gt), - (t.DeliveryServiceQuote = yr), - (t.Network = gr), - (t.PaymentGateway = fr), - (t.Product = It), - (t.Review = Yt), - (t.Store = vr), - (t.StoreHour = lr), - (t.StoreLocation = dr), - (t.default = Ar); -}); +!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 n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function r(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:{},n={};return t&&(n.store=t),this.adapter.get("".concat(this.namespace,"/count"),n,e)}}),b=function(t){c(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,r,"review",a)}return s(n,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),n}(p);function k(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:n}).format(t)}var x=function(t){c(r,t);var n=m(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,r),n.call(this,t,e,"product",a)}return s(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"]),n=t.price,r=t.sale_price,a=t.currency;return this.isOnSale?e.isEmpty(r)||e.isEmpty(a)?null:k(r/100,a):e.isEmpty(n)||e.isEmpty(a)?null:k(n/100,a)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(n){return new e.Collection(n.map((function(e){return new b(e,t.adapter)})))}))}}]),r}(p),T=function(t){c(r,t);var n=m(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,r),n.call(this,t,e,"category",a)}return s(r,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(n){return new e.Collection(n.map((function(e){return new x(e,t.adapter)})))}))}}]),r}(p),M=new e.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)}}),D=function(t){c(a,t);var n=m(a);function a(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,a),n.call(this,t,e,"customer",r({actions:M},i))}return s(a,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ce(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:function(t){var e=this;return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",t).then((function(){return e}))}},{key:"getSavedPlaces",value:function(){var t=this;return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/places").then((function(n){return new e.Collection(n.map((function(n){return new e.Place(n,t.adapter)})))}))}},{key:"getOrderHistory",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/orders",n).then((function(n){return new e.Collection(n.map((function(n){return new e.Order(n,t.adapter)})))}))}}]),a}(p),P=Array.isArray,S=new e.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,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),r(r({},a),{},{quantity:n}),o).then(this.afterFetch.bind(this))},update:function(t,e,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),r(r({},a),{},{quantity:n}),o).then(this.afterFetch.bind(this))},remove:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},n).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)}}),O=function(t){c(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,a,"cart",r({actions:S},i))}return s(n,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof x&&(t=t.id),this.store.add(this.id,t,e,n,r)}},{key:"update",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,n,r)}},{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!P(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),n}(p),A=function(t){c(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,r,"payment-gateway",a)}return s(n,[{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!")}}]),n}(p);function E(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 H(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function q(t,e){const n=E(t);return isNaN(e)?H(t,NaN):e?(n.setDate(n.getDate()+e),n):n}const Y=6048e5,C=864e5;let N={};function W(){return N}function j(t,e){const n=W(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=E(t),o=a.getDay(),i=(o=a.getTime()?n+1:e.getTime()>=i.getTime()?n:n-1}function L(t){const e=E(t);return e.setHours(0,0,0,0),e}function Q(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 I(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 n=E(t);return!isNaN(Number(n))}const G={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 B(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const X={date:B({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:B({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:B({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},z={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function _(t){return(e,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,a=n?.width?String(n.width):e;r=t.formattingValues[a]||t.formattingValues[e]}else{const e=t.defaultWidth,a=n?.width?String(n.width):t.defaultWidth;r=t.values[a]||t.values[e]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function $(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;const i=o[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let n=0;nt.test(i))):function(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var K;const U={code:"en-US",formatDistance:(t,e,n)=>{let r;const a=G[t];return r="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:X,formatRelative:(t,e,n,r)=>z[t],localize:{ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:_({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:_({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:_({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:_({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:_({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:(K={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const n=t.match(K.matchPattern);if(!n)return null;const r=n[0],a=t.match(K.parsePattern);if(!a)return null;let o=K.valueCallback?K.valueCallback(a[0]):a[0];return o=e.valueCallback?e.valueCallback(o):o,{value:o,rest:t.slice(r.length)}}),era:$({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:$({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:$({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:$({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:$({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 J(t){const e=E(t),n=function(t,e){const n=L(t),r=L(e),a=n.getTime()-Q(n),o=r.getTime()-Q(r);return Math.round((a-o)/C)}(e,function(t){const e=E(t),n=H(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}(e));return n+1}function V(t){const e=E(t),n=R(e).getTime()-function(t){const e=F(t),n=H(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),R(n)}(e).getTime();return Math.round(n/Y)+1}function Z(t,e){const n=E(t),r=n.getFullYear(),a=W(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=H(t,0);i.setFullYear(r+1,0,o),i.setHours(0,0,0,0);const s=j(i,e),u=H(t,0);u.setFullYear(r,0,o),u.setHours(0,0,0,0);const c=j(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function tt(t,e){const n=E(t),r=j(n,e).getTime()-function(t,e){const n=W(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=Z(t,e),o=H(t,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),j(o,e)}(n,e).getTime();return Math.round(r/Y)+1}function et(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const nt={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return et("yy"===e?r%100:r,e.length)},M(t,e){const n=t.getMonth();return"M"===e?String(n+1):et(n+1,2)},d:(t,e)=>et(t.getDate(),e.length),a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(t,e)=>et(t.getHours()%12||12,e.length),H:(t,e)=>et(t.getHours(),e.length),m:(t,e)=>et(t.getMinutes(),e.length),s:(t,e)=>et(t.getSeconds(),e.length),S(t,e){const n=e.length,r=t.getMilliseconds();return et(Math.floor(r*Math.pow(10,n-3)),e.length)}},rt="midnight",at="noon",ot="morning",it="afternoon",st="evening",ut="night",ct={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){const e=t.getFullYear(),r=e>0?e:1-e;return n.ordinalNumber(r,{unit:"year"})}return nt.y(t,e)},Y:function(t,e,n,r){const a=Z(t,r),o=a>0?a:1-a;if("YY"===e){return et(o%100,2)}return"Yo"===e?n.ordinalNumber(o,{unit:"year"}):et(o,e.length)},R:function(t,e){return et(F(t),e.length)},u:function(t,e){return et(t.getFullYear(),e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return et(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return et(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return nt.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return et(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=tt(t,r);return"wo"===e?n.ordinalNumber(a,{unit:"week"}):et(a,e.length)},I:function(t,e,n){const r=V(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):et(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getDate(),{unit:"date"}):nt.d(t,e)},D:function(t,e,n){const r=J(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):et(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return et(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return et(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=0===r?7:r;switch(e){case"i":return String(a);case"ii":return et(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(a=12===r?at:0===r?rt:r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(a=r>=17?st:r>=12?it:r>=4?ot:ut,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),n.ordinalNumber(e,{unit:"hour"})}return nt.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getHours(),{unit:"hour"}):nt.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):et(r,e.length)},k:function(t,e,n){let r=t.getHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):et(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):nt.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getSeconds(),{unit:"second"}):nt.s(t,e)},S:function(t,e){return nt.S(t,e)},X:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return lt(a);case"XXXX":case"XX":return ht(a);default:return ht(a,":")}},x:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return lt(a);case"xxxx":case"xx":return ht(a);default:return ht(a,":")}},O:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+dt(a,":");default:return"GMT"+ht(a,":")}},z:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+dt(a,":");default:return"GMT"+ht(a,":")}},t:function(t,e,n,r){const a=r._originalDate||t;return et(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,n,r){return et((r._originalDate||t).getTime(),e.length)}};function dt(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.floor(r/60),o=r%60;return 0===o?n+String(a):n+String(a)+e+et(o,2)}function lt(t,e){if(t%60==0){return(t>0?"-":"+")+et(Math.abs(t)/60,2)}return ht(t,e)}function ht(t,e=""){const n=t>0?"-":"+",r=Math.abs(t);return n+et(Math.floor(r/60),2)+e+et(r%60,2)}const ft=(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"})}},gt=(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"})}},mt={p:gt,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return ft(t,e);let o;switch(r){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}}",ft(r,e)).replace("{{time}}",gt(a,e))}},wt=["D","DD"],yt=["YY","YYYY"];function pt(t){return-1!==wt.indexOf(t)}function vt(t){return-1!==yt.indexOf(t)}function bt(t,e,n){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${n}\`; 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 \`${n}\`; 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 \`${n}\`; 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 \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const kt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Tt=/^'([^]*?)'?$/,Mt=/''/g,Dt=/[a-zA-Z]/;function Pt(t,e,n){const r=W(),a=n?.locale??r.locale??U,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=E(t);if(!I(s))throw new RangeError("Invalid time value");const u={firstWeekContainsDate:o,weekStartsOn:i,locale:a,_originalDate:s};return e.match(xt).map((function(t){const e=t[0];if("p"===e||"P"===e){return(0,mt[e])(t,a.formatLong)}return t})).join("").match(kt).map((function(r){if("''"===r)return"'";const o=r[0];if("'"===o)return function(t){const e=t.match(Tt);if(!e)return t;return e[1].replace(Mt,"'")}(r);const i=ct[o];if(i)return!n?.useAdditionalWeekYearTokens&&vt(r)&&bt(r,e,String(t)),!n?.useAdditionalDayOfYearTokens&&pt(r)&&bt(r,e,String(t)),i(s,r,a.localize,u);if(o.match(Dt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}class St{subPriority=0;validate(t,e){return!0}}class Ot extends St{constructor(t,e,n,r,a){super(),this.value=t,this.validateValue=e,this.setValue=n,this.priority=r,a&&(this.subPriority=a)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,n){return this.setValue(t,e,this.value,n)}}class At extends St{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:H(t,function(t,e){const n=e instanceof Date?H(e,0):new e(0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),n}(t,Date))}}class Et{run(t,e,n,r){const a=this.parse(t,e,n,r);return a?{setter:new Ot(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(t,e,n){return!0}}const Ht=/^(1[0-2]|0?\d)/,qt=/^(3[0-1]|[0-2]?\d)/,Yt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Ct=/^(5[0-3]|[0-4]?\d)/,Nt=/^(2[0-3]|[0-1]?\d)/,Wt=/^(2[0-4]|[0-1]?\d)/,jt=/^(1[0-1]|0?\d)/,Rt=/^(1[0-2]|0?\d)/,Ft=/^[0-5]?\d/,Lt=/^[0-5]?\d/,Qt=/^\d/,It=/^\d{1,2}/,Gt=/^\d{1,3}/,Bt=/^\d{1,4}/,Xt=/^-?\d+/,zt=/^-?\d/,_t=/^-?\d{1,2}/,$t=/^-?\d{1,3}/,Kt=/^-?\d{1,4}/,Ut=/^([+-])(\d{2})(\d{2})?|Z/,Jt=/^([+-])(\d{2})(\d{2})|Z/,Vt=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,Zt=/^([+-])(\d{2}):(\d{2})|Z/,te=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function ee(t,e){return t?{value:e(t.value),rest:t.rest}:t}function ne(t,e){const n=e.match(t);return n?{value:parseInt(n[0],10),rest:e.slice(n[0].length)}:null}function re(t,e){const n=e.match(t);if(!n)return null;if("Z"===n[0])return{value:0,rest:e.slice(1)};return{value:("+"===n[1]?1:-1)*(36e5*(n[2]?parseInt(n[2],10):0)+6e4*(n[3]?parseInt(n[3],10):0)+1e3*(n[5]?parseInt(n[5],10):0)),rest:e.slice(n[0].length)}}function ae(t){return ne(Xt,t)}function oe(t,e){switch(t){case 1:return ne(Qt,e);case 2:return ne(It,e);case 3:return ne(Gt,e);case 4:return ne(Bt,e);default:return ne(new RegExp("^\\d{1,"+t+"}"),e)}}function ie(t,e){switch(t){case 1:return ne(zt,e);case 2:return ne(_t,e);case 3:return ne($t,e);case 4:return ne(Kt,e);default:return ne(new RegExp("^-?\\d{1,"+t+"}"),e)}}function se(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function ue(t,e){const n=e>0,r=n?e:1-e;let a;if(r<=50)a=t||100;else{const e=r+50;a=t+100*Math.floor(e/100)-(t>=e%100?100:0)}return n?a:1-a}function ce(t){return t%400==0||t%4==0&&t%100!=0}const de=[31,28,31,30,31,30,31,31,30,31,30,31],le=[31,29,31,30,31,30,31,31,30,31,30,31];function he(t,e,n){const r=W(),a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=E(t),i=o.getDay(),s=7-a;return q(o,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function fe(t,e){const n=E(t),r=function(t){let e=E(t).getDay();return 0===e&&(e=7),e}(n);return q(n,e-r)}const ge={G:new class extends Et{priority=140;parse(t,e,n){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}}set(t,e,n){return e.era=n,t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Et{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,n){const r=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return ee(oe(4,t),r);case"yo":return ee(n.ordinalNumber(t,{unit:"year"}),r);default:return ee(oe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n){const r=t.getFullYear();if(n.isTwoDigitYear){const e=ue(n.year,r);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const a="era"in e&&1!==e.era?1-n.year:n.year;return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Et{priority=130;parse(t,e,n){const r=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return ee(oe(4,t),r);case"Yo":return ee(n.ordinalNumber(t,{unit:"year"}),r);default:return ee(oe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n,r){const a=Z(t,r);if(n.isTwoDigitYear){const e=ue(n.year,a);return t.setFullYear(e,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),j(t,r)}const o="era"in e&&1!==e.era?1-n.year:n.year;return t.setFullYear(o,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),j(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Et{priority=130;parse(t,e){return ie("R"===e?4:e.length,t)}set(t,e,n){const r=H(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),R(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Et{priority=130;parse(t,e){return ie("u"===e?4:e.length,t)}set(t,e,n){return t.setFullYear(n,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 Et{priority=120;parse(t,e,n){switch(e){case"Q":case"QQ":return oe(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth(3*(n-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 Et{priority=120;parse(t,e,n){switch(e){case"q":case"qq":return oe(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth(3*(n-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 Et{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,n){const r=t=>t-1;switch(e){case"M":return ee(ne(Ht,t),r);case"MM":return ee(oe(2,t),r);case"Mo":return ee(n.ordinalNumber(t,{unit:"month"}),r);case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}},L:new class extends Et{priority=110;parse(t,e,n){const r=t=>t-1;switch(e){case"L":return ee(ne(Ht,t),r);case"LL":return ee(oe(2,t),r);case"Lo":return ee(n.ordinalNumber(t,{unit:"month"}),r);case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,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 Et{priority=100;parse(t,e,n){switch(e){case"w":return ne(Ct,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return oe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n,r){return j(function(t,e,n){const r=E(t),a=tt(r,n)-e;return r.setDate(r.getDate()-7*a),r}(t,n,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Et{priority=100;parse(t,e,n){switch(e){case"I":return ne(Ct,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return oe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n){return R(function(t,e){const n=E(t),r=V(n)-e;return n.setDate(n.getDate()-7*r),n}(t,n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Et{priority=90;subPriority=1;parse(t,e,n){switch(e){case"d":return ne(qt,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return oe(e.length,t)}}validate(t,e){const n=ce(t.getFullYear()),r=t.getMonth();return n?e>=1&&e<=le[r]:e>=1&&e<=de[r]}set(t,e,n){return t.setDate(n),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Et{priority=90;subpriority=1;parse(t,e,n){switch(e){case"D":case"DD":return ne(Yt,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return oe(e.length,t)}}validate(t,e){return ce(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,n){return t.setMonth(0,n),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 Et{priority=90;parse(t,e,n){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=he(t,n,r)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Et{priority=90;parse(t,e,n,r){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return ee(oe(e.length,t),a);case"eo":return ee(n.ordinalNumber(t,{unit:"day"}),a);case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=he(t,n,r)).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 Et{priority=90;parse(t,e,n,r){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return ee(oe(e.length,t),a);case"co":return ee(n.ordinalNumber(t,{unit:"day"}),a);case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=he(t,n,r)).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 Et{priority=90;parse(t,e,n){const r=t=>0===t?7:t;switch(e){case"i":case"ii":return oe(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return ee(n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return ee(n.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return ee(n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r);default:return ee(n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,e){return e>=1&&e<=7}set(t,e,n){return(t=fe(t,n)).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 Et{priority=80;parse(t,e,n){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(se(n),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Et{priority=80;parse(t,e,n){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(se(n),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Et{priority=80;parse(t,e,n){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(se(n),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Et{priority=70;parse(t,e,n){switch(e){case"h":return ne(Rt,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return oe(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,n){const r=t.getHours()>=12;return r&&n<12?t.setHours(n+12,0,0,0):r||12!==n?t.setHours(n,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Et{priority=70;parse(t,e,n){switch(e){case"H":return ne(Nt,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return oe(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,n){return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Et{priority=70;parse(t,e,n){switch(e){case"K":return ne(jt,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return oe(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.getHours()>=12&&n<12?t.setHours(n+12,0,0,0):t.setHours(n,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Et{priority=70;parse(t,e,n){switch(e){case"k":return ne(Wt,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return oe(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,n){const r=n<=24?n%24:n;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Et{priority=60;parse(t,e,n){switch(e){case"m":return ne(Ft,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return oe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setMinutes(n,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Et{priority=50;parse(t,e,n){switch(e){case"s":return ne(Lt,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return oe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setSeconds(n,0),t}incompatibleTokens=["t","T"]},S:new class extends Et{priority=30;parse(t,e){return ee(oe(e.length,t),(t=>Math.floor(t*Math.pow(10,3-e.length))))}set(t,e,n){return t.setMilliseconds(n),t}incompatibleTokens=["t","T"]},X:new class extends Et{priority=10;parse(t,e){switch(e){case"X":return re(Ut,t);case"XX":return re(Jt,t);case"XXXX":return re(Vt,t);case"XXXXX":return re(te,t);default:return re(Zt,t)}}set(t,e,n){return e.timestampIsSet?t:H(t,t.getTime()-Q(t)-n)}incompatibleTokens=["t","T","x"]},x:new class extends Et{priority=10;parse(t,e){switch(e){case"x":return re(Ut,t);case"xx":return re(Jt,t);case"xxxx":return re(Vt,t);case"xxxxx":return re(te,t);default:return re(Zt,t)}}set(t,e,n){return e.timestampIsSet?t:H(t,t.getTime()-Q(t)-n)}incompatibleTokens=["t","T","X"]},t:new class extends Et{priority=40;parse(t){return ae(t)}set(t,e,n){return[H(t,1e3*n),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Et{priority=20;parse(t){return ae(t)}set(t,e,n){return[H(t,n),{timestampIsSet:!0}]}incompatibleTokens="*"}},me=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,we=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ye=/^'([^]*?)'?$/,pe=/''/g,ve=/\S/,be=/[a-zA-Z]/;function ke(t,e,n,r){const a=Object.assign({},W()),o=r?.locale??a.locale??U,i=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(""===e)return""===t?E(n):H(n,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:o},c=[new At],d=e.match(we).map((t=>{const e=t[0];if(e in mt){return(0,mt[e])(t,o.formatLong)}return t})).join("").match(me),l=[];for(let a of d){!r?.useAdditionalWeekYearTokens&&vt(a)&&bt(a,e,t),!r?.useAdditionalDayOfYearTokens&&pt(a)&&bt(a,e,t);const i=a[0],s=ge[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 \`${a}\` at the same time`)}else if("*"===s.incompatibleTokens&&l.length>0)throw new RangeError(`The format string mustn't contain \`${a}\` and any other token at the same time`);l.push({token:i,fullToken:a});const r=s.run(t,a,o.match,u);if(!r)return H(n,NaN);c.push(r.setter),t=r.rest}else{if(i.match(be))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");if("''"===a?a="'":"'"===i&&(a=a.match(ye)[1].replace(pe,"'")),0!==t.indexOf(a))return H(n,NaN);t=t.slice(a.length)}}if(t.length>0&&ve.test(t))return H(n,NaN);const h=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,n)=>n.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=E(n);if(isNaN(f.getTime()))return H(n,NaN);const g={};for(const t of h){if(!t.validate(f,u))return H(n,NaN);const e=t.set(f,g,u);Array.isArray(e)?(f=e[0],Object.assign(g,e[1])):f=e}return H(n,f)}var xe=function(t){c(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,r,"store-hour",a)}return s(n,[{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,n=Math.abs(t-e);return Math.floor(n/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 ke(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 ke(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return I(this.startDateInstance)&&I(this.endDateInstance)?"".concat(Pt(this.startDateInstance,"p")," - ").concat(Pt(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!")}}]),n}(p),Te=function(t){c(r,t);var n=m(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,r),n.call(this,t,e,"store-location",a)}return s(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 e.Collection(this.getAttribute("hours").map((function(t){return new xe(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=Pt(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},n=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],r=0;r0&&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 o(this,a),n.call(this,t,e,"store",r)}return s(a,[{key:"getReviews",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",r({store:this.id},n)).then((function(n){return new e.Collection(n.map((function(e){return new b(e,t.adapter)})))}))}},{key:"getLocations",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",r({store:this.id},n)).then((function(n){return new e.Collection(n.map((function(n){return n.place&&(n.place=new e.Place(n.place)),new Te(n,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 Te(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",n).then((function(n){return new e.Collection(n.map((function(e){return new A(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new A(t,e.adapter)}))}}]),a}(p),De=function(t){c(r,t);var n=m(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,r),n.call(this,t,e,"network",a)}return s(r,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getStores",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("stores",n).then((function(n){return new e.Collection(n.map((function(e){return new Me(e,t.adapter)})))}))}},{key:"getStoreLocations",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("store-locations",n).then((function(n){return new e.Collection(n.map((function(e){return new Te(e,t.adapter)})))}))}},{key:"getPaymentGateways",value:function(){var t=this;return this.adapter.get("gateways").then((function(n){return new e.Collection(n.map((function(e){return new A(e,t.adapter)})))}))}}]),r}(p),Pe=Array.isArray,Se=function(t){c(r,t);var n=m(r);function r(){var t,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,r),a instanceof e.Adapter?g(t,t=n.call(this,{},a,"service-quote",s)):n.call(this,a,i,"service-quote",s)}return s(r,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ce(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"]),n=t.amount,r=t.currency;return e.isEmpty(n)||e.isEmpty(r)?null:k(n/100,r)}},{key:"fromCart",value:function(t,n,a){var o,i,s,u=this,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"storefront",d=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return null!==(o=t)&&void 0!==o&&o.id&&(t=t.id),null!==(i=n)&&void 0!==i&&i.id&&(n=n.id),null!==(s=a)&&void 0!==s&&s.id&&(a=a.id),this.adapter.get("service-quotes/from-cart",{origin:t,destination:n,cart:a,config:c,all:d}).then((function(t){return Pe(t)?new e.Collection(t.map((function(t){return new r(t,u.adapter)}))):new r(t,u.adapter)}))}}],[{key:"getFromCart",value:function(t){for(var e=new r(t),n=arguments.length,a=new Array(n>1?n-1:0),o=1;o4&&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(n)&&(n=n.id),e.isResource(a)&&(a=a.id),e.isResource(o)&&(o=o.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),r(r({},i),{},{customer:t,cart:n,serviceQuote:a,gateway:o}),s)},captureOrder:function(t){var n=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:n},r).then((function(t){return new e.Order(t)}))}}),Ae=function(t){c(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,r,"checkout",a)}return s(n,[{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)}}]),n}(p),Ee={Product:x,Category:T,Customer:D,Cart:O,DeliveryServiceQuote:Se,Store:Me,StoreLocation:Te,StoreHour:xe,Checkout:Ae,Review:b},He={BrowserAdapter:e.BrowserAdapter,NodeAdapter:e.NodeAdapter},qe=function(){function t(){return o(this,t),this.resources=Ee,this.adapters=He,this.lookup.apply(this,arguments)}return s(t,[{key:"lookup",value:function(t,n){var r=e.pluralize(t),a=Array.prototype.slice.call(arguments).slice(2);if(!this[r])throw new Error("Attempted to resolve invalid type");if(!this[r][n])throw new Error("No ".concat(e.singularize(t)," named ").concat(n," to resolve"));return f(this[r][n],w(a))}}]),t}(),Ye=function(){return f(qe,Array.prototype.slice.call(arguments))},Ce=function(t){c(r,t);var n=m(r);function r(){return o(this,r),n.apply(this,arguments)}return s(r,[{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 Ye("resource",e.classify(this.resource),t,this.adapter)}}]),r}(e.Store),Ne=function(){function t(n){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(o(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:n,debug:i},!("string"==typeof(r=n)&&r.length>30&&(r.startsWith("store_")||r.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 e.isNodeEnvironment()?Ye("adapter","NodeAdapter",t):Ye("adapter","BrowserAdapter",t)}(this.options),this.products=new Ce("product",this.adapter),this.categories=new Ce("category",this.adapter),this.reviews=new Ce("review",this.adapter).extendActions(v),this.customers=new Ce("customer",this.adapter).extendActions(M),this.cart=new Ce("cart",this.adapter).extendActions(S),this.checkout=new Ce("checkout",this.adapter).extendActions(Oe)}return s(t,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"search",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",r({query:t},n)).then((function(t){return new e.Collection(t.map((function(t){return new x(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return f(t,Array.prototype.slice.call(arguments))}}]),t}();t.Cart=O,t.Category=T,t.Checkout=Ae,t.Customer=D,t.DeliveryServiceQuote=Se,t.Network=De,t.PaymentGateway=A,t.Product=x,t.Review=b,t.Store=Me,t.StoreHour=xe,t.StoreLocation=Te,t.default=Ne})); //# sourceMappingURL=storefront.min.js.map diff --git a/dist/@fleetbase/storefront.min.js.map b/dist/@fleetbase/storefront.min.js.map index 332e684..991e401 100644 --- a/dist/@fleetbase/storefront.min.js.map +++ b/dist/@fleetbase/storefront.min.js.map @@ -1 +1 @@ -{"version":3,"file":"storefront.min.js","sources":["../../node_modules/@fleetbase/sdk/dist/esm/fleetbase.js","../../src/resource.js","../../src/resources/review.js","../../src/utils/detect-adapter.js","../../src/utils/is-phone.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/resources/cart.js","../../node_modules/date-fns/esm/_lib/toInteger/index.js","../../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../../node_modules/date-fns/esm/toDate/index.js","../../node_modules/date-fns/esm/addMilliseconds/index.js","../../node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js","../../node_modules/date-fns/esm/isDate/index.js","../../node_modules/date-fns/esm/isValid/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js","../../node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js","../../node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js","../../node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js","../../node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/match/index.js","../../node_modules/date-fns/esm/locale/en-US/index.js","../../node_modules/date-fns/esm/subMilliseconds/index.js","../../node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","../../node_modules/date-fns/esm/_lib/format/lightFormatters/index.js","../../node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js","../../node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js","../../node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js","../../node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js","../../node_modules/date-fns/esm/_lib/getUTCWeek/index.js","../../node_modules/date-fns/esm/_lib/format/formatters/index.js","../../node_modules/date-fns/esm/_lib/format/longFormatters/index.js","../../node_modules/date-fns/esm/_lib/protectedTokens/index.js","../../node_modules/date-fns/esm/format/index.js","../../node_modules/date-fns/esm/_lib/assign/index.js","../../node_modules/date-fns/esm/_lib/setUTCDay/index.js","../../node_modules/date-fns/esm/_lib/setUTCISODay/index.js","../../node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js","../../node_modules/date-fns/esm/_lib/setUTCWeek/index.js","../../node_modules/date-fns/esm/parse/_lib/parsers/index.js","../../node_modules/date-fns/esm/parse/index.js","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/payment-gateway.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"],"sourcesContent":["import t from\"axios\";function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:[];if(A(t))if(r.length<=6e4)t.splice.apply(t,[e,n].concat(m(r)));else{t.splice(e,n);for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:0,r=t.length,i=n;i2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=t.length;n<0&&(n+=i);var o=r&&e!=e?function(t){return t!=t}:function(t){return t===e};return S(t,o,n)},F=function(t,e,n){return $(t,e,0,[n]),n},D=function(t){h(n,g(Array));var e=y(n);function n(){for(var t=arguments.length,r=new Array(t),i=0;i0}},{key:\"empty\",get:function(){return 0===this.length}},{key:\"first\",get:function(){return j(this,0)}},{key:\"last\",get:function(){return j(this,this.length-1)}},{key:\"replace\",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return $(this,t,e,n),this}},{key:\"objectsAt\",value:function(t){var e=this;return t.map((function(t){return j(e,t)}))}},{key:\"objectAt\",value:function(t){return j(this,t)}},{key:\"indexOf\",value:function(t,e){return L(this,t,e,!1)}},{key:\"lastIndexOf\",value:function(t,e){var n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(var r=e;r>=0;r--)if(j(this,r)===t)return r;return-1}},{key:\"includes\",value:function(t,e){return-1!==L(this,t,e,!0)}},{key:\"findBy\",value:function(){return _(this,O.apply(void 0,arguments))}},{key:\"findIndexBy\",value:function(){return S(this,O.apply(void 0,arguments))}},{key:\"isEvery\",value:function(){return z(this,O.apply(void 0,arguments))}},{key:\"isAny\",value:function(){return P(this,O.apply(void 0,arguments))}},{key:\"invoke\",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:R,n=[],r=new Set,i=\"function\"==typeof e?e:function(t){return get(t,e)};return t.forEach((function(t){var e=i(t);r.has(e)||(r.add(e),n.push(t))})),n}(this,t)}},{key:\"without\",value:function(t){if(!this.includes(t))return this;var e=t==t?function(e){return e!==t}:function(t){return t==t};return this.filter(e)}},{key:\"clear\",value:function(){var t=this.length;return 0===t||this.replace(0,t,[]),this}},{key:\"insertAt\",value:function(t,e){return F(this,t,e),this}},{key:\"replaceAt\",value:function(t,e){return this.replace(t,1,[e])}},{key:\"removeAt\",value:function(t,e){return function(t,e){return $(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,[]),t}(this,t,e)}},{key:\"pushObject\",value:function(t){return this.insertAt(this.length,t)}},{key:\"pushObjects\",value:function(t){return this.replace(this.length,0,t),this}},{key:\"popObject\",value:function(){var t=this.length;if(0===t)return null;var e=j(this,t-1);return this.removeAt(t-1,1),e}},{key:\"shiftObject\",value:function(){if(0===this.length)return null;var t=j(this,0);return this.removeAt(0),t}},{key:\"unshiftObject\",value:function(t){return F(this,0,t)}},{key:\"unshiftObjects\",value:function(t){return this.replace(0,0,t),this}},{key:\"reverseObjects\",value:function(){var t=this.length;if(0===t)return this;var e=this.toArray().reverse();return this.replace(0,t,e),this}},{key:\"setObjects\",value:function(t){if(0===t.length)return this.clear();var e=this.length;return this.replace(0,e,t),this}},{key:\"removeObject\",value:function(t){for(var e=this.length||0;--e>=0;){j(this,e)===t&&this.removeAt(e)}return this}},{key:\"removeObjects\",value:function(t){for(var e=t.length-1;e>=0;e--)this.removeObject(t[e]);return this}},{key:\"addObject\",value:function(t){return this.includes(t)||this.pushObject(t),this}},{key:\"addObjects\",value:function(t){var e=this;return t.forEach((function(t){return e.addObject(t)})),this}}]),n}(),C=function(t){var e=null==t;if(e)return e;if(\"number\"==typeof t.size)return!t.size;var n=r(t);if(\"object\"===n){var i=t.size;if(\"number\"==typeof i)return!i}if(\"number\"==typeof t.length&&\"function\"!==n)return!t.length;if(\"object\"===n){var o=t.length;if(\"number\"==typeof o)return!o}return!1},T=function(t){return C(t)||\"string\"==typeof t&&!1===/\\S/.test(t)};function N(t){return isFinite(t)&&Math.abs(t)<=90}function q(t){return isFinite(t)&&Math.abs(t)<=180&&Math.abs(t)>=90}function B(t){return t instanceof Y}var U=function(){var t,e,n,i,o;return!(\"undefined\"==typeof process||\"object\"!==r(null===(t=process)||void 0===t?void 0:t.env)&&-1===(null===(e=process.release)||void 0===e||null===(n=e.name)||void 0===n?void 0:n.search(/node|io.js/))||\"undefined\"!=typeof window&&\"ReactNative\"!==(null===(i=window)||void 0===i||null===(o=i.navigator)||void 0===o?void 0:o.product))},I=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U()?Rt(\"adapter\",\"NodeAdapter\",t):Rt(\"adapter\",\"BrowserAdapter\",t)},J=Array.isArray,K=function(){function t(e){s(this,t),this.place=e,this.geometry=null==e?void 0:e.geometry,this.components=this.parseComponents(),this.attributes=this.parseProperties()}return a(t,[{key:\"parse\",value:function(){this.parseComponents(),this.parseProperties()}},{key:\"parseComponents\",value:function(){var t;return((null===(t=this.place)||void 0===t?void 0:t.address_components)||[]).reduce((function(t,e){return e.types.forEach((function(n){t[n]=e})),t}),{})}},{key:\"parseProperties\",value:function(){var t,e={streetNumber:this.get(\"street_number\"),streetName:this.get(\"route\"),coordinates:null!==(t=this.geometry)&&void 0!==t&&t.location?Object.values(this.geometry.location):[0,0],city:this.or([\"locality\",\"sublocality\",\"sublocality_level_1\",\"neighborhood\",\"administrative_area_level_3\",\"administrative_area_level_2\"]),county:this.get(\"administrative_area_level_2\"),stateShort:this.get(\"administrative_area_level_1\",!0),stateLong:this.get(\"administrative_area_level_1\"),countryShort:this.get(\"country\",!0),country:this.get(\"country\",!0),countryLong:this.get(\"country\"),postalCode:this.get(\"postal_code\")};return e.address=[e.streetNumber,e.streetName].filter(Boolean).join(\" \"),e}},{key:\"all\",value:function(){return this.attributes}},{key:\"or\",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=0;e1&&void 0!==arguments[1]&&arguments[1];return t in this.components?e?this.components[t].short_name:this.components[t].long_name:null}},{key:\"setAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.attributes=n(n({},this.attributes),t),this}},{key:\"setAttribute\",value:function(t,e){return this.attributes[t]=e,this}},{key:\"getAttribute\",value:function(t){return this.attributes[t]||null}}]),t}(),M=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s(this,t),this.type=\"Point\",this.coordinates=[n,e]}return a(t,[{key:\"latitude\",get:function(){return this.coordinates[1]}},{key:\"longitude\",get:function(){return this.coordinates[0]}},{key:\"lat\",value:function(){return this.latitude}},{key:\"lng\",value:function(){return this.longitude}},{key:\"serialize\",value:function(){return{type:\"Point\",coorindates:[this.lat(),this.lng()]}}},{key:\"toJson\",value:function(){return this.serialize()}},{key:\"toString\",value:function(){return\"(\".concat(this.latitude,\", \").concat(this.longitude,\")\")}}],[{key:\"fromGeoJson\",value:function(e){var n=b(e.coordinates,2);return longitude=n[0],latitude=n[1],new t(latitude,longitude)}}]),t}();\"undefined\"==typeof arguments||arguments;var W=function(t,e){var n=t();return Array.isArray(n)||\"object\"===r(n)?H(n,e):null},H=function t(e,n){var i,o=e,s=r(e),u=\"object\"===s,a=\"function\"===s,c=Array.isArray(e),h=\"string\"===r(n)&&n.includes(\".\")?n.split(\".\"):[n];if(c||u){for(var l=0;l0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;s(this,t),this.actions=e,this.bind=n}return a(t,[{key:\"extend\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=t||this.bind;if(!e)return this;if(null!=this&&this.actions&&\"object\"===r(this.actions))for(var n in this.actions){var i=this.actions[n];\"function\"==typeof i?G(e,n,i.bind(e)):G(e,n,i)}return this}}]),t}(),Y=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};s(this,t),this.attributes=e,this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isDestroying=!1,this.isReloading=!1,this.resource=r,this.options=i,this.version=i.version||\"v1\",this.setAdapter(n)}return a(t,[{key:\"setAdapter\",value:function(t){var e;return this.adapter=t,this.store=new jt(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:\"id\",get:function(){return this.getAttribute(\"id\")}},{key:\"create\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.mergeAttributes(e);return this.setFlags([\"isLoading\",\"isSaving\"]),this.store.create(n).then((function(e){return t.setFlags([\"isLoading\",\"isSaving\"],!1),e}))}},{key:\"update\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setFlags([\"isLoading\",\"isSaving\"]),this.store.update(this.attributes.id,e).then((function(e){return t.setFlags([\"isLoading\",\"isSaving\"],!1),e}))}},{key:\"destroy\",value:function(){var t=this;return this.setFlags([\"isLoading\",\"isDestroying\"]),this.store.destroy(this.attributes.id).then((function(e){return t.setFlags([\"isLoading\",\"isDestroying\"],!1),e}))}},{key:\"reload\",value:function(){var t=this;return this.setFlags([\"isLoading\",\"isReloading\"]),this.store.findRecord(this.attributes.id).then((function(e){return t.reset(),e}))}},{key:\"setFlags\",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=[\"isLoading\",\"isSaving\",\"isReloading\",\"isDestroying\"],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAttributes();return C(this.id)?this.create(e):!0===t.onlyDirty?this.savedirty():this.update(e)}},{key:\"saveDirty\",value:function(){for(var t=Object.keys(this.dirtyAttributes),e={},n=0;n0}},{key:\"mutate\",value:function(t,e){this.attributes[t]=e}},{key:\"setAttribute\",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===n&&\"object\"===r(t))return this.setAttributes(t);var i=null!==(e=null==this?void 0:this.attributes[t])&&void 0!==e?e:null;return G(this.attributes,t,n),G(this.dirtyAttributes,t,i),A(null==this?void 0:this.changes[t])||(this.changes[t]=[]),this.changes[t].push({property:t,previousValue:i,value:n,changedAt:new Date}),this}},{key:\"setAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)this.setAttribute(e,t[e]);return this}},{key:\"getAttribute\",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=H(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{},t);return void 0===r?n:r}},{key:\"hasAttribute\",value:function(t){if(A(t)){var e,n=t,r=Object.keys(null!==(e=this.attributes)&&void 0!==e?e:{});return n.every((function(t){return r.includes(t)}))}return!(null==this||!this.attributes)&&t in this.attributes}},{key:\"hasAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.hasAttribute(t)}},{key:\"isAttributeFilled\",value:function(t){var e=this;return A(t)?this.hasAttribute(t)&&t.every((function(t){return!C(e.getAttribute(t))})):this.hasAttribute(t)&&!C(this.getAttribute(t))}},{key:\"getAttributes\",value:function(t){var e={};if(null==t)return this.getAttributes(Object.keys(this.attributes));if(\"string\"==typeof t)return this.getAttribute(Array.prototype.slice.call(arguments));if(!A(t))throw new Error(\"No attribute properties provided!\");for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=null!==(t=null==this?void 0:this.attributes)&&void 0!==t?t:{};return this.attributes=n(n({},r),e),this.attributes}},{key:\"syncAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attributes=t}}]),t}(),Z=new V({getDistanceAndTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get(\"\".concat(this.namespace,\"/\").concat(t,\"/distance-and-time\"),{},e)}}),Q=function(t){h(r,Y);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,r),e.call(this,t,i,\"order\",n({actions:Z},o))}return a(r,[{key:\"getDistanceAndTime\",value:function(){return this.store.getDistanceAndTime(this.id)}}]),r}(),X=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"payload\",i)}return a(n,[{key:\"attach\",value:function(t){}},{key:\"entities\",get:function(){}},{key:\"dropoff\",get:function(){}},{key:\"pickup\",get:function(){}},{key:\"waypoints\",get:function(){return new D(this.waypoints)}}]),n}(),tt=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"entity\",i)}return n}(),et=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"place\",i)}return a(n,[{key:\"latitude\",get:function(){var t;return null===(t=this.getAttribute(\"location\",new M))||void 0===t?void 0:t.coordinates[1]}},{key:\"longitude\",get:function(){var t;return null===(t=this.getAttribute(\"location\",new M))||void 0===t?void 0:t.coordinates[0]}},{key:\"coordinates\",get:function(){return[this.latitude,this.longitude]}},{key:\"setOwner\",value:function(t){return B(t)&&this.setAttribute(\"owner\",t.id),\"string\"==typeof t&&this.setAttribute(\"owner\",t),this}}],[{key:\"fromGoogleAddress\",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.getAttribute(\"coordinates\"),o=b(i,2),s=o[0],u=o[1],a={name:null,address:t.getAttribute(\"address\"),location:new M(s,u),street1:t.getAttribute(\"streetName\"),street2:null,city:t.getAttribute(\"city\"),province:t.getAttribute(\"stateLong\"),postal_code:t.getAttribute(\"postalCode\"),neighborhood:t.get(\"neighborhood\"),district:t.getAttribute(\"county\"),building:t.get(\"building\"),country:t.getAttribute(\"countryShort\"),phone:null,security_access_code:null};return new n(a,e,r)}}]),n}(),nt=function(t){h(n,et);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"waypoint\",i)}return n}(),rt=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"tracking-status\",i)}return n}(),it=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"vehicle\",i)}return n}(),ot=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"driver\",i)}return n}(),st=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"vendor\",i)}return n}(),ut=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"contact\",i)}return n}(),at=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"zone\",i)}return n}(),ct=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"service-area\",i)}return n}(),ht=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"service-rate\",i)}return n}(),lt=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"service-quote\",i)}return a(n,[{key:\"fromPreliminary\",value:function(){}},{key:\"fromPayload\",value:function(){}}]),n}(),vt=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,t),this.version=e.version||\"v1\",this.host=e.host||null,this.namespace=e.namespace||null,this.headers=e.headers||{}},ft=function(t){h(r,vt);var e=y(r);function r(t){var n;return s(this,r),(n=e.call(this,t)).setHeaders({Authorization:\"Bearer \".concat(t.publicKey),\"Content-Type\":\"application/json\",\"User-Agent\":\"@fleetbase/sdk;browser\"}),n}return a(r,[{key:\"setHeaders\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.headers=n(n({},this.headers),t),this}},{key:\"parseJSON\",value:function(t){return new Promise((function(e,n){return t.json().then((function(n){return e({statusText:t.statusText,status:t.status,ok:t.ok,json:n})})).catch((function(){n(new Error(\"Oops! Something went wrong when handling your request.\"))}))}))}},{key:\"request\",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"GET\",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(s,u){return fetch(o.url||\"\".concat(e.host,\"/\").concat(e.namespace,\"/\").concat(t),n({method:r,mode:o.mode||\"cors\",headers:new Headers(n(n({},e.headers||{}),o.headers||{}))},i)).then(e.parseJSON).then((function(t){return t.ok?s(t.json):u(new Error(t.json.errors?t.json.errors[0]:t.statusText))})).catch((function(t){u(t)}))}))}},{key:\"get\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=T(e)?\"\":new URLSearchParams(e).toString();return this.request(\"\".concat(t).concat(r?\"?\".concat(r):\"\"),\"GET\",{},n)}},{key:\"post\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,\"POST\",{body:JSON.stringify(e)},n)}},{key:\"put\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,\"PUT\",{body:JSON.stringify(e)},n)}},{key:\"delete\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(t,\"DELETE\",{},e)}},{key:\"patch\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,\"PATCH\",{body:JSON.stringify(e)},n)}}]),r}(),dt=function(e){h(i,vt);var r=y(i);function i(e){var n;return s(this,i),(n=r.call(this,e)).axios=t.create({baseURL:\"\".concat(n.host,\"/\").concat(n.namespace),headers:{Authorization:\"Bearer \".concat(e.publicKey),\"Content-Type\":\"application/json\",\"User-Agent\":\"@fleetbase/sdk;node\"}}),n}return a(i,[{key:\"setHeaders\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.axios.defaults.headers.common;return this.axios.defaults.headers.common=n(n({},e),t),this}},{key:\"transform\",value:function(t){return t.data}},{key:\"handleError\",value:function(t){if(t.response){var e=t.response.data;if(A(e.errors))throw new Error(e.errors[0]);if(e.error)throw new Error(e.error)}throw t}},{key:\"get\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=T(e)?\"\":new URLSearchParams(e).toString();return this.axios.get(\"\".concat(t).concat(r?\"?\".concat(r):\"\"),n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"post\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.post(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"put\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.put(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"delete\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.axios.delete(t,e).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"patch\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.patch(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}}]),i}(),gt=function(t){h(n,vt);var e=y(n);function n(){return s(this,n),e.apply(this,arguments)}return n}(),pt=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];s(this,t),c(this,\"uncountableWords\",[\"equipment\",\"information\",\"rice\",\"money\",\"species\",\"series\",\"fish\",\"sheep\",\"moose\",\"deer\",\"news\"]),c(this,\"pluralRules\",[[new RegExp(\"(m)an$\",\"gi\"),\"$1en\"],[new RegExp(\"(pe)rson$\",\"gi\"),\"$1ople\"],[new RegExp(\"(child)$\",\"gi\"),\"$1ren\"],[new RegExp(\"^(ox)$\",\"gi\"),\"$1en\"],[new RegExp(\"(ax|test)is$\",\"gi\"),\"$1es\"],[new RegExp(\"(octop|vir)us$\",\"gi\"),\"$1i\"],[new RegExp(\"(alias|status)$\",\"gi\"),\"$1es\"],[new RegExp(\"(bu)s$\",\"gi\"),\"$1ses\"],[new RegExp(\"(buffal|tomat|potat)o$\",\"gi\"),\"$1oes\"],[new RegExp(\"([ti])um$\",\"gi\"),\"$1a\"],[new RegExp(\"sis$\",\"gi\"),\"ses\"],[new RegExp(\"(?:([^f])fe|([lr])f)$\",\"gi\"),\"$1$2ves\"],[new RegExp(\"(hive)$\",\"gi\"),\"$1s\"],[new RegExp(\"([^aeiouy]|qu)y$\",\"gi\"),\"$1ies\"],[new RegExp(\"(x|ch|ss|sh)$\",\"gi\"),\"$1es\"],[new RegExp(\"(matr|vert|ind)ix|ex$\",\"gi\"),\"$1ices\"],[new RegExp(\"([m|l])ouse$\",\"gi\"),\"$1ice\"],[new RegExp(\"(quiz)$\",\"gi\"),\"$1zes\"],[new RegExp(\"s$\",\"gi\"),\"s\"],[new RegExp(\"$\",\"gi\"),\"s\"]]),c(this,\"singularRules\",[[new RegExp(\"(m)en$\",\"gi\"),\"$1an\"],[new RegExp(\"(pe)ople$\",\"gi\"),\"$1rson\"],[new RegExp(\"(child)ren$\",\"gi\"),\"$1\"],[new RegExp(\"([ti])a$\",\"gi\"),\"$1um\"],[new RegExp(\"((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$\",\"gi\"),\"$1$2sis\"],[new RegExp(\"(hive)s$\",\"gi\"),\"$1\"],[new RegExp(\"(tive)s$\",\"gi\"),\"$1\"],[new RegExp(\"(curve)s$\",\"gi\"),\"$1\"],[new RegExp(\"([lr])ves$\",\"gi\"),\"$1f\"],[new RegExp(\"([^fo])ves$\",\"gi\"),\"$1fe\"],[new RegExp(\"([^aeiouy]|qu)ies$\",\"gi\"),\"$1y\"],[new RegExp(\"(s)eries$\",\"gi\"),\"$1eries\"],[new RegExp(\"(m)ovies$\",\"gi\"),\"$1ovie\"],[new RegExp(\"(x|ch|ss|sh)es$\",\"gi\"),\"$1\"],[new RegExp(\"([m|l])ice$\",\"gi\"),\"$1ouse\"],[new RegExp(\"(bus)es$\",\"gi\"),\"$1\"],[new RegExp(\"(o)es$\",\"gi\"),\"$1\"],[new RegExp(\"(shoe)s$\",\"gi\"),\"$1\"],[new RegExp(\"(cris|ax|test)es$\",\"gi\"),\"$1is\"],[new RegExp(\"(octop|vir)i$\",\"gi\"),\"$1us\"],[new RegExp(\"(alias|status)es$\",\"gi\"),\"$1\"],[new RegExp(\"^(ox)en\",\"gi\"),\"$1\"],[new RegExp(\"(vert|ind)ices$\",\"gi\"),\"$1ex\"],[new RegExp(\"(matr)ices$\",\"gi\"),\"$1ix\"],[new RegExp(\"(quiz)zes$\",\"gi\"),\"$1\"],[new RegExp(\"s$\",\"gi\"),\"\"]]),c(this,\"nonTitlecasedWords\",[\"and\",\"or\",\"nor\",\"a\",\"an\",\"the\",\"so\",\"but\",\"to\",\"of\",\"at\",\"by\",\"from\",\"into\",\"on\",\"onto\",\"off\",\"out\",\"in\",\"over\",\"with\",\"for\"]),c(this,\"idSuffix\",new RegExp(\"(_ids|_id)$\",\"g\")),c(this,\"underbar\",new RegExp(\"_\",\"g\")),c(this,\"spaceOrUnderbar\",new RegExp(\"[ _]\",\"g\")),c(this,\"uppercase\",new RegExp(\"([A-Z])\",\"g\")),c(this,\"underbarPrefix\",new RegExp(\"^_\")),this.str=e,this.chain=n}return a(t,[{key:\"get\",value:function(){return this.str}},{key:\"applyRules\",value:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:null;return t=t||this.str,this.applyRules(t,this.pluralRules,this.uncountableWords,e)}},{key:\"singularize\",value:function(t,e){return t=t||this.str,this.applyRules(t,this.singularRules,this.uncountableWords,e)}},{key:\"camelize\",value:function(t,e){for(var n=(t=t||this.str).split(\"/\"),r=0;r1&&void 0!==arguments[1]&&arguments[1];return t=t||this.str,t=this.underscore(this.demodulize(t))+(e?\"\":\"_\")+\"id\",this.str=t,!0===this.chain?this:t}},{key:\"ordinalize\",value:function(t){for(var e=(t=t||this.str).split(\" \"),n=0;n1&&void 0!==arguments[1]?arguments[1]:[];if(t.actions=A(e)?e:[e],!A(e))return e instanceof V&&e.extend(t),t;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};s(this,t),this.resource=e,this.adapter=n||I(),this.namespace=yt(e),this.storage=new D,this.options=r,this.extendActions(r.actions)}return a(t,[{key:\"extendActions\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Et(this,t)}},{key:\"deposit\",value:function(t){return t}},{key:\"serialize\",value:function(t){return Rt(\"resource\",wt(this.resource),t,this.adapter)}},{key:\"afterFetch\",value:function(t){return function(t,e){if(\"function\"==typeof t.options.onAfterFetch&&t.options.onAfterFetch(e),A(e)){for(var n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.post(\"\".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"update\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(function(){var i=o(regeneratorRuntime.mark((function i(o,s){var u;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,e.adapter.put(\"\".concat(e.namespace,\"/\").concat(t),n,r).then(e.afterFetch.bind(e)).catch(s);case 2:u=i.sent,o(u);case 4:case\"end\":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}())}},{key:\"findRecord\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.adapter.get(\"\".concat(e.namespace,\"/\").concat(t),{},n).then(e.afterFetch.bind(e)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"findAll\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var n=o(regeneratorRuntime.mark((function n(r,i){var o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.adapter.get(\"\".concat(t.namespace),{},e).then(t.afterFetch.bind(t)).catch(i);case 2:o=n.sent,r(o);case 4:case\"end\":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}())}},{key:\"query\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get(\"\".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"queryRecord\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.single=!0,new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get(\"\".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"destroy\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=B(t)?t.getAttribute(\"id\"):t;return new Promise(function(){var t=o(regeneratorRuntime.mark((function t(i,o){var s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.adapter.delete(\"\".concat(e.namespace,\"/\").concat(r),{},n).then(e.afterFetch.bind(e)).catch(o);case 2:s=t.sent,i(s);case 4:case\"end\":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())}}]),t}(),Ot=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(s(this,t),this.version=n.version||\"v1\",this.options={version:this.version,host:n.host||\"https://api.fleetbase.io\",namespace:this.version||n.namespace,debug:r,publicKey:e},\"string\"!=typeof e||0===e.length)throw new Error(\"⚠️ Invalid public key given to Fleetbase SDK\");if(!U()&&e.toLowerCase().startsWith(\"$\"))throw new Error(\"Secret key provided. You must use a public key with Fleetbase Javascript SDK!\");this.adapter=n.adapter||I(this.options),this.orders=new jt(\"order\",this.adapter).extendActions(Z),this.entities=new jt(\"entity\",this.adapter),this.places=new jt(\"place\",this.adapter),this.drivers=new jt(\"driver\",this.adapter),this.vehicles=new jt(\"vehicle\",this.adapter),this.vendors=new jt(\"vendor\",this.adapter),this.contacts=new jt(\"contact\",this.adapter)}return a(t,[{key:\"setAdapter\",value:function(t){this.adapter=t}},{key:\"getAdapter\",value:function(){return this.adapter}}],[{key:\"newInstance\",value:function(){return d(t,Array.prototype.slice.call(arguments))}}]),t}();export default Ot;export{vt as Adapter,ft as BrowserAdapter,D as Collection,ut as Contact,ot as Driver,gt as EmberJsAdapter,tt as Entity,K as GoogleAddress,dt as NodeAdapter,Q as Order,X as Payload,et as Place,M as Point,Y as Resource,ct as ServiceArea,lt as ServiceQuote,ht as ServiceRate,jt as Store,V as StoreActions,rt as TrackingStatus,it as Vehicle,st as Vendor,nt as Waypoint,at as Zone,mt as camelize,wt as classify,kt as dasherize,Et as extendStoreActions,N as isLatitude,q as isLongitude,U as isNodeEnvironment,B as isResource,yt as pluralize,bt as singularize};\n//# sourceMappingURL=fleetbase.js.map\n","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}","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 };","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;","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n}\n\nexport default isPhone;","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', { style: 'currency', currency, currencyDisplay }).format(amount);\n}","const isKeyValid = (key) => {\n return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_'));\n};\n\nexport default isKeyValid;","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\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}","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\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 StorefrontStore from '../store';\nimport Resource from '../resource';\nimport { Contact, Place, Order, Collection, StoreActions } from '@fleetbase/sdk';\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', { identity, mode });\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', { actions: customerActions, ...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 token() {\n return this.getAttribute('token');\n }\n\n 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 getSavedPlaces() {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/places')\n .then((places) => {\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n });\n }\n\n getOrderHistory(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/orders', params)\n .then((orders) => {\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n });\n }\n}\n\nexport { customerActions };\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\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","export default function toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n\n var number = Number(dirtyNumber);\n\n if (isNaN(number)) {\n return number;\n }\n\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\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 * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\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 */\n\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument); // Clone the date\n\n if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule\"); // eslint-disable-next-line no-console\n\n console.warn(new Error().stack);\n }\n\n return new Date(NaN);\n }\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\n\nexport default function addMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var timestamp = toDate(dirtyDate).getTime();\n var amount = toInteger(dirtyAmount);\n return new Date(timestamp + amount);\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 default function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\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 * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {*} value - the value to check\n * @returns {boolean} true if the given value is a date\n * @throws {TypeError} 1 arguments required\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 */\n\nexport default function isDate(value) {\n requiredArgs(1, arguments);\n return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';\n}","import isDate from \"../isDate/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\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]{@link 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 * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Now `isValid` doesn't throw an exception\n * if the first argument is not an instance of Date.\n * Instead, argument is converted beforehand using `toDate`.\n *\n * Examples:\n *\n * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |\n * |---------------------------|---------------|---------------|\n * | `new Date()` | `true` | `true` |\n * | `new Date('2016-01-01')` | `true` | `true` |\n * | `new Date('')` | `false` | `false` |\n * | `new Date(1488370835081)` | `true` | `true` |\n * | `new Date(NaN)` | `false` | `false` |\n * | `'2016-01-01'` | `TypeError` | `false` |\n * | `''` | `TypeError` | `false` |\n * | `1488370835081` | `TypeError` | `true` |\n * | `NaN` | `TypeError` | `false` |\n *\n * We introduce this change to make *date-fns* consistent with ECMAScript behavior\n * that try to coerce arguments to the expected type\n * (which is also the case with other *date-fns* functions).\n *\n * @param {*} date - the date to check\n * @returns {Boolean} the date is valid\n * @throws {TypeError} 1 argument required\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 */\n\nexport default function isValid(dirtyDate) {\n requiredArgs(1, arguments);\n\n if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {\n return false;\n }\n\n var date = toDate(dirtyDate);\n return !isNaN(Number(date));\n}","var formatDistanceLocale = {\n lessThanXSeconds: {\n one: 'less than a second',\n other: 'less than {{count}} seconds'\n },\n xSeconds: {\n one: '1 second',\n other: '{{count}} seconds'\n },\n halfAMinute: 'half a minute',\n lessThanXMinutes: {\n one: 'less than a minute',\n other: 'less than {{count}} minutes'\n },\n xMinutes: {\n one: '1 minute',\n other: '{{count}} minutes'\n },\n aboutXHours: {\n one: 'about 1 hour',\n other: 'about {{count}} hours'\n },\n xHours: {\n one: '1 hour',\n other: '{{count}} hours'\n },\n xDays: {\n one: '1 day',\n other: '{{count}} days'\n },\n aboutXWeeks: {\n one: 'about 1 week',\n other: 'about {{count}} weeks'\n },\n xWeeks: {\n one: '1 week',\n other: '{{count}} weeks'\n },\n aboutXMonths: {\n one: 'about 1 month',\n other: 'about {{count}} months'\n },\n xMonths: {\n one: '1 month',\n other: '{{count}} months'\n },\n aboutXYears: {\n one: 'about 1 year',\n other: 'about {{count}} years'\n },\n xYears: {\n one: '1 year',\n other: '{{count}} years'\n },\n overXYears: {\n one: 'over 1 year',\n other: 'over {{count}} years'\n },\n almostXYears: {\n one: 'almost 1 year',\n other: 'almost {{count}} years'\n }\n};\n\nvar formatDistance = function (token, count, options) {\n var result;\n var tokenValue = formatDistanceLocale[token];\n\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 !== null && options !== void 0 && 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\nexport default formatDistance;","export default function buildFormatLongFn(args) {\n return function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // TODO: Remove String()\n var width = options.width ? String(options.width) : args.defaultWidth;\n var format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}","import buildFormatLongFn from \"../../../_lib/buildFormatLongFn/index.js\";\nvar dateFormats = {\n full: 'EEEE, MMMM do, y',\n long: 'MMMM do, y',\n medium: 'MMM d, y',\n short: 'MM/dd/yyyy'\n};\nvar 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};\nvar dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: '{{date}}, {{time}}',\n short: '{{date}}, {{time}}'\n};\nvar formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: 'full'\n }),\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: 'full'\n }),\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: 'full'\n })\n};\nexport default formatLong;","var 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\nvar formatRelative = function (token, _date, _baseDate, _options) {\n return formatRelativeLocale[token];\n};\n\nexport default formatRelative;","export default function buildLocalizeFn(args) {\n return function (dirtyIndex, dirtyOptions) {\n var options = dirtyOptions || {};\n var context = options.context ? String(options.context) : 'standalone';\n var valuesArray;\n\n if (context === 'formatting' && args.formattingValues) {\n var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n var width = options.width ? String(options.width) : defaultWidth;\n valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n var _defaultWidth = args.defaultWidth;\n\n var _width = options.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[_width] || args.values[_defaultWidth];\n }\n\n var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challange you to try to remove it!\n\n return valuesArray[index];\n };\n}","import buildLocalizeFn from \"../../../_lib/buildLocalizeFn/index.js\";\nvar eraValues = {\n narrow: ['B', 'A'],\n abbreviated: ['BC', 'AD'],\n wide: ['Before Christ', 'Anno Domini']\n};\nvar quarterValues = {\n narrow: ['1', '2', '3', '4'],\n abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],\n wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']\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.\n\nvar monthValues = {\n narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\n abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n};\nvar 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: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n};\nvar 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};\nvar 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\nvar ordinalNumber = function (dirtyNumber, _options) {\n var number = Number(dirtyNumber); // 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 var rem100 = number % 100;\n\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + 'st';\n\n case 2:\n return number + 'nd';\n\n case 3:\n return number + 'rd';\n }\n }\n\n return number + 'th';\n};\n\nvar localize = {\n ordinalNumber: ordinalNumber,\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: 'wide'\n }),\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: 'wide',\n argumentCallback: function (quarter) {\n return quarter - 1;\n }\n }),\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: 'wide'\n }),\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: 'wide'\n }),\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: 'wide',\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: 'wide'\n })\n};\nexport default localize;","export default function buildMatchFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var width = options.width;\n var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n var matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n\n var matchedString = matchResult[0];\n var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n }) : findKey(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n });\n var value;\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}\n\nfunction findKey(object, predicate) {\n for (var key in object) {\n if (object.hasOwnProperty(key) && predicate(object[key])) {\n return key;\n }\n }\n\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (var key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n\n return undefined;\n}","export default function buildMatchPatternFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n var matchedString = matchResult[0];\n var parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}","import buildMatchFn from \"../../../_lib/buildMatchFn/index.js\";\nimport buildMatchPatternFn from \"../../../_lib/buildMatchPatternFn/index.js\";\nvar matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nvar parseOrdinalNumberPattern = /\\d+/i;\nvar 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};\nvar parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i]\n};\nvar matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i\n};\nvar parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i]\n};\nvar 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};\nvar parseMonthPatterns = {\n 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],\n 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]\n};\nvar 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};\nvar 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};\nvar 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};\nvar 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};\nvar match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: function (value) {\n return parseInt(value, 10);\n }\n }),\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseEraPatterns,\n defaultParseWidth: 'any'\n }),\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: 'any',\n valueCallback: function (index) {\n return index + 1;\n }\n }),\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: 'any'\n }),\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseDayPatterns,\n defaultParseWidth: 'any'\n }),\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: 'any',\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: 'any'\n })\n};\nexport default match;","import formatDistance from \"./_lib/formatDistance/index.js\";\nimport formatLong from \"./_lib/formatLong/index.js\";\nimport formatRelative from \"./_lib/formatRelative/index.js\";\nimport localize from \"./_lib/localize/index.js\";\nimport match from \"./_lib/match/index.js\";\n\n/**\n * @type {Locale}\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}\n * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}\n */\nvar locale = {\n code: 'en-US',\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0\n /* Sunday */\n ,\n firstWeekContainsDate: 1\n }\n};\nexport default locale;","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subMilliseconds\n * @category Millisecond Helpers\n * @summary Subtract the specified number of milliseconds from the given date.\n *\n * @description\n * Subtract the specified number of milliseconds from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:\n * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:29.250\n */\n\nexport default function subMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, -amount);\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n\n while (output.length < targetLength) {\n output = '0' + output;\n }\n\n return sign + output;\n}","import addLeadingZeros from \"../../addLeadingZeros/index.js\";\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\nvar formatters = {\n // Year\n y: function (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 var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);\n },\n // Month\n M: function (date, token) {\n var month = date.getUTCMonth();\n return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n // Day of the month\n d: function (date, token) {\n return addLeadingZeros(date.getUTCDate(), token.length);\n },\n // AM or PM\n a: function (date, token) {\n var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return dayPeriodEnumValue.toUpperCase();\n\n case 'aaa':\n return dayPeriodEnumValue;\n\n case 'aaaaa':\n return dayPeriodEnumValue[0];\n\n case 'aaaa':\n default:\n return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';\n }\n },\n // Hour [1-12]\n h: function (date, token) {\n return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);\n },\n // Hour [0-23]\n H: function (date, token) {\n return addLeadingZeros(date.getUTCHours(), token.length);\n },\n // Minute\n m: function (date, token) {\n return addLeadingZeros(date.getUTCMinutes(), token.length);\n },\n // Second\n s: function (date, token) {\n return addLeadingZeros(date.getUTCSeconds(), token.length);\n },\n // Fraction of second\n S: function (date, token) {\n var numberOfDigits = token.length;\n var milliseconds = date.getUTCMilliseconds();\n var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));\n return addLeadingZeros(fractionalSeconds, token.length);\n }\n};\nexport default formatters;","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCDayOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var timestamp = date.getTime();\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n var startOfYearTimestamp = date.getTime();\n var difference = timestamp - startOfYearTimestamp;\n return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;\n}","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getUTCFullYear();\n var fourthOfJanuaryOfNextYear = new Date(0);\n fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);\n var fourthOfJanuaryOfThisYear = new Date(0);\n fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCISOWeek(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}","import getUTCISOWeekYear from \"../getUTCISOWeekYear/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var year = getUTCISOWeekYear(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setUTCFullYear(year, 0, 4);\n fourthOfJanuary.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCISOWeek(fourthOfJanuary);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport startOfUTCISOWeekYear from \"../startOfUTCISOWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // 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\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeek(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate, dirtyOptions);\n var year = date.getUTCFullYear();\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var firstWeekOfNextYear = new Date(0);\n firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);\n var firstWeekOfThisYear = new Date(0);\n firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);\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}","import toInteger from \"../toInteger/index.js\";\nimport getUTCWeekYear from \"../getUTCWeekYear/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\n var year = getUTCWeekYear(dirtyDate, dirtyOptions);\n var firstWeek = new Date(0);\n firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCWeek(firstWeek, dirtyOptions);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport startOfUTCWeekYear from \"../startOfUTCWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // 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\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import lightFormatters from \"../lightFormatters/index.js\";\nimport getUTCDayOfYear from \"../../../_lib/getUTCDayOfYear/index.js\";\nimport getUTCISOWeek from \"../../../_lib/getUTCISOWeek/index.js\";\nimport getUTCISOWeekYear from \"../../../_lib/getUTCISOWeekYear/index.js\";\nimport getUTCWeek from \"../../../_lib/getUTCWeek/index.js\";\nimport getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport addLeadingZeros from \"../../addLeadingZeros/index.js\";\nvar 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 * | | 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\nvar formatters = {\n // Era\n G: function (date, token, localize) {\n var era = date.getUTCFullYear() > 0 ? 1 : 0;\n\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return localize.era(era, {\n width: 'abbreviated'\n });\n // A, B\n\n case 'GGGGG':\n return localize.era(era, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return localize.era(era, {\n width: 'wide'\n });\n }\n },\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === 'yo') {\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, {\n unit: 'year'\n });\n }\n\n return lightFormatters.y(date, token);\n },\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year\n\n if (token === 'YY') {\n var twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n } // Ordinal number\n\n\n if (token === 'Yo') {\n return localize.ordinalNumber(weekYear, {\n unit: 'year'\n });\n } // Padding\n\n\n return addLeadingZeros(weekYear, token.length);\n },\n // ISO week-numbering year\n R: function (date, token) {\n var isoWeekYear = getUTCISOWeekYear(date); // Padding\n\n return addLeadingZeros(isoWeekYear, token.length);\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 var year = date.getUTCFullYear();\n return addLeadingZeros(year, token.length);\n },\n // Quarter\n Q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'QQ':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\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\n case 'QQQQQ':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone quarter\n q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'qq':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\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\n case 'qqqqq':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Month\n M: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n case 'M':\n case 'MM':\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return localize.month(month, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone month\n L: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return String(month + 1);\n // 01, 02, ..., 12\n\n case 'LL':\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return localize.month(month, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Local week of year\n w: function (date, token, localize, options) {\n var week = getUTCWeek(date, options);\n\n if (token === 'wo') {\n return localize.ordinalNumber(week, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(week, token.length);\n },\n // ISO week of year\n I: function (date, token, localize) {\n var isoWeek = getUTCISOWeek(date);\n\n if (token === 'Io') {\n return localize.ordinalNumber(isoWeek, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n // Day of the month\n d: function (date, token, localize) {\n if (token === 'do') {\n return localize.ordinalNumber(date.getUTCDate(), {\n unit: 'date'\n });\n }\n\n return lightFormatters.d(date, token);\n },\n // Day of year\n D: function (date, token, localize) {\n var dayOfYear = getUTCDayOfYear(date);\n\n if (token === 'Do') {\n return localize.ordinalNumber(dayOfYear, {\n unit: 'dayOfYear'\n });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n // Day of week\n E: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n\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\n case 'EEEEE':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Local day of week\n e: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\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\n case 'ee':\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n\n case 'eo':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'eee':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (same as in `e`)\n case 'c':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'cc':\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n\n case 'co':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'ccc':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // ISO day of week\n i: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n\n switch (token) {\n // 2\n case 'i':\n return String(isoDayOfWeek);\n // 02\n\n case 'ii':\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n\n case 'io':\n return localize.ordinalNumber(isoDayOfWeek, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'iiiii':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'iiiiii':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'iiii':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM or PM\n a: function (date, token, localize) {\n var hours = date.getUTCHours();\n var 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\n case 'aaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'aaaaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\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\n case 'bbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'bbbbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\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\n case 'BBBBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === 'ho') {\n var hours = date.getUTCHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return lightFormatters.h(date, token);\n },\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === 'Ho') {\n return localize.ordinalNumber(date.getUTCHours(), {\n unit: 'hour'\n });\n }\n\n return lightFormatters.H(date, token);\n },\n // Hour [0-11]\n K: function (date, token, localize) {\n var hours = date.getUTCHours() % 12;\n\n if (token === 'Ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Hour [1-24]\n k: function (date, token, localize) {\n var hours = date.getUTCHours();\n if (hours === 0) hours = 24;\n\n if (token === 'ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Minute\n m: function (date, token, localize) {\n if (token === 'mo') {\n return localize.ordinalNumber(date.getUTCMinutes(), {\n unit: 'minute'\n });\n }\n\n return lightFormatters.m(date, token);\n },\n // Second\n s: function (date, token, localize) {\n if (token === 'so') {\n return localize.ordinalNumber(date.getUTCSeconds(), {\n unit: 'second'\n });\n }\n\n return lightFormatters.s(date, token);\n },\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var 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 // 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\n case 'XXXX':\n case 'XX':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\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\n case 'XXXXX':\n case 'XXX': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case 'x':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\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\n case 'xxxx':\n case 'xx':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\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\n case 'xxxxx':\n case 'xxx': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var 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\n case 'OOOO':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var 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\n case 'zzzz':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n }\n};\n\nfunction formatTimezoneShort(offset, dirtyDelimiter) {\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = Math.floor(absOffset / 60);\n var minutes = absOffset % 60;\n\n if (minutes === 0) {\n return sign + String(hours);\n }\n\n var delimiter = dirtyDelimiter || '';\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {\n if (offset % 60 === 0) {\n var sign = offset > 0 ? '-' : '+';\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n\n return formatTimezone(offset, dirtyDelimiter);\n}\n\nfunction formatTimezone(offset, dirtyDelimiter) {\n var delimiter = dirtyDelimiter || '';\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n var minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n\nexport default formatters;","function dateLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'P':\n return formatLong.date({\n width: 'short'\n });\n\n case 'PP':\n return formatLong.date({\n width: 'medium'\n });\n\n case 'PPP':\n return formatLong.date({\n width: 'long'\n });\n\n case 'PPPP':\n default:\n return formatLong.date({\n width: 'full'\n });\n }\n}\n\nfunction timeLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'p':\n return formatLong.time({\n width: 'short'\n });\n\n case 'pp':\n return formatLong.time({\n width: 'medium'\n });\n\n case 'ppp':\n return formatLong.time({\n width: 'long'\n });\n\n case 'pppp':\n default:\n return formatLong.time({\n width: 'full'\n });\n }\n}\n\nfunction dateTimeLongFormatter(pattern, formatLong) {\n var matchResult = pattern.match(/(P+)(p+)?/);\n var datePattern = matchResult[1];\n var timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n var dateTimeFormat;\n\n switch (datePattern) {\n case 'P':\n dateTimeFormat = formatLong.dateTime({\n width: 'short'\n });\n break;\n\n case 'PP':\n dateTimeFormat = formatLong.dateTime({\n width: 'medium'\n });\n break;\n\n case 'PPP':\n dateTimeFormat = formatLong.dateTime({\n width: 'long'\n });\n break;\n\n case 'PPPP':\n default:\n dateTimeFormat = formatLong.dateTime({\n width: 'full'\n });\n break;\n }\n\n return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));\n}\n\nvar longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter\n};\nexport default longFormatters;","var protectedDayOfYearTokens = ['D', 'DD'];\nvar protectedWeekYearTokens = ['YY', 'YYYY'];\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\nexport function throwProtectedError(token, format, input) {\n if (token === 'YYYY') {\n throw new RangeError(\"Use `yyyy` instead of `YYYY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'YY') {\n throw new RangeError(\"Use `yy` instead of `YY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'D') {\n throw new RangeError(\"Use `d` instead of `D` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'DD') {\n throw new RangeError(\"Use `dd` instead of `DD` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n }\n}","import isValid from \"../isValid/index.js\";\nimport defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport formatters from \"../_lib/format/formatters/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\"; // 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\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\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://git.io/fxCyr\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, Su, Sa | |\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, Su, Sa | 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, Su, Sa | |\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, Su, Sa | |\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]{@link https://date-fns.org/docs/getISOWeekYear}\n * and [getWeekYear]{@link 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://git.io/fxCyr\n *\n * 9. `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://git.io/fxCyr\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The second argument is now required for the sake of explicitness.\n *\n * ```javascript\n * // Before v2.0.0\n * format(new Date(2016, 0, 1))\n *\n * // v2.0.0 onward\n * format(new Date(2016, 0, 1), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n * ```\n *\n * - New format string API for `format` function\n * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).\n * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.\n *\n * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.\n *\n * @param {Date|Number} date - the original date\n * @param {String} format - the string of tokens\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {String} the formatted date string\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * var 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 * var 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 * var result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\n\nexport default function format(dirtyDate, dirtyFormatStr, dirtyOptions) {\n requiredArgs(2, arguments);\n var formatStr = String(dirtyFormatStr);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (!locale.localize) {\n throw new RangeError('locale must contain localize property');\n }\n\n if (!locale.formatLong) {\n throw new RangeError('locale must contain formatLong property');\n }\n\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\n\n\n var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);\n var utcDate = subMilliseconds(originalDate, timezoneOffset);\n var formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate\n };\n var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, formatterOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp).map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n var firstCharacter = substring[0];\n\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n var formatter = formatters[firstCharacter];\n\n if (formatter) {\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n return formatter(utcDate, substring, locale.localize, formatterOptions);\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n }\n\n return substring;\n }).join('');\n return result;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","export default function assign(target, dirtyObject) {\n if (target == null) {\n throw new TypeError('assign requires that input parameter not be null or undefined');\n }\n\n dirtyObject = dirtyObject || {};\n\n for (var property in dirtyObject) {\n if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) {\n target[property] = dirtyObject[property];\n }\n }\n\n return target;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {\n requiredArgs(2, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = toInteger(dirtyDay);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISODay(dirtyDate, dirtyDay) {\n requiredArgs(2, arguments);\n var day = toInteger(dirtyDay);\n\n if (day % 7 === 0) {\n day = day - 7;\n }\n\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCISOWeek from \"../getUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISOWeek(dirtyDate, dirtyISOWeek) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var isoWeek = toInteger(dirtyISOWeek);\n var diff = getUTCISOWeek(date) - isoWeek;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCWeek from \"../getUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCWeek(dirtyDate, dirtyWeek, options) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var week = toInteger(dirtyWeek);\n var diff = getUTCWeek(date, options) - week;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport setUTCDay from \"../../../_lib/setUTCDay/index.js\";\nimport setUTCISODay from \"../../../_lib/setUTCISODay/index.js\";\nimport setUTCISOWeek from \"../../../_lib/setUTCISOWeek/index.js\";\nimport setUTCWeek from \"../../../_lib/setUTCWeek/index.js\";\nimport startOfUTCISOWeek from \"../../../_lib/startOfUTCISOWeek/index.js\";\nimport startOfUTCWeek from \"../../../_lib/startOfUTCWeek/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\nvar MILLISECONDS_IN_MINUTE = 60000;\nvar MILLISECONDS_IN_SECOND = 1000;\nvar numericPatterns = {\n month: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/,\n // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/,\n // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/,\n // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/,\n // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/,\n // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/,\n // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n minute: /^[0-5]?\\d/,\n // 0 to 59\n second: /^[0-5]?\\d/,\n // 0 to 59\n singleDigit: /^\\d/,\n // 0 to 9\n twoDigits: /^\\d{1,2}/,\n // 0 to 99\n threeDigits: /^\\d{1,3}/,\n // 0 to 999\n fourDigits: /^\\d{1,4}/,\n // 0 to 9999\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/,\n // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/,\n // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/,\n // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/ // 0 to 9999, -0 to -9999\n\n};\nvar 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\nfunction parseNumericPattern(pattern, string, valueCallback) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n var value = parseInt(matchResult[0], 10);\n return {\n value: valueCallback ? valueCallback(value) : value,\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseTimezonePattern(pattern, string) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n } // Input is 'Z'\n\n\n if (matchResult[0] === 'Z') {\n return {\n value: 0,\n rest: string.slice(1)\n };\n }\n\n var sign = matchResult[1] === '+' ? 1 : -1;\n var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n return {\n value: sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * MILLISECONDS_IN_SECOND),\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseAnyDigitsSigned(string, valueCallback) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback);\n}\n\nfunction parseNDigits(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction parseNDigitsSigned(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^-?\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction dayPeriodEnumToHours(enumValue) {\n switch (enumValue) {\n case 'morning':\n return 4;\n\n case 'evening':\n return 17;\n\n case 'pm':\n case 'noon':\n case 'afternoon':\n return 12;\n\n case 'am':\n case 'midnight':\n case 'night':\n default:\n return 0;\n }\n}\n\nfunction normalizeTwoDigitYear(twoDigitYear, currentYear) {\n var isCommonEra = currentYear > 0; // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n\n var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n var result;\n\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n var rangeEnd = absCurrentYear + 50;\n var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n var isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nvar DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nvar DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // User for validation\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\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\n\nvar parsers = {\n // Era\n G: {\n priority: 140,\n parse: function (string, token, match, _options) {\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n // A, B\n\n case 'GGGGG':\n return match.era(string, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return match.era(string, {\n width: 'wide'\n }) || match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n }\n },\n set: function (date, flags, value, _options) {\n flags.era = value;\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['R', 'u', 't', 'T']\n },\n // Year\n y: {\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 |\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'yy'\n };\n };\n\n switch (token) {\n case 'y':\n return parseNDigits(4, string, valueCallback);\n\n case 'yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, _options) {\n var currentYear = date.getUTCFullYear();\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Local week-numbering year\n Y: {\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'YY'\n };\n };\n\n switch (token) {\n case 'Y':\n return parseNDigits(4, string, valueCallback);\n\n case 'Yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, options) {\n var currentYear = getUTCWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week-numbering year\n R: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'R') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (_date, _flags, value, _options) {\n var firstWeekOfYear = new Date(0);\n firstWeekOfYear.setUTCFullYear(value, 0, 4);\n firstWeekOfYear.setUTCHours(0, 0, 0, 0);\n return startOfUTCISOWeek(firstWeekOfYear);\n },\n incompatibleTokens: ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Extended year\n u: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'u') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Quarter\n Q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n case 'QQ':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone quarter\n q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n case 'qq':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Month\n M: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'M':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'MM':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone month\n L: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'LL':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Local week of year\n w: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'w':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'wo':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCWeek(setUTCWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week of year\n I: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'I':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'Io':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCISOWeek(setUTCISOWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Day of the month\n d: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'd':\n return parseNumericPattern(numericPatterns.date, string);\n\n case 'do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n var month = date.getUTCMonth();\n\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 set: function (date, _flags, value, _options) {\n date.setUTCDate(value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Day of year\n D: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'D':\n case 'DD':\n return parseNumericPattern(numericPatterns.dayOfYear, string);\n\n case 'Do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(0, value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']\n },\n // Day of week\n E: {\n priority: 90,\n parse: function (string, token, match, _options) {\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T']\n },\n // Local day of week\n e: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var 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':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'eo':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'eee':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']\n },\n // Stand-alone local day of week\n c: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var 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':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'co':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'ccc':\n return match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']\n },\n // ISO day of week\n i: {\n priority: 90,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n if (value === 0) {\n return 7;\n }\n\n return value;\n };\n\n switch (token) {\n // 2\n case 'i':\n case 'ii':\n // 02\n return parseNDigits(token.length, string);\n // 2nd\n\n case 'io':\n return match.ordinalNumber(string, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // T\n\n case 'iiiii':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tu\n\n case 'iiiiii':\n return match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tuesday\n\n case 'iiii':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 7;\n },\n set: function (date, _flags, value, options) {\n date = setUTCISODay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']\n },\n // AM or PM\n a: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'a':\n case 'aa':\n case 'aaa':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaaa':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // AM, PM, midnight\n b: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'b':\n case 'bb':\n case 'bbb':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbbb':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // in the morning, in the afternoon, in the evening, at night\n B: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 't', 'T']\n },\n // Hour [1-12]\n h: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'h':\n return parseNumericPattern(numericPatterns.hour12h, string);\n\n case 'ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 12;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setUTCHours(0, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['H', 'K', 'k', 't', 'T']\n },\n // Hour [0-23]\n H: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'H':\n return parseNumericPattern(numericPatterns.hour23h, string);\n\n case 'Ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 23;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(value, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T']\n },\n // Hour [0-11]\n K: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'K':\n return parseNumericPattern(numericPatterns.hour11h, string);\n\n case 'Ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T']\n },\n // Hour [1-24]\n k: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'k':\n return parseNumericPattern(numericPatterns.hour24h, string);\n\n case 'ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 24;\n },\n set: function (date, _flags, value, _options) {\n var hours = value <= 24 ? value % 24 : value;\n date.setUTCHours(hours, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T']\n },\n // Minute\n m: {\n priority: 60,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'm':\n return parseNumericPattern(numericPatterns.minute, string);\n\n case 'mo':\n return match.ordinalNumber(string, {\n unit: 'minute'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMinutes(value, 0, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Second\n s: {\n priority: 50,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 's':\n return parseNumericPattern(numericPatterns.second, string);\n\n case 'so':\n return match.ordinalNumber(string, {\n unit: 'second'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCSeconds(value, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Fraction of second\n S: {\n priority: 30,\n parse: function (string, token, _match, _options) {\n var valueCallback = function (value) {\n return Math.floor(value * Math.pow(10, -token.length + 3));\n };\n\n return parseNDigits(token.length, string, valueCallback);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMilliseconds(value);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Timezone (ISO-8601. +00:00 is `'Z'`)\n X: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'X':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'XX':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'XXXX':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'XXXXX':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'XXX':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'x']\n },\n // Timezone (ISO-8601)\n x: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'x':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'xx':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'xxxx':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'xxxxx':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'xxx':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'X']\n },\n // Seconds timestamp\n t: {\n priority: 40,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value * 1000), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n },\n // Milliseconds timestamp\n T: {\n priority: 20,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n }\n};\nexport default parsers;","import defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport assign from \"../_lib/assign/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport parsers from \"./_lib/parsers/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar TIMEZONE_UNIT_PRIORITY = 10; // 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\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar notWhitespaceRegExp = /\\S/;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\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://git.io/fxCyr\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, Su, Sa | |\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, Su, Sa | 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, Su, Sa | |\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, Su, Sa | |\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, 0001, ..., 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]{@link https://date-fns.org/docs/setISOWeekYear}\n * and [setWeekYear]{@link 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://git.io/fxCyr\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://git.io/fxCyr\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 * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Old `parse` was renamed to `toDate`.\n * Now `parse` is a new function which parses a string using a provided format.\n *\n * ```javascript\n * // Before v2.0.0\n * parse('2016-01-01')\n *\n * // v2.0.0 onward (toDate no longer accepts a string)\n * toDate(1392098430000) // Unix to timestamp\n * toDate(new Date(2014, 1, 11, 11, 30, 30)) // Cloning the date\n * parse('2016-01-01', 'yyyy-MM-dd', new Date())\n * ```\n *\n * @param {String} dateString - the string to parse\n * @param {String} formatString - the string of tokens\n * @param {Date|Number} referenceDate - defines values missing from the parsed dateString\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {Date} the parsed date\n * @throws {TypeError} 3 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} `options.locale` must contain `match` property\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} 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 */\n\nexport default function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, dirtyOptions) {\n requiredArgs(3, arguments);\n var dateString = String(dirtyDateString);\n var formatString = String(dirtyFormatString);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n\n if (!locale.match) {\n throw new RangeError('locale must contain match property');\n }\n\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (formatString === '') {\n if (dateString === '') {\n return toDate(dirtyReferenceDate);\n } else {\n return new Date(NaN);\n }\n }\n\n var subFnOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale\n }; // If timezone isn't specified, it will be set to the system timezone\n\n var setters = [{\n priority: TIMEZONE_UNIT_PRIORITY,\n subPriority: -1,\n set: dateToSystemTimezone,\n index: 0\n }];\n var i;\n var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, subFnOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp);\n var usedTokens = [];\n\n for (i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n var firstCharacter = token[0];\n var parser = parsers[firstCharacter];\n\n if (parser) {\n var incompatibleTokens = parser.incompatibleTokens;\n\n if (Array.isArray(incompatibleTokens)) {\n var incompatibleToken = void 0;\n\n for (var _i = 0; _i < usedTokens.length; _i++) {\n var usedToken = usedTokens[_i].token;\n\n if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {\n incompatibleToken = usedTokens[_i];\n break;\n }\n }\n\n if (incompatibleToken) {\n throw new RangeError(\"The format string mustn't contain `\".concat(incompatibleToken.fullToken, \"` and `\").concat(token, \"` at the same time\"));\n }\n } else if (parser.incompatibleTokens === '*' && usedTokens.length) {\n throw new RangeError(\"The format string mustn't contain `\".concat(token, \"` and any other token at the same time\"));\n }\n\n usedTokens.push({\n token: firstCharacter,\n fullToken: token\n });\n var parseResult = parser.parse(dateString, token, locale.match, subFnOptions);\n\n if (!parseResult) {\n return new Date(NaN);\n }\n\n setters.push({\n priority: parser.priority,\n subPriority: parser.subPriority || 0,\n set: parser.set,\n validate: parser.validate,\n value: parseResult.value,\n index: setters.length\n });\n dateString = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n } // Replace two single quote characters with one single quote character\n\n\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n } // Cut token from string, or, if string doesn't match the token, return Invalid Date\n\n\n if (dateString.indexOf(token) === 0) {\n dateString = dateString.slice(token.length);\n } else {\n return new Date(NaN);\n }\n }\n } // Check if the remaining input contains something other than whitespace\n\n\n if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {\n return new Date(NaN);\n }\n\n var uniquePrioritySetters = setters.map(function (setter) {\n return setter.priority;\n }).sort(function (a, b) {\n return b - a;\n }).filter(function (priority, index, array) {\n return array.indexOf(priority) === index;\n }).map(function (priority) {\n return setters.filter(function (setter) {\n return setter.priority === priority;\n }).sort(function (a, b) {\n return b.subPriority - a.subPriority;\n });\n }).map(function (setterArray) {\n return setterArray[0];\n });\n var date = toDate(dirtyReferenceDate);\n\n if (isNaN(date)) {\n return new Date(NaN);\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37\n\n\n var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));\n var flags = {};\n\n for (i = 0; i < uniquePrioritySetters.length; i++) {\n var setter = uniquePrioritySetters[i];\n\n if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {\n return new Date(NaN);\n }\n\n var result = setter.set(utcDate, flags, setter.value, subFnOptions); // Result is tuple (date, flags)\n\n if (result[0]) {\n utcDate = result[0];\n assign(flags, result[1]); // Result is date\n } else {\n utcDate = result;\n }\n }\n\n return utcDate;\n}\n\nfunction dateToSystemTimezone(date, flags) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n var convertedDate = new Date(0);\n convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());\n return convertedDate;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\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\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}","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}","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 Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Store from './store';\nimport { Collection, Place } from '@fleetbase/sdk';\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 getStores(params = {}) {\n return this.adapter.get('stores', params).then((stores) => {\n return new Collection(stores.map(attributes => {\n return new Store(attributes, this.adapter);\n }));\n });\n }\n\n getStoreLocations(params = {}) {\n return this.adapter.get('store-locations', params).then((locations) => {\n return new Collection(locations.map(attributes => {\n return new StoreLocation(attributes, this.adapter);\n }));\n });\n }\n \n getPaymentGateways() {\n return this.adapter.get('gateways').then((gateways) => {\n return new Collection(gateways.map(attributes => {\n return new PaymentGateway(attributes, this.adapter);\n }));\n });\n }\n}","import StorefrontStore from '../store';\nimport Cart from './cart';\nimport StoreLocation from './store-location';\nimport { ServiceQuote, ServiceRate, Place, Collection, Adapter } from '@fleetbase/sdk';\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 static getFromCart(adapter, ...params) {\n const quote = new DeliveryServiceQuote(adapter);\n\n return quote.fromCart(...params);\n }\n\n fromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n\n if (destination?.id) {\n destination = destination.id;\n }\n\n if (cart?.id) {\n cart = cart.id;\n }\n\n return this.adapter.get('service-quotes/from-cart', { origin, destination, cart, config, all }).then(serviceQuotes => {\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 });\n }\n}","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions, isResource, Order } from '@fleetbase/sdk';\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, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, 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 {\n Resolver,\n lookup\n};\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}","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\t * Builds an instance of the Fleetbase Storefront SDK\n\t *\n\t * @param {String} storeKey The access key for the storefront store\n\t * @param {Object} config The config object\n\t * @param {Boolean} debug Enable debug mode\n\t * @return {Storefront} Instance\n\t */\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"],"names":["isArray","Array","StorefrontResource","adapter","store","StorefrontStore","this","resource","onAfterFetch","syncAttributes","bind","actions","options","_this$options","Resource","reviewActions","StoreActions","count","storeId","params","get","namespace","Review","attributes","detectAdapter","isNodeEnvironment","lookup","isPhone","phone","test","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isKeyValid","key","length","startsWith","isEmpty","obj","none","size","objectType","Product","getAttribute","getAttributes","price","sale_price","isOnSale","id","then","reviews","Collection","map","_this","Category","category","products","customerActions","login","identity","password","post","Error","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","token","setHeaders","places","Place","_this2","orders","Order","_this3","cartActions","undefined","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","toInteger","dirtyNumber","NaN","number","Number","isNaN","Math","ceil","floor","requiredArgs","required","args","TypeError","toDate","argument","arguments","argStr","Object","prototype","toString","call","Date","getTime","console","warn","stack","addMilliseconds","dirtyDate","dirtyAmount","timestamp","getTimezoneOffsetInMilliseconds","date","utcDate","UTC","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isDate","value","isValid","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","formatDistance","result","tokenValue","replace","addSuffix","comparison","buildFormatLongFn","width","String","defaultWidth","formats","dateFormats","full","long","medium","short","timeFormats","dateTimeFormats","formatLong","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","formatRelative","_date","_baseDate","_options","buildLocalizeFn","dirtyIndex","dirtyOptions","valuesArray","context","formattingValues","defaultFormattingWidth","_defaultWidth","_width","values","argumentCallback","eraValues","narrow","abbreviated","wide","quarterValues","monthValues","dayValues","dayPeriodValues","am","pm","midnight","noon","morning","afternoon","evening","night","formattingDayPeriodValues","ordinalNumber","rem100","localize","era","quarter","month","day","dayPeriod","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","pattern","findKey","valueCallback","rest","slice","object","predicate","hasOwnProperty","array","buildMatchPatternFn","parseResult","parsePattern","matchOrdinalNumberPattern","parseOrdinalNumberPattern","matchEraPatterns","parseEraPatterns","any","matchQuarterPatterns","parseQuarterPatterns","matchMonthPatterns","parseMonthPatterns","matchDayPatterns","parseDayPatterns","matchDayPeriodPatterns","parseDayPeriodPatterns","parseInt","index","locale","weekStartsOn","firstWeekContainsDate","subMilliseconds","addLeadingZeros","targetLength","sign","output","abs","formatters","y","signedYear","getUTCFullYear","year","M","getUTCMonth","d","getUTCDate","a","dayPeriodEnumValue","getUTCHours","toUpperCase","h","H","m","getUTCMinutes","s","getUTCSeconds","S","numberOfDigits","milliseconds","getUTCMilliseconds","pow","MILLISECONDS_IN_DAY","getUTCDayOfYear","setUTCMonth","setUTCHours","startOfYearTimestamp","difference","startOfUTCISOWeek","getUTCDay","diff","setUTCDate","getUTCISOWeekYear","fourthOfJanuaryOfNextYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","startOfUTCISOWeekYear","fourthOfJanuary","MILLISECONDS_IN_WEEK","getUTCISOWeek","round","startOfUTCWeek","localeWeekStartsOn","defaultWeekStartsOn","RangeError","getUTCWeekYear","localeFirstWeekContainsDate","defaultFirstWeekContainsDate","firstWeekOfNextYear","firstWeekOfThisYear","startOfUTCWeekYear","firstWeek","getUTCWeek","dayPeriodEnum","G","unit","lightFormatters","Y","signedWeekYear","weekYear","R","u","Q","q","L","w","week","I","isoWeek","D","dayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","toLowerCase","b","hours","B","K","k","X","_localize","timezoneOffset","_originalDate","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","originalDate","T","offset","dirtyDelimiter","absOffset","minutes","delimiter","dateLongFormatter","timeLongFormatter","dateTimeLongFormatter","dateTimeFormat","datePattern","timePattern","longFormatters","p","P","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","indexOf","isProtectedWeekYearToken","throwProtectedError","input","concat","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","dirtyFormatStr","formatStr","defaultLocale","formatterOptions","substring","firstCharacter","longFormatter","join","cleanEscapedString","formatter","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","assign","target","dirtyObject","property","setUTCDay","dirtyDay","currentDay","remainder","dayIndex","setUTCISODay","setUTCISOWeek","dirtyISOWeek","setUTCWeek","dirtyWeek","MILLISECONDS_IN_HOUR","MILLISECONDS_IN_MINUTE","MILLISECONDS_IN_SECOND","numericPatterns","hour23h","hour24h","hour11h","hour12h","minute","second","singleDigit","twoDigits","threeDigits","fourDigits","anyDigitsSigned","singleDigitSigned","twoDigitsSigned","threeDigitsSigned","fourDigitsSigned","timezonePatterns","basicOptionalMinutes","basic","basicOptionalSeconds","extended","extendedOptionalSeconds","parseNumericPattern","parseTimezonePattern","seconds","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","enumValue","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","isLeapYearIndex","parsers","priority","parse","set","flags","incompatibleTokens","isTwoDigitYear","validate","normalizedTwoDigitYear","_match","_flags","firstWeekOfYear","subPriority","isLeapYear","wholeWeekDays","isPM","setUTCMinutes","setUTCSeconds","setUTCMilliseconds","timestampIsSet","_token","TIMEZONE_UNIT_PRIORITY","notWhitespaceRegExp","dirtyDateString","dirtyFormatString","dirtyReferenceDate","dateString","formatString","subFnOptions","setters","dateToSystemTimezone","tokens","usedTokens","parser","incompatibleToken","_i","usedToken","fullToken","push","uniquePrioritySetters","setter","sort","filter","setterArray","convertedDate","setFullYear","setHours","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","PaymentGateway","type","Store","storeLocations","place","gateways","_this4","_this5","Network","stores","locations","DeliveryServiceQuote","Adapter","origin","destination","cart","config","all","_origin","_destination","_cart","serviceQuotes","serviceQuote","quote","fromCart","ServiceQuote","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","resources","adapters","BrowserAdapter","NodeAdapter","Resolver","className","pluralize","singularize","extendStoreActions","json","classify","Storefront","storeKey","debug","version","host","publicKey","categories","extendActions","customers","checkout","product"],"mappings":"yrQAAA,IAAQA,EAAYC,MAAZD,QAAAA,OAAAA,IAAAA,eAAAA,EAAAA,kyrCCGaE,oIAONC,qBACFA,QAAUA,OACVC,MAAQ,IAAIC,GAAgBC,KAAKC,SAAUJ,EAAS,CACrDK,aAAcF,KAAKG,eAAeC,KAAKJ,MACvCK,kBAASL,KAAKM,4BAALC,EAAcF,UAGpBL,YAdiCQ,ICA1CC,GAAgB,IAAIC,GAAa,CACn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,aClCNrH,4EAEJqH,kDAGb,eAAc/G,yDAAU,UACbmkB,GAAmBxkB,KAAMK,4BAGpC,SAAUokB,UACCrjB,GAAO,WAAYsjB,GAAS1kB,KAAKC,UAAWwkB,EAAMzkB,KAAKH,gBAVzBiiB,ICYxB6C,yBASLC,OAAUhC,yDAAS,GAAIiC,4EAC1BC,QAAUlC,EAAOkC,SAAW,UAC5BxkB,QAAU,CACXwkB,QAAS9kB,KAAK8kB,QACdC,KAAMnC,EAAOmC,MAAQ,2BACrBhkB,UAAW,qBAAcf,KAAK8kB,UAAalC,EAAO7hB,UAClDikB,UAAWJ,EACXC,MAAAA,IAGC7iB,GAAW4iB,SACN,IAAI/gB,MAAM,0DAGfhE,QAAU+iB,EAAO/iB,SAAWqB,GAAclB,KAAKM,cAE/CiD,SAAW,IAAIxD,GAAgB,UAAWC,KAAKH,cAC/ColB,WAAa,IAAIllB,GAAgB,WAAYC,KAAKH,cAClDoD,QAAU,IAAIlD,GAAgB,SAAUC,KAAKH,SAASqlB,cAAczkB,SACpE0kB,UAAY,IAAIplB,GAAgB,WAAYC,KAAKH,SAASqlB,cAAc1hB,SACxEmf,KAAO,IAAI5iB,GAAgB,OAAQC,KAAKH,SAASqlB,cAAcngB,SAC/DqgB,SAAW,IAAIrlB,GAAgB,WAAYC,KAAKH,SAASqlB,cAAc5B,mCAIhF,kBACWtjB,KAAKH,QAAQiB,IAAI,+BAI5B,SAAOoE,OAAO5E,yDAAU,UACbN,KAAKH,QAAQiB,IAAI,YAAYoE,MAAAA,GAAU5E,IAAW0C,MAAK,SAAAO,UACnD,IAAIL,GAAWK,EAASJ,KAAI,SAAAkiB,UAAW,IAAI5iB,GAAQ4iB,oCAQlE,SAAWxlB,QACFA,QAAUA,4BAGnB,kBACWG,KAAKH,qCAThB,oBACe8kB,6BAAcvd"} \ 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/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","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 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 getSavedPlaces() {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/places')\n .then((places) => {\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n });\n }\n\n getOrderHistory(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/orders', params)\n .then((orders) => {\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\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 getStores(params = {}) {\n return this.adapter.get('stores', params).then((stores) => {\n return new Collection(\n stores.map((attributes) => {\n return new Store(attributes, this.adapter);\n })\n );\n });\n }\n\n getStoreLocations(params = {}) {\n return this.adapter.get('store-locations', params).then((locations) => {\n return new Collection(\n locations.map((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateways() {\n return this.adapter.get('gateways').then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\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 static getFromCart(adapter, ...params) {\n const quote = new DeliveryServiceQuote(adapter);\n\n return quote.fromCart(...params);\n }\n\n fromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n\n if (destination?.id) {\n destination = destination.id;\n }\n\n if (cart?.id) {\n cart = cart.id;\n }\n\n return this.adapter\n .get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n })\n .then((serviceQuotes) => {\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 });\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","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","isEmpty","_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","token","setHeaders","_this2","places","Place","_this3","orders","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","toLowerCase","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","stores","locations","DeliveryServiceQuote","_ServiceQuote","Adapter","_possibleConstructorReturn","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","quote","_len","_key","fromCart","ServiceQuote","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","_this$store","_this$store2","resources","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":"u1HACsC,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,OAJIH,IACAG,EAAOf,MAAQY,GAGZnB,KAAKK,QAAQkB,IAAGC,GAAAA,OAAIxB,KAAKyB,UAAS,UAAUH,EAAQR,EAC/D,IAGiBY,WAAMhC,GAAAC,EAAA+B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AAQkB,IAAI,SAAQwC,EAAA,CAAIsB,MAAAA,GAAUvE,IAAWiC,MAAK,SAACM,GAC3D,OAAO,IAAIJ,EAAAA,WAAWI,EAASH,KAAI,SAACqf,GAAO,OAAK,IAAIlgB,EAAQkgB,EAAQ,IACxE,GACJ,GAAC,CAAApiB,IAAA,aAAAC,MAMD,SAAWC,GACPL,KAAKK,QAAUA,CACnB,GAAC,CAAAF,IAAA,aAAAC,MAED,WACI,OAAOJ,KAAKK,OAChB,IAAC,CAAA,CAAAF,IAAA,cAAAC,MAVD,WACI,OAAAghB,EAAWM,EAAUxc,MAAA4B,UAAA4G,MAAA9L,KAAI3B,WAC7B,KAACyhB,CAAA,CA/C0B","x_google_ignoreList":[10,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]} \ No newline at end of file diff --git a/dist/cjs/storefront.js b/dist/cjs/storefront.js index 8274470..cea201e 100644 --- a/dist/cjs/storefront.js +++ b/dist/cjs/storefront.js @@ -1,5591 +1,2 @@ -'use strict'; -function t(t) { - return t && 'object' == typeof t && 'default' in t ? t : { default: t }; -} -Object.defineProperty(exports, '__esModule', { value: !0 }); -var e = t(require('axios')); -function n(t, e) { - var n = Object.keys(t); - if (Object.getOwnPropertySymbols) { - var r = Object.getOwnPropertySymbols(t); - e && - (r = r.filter(function (e) { - return Object.getOwnPropertyDescriptor(t, e).enumerable; - })), - n.push.apply(n, r); - } - return n; -} -function r(t) { - for (var e = 1; e < arguments.length; e++) { - var r = null != arguments[e] ? arguments[e] : {}; - e % 2 - ? n(Object(r), !0).forEach(function (e) { - s(t, e, r[e]); - }) - : Object.getOwnPropertyDescriptors - ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) - : n(Object(r)).forEach(function (e) { - Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e)); - }); - } - return t; -} -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 a(t, e) { - if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function'); -} -function o(t, e) { - for (var n = 0; n < e.length; n++) { - var r = e[n]; - (r.enumerable = r.enumerable || !1), (r.configurable = !0), 'value' in r && (r.writable = !0), Object.defineProperty(t, r.key, r); - } -} -function u(t, e, n) { - return e && o(t.prototype, e), n && o(t, n), t; -} -function s(t, e, n) { - return ( - e in t - ? Object.defineProperty(t, e, { - value: n, - enumerable: !0, - configurable: !0, - writable: !0, - }) - : (t[e] = n), - t - ); -} -function c(t, e) { - if ('function' != typeof e && null !== e) throw new TypeError('Super expression must either be null or a function'); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && l(t, e); -} -function h(t) { - return ( - (h = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - }), - h(t) - ); -} -function l(t, e) { - return ( - (l = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - }), - l(t, e) - ); -} -function d() { - if ('undefined' == typeof Reflect || !Reflect.construct) return !1; - if (Reflect.construct.sham) return !1; - if ('function' == typeof Proxy) return !0; - try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0; - } catch (t) { - return !1; - } -} -function f(t, e, n) { - return ( - (f = d() - ? Reflect.construct - : function (t, e, n) { - var r = [null]; - r.push.apply(r, e); - var i = new (Function.bind.apply(t, r))(); - return n && l(i, n.prototype), i; - }), - f.apply(null, arguments) - ); -} -function v(t, e) { - if (e && ('object' == typeof e || 'function' == typeof e)) return e; - if (void 0 !== e) throw new TypeError('Derived constructors may only return object or undefined'); - return (function (t) { - if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - return t; - })(t); -} -function g(t) { - var e = d(); - return function () { - var n, - r = h(t); - if (e) { - var i = h(this).constructor; - n = Reflect.construct(r, arguments, i); - } else n = r.apply(this, arguments); - return v(this, n); - }; -} -function p(t) { - return ( - (function (t) { - if (Array.isArray(t)) return y(t); - })(t) || - (function (t) { - if (('undefined' != typeof Symbol && null != t[Symbol.iterator]) || null != t['@@iterator']) return Array.from(t); - })(t) || - (function (t, e) { - if (!t) return; - if ('string' == typeof t) return y(t, e); - var n = Object.prototype.toString.call(t).slice(8, -1); - 'Object' === n && t.constructor && (n = t.constructor.name); - if ('Map' === n || 'Set' === n) return Array.from(t); - if ('Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return y(t, e); - })(t) || - (function () { - throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); - })() - ); -} -function y(t, e) { - (null == e || e > t.length) && (e = t.length); - for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; - return r; -} -function m(t, e) { - var n = Object.keys(t); - if (Object.getOwnPropertySymbols) { - var r = Object.getOwnPropertySymbols(t); - e && - (r = r.filter(function (e) { - return Object.getOwnPropertyDescriptor(t, e).enumerable; - })), - n.push.apply(n, r); - } - return n; -} -function w(t) { - for (var e = 1; e < arguments.length; e++) { - var n = null != arguments[e] ? arguments[e] : {}; - e % 2 - ? m(Object(n), !0).forEach(function (e) { - E(t, e, n[e]); - }) - : Object.getOwnPropertyDescriptors - ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) - : m(Object(n)).forEach(function (e) { - Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e)); - }); - } - return t; -} -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; - })(t); -} -function k(t, e, n, r, i, a, o) { - try { - var u = t[a](o), - s = u.value; - } catch (t) { - return void n(t); - } - u.done ? e(s) : Promise.resolve(s).then(r, i); -} -function x(t) { - return function () { - var e = this, - n = arguments; - return new Promise(function (r, i) { - var a = t.apply(e, n); - function o(t) { - k(a, r, i, o, u, 'next', t); - } - function u(t) { - k(a, r, i, o, u, 'throw', t); - } - o(void 0); - }); - }; -} -function T(t, e) { - if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function'); -} -function C(t, e) { - for (var n = 0; n < e.length; n++) { - var r = e[n]; - (r.enumerable = r.enumerable || !1), (r.configurable = !0), 'value' in r && (r.writable = !0), Object.defineProperty(t, r.key, r); - } -} -function A(t, e, n) { - return e && C(t.prototype, e), n && C(t, n), t; -} -function E(t, e, n) { - return ( - e in t - ? Object.defineProperty(t, e, { - value: n, - enumerable: !0, - configurable: !0, - writable: !0, - }) - : (t[e] = n), - t - ); -} -function D(t, e) { - if ('function' != typeof e && null !== e) throw new TypeError('Super expression must either be null or a function'); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && S(t, e); -} -function O(t) { - return (O = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - })(t); -} -function S(t, e) { - return (S = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - })(t, e); -} -function P() { - if ('undefined' == typeof Reflect || !Reflect.construct) return !1; - if (Reflect.construct.sham) return !1; - if ('function' == typeof Proxy) return !0; - try { - return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0; - } catch (t) { - return !1; - } -} -function R(t, e, n) { - return (R = P() - ? Reflect.construct - : function (t, e, n) { - var r = [null]; - r.push.apply(r, e); - var i = new (Function.bind.apply(t, r))(); - return n && S(i, n.prototype), i; - }).apply(null, arguments); -} -function U(t) { - var e = 'function' == typeof Map ? new Map() : void 0; - return (U = function (t) { - if (null === t || ((n = t), -1 === Function.toString.call(n).indexOf('[native code]'))) return t; - var n; - if ('function' != typeof t) throw new TypeError('Super expression must either be null or a function'); - if (void 0 !== e) { - if (e.has(t)) return e.get(t); - e.set(t, r); - } - function r() { - return R(t, arguments, O(this).constructor); - } - return ( - (r.prototype = Object.create(t.prototype, { - constructor: { - value: r, - enumerable: !1, - writable: !0, - configurable: !0, - }, - })), - S(r, t) - ); - })(t); -} -function M(t, e) { - return !e || ('object' != typeof e && 'function' != typeof e) - ? (function (t) { - if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - return t; - })(t) - : e; -} -function j(t) { - var e = P(); - return function () { - var n, - r = O(t); - if (e) { - var i = O(this).constructor; - n = Reflect.construct(r, arguments, i); - } else n = r.apply(this, arguments); - return M(this, n); - }; -} -function q(t, e) { - return ( - (function (t) { - if (Array.isArray(t)) return t; - })(t) || - (function (t, e) { - var n = null == t ? null : ('undefined' != typeof Symbol && t[Symbol.iterator]) || t['@@iterator']; - if (null != n) { - var r, - i, - a = [], - o = !0, - u = !1; - try { - for (n = n.call(t); !(o = (r = n.next()).done) && (a.push(r.value), !e || a.length !== e); o = !0); - } catch (t) { - (u = !0), (i = t); - } finally { - try { - o || null == n.return || n.return(); - } finally { - if (u) throw i; - } - } - return a; - } - })(t, e) || - N(t, e) || - (function () { - throw new TypeError('Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); - })() - ); -} -function $(t) { - return ( - (function (t) { - if (Array.isArray(t)) return H(t); - })(t) || - (function (t) { - if (('undefined' != typeof Symbol && null != t[Symbol.iterator]) || null != t['@@iterator']) return Array.from(t); - })(t) || - N(t) || - (function () { - throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); - })() - ); -} -function N(t, e) { - if (t) { - if ('string' == typeof t) return H(t, e); - var n = Object.prototype.toString.call(t).slice(8, -1); - return ( - 'Object' === n && t.constructor && (n = t.constructor.name), - 'Map' === n || 'Set' === n ? Array.from(t) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? H(t, e) : void 0 - ); - } -} -function H(t, e) { - (null == e || e > t.length) && (e = t.length); - for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; - return r; -} -var Y = Array.isArray, - L = 'undefined' == typeof arguments ? void 0 : arguments, - F = function (t, e, n) { - var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : []; - if (Y(t)) - if (r.length <= 6e4) t.splice.apply(t, [e, n].concat($(r))); - else { - t.splice(e, n); - for (var i = 0; i < r.length; i += 6e4) { - var a = r.slice(i, i + 6e4); - t.splice.apply(t, [e + i, 0].concat($(a))); - } - } - else W(arr) && t.replace(e, n, r); - }, - _ = function (t) { - return t; - }, - W = function (t) { - return t instanceof Z; - }, - z = function (t, e) { - return Y(t) ? t[e] : W(t) ? t.objectAt(e) : null; - }, - I = function (t, e) { - return 2 === L.length - ? function (n) { - return e === n[t]; - } - : function (e) { - return Boolean(e[t]); - }; - }, - Q = function (t, e) { - for (var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, r = t.length, i = n; i < r; i++) { - var a = z(t, i); - if (e(a, i, t)) return i; - } - return -1; - }, - B = function (t, e, n) { - var r = e.bind(n), - i = Q(t, r, 0); - return -1 === i ? void 0 : z(t, i); - }, - G = function (t, e, n) { - var r = e.bind(n); - return -1 !== Q(t, r, 0); - }, - X = function (t, e, n) { - var r = e.bind(n); - return ( - -1 === - Q( - t, - function (t, e, n) { - return !r(t, e, n); - }, - 0 - ) - ); - }, - K = function (t, e) { - var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, - r = arguments.length > 3 ? arguments[3] : void 0, - i = t.length; - n < 0 && (n += i); - var a = - r && e != e - ? function (t) { - return t != t; - } - : function (t) { - return t === e; - }; - return Q(t, a, n); - }, - J = function (t, e, n) { - return F(t, e, 0, [n]), n; - }, - Z = (function (t) { - D(n, U(Array)); - var e = j(n); - function n() { - for (var t = arguments.length, r = new Array(t), i = 0; i < t; i++) r[i] = arguments[i]; - return T(this, n), M(Y(arguments[0]) ? e.call.apply(e, [this].concat($(arguments[0]))) : e.apply(this, arguments)); - } - return ( - A(n, [ - { - key: 'notEmpty', - get: function () { - return this.length > 0; - }, - }, - { - key: 'empty', - get: function () { - return 0 === this.length; - }, - }, - { - key: 'first', - get: function () { - return z(this, 0); - }, - }, - { - key: 'last', - get: function () { - return z(this, this.length - 1); - }, - }, - { - key: 'replace', - value: function (t, e) { - var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : []; - return F(this, t, e, n), this; - }, - }, - { - key: 'objectsAt', - value: function (t) { - var e = this; - return t.map(function (t) { - return z(e, t); - }); - }, - }, - { - key: 'objectAt', - value: function (t) { - return z(this, t); - }, - }, - { - key: 'indexOf', - value: function (t, e) { - return K(this, t, e, !1); - }, - }, - { - key: 'lastIndexOf', - value: function (t, e) { - var n = this.length; - (void 0 === e || e >= n) && (e = n - 1), e < 0 && (e += n); - for (var r = e; r >= 0; r--) if (z(this, r) === t) return r; - return -1; - }, - }, - { - key: 'includes', - value: function (t, e) { - return -1 !== K(this, t, e, !0); - }, - }, - { - key: 'findBy', - value: function () { - return B(this, I.apply(void 0, arguments)); - }, - }, - { - key: 'findIndexBy', - value: function () { - return Q(this, I.apply(void 0, arguments)); - }, - }, - { - key: 'isEvery', - value: function () { - return X(this, I.apply(void 0, arguments)); - }, - }, - { - key: 'isAny', - value: function () { - return G(this, I.apply(void 0, arguments)); - }, - }, - { - key: 'invoke', - value: function (t) { - for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) n[r - 1] = arguments[r]; - var i = []; - return ( - this.forEach(function (e) { - var r; - return i.push(null === (r = e[t]) || void 0 === r ? void 0 : r.call.apply(r, [e].concat(n))); - }), - i - ); - }, - }, - { - key: 'toArray', - value: function () { - return this.map(function (t) { - return t; - }); - }, - }, - { - key: 'compact', - value: function () { - return this.filter(function (t) { - return null != t; - }); - }, - }, - { - key: 'sortBy', - value: function () { - var t = arguments; - return this.sort(function (e, n) { - for (var r = 0; r < t.length; r++) { - var i = t[r], - a = e[i], - o = n[i], - u = compare(a, o); - if (u) return u; - } - return 0; - }); - }, - }, - { - key: 'uniqBy', - value: function (t) { - return (function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : _, - n = [], - r = new Set(), - i = - 'function' == typeof e - ? e - : function (t) { - return get(t, e); - }; - return ( - t.forEach(function (t) { - var e = i(t); - r.has(e) || (r.add(e), n.push(t)); - }), - n - ); - })(this, t); - }, - }, - { - key: 'without', - value: function (t) { - if (!this.includes(t)) return this; - var e = - t == t - ? function (e) { - return e !== t; - } - : function (t) { - return t == t; - }; - return this.filter(e); - }, - }, - { - key: 'clear', - value: function () { - var t = this.length; - return 0 === t || this.replace(0, t, []), this; - }, - }, - { - key: 'insertAt', - value: function (t, e) { - return J(this, t, e), this; - }, - }, - { - key: 'replaceAt', - value: function (t, e) { - return this.replace(t, 1, [e]); - }, - }, - { - key: 'removeAt', - value: function (t, e) { - return (function (t, e) { - return F(t, e, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, []), t; - })(this, t, e); - }, - }, - { - key: 'pushObject', - value: function (t) { - return this.insertAt(this.length, t); - }, - }, - { - key: 'pushObjects', - value: function (t) { - return this.replace(this.length, 0, t), this; - }, - }, - { - key: 'popObject', - value: function () { - var t = this.length; - if (0 === t) return null; - var e = z(this, t - 1); - return this.removeAt(t - 1, 1), e; - }, - }, - { - key: 'shiftObject', - value: function () { - if (0 === this.length) return null; - var t = z(this, 0); - return this.removeAt(0), t; - }, - }, - { - key: 'unshiftObject', - value: function (t) { - return J(this, 0, t); - }, - }, - { - key: 'unshiftObjects', - value: function (t) { - return this.replace(0, 0, t), this; - }, - }, - { - key: 'reverseObjects', - value: function () { - var t = this.length; - if (0 === t) return this; - var e = this.toArray().reverse(); - return this.replace(0, t, e), this; - }, - }, - { - key: 'setObjects', - value: function (t) { - if (0 === t.length) return this.clear(); - var e = this.length; - return this.replace(0, e, t), this; - }, - }, - { - key: 'removeObject', - value: function (t) { - for (var e = this.length || 0; --e >= 0; ) z(this, e) === t && this.removeAt(e); - return this; - }, - }, - { - key: 'removeObjects', - value: function (t) { - for (var e = t.length - 1; e >= 0; e--) this.removeObject(t[e]); - return this; - }, - }, - { - key: 'addObject', - value: function (t) { - return this.includes(t) || this.pushObject(t), this; - }, - }, - { - key: 'addObjects', - value: function (t) { - var e = this; - return ( - t.forEach(function (t) { - return e.addObject(t); - }), - this - ); - }, - }, - ]), - n - ); - })(), - V = function (t) { - var e = null == t; - if (e) return e; - if ('number' == typeof t.size) return !t.size; - var n = b(t); - if ('object' === n) { - var r = t.size; - if ('number' == typeof r) return !r; - } - if ('number' == typeof t.length && 'function' !== n) return !t.length; - if ('object' === n) { - var i = t.length; - if ('number' == typeof i) return !i; - } - return !1; - }, - tt = function (t) { - return V(t) || ('string' == typeof t && !1 === /\S/.test(t)); - }; -function et(t) { - return t instanceof ht; -} -var nt = function () { - var t, e, n, r, i; - return !( - 'undefined' == typeof process || - ('object' !== b(null === (t = process) || void 0 === t ? void 0 : t.env) && - -1 === (null === (e = process.release) || void 0 === e || null === (n = e.name) || void 0 === n ? void 0 : n.search(/node|io.js/))) || - ('undefined' != typeof window && 'ReactNative' !== (null === (r = window) || void 0 === r || null === (i = r.navigator) || void 0 === i ? void 0 : i.product)) - ); - }, - rt = function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return nt() ? Dt('adapter', 'NodeAdapter', t) : Dt('adapter', 'BrowserAdapter', t); - }, - it = Array.isArray; -!(function () { - function t(e) { - T(this, t), (this.place = e), (this.geometry = null == e ? void 0 : e.geometry), (this.components = this.parseComponents()), (this.attributes = this.parseProperties()); - } - A(t, [ - { - key: 'parse', - value: function () { - this.parseComponents(), this.parseProperties(); - }, - }, - { - key: 'parseComponents', - value: function () { - var t; - return ((null === (t = this.place) || void 0 === t ? void 0 : t.address_components) || []).reduce(function (t, e) { - return ( - e.types.forEach(function (n) { - t[n] = e; - }), - t - ); - }, {}); - }, - }, - { - key: 'parseProperties', - value: function () { - var t, - e = { - streetNumber: this.get('street_number'), - streetName: this.get('route'), - coordinates: null !== (t = this.geometry) && void 0 !== t && t.location ? Object.values(this.geometry.location) : [0, 0], - city: this.or(['locality', 'sublocality', 'sublocality_level_1', 'neighborhood', 'administrative_area_level_3', 'administrative_area_level_2']), - county: this.get('administrative_area_level_2'), - stateShort: this.get('administrative_area_level_1', !0), - stateLong: this.get('administrative_area_level_1'), - countryShort: this.get('country', !0), - country: this.get('country', !0), - countryLong: this.get('country'), - postalCode: this.get('postal_code'), - }; - return (e.address = [e.streetNumber, e.streetName].filter(Boolean).join(' ')), e; - }, - }, - { - key: 'all', - value: function () { - return this.attributes; - }, - }, - { - key: 'or', - value: function () { - for (var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], e = 0; e < t.length; e++) { - var n = t[e]; - if (it(n)) { - var r = n[0], - i = n[1]; - if (this.has(r)) return this.get(r, i); - } else if (this.has(n)) return this.get(n); - } - return null; - }, - }, - { - key: 'has', - value: function (t) { - return t in this.components; - }, - }, - { - key: 'get', - value: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; - return t in this.components ? (e ? this.components[t].short_name : this.components[t].long_name) : null; - }, - }, - { - key: 'setAttributes', - value: function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return (this.attributes = w(w({}, this.attributes), t)), this; - }, - }, - { - key: 'setAttribute', - value: function (t, e) { - return (this.attributes[t] = e), this; - }, - }, - { - key: 'getAttribute', - value: function (t) { - return this.attributes[t] || null; - }, - }, - ]); -})(); -var at = (function () { - function t() { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, - n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; - T(this, t), (this.type = 'Point'), (this.coordinates = [n, e]); - } - return ( - A( - t, - [ - { - key: 'latitude', - get: function () { - return this.coordinates[1]; - }, - }, - { - key: 'longitude', - get: function () { - return this.coordinates[0]; - }, - }, - { - key: 'lat', - value: function () { - return this.latitude; - }, - }, - { - key: 'lng', - value: function () { - return this.longitude; - }, - }, - { - key: 'serialize', - value: function () { - return { type: 'Point', coorindates: [this.lat(), this.lng()] }; - }, - }, - { - key: 'toJson', - value: function () { - return this.serialize(); - }, - }, - { - key: 'toString', - value: function () { - return '('.concat(this.latitude, ', ').concat(this.longitude, ')'); - }, - }, - ], - [ - { - key: 'fromGeoJson', - value: function (e) { - var n = q(e.coordinates, 2); - return (longitude = n[0]), (latitude = n[1]), new t(latitude, longitude); - }, - }, - ] - ), - t - ); -})(); -'undefined' == typeof arguments || arguments; -var ot = function (t, e) { - var n = t(); - return Array.isArray(n) || 'object' === b(n) ? ut(n, e) : null; - }, - ut = function t(e, n) { - var r, - i = e, - a = b(e), - o = 'object' === a, - u = 'function' === a, - s = Array.isArray(e), - c = 'string' === b(n) && n.includes('.') ? n.split('.') : [n]; - if (s || o) { - for (var h = 0; h < c.length; h++) { - if (i && void 0 === i[c[h]]) return null; - if (i) { - if ('object' === b((r = i = i[c[h]])) && !V(null == r ? void 0 : r.attributes) && 'object' === b(null == r ? void 0 : r.attributes) && void 0 !== c[h + 1]) { - var l = c.slice(h + 1).join('.'); - return t(i.attributes, l); - } - if ('function' == typeof i) { - var d = c.slice(h + 1).join('.'); - return ot(i, d); - } - } - } - return i; - } - if (u) return ot(e, n); - }, - st = function (t, e, n) { - var r = t, - i = 'object' === b(t), - a = Array.isArray(t), - o = 'string' === b(e) && e.includes('.') ? e.split('.') : [e], - u = o.length; - if (a || i) { - for (var s = 0; s < u - 1; s++) r[o[s]] || (r[o[s]] = {}), (r = r[o[s]]); - r[o[u - 1]] = n; - } - return n; - }, - ct = (function () { - function t() { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; - T(this, t), (this.actions = e), (this.bind = n); - } - return ( - A(t, [ - { - key: 'extend', - value: function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null, - e = t || this.bind; - if (!e) return this; - if (null != this && this.actions && 'object' === b(this.actions)) - for (var n in this.actions) { - var r = this.actions[n]; - st(e, n, 'function' == typeof r ? r.bind(e) : r); - } - return this; - }, - }, - ]), - t - ); - })(), - ht = (function () { - function t() { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - n = arguments.length > 1 ? arguments[1] : void 0, - r = arguments.length > 2 ? arguments[2] : void 0, - i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; - T(this, t), - (this.attributes = e), - (this.dirtyAttributes = {}), - (this.changes = {}), - (this.isLoading = !1), - (this.isSaving = !1), - (this.isDestroying = !1), - (this.isReloading = !1), - (this.resource = r), - (this.options = i), - (this.version = i.version || 'v1'), - this.setAdapter(n); - } - return ( - A(t, [ - { - key: 'setAdapter', - value: function (t) { - var e; - return ( - (this.adapter = t), - (this.store = new St(this.resource, t, { - onAfterFetch: this.syncAttributes.bind(this), - actions: null === (e = this.options) || void 0 === e ? void 0 : e.actions, - })), - this - ); - }, - }, - { - key: 'id', - get: function () { - return this.getAttribute('id'); - }, - }, - { - key: 'create', - value: function () { - var t = this, - e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - n = this.mergeAttributes(e); - return ( - this.setFlags(['isLoading', 'isSaving']), - this.store.create(n).then(function (e) { - return t.setFlags(['isLoading', 'isSaving'], !1), e; - }) - ); - }, - }, - { - key: 'update', - value: function () { - var t = this, - e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return ( - this.setFlags(['isLoading', 'isSaving']), - this.store.update(this.attributes.id, e).then(function (e) { - return t.setFlags(['isLoading', 'isSaving'], !1), e; - }) - ); - }, - }, - { - key: 'destroy', - value: function () { - var t = this; - return ( - this.setFlags(['isLoading', 'isDestroying']), - this.store.destroy(this.attributes.id).then(function (e) { - return t.setFlags(['isLoading', 'isDestroying'], !1), e; - }) - ); - }, - }, - { - key: 'reload', - value: function () { - var t = this; - return ( - this.setFlags(['isLoading', 'isReloading']), - this.store.findRecord(this.attributes.id).then(function (e) { - return t.reset(), e; - }) - ); - }, - }, - { - key: 'setFlags', - value: function () { - for ( - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], - e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], - n = ['isLoading', 'isSaving', 'isReloading', 'isDestroying'], - r = 0; - r < t.length; - r++ - ) { - var i = t[r]; - if ('string' != typeof i || !n.includes(i)) throw new Error(''.concat(i, ' is not a valid flag!')); - this[i] = e; - } - return this; - }, - }, - { - key: 'reset', - value: function () { - return (this.dirtyAttributes = {}), (this.changes = {}), (this.isLoading = !1), (this.isSaving = !1), (this.isReloading = !1), this; - }, - }, - { - key: 'empty', - value: function () { - return this.reset(), (this.attribues = {}), this; - }, - }, - { - key: 'save', - value: function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - e = this.getAttributes(); - return V(this.id) ? this.create(e) : !0 === t.onlyDirty ? this.savedirty() : this.update(e); - }, - }, - { - key: 'saveDirty', - value: function () { - for (var t = Object.keys(this.dirtyAttributes), e = {}, n = 0; n < t.length; n++) { - var r = t[n]; - e[r] = this.getAttribute(r); - } - return this.update(e); - }, - }, - { - key: 'createdAt', - get: function () { - return this.hasAttribute('created_at') ? new Date(this.getAttribute('created_at')) : null; - }, - }, - { - key: 'updatedAt', - get: function () { - return this.hasAttribute('updated_at') ? new Date(this.getAttribute('updated_at')) : null; - }, - }, - { - key: 'isLoaded', - get: function () { - return this.hasAttributes(['created_at', 'id']); - }, - }, - { - key: 'isEmpty', - get: function () { - return 0 === Object.values(null == this ? void 0 : this.attributes).length; - }, - }, - { - key: 'isNew', - get: function () { - return !this.id; - }, - }, - { - key: 'isSaved', - get: function () { - return !this.isNew && this.isLoaded; - }, - }, - { - key: 'isDeleted', - get: function () { - return this.hasAttributes(['deleted', 'time']); - }, - }, - { - key: 'eachAttribute', - value: function (t) { - var e, - n = this; - return ( - 'function' != typeof t || - Object.keys(null !== (e = null == this ? void 0 : this.attributes) && void 0 !== e ? e : {}).forEach(function (e) { - var r = n.getAttribute(e); - t.call(n, r, e); - }), - this - ); - }, - }, - { - key: 'changes', - value: function () { - return this.changes; - }, - }, - { - key: 'getDirtyAttributes', - value: function () { - return this.dirtyAttributes; - }, - }, - { - key: 'isDirty', - value: function (t) { - return t in this.dirtyAttributes; - }, - }, - { - key: 'hasDirtyAttributes', - value: function () { - var t; - return Object.keys(null !== (t = null == this ? void 0 : this.dirtyAttributes) && void 0 !== t ? t : {}).length > 0; - }, - }, - { - key: 'mutate', - value: function (t, e) { - this.attributes[t] = e; - }, - }, - { - key: 'setAttribute', - value: function (t) { - var e, - n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; - if (null === n && 'object' === b(t)) return this.setAttributes(t); - var r = null !== (e = null == this ? void 0 : this.attributes[t]) && void 0 !== e ? e : null; - return ( - st(this.attributes, t, n), - st(this.dirtyAttributes, t, r), - Y(null == this ? void 0 : this.changes[t]) || (this.changes[t] = []), - this.changes[t].push({ - property: t, - previousValue: r, - value: n, - changedAt: new Date(), - }), - this - ); - }, - }, - { - key: 'setAttributes', - value: function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - for (var e in t) this.setAttribute(e, t[e]); - return this; - }, - }, - { - key: 'getAttribute', - value: function (t) { - var e, - n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, - r = ut(null !== (e = null == this ? void 0 : this.attributes) && void 0 !== e ? e : {}, t); - return void 0 === r ? n : r; - }, - }, - { - key: 'hasAttribute', - value: function (t) { - if (Y(t)) { - var e, - n = t, - r = Object.keys(null !== (e = this.attributes) && void 0 !== e ? e : {}); - return n.every(function (t) { - return r.includes(t); - }); - } - return !(null == this || !this.attributes) && t in this.attributes; - }, - }, - { - key: 'hasAttributes', - value: function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; - return this.hasAttribute(t); - }, - }, - { - key: 'isAttributeFilled', - value: function (t) { - var e = this; - return Y(t) - ? this.hasAttribute(t) && - t.every(function (t) { - return !V(e.getAttribute(t)); - }) - : this.hasAttribute(t) && !V(this.getAttribute(t)); - }, - }, - { - key: 'getAttributes', - value: function (t) { - var e = {}; - if (null == t) return this.getAttributes(Object.keys(this.attributes)); - if ('string' == typeof t) return this.getAttribute(Array.prototype.slice.call(arguments)); - if (!Y(t)) throw new Error('No attribute properties provided!'); - for (var n = 0; n < t.length; n++) { - var r, - i, - a = t[n]; - if ('string' == typeof a) { - var o = this.getAttribute(a); - 'object' !== b(null === (r = o) || void 0 === r ? void 0 : r.attributes) || Y(null === (i = o) || void 0 === i ? void 0 : i.attributes) || (o = o.attributes), - (e[a] = o); - } - } - return e; - }, - }, - { - key: 'serialize', - value: function () { - return this.getAttributes(); - }, - }, - { - key: 'mergeAttributes', - value: function () { - var t, - e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - n = null !== (t = null == this ? void 0 : this.attributes) && void 0 !== t ? t : {}; - return (this.attributes = w(w({}, n), e)), this.attributes; - }, - }, - { - key: 'syncAttributes', - value: function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - this.attributes = t; - }, - }, - ]), - t - ); - })(), - lt = new ct({ - getDistanceAndTime: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; - return this.adapter.get(''.concat(this.namespace, '/').concat(t, '/distance-and-time'), {}, e); - }, - }), - dt = (function (t) { - D(n, ht); - var e = j(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, 'order', w({ actions: lt }, i)); - } - return ( - A(n, [ - { - key: 'getDistanceAndTime', - value: function () { - return this.store.getDistanceAndTime(this.id); - }, - }, - ]), - n - ); - })(), - ft = (function (t) { - D(n, ht); - var e = j(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, 'payload', i); - } - return ( - A(n, [ - { key: 'attach', value: function (t) {} }, - { key: 'entities', get: function () {} }, - { key: 'dropoff', get: function () {} }, - { key: 'pickup', get: function () {} }, - { - key: 'waypoints', - get: function () { - return new Z(this.waypoints); - }, - }, - ]), - n - ); - })(); -!(function (t) { - D(n, ht); - var e = j(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, 'entity', i); - } -})(); -var vt = (function (t) { - D(n, ht); - var e = j(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, 'place', i); - } - return ( - A( - n, - [ - { - key: 'latitude', - get: function () { - var t; - return null === (t = this.getAttribute('location', new at())) || void 0 === t ? void 0 : t.coordinates[1]; - }, - }, - { - key: 'longitude', - get: function () { - var t; - return null === (t = this.getAttribute('location', new at())) || void 0 === t ? void 0 : t.coordinates[0]; - }, - }, - { - key: 'coordinates', - get: function () { - return [this.latitude, this.longitude]; - }, - }, - { - key: 'setOwner', - value: function (t) { - return et(t) && this.setAttribute('owner', t.id), 'string' == typeof t && this.setAttribute('owner', t), this; - }, - }, - ], - [ - { - key: 'fromGoogleAddress', - value: function (t, e) { - var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, - i = t.getAttribute('coordinates'), - a = q(i, 2), - o = a[0], - u = a[1], - s = { - name: null, - address: t.getAttribute('address'), - location: new at(o, u), - street1: t.getAttribute('streetName'), - street2: null, - city: t.getAttribute('city'), - province: t.getAttribute('stateLong'), - postal_code: t.getAttribute('postalCode'), - neighborhood: t.get('neighborhood'), - district: t.getAttribute('county'), - building: t.get('building'), - country: t.getAttribute('countryShort'), - phone: null, - security_access_code: null, - }; - return new n(s, e, r); - }, - }, - ] - ), - n - ); -})(); -!(function (t) { - D(n, vt); - var e = j(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, 'waypoint', i); - } -})(), - (function (t) { - D(n, ht); - var e = j(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, 'tracking-status', i); - } - })(), - (function (t) { - D(n, ht); - var e = j(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, 'vehicle', i); - } - })(), - (function (t) { - D(n, ht); - var e = j(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, 'driver', i); - } - })(), - (function (t) { - D(n, ht); - var e = j(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, 'vendor', i); - } - })(), - (function (t) { - D(n, ht); - var e = j(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, 'contact', i); - } - })(), - (function (t) { - D(n, ht); - var e = j(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, 'zone', i); - } - })(), - (function (t) { - D(n, ht); - var e = j(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, 'service-area', i); - } - })(), - (function (t) { - D(n, ht); - var e = j(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, 'service-rate', i); - } - })(); -var gt = (function (t) { - D(n, ht); - var e = j(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, 'service-quote', i); - } - return ( - A(n, [ - { key: 'fromPreliminary', value: function () {} }, - { key: 'fromPayload', value: function () {} }, - ]), - n - ); - })(), - pt = function t() { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - T(this, t), (this.version = e.version || 'v1'), (this.host = e.host || null), (this.namespace = e.namespace || null), (this.headers = e.headers || {}); - }, - yt = (function (t) { - D(n, pt); - var e = j(n); - function n(t) { - var r; - return ( - T(this, n), - (r = e.call(this, t)).setHeaders({ - Authorization: 'Bearer '.concat(t.publicKey), - 'Content-Type': 'application/json', - 'User-Agent': '@fleetbase/sdk;browser', - }), - r - ); - } - return ( - A(n, [ - { - key: 'setHeaders', - value: function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return (this.headers = w(w({}, this.headers), t)), this; - }, - }, - { - key: 'parseJSON', - value: function (t) { - return new Promise(function (e, n) { - return t - .json() - .then(function (n) { - return e({ - statusText: t.statusText, - status: t.status, - ok: t.ok, - json: n, - }); - }) - .catch(function () { - n(new Error('Oops! Something went wrong when handling your request.')); - }); - }); - }, - }, - { - key: 'request', - value: function (t) { - var e = this, - n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'GET', - r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, - i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; - return new Promise(function (a, o) { - return fetch( - i.url || ''.concat(e.host, '/').concat(e.namespace, '/').concat(t), - w( - { - method: n, - mode: i.mode || 'cors', - headers: new Headers(w(w({}, e.headers || {}), i.headers || {})), - }, - r - ) - ) - .then(e.parseJSON) - .then(function (t) { - return t.ok ? a(t.json) : o(new Error(t.json.errors ? t.json.errors[0] : t.statusText)); - }) - .catch(function (t) { - o(t); - }); - }); - }, - }, - { - key: 'get', - value: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, - r = tt(e) ? '' : new URLSearchParams(e).toString(); - return this.request(''.concat(t).concat(r ? '?'.concat(r) : ''), 'GET', {}, n); - }, - }, - { - key: 'post', - value: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return this.request(t, 'POST', { body: JSON.stringify(e) }, n); - }, - }, - { - key: 'put', - value: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return this.request(t, 'PUT', { body: JSON.stringify(e) }, n); - }, - }, - { - key: 'delete', - value: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; - return this.request(t, 'DELETE', {}, e); - }, - }, - { - key: 'patch', - value: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return this.request(t, 'PATCH', { body: JSON.stringify(e) }, n); - }, - }, - ]), - n - ); - })(), - mt = (function (t) { - D(r, pt); - var n = j(r); - function r(t) { - var i; - return ( - T(this, r), - ((i = n.call(this, t)).axios = e.default.create({ - baseURL: ''.concat(i.host, '/').concat(i.namespace), - headers: { - Authorization: 'Bearer '.concat(t.publicKey), - 'Content-Type': 'application/json', - 'User-Agent': '@fleetbase/sdk;node', - }, - })), - i - ); - } - return ( - A(r, [ - { - key: 'setHeaders', - value: function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - e = this.axios.defaults.headers.common; - return (this.axios.defaults.headers.common = w(w({}, e), t)), this; - }, - }, - { - key: 'transform', - value: function (t) { - return t.data; - }, - }, - { - key: 'handleError', - value: function (t) { - if (t.response) { - var e = t.response.data; - if (Y(e.errors)) throw new Error(e.errors[0]); - if (e.error) throw new Error(e.error); - } - throw t; - }, - }, - { - key: 'get', - value: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, - r = tt(e) ? '' : new URLSearchParams(e).toString(); - return this.axios - .get(''.concat(t).concat(r ? '?'.concat(r) : ''), n) - .then(this.transform.bind(this)) - .catch(this.handleError.bind(this)); - }, - }, - { - key: 'post', - value: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return this.axios.post(t, e, n).then(this.transform.bind(this)).catch(this.handleError.bind(this)); - }, - }, - { - key: 'put', - value: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return this.axios.put(t, e, n).then(this.transform.bind(this)).catch(this.handleError.bind(this)); - }, - }, - { - key: 'delete', - value: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; - return this.axios.delete(t, e).then(this.transform.bind(this)).catch(this.handleError.bind(this)); - }, - }, - { - key: 'patch', - value: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return this.axios.patch(t, e, n).then(this.transform.bind(this)).catch(this.handleError.bind(this)); - }, - }, - ]), - r - ); - })(), - wt = (function (t) { - D(n, pt); - var e = j(n); - function n() { - return T(this, n), e.apply(this, arguments); - } - return n; - })(), - bt = (function () { - function t(e) { - var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; - T(this, t), - E(this, 'uncountableWords', ['equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep', 'moose', 'deer', 'news']), - E(this, 'pluralRules', [ - [new RegExp('(m)an$', 'gi'), '$1en'], - [new RegExp('(pe)rson$', 'gi'), '$1ople'], - [new RegExp('(child)$', 'gi'), '$1ren'], - [new RegExp('^(ox)$', 'gi'), '$1en'], - [new RegExp('(ax|test)is$', 'gi'), '$1es'], - [new RegExp('(octop|vir)us$', 'gi'), '$1i'], - [new RegExp('(alias|status)$', 'gi'), '$1es'], - [new RegExp('(bu)s$', 'gi'), '$1ses'], - [new RegExp('(buffal|tomat|potat)o$', 'gi'), '$1oes'], - [new RegExp('([ti])um$', 'gi'), '$1a'], - [new RegExp('sis$', 'gi'), 'ses'], - [new RegExp('(?:([^f])fe|([lr])f)$', 'gi'), '$1$2ves'], - [new RegExp('(hive)$', 'gi'), '$1s'], - [new RegExp('([^aeiouy]|qu)y$', 'gi'), '$1ies'], - [new RegExp('(x|ch|ss|sh)$', 'gi'), '$1es'], - [new RegExp('(matr|vert|ind)ix|ex$', 'gi'), '$1ices'], - [new RegExp('([m|l])ouse$', 'gi'), '$1ice'], - [new RegExp('(quiz)$', 'gi'), '$1zes'], - [new RegExp('s$', 'gi'), 's'], - [new RegExp('$', 'gi'), 's'], - ]), - E(this, 'singularRules', [ - [new RegExp('(m)en$', 'gi'), '$1an'], - [new RegExp('(pe)ople$', 'gi'), '$1rson'], - [new RegExp('(child)ren$', 'gi'), '$1'], - [new RegExp('([ti])a$', 'gi'), '$1um'], - [new RegExp('((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$', 'gi'), '$1$2sis'], - [new RegExp('(hive)s$', 'gi'), '$1'], - [new RegExp('(tive)s$', 'gi'), '$1'], - [new RegExp('(curve)s$', 'gi'), '$1'], - [new RegExp('([lr])ves$', 'gi'), '$1f'], - [new RegExp('([^fo])ves$', 'gi'), '$1fe'], - [new RegExp('([^aeiouy]|qu)ies$', 'gi'), '$1y'], - [new RegExp('(s)eries$', 'gi'), '$1eries'], - [new RegExp('(m)ovies$', 'gi'), '$1ovie'], - [new RegExp('(x|ch|ss|sh)es$', 'gi'), '$1'], - [new RegExp('([m|l])ice$', 'gi'), '$1ouse'], - [new RegExp('(bus)es$', 'gi'), '$1'], - [new RegExp('(o)es$', 'gi'), '$1'], - [new RegExp('(shoe)s$', 'gi'), '$1'], - [new RegExp('(cris|ax|test)es$', 'gi'), '$1is'], - [new RegExp('(octop|vir)i$', 'gi'), '$1us'], - [new RegExp('(alias|status)es$', 'gi'), '$1'], - [new RegExp('^(ox)en', 'gi'), '$1'], - [new RegExp('(vert|ind)ices$', 'gi'), '$1ex'], - [new RegExp('(matr)ices$', 'gi'), '$1ix'], - [new RegExp('(quiz)zes$', 'gi'), '$1'], - [new RegExp('s$', 'gi'), ''], - ]), - E(this, 'nonTitlecasedWords', [ - 'and', - 'or', - 'nor', - 'a', - 'an', - 'the', - 'so', - 'but', - 'to', - 'of', - 'at', - 'by', - 'from', - 'into', - 'on', - 'onto', - 'off', - 'out', - 'in', - 'over', - 'with', - 'for', - ]), - E(this, 'idSuffix', new RegExp('(_ids|_id)$', 'g')), - E(this, 'underbar', new RegExp('_', 'g')), - E(this, 'spaceOrUnderbar', new RegExp('[ _]', 'g')), - E(this, 'uppercase', new RegExp('([A-Z])', 'g')), - E(this, 'underbarPrefix', new RegExp('^_')), - (this.str = e), - (this.chain = n); - } - return ( - A( - t, - [ - { - key: 'get', - value: function () { - return this.str; - }, - }, - { - key: 'applyRules', - value: function (t, e, n, r) { - if (r) t = r; - else if (!(n.indexOf(t.toLowerCase()) > -1)) - for (var i = 0; i < e.length; i++) - if (t.match(e[i][0])) { - t = t.replace(e[i][0], e[i][1]); - break; - } - return (this.str = t), !0 === this.chain ? this : t; - }, - }, - { - key: 'pluralize', - value: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; - return (t = t || this.str), this.applyRules(t, this.pluralRules, this.uncountableWords, e); - }, - }, - { - key: 'singularize', - value: function (t, e) { - return (t = t || this.str), this.applyRules(t, this.singularRules, this.uncountableWords, e); - }, - }, - { - key: 'camelize', - value: function (t, e) { - for (var n = (t = t || this.str).split('/'), r = 0; r < n.length; r++) { - for (var i = n[r].split('_'), a = e && r + 1 === n.length ? 1 : 0; a < i.length; a++) i[a] = i[a].charAt(0).toUpperCase() + i[a].substring(1); - n[r] = i.join(''); - } - if (((t = n.join('::')), !0 === e)) { - var o = t.charAt(0).toLowerCase(), - u = t.slice(1); - t = o + u; - } - return (this.str = t), !0 === this.chain ? this : t; - }, - }, - { - key: 'underscore', - value: function (t) { - for (var e = (t = t || this.str).split('::'), n = 0; n < e.length; n++) - (e[n] = e[n].replace(this.uppercase, '_$1')), (e[n] = e[n].replace(this.underbarPrefix, '')); - return (t = e.join('/').toLowerCase()), (this.str = t), !0 === this.chain ? this : t; - }, - }, - { - key: 'humanize', - value: function (t, e) { - return ( - (t = (t = (t = (t = t || this.str).toLowerCase()).replace(this.idSuffix, '')).replace(this.underbar, ' ')), - e || (t = this.capitalize(t)), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: 'capitalize', - value: function (t) { - return (t = (t = (t = t || this.str).toLowerCase()).substring(0, 1).toUpperCase() + t.substring(1)), (this.str = t), !0 === this.chain ? this : t; - }, - }, - { - key: 'dasherize', - value: function (t) { - return (t = (t = (t = t || this.str).replace(this.spaceOrUnderbar, '-')).toLowerCase()), (this.str = t), !0 === this.chain ? this : t; - }, - }, - { - key: 'normify', - value: function (t, e) { - (t = t || this.str), !0 === e ? ((t = this.camelize(t)), (t = this.underscore(t))) : (t = t.toLowerCase()); - for (var n = (t = t.replace(this.underbar, ' ')).split(' '), r = 0; r < n.length; r++) { - for (var i = n[r].split('-'), a = 0; a < i.length; a++) this.nonTitlecasedWords.indexOf(i[a].toLowerCase()) < 0 && (i[a] = this.capitalize(i[a])); - n[r] = i.join('-'); - } - return (t = (t = n.join(' ')).substring(0, 1).toUpperCase() + t.substring(1)), (this.str = t), !0 === this.chain ? this : t; - }, - }, - { - key: 'demodulize', - value: function (t) { - var e = (t = t || this.str).split('::'); - return (t = e[e.length - 1]), (this.str = t), !0 === this.chain ? this : t; - }, - }, - { - key: 'tableize', - value: function (t) { - return (t = t || this.str), (t = this.pluralize(this.underscore(t))), (this.str = t), !0 === this.chain ? this : t; - }, - }, - { - key: 'classify', - value: function (t) { - return (t = t || this.str), (t = this.singularize(this.camelize(t))), (this.str = t), !0 === this.chain ? this : t; - }, - }, - { - key: 'foreignKey', - value: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; - return (t = t || this.str), (t = this.underscore(this.demodulize(t)) + (e ? '' : '_') + 'id'), (this.str = t), !0 === this.chain ? this : t; - }, - }, - { - key: 'ordinalize', - value: function (t) { - for (var e = (t = t || this.str).split(' '), n = 0; n < e.length; n++) - if (NaN === parseInt(e[n])) { - var r = e[n].substring(e[n].length - 2), - i = e[n].substring(e[n].length - 1), - a = 'th'; - '11' != r && '12' != r && '13' != r && ('1' === i ? (a = 'st') : '2' === i ? (a = 'nd') : '3' === i && (a = 'rd')), (e[n] += a); - } - return (t = e.join(' ')), (this.str = t), !0 === this.chain ? this : t; - }, - }, - ], - [ - { - key: 'invoke', - value: function () { - var e = Object.values(arguments), - n = new t(null, !1), - r = arguments[0]; - return e.shift(), 'function' == typeof n[r] ? n[r].apply(n, $(e)) : null; - }, - }, - ] - ), - t - ); - })(), - kt = function () { - var t = ['pluralize'].concat(Array.prototype.slice.call(arguments)); - return bt.invoke.apply(bt, $(t)); - }, - xt = function () { - var t = ['singularize'].concat(Array.prototype.slice.call(arguments)); - return bt.invoke.apply(bt, $(t)); - }, - Tt = function () { - var t = ['classify'].concat(Array.prototype.slice.call(arguments)); - return bt.invoke.apply(bt, $(t)); - }, - Ct = { Place: vt, Payload: ft, Order: dt }, - At = { BrowserAdapter: yt, NodeAdapter: mt, EmberJsAdapter: wt }, - Et = (function () { - function t() { - return T(this, t), (this.resources = Ct), (this.adapters = At), this.lookup.apply(this, arguments); - } - return ( - A(t, [ - { - key: 'lookup', - value: function (t, e) { - var n = kt(t), - r = Array.prototype.slice.call(arguments).slice(2); - if (!this[n]) throw new Error('Attempted to resolve invalid type'); - if (!this[n][e]) throw new Error('No '.concat(xt(t), ' named ').concat(e, ' to resolve')); - return R(this[n][e], $(r)); - }, - }, - ]), - t - ); - })(), - Dt = function () { - return R(Et, Array.prototype.slice.call(arguments)); - }, - Ot = function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : []; - if (((t.actions = Y(e) ? e : [e]), !Y(e))) return e instanceof ct && e.extend(t), t; - for (var n = 0; n < e.length; n++) { - var r = e[n]; - t.extendActions(r); - } - }, - St = (function () { - function t(e, n) { - var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - T(this, t), (this.resource = e), (this.adapter = n || rt()), (this.namespace = kt(e)), (this.storage = new Z()), (this.options = r), this.extendActions(r.actions); - } - return ( - A(t, [ - { - key: 'extendActions', - value: function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; - return Ot(this, t); - }, - }, - { - key: 'deposit', - value: function (t) { - return t; - }, - }, - { - key: 'serialize', - value: function (t) { - return Dt('resource', Tt(this.resource), t, this.adapter); - }, - }, - { - key: 'afterFetch', - value: function (t) { - return (function (t, e) { - if (('function' == typeof t.options.onAfterFetch && t.options.onAfterFetch(e), Y(e))) { - for (var n = [], r = 0; r < e.length; r++) n.push(t.afterFetch(e[r])); - return R(Z, n); - } - var i = t.serialize(e); - return t.deposit(i); - })(this, t); - }, - }, - { - key: 'create', - value: function () { - var t = this, - e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; - return new Promise( - (function () { - var r = x( - regeneratorRuntime.mark(function r(i, a) { - var o; - return regeneratorRuntime.wrap(function (r) { - for (;;) - switch ((r.prev = r.next)) { - case 0: - return (r.next = 2), t.adapter.post(''.concat(t.namespace), e, n).then(t.afterFetch.bind(t)).catch(a); - case 2: - (o = r.sent), i(o); - case 4: - case 'end': - return r.stop(); - } - }, r); - }) - ); - return function (t, e) { - return r.apply(this, arguments); - }; - })() - ); - }, - }, - { - key: 'update', - value: function (t) { - var e = this, - n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return new Promise( - (function () { - var i = x( - regeneratorRuntime.mark(function i(a, o) { - var u; - return regeneratorRuntime.wrap(function (i) { - for (;;) - switch ((i.prev = i.next)) { - case 0: - return (i.next = 2), e.adapter.put(''.concat(e.namespace, '/').concat(t), n, r).then(e.afterFetch.bind(e)).catch(o); - case 2: - (u = i.sent), a(u); - case 4: - case 'end': - return i.stop(); - } - }, i); - }) - ); - return function (t, e) { - return i.apply(this, arguments); - }; - })() - ); - }, - }, - { - key: 'findRecord', - value: function (t) { - var e = this, - n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; - return new Promise( - (function () { - var r = x( - regeneratorRuntime.mark(function r(i, a) { - var o; - return regeneratorRuntime.wrap(function (r) { - for (;;) - switch ((r.prev = r.next)) { - case 0: - return (r.next = 2), e.adapter.get(''.concat(e.namespace, '/').concat(t), {}, n).then(e.afterFetch.bind(e)).catch(a); - case 2: - (o = r.sent), i(o); - case 4: - case 'end': - return r.stop(); - } - }, r); - }) - ); - return function (t, e) { - return r.apply(this, arguments); - }; - })() - ); - }, - }, - { - key: 'findAll', - value: function () { - var t = this, - e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return new Promise( - (function () { - var n = x( - regeneratorRuntime.mark(function n(r, i) { - var a; - return regeneratorRuntime.wrap(function (n) { - for (;;) - switch ((n.prev = n.next)) { - case 0: - return (n.next = 2), t.adapter.get(''.concat(t.namespace), {}, e).then(t.afterFetch.bind(t)).catch(i); - case 2: - (a = n.sent), r(a); - case 4: - case 'end': - return n.stop(); - } - }, n); - }) - ); - return function (t, e) { - return n.apply(this, arguments); - }; - })() - ); - }, - }, - { - key: 'query', - value: function () { - var t = this, - e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; - return new Promise( - (function () { - var r = x( - regeneratorRuntime.mark(function r(i, a) { - var o; - return regeneratorRuntime.wrap(function (r) { - for (;;) - switch ((r.prev = r.next)) { - case 0: - return (r.next = 2), t.adapter.get(''.concat(t.namespace), e, n).then(t.afterFetch.bind(t)).catch(a); - case 2: - (o = r.sent), i(o); - case 4: - case 'end': - return r.stop(); - } - }, r); - }) - ); - return function (t, e) { - return r.apply(this, arguments); - }; - })() - ); - }, - }, - { - key: 'queryRecord', - value: function () { - var t = this, - e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; - return ( - (e.single = !0), - new Promise( - (function () { - var r = x( - regeneratorRuntime.mark(function r(i, a) { - var o; - return regeneratorRuntime.wrap(function (r) { - for (;;) - switch ((r.prev = r.next)) { - case 0: - return (r.next = 2), t.adapter.get(''.concat(t.namespace), e, n).then(t.afterFetch.bind(t)).catch(a); - case 2: - (o = r.sent), i(o); - case 4: - case 'end': - return r.stop(); - } - }, r); - }) - ); - return function (t, e) { - return r.apply(this, arguments); - }; - })() - ) - ); - }, - }, - { - key: 'destroy', - value: function (t) { - var e = this, - n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - r = et(t) ? t.getAttribute('id') : t; - return new Promise( - (function () { - var t = x( - regeneratorRuntime.mark(function t(i, a) { - var o; - return regeneratorRuntime.wrap(function (t) { - for (;;) - switch ((t.prev = t.next)) { - case 0: - return (t.next = 2), e.adapter.delete(''.concat(e.namespace, '/').concat(r), {}, n).then(e.afterFetch.bind(e)).catch(a); - case 2: - (o = t.sent), i(o); - case 4: - case 'end': - return t.stop(); - } - }, t); - }) - ); - return function (e, n) { - return t.apply(this, arguments); - }; - })() - ); - }, - }, - ]), - t - ); - })(); -!(function () { - function t(e) { - var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; - if ( - (T(this, t), - (this.version = n.version || 'v1'), - (this.options = { - version: this.version, - host: n.host || 'https://api.fleetbase.io', - namespace: this.version || n.namespace, - debug: r, - publicKey: e, - }), - 'string' != typeof e || 0 === e.length) - ) - throw new Error('⚠️ Invalid public key given to Fleetbase SDK'); - if (!nt() && e.toLowerCase().startsWith('$')) throw new Error('Secret key provided. You must use a public key with Fleetbase Javascript SDK!'); - (this.adapter = n.adapter || rt(this.options)), - (this.orders = new St('order', this.adapter).extendActions(lt)), - (this.entities = new St('entity', this.adapter)), - (this.places = new St('place', this.adapter)), - (this.drivers = new St('driver', this.adapter)), - (this.vehicles = new St('vehicle', this.adapter)), - (this.vendors = new St('vendor', this.adapter)), - (this.contacts = new St('contact', this.adapter)); - } - A( - t, - [ - { - key: 'setAdapter', - value: function (t) { - this.adapter = t; - }, - }, - { - key: 'getAdapter', - value: function () { - return this.adapter; - }, - }, - ], - [ - { - key: 'newInstance', - value: function () { - return R(t, Array.prototype.slice.call(arguments)); - }, - }, - ] - ); -})(); -var Pt = (function (t) { - c(n, ht); - var e = g(n); - function n() { - return a(this, n), e.apply(this, arguments); - } - return ( - u(n, [ - { - key: 'setAdapter', - value: function (t) { - var e; - return ( - (this.adapter = t), - (this.store = new tr(this.resource, t, { - onAfterFetch: this.syncAttributes.bind(this), - actions: null === (e = this.options) || void 0 === e ? void 0 : e.actions, - })), - this - ); - }, - }, - ]), - n - ); - })(), - Rt = new ct({ - count: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - n = {}; - return t && (n.store = t), this.adapter.get(''.concat(this.namespace, '/count'), n, e); - }, - }), - Ut = (function (t) { - c(n, Pt); - var e = g(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return a(this, n), e.call(this, t, r, 'review', i); - } - return ( - u(n, [ - { key: 'getMedia', value: function () {} }, - { key: 'getPhotos', value: function () {} }, - { key: 'getVideos', value: function () {} }, - ]), - n - ); - })(), - Mt = function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return nt() ? Vn('adapter', 'NodeAdapter', t) : Vn('adapter', 'BrowserAdapter', t); - }, - jt = function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ''; - return /^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(t); - }; -function qt() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, - e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'USD', - n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 'symbol'; - return new Intl.NumberFormat('en-US', { - style: 'currency', - currency: e, - currencyDisplay: n, - }).format(t); -} -var $t = function (t) { - return 'string' == typeof t && t.length > 30 && (t.startsWith('store_') || t.startsWith('network_')); - }, - Nt = function (t) { - var e = null == t; - if (e) return e; - if ('number' == typeof t.size) return !t.size; - var n = i(t); - if ('object' === n) { - var r = t.size; - if ('number' == typeof r) return !r; - } - if ('number' == typeof t.length && 'function' !== n) return !t.length; - if ('object' === n) { - var a = t.length; - if ('number' == typeof a) return !a; - } - return !1; - }, - Ht = (function (t) { - c(n, Pt); - var e = g(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return a(this, n), e.call(this, t, r, 'product', i); - } - return ( - u(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, - n = t.sale_price, - r = t.currency; - return this.isOnSale ? (Nt(n) || Nt(r) ? null : qt(n / 100, r)) : Nt(e) || Nt(r) ? null : qt(e / 100, r); - }, - }, - { - key: 'getReviews', - value: function () { - var t = this; - return this.adapter.get('reviews', { store: this.id }).then(function (e) { - return new Z( - e.map(function (e) { - return new Ut(e, t.adapter); - }) - ); - }); - }, - }, - ]), - n - ); - })(), - Yt = (function (t) { - c(n, Pt); - var e = g(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return a(this, n), e.call(this, t, r, 'category', i); - } - return ( - u(n, [ - { - key: 'getProducts', - value: function () { - var t = this; - return this.adapter.get('products', { category: this.id }).then(function (e) { - return new Z( - e.map(function (e) { - return new Ht(e, t.adapter); - }) - ); - }); - }, - }, - ]), - n - ); - })(), - Lt = new ct({ - 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 (jt(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); - }, - }), - Ft = (function (t) { - c(n, Pt); - var e = g(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - i = arguments.length > 1 ? arguments[1] : void 0, - o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return a(this, n), e.call(this, t, i, 'customer', r({ actions: Lt }, o)); - } - return ( - u(n, [ - { - key: 'setAdapter', - value: function (t) { - var e; - return ( - (this.adapter = t), - (this.store = new tr(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: function (t) { - var e = this; - return this.adapter - .setHeaders({ 'Customer-Token': this.token }) - .post('customers/register-device', t) - .then(function () { - return e; - }); - }, - }, - { - key: 'getSavedPlaces', - value: function () { - var t = this; - return this.adapter - .setHeaders({ 'Customer-Token': this.token }) - .get('customers/places') - .then(function (e) { - return new Z( - e.map(function (e) { - return new vt(e, t.adapter); - }) - ); - }); - }, - }, - { - key: 'getOrderHistory', - value: function () { - var t = this, - e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return this.adapter - .setHeaders({ 'Customer-Token': this.token }) - .get('customers/orders', e) - .then(function (e) { - return new Z( - e.map(function (e) { - return new dt(e, t.adapter); - }) - ); - }); - }, - }, - ]), - n - ); - })(), - _t = Array.isArray, - Wt = new ct({ - 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, - i = 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({}, i), {}, { quantity: n }), a).then(this.afterFetch.bind(this)); - }, - update: function (t, e, n) { - var i = 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({}, i), {}, { quantity: n }), a).then(this.afterFetch.bind(this)); - }, - remove: function (t, e) { - var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return this.adapter.delete(''.concat(this.namespace, '/').concat(t, '/').concat(e), {}, n).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); - }, - }), - zt = (function (t) { - c(n, Pt); - var e = g(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - i = arguments.length > 1 ? arguments[1] : void 0, - o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return a(this, n), e.call(this, t, i, 'cart', r({ actions: Wt }, o)); - } - return ( - u(n, [ - { - key: 'add', - value: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, - n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, - r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; - return t instanceof Ht && (t = t.id), this.store.add(this.id, t, e, n, r); - }, - }, - { - key: 'update', - value: function (t, e) { - var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, - r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; - return this.store.update(this.id, t, e, n, r); - }, - }, - { - 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 !_t(t) || 0 === t.length; - }, - }, - { - key: 'isNotEmpty', - get: function () { - return !this.isEmpty; - }, - }, - ]), - n - ); - })(); -function It(t) { - if (null === t || !0 === t || !1 === t) return NaN; - var e = Number(t); - return isNaN(e) ? e : e < 0 ? Math.ceil(e) : Math.floor(e); -} -function Qt(t, e) { - if (e.length < t) throw new TypeError(t + ' argument' + (t > 1 ? 's' : '') + ' required, but only ' + e.length + ' present'); -} -function Bt(t) { - Qt(1, arguments); - var e = Object.prototype.toString.call(t); - return t instanceof Date || ('object' == typeof t && '[object Date]' === e) - ? new Date(t.getTime()) - : 'number' == typeof t || '[object Number]' === e - ? new Date(t) - : (('string' != typeof t && '[object String]' !== e) || - 'undefined' == typeof console || - (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"), - console.warn(new Error().stack)), - new Date(NaN)); -} -function Gt(t, e) { - Qt(2, arguments); - var n = Bt(t).getTime(), - r = It(e); - return new Date(n + r); -} -function Xt(t) { - var 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 Kt(t) { - return Qt(1, arguments), t instanceof Date || ('object' == typeof t && '[object Date]' === Object.prototype.toString.call(t)); -} -function Jt(t) { - if ((Qt(1, arguments), !Kt(t) && 'number' != typeof t)) return !1; - var e = Bt(t); - return !isNaN(Number(e)); -} -var Zt = { - 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' }, - }, - Vt = function (t, e, n) { - var r, - i = Zt[t]; - return ( - (r = 'string' == typeof i ? i : 1 === e ? i.one : i.other.replace('{{count}}', e.toString())), - null != n && n.addSuffix ? (n.comparison && n.comparison > 0 ? 'in ' + r : r + ' ago') : r - ); - }; -function te(t) { - return function () { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - n = e.width ? String(e.width) : t.defaultWidth, - r = t.formats[n] || t.formats[t.defaultWidth]; - return r; - }; -} -var ee = { - date: te({ - formats: { - full: 'EEEE, MMMM do, y', - long: 'MMMM do, y', - medium: 'MMM d, y', - short: 'MM/dd/yyyy', - }, - defaultWidth: 'full', - }), - time: te({ - 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: te({ - formats: { - full: "{{date}} 'at' {{time}}", - long: "{{date}} 'at' {{time}}", - medium: '{{date}}, {{time}}', - short: '{{date}}, {{time}}', - }, - defaultWidth: 'full', - }), - }, - ne = { - lastWeek: "'last' eeee 'at' p", - yesterday: "'yesterday at' p", - today: "'today at' p", - tomorrow: "'tomorrow at' p", - nextWeek: "eeee 'at' p", - other: 'P', - }; -function re(t) { - return function (e, n) { - var r, - i = n || {}; - if ('formatting' === (i.context ? String(i.context) : 'standalone') && t.formattingValues) { - var a = t.defaultFormattingWidth || t.defaultWidth, - o = i.width ? String(i.width) : a; - r = t.formattingValues[o] || t.formattingValues[a]; - } else { - var u = t.defaultWidth, - s = i.width ? String(i.width) : t.defaultWidth; - r = t.values[s] || t.values[u]; - } - return r[t.argumentCallback ? t.argumentCallback(e) : e]; - }; -} -function ie(t) { - return function (e) { - var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - r = n.width, - i = (r && t.matchPatterns[r]) || t.matchPatterns[t.defaultMatchWidth], - a = e.match(i); - if (!a) return null; - var o, - u = a[0], - s = (r && t.parsePatterns[r]) || t.parsePatterns[t.defaultParseWidth], - c = Array.isArray(s) - ? oe(s, function (t) { - return t.test(u); - }) - : ae(s, function (t) { - return t.test(u); - }); - (o = t.valueCallback ? t.valueCallback(c) : c), (o = n.valueCallback ? n.valueCallback(o) : o); - var h = e.slice(u.length); - return { value: o, rest: h }; - }; -} -function ae(t, e) { - for (var n in t) if (t.hasOwnProperty(n) && e(t[n])) return n; -} -function oe(t, e) { - for (var n = 0; n < t.length; n++) if (e(t[n])) return n; -} -var ue, - se = { - code: 'en-US', - formatDistance: Vt, - formatLong: ee, - formatRelative: function (t, e, n, r) { - return ne[t]; - }, - localize: { - ordinalNumber: function (t, e) { - var n = Number(t), - r = n % 100; - if (r > 20 || r < 10) - switch (r % 10) { - case 1: - return n + 'st'; - case 2: - return n + 'nd'; - case 3: - return n + 'rd'; - } - return n + 'th'; - }, - era: re({ - values: { - narrow: ['B', 'A'], - abbreviated: ['BC', 'AD'], - wide: ['Before Christ', 'Anno Domini'], - }, - defaultWidth: 'wide', - }), - quarter: re({ - values: { - narrow: ['1', '2', '3', '4'], - abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'], - wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'], - }, - defaultWidth: 'wide', - argumentCallback: function (t) { - return t - 1; - }, - }), - month: re({ - 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: re({ - 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: re({ - 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: - ((ue = { - matchPattern: /^(\d+)(th|st|nd|rd)?/i, - parsePattern: /\d+/i, - valueCallback: function (t) { - return parseInt(t, 10); - }, - }), - function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - n = t.match(ue.matchPattern); - if (!n) return null; - var r = n[0], - i = t.match(ue.parsePattern); - if (!i) return null; - var a = ue.valueCallback ? ue.valueCallback(i[0]) : i[0]; - a = e.valueCallback ? e.valueCallback(a) : a; - var o = t.slice(r.length); - return { value: a, rest: o }; - }), - era: ie({ - 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: ie({ - 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: function (t) { - return t + 1; - }, - }), - month: ie({ - 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: ie({ - 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: ie({ - 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 ce(t, e) { - Qt(2, arguments); - var n = It(e); - return Gt(t, -n); -} -function he(t, e) { - for (var n = t < 0 ? '-' : '', r = Math.abs(t).toString(); r.length < e; ) r = '0' + r; - return n + r; -} -var le = { - y: function (t, e) { - var n = t.getUTCFullYear(), - r = n > 0 ? n : 1 - n; - return he('yy' === e ? r % 100 : r, e.length); - }, - M: function (t, e) { - var n = t.getUTCMonth(); - return 'M' === e ? String(n + 1) : he(n + 1, 2); - }, - d: function (t, e) { - return he(t.getUTCDate(), e.length); - }, - a: function (t, e) { - var n = t.getUTCHours() / 12 >= 1 ? 'pm' : 'am'; - switch (e) { - case 'a': - case 'aa': - return n.toUpperCase(); - case 'aaa': - return n; - case 'aaaaa': - return n[0]; - default: - return 'am' === n ? 'a.m.' : 'p.m.'; - } - }, - h: function (t, e) { - return he(t.getUTCHours() % 12 || 12, e.length); - }, - H: function (t, e) { - return he(t.getUTCHours(), e.length); - }, - m: function (t, e) { - return he(t.getUTCMinutes(), e.length); - }, - s: function (t, e) { - return he(t.getUTCSeconds(), e.length); - }, - S: function (t, e) { - var n = e.length, - r = t.getUTCMilliseconds(); - return he(Math.floor(r * Math.pow(10, n - 3)), e.length); - }, -}; -function de(t) { - Qt(1, arguments); - var e = 1, - n = Bt(t), - r = n.getUTCDay(), - i = (r < e ? 7 : 0) + r - e; - return n.setUTCDate(n.getUTCDate() - i), n.setUTCHours(0, 0, 0, 0), n; -} -function fe(t) { - Qt(1, arguments); - var e = Bt(t), - n = e.getUTCFullYear(), - r = new Date(0); - r.setUTCFullYear(n + 1, 0, 4), r.setUTCHours(0, 0, 0, 0); - var i = de(r), - a = new Date(0); - a.setUTCFullYear(n, 0, 4), a.setUTCHours(0, 0, 0, 0); - var o = de(a); - return e.getTime() >= i.getTime() ? n + 1 : e.getTime() >= o.getTime() ? n : n - 1; -} -function ve(t) { - Qt(1, arguments); - var e = fe(t), - n = new Date(0); - n.setUTCFullYear(e, 0, 4), n.setUTCHours(0, 0, 0, 0); - var r = de(n); - return r; -} -function ge(t) { - Qt(1, arguments); - var e = Bt(t), - n = de(e).getTime() - ve(e).getTime(); - return Math.round(n / 6048e5) + 1; -} -function pe(t, e) { - Qt(1, arguments); - var n = e || {}, - r = n.locale, - i = r && r.options && r.options.weekStartsOn, - a = null == i ? 0 : It(i), - o = null == n.weekStartsOn ? a : It(n.weekStartsOn); - if (!(o >= 0 && o <= 6)) throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); - var u = Bt(t), - s = u.getUTCDay(), - c = (s < o ? 7 : 0) + s - o; - return u.setUTCDate(u.getUTCDate() - c), u.setUTCHours(0, 0, 0, 0), u; -} -function ye(t, e) { - Qt(1, arguments); - var n = Bt(t, e), - r = n.getUTCFullYear(), - i = e || {}, - a = i.locale, - o = a && a.options && a.options.firstWeekContainsDate, - u = null == o ? 1 : It(o), - s = null == i.firstWeekContainsDate ? u : It(i.firstWeekContainsDate); - if (!(s >= 1 && s <= 7)) throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); - var c = new Date(0); - c.setUTCFullYear(r + 1, 0, s), c.setUTCHours(0, 0, 0, 0); - var h = pe(c, e), - l = new Date(0); - l.setUTCFullYear(r, 0, s), l.setUTCHours(0, 0, 0, 0); - var d = pe(l, e); - return n.getTime() >= h.getTime() ? r + 1 : n.getTime() >= d.getTime() ? r : r - 1; -} -function me(t, e) { - Qt(1, arguments); - var n = e || {}, - r = n.locale, - i = r && r.options && r.options.firstWeekContainsDate, - a = null == i ? 1 : It(i), - o = null == n.firstWeekContainsDate ? a : It(n.firstWeekContainsDate), - u = ye(t, e), - s = new Date(0); - s.setUTCFullYear(u, 0, o), s.setUTCHours(0, 0, 0, 0); - var c = pe(s, e); - return c; -} -function we(t, e) { - Qt(1, arguments); - var n = Bt(t), - r = pe(n, e).getTime() - me(n, e).getTime(); - return Math.round(r / 6048e5) + 1; -} -var be = 'midnight', - ke = 'noon', - xe = 'morning', - Te = 'afternoon', - Ce = 'evening', - Ae = 'night', - Ee = { - G: function (t, e, n) { - var r = t.getUTCFullYear() > 0 ? 1 : 0; - switch (e) { - case 'G': - case 'GG': - case 'GGG': - return n.era(r, { width: 'abbreviated' }); - case 'GGGGG': - return n.era(r, { width: 'narrow' }); - default: - return n.era(r, { width: 'wide' }); - } - }, - y: function (t, e, n) { - if ('yo' === e) { - var r = t.getUTCFullYear(), - i = r > 0 ? r : 1 - r; - return n.ordinalNumber(i, { unit: 'year' }); - } - return le.y(t, e); - }, - Y: function (t, e, n, r) { - var i = ye(t, r), - a = i > 0 ? i : 1 - i; - return 'YY' === e ? he(a % 100, 2) : 'Yo' === e ? n.ordinalNumber(a, { unit: 'year' }) : he(a, e.length); - }, - R: function (t, e) { - return he(fe(t), e.length); - }, - u: function (t, e) { - return he(t.getUTCFullYear(), e.length); - }, - Q: function (t, e, n) { - var r = Math.ceil((t.getUTCMonth() + 1) / 3); - switch (e) { - case 'Q': - return String(r); - case 'QQ': - return he(r, 2); - case 'Qo': - return n.ordinalNumber(r, { unit: 'quarter' }); - case 'QQQ': - return n.quarter(r, { width: 'abbreviated', context: 'formatting' }); - case 'QQQQQ': - return n.quarter(r, { width: 'narrow', context: 'formatting' }); - default: - return n.quarter(r, { width: 'wide', context: 'formatting' }); - } - }, - q: function (t, e, n) { - var r = Math.ceil((t.getUTCMonth() + 1) / 3); - switch (e) { - case 'q': - return String(r); - case 'qq': - return he(r, 2); - case 'qo': - return n.ordinalNumber(r, { unit: 'quarter' }); - case 'qqq': - return n.quarter(r, { width: 'abbreviated', context: 'standalone' }); - case 'qqqqq': - return n.quarter(r, { width: 'narrow', context: 'standalone' }); - default: - return n.quarter(r, { width: 'wide', context: 'standalone' }); - } - }, - M: function (t, e, n) { - var r = t.getUTCMonth(); - switch (e) { - case 'M': - case 'MM': - return le.M(t, e); - case 'Mo': - return n.ordinalNumber(r + 1, { unit: 'month' }); - case 'MMM': - return n.month(r, { width: 'abbreviated', context: 'formatting' }); - case 'MMMMM': - return n.month(r, { width: 'narrow', context: 'formatting' }); - default: - return n.month(r, { width: 'wide', context: 'formatting' }); - } - }, - L: function (t, e, n) { - var r = t.getUTCMonth(); - switch (e) { - case 'L': - return String(r + 1); - case 'LL': - return he(r + 1, 2); - case 'Lo': - return n.ordinalNumber(r + 1, { unit: 'month' }); - case 'LLL': - return n.month(r, { width: 'abbreviated', context: 'standalone' }); - case 'LLLLL': - return n.month(r, { width: 'narrow', context: 'standalone' }); - default: - return n.month(r, { width: 'wide', context: 'standalone' }); - } - }, - w: function (t, e, n, r) { - var i = we(t, r); - return 'wo' === e ? n.ordinalNumber(i, { unit: 'week' }) : he(i, e.length); - }, - I: function (t, e, n) { - var r = ge(t); - return 'Io' === e ? n.ordinalNumber(r, { unit: 'week' }) : he(r, e.length); - }, - d: function (t, e, n) { - return 'do' === e ? n.ordinalNumber(t.getUTCDate(), { unit: 'date' }) : le.d(t, e); - }, - D: function (t, e, n) { - var r = (function (t) { - Qt(1, arguments); - var e = Bt(t), - n = e.getTime(); - e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0); - var r = e.getTime(), - i = n - r; - return Math.floor(i / 864e5) + 1; - })(t); - return 'Do' === e ? n.ordinalNumber(r, { unit: 'dayOfYear' }) : he(r, e.length); - }, - E: function (t, e, n) { - var r = t.getUTCDay(); - switch (e) { - case 'E': - case 'EE': - case 'EEE': - return n.day(r, { width: 'abbreviated', context: 'formatting' }); - case 'EEEEE': - return n.day(r, { width: 'narrow', context: 'formatting' }); - case 'EEEEEE': - return n.day(r, { width: 'short', context: 'formatting' }); - default: - return n.day(r, { width: 'wide', context: 'formatting' }); - } - }, - e: function (t, e, n, r) { - var i = t.getUTCDay(), - a = (i - r.weekStartsOn + 8) % 7 || 7; - switch (e) { - case 'e': - return String(a); - case 'ee': - return he(a, 2); - case 'eo': - return n.ordinalNumber(a, { unit: 'day' }); - case 'eee': - return n.day(i, { width: 'abbreviated', context: 'formatting' }); - case 'eeeee': - return n.day(i, { width: 'narrow', context: 'formatting' }); - case 'eeeeee': - return n.day(i, { width: 'short', context: 'formatting' }); - default: - return n.day(i, { width: 'wide', context: 'formatting' }); - } - }, - c: function (t, e, n, r) { - var i = t.getUTCDay(), - a = (i - r.weekStartsOn + 8) % 7 || 7; - switch (e) { - case 'c': - return String(a); - case 'cc': - return he(a, e.length); - case 'co': - return n.ordinalNumber(a, { unit: 'day' }); - case 'ccc': - return n.day(i, { width: 'abbreviated', context: 'standalone' }); - case 'ccccc': - return n.day(i, { width: 'narrow', context: 'standalone' }); - case 'cccccc': - return n.day(i, { width: 'short', context: 'standalone' }); - default: - return n.day(i, { width: 'wide', context: 'standalone' }); - } - }, - i: function (t, e, n) { - var r = t.getUTCDay(), - i = 0 === r ? 7 : r; - switch (e) { - case 'i': - return String(i); - case 'ii': - return he(i, e.length); - case 'io': - return n.ordinalNumber(i, { unit: 'day' }); - case 'iii': - return n.day(r, { width: 'abbreviated', context: 'formatting' }); - case 'iiiii': - return n.day(r, { width: 'narrow', context: 'formatting' }); - case 'iiiiii': - return n.day(r, { width: 'short', context: 'formatting' }); - default: - return n.day(r, { width: 'wide', context: 'formatting' }); - } - }, - a: function (t, e, n) { - var r = t.getUTCHours() / 12 >= 1 ? 'pm' : 'am'; - switch (e) { - case 'a': - case 'aa': - return n.dayPeriod(r, { - width: 'abbreviated', - context: 'formatting', - }); - case 'aaa': - return n.dayPeriod(r, { width: 'abbreviated', context: 'formatting' }).toLowerCase(); - case 'aaaaa': - return n.dayPeriod(r, { width: 'narrow', context: 'formatting' }); - default: - return n.dayPeriod(r, { width: 'wide', context: 'formatting' }); - } - }, - b: function (t, e, n) { - var r, - i = t.getUTCHours(); - switch (((r = 12 === i ? ke : 0 === i ? be : i / 12 >= 1 ? 'pm' : 'am'), e)) { - case 'b': - case 'bb': - return n.dayPeriod(r, { - width: 'abbreviated', - context: 'formatting', - }); - case 'bbb': - return n.dayPeriod(r, { width: 'abbreviated', context: 'formatting' }).toLowerCase(); - case 'bbbbb': - return n.dayPeriod(r, { width: 'narrow', context: 'formatting' }); - default: - return n.dayPeriod(r, { width: 'wide', context: 'formatting' }); - } - }, - B: function (t, e, n) { - var r, - i = t.getUTCHours(); - switch (((r = i >= 17 ? Ce : i >= 12 ? Te : i >= 4 ? xe : Ae), e)) { - case 'B': - case 'BB': - case 'BBB': - return n.dayPeriod(r, { - width: 'abbreviated', - context: 'formatting', - }); - case 'BBBBB': - return n.dayPeriod(r, { width: 'narrow', context: 'formatting' }); - default: - return n.dayPeriod(r, { width: 'wide', context: 'formatting' }); - } - }, - h: function (t, e, n) { - if ('ho' === e) { - var r = t.getUTCHours() % 12; - return 0 === r && (r = 12), n.ordinalNumber(r, { unit: 'hour' }); - } - return le.h(t, e); - }, - H: function (t, e, n) { - return 'Ho' === e ? n.ordinalNumber(t.getUTCHours(), { unit: 'hour' }) : le.H(t, e); - }, - K: function (t, e, n) { - var r = t.getUTCHours() % 12; - return 'Ko' === e ? n.ordinalNumber(r, { unit: 'hour' }) : he(r, e.length); - }, - k: function (t, e, n) { - var r = t.getUTCHours(); - return 0 === r && (r = 24), 'ko' === e ? n.ordinalNumber(r, { unit: 'hour' }) : he(r, e.length); - }, - m: function (t, e, n) { - return 'mo' === e ? n.ordinalNumber(t.getUTCMinutes(), { unit: 'minute' }) : le.m(t, e); - }, - s: function (t, e, n) { - return 'so' === e ? n.ordinalNumber(t.getUTCSeconds(), { unit: 'second' }) : le.s(t, e); - }, - S: function (t, e) { - return le.S(t, e); - }, - X: function (t, e, n, r) { - var i = (r._originalDate || t).getTimezoneOffset(); - if (0 === i) return 'Z'; - switch (e) { - case 'X': - return Oe(i); - case 'XXXX': - case 'XX': - return Se(i); - default: - return Se(i, ':'); - } - }, - x: function (t, e, n, r) { - var i = (r._originalDate || t).getTimezoneOffset(); - switch (e) { - case 'x': - return Oe(i); - case 'xxxx': - case 'xx': - return Se(i); - default: - return Se(i, ':'); - } - }, - O: function (t, e, n, r) { - var i = (r._originalDate || t).getTimezoneOffset(); - switch (e) { - case 'O': - case 'OO': - case 'OOO': - return 'GMT' + De(i, ':'); - default: - return 'GMT' + Se(i, ':'); - } - }, - z: function (t, e, n, r) { - var i = (r._originalDate || t).getTimezoneOffset(); - switch (e) { - case 'z': - case 'zz': - case 'zzz': - return 'GMT' + De(i, ':'); - default: - return 'GMT' + Se(i, ':'); - } - }, - t: function (t, e, n, r) { - var i = r._originalDate || t; - return he(Math.floor(i.getTime() / 1e3), e.length); - }, - T: function (t, e, n, r) { - return he((r._originalDate || t).getTime(), e.length); - }, - }; -function De(t, e) { - var n = t > 0 ? '-' : '+', - r = Math.abs(t), - i = Math.floor(r / 60), - a = r % 60; - if (0 === a) return n + String(i); - var o = e || ''; - return n + String(i) + o + he(a, 2); -} -function Oe(t, e) { - return t % 60 == 0 ? (t > 0 ? '-' : '+') + he(Math.abs(t) / 60, 2) : Se(t, e); -} -function Se(t, e) { - var n = e || '', - r = t > 0 ? '-' : '+', - i = Math.abs(t); - return r + he(Math.floor(i / 60), 2) + n + he(i % 60, 2); -} -var Pe = Ee; -function Re(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' }); - } -} -function Ue(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' }); - } -} -var Me = { - p: Ue, - P: function (t, e) { - var n, - r = t.match(/(P+)(p+)?/), - i = r[1], - a = r[2]; - if (!a) return Re(t, e); - switch (i) { - case 'P': - n = e.dateTime({ width: 'short' }); - break; - case 'PP': - n = e.dateTime({ width: 'medium' }); - break; - case 'PPP': - n = e.dateTime({ width: 'long' }); - break; - default: - n = e.dateTime({ width: 'full' }); - } - return n.replace('{{date}}', Re(i, e)).replace('{{time}}', Ue(a, e)); - }, - }, - je = Me, - qe = ['D', 'DD'], - $e = ['YY', 'YYYY']; -function Ne(t) { - return -1 !== qe.indexOf(t); -} -function He(t) { - return -1 !== $e.indexOf(t); -} -function Ye(t, e, n) { - if ('YYYY' === t) throw new RangeError('Use `yyyy` instead of `YYYY` (in `'.concat(e, '`) for formatting years to the input `').concat(n, '`; see: https://git.io/fxCyr')); - if ('YY' === t) throw new RangeError('Use `yy` instead of `YY` (in `'.concat(e, '`) for formatting years to the input `').concat(n, '`; see: https://git.io/fxCyr')); - if ('D' === t) throw new RangeError('Use `d` instead of `D` (in `'.concat(e, '`) for formatting days of the month to the input `').concat(n, '`; see: https://git.io/fxCyr')); - if ('DD' === t) throw new RangeError('Use `dd` instead of `DD` (in `'.concat(e, '`) for formatting days of the month to the input `').concat(n, '`; see: https://git.io/fxCyr')); -} -var Le = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, - Fe = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, - _e = /^'([^]*?)'?$/, - We = /''/g, - ze = /[a-zA-Z]/; -function Ie(t, e, n) { - Qt(2, arguments); - var r = String(e), - i = n || {}, - a = i.locale || se, - o = a.options && a.options.firstWeekContainsDate, - u = null == o ? 1 : It(o), - s = null == i.firstWeekContainsDate ? u : It(i.firstWeekContainsDate); - if (!(s >= 1 && s <= 7)) throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); - var c = a.options && a.options.weekStartsOn, - h = null == c ? 0 : It(c), - l = null == i.weekStartsOn ? h : It(i.weekStartsOn); - if (!(l >= 0 && l <= 6)) throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); - if (!a.localize) throw new RangeError('locale must contain localize property'); - if (!a.formatLong) throw new RangeError('locale must contain formatLong property'); - var d = Bt(t); - if (!Jt(d)) throw new RangeError('Invalid time value'); - var f = Xt(d), - v = ce(d, f), - g = { - firstWeekContainsDate: s, - weekStartsOn: l, - locale: a, - _originalDate: d, - }, - p = r - .match(Fe) - .map(function (t) { - var e = t[0]; - return 'p' === e || 'P' === e ? (0, je[e])(t, a.formatLong, g) : t; - }) - .join('') - .match(Le) - .map(function (n) { - if ("''" === n) return "'"; - var r = n[0]; - if ("'" === r) return Qe(n); - var o = Pe[r]; - if (o) return !i.useAdditionalWeekYearTokens && He(n) && Ye(n, e, t), !i.useAdditionalDayOfYearTokens && Ne(n) && Ye(n, e, t), o(v, n, a.localize, g); - if (r.match(ze)) throw new RangeError('Format string contains an unescaped latin alphabet character `' + r + '`'); - return n; - }) - .join(''); - return p; -} -function Qe(t) { - return t.match(_e)[1].replace(We, "'"); -} -function Be(t, e) { - if (null == t) throw new TypeError('assign requires that input parameter not be null or undefined'); - for (var n in (e = e || {})) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); - return t; -} -function Ge(t, e, n) { - Qt(2, arguments); - var r = n || {}, - i = r.locale, - a = i && i.options && i.options.weekStartsOn, - o = null == a ? 0 : It(a), - u = null == r.weekStartsOn ? o : It(r.weekStartsOn); - if (!(u >= 0 && u <= 6)) throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); - var s = Bt(t), - c = It(e), - h = s.getUTCDay(), - l = c % 7, - d = (l + 7) % 7, - f = (d < u ? 7 : 0) + c - h; - return s.setUTCDate(s.getUTCDate() + f), s; -} -var Xe = /^(1[0-2]|0?\d)/, - Ke = /^(3[0-1]|[0-2]?\d)/, - Je = /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, - Ze = /^(5[0-3]|[0-4]?\d)/, - Ve = /^(2[0-3]|[0-1]?\d)/, - tn = /^(2[0-4]|[0-1]?\d)/, - en = /^(1[0-1]|0?\d)/, - nn = /^(1[0-2]|0?\d)/, - rn = /^[0-5]?\d/, - an = /^[0-5]?\d/, - on = /^\d/, - un = /^\d{1,2}/, - sn = /^\d{1,3}/, - cn = /^\d{1,4}/, - hn = /^-?\d+/, - ln = /^-?\d/, - dn = /^-?\d{1,2}/, - fn = /^-?\d{1,3}/, - vn = /^-?\d{1,4}/, - gn = /^([+-])(\d{2})(\d{2})?|Z/, - pn = /^([+-])(\d{2})(\d{2})|Z/, - yn = /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, - mn = /^([+-])(\d{2}):(\d{2})|Z/, - wn = /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/; -function bn(t, e, n) { - var r = e.match(t); - if (!r) return null; - var i = parseInt(r[0], 10); - return { value: n ? n(i) : i, rest: e.slice(r[0].length) }; -} -function kn(t, e) { - var n = e.match(t); - return n - ? 'Z' === n[0] - ? { value: 0, rest: e.slice(1) } - : { - value: ('+' === n[1] ? 1 : -1) * (36e5 * (n[2] ? parseInt(n[2], 10) : 0) + 6e4 * (n[3] ? parseInt(n[3], 10) : 0) + 1e3 * (n[5] ? parseInt(n[5], 10) : 0)), - rest: e.slice(n[0].length), - } - : null; -} -function xn(t, e) { - return bn(hn, t, e); -} -function Tn(t, e, n) { - switch (t) { - case 1: - return bn(on, e, n); - case 2: - return bn(un, e, n); - case 3: - return bn(sn, e, n); - case 4: - return bn(cn, e, n); - default: - return bn(new RegExp('^\\d{1,' + t + '}'), e, n); - } -} -function Cn(t, e, n) { - switch (t) { - case 1: - return bn(ln, e, n); - case 2: - return bn(dn, e, n); - case 3: - return bn(fn, e, n); - case 4: - return bn(vn, e, n); - default: - return bn(new RegExp('^-?\\d{1,' + t + '}'), e, n); - } -} -function An(t) { - switch (t) { - case 'morning': - return 4; - case 'evening': - return 17; - case 'pm': - case 'noon': - case 'afternoon': - return 12; - default: - return 0; - } -} -function En(t, e) { - var n, - r = e > 0, - i = r ? e : 1 - e; - if (i <= 50) n = t || 100; - else { - var a = i + 50; - n = t + 100 * Math.floor(a / 100) - (t >= a % 100 ? 100 : 0); - } - return r ? n : 1 - n; -} -var Dn = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], - On = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; -function Sn(t) { - return t % 400 == 0 || (t % 4 == 0 && t % 100 != 0); -} -var Pn = { - G: { - priority: 140, - parse: function (t, e, n, r) { - switch (e) { - case 'G': - case 'GG': - case 'GGG': - return n.era(t, { width: 'abbreviated' }) || n.era(t, { width: 'narrow' }); - case 'GGGGG': - return n.era(t, { width: 'narrow' }); - default: - return n.era(t, { width: 'wide' }) || n.era(t, { width: 'abbreviated' }) || n.era(t, { width: 'narrow' }); - } - }, - set: function (t, e, n, r) { - return (e.era = n), t.setUTCFullYear(n, 0, 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ['R', 'u', 't', 'T'], - }, - y: { - priority: 130, - parse: function (t, e, n, r) { - var i = function (t) { - return { year: t, isTwoDigitYear: 'yy' === e }; - }; - switch (e) { - case 'y': - return Tn(4, t, i); - case 'yo': - return n.ordinalNumber(t, { unit: 'year', valueCallback: i }); - default: - return Tn(e.length, t, i); - } - }, - validate: function (t, e, n) { - return e.isTwoDigitYear || e.year > 0; - }, - set: function (t, e, n, r) { - var i = t.getUTCFullYear(); - if (n.isTwoDigitYear) { - var a = En(n.year, i); - return t.setUTCFullYear(a, 0, 1), t.setUTCHours(0, 0, 0, 0), t; - } - var o = 'era' in e && 1 !== e.era ? 1 - n.year : n.year; - return t.setUTCFullYear(o, 0, 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T'], - }, - Y: { - priority: 130, - parse: function (t, e, n, r) { - var i = function (t) { - return { year: t, isTwoDigitYear: 'YY' === e }; - }; - switch (e) { - case 'Y': - return Tn(4, t, i); - case 'Yo': - return n.ordinalNumber(t, { unit: 'year', valueCallback: i }); - default: - return Tn(e.length, t, i); - } - }, - validate: function (t, e, n) { - return e.isTwoDigitYear || e.year > 0; - }, - set: function (t, e, n, r) { - var i = ye(t, r); - if (n.isTwoDigitYear) { - var a = En(n.year, i); - return t.setUTCFullYear(a, 0, r.firstWeekContainsDate), t.setUTCHours(0, 0, 0, 0), pe(t, r); - } - var o = 'era' in e && 1 !== e.era ? 1 - n.year : n.year; - return t.setUTCFullYear(o, 0, r.firstWeekContainsDate), t.setUTCHours(0, 0, 0, 0), pe(t, r); - }, - incompatibleTokens: ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T'], - }, - R: { - priority: 130, - parse: function (t, e, n, r) { - return Cn('R' === e ? 4 : e.length, t); - }, - set: function (t, e, n, r) { - var i = new Date(0); - return i.setUTCFullYear(n, 0, 4), i.setUTCHours(0, 0, 0, 0), de(i); - }, - incompatibleTokens: ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T'], - }, - u: { - priority: 130, - parse: function (t, e, n, r) { - return Cn('u' === e ? 4 : e.length, t); - }, - set: function (t, e, n, r) { - return t.setUTCFullYear(n, 0, 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T'], - }, - Q: { - priority: 120, - parse: function (t, e, n, r) { - switch (e) { - case 'Q': - case 'QQ': - return Tn(e.length, t); - case 'Qo': - return n.ordinalNumber(t, { unit: 'quarter' }); - case 'QQQ': - return n.quarter(t, { width: 'abbreviated', context: 'formatting' }) || n.quarter(t, { width: 'narrow', context: 'formatting' }); - case 'QQQQQ': - return n.quarter(t, { width: 'narrow', context: 'formatting' }); - default: - return ( - n.quarter(t, { width: 'wide', context: 'formatting' }) || - n.quarter(t, { width: 'abbreviated', context: 'formatting' }) || - n.quarter(t, { width: 'narrow', context: 'formatting' }) - ); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 4; - }, - set: function (t, e, n, r) { - return t.setUTCMonth(3 * (n - 1), 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T'], - }, - q: { - priority: 120, - parse: function (t, e, n, r) { - switch (e) { - case 'q': - case 'qq': - return Tn(e.length, t); - case 'qo': - return n.ordinalNumber(t, { unit: 'quarter' }); - case 'qqq': - return n.quarter(t, { width: 'abbreviated', context: 'standalone' }) || n.quarter(t, { width: 'narrow', context: 'standalone' }); - case 'qqqqq': - return n.quarter(t, { width: 'narrow', context: 'standalone' }); - default: - return ( - n.quarter(t, { width: 'wide', context: 'standalone' }) || - n.quarter(t, { width: 'abbreviated', context: 'standalone' }) || - n.quarter(t, { width: 'narrow', context: 'standalone' }) - ); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 4; - }, - set: function (t, e, n, r) { - return t.setUTCMonth(3 * (n - 1), 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T'], - }, - M: { - priority: 110, - parse: function (t, e, n, r) { - var i = function (t) { - return t - 1; - }; - switch (e) { - case 'M': - return bn(Xe, t, i); - case 'MM': - return Tn(2, t, i); - case 'Mo': - return n.ordinalNumber(t, { unit: 'month', valueCallback: i }); - case 'MMM': - return n.month(t, { width: 'abbreviated', context: 'formatting' }) || n.month(t, { width: 'narrow', context: 'formatting' }); - case 'MMMMM': - return n.month(t, { width: 'narrow', context: 'formatting' }); - default: - return ( - n.month(t, { width: 'wide', context: 'formatting' }) || - n.month(t, { width: 'abbreviated', context: 'formatting' }) || - n.month(t, { width: 'narrow', context: 'formatting' }) - ); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 11; - }, - set: function (t, e, n, r) { - return t.setUTCMonth(n, 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T'], - }, - L: { - priority: 110, - parse: function (t, e, n, r) { - var i = function (t) { - return t - 1; - }; - switch (e) { - case 'L': - return bn(Xe, t, i); - case 'LL': - return Tn(2, t, i); - case 'Lo': - return n.ordinalNumber(t, { unit: 'month', valueCallback: i }); - case 'LLL': - return n.month(t, { width: 'abbreviated', context: 'standalone' }) || n.month(t, { width: 'narrow', context: 'standalone' }); - case 'LLLLL': - return n.month(t, { width: 'narrow', context: 'standalone' }); - default: - return ( - n.month(t, { width: 'wide', context: 'standalone' }) || - n.month(t, { width: 'abbreviated', context: 'standalone' }) || - n.month(t, { width: 'narrow', context: 'standalone' }) - ); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 11; - }, - set: function (t, e, n, r) { - return t.setUTCMonth(n, 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T'], - }, - w: { - priority: 100, - parse: function (t, e, n, r) { - switch (e) { - case 'w': - return bn(Ze, t); - case 'wo': - return n.ordinalNumber(t, { unit: 'week' }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 53; - }, - set: function (t, e, n, r) { - return pe( - (function (t, e, n) { - Qt(2, arguments); - var r = Bt(t), - i = It(e), - a = we(r, n) - i; - return r.setUTCDate(r.getUTCDate() - 7 * a), r; - })(t, n, r), - r - ); - }, - incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T'], - }, - I: { - priority: 100, - parse: function (t, e, n, r) { - switch (e) { - case 'I': - return bn(Ze, t); - case 'Io': - return n.ordinalNumber(t, { unit: 'week' }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 53; - }, - set: function (t, e, n, r) { - return de( - (function (t, e) { - Qt(2, arguments); - var n = Bt(t), - r = It(e), - i = ge(n) - r; - return n.setUTCDate(n.getUTCDate() - 7 * i), n; - })(t, n, r), - r - ); - }, - incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T'], - }, - d: { - priority: 90, - subPriority: 1, - parse: function (t, e, n, r) { - switch (e) { - case 'd': - return bn(Ke, t); - case 'do': - return n.ordinalNumber(t, { unit: 'date' }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - var r = Sn(t.getUTCFullYear()), - i = t.getUTCMonth(); - return r ? e >= 1 && e <= On[i] : e >= 1 && e <= Dn[i]; - }, - set: function (t, e, n, r) { - return t.setUTCDate(n), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T'], - }, - D: { - priority: 90, - subPriority: 1, - parse: function (t, e, n, r) { - switch (e) { - case 'D': - case 'DD': - return bn(Je, t); - case 'Do': - return n.ordinalNumber(t, { unit: 'date' }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return Sn(t.getUTCFullYear()) ? e >= 1 && e <= 366 : e >= 1 && e <= 365; - }, - set: function (t, e, n, r) { - return t.setUTCMonth(0, n), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T'], - }, - E: { - priority: 90, - parse: function (t, e, n, r) { - switch (e) { - case 'E': - case 'EE': - case 'EEE': - return ( - n.day(t, { width: 'abbreviated', context: 'formatting' }) || - n.day(t, { width: 'short', context: 'formatting' }) || - n.day(t, { width: 'narrow', context: 'formatting' }) - ); - case 'EEEEE': - return n.day(t, { width: 'narrow', context: 'formatting' }); - case 'EEEEEE': - return n.day(t, { width: 'short', context: 'formatting' }) || n.day(t, { width: 'narrow', context: 'formatting' }); - default: - return ( - n.day(t, { width: 'wide', context: 'formatting' }) || - n.day(t, { width: 'abbreviated', context: 'formatting' }) || - n.day(t, { width: 'short', context: 'formatting' }) || - n.day(t, { width: 'narrow', context: 'formatting' }) - ); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 6; - }, - set: function (t, e, n, r) { - return (t = Ge(t, n, r)).setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T'], - }, - e: { - priority: 90, - parse: function (t, e, n, r) { - var i = function (t) { - var e = 7 * Math.floor((t - 1) / 7); - return ((t + r.weekStartsOn + 6) % 7) + e; - }; - switch (e) { - case 'e': - case 'ee': - return Tn(e.length, t, i); - case 'eo': - return n.ordinalNumber(t, { unit: 'day', valueCallback: i }); - case 'eee': - return ( - n.day(t, { width: 'abbreviated', context: 'formatting' }) || - n.day(t, { width: 'short', context: 'formatting' }) || - n.day(t, { width: 'narrow', context: 'formatting' }) - ); - case 'eeeee': - return n.day(t, { width: 'narrow', context: 'formatting' }); - case 'eeeeee': - return n.day(t, { width: 'short', context: 'formatting' }) || n.day(t, { width: 'narrow', context: 'formatting' }); - default: - return ( - n.day(t, { width: 'wide', context: 'formatting' }) || - n.day(t, { width: 'abbreviated', context: 'formatting' }) || - n.day(t, { width: 'short', context: 'formatting' }) || - n.day(t, { width: 'narrow', context: 'formatting' }) - ); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 6; - }, - set: function (t, e, n, r) { - return (t = Ge(t, n, r)).setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T'], - }, - c: { - priority: 90, - parse: function (t, e, n, r) { - var i = function (t) { - var e = 7 * Math.floor((t - 1) / 7); - return ((t + r.weekStartsOn + 6) % 7) + e; - }; - switch (e) { - case 'c': - case 'cc': - return Tn(e.length, t, i); - case 'co': - return n.ordinalNumber(t, { unit: 'day', valueCallback: i }); - case 'ccc': - return ( - n.day(t, { width: 'abbreviated', context: 'standalone' }) || - n.day(t, { width: 'short', context: 'standalone' }) || - n.day(t, { width: 'narrow', context: 'standalone' }) - ); - case 'ccccc': - return n.day(t, { width: 'narrow', context: 'standalone' }); - case 'cccccc': - return n.day(t, { width: 'short', context: 'standalone' }) || n.day(t, { width: 'narrow', context: 'standalone' }); - default: - return ( - n.day(t, { width: 'wide', context: 'standalone' }) || - n.day(t, { width: 'abbreviated', context: 'standalone' }) || - n.day(t, { width: 'short', context: 'standalone' }) || - n.day(t, { width: 'narrow', context: 'standalone' }) - ); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 6; - }, - set: function (t, e, n, r) { - return (t = Ge(t, n, r)).setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T'], - }, - i: { - priority: 90, - parse: function (t, e, n, r) { - var i = function (t) { - return 0 === t ? 7 : t; - }; - switch (e) { - case 'i': - case 'ii': - return Tn(e.length, t); - case 'io': - return n.ordinalNumber(t, { unit: 'day' }); - case 'iii': - return ( - n.day(t, { - width: 'abbreviated', - context: 'formatting', - valueCallback: i, - }) || - n.day(t, { - width: 'short', - context: 'formatting', - valueCallback: i, - }) || - n.day(t, { - width: 'narrow', - context: 'formatting', - valueCallback: i, - }) - ); - case 'iiiii': - return n.day(t, { - width: 'narrow', - context: 'formatting', - valueCallback: i, - }); - case 'iiiiii': - return ( - n.day(t, { - width: 'short', - context: 'formatting', - valueCallback: i, - }) || - n.day(t, { - width: 'narrow', - context: 'formatting', - valueCallback: i, - }) - ); - default: - return ( - n.day(t, { - width: 'wide', - context: 'formatting', - valueCallback: i, - }) || - n.day(t, { - width: 'abbreviated', - context: 'formatting', - valueCallback: i, - }) || - n.day(t, { - width: 'short', - context: 'formatting', - valueCallback: i, - }) || - n.day(t, { - width: 'narrow', - context: 'formatting', - valueCallback: i, - }) - ); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 7; - }, - set: function (t, e, n, r) { - return ( - (t = (function (t, e) { - Qt(2, arguments); - var n = It(e); - n % 7 == 0 && (n -= 7); - var r = 1, - i = Bt(t), - a = i.getUTCDay(), - o = (((n % 7) + 7) % 7 < r ? 7 : 0) + n - a; - return i.setUTCDate(i.getUTCDate() + o), i; - })(t, n, r)), - t.setUTCHours(0, 0, 0, 0), - t - ); - }, - incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T'], - }, - a: { - priority: 80, - parse: function (t, e, n, r) { - switch (e) { - case 'a': - case 'aa': - case 'aaa': - return n.dayPeriod(t, { width: 'abbreviated', context: 'formatting' }) || n.dayPeriod(t, { width: 'narrow', context: 'formatting' }); - case 'aaaaa': - return n.dayPeriod(t, { width: 'narrow', context: 'formatting' }); - default: - return ( - n.dayPeriod(t, { width: 'wide', context: 'formatting' }) || - n.dayPeriod(t, { width: 'abbreviated', context: 'formatting' }) || - n.dayPeriod(t, { width: 'narrow', context: 'formatting' }) - ); - } - }, - set: function (t, e, n, r) { - return t.setUTCHours(An(n), 0, 0, 0), t; - }, - incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T'], - }, - b: { - priority: 80, - parse: function (t, e, n, r) { - switch (e) { - case 'b': - case 'bb': - case 'bbb': - return n.dayPeriod(t, { width: 'abbreviated', context: 'formatting' }) || n.dayPeriod(t, { width: 'narrow', context: 'formatting' }); - case 'bbbbb': - return n.dayPeriod(t, { width: 'narrow', context: 'formatting' }); - default: - return ( - n.dayPeriod(t, { width: 'wide', context: 'formatting' }) || - n.dayPeriod(t, { width: 'abbreviated', context: 'formatting' }) || - n.dayPeriod(t, { width: 'narrow', context: 'formatting' }) - ); - } - }, - set: function (t, e, n, r) { - return t.setUTCHours(An(n), 0, 0, 0), t; - }, - incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T'], - }, - B: { - priority: 80, - parse: function (t, e, n, r) { - switch (e) { - case 'B': - case 'BB': - case 'BBB': - return n.dayPeriod(t, { width: 'abbreviated', context: 'formatting' }) || n.dayPeriod(t, { width: 'narrow', context: 'formatting' }); - case 'BBBBB': - return n.dayPeriod(t, { width: 'narrow', context: 'formatting' }); - default: - return ( - n.dayPeriod(t, { width: 'wide', context: 'formatting' }) || - n.dayPeriod(t, { width: 'abbreviated', context: 'formatting' }) || - n.dayPeriod(t, { width: 'narrow', context: 'formatting' }) - ); - } - }, - set: function (t, e, n, r) { - return t.setUTCHours(An(n), 0, 0, 0), t; - }, - incompatibleTokens: ['a', 'b', 't', 'T'], - }, - h: { - priority: 70, - parse: function (t, e, n, r) { - switch (e) { - case 'h': - return bn(nn, t); - case 'ho': - return n.ordinalNumber(t, { unit: 'hour' }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 12; - }, - set: function (t, e, n, r) { - var i = t.getUTCHours() >= 12; - return i && n < 12 ? t.setUTCHours(n + 12, 0, 0, 0) : i || 12 !== n ? t.setUTCHours(n, 0, 0, 0) : t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ['H', 'K', 'k', 't', 'T'], - }, - H: { - priority: 70, - parse: function (t, e, n, r) { - switch (e) { - case 'H': - return bn(Ve, t); - case 'Ho': - return n.ordinalNumber(t, { unit: 'hour' }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 23; - }, - set: function (t, e, n, r) { - return t.setUTCHours(n, 0, 0, 0), t; - }, - incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T'], - }, - K: { - priority: 70, - parse: function (t, e, n, r) { - switch (e) { - case 'K': - return bn(en, t); - case 'Ko': - return n.ordinalNumber(t, { unit: 'hour' }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 11; - }, - set: function (t, e, n, r) { - return t.getUTCHours() >= 12 && n < 12 ? t.setUTCHours(n + 12, 0, 0, 0) : t.setUTCHours(n, 0, 0, 0), t; - }, - incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T'], - }, - k: { - priority: 70, - parse: function (t, e, n, r) { - switch (e) { - case 'k': - return bn(tn, t); - case 'ko': - return n.ordinalNumber(t, { unit: 'hour' }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 24; - }, - set: function (t, e, n, r) { - var i = n <= 24 ? n % 24 : n; - return t.setUTCHours(i, 0, 0, 0), t; - }, - incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T'], - }, - m: { - priority: 60, - parse: function (t, e, n, r) { - switch (e) { - case 'm': - return bn(rn, t); - case 'mo': - return n.ordinalNumber(t, { unit: 'minute' }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 59; - }, - set: function (t, e, n, r) { - return t.setUTCMinutes(n, 0, 0), t; - }, - incompatibleTokens: ['t', 'T'], - }, - s: { - priority: 50, - parse: function (t, e, n, r) { - switch (e) { - case 's': - return bn(an, t); - case 'so': - return n.ordinalNumber(t, { unit: 'second' }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 59; - }, - set: function (t, e, n, r) { - return t.setUTCSeconds(n, 0), t; - }, - incompatibleTokens: ['t', 'T'], - }, - S: { - priority: 30, - parse: function (t, e, n, r) { - return Tn(e.length, t, function (t) { - return Math.floor(t * Math.pow(10, 3 - e.length)); - }); - }, - set: function (t, e, n, r) { - return t.setUTCMilliseconds(n), t; - }, - incompatibleTokens: ['t', 'T'], - }, - X: { - priority: 10, - parse: function (t, e, n, r) { - switch (e) { - case 'X': - return kn(gn, t); - case 'XX': - return kn(pn, t); - case 'XXXX': - return kn(yn, t); - case 'XXXXX': - return kn(wn, t); - default: - return kn(mn, t); - } - }, - set: function (t, e, n, r) { - return e.timestampIsSet ? t : new Date(t.getTime() - n); - }, - incompatibleTokens: ['t', 'T', 'x'], - }, - x: { - priority: 10, - parse: function (t, e, n, r) { - switch (e) { - case 'x': - return kn(gn, t); - case 'xx': - return kn(pn, t); - case 'xxxx': - return kn(yn, t); - case 'xxxxx': - return kn(wn, t); - default: - return kn(mn, t); - } - }, - set: function (t, e, n, r) { - return e.timestampIsSet ? t : new Date(t.getTime() - n); - }, - incompatibleTokens: ['t', 'T', 'X'], - }, - t: { - priority: 40, - parse: function (t, e, n, r) { - return xn(t); - }, - set: function (t, e, n, r) { - return [new Date(1e3 * n), { timestampIsSet: !0 }]; - }, - incompatibleTokens: '*', - }, - T: { - priority: 20, - parse: function (t, e, n, r) { - return xn(t); - }, - set: function (t, e, n, r) { - return [new Date(n), { timestampIsSet: !0 }]; - }, - incompatibleTokens: '*', - }, - }, - Rn = Pn, - Un = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, - Mn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, - jn = /^'([^]*?)'?$/, - qn = /''/g, - $n = /\S/, - Nn = /[a-zA-Z]/; -function Hn(t, e, n, r) { - Qt(3, arguments); - var i = String(t), - a = String(e), - o = r || {}, - u = o.locale || se; - if (!u.match) throw new RangeError('locale must contain match property'); - var s = u.options && u.options.firstWeekContainsDate, - c = null == s ? 1 : It(s), - h = null == o.firstWeekContainsDate ? c : It(o.firstWeekContainsDate); - if (!(h >= 1 && h <= 7)) throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); - var l = u.options && u.options.weekStartsOn, - d = null == l ? 0 : It(l), - f = null == o.weekStartsOn ? d : It(o.weekStartsOn); - if (!(f >= 0 && f <= 6)) throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); - if ('' === a) return '' === i ? Bt(n) : new Date(NaN); - var v, - g = { firstWeekContainsDate: h, weekStartsOn: f, locale: u }, - p = [{ priority: 10, subPriority: -1, set: Yn, index: 0 }], - y = a - .match(Mn) - .map(function (t) { - var e = t[0]; - return 'p' === e || 'P' === e ? (0, je[e])(t, u.formatLong, g) : t; - }) - .join('') - .match(Un), - m = []; - for (v = 0; v < y.length; v++) { - var w = y[v]; - !o.useAdditionalWeekYearTokens && He(w) && Ye(w, a, t), !o.useAdditionalDayOfYearTokens && Ne(w) && Ye(w, a, t); - var b = w[0], - k = Rn[b]; - if (k) { - var x = k.incompatibleTokens; - if (Array.isArray(x)) { - for (var T = void 0, C = 0; C < m.length; C++) { - var A = m[C].token; - if (-1 !== x.indexOf(A) || A === b) { - T = m[C]; - break; - } - } - if (T) throw new RangeError("The format string mustn't contain `".concat(T.fullToken, '` and `').concat(w, '` at the same time')); - } else if ('*' === k.incompatibleTokens && m.length) throw new RangeError("The format string mustn't contain `".concat(w, '` and any other token at the same time')); - m.push({ token: b, fullToken: w }); - var E = k.parse(i, w, u.match, g); - if (!E) return new Date(NaN); - p.push({ - priority: k.priority, - subPriority: k.subPriority || 0, - set: k.set, - validate: k.validate, - value: E.value, - index: p.length, - }), - (i = E.rest); - } else { - if (b.match(Nn)) throw new RangeError('Format string contains an unescaped latin alphabet character `' + b + '`'); - if (("''" === w ? (w = "'") : "'" === b && (w = Ln(w)), 0 !== i.indexOf(w))) return new Date(NaN); - i = i.slice(w.length); - } - } - if (i.length > 0 && $n.test(i)) return new Date(NaN); - var D = p - .map(function (t) { - return t.priority; - }) - .sort(function (t, e) { - return e - t; - }) - .filter(function (t, e, n) { - return n.indexOf(t) === e; - }) - .map(function (t) { - return p - .filter(function (e) { - return e.priority === t; - }) - .sort(function (t, e) { - return e.subPriority - t.subPriority; - }); - }) - .map(function (t) { - return t[0]; - }), - O = Bt(n); - if (isNaN(O)) return new Date(NaN); - var S = ce(O, Xt(O)), - P = {}; - for (v = 0; v < D.length; v++) { - var R = D[v]; - if (R.validate && !R.validate(S, R.value, g)) return new Date(NaN); - var U = R.set(S, P, R.value, g); - U[0] ? ((S = U[0]), Be(P, U[1])) : (S = U); - } - return S; -} -function Yn(t, e) { - if (e.timestampIsSet) return t; - var n = new Date(0); - return n.setFullYear(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()), n.setHours(t.getUTCHours(), t.getUTCMinutes(), t.getUTCSeconds(), t.getUTCMilliseconds()), n; -} -function Ln(t) { - return t.match(jn)[1].replace(qn, "'"); -} -var Fn = (function (t) { - c(n, Pt); - var e = g(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return a(this, n), e.call(this, t, r, 'store-hour', i); - } - return ( - u(n, [ - { - 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, - n = Math.abs(t - e); - return Math.floor(n / 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 Hn(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 Hn(t, e ? 'HH:mm:ss' : 'HH:mm', new Date()); - }, - }, - { - key: 'humanReadableHoursRange', - get: function () { - return Jt(this.startDateInstance) && Jt(this.endDateInstance) - ? ''.concat(Ie(this.startDateInstance, 'p'), ' - ').concat(Ie(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!'); - }, - }, - ]), - n - ); - })(), - _n = (function (t) { - c(n, Pt); - var e = g(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return a(this, n), e.call(this, t, r, 'store-location', i); - } - return ( - u(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 Z( - this.getAttribute('hours').map(function (t) { - return new Fn(t); - }) - ); - }, - }, - { - key: 'isAlwaysOpen', - get: function () { - return this.hours.every(function (t) { - return null == t ? void 0 : t.is24Hours; - }); - }, - }, - { - key: 'today', - get: function () { - var t = Ie(new Date(), 'EEEE'); - return this.schedule[t]; - }, - }, - { - key: 'schedule', - get: function () { - for (var t = {}, e = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'], n = 0; n < e.length; n++) { - t[e[n]] = new Z(); - } - for (var r = 0; r < this.hours.length; r++) { - var i = this.hours.objectAt(r); - t[i.day].pushObject(i); - } - return t; - }, - }, - { - 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!'); - }, - }, - ]), - n - ); - })(), - Wn = (function (t) { - c(n, Pt); - var e = g(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return a(this, n), e.call(this, t, r, 'payment-gateway', i); - } - return ( - u(n, [ - { - 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!'); - }, - }, - ]), - n - ); - })(), - zn = (function (t) { - c(n, Pt); - var e = g(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return a(this, n), e.call(this, t, r, 'store', i); - } - return ( - u(n, [ - { - key: 'getReviews', - value: function () { - var t = this, - e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return this.adapter.get('reviews', r({ store: this.id }, e)).then(function (e) { - return new Z( - e.map(function (e) { - return new Ut(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', r({ store: this.id }, e)).then(function (e) { - return new Z( - e.map(function (e) { - return e.place && (e.place = new vt(e.place)), new _n(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 _n(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 Z( - e.map(function (e) { - return new Wn(e, t.adapter); - }) - ); - }); - }, - }, - { - key: 'getPaymentGateway', - value: function (t) { - var e = this; - return this.adapter.get('gateways/'.concat(t)).then(function (t) { - return new Wn(t, e.adapter); - }); - }, - }, - ]), - n - ); - })(), - In = (function (t) { - c(n, Pt); - var e = g(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return a(this, n), e.call(this, t, r, 'network', i); - } - return ( - u(n, [ - { - key: 'getTags', - value: function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return this.adapter.get('tags', t); - }, - }, - { - key: 'getStores', - value: function () { - var t = this, - e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return this.adapter.get('stores', e).then(function (e) { - return new Z( - e.map(function (e) { - return new zn(e, t.adapter); - }) - ); - }); - }, - }, - { - key: 'getStoreLocations', - value: function () { - var t = this, - e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return this.adapter.get('store-locations', e).then(function (e) { - return new Z( - e.map(function (e) { - return new _n(e, t.adapter); - }) - ); - }); - }, - }, - { - key: 'getPaymentGateways', - value: function () { - var t = this; - return this.adapter.get('gateways').then(function (e) { - return new Z( - e.map(function (e) { - return new Wn(e, t.adapter); - }) - ); - }); - }, - }, - ]), - n - ); - })(), - Qn = Array.isArray, - Bn = (function (t) { - c(n, gt); - var e = g(n); - function n() { - var t, - r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - i = arguments.length > 1 ? arguments[1] : void 0, - o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return a(this, n), r instanceof pt ? v(t, (t = e.call(this, {}, r, 'service-quote', o))) : e.call(this, r, i, 'service-quote', o); - } - return ( - u( - n, - [ - { - key: 'setAdapter', - value: function (t) { - var e; - return ( - (this.adapter = t), - (this.store = new tr(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, - n = t.currency; - return Nt(e) || Nt(n) ? null : qt(e / 100, n); - }, - }, - { - key: 'fromCart', - value: function (t, e, r) { - var i, - a, - o, - u = this, - s = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 'storefront', - c = arguments.length > 4 && void 0 !== arguments[4] && arguments[4]; - return ( - null !== (i = t) && void 0 !== i && i.id && (t = t.id), - null !== (a = e) && void 0 !== a && a.id && (e = e.id), - null !== (o = r) && void 0 !== o && o.id && (r = r.id), - this.adapter - .get('service-quotes/from-cart', { - origin: t, - destination: e, - cart: r, - config: s, - all: c, - }) - .then(function (t) { - return Qn(t) - ? new Z( - t.map(function (t) { - return new n(t, u.adapter); - }) - ) - : new n(t, u.adapter); - }) - ); - }, - }, - ], - [ - { - key: 'getFromCart', - value: function (t) { - for (var e = new n(t), r = arguments.length, i = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++) i[a - 1] = arguments[a]; - return e.fromCart.apply(e, i); - }, - }, - ] - ), - n - ); - })(), - Gn = new ct({ - create: void 0, - findAll: void 0, - query: void 0, - queryRecord: void 0, - initialize: function (t, e, n, i) { - var a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {}, - o = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : {}; - return ( - et(t) && (t = t.id), - et(e) && (e = e.id), - et(n) && (n = n.id), - et(i) && (i = i.getAttribute('code')), - this.adapter.get(''.concat(this.namespace, '/before'), r(r({}, a), {}, { customer: t, cart: e, serviceQuote: n, gateway: i }), o) - ); - }, - captureOrder: function (t) { - var e = 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: e }, n).then(function (t) { - return new dt(t); - }); - }, - }), - Xn = (function (t) { - c(n, Pt); - var e = g(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return a(this, n), e.call(this, t, r, 'checkout', i); - } - return ( - u(n, [ - { - 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); - }, - }, - ]), - n - ); - })(), - Kn = { - Product: Ht, - Category: Yt, - Customer: Ft, - Cart: zt, - DeliveryServiceQuote: Bn, - Store: zn, - StoreLocation: _n, - StoreHour: Fn, - Checkout: Xn, - Review: Ut, - }, - Jn = { BrowserAdapter: yt, NodeAdapter: mt }, - Zn = (function () { - function t() { - return a(this, t), (this.resources = Kn), (this.adapters = Jn), this.lookup.apply(this, arguments); - } - return ( - u(t, [ - { - key: 'lookup', - value: function (t, e) { - var n = kt(t), - r = Array.prototype.slice.call(arguments).slice(2); - if (!this[n]) throw new Error('Attempted to resolve invalid type'); - if (!this[n][e]) throw new Error('No '.concat(xt(t), ' named ').concat(e, ' to resolve')); - return f(this[n][e], p(r)); - }, - }, - ]), - t - ); - })(), - Vn = function () { - return f(Zn, Array.prototype.slice.call(arguments)); - }, - tr = (function (t) { - c(n, St); - var e = g(n); - function n() { - return a(this, n), e.apply(this, arguments); - } - return ( - u(n, [ - { - key: 'extendActions', - value: function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; - return Ot(this, t); - }, - }, - { - key: 'serialize', - value: function (t) { - return Vn('resource', Tt(this.resource), t, this.adapter); - }, - }, - ]), - n - ); - })(), - er = (function () { - function t(e) { - var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; - if ( - (a(this, t), - (this.version = n.version || 'v1'), - (this.options = { - version: this.version, - host: n.host || 'https://api.fleetbase.io', - namespace: 'storefront/'.concat(this.version) || n.namespace, - publicKey: e, - debug: r, - }), - !$t(e)) - ) - throw new Error('⚠️ Invalid Storefront key given to Storefront SDK'); - (this.adapter = n.adapter || Mt(this.options)), - (this.products = new tr('product', this.adapter)), - (this.categories = new tr('category', this.adapter)), - (this.reviews = new tr('review', this.adapter).extendActions(Rt)), - (this.customers = new tr('customer', this.adapter).extendActions(Lt)), - (this.cart = new tr('cart', this.adapter).extendActions(Wt)), - (this.checkout = new tr('checkout', this.adapter).extendActions(Gn)); - } - return ( - u( - 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', r({ query: t }, e)).then(function (t) { - return new Z( - t.map(function (t) { - return new Ht(t); - }) - ); - }); - }, - }, - { - key: 'setAdapter', - value: function (t) { - this.adapter = t; - }, - }, - { - key: 'getAdapter', - value: function () { - return this.adapter; - }, - }, - ], - [ - { - key: 'newInstance', - value: function () { - return f(t, Array.prototype.slice.call(arguments)); - }, - }, - ] - ), - t - ); - })(); -(exports.Cart = zt), - (exports.Category = Yt), - (exports.Checkout = Xn), - (exports.Customer = Ft), - (exports.DeliveryServiceQuote = Bn), - (exports.Network = In), - (exports.PaymentGateway = Wn), - (exports.Product = Ht), - (exports.Review = Ut), - (exports.Store = zn), - (exports.StoreHour = Fn), - (exports.StoreLocation = _n), - (exports.default = er); +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@fleetbase/sdk");function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:{},n={};return t&&(n.store=t),this.adapter.get("".concat(this.namespace,"/count"),n,e)}}),v=function(t){u(n,y);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"review",o)}return i(n,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),n}();function b(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:n}).format(t)}var k=function(e){u(r,y);var n=g(r);function r(){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 a(this,r),n.call(this,t,e,"product",o)}return i(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 e=this.getAttributes(["price","sale_price","currency"]),n=e.price,r=e.sale_price,a=e.currency;return this.isOnSale?t.isEmpty(r)||t.isEmpty(a)?null:b(r/100,a):t.isEmpty(n)||t.isEmpty(a)?null:b(n/100,a)}},{key:"getReviews",value:function(){var e=this;return this.adapter.get("reviews",{store:this.id}).then((function(n){return new t.Collection(n.map((function(t){return new v(t,e.adapter)})))}))}}]),r}(),x=function(e){u(r,y);var n=g(r);function r(){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 a(this,r),n.call(this,t,e,"category",o)}return i(r,[{key:"getProducts",value:function(){var e=this;return this.adapter.get("products",{category:this.id}).then((function(n){return new t.Collection(n.map((function(t){return new k(t,e.adapter)})))}))}}]),r}(),T=new t.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)}}),M=function(e){u(o,y);var r=g(o);function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,o),r.call(this,t,e,"customer",n({actions:T},i))}return i(o,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ye(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:function(t){var e=this;return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",t).then((function(){return e}))}},{key:"getSavedPlaces",value:function(){var e=this;return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/places").then((function(n){return new t.Collection(n.map((function(n){return new t.Place(n,e.adapter)})))}))}},{key:"getOrderHistory",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/orders",n).then((function(n){return new t.Collection(n.map((function(n){return new t.Order(n,e.adapter)})))}))}}]),o}(),D=Array.isArray,P=new t.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,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),n(n({},a),{},{quantity:r}),o).then(this.afterFetch.bind(this))},update:function(t,e,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),n(n({},a),{},{quantity:r}),o).then(this.afterFetch.bind(this))},remove:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},n).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)}}),S=function(t){u(r,y);var e=g(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,r),e.call(this,t,o,"cart",n({actions:P},i))}return i(r,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof k&&(t=t.id),this.store.add(this.id,t,e,n,r)}},{key:"update",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,n,r)}},{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!D(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),r}(),O=function(t){u(n,y);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"payment-gateway",o)}return i(n,[{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!")}}]),n}();function A(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 E(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function H(t,e){const n=A(t);return isNaN(e)?E(t,NaN):e?(n.setDate(n.getDate()+e),n):n}const q=6048e5,Y=864e5;let C={};function N(){return C}function W(t,e){const n=N(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=A(t),o=a.getDay(),i=(o=a.getTime()?n+1:e.getTime()>=i.getTime()?n:n-1}function F(t){const e=A(t);return e.setHours(0,0,0,0),e}function L(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 Q(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 n=A(t);return!isNaN(Number(n))}const I={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 G(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const B={date:G({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:G({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:G({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},X={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function _(t){return(e,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,a=n?.width?String(n.width):e;r=t.formattingValues[a]||t.formattingValues[e]}else{const e=t.defaultWidth,a=n?.width?String(n.width):t.defaultWidth;r=t.values[a]||t.values[e]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function z(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;const i=o[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let n=0;nt.test(i))):function(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var $;const K={code:"en-US",formatDistance:(t,e,n)=>{let r;const a=I[t];return r="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:B,formatRelative:(t,e,n,r)=>X[t],localize:{ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:_({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:_({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:_({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:_({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:_({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:($={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const n=t.match($.matchPattern);if(!n)return null;const r=n[0],a=t.match($.parsePattern);if(!a)return null;let o=$.valueCallback?$.valueCallback(a[0]):a[0];return o=e.valueCallback?e.valueCallback(o):o,{value:o,rest:t.slice(r.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 U(t){const e=A(t),n=function(t,e){const n=F(t),r=F(e),a=n.getTime()-L(n),o=r.getTime()-L(r);return Math.round((a-o)/Y)}(e,function(t){const e=A(t),n=E(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}(e));return n+1}function J(t){const e=A(t),n=j(e).getTime()-function(t){const e=R(t),n=E(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),j(n)}(e).getTime();return Math.round(n/q)+1}function V(t,e){const n=A(t),r=n.getFullYear(),a=N(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=E(t,0);i.setFullYear(r+1,0,o),i.setHours(0,0,0,0);const s=W(i,e),u=E(t,0);u.setFullYear(r,0,o),u.setHours(0,0,0,0);const c=W(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Z(t,e){const n=A(t),r=W(n,e).getTime()-function(t,e){const n=N(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=V(t,e),o=E(t,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),W(o,e)}(n,e).getTime();return Math.round(r/q)+1}function tt(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const et={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return tt("yy"===e?r%100:r,e.length)},M(t,e){const n=t.getMonth();return"M"===e?String(n+1):tt(n+1,2)},d:(t,e)=>tt(t.getDate(),e.length),a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(t,e)=>tt(t.getHours()%12||12,e.length),H:(t,e)=>tt(t.getHours(),e.length),m:(t,e)=>tt(t.getMinutes(),e.length),s:(t,e)=>tt(t.getSeconds(),e.length),S(t,e){const n=e.length,r=t.getMilliseconds();return tt(Math.floor(r*Math.pow(10,n-3)),e.length)}},nt="midnight",rt="noon",at="morning",ot="afternoon",it="evening",st="night",ut={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){const e=t.getFullYear(),r=e>0?e:1-e;return n.ordinalNumber(r,{unit:"year"})}return et.y(t,e)},Y:function(t,e,n,r){const a=V(t,r),o=a>0?a:1-a;if("YY"===e){return tt(o%100,2)}return"Yo"===e?n.ordinalNumber(o,{unit:"year"}):tt(o,e.length)},R:function(t,e){return tt(R(t),e.length)},u:function(t,e){return tt(t.getFullYear(),e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return tt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return tt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return et.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return tt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Z(t,r);return"wo"===e?n.ordinalNumber(a,{unit:"week"}):tt(a,e.length)},I:function(t,e,n){const r=J(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):tt(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getDate(),{unit:"date"}):et.d(t,e)},D:function(t,e,n){const r=U(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):tt(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return tt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return tt(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=0===r?7:r;switch(e){case"i":return String(a);case"ii":return tt(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(a=12===r?rt:0===r?nt:r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(a=r>=17?it:r>=12?ot:r>=4?at:st,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),n.ordinalNumber(e,{unit:"hour"})}return et.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getHours(),{unit:"hour"}):et.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):tt(r,e.length)},k:function(t,e,n){let r=t.getHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):tt(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):et.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getSeconds(),{unit:"second"}):et.s(t,e)},S:function(t,e){return et.S(t,e)},X:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return dt(a);case"XXXX":case"XX":return lt(a);default:return lt(a,":")}},x:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return dt(a);case"xxxx":case"xx":return lt(a);default:return lt(a,":")}},O:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ct(a,":");default:return"GMT"+lt(a,":")}},z:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ct(a,":");default:return"GMT"+lt(a,":")}},t:function(t,e,n,r){const a=r._originalDate||t;return tt(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,n,r){return tt((r._originalDate||t).getTime(),e.length)}};function ct(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.floor(r/60),o=r%60;return 0===o?n+String(a):n+String(a)+e+tt(o,2)}function dt(t,e){if(t%60==0){return(t>0?"-":"+")+tt(Math.abs(t)/60,2)}return lt(t,e)}function lt(t,e=""){const n=t>0?"-":"+",r=Math.abs(t);return n+tt(Math.floor(r/60),2)+e+tt(r%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"})}},ft=(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"})}},gt={p:ft,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return ht(t,e);let o;switch(r){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(r,e)).replace("{{time}}",ft(a,e))}},mt=["D","DD"],wt=["YY","YYYY"];function yt(t){return-1!==mt.indexOf(t)}function pt(t){return-1!==wt.indexOf(t)}function vt(t,e,n){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${n}\`; 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 \`${n}\`; 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 \`${n}\`; 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 \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const bt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xt=/^'([^]*?)'?$/,Tt=/''/g,Mt=/[a-zA-Z]/;function Dt(t,e,n){const r=N(),a=n?.locale??r.locale??K,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=A(t);if(!Q(s))throw new RangeError("Invalid time value");const u={firstWeekContainsDate:o,weekStartsOn:i,locale:a,_originalDate:s};return e.match(kt).map((function(t){const e=t[0];if("p"===e||"P"===e){return(0,gt[e])(t,a.formatLong)}return t})).join("").match(bt).map((function(r){if("''"===r)return"'";const o=r[0];if("'"===o)return function(t){const e=t.match(xt);if(!e)return t;return e[1].replace(Tt,"'")}(r);const i=ut[o];if(i)return!n?.useAdditionalWeekYearTokens&&pt(r)&&vt(r,e,String(t)),!n?.useAdditionalDayOfYearTokens&&yt(r)&&vt(r,e,String(t)),i(s,r,a.localize,u);if(o.match(Mt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}class Pt{subPriority=0;validate(t,e){return!0}}class St extends Pt{constructor(t,e,n,r,a){super(),this.value=t,this.validateValue=e,this.setValue=n,this.priority=r,a&&(this.subPriority=a)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,n){return this.setValue(t,e,this.value,n)}}class Ot extends Pt{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:E(t,function(t,e){const n=e instanceof Date?E(e,0):new e(0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),n}(t,Date))}}class At{run(t,e,n,r){const a=this.parse(t,e,n,r);return a?{setter:new St(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(t,e,n){return!0}}const Et=/^(1[0-2]|0?\d)/,Ht=/^(3[0-1]|[0-2]?\d)/,qt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Yt=/^(5[0-3]|[0-4]?\d)/,Ct=/^(2[0-3]|[0-1]?\d)/,Nt=/^(2[0-4]|[0-1]?\d)/,Wt=/^(1[0-1]|0?\d)/,jt=/^(1[0-2]|0?\d)/,Rt=/^[0-5]?\d/,Ft=/^[0-5]?\d/,Lt=/^\d/,Qt=/^\d{1,2}/,It=/^\d{1,3}/,Gt=/^\d{1,4}/,Bt=/^-?\d+/,Xt=/^-?\d/,_t=/^-?\d{1,2}/,zt=/^-?\d{1,3}/,$t=/^-?\d{1,4}/,Kt=/^([+-])(\d{2})(\d{2})?|Z/,Ut=/^([+-])(\d{2})(\d{2})|Z/,Jt=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,Vt=/^([+-])(\d{2}):(\d{2})|Z/,Zt=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function te(t,e){return t?{value:e(t.value),rest:t.rest}:t}function ee(t,e){const n=e.match(t);return n?{value:parseInt(n[0],10),rest:e.slice(n[0].length)}:null}function ne(t,e){const n=e.match(t);if(!n)return null;if("Z"===n[0])return{value:0,rest:e.slice(1)};return{value:("+"===n[1]?1:-1)*(36e5*(n[2]?parseInt(n[2],10):0)+6e4*(n[3]?parseInt(n[3],10):0)+1e3*(n[5]?parseInt(n[5],10):0)),rest:e.slice(n[0].length)}}function re(t){return ee(Bt,t)}function ae(t,e){switch(t){case 1:return ee(Lt,e);case 2:return ee(Qt,e);case 3:return ee(It,e);case 4:return ee(Gt,e);default:return ee(new RegExp("^\\d{1,"+t+"}"),e)}}function oe(t,e){switch(t){case 1:return ee(Xt,e);case 2:return ee(_t,e);case 3:return ee(zt,e);case 4:return ee($t,e);default:return ee(new RegExp("^-?\\d{1,"+t+"}"),e)}}function ie(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 n=e>0,r=n?e:1-e;let a;if(r<=50)a=t||100;else{const e=r+50;a=t+100*Math.floor(e/100)-(t>=e%100?100:0)}return n?a:1-a}function ue(t){return t%400==0||t%4==0&&t%100!=0}const ce=[31,28,31,30,31,30,31,31,30,31,30,31],de=[31,29,31,30,31,30,31,31,30,31,30,31];function le(t,e,n){const r=N(),a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=A(t),i=o.getDay(),s=7-a;return H(o,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function he(t,e){const n=A(t),r=function(t){let e=A(t).getDay();return 0===e&&(e=7),e}(n);return H(n,e-r)}const fe={G:new class extends At{priority=140;parse(t,e,n){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}}set(t,e,n){return e.era=n,t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends At{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,n){const r=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return te(ae(4,t),r);case"yo":return te(n.ordinalNumber(t,{unit:"year"}),r);default:return te(ae(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n){const r=t.getFullYear();if(n.isTwoDigitYear){const e=se(n.year,r);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const a="era"in e&&1!==e.era?1-n.year:n.year;return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}},Y:new class extends At{priority=130;parse(t,e,n){const r=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return te(ae(4,t),r);case"Yo":return te(n.ordinalNumber(t,{unit:"year"}),r);default:return te(ae(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n,r){const a=V(t,r);if(n.isTwoDigitYear){const e=se(n.year,a);return t.setFullYear(e,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),W(t,r)}const o="era"in e&&1!==e.era?1-n.year:n.year;return t.setFullYear(o,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),W(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends At{priority=130;parse(t,e){return oe("R"===e?4:e.length,t)}set(t,e,n){const r=E(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),j(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends At{priority=130;parse(t,e){return oe("u"===e?4:e.length,t)}set(t,e,n){return t.setFullYear(n,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 At{priority=120;parse(t,e,n){switch(e){case"Q":case"QQ":return ae(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth(3*(n-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 At{priority=120;parse(t,e,n){switch(e){case"q":case"qq":return ae(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth(3*(n-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 At{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,n){const r=t=>t-1;switch(e){case"M":return te(ee(Et,t),r);case"MM":return te(ae(2,t),r);case"Mo":return te(n.ordinalNumber(t,{unit:"month"}),r);case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}},L:new class extends At{priority=110;parse(t,e,n){const r=t=>t-1;switch(e){case"L":return te(ee(Et,t),r);case"LL":return te(ae(2,t),r);case"Lo":return te(n.ordinalNumber(t,{unit:"month"}),r);case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,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 At{priority=100;parse(t,e,n){switch(e){case"w":return ee(Yt,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return ae(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n,r){return W(function(t,e,n){const r=A(t),a=Z(r,n)-e;return r.setDate(r.getDate()-7*a),r}(t,n,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends At{priority=100;parse(t,e,n){switch(e){case"I":return ee(Yt,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return ae(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n){return j(function(t,e){const n=A(t),r=J(n)-e;return n.setDate(n.getDate()-7*r),n}(t,n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends At{priority=90;subPriority=1;parse(t,e,n){switch(e){case"d":return ee(Ht,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return ae(e.length,t)}}validate(t,e){const n=ue(t.getFullYear()),r=t.getMonth();return n?e>=1&&e<=de[r]:e>=1&&e<=ce[r]}set(t,e,n){return t.setDate(n),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends At{priority=90;subpriority=1;parse(t,e,n){switch(e){case"D":case"DD":return ee(qt,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return ae(e.length,t)}}validate(t,e){return ue(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,n){return t.setMonth(0,n),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 At{priority=90;parse(t,e,n){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=le(t,n,r)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends At{priority=90;parse(t,e,n,r){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return te(ae(e.length,t),a);case"eo":return te(n.ordinalNumber(t,{unit:"day"}),a);case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=le(t,n,r)).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 At{priority=90;parse(t,e,n,r){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return te(ae(e.length,t),a);case"co":return te(n.ordinalNumber(t,{unit:"day"}),a);case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=le(t,n,r)).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 At{priority=90;parse(t,e,n){const r=t=>0===t?7:t;switch(e){case"i":case"ii":return ae(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return te(n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return te(n.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return te(n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r);default:return te(n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,e){return e>=1&&e<=7}set(t,e,n){return(t=he(t,n)).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 At{priority=80;parse(t,e,n){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(ie(n),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends At{priority=80;parse(t,e,n){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(ie(n),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends At{priority=80;parse(t,e,n){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(ie(n),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends At{priority=70;parse(t,e,n){switch(e){case"h":return ee(jt,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return ae(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,n){const r=t.getHours()>=12;return r&&n<12?t.setHours(n+12,0,0,0):r||12!==n?t.setHours(n,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends At{priority=70;parse(t,e,n){switch(e){case"H":return ee(Ct,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return ae(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,n){return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends At{priority=70;parse(t,e,n){switch(e){case"K":return ee(Wt,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return ae(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.getHours()>=12&&n<12?t.setHours(n+12,0,0,0):t.setHours(n,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends At{priority=70;parse(t,e,n){switch(e){case"k":return ee(Nt,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return ae(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,n){const r=n<=24?n%24:n;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends At{priority=60;parse(t,e,n){switch(e){case"m":return ee(Rt,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return ae(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setMinutes(n,0,0),t}incompatibleTokens=["t","T"]},s:new class extends At{priority=50;parse(t,e,n){switch(e){case"s":return ee(Ft,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return ae(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setSeconds(n,0),t}incompatibleTokens=["t","T"]},S:new class extends At{priority=30;parse(t,e){return te(ae(e.length,t),(t=>Math.floor(t*Math.pow(10,3-e.length))))}set(t,e,n){return t.setMilliseconds(n),t}incompatibleTokens=["t","T"]},X:new class extends At{priority=10;parse(t,e){switch(e){case"X":return ne(Kt,t);case"XX":return ne(Ut,t);case"XXXX":return ne(Jt,t);case"XXXXX":return ne(Zt,t);default:return ne(Vt,t)}}set(t,e,n){return e.timestampIsSet?t:E(t,t.getTime()-L(t)-n)}incompatibleTokens=["t","T","x"]},x:new class extends At{priority=10;parse(t,e){switch(e){case"x":return ne(Kt,t);case"xx":return ne(Ut,t);case"xxxx":return ne(Jt,t);case"xxxxx":return ne(Zt,t);default:return ne(Vt,t)}}set(t,e,n){return e.timestampIsSet?t:E(t,t.getTime()-L(t)-n)}incompatibleTokens=["t","T","X"]},t:new class extends At{priority=40;parse(t){return re(t)}set(t,e,n){return[E(t,1e3*n),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends At{priority=20;parse(t){return re(t)}set(t,e,n){return[E(t,n),{timestampIsSet:!0}]}incompatibleTokens="*"}},ge=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,me=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,we=/^'([^]*?)'?$/,ye=/''/g,pe=/\S/,ve=/[a-zA-Z]/;function be(t,e,n,r){const a=Object.assign({},N()),o=r?.locale??a.locale??K,i=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(""===e)return""===t?A(n):E(n,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:o},c=[new Ot],d=e.match(me).map((t=>{const e=t[0];if(e in gt){return(0,gt[e])(t,o.formatLong)}return t})).join("").match(ge),l=[];for(let a of d){!r?.useAdditionalWeekYearTokens&&pt(a)&&vt(a,e,t),!r?.useAdditionalDayOfYearTokens&&yt(a)&&vt(a,e,t);const i=a[0],s=fe[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 \`${a}\` at the same time`)}else if("*"===s.incompatibleTokens&&l.length>0)throw new RangeError(`The format string mustn't contain \`${a}\` and any other token at the same time`);l.push({token:i,fullToken:a});const r=s.run(t,a,o.match,u);if(!r)return E(n,NaN);c.push(r.setter),t=r.rest}else{if(i.match(ve))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");if("''"===a?a="'":"'"===i&&(a=a.match(we)[1].replace(ye,"'")),0!==t.indexOf(a))return E(n,NaN);t=t.slice(a.length)}}if(t.length>0&&pe.test(t))return E(n,NaN);const h=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,n)=>n.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=A(n);if(isNaN(f.getTime()))return E(n,NaN);const g={};for(const t of h){if(!t.validate(f,u))return E(n,NaN);const e=t.set(f,g,u);Array.isArray(e)?(f=e[0],Object.assign(g,e[1])):f=e}return E(n,f)}var ke=function(t){u(n,y);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"store-hour",o)}return i(n,[{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,n=Math.abs(t-e);return Math.floor(n/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 be(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 be(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return Q(this.startDateInstance)&&Q(this.endDateInstance)?"".concat(Dt(this.startDateInstance,"p")," - ").concat(Dt(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!")}}]),n}(),xe=function(e){u(r,y);var n=g(r);function r(){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 a(this,r),n.call(this,t,e,"store-location",o)}return i(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 t.Collection(this.getAttribute("hours").map((function(t){return new ke(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=Dt(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var e={},n=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],r=0;r0&&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 a(this,o),r.call(this,t,e,"store",n)}return i(o,[{key:"getReviews",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",n({store:this.id},r)).then((function(n){return new t.Collection(n.map((function(t){return new v(t,e.adapter)})))}))}},{key:"getLocations",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",n({store:this.id},r)).then((function(n){return new t.Collection(n.map((function(n){return n.place&&(n.place=new t.Place(n.place)),new xe(n,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 xe(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",n).then((function(n){return new t.Collection(n.map((function(t){return new O(t,e.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new O(t,e.adapter)}))}}]),o}(),Me=function(e){u(r,y);var n=g(r);function r(){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 a(this,r),n.call(this,t,e,"network",o)}return i(r,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getStores",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("stores",n).then((function(n){return new t.Collection(n.map((function(t){return new Te(t,e.adapter)})))}))}},{key:"getStoreLocations",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("store-locations",n).then((function(n){return new t.Collection(n.map((function(t){return new xe(t,e.adapter)})))}))}},{key:"getPaymentGateways",value:function(){var e=this;return this.adapter.get("gateways").then((function(n){return new t.Collection(n.map((function(t){return new O(t,e.adapter)})))}))}}]),r}(),De=Array.isArray,Pe=function(e){u(r,t.ServiceQuote);var n=g(r);function r(){var e,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,r),o instanceof t.Adapter?f(e,e=n.call(this,{},o,"service-quote",s)):n.call(this,o,i,"service-quote",s)}return i(r,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ye(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 e=this.getAttributes(["amount","currency"]),n=e.amount,r=e.currency;return t.isEmpty(n)||t.isEmpty(r)?null:b(n/100,r)}},{key:"fromCart",value:function(e,n,a){var o,i,s,u=this,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"storefront",d=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return null!==(o=e)&&void 0!==o&&o.id&&(e=e.id),null!==(i=n)&&void 0!==i&&i.id&&(n=n.id),null!==(s=a)&&void 0!==s&&s.id&&(a=a.id),this.adapter.get("service-quotes/from-cart",{origin:e,destination:n,cart:a,config:c,all:d}).then((function(e){return De(e)?new t.Collection(e.map((function(t){return new r(t,u.adapter)}))):new r(e,u.adapter)}))}}],[{key:"getFromCart",value:function(t){for(var e=new r(t),n=arguments.length,a=new Array(n>1?n-1:0),o=1;o4&&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(r)&&(r=r.id),t.isResource(a)&&(a=a.id),t.isResource(o)&&(o=o.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),n(n({},i),{},{customer:e,cart:r,serviceQuote:a,gateway:o}),s)},captureOrder:function(e){var n=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:e,transactionDetails:n},r).then((function(e){return new t.Order(e)}))}}),Oe=function(t){u(n,y);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"checkout",o)}return i(n,[{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)}}]),n}(),Ae={Product:k,Category:x,Customer:M,Cart:S,DeliveryServiceQuote:Pe,Store:Te,StoreLocation:xe,StoreHour:ke,Checkout:Oe,Review:v},Ee={BrowserAdapter:t.BrowserAdapter,NodeAdapter:t.NodeAdapter},He=function(){function e(){return a(this,e),this.resources=Ae,this.adapters=Ee,this.lookup.apply(this,arguments)}return i(e,[{key:"lookup",value:function(e,n){var r=t.pluralize(e),a=Array.prototype.slice.call(arguments).slice(2);if(!this[r])throw new Error("Attempted to resolve invalid type");if(!this[r][n])throw new Error("No ".concat(t.singularize(e)," named ").concat(n," to resolve"));return h(this[r][n],m(a))}}]),e}(),qe=function(){return h(He,Array.prototype.slice.call(arguments))},Ye=function(e){u(r,t.Store);var n=g(r);function r(){return a(this,r),n.apply(this,arguments)}return i(r,[{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 qe("resource",t.classify(this.resource),e,this.adapter)}}]),r}(),Ce=function(){function e(n){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(a(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:n,debug:i},!("string"==typeof(r=n)&&r.length>30&&(r.startsWith("store_")||r.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()?qe("adapter","NodeAdapter",e):qe("adapter","BrowserAdapter",e)}(this.options),this.products=new Ye("product",this.adapter),this.categories=new Ye("category",this.adapter),this.reviews=new Ye("review",this.adapter).extendActions(p),this.customers=new Ye("customer",this.adapter).extendActions(T),this.cart=new Ye("cart",this.adapter).extendActions(P),this.checkout=new Ye("checkout",this.adapter).extendActions(Se)}return i(e,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"search",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",n({query:e},r)).then((function(e){return new t.Collection(e.map((function(t){return new k(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return h(e,Array.prototype.slice.call(arguments))}}]),e}();exports.Cart=S,exports.Category=x,exports.Checkout=Oe,exports.Customer=M,exports.DeliveryServiceQuote=Pe,exports.Network=Me,exports.PaymentGateway=O,exports.Product=k,exports.Review=v,exports.Store=Te,exports.StoreHour=ke,exports.StoreLocation=xe,exports.default=Ce; //# sourceMappingURL=storefront.js.map diff --git a/dist/cjs/storefront.js.map b/dist/cjs/storefront.js.map index 59e0f95..ac7e0b9 100644 --- a/dist/cjs/storefront.js.map +++ b/dist/cjs/storefront.js.map @@ -1 +1 @@ -{"version":3,"file":"storefront.js","sources":["../../node_modules/@fleetbase/sdk/dist/esm/fleetbase.js","../../src/resource.js","../../src/resources/review.js","../../src/utils/detect-adapter.js","../../src/utils/is-phone.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/resources/cart.js","../../node_modules/date-fns/esm/_lib/toInteger/index.js","../../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../../node_modules/date-fns/esm/toDate/index.js","../../node_modules/date-fns/esm/addMilliseconds/index.js","../../node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js","../../node_modules/date-fns/esm/isDate/index.js","../../node_modules/date-fns/esm/isValid/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js","../../node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js","../../node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js","../../node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/match/index.js","../../node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js","../../node_modules/date-fns/esm/locale/en-US/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js","../../node_modules/date-fns/esm/subMilliseconds/index.js","../../node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","../../node_modules/date-fns/esm/_lib/format/lightFormatters/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js","../../node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js","../../node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js","../../node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js","../../node_modules/date-fns/esm/_lib/getUTCWeek/index.js","../../node_modules/date-fns/esm/_lib/format/formatters/index.js","../../node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js","../../node_modules/date-fns/esm/_lib/format/longFormatters/index.js","../../node_modules/date-fns/esm/_lib/protectedTokens/index.js","../../node_modules/date-fns/esm/format/index.js","../../node_modules/date-fns/esm/_lib/assign/index.js","../../node_modules/date-fns/esm/_lib/setUTCDay/index.js","../../node_modules/date-fns/esm/parse/_lib/parsers/index.js","../../node_modules/date-fns/esm/_lib/setUTCWeek/index.js","../../node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js","../../node_modules/date-fns/esm/_lib/setUTCISODay/index.js","../../node_modules/date-fns/esm/parse/index.js","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/payment-gateway.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"],"sourcesContent":["import t from\"axios\";function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:[];if(A(t))if(r.length<=6e4)t.splice.apply(t,[e,n].concat(m(r)));else{t.splice(e,n);for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:0,r=t.length,i=n;i2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=t.length;n<0&&(n+=i);var o=r&&e!=e?function(t){return t!=t}:function(t){return t===e};return S(t,o,n)},F=function(t,e,n){return $(t,e,0,[n]),n},D=function(t){h(n,g(Array));var e=y(n);function n(){for(var t=arguments.length,r=new Array(t),i=0;i0}},{key:\"empty\",get:function(){return 0===this.length}},{key:\"first\",get:function(){return j(this,0)}},{key:\"last\",get:function(){return j(this,this.length-1)}},{key:\"replace\",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return $(this,t,e,n),this}},{key:\"objectsAt\",value:function(t){var e=this;return t.map((function(t){return j(e,t)}))}},{key:\"objectAt\",value:function(t){return j(this,t)}},{key:\"indexOf\",value:function(t,e){return L(this,t,e,!1)}},{key:\"lastIndexOf\",value:function(t,e){var n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(var r=e;r>=0;r--)if(j(this,r)===t)return r;return-1}},{key:\"includes\",value:function(t,e){return-1!==L(this,t,e,!0)}},{key:\"findBy\",value:function(){return _(this,O.apply(void 0,arguments))}},{key:\"findIndexBy\",value:function(){return S(this,O.apply(void 0,arguments))}},{key:\"isEvery\",value:function(){return z(this,O.apply(void 0,arguments))}},{key:\"isAny\",value:function(){return P(this,O.apply(void 0,arguments))}},{key:\"invoke\",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:R,n=[],r=new Set,i=\"function\"==typeof e?e:function(t){return get(t,e)};return t.forEach((function(t){var e=i(t);r.has(e)||(r.add(e),n.push(t))})),n}(this,t)}},{key:\"without\",value:function(t){if(!this.includes(t))return this;var e=t==t?function(e){return e!==t}:function(t){return t==t};return this.filter(e)}},{key:\"clear\",value:function(){var t=this.length;return 0===t||this.replace(0,t,[]),this}},{key:\"insertAt\",value:function(t,e){return F(this,t,e),this}},{key:\"replaceAt\",value:function(t,e){return this.replace(t,1,[e])}},{key:\"removeAt\",value:function(t,e){return function(t,e){return $(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,[]),t}(this,t,e)}},{key:\"pushObject\",value:function(t){return this.insertAt(this.length,t)}},{key:\"pushObjects\",value:function(t){return this.replace(this.length,0,t),this}},{key:\"popObject\",value:function(){var t=this.length;if(0===t)return null;var e=j(this,t-1);return this.removeAt(t-1,1),e}},{key:\"shiftObject\",value:function(){if(0===this.length)return null;var t=j(this,0);return this.removeAt(0),t}},{key:\"unshiftObject\",value:function(t){return F(this,0,t)}},{key:\"unshiftObjects\",value:function(t){return this.replace(0,0,t),this}},{key:\"reverseObjects\",value:function(){var t=this.length;if(0===t)return this;var e=this.toArray().reverse();return this.replace(0,t,e),this}},{key:\"setObjects\",value:function(t){if(0===t.length)return this.clear();var e=this.length;return this.replace(0,e,t),this}},{key:\"removeObject\",value:function(t){for(var e=this.length||0;--e>=0;){j(this,e)===t&&this.removeAt(e)}return this}},{key:\"removeObjects\",value:function(t){for(var e=t.length-1;e>=0;e--)this.removeObject(t[e]);return this}},{key:\"addObject\",value:function(t){return this.includes(t)||this.pushObject(t),this}},{key:\"addObjects\",value:function(t){var e=this;return t.forEach((function(t){return e.addObject(t)})),this}}]),n}(),C=function(t){var e=null==t;if(e)return e;if(\"number\"==typeof t.size)return!t.size;var n=r(t);if(\"object\"===n){var i=t.size;if(\"number\"==typeof i)return!i}if(\"number\"==typeof t.length&&\"function\"!==n)return!t.length;if(\"object\"===n){var o=t.length;if(\"number\"==typeof o)return!o}return!1},T=function(t){return C(t)||\"string\"==typeof t&&!1===/\\S/.test(t)};function N(t){return isFinite(t)&&Math.abs(t)<=90}function q(t){return isFinite(t)&&Math.abs(t)<=180&&Math.abs(t)>=90}function B(t){return t instanceof Y}var U=function(){var t,e,n,i,o;return!(\"undefined\"==typeof process||\"object\"!==r(null===(t=process)||void 0===t?void 0:t.env)&&-1===(null===(e=process.release)||void 0===e||null===(n=e.name)||void 0===n?void 0:n.search(/node|io.js/))||\"undefined\"!=typeof window&&\"ReactNative\"!==(null===(i=window)||void 0===i||null===(o=i.navigator)||void 0===o?void 0:o.product))},I=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U()?Rt(\"adapter\",\"NodeAdapter\",t):Rt(\"adapter\",\"BrowserAdapter\",t)},J=Array.isArray,K=function(){function t(e){s(this,t),this.place=e,this.geometry=null==e?void 0:e.geometry,this.components=this.parseComponents(),this.attributes=this.parseProperties()}return a(t,[{key:\"parse\",value:function(){this.parseComponents(),this.parseProperties()}},{key:\"parseComponents\",value:function(){var t;return((null===(t=this.place)||void 0===t?void 0:t.address_components)||[]).reduce((function(t,e){return e.types.forEach((function(n){t[n]=e})),t}),{})}},{key:\"parseProperties\",value:function(){var t,e={streetNumber:this.get(\"street_number\"),streetName:this.get(\"route\"),coordinates:null!==(t=this.geometry)&&void 0!==t&&t.location?Object.values(this.geometry.location):[0,0],city:this.or([\"locality\",\"sublocality\",\"sublocality_level_1\",\"neighborhood\",\"administrative_area_level_3\",\"administrative_area_level_2\"]),county:this.get(\"administrative_area_level_2\"),stateShort:this.get(\"administrative_area_level_1\",!0),stateLong:this.get(\"administrative_area_level_1\"),countryShort:this.get(\"country\",!0),country:this.get(\"country\",!0),countryLong:this.get(\"country\"),postalCode:this.get(\"postal_code\")};return e.address=[e.streetNumber,e.streetName].filter(Boolean).join(\" \"),e}},{key:\"all\",value:function(){return this.attributes}},{key:\"or\",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=0;e1&&void 0!==arguments[1]&&arguments[1];return t in this.components?e?this.components[t].short_name:this.components[t].long_name:null}},{key:\"setAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.attributes=n(n({},this.attributes),t),this}},{key:\"setAttribute\",value:function(t,e){return this.attributes[t]=e,this}},{key:\"getAttribute\",value:function(t){return this.attributes[t]||null}}]),t}(),M=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s(this,t),this.type=\"Point\",this.coordinates=[n,e]}return a(t,[{key:\"latitude\",get:function(){return this.coordinates[1]}},{key:\"longitude\",get:function(){return this.coordinates[0]}},{key:\"lat\",value:function(){return this.latitude}},{key:\"lng\",value:function(){return this.longitude}},{key:\"serialize\",value:function(){return{type:\"Point\",coorindates:[this.lat(),this.lng()]}}},{key:\"toJson\",value:function(){return this.serialize()}},{key:\"toString\",value:function(){return\"(\".concat(this.latitude,\", \").concat(this.longitude,\")\")}}],[{key:\"fromGeoJson\",value:function(e){var n=b(e.coordinates,2);return longitude=n[0],latitude=n[1],new t(latitude,longitude)}}]),t}();\"undefined\"==typeof arguments||arguments;var W=function(t,e){var n=t();return Array.isArray(n)||\"object\"===r(n)?H(n,e):null},H=function t(e,n){var i,o=e,s=r(e),u=\"object\"===s,a=\"function\"===s,c=Array.isArray(e),h=\"string\"===r(n)&&n.includes(\".\")?n.split(\".\"):[n];if(c||u){for(var l=0;l0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;s(this,t),this.actions=e,this.bind=n}return a(t,[{key:\"extend\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=t||this.bind;if(!e)return this;if(null!=this&&this.actions&&\"object\"===r(this.actions))for(var n in this.actions){var i=this.actions[n];\"function\"==typeof i?G(e,n,i.bind(e)):G(e,n,i)}return this}}]),t}(),Y=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};s(this,t),this.attributes=e,this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isDestroying=!1,this.isReloading=!1,this.resource=r,this.options=i,this.version=i.version||\"v1\",this.setAdapter(n)}return a(t,[{key:\"setAdapter\",value:function(t){var e;return this.adapter=t,this.store=new jt(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:\"id\",get:function(){return this.getAttribute(\"id\")}},{key:\"create\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.mergeAttributes(e);return this.setFlags([\"isLoading\",\"isSaving\"]),this.store.create(n).then((function(e){return t.setFlags([\"isLoading\",\"isSaving\"],!1),e}))}},{key:\"update\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setFlags([\"isLoading\",\"isSaving\"]),this.store.update(this.attributes.id,e).then((function(e){return t.setFlags([\"isLoading\",\"isSaving\"],!1),e}))}},{key:\"destroy\",value:function(){var t=this;return this.setFlags([\"isLoading\",\"isDestroying\"]),this.store.destroy(this.attributes.id).then((function(e){return t.setFlags([\"isLoading\",\"isDestroying\"],!1),e}))}},{key:\"reload\",value:function(){var t=this;return this.setFlags([\"isLoading\",\"isReloading\"]),this.store.findRecord(this.attributes.id).then((function(e){return t.reset(),e}))}},{key:\"setFlags\",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=[\"isLoading\",\"isSaving\",\"isReloading\",\"isDestroying\"],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAttributes();return C(this.id)?this.create(e):!0===t.onlyDirty?this.savedirty():this.update(e)}},{key:\"saveDirty\",value:function(){for(var t=Object.keys(this.dirtyAttributes),e={},n=0;n0}},{key:\"mutate\",value:function(t,e){this.attributes[t]=e}},{key:\"setAttribute\",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===n&&\"object\"===r(t))return this.setAttributes(t);var i=null!==(e=null==this?void 0:this.attributes[t])&&void 0!==e?e:null;return G(this.attributes,t,n),G(this.dirtyAttributes,t,i),A(null==this?void 0:this.changes[t])||(this.changes[t]=[]),this.changes[t].push({property:t,previousValue:i,value:n,changedAt:new Date}),this}},{key:\"setAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)this.setAttribute(e,t[e]);return this}},{key:\"getAttribute\",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=H(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{},t);return void 0===r?n:r}},{key:\"hasAttribute\",value:function(t){if(A(t)){var e,n=t,r=Object.keys(null!==(e=this.attributes)&&void 0!==e?e:{});return n.every((function(t){return r.includes(t)}))}return!(null==this||!this.attributes)&&t in this.attributes}},{key:\"hasAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.hasAttribute(t)}},{key:\"isAttributeFilled\",value:function(t){var e=this;return A(t)?this.hasAttribute(t)&&t.every((function(t){return!C(e.getAttribute(t))})):this.hasAttribute(t)&&!C(this.getAttribute(t))}},{key:\"getAttributes\",value:function(t){var e={};if(null==t)return this.getAttributes(Object.keys(this.attributes));if(\"string\"==typeof t)return this.getAttribute(Array.prototype.slice.call(arguments));if(!A(t))throw new Error(\"No attribute properties provided!\");for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=null!==(t=null==this?void 0:this.attributes)&&void 0!==t?t:{};return this.attributes=n(n({},r),e),this.attributes}},{key:\"syncAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attributes=t}}]),t}(),Z=new V({getDistanceAndTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get(\"\".concat(this.namespace,\"/\").concat(t,\"/distance-and-time\"),{},e)}}),Q=function(t){h(r,Y);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,r),e.call(this,t,i,\"order\",n({actions:Z},o))}return a(r,[{key:\"getDistanceAndTime\",value:function(){return this.store.getDistanceAndTime(this.id)}}]),r}(),X=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"payload\",i)}return a(n,[{key:\"attach\",value:function(t){}},{key:\"entities\",get:function(){}},{key:\"dropoff\",get:function(){}},{key:\"pickup\",get:function(){}},{key:\"waypoints\",get:function(){return new D(this.waypoints)}}]),n}(),tt=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"entity\",i)}return n}(),et=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"place\",i)}return a(n,[{key:\"latitude\",get:function(){var t;return null===(t=this.getAttribute(\"location\",new M))||void 0===t?void 0:t.coordinates[1]}},{key:\"longitude\",get:function(){var t;return null===(t=this.getAttribute(\"location\",new M))||void 0===t?void 0:t.coordinates[0]}},{key:\"coordinates\",get:function(){return[this.latitude,this.longitude]}},{key:\"setOwner\",value:function(t){return B(t)&&this.setAttribute(\"owner\",t.id),\"string\"==typeof t&&this.setAttribute(\"owner\",t),this}}],[{key:\"fromGoogleAddress\",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.getAttribute(\"coordinates\"),o=b(i,2),s=o[0],u=o[1],a={name:null,address:t.getAttribute(\"address\"),location:new M(s,u),street1:t.getAttribute(\"streetName\"),street2:null,city:t.getAttribute(\"city\"),province:t.getAttribute(\"stateLong\"),postal_code:t.getAttribute(\"postalCode\"),neighborhood:t.get(\"neighborhood\"),district:t.getAttribute(\"county\"),building:t.get(\"building\"),country:t.getAttribute(\"countryShort\"),phone:null,security_access_code:null};return new n(a,e,r)}}]),n}(),nt=function(t){h(n,et);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"waypoint\",i)}return n}(),rt=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"tracking-status\",i)}return n}(),it=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"vehicle\",i)}return n}(),ot=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"driver\",i)}return n}(),st=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"vendor\",i)}return n}(),ut=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"contact\",i)}return n}(),at=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"zone\",i)}return n}(),ct=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"service-area\",i)}return n}(),ht=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"service-rate\",i)}return n}(),lt=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"service-quote\",i)}return a(n,[{key:\"fromPreliminary\",value:function(){}},{key:\"fromPayload\",value:function(){}}]),n}(),vt=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,t),this.version=e.version||\"v1\",this.host=e.host||null,this.namespace=e.namespace||null,this.headers=e.headers||{}},ft=function(t){h(r,vt);var e=y(r);function r(t){var n;return s(this,r),(n=e.call(this,t)).setHeaders({Authorization:\"Bearer \".concat(t.publicKey),\"Content-Type\":\"application/json\",\"User-Agent\":\"@fleetbase/sdk;browser\"}),n}return a(r,[{key:\"setHeaders\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.headers=n(n({},this.headers),t),this}},{key:\"parseJSON\",value:function(t){return new Promise((function(e,n){return t.json().then((function(n){return e({statusText:t.statusText,status:t.status,ok:t.ok,json:n})})).catch((function(){n(new Error(\"Oops! Something went wrong when handling your request.\"))}))}))}},{key:\"request\",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"GET\",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(s,u){return fetch(o.url||\"\".concat(e.host,\"/\").concat(e.namespace,\"/\").concat(t),n({method:r,mode:o.mode||\"cors\",headers:new Headers(n(n({},e.headers||{}),o.headers||{}))},i)).then(e.parseJSON).then((function(t){return t.ok?s(t.json):u(new Error(t.json.errors?t.json.errors[0]:t.statusText))})).catch((function(t){u(t)}))}))}},{key:\"get\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=T(e)?\"\":new URLSearchParams(e).toString();return this.request(\"\".concat(t).concat(r?\"?\".concat(r):\"\"),\"GET\",{},n)}},{key:\"post\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,\"POST\",{body:JSON.stringify(e)},n)}},{key:\"put\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,\"PUT\",{body:JSON.stringify(e)},n)}},{key:\"delete\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(t,\"DELETE\",{},e)}},{key:\"patch\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,\"PATCH\",{body:JSON.stringify(e)},n)}}]),r}(),dt=function(e){h(i,vt);var r=y(i);function i(e){var n;return s(this,i),(n=r.call(this,e)).axios=t.create({baseURL:\"\".concat(n.host,\"/\").concat(n.namespace),headers:{Authorization:\"Bearer \".concat(e.publicKey),\"Content-Type\":\"application/json\",\"User-Agent\":\"@fleetbase/sdk;node\"}}),n}return a(i,[{key:\"setHeaders\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.axios.defaults.headers.common;return this.axios.defaults.headers.common=n(n({},e),t),this}},{key:\"transform\",value:function(t){return t.data}},{key:\"handleError\",value:function(t){if(t.response){var e=t.response.data;if(A(e.errors))throw new Error(e.errors[0]);if(e.error)throw new Error(e.error)}throw t}},{key:\"get\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=T(e)?\"\":new URLSearchParams(e).toString();return this.axios.get(\"\".concat(t).concat(r?\"?\".concat(r):\"\"),n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"post\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.post(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"put\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.put(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"delete\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.axios.delete(t,e).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"patch\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.patch(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}}]),i}(),gt=function(t){h(n,vt);var e=y(n);function n(){return s(this,n),e.apply(this,arguments)}return n}(),pt=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];s(this,t),c(this,\"uncountableWords\",[\"equipment\",\"information\",\"rice\",\"money\",\"species\",\"series\",\"fish\",\"sheep\",\"moose\",\"deer\",\"news\"]),c(this,\"pluralRules\",[[new RegExp(\"(m)an$\",\"gi\"),\"$1en\"],[new RegExp(\"(pe)rson$\",\"gi\"),\"$1ople\"],[new RegExp(\"(child)$\",\"gi\"),\"$1ren\"],[new RegExp(\"^(ox)$\",\"gi\"),\"$1en\"],[new RegExp(\"(ax|test)is$\",\"gi\"),\"$1es\"],[new RegExp(\"(octop|vir)us$\",\"gi\"),\"$1i\"],[new RegExp(\"(alias|status)$\",\"gi\"),\"$1es\"],[new RegExp(\"(bu)s$\",\"gi\"),\"$1ses\"],[new RegExp(\"(buffal|tomat|potat)o$\",\"gi\"),\"$1oes\"],[new RegExp(\"([ti])um$\",\"gi\"),\"$1a\"],[new RegExp(\"sis$\",\"gi\"),\"ses\"],[new RegExp(\"(?:([^f])fe|([lr])f)$\",\"gi\"),\"$1$2ves\"],[new RegExp(\"(hive)$\",\"gi\"),\"$1s\"],[new RegExp(\"([^aeiouy]|qu)y$\",\"gi\"),\"$1ies\"],[new RegExp(\"(x|ch|ss|sh)$\",\"gi\"),\"$1es\"],[new RegExp(\"(matr|vert|ind)ix|ex$\",\"gi\"),\"$1ices\"],[new RegExp(\"([m|l])ouse$\",\"gi\"),\"$1ice\"],[new RegExp(\"(quiz)$\",\"gi\"),\"$1zes\"],[new RegExp(\"s$\",\"gi\"),\"s\"],[new RegExp(\"$\",\"gi\"),\"s\"]]),c(this,\"singularRules\",[[new RegExp(\"(m)en$\",\"gi\"),\"$1an\"],[new RegExp(\"(pe)ople$\",\"gi\"),\"$1rson\"],[new RegExp(\"(child)ren$\",\"gi\"),\"$1\"],[new RegExp(\"([ti])a$\",\"gi\"),\"$1um\"],[new RegExp(\"((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$\",\"gi\"),\"$1$2sis\"],[new RegExp(\"(hive)s$\",\"gi\"),\"$1\"],[new RegExp(\"(tive)s$\",\"gi\"),\"$1\"],[new RegExp(\"(curve)s$\",\"gi\"),\"$1\"],[new RegExp(\"([lr])ves$\",\"gi\"),\"$1f\"],[new RegExp(\"([^fo])ves$\",\"gi\"),\"$1fe\"],[new RegExp(\"([^aeiouy]|qu)ies$\",\"gi\"),\"$1y\"],[new RegExp(\"(s)eries$\",\"gi\"),\"$1eries\"],[new RegExp(\"(m)ovies$\",\"gi\"),\"$1ovie\"],[new RegExp(\"(x|ch|ss|sh)es$\",\"gi\"),\"$1\"],[new RegExp(\"([m|l])ice$\",\"gi\"),\"$1ouse\"],[new RegExp(\"(bus)es$\",\"gi\"),\"$1\"],[new RegExp(\"(o)es$\",\"gi\"),\"$1\"],[new RegExp(\"(shoe)s$\",\"gi\"),\"$1\"],[new RegExp(\"(cris|ax|test)es$\",\"gi\"),\"$1is\"],[new RegExp(\"(octop|vir)i$\",\"gi\"),\"$1us\"],[new RegExp(\"(alias|status)es$\",\"gi\"),\"$1\"],[new RegExp(\"^(ox)en\",\"gi\"),\"$1\"],[new RegExp(\"(vert|ind)ices$\",\"gi\"),\"$1ex\"],[new RegExp(\"(matr)ices$\",\"gi\"),\"$1ix\"],[new RegExp(\"(quiz)zes$\",\"gi\"),\"$1\"],[new RegExp(\"s$\",\"gi\"),\"\"]]),c(this,\"nonTitlecasedWords\",[\"and\",\"or\",\"nor\",\"a\",\"an\",\"the\",\"so\",\"but\",\"to\",\"of\",\"at\",\"by\",\"from\",\"into\",\"on\",\"onto\",\"off\",\"out\",\"in\",\"over\",\"with\",\"for\"]),c(this,\"idSuffix\",new RegExp(\"(_ids|_id)$\",\"g\")),c(this,\"underbar\",new RegExp(\"_\",\"g\")),c(this,\"spaceOrUnderbar\",new RegExp(\"[ _]\",\"g\")),c(this,\"uppercase\",new RegExp(\"([A-Z])\",\"g\")),c(this,\"underbarPrefix\",new RegExp(\"^_\")),this.str=e,this.chain=n}return a(t,[{key:\"get\",value:function(){return this.str}},{key:\"applyRules\",value:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:null;return t=t||this.str,this.applyRules(t,this.pluralRules,this.uncountableWords,e)}},{key:\"singularize\",value:function(t,e){return t=t||this.str,this.applyRules(t,this.singularRules,this.uncountableWords,e)}},{key:\"camelize\",value:function(t,e){for(var n=(t=t||this.str).split(\"/\"),r=0;r1&&void 0!==arguments[1]&&arguments[1];return t=t||this.str,t=this.underscore(this.demodulize(t))+(e?\"\":\"_\")+\"id\",this.str=t,!0===this.chain?this:t}},{key:\"ordinalize\",value:function(t){for(var e=(t=t||this.str).split(\" \"),n=0;n1&&void 0!==arguments[1]?arguments[1]:[];if(t.actions=A(e)?e:[e],!A(e))return e instanceof V&&e.extend(t),t;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};s(this,t),this.resource=e,this.adapter=n||I(),this.namespace=yt(e),this.storage=new D,this.options=r,this.extendActions(r.actions)}return a(t,[{key:\"extendActions\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Et(this,t)}},{key:\"deposit\",value:function(t){return t}},{key:\"serialize\",value:function(t){return Rt(\"resource\",wt(this.resource),t,this.adapter)}},{key:\"afterFetch\",value:function(t){return function(t,e){if(\"function\"==typeof t.options.onAfterFetch&&t.options.onAfterFetch(e),A(e)){for(var n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.post(\"\".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"update\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(function(){var i=o(regeneratorRuntime.mark((function i(o,s){var u;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,e.adapter.put(\"\".concat(e.namespace,\"/\").concat(t),n,r).then(e.afterFetch.bind(e)).catch(s);case 2:u=i.sent,o(u);case 4:case\"end\":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}())}},{key:\"findRecord\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.adapter.get(\"\".concat(e.namespace,\"/\").concat(t),{},n).then(e.afterFetch.bind(e)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"findAll\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var n=o(regeneratorRuntime.mark((function n(r,i){var o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.adapter.get(\"\".concat(t.namespace),{},e).then(t.afterFetch.bind(t)).catch(i);case 2:o=n.sent,r(o);case 4:case\"end\":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}())}},{key:\"query\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get(\"\".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"queryRecord\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.single=!0,new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get(\"\".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"destroy\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=B(t)?t.getAttribute(\"id\"):t;return new Promise(function(){var t=o(regeneratorRuntime.mark((function t(i,o){var s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.adapter.delete(\"\".concat(e.namespace,\"/\").concat(r),{},n).then(e.afterFetch.bind(e)).catch(o);case 2:s=t.sent,i(s);case 4:case\"end\":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())}}]),t}(),Ot=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(s(this,t),this.version=n.version||\"v1\",this.options={version:this.version,host:n.host||\"https://api.fleetbase.io\",namespace:this.version||n.namespace,debug:r,publicKey:e},\"string\"!=typeof e||0===e.length)throw new Error(\"⚠️ Invalid public key given to Fleetbase SDK\");if(!U()&&e.toLowerCase().startsWith(\"$\"))throw new Error(\"Secret key provided. You must use a public key with Fleetbase Javascript SDK!\");this.adapter=n.adapter||I(this.options),this.orders=new jt(\"order\",this.adapter).extendActions(Z),this.entities=new jt(\"entity\",this.adapter),this.places=new jt(\"place\",this.adapter),this.drivers=new jt(\"driver\",this.adapter),this.vehicles=new jt(\"vehicle\",this.adapter),this.vendors=new jt(\"vendor\",this.adapter),this.contacts=new jt(\"contact\",this.adapter)}return a(t,[{key:\"setAdapter\",value:function(t){this.adapter=t}},{key:\"getAdapter\",value:function(){return this.adapter}}],[{key:\"newInstance\",value:function(){return d(t,Array.prototype.slice.call(arguments))}}]),t}();export default Ot;export{vt as Adapter,ft as BrowserAdapter,D as Collection,ut as Contact,ot as Driver,gt as EmberJsAdapter,tt as Entity,K as GoogleAddress,dt as NodeAdapter,Q as Order,X as Payload,et as Place,M as Point,Y as Resource,ct as ServiceArea,lt as ServiceQuote,ht as ServiceRate,jt as Store,V as StoreActions,rt as TrackingStatus,it as Vehicle,st as Vendor,nt as Waypoint,at as Zone,mt as camelize,wt as classify,kt as dasherize,Et as extendStoreActions,N as isLatitude,q as isLongitude,U as isNodeEnvironment,B as isResource,yt as pluralize,bt as singularize};\n//# sourceMappingURL=fleetbase.js.map\n","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}","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 };","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;","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n}\n\nexport default isPhone;","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', { style: 'currency', currency, currencyDisplay }).format(amount);\n}","const isKeyValid = (key) => {\n return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_'));\n};\n\nexport default isKeyValid;","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\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}","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\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 StorefrontStore from '../store';\nimport Resource from '../resource';\nimport { Contact, Place, Order, Collection, StoreActions } from '@fleetbase/sdk';\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', { identity, mode });\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', { actions: customerActions, ...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 token() {\n return this.getAttribute('token');\n }\n\n 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 getSavedPlaces() {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/places')\n .then((places) => {\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n });\n }\n\n getOrderHistory(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/orders', params)\n .then((orders) => {\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n });\n }\n}\n\nexport { customerActions };\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\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","export default function toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n\n var number = Number(dirtyNumber);\n\n if (isNaN(number)) {\n return number;\n }\n\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\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 * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\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 */\n\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument); // Clone the date\n\n if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule\"); // eslint-disable-next-line no-console\n\n console.warn(new Error().stack);\n }\n\n return new Date(NaN);\n }\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\n\nexport default function addMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var timestamp = toDate(dirtyDate).getTime();\n var amount = toInteger(dirtyAmount);\n return new Date(timestamp + amount);\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 default function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\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 * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {*} value - the value to check\n * @returns {boolean} true if the given value is a date\n * @throws {TypeError} 1 arguments required\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 */\n\nexport default function isDate(value) {\n requiredArgs(1, arguments);\n return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';\n}","import isDate from \"../isDate/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\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]{@link 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 * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Now `isValid` doesn't throw an exception\n * if the first argument is not an instance of Date.\n * Instead, argument is converted beforehand using `toDate`.\n *\n * Examples:\n *\n * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |\n * |---------------------------|---------------|---------------|\n * | `new Date()` | `true` | `true` |\n * | `new Date('2016-01-01')` | `true` | `true` |\n * | `new Date('')` | `false` | `false` |\n * | `new Date(1488370835081)` | `true` | `true` |\n * | `new Date(NaN)` | `false` | `false` |\n * | `'2016-01-01'` | `TypeError` | `false` |\n * | `''` | `TypeError` | `false` |\n * | `1488370835081` | `TypeError` | `true` |\n * | `NaN` | `TypeError` | `false` |\n *\n * We introduce this change to make *date-fns* consistent with ECMAScript behavior\n * that try to coerce arguments to the expected type\n * (which is also the case with other *date-fns* functions).\n *\n * @param {*} date - the date to check\n * @returns {Boolean} the date is valid\n * @throws {TypeError} 1 argument required\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 */\n\nexport default function isValid(dirtyDate) {\n requiredArgs(1, arguments);\n\n if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {\n return false;\n }\n\n var date = toDate(dirtyDate);\n return !isNaN(Number(date));\n}","var formatDistanceLocale = {\n lessThanXSeconds: {\n one: 'less than a second',\n other: 'less than {{count}} seconds'\n },\n xSeconds: {\n one: '1 second',\n other: '{{count}} seconds'\n },\n halfAMinute: 'half a minute',\n lessThanXMinutes: {\n one: 'less than a minute',\n other: 'less than {{count}} minutes'\n },\n xMinutes: {\n one: '1 minute',\n other: '{{count}} minutes'\n },\n aboutXHours: {\n one: 'about 1 hour',\n other: 'about {{count}} hours'\n },\n xHours: {\n one: '1 hour',\n other: '{{count}} hours'\n },\n xDays: {\n one: '1 day',\n other: '{{count}} days'\n },\n aboutXWeeks: {\n one: 'about 1 week',\n other: 'about {{count}} weeks'\n },\n xWeeks: {\n one: '1 week',\n other: '{{count}} weeks'\n },\n aboutXMonths: {\n one: 'about 1 month',\n other: 'about {{count}} months'\n },\n xMonths: {\n one: '1 month',\n other: '{{count}} months'\n },\n aboutXYears: {\n one: 'about 1 year',\n other: 'about {{count}} years'\n },\n xYears: {\n one: '1 year',\n other: '{{count}} years'\n },\n overXYears: {\n one: 'over 1 year',\n other: 'over {{count}} years'\n },\n almostXYears: {\n one: 'almost 1 year',\n other: 'almost {{count}} years'\n }\n};\n\nvar formatDistance = function (token, count, options) {\n var result;\n var tokenValue = formatDistanceLocale[token];\n\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 !== null && options !== void 0 && 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\nexport default formatDistance;","export default function buildFormatLongFn(args) {\n return function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // TODO: Remove String()\n var width = options.width ? String(options.width) : args.defaultWidth;\n var format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}","import buildFormatLongFn from \"../../../_lib/buildFormatLongFn/index.js\";\nvar dateFormats = {\n full: 'EEEE, MMMM do, y',\n long: 'MMMM do, y',\n medium: 'MMM d, y',\n short: 'MM/dd/yyyy'\n};\nvar 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};\nvar dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: '{{date}}, {{time}}',\n short: '{{date}}, {{time}}'\n};\nvar formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: 'full'\n }),\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: 'full'\n }),\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: 'full'\n })\n};\nexport default formatLong;","var 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\nvar formatRelative = function (token, _date, _baseDate, _options) {\n return formatRelativeLocale[token];\n};\n\nexport default formatRelative;","export default function buildLocalizeFn(args) {\n return function (dirtyIndex, dirtyOptions) {\n var options = dirtyOptions || {};\n var context = options.context ? String(options.context) : 'standalone';\n var valuesArray;\n\n if (context === 'formatting' && args.formattingValues) {\n var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n var width = options.width ? String(options.width) : defaultWidth;\n valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n var _defaultWidth = args.defaultWidth;\n\n var _width = options.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[_width] || args.values[_defaultWidth];\n }\n\n var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challange you to try to remove it!\n\n return valuesArray[index];\n };\n}","export default function buildMatchFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var width = options.width;\n var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n var matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n\n var matchedString = matchResult[0];\n var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n }) : findKey(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n });\n var value;\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}\n\nfunction findKey(object, predicate) {\n for (var key in object) {\n if (object.hasOwnProperty(key) && predicate(object[key])) {\n return key;\n }\n }\n\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (var key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n\n return undefined;\n}","import buildMatchFn from \"../../../_lib/buildMatchFn/index.js\";\nimport buildMatchPatternFn from \"../../../_lib/buildMatchPatternFn/index.js\";\nvar matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nvar parseOrdinalNumberPattern = /\\d+/i;\nvar 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};\nvar parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i]\n};\nvar matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i\n};\nvar parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i]\n};\nvar 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};\nvar parseMonthPatterns = {\n 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],\n 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]\n};\nvar 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};\nvar 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};\nvar 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};\nvar 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};\nvar match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: function (value) {\n return parseInt(value, 10);\n }\n }),\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseEraPatterns,\n defaultParseWidth: 'any'\n }),\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: 'any',\n valueCallback: function (index) {\n return index + 1;\n }\n }),\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: 'any'\n }),\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseDayPatterns,\n defaultParseWidth: 'any'\n }),\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: 'any',\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: 'any'\n })\n};\nexport default match;","export default function buildMatchPatternFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n var matchedString = matchResult[0];\n var parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}","import formatDistance from \"./_lib/formatDistance/index.js\";\nimport formatLong from \"./_lib/formatLong/index.js\";\nimport formatRelative from \"./_lib/formatRelative/index.js\";\nimport localize from \"./_lib/localize/index.js\";\nimport match from \"./_lib/match/index.js\";\n\n/**\n * @type {Locale}\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}\n * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}\n */\nvar locale = {\n code: 'en-US',\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0\n /* Sunday */\n ,\n firstWeekContainsDate: 1\n }\n};\nexport default locale;","import buildLocalizeFn from \"../../../_lib/buildLocalizeFn/index.js\";\nvar eraValues = {\n narrow: ['B', 'A'],\n abbreviated: ['BC', 'AD'],\n wide: ['Before Christ', 'Anno Domini']\n};\nvar quarterValues = {\n narrow: ['1', '2', '3', '4'],\n abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],\n wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']\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.\n\nvar monthValues = {\n narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\n abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n};\nvar 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: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n};\nvar 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};\nvar 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\nvar ordinalNumber = function (dirtyNumber, _options) {\n var number = Number(dirtyNumber); // 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 var rem100 = number % 100;\n\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + 'st';\n\n case 2:\n return number + 'nd';\n\n case 3:\n return number + 'rd';\n }\n }\n\n return number + 'th';\n};\n\nvar localize = {\n ordinalNumber: ordinalNumber,\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: 'wide'\n }),\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: 'wide',\n argumentCallback: function (quarter) {\n return quarter - 1;\n }\n }),\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: 'wide'\n }),\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: 'wide'\n }),\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: 'wide',\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: 'wide'\n })\n};\nexport default localize;","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subMilliseconds\n * @category Millisecond Helpers\n * @summary Subtract the specified number of milliseconds from the given date.\n *\n * @description\n * Subtract the specified number of milliseconds from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:\n * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:29.250\n */\n\nexport default function subMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, -amount);\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n\n while (output.length < targetLength) {\n output = '0' + output;\n }\n\n return sign + output;\n}","import addLeadingZeros from \"../../addLeadingZeros/index.js\";\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\nvar formatters = {\n // Year\n y: function (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 var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);\n },\n // Month\n M: function (date, token) {\n var month = date.getUTCMonth();\n return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n // Day of the month\n d: function (date, token) {\n return addLeadingZeros(date.getUTCDate(), token.length);\n },\n // AM or PM\n a: function (date, token) {\n var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return dayPeriodEnumValue.toUpperCase();\n\n case 'aaa':\n return dayPeriodEnumValue;\n\n case 'aaaaa':\n return dayPeriodEnumValue[0];\n\n case 'aaaa':\n default:\n return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';\n }\n },\n // Hour [1-12]\n h: function (date, token) {\n return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);\n },\n // Hour [0-23]\n H: function (date, token) {\n return addLeadingZeros(date.getUTCHours(), token.length);\n },\n // Minute\n m: function (date, token) {\n return addLeadingZeros(date.getUTCMinutes(), token.length);\n },\n // Second\n s: function (date, token) {\n return addLeadingZeros(date.getUTCSeconds(), token.length);\n },\n // Fraction of second\n S: function (date, token) {\n var numberOfDigits = token.length;\n var milliseconds = date.getUTCMilliseconds();\n var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));\n return addLeadingZeros(fractionalSeconds, token.length);\n }\n};\nexport default formatters;","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getUTCFullYear();\n var fourthOfJanuaryOfNextYear = new Date(0);\n fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);\n var fourthOfJanuaryOfThisYear = new Date(0);\n fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCISOWeek(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}","import getUTCISOWeekYear from \"../getUTCISOWeekYear/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var year = getUTCISOWeekYear(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setUTCFullYear(year, 0, 4);\n fourthOfJanuary.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCISOWeek(fourthOfJanuary);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport startOfUTCISOWeekYear from \"../startOfUTCISOWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // 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\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeek(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate, dirtyOptions);\n var year = date.getUTCFullYear();\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var firstWeekOfNextYear = new Date(0);\n firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);\n var firstWeekOfThisYear = new Date(0);\n firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);\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}","import toInteger from \"../toInteger/index.js\";\nimport getUTCWeekYear from \"../getUTCWeekYear/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\n var year = getUTCWeekYear(dirtyDate, dirtyOptions);\n var firstWeek = new Date(0);\n firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCWeek(firstWeek, dirtyOptions);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport startOfUTCWeekYear from \"../startOfUTCWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // 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\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import lightFormatters from \"../lightFormatters/index.js\";\nimport getUTCDayOfYear from \"../../../_lib/getUTCDayOfYear/index.js\";\nimport getUTCISOWeek from \"../../../_lib/getUTCISOWeek/index.js\";\nimport getUTCISOWeekYear from \"../../../_lib/getUTCISOWeekYear/index.js\";\nimport getUTCWeek from \"../../../_lib/getUTCWeek/index.js\";\nimport getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport addLeadingZeros from \"../../addLeadingZeros/index.js\";\nvar 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 * | | 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\nvar formatters = {\n // Era\n G: function (date, token, localize) {\n var era = date.getUTCFullYear() > 0 ? 1 : 0;\n\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return localize.era(era, {\n width: 'abbreviated'\n });\n // A, B\n\n case 'GGGGG':\n return localize.era(era, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return localize.era(era, {\n width: 'wide'\n });\n }\n },\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === 'yo') {\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, {\n unit: 'year'\n });\n }\n\n return lightFormatters.y(date, token);\n },\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year\n\n if (token === 'YY') {\n var twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n } // Ordinal number\n\n\n if (token === 'Yo') {\n return localize.ordinalNumber(weekYear, {\n unit: 'year'\n });\n } // Padding\n\n\n return addLeadingZeros(weekYear, token.length);\n },\n // ISO week-numbering year\n R: function (date, token) {\n var isoWeekYear = getUTCISOWeekYear(date); // Padding\n\n return addLeadingZeros(isoWeekYear, token.length);\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 var year = date.getUTCFullYear();\n return addLeadingZeros(year, token.length);\n },\n // Quarter\n Q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'QQ':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\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\n case 'QQQQQ':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone quarter\n q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'qq':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\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\n case 'qqqqq':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Month\n M: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n case 'M':\n case 'MM':\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return localize.month(month, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone month\n L: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return String(month + 1);\n // 01, 02, ..., 12\n\n case 'LL':\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return localize.month(month, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Local week of year\n w: function (date, token, localize, options) {\n var week = getUTCWeek(date, options);\n\n if (token === 'wo') {\n return localize.ordinalNumber(week, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(week, token.length);\n },\n // ISO week of year\n I: function (date, token, localize) {\n var isoWeek = getUTCISOWeek(date);\n\n if (token === 'Io') {\n return localize.ordinalNumber(isoWeek, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n // Day of the month\n d: function (date, token, localize) {\n if (token === 'do') {\n return localize.ordinalNumber(date.getUTCDate(), {\n unit: 'date'\n });\n }\n\n return lightFormatters.d(date, token);\n },\n // Day of year\n D: function (date, token, localize) {\n var dayOfYear = getUTCDayOfYear(date);\n\n if (token === 'Do') {\n return localize.ordinalNumber(dayOfYear, {\n unit: 'dayOfYear'\n });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n // Day of week\n E: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n\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\n case 'EEEEE':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Local day of week\n e: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\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\n case 'ee':\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n\n case 'eo':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'eee':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (same as in `e`)\n case 'c':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'cc':\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n\n case 'co':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'ccc':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // ISO day of week\n i: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n\n switch (token) {\n // 2\n case 'i':\n return String(isoDayOfWeek);\n // 02\n\n case 'ii':\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n\n case 'io':\n return localize.ordinalNumber(isoDayOfWeek, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'iiiii':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'iiiiii':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'iiii':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM or PM\n a: function (date, token, localize) {\n var hours = date.getUTCHours();\n var 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\n case 'aaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'aaaaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\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\n case 'bbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'bbbbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\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\n case 'BBBBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === 'ho') {\n var hours = date.getUTCHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return lightFormatters.h(date, token);\n },\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === 'Ho') {\n return localize.ordinalNumber(date.getUTCHours(), {\n unit: 'hour'\n });\n }\n\n return lightFormatters.H(date, token);\n },\n // Hour [0-11]\n K: function (date, token, localize) {\n var hours = date.getUTCHours() % 12;\n\n if (token === 'Ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Hour [1-24]\n k: function (date, token, localize) {\n var hours = date.getUTCHours();\n if (hours === 0) hours = 24;\n\n if (token === 'ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Minute\n m: function (date, token, localize) {\n if (token === 'mo') {\n return localize.ordinalNumber(date.getUTCMinutes(), {\n unit: 'minute'\n });\n }\n\n return lightFormatters.m(date, token);\n },\n // Second\n s: function (date, token, localize) {\n if (token === 'so') {\n return localize.ordinalNumber(date.getUTCSeconds(), {\n unit: 'second'\n });\n }\n\n return lightFormatters.s(date, token);\n },\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var 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 // 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\n case 'XXXX':\n case 'XX':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\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\n case 'XXXXX':\n case 'XXX': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case 'x':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\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\n case 'xxxx':\n case 'xx':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\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\n case 'xxxxx':\n case 'xxx': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var 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\n case 'OOOO':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var 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\n case 'zzzz':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n }\n};\n\nfunction formatTimezoneShort(offset, dirtyDelimiter) {\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = Math.floor(absOffset / 60);\n var minutes = absOffset % 60;\n\n if (minutes === 0) {\n return sign + String(hours);\n }\n\n var delimiter = dirtyDelimiter || '';\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {\n if (offset % 60 === 0) {\n var sign = offset > 0 ? '-' : '+';\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n\n return formatTimezone(offset, dirtyDelimiter);\n}\n\nfunction formatTimezone(offset, dirtyDelimiter) {\n var delimiter = dirtyDelimiter || '';\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n var minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n\nexport default formatters;","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCDayOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var timestamp = date.getTime();\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n var startOfYearTimestamp = date.getTime();\n var difference = timestamp - startOfYearTimestamp;\n return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;\n}","function dateLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'P':\n return formatLong.date({\n width: 'short'\n });\n\n case 'PP':\n return formatLong.date({\n width: 'medium'\n });\n\n case 'PPP':\n return formatLong.date({\n width: 'long'\n });\n\n case 'PPPP':\n default:\n return formatLong.date({\n width: 'full'\n });\n }\n}\n\nfunction timeLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'p':\n return formatLong.time({\n width: 'short'\n });\n\n case 'pp':\n return formatLong.time({\n width: 'medium'\n });\n\n case 'ppp':\n return formatLong.time({\n width: 'long'\n });\n\n case 'pppp':\n default:\n return formatLong.time({\n width: 'full'\n });\n }\n}\n\nfunction dateTimeLongFormatter(pattern, formatLong) {\n var matchResult = pattern.match(/(P+)(p+)?/);\n var datePattern = matchResult[1];\n var timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n var dateTimeFormat;\n\n switch (datePattern) {\n case 'P':\n dateTimeFormat = formatLong.dateTime({\n width: 'short'\n });\n break;\n\n case 'PP':\n dateTimeFormat = formatLong.dateTime({\n width: 'medium'\n });\n break;\n\n case 'PPP':\n dateTimeFormat = formatLong.dateTime({\n width: 'long'\n });\n break;\n\n case 'PPPP':\n default:\n dateTimeFormat = formatLong.dateTime({\n width: 'full'\n });\n break;\n }\n\n return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));\n}\n\nvar longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter\n};\nexport default longFormatters;","var protectedDayOfYearTokens = ['D', 'DD'];\nvar protectedWeekYearTokens = ['YY', 'YYYY'];\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\nexport function throwProtectedError(token, format, input) {\n if (token === 'YYYY') {\n throw new RangeError(\"Use `yyyy` instead of `YYYY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'YY') {\n throw new RangeError(\"Use `yy` instead of `YY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'D') {\n throw new RangeError(\"Use `d` instead of `D` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'DD') {\n throw new RangeError(\"Use `dd` instead of `DD` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n }\n}","import isValid from \"../isValid/index.js\";\nimport defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport formatters from \"../_lib/format/formatters/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\"; // 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\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\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://git.io/fxCyr\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, Su, Sa | |\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, Su, Sa | 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, Su, Sa | |\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, Su, Sa | |\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]{@link https://date-fns.org/docs/getISOWeekYear}\n * and [getWeekYear]{@link 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://git.io/fxCyr\n *\n * 9. `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://git.io/fxCyr\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The second argument is now required for the sake of explicitness.\n *\n * ```javascript\n * // Before v2.0.0\n * format(new Date(2016, 0, 1))\n *\n * // v2.0.0 onward\n * format(new Date(2016, 0, 1), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n * ```\n *\n * - New format string API for `format` function\n * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).\n * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.\n *\n * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.\n *\n * @param {Date|Number} date - the original date\n * @param {String} format - the string of tokens\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {String} the formatted date string\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * var 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 * var 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 * var result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\n\nexport default function format(dirtyDate, dirtyFormatStr, dirtyOptions) {\n requiredArgs(2, arguments);\n var formatStr = String(dirtyFormatStr);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (!locale.localize) {\n throw new RangeError('locale must contain localize property');\n }\n\n if (!locale.formatLong) {\n throw new RangeError('locale must contain formatLong property');\n }\n\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\n\n\n var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);\n var utcDate = subMilliseconds(originalDate, timezoneOffset);\n var formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate\n };\n var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, formatterOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp).map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n var firstCharacter = substring[0];\n\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n var formatter = formatters[firstCharacter];\n\n if (formatter) {\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n return formatter(utcDate, substring, locale.localize, formatterOptions);\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n }\n\n return substring;\n }).join('');\n return result;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","export default function assign(target, dirtyObject) {\n if (target == null) {\n throw new TypeError('assign requires that input parameter not be null or undefined');\n }\n\n dirtyObject = dirtyObject || {};\n\n for (var property in dirtyObject) {\n if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) {\n target[property] = dirtyObject[property];\n }\n }\n\n return target;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {\n requiredArgs(2, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = toInteger(dirtyDay);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport setUTCDay from \"../../../_lib/setUTCDay/index.js\";\nimport setUTCISODay from \"../../../_lib/setUTCISODay/index.js\";\nimport setUTCISOWeek from \"../../../_lib/setUTCISOWeek/index.js\";\nimport setUTCWeek from \"../../../_lib/setUTCWeek/index.js\";\nimport startOfUTCISOWeek from \"../../../_lib/startOfUTCISOWeek/index.js\";\nimport startOfUTCWeek from \"../../../_lib/startOfUTCWeek/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\nvar MILLISECONDS_IN_MINUTE = 60000;\nvar MILLISECONDS_IN_SECOND = 1000;\nvar numericPatterns = {\n month: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/,\n // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/,\n // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/,\n // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/,\n // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/,\n // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/,\n // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n minute: /^[0-5]?\\d/,\n // 0 to 59\n second: /^[0-5]?\\d/,\n // 0 to 59\n singleDigit: /^\\d/,\n // 0 to 9\n twoDigits: /^\\d{1,2}/,\n // 0 to 99\n threeDigits: /^\\d{1,3}/,\n // 0 to 999\n fourDigits: /^\\d{1,4}/,\n // 0 to 9999\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/,\n // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/,\n // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/,\n // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/ // 0 to 9999, -0 to -9999\n\n};\nvar 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\nfunction parseNumericPattern(pattern, string, valueCallback) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n var value = parseInt(matchResult[0], 10);\n return {\n value: valueCallback ? valueCallback(value) : value,\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseTimezonePattern(pattern, string) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n } // Input is 'Z'\n\n\n if (matchResult[0] === 'Z') {\n return {\n value: 0,\n rest: string.slice(1)\n };\n }\n\n var sign = matchResult[1] === '+' ? 1 : -1;\n var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n return {\n value: sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * MILLISECONDS_IN_SECOND),\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseAnyDigitsSigned(string, valueCallback) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback);\n}\n\nfunction parseNDigits(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction parseNDigitsSigned(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^-?\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction dayPeriodEnumToHours(enumValue) {\n switch (enumValue) {\n case 'morning':\n return 4;\n\n case 'evening':\n return 17;\n\n case 'pm':\n case 'noon':\n case 'afternoon':\n return 12;\n\n case 'am':\n case 'midnight':\n case 'night':\n default:\n return 0;\n }\n}\n\nfunction normalizeTwoDigitYear(twoDigitYear, currentYear) {\n var isCommonEra = currentYear > 0; // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n\n var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n var result;\n\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n var rangeEnd = absCurrentYear + 50;\n var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n var isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nvar DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nvar DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // User for validation\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\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\n\nvar parsers = {\n // Era\n G: {\n priority: 140,\n parse: function (string, token, match, _options) {\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n // A, B\n\n case 'GGGGG':\n return match.era(string, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return match.era(string, {\n width: 'wide'\n }) || match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n }\n },\n set: function (date, flags, value, _options) {\n flags.era = value;\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['R', 'u', 't', 'T']\n },\n // Year\n y: {\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 |\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'yy'\n };\n };\n\n switch (token) {\n case 'y':\n return parseNDigits(4, string, valueCallback);\n\n case 'yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, _options) {\n var currentYear = date.getUTCFullYear();\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Local week-numbering year\n Y: {\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'YY'\n };\n };\n\n switch (token) {\n case 'Y':\n return parseNDigits(4, string, valueCallback);\n\n case 'Yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, options) {\n var currentYear = getUTCWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week-numbering year\n R: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'R') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (_date, _flags, value, _options) {\n var firstWeekOfYear = new Date(0);\n firstWeekOfYear.setUTCFullYear(value, 0, 4);\n firstWeekOfYear.setUTCHours(0, 0, 0, 0);\n return startOfUTCISOWeek(firstWeekOfYear);\n },\n incompatibleTokens: ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Extended year\n u: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'u') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Quarter\n Q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n case 'QQ':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone quarter\n q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n case 'qq':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Month\n M: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'M':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'MM':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone month\n L: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'LL':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Local week of year\n w: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'w':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'wo':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCWeek(setUTCWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week of year\n I: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'I':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'Io':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCISOWeek(setUTCISOWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Day of the month\n d: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'd':\n return parseNumericPattern(numericPatterns.date, string);\n\n case 'do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n var month = date.getUTCMonth();\n\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 set: function (date, _flags, value, _options) {\n date.setUTCDate(value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Day of year\n D: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'D':\n case 'DD':\n return parseNumericPattern(numericPatterns.dayOfYear, string);\n\n case 'Do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(0, value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']\n },\n // Day of week\n E: {\n priority: 90,\n parse: function (string, token, match, _options) {\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T']\n },\n // Local day of week\n e: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var 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':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'eo':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'eee':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']\n },\n // Stand-alone local day of week\n c: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var 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':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'co':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'ccc':\n return match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']\n },\n // ISO day of week\n i: {\n priority: 90,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n if (value === 0) {\n return 7;\n }\n\n return value;\n };\n\n switch (token) {\n // 2\n case 'i':\n case 'ii':\n // 02\n return parseNDigits(token.length, string);\n // 2nd\n\n case 'io':\n return match.ordinalNumber(string, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // T\n\n case 'iiiii':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tu\n\n case 'iiiiii':\n return match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tuesday\n\n case 'iiii':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 7;\n },\n set: function (date, _flags, value, options) {\n date = setUTCISODay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']\n },\n // AM or PM\n a: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'a':\n case 'aa':\n case 'aaa':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaaa':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // AM, PM, midnight\n b: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'b':\n case 'bb':\n case 'bbb':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbbb':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // in the morning, in the afternoon, in the evening, at night\n B: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 't', 'T']\n },\n // Hour [1-12]\n h: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'h':\n return parseNumericPattern(numericPatterns.hour12h, string);\n\n case 'ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 12;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setUTCHours(0, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['H', 'K', 'k', 't', 'T']\n },\n // Hour [0-23]\n H: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'H':\n return parseNumericPattern(numericPatterns.hour23h, string);\n\n case 'Ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 23;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(value, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T']\n },\n // Hour [0-11]\n K: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'K':\n return parseNumericPattern(numericPatterns.hour11h, string);\n\n case 'Ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T']\n },\n // Hour [1-24]\n k: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'k':\n return parseNumericPattern(numericPatterns.hour24h, string);\n\n case 'ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 24;\n },\n set: function (date, _flags, value, _options) {\n var hours = value <= 24 ? value % 24 : value;\n date.setUTCHours(hours, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T']\n },\n // Minute\n m: {\n priority: 60,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'm':\n return parseNumericPattern(numericPatterns.minute, string);\n\n case 'mo':\n return match.ordinalNumber(string, {\n unit: 'minute'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMinutes(value, 0, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Second\n s: {\n priority: 50,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 's':\n return parseNumericPattern(numericPatterns.second, string);\n\n case 'so':\n return match.ordinalNumber(string, {\n unit: 'second'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCSeconds(value, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Fraction of second\n S: {\n priority: 30,\n parse: function (string, token, _match, _options) {\n var valueCallback = function (value) {\n return Math.floor(value * Math.pow(10, -token.length + 3));\n };\n\n return parseNDigits(token.length, string, valueCallback);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMilliseconds(value);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Timezone (ISO-8601. +00:00 is `'Z'`)\n X: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'X':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'XX':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'XXXX':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'XXXXX':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'XXX':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'x']\n },\n // Timezone (ISO-8601)\n x: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'x':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'xx':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'xxxx':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'xxxxx':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'xxx':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'X']\n },\n // Seconds timestamp\n t: {\n priority: 40,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value * 1000), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n },\n // Milliseconds timestamp\n T: {\n priority: 20,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n }\n};\nexport default parsers;","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCWeek from \"../getUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCWeek(dirtyDate, dirtyWeek, options) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var week = toInteger(dirtyWeek);\n var diff = getUTCWeek(date, options) - week;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCISOWeek from \"../getUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISOWeek(dirtyDate, dirtyISOWeek) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var isoWeek = toInteger(dirtyISOWeek);\n var diff = getUTCISOWeek(date) - isoWeek;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISODay(dirtyDate, dirtyDay) {\n requiredArgs(2, arguments);\n var day = toInteger(dirtyDay);\n\n if (day % 7 === 0) {\n day = day - 7;\n }\n\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport assign from \"../_lib/assign/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport parsers from \"./_lib/parsers/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar TIMEZONE_UNIT_PRIORITY = 10; // 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\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar notWhitespaceRegExp = /\\S/;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\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://git.io/fxCyr\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, Su, Sa | |\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, Su, Sa | 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, Su, Sa | |\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, Su, Sa | |\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, 0001, ..., 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]{@link https://date-fns.org/docs/setISOWeekYear}\n * and [setWeekYear]{@link 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://git.io/fxCyr\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://git.io/fxCyr\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 * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Old `parse` was renamed to `toDate`.\n * Now `parse` is a new function which parses a string using a provided format.\n *\n * ```javascript\n * // Before v2.0.0\n * parse('2016-01-01')\n *\n * // v2.0.0 onward (toDate no longer accepts a string)\n * toDate(1392098430000) // Unix to timestamp\n * toDate(new Date(2014, 1, 11, 11, 30, 30)) // Cloning the date\n * parse('2016-01-01', 'yyyy-MM-dd', new Date())\n * ```\n *\n * @param {String} dateString - the string to parse\n * @param {String} formatString - the string of tokens\n * @param {Date|Number} referenceDate - defines values missing from the parsed dateString\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {Date} the parsed date\n * @throws {TypeError} 3 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} `options.locale` must contain `match` property\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} 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 */\n\nexport default function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, dirtyOptions) {\n requiredArgs(3, arguments);\n var dateString = String(dirtyDateString);\n var formatString = String(dirtyFormatString);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n\n if (!locale.match) {\n throw new RangeError('locale must contain match property');\n }\n\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (formatString === '') {\n if (dateString === '') {\n return toDate(dirtyReferenceDate);\n } else {\n return new Date(NaN);\n }\n }\n\n var subFnOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale\n }; // If timezone isn't specified, it will be set to the system timezone\n\n var setters = [{\n priority: TIMEZONE_UNIT_PRIORITY,\n subPriority: -1,\n set: dateToSystemTimezone,\n index: 0\n }];\n var i;\n var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, subFnOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp);\n var usedTokens = [];\n\n for (i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n var firstCharacter = token[0];\n var parser = parsers[firstCharacter];\n\n if (parser) {\n var incompatibleTokens = parser.incompatibleTokens;\n\n if (Array.isArray(incompatibleTokens)) {\n var incompatibleToken = void 0;\n\n for (var _i = 0; _i < usedTokens.length; _i++) {\n var usedToken = usedTokens[_i].token;\n\n if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {\n incompatibleToken = usedTokens[_i];\n break;\n }\n }\n\n if (incompatibleToken) {\n throw new RangeError(\"The format string mustn't contain `\".concat(incompatibleToken.fullToken, \"` and `\").concat(token, \"` at the same time\"));\n }\n } else if (parser.incompatibleTokens === '*' && usedTokens.length) {\n throw new RangeError(\"The format string mustn't contain `\".concat(token, \"` and any other token at the same time\"));\n }\n\n usedTokens.push({\n token: firstCharacter,\n fullToken: token\n });\n var parseResult = parser.parse(dateString, token, locale.match, subFnOptions);\n\n if (!parseResult) {\n return new Date(NaN);\n }\n\n setters.push({\n priority: parser.priority,\n subPriority: parser.subPriority || 0,\n set: parser.set,\n validate: parser.validate,\n value: parseResult.value,\n index: setters.length\n });\n dateString = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n } // Replace two single quote characters with one single quote character\n\n\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n } // Cut token from string, or, if string doesn't match the token, return Invalid Date\n\n\n if (dateString.indexOf(token) === 0) {\n dateString = dateString.slice(token.length);\n } else {\n return new Date(NaN);\n }\n }\n } // Check if the remaining input contains something other than whitespace\n\n\n if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {\n return new Date(NaN);\n }\n\n var uniquePrioritySetters = setters.map(function (setter) {\n return setter.priority;\n }).sort(function (a, b) {\n return b - a;\n }).filter(function (priority, index, array) {\n return array.indexOf(priority) === index;\n }).map(function (priority) {\n return setters.filter(function (setter) {\n return setter.priority === priority;\n }).sort(function (a, b) {\n return b.subPriority - a.subPriority;\n });\n }).map(function (setterArray) {\n return setterArray[0];\n });\n var date = toDate(dirtyReferenceDate);\n\n if (isNaN(date)) {\n return new Date(NaN);\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37\n\n\n var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));\n var flags = {};\n\n for (i = 0; i < uniquePrioritySetters.length; i++) {\n var setter = uniquePrioritySetters[i];\n\n if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {\n return new Date(NaN);\n }\n\n var result = setter.set(utcDate, flags, setter.value, subFnOptions); // Result is tuple (date, flags)\n\n if (result[0]) {\n utcDate = result[0];\n assign(flags, result[1]); // Result is date\n } else {\n utcDate = result;\n }\n }\n\n return utcDate;\n}\n\nfunction dateToSystemTimezone(date, flags) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n var convertedDate = new Date(0);\n convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());\n return convertedDate;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\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\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}","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}","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 Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Store from './store';\nimport { Collection, Place } from '@fleetbase/sdk';\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 getStores(params = {}) {\n return this.adapter.get('stores', params).then((stores) => {\n return new Collection(stores.map(attributes => {\n return new Store(attributes, this.adapter);\n }));\n });\n }\n\n getStoreLocations(params = {}) {\n return this.adapter.get('store-locations', params).then((locations) => {\n return new Collection(locations.map(attributes => {\n return new StoreLocation(attributes, this.adapter);\n }));\n });\n }\n \n getPaymentGateways() {\n return this.adapter.get('gateways').then((gateways) => {\n return new Collection(gateways.map(attributes => {\n return new PaymentGateway(attributes, this.adapter);\n }));\n });\n }\n}","import StorefrontStore from '../store';\nimport Cart from './cart';\nimport StoreLocation from './store-location';\nimport { ServiceQuote, ServiceRate, Place, Collection, Adapter } from '@fleetbase/sdk';\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 static getFromCart(adapter, ...params) {\n const quote = new DeliveryServiceQuote(adapter);\n\n return quote.fromCart(...params);\n }\n\n fromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n\n if (destination?.id) {\n destination = destination.id;\n }\n\n if (cart?.id) {\n cart = cart.id;\n }\n\n return this.adapter.get('service-quotes/from-cart', { origin, destination, cart, config, all }).then(serviceQuotes => {\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 });\n }\n}","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions, isResource, Order } from '@fleetbase/sdk';\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, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, 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 {\n Resolver,\n lookup\n};\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}","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\t * Builds an instance of the Fleetbase Storefront SDK\n\t *\n\t * @param {String} storeKey The access key for the storefront store\n\t * @param {Object} config The config object\n\t * @param {Boolean} debug Enable debug mode\n\t * @return {Storefront} Instance\n\t */\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"],"names":["isArray","Array","StorefrontResource","Resource","adapter","store","StorefrontStore","this","resource","onAfterFetch","syncAttributes","bind","actions","options","_this$options","reviewActions","StoreActions","count","storeId","params","get","namespace","Review","attributes","detectAdapter","isNodeEnvironment","lookup","isPhone","phone","test","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isKeyValid","key","length","startsWith","isEmpty","obj","none","size","objectType","Product","getAttribute","getAttributes","price","sale_price","isOnSale","id","then","reviews","Collection","map","_this","Category","category","products","customerActions","login","identity","password","post","Error","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","token","setHeaders","places","Place","_this2","orders","Order","_this3","cartActions","undefined","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","toInteger","dirtyNumber","NaN","number","Number","isNaN","Math","ceil","floor","requiredArgs","required","args","TypeError","toDate","argument","arguments","argStr","Object","prototype","toString","call","Date","getTime","console","warn","stack","addMilliseconds","dirtyDate","dirtyAmount","timestamp","getTimezoneOffsetInMilliseconds","date","utcDate","UTC","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isDate","value","isValid","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","result","tokenValue","replace","addSuffix","comparison","buildFormatLongFn","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","dirtyIndex","dirtyOptions","valuesArray","context","formattingValues","defaultFormattingWidth","_defaultWidth","_width","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","pattern","findKey","valueCallback","rest","slice","object","predicate","hasOwnProperty","array","formatDistance","formatRelative","_date","_baseDate","_options","localize","ordinalNumber","rem100","era","narrow","abbreviated","wide","quarter","month","day","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","weekStartsOn","firstWeekContainsDate","subMilliseconds","addLeadingZeros","targetLength","sign","output","abs","y","signedYear","getUTCFullYear","year","M","getUTCMonth","d","getUTCDate","a","dayPeriodEnumValue","getUTCHours","toUpperCase","h","H","m","getUTCMinutes","s","getUTCSeconds","S","numberOfDigits","milliseconds","getUTCMilliseconds","pow","startOfUTCISOWeek","getUTCDay","diff","setUTCDate","setUTCHours","getUTCISOWeekYear","fourthOfJanuaryOfNextYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","startOfUTCISOWeekYear","fourthOfJanuary","getUTCISOWeek","round","startOfUTCWeek","locale","localeWeekStartsOn","defaultWeekStartsOn","RangeError","getUTCWeekYear","localeFirstWeekContainsDate","defaultFirstWeekContainsDate","firstWeekOfNextYear","firstWeekOfThisYear","startOfUTCWeekYear","firstWeek","getUTCWeek","dayPeriodEnum","formatters","G","unit","lightFormatters","Y","signedWeekYear","weekYear","R","u","Q","q","L","w","week","I","isoWeek","D","dayOfYear","setUTCMonth","startOfYearTimestamp","difference","getUTCDayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","toLowerCase","b","hours","B","K","k","X","_localize","timezoneOffset","_originalDate","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","originalDate","T","offset","dirtyDelimiter","absOffset","minutes","delimiter","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeFormat","datePattern","timePattern","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","indexOf","isProtectedWeekYearToken","throwProtectedError","input","concat","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","dirtyFormatStr","formatStr","defaultLocale","formatterOptions","substring","firstCharacter","longFormatter","join","cleanEscapedString","formatter","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","assign","target","dirtyObject","property","setUTCDay","dirtyDay","currentDay","remainder","dayIndex","numericPatterns","timezonePatterns","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","enumValue","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","isLeapYearIndex","parsers","priority","parse","set","flags","incompatibleTokens","isTwoDigitYear","validate","normalizedTwoDigitYear","_match","_flags","firstWeekOfYear","dirtyWeek","setUTCWeek","dirtyISOWeek","setUTCISOWeek","subPriority","isLeapYear","wholeWeekDays","setUTCISODay","isPM","setUTCMinutes","setUTCSeconds","setUTCMilliseconds","timestampIsSet","_token","notWhitespaceRegExp","dirtyDateString","dirtyFormatString","dirtyReferenceDate","dateString","formatString","subFnOptions","setters","dateToSystemTimezone","tokens","usedTokens","parser","incompatibleToken","_i","usedToken","fullToken","push","uniquePrioritySetters","setter","sort","filter","setterArray","convertedDate","setFullYear","setHours","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","PaymentGateway","type","Store","storeLocations","place","gateways","_this4","_this5","Network","stores","locations","DeliveryServiceQuote","ServiceQuote","Adapter","origin","destination","cart","config","all","_origin","_destination","_cart","serviceQuotes","serviceQuote","quote","fromCart","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","resources","adapters","BrowserAdapter","NodeAdapter","Resolver","className","pluralize","singularize","extendStoreActions","json","classify","Storefront","storeKey","debug","version","host","publicKey","categories","extendActions","customers","checkout","product"],"mappings":"2+PAAA,IAAQA,EAAYC,MAAZD,QAAAA,E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AAcvhB,SACpEwhB,UAAY,IAAIjiB,GAAgB,WAAYC,KAAKH,SAASkiB,cAAcxe,SACxEkc,KAAO,IAAI1f,GAAgB,OAAQC,KAAKH,SAASkiB,cAAcjd,SAC/Dmd,SAAW,IAAIliB,GAAgB,WAAYC,KAAKH,SAASkiB,cAAc5B,mCAIhF,kBACWngB,KAAKH,QAAQgB,IAAI,+BAI5B,SAAOoE,OAAO3E,yDAAU,UACbN,KAAKH,QAAQgB,IAAI,YAAYoE,MAAAA,GAAU3E,IAAWyC,MAAK,SAAAO,UACnD,IAAIL,EAAWK,EAASJ,KAAI,SAAAgf,UAAW,IAAI1f,GAAQ0f,oCAQlE,SAAWriB,QACFA,QAAUA,4BAGnB,kBACWG,KAAKH,qCAThB,oBACe2hB,6BAAcra"} \ 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/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","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 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 getSavedPlaces() {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/places')\n .then((places) => {\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n });\n }\n\n getOrderHistory(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/orders', params)\n .then((orders) => {\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\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 getStores(params = {}) {\n return this.adapter.get('stores', params).then((stores) => {\n return new Collection(\n stores.map((attributes) => {\n return new Store(attributes, this.adapter);\n })\n );\n });\n }\n\n getStoreLocations(params = {}) {\n return this.adapter.get('store-locations', params).then((locations) => {\n return new Collection(\n locations.map((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateways() {\n return this.adapter.get('gateways').then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\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 static getFromCart(adapter, ...params) {\n const quote = new DeliveryServiceQuote(adapter);\n\n return quote.fromCart(...params);\n }\n\n fromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n\n if (destination?.id) {\n destination = destination.id;\n }\n\n if (cart?.id) {\n cart = cart.id;\n }\n\n return this.adapter\n .get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n })\n .then((serviceQuotes) => {\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 });\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","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","isEmpty","_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","token","setHeaders","_this2","places","Place","_this3","orders","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","toLowerCase","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","stores","locations","DeliveryServiceQuote","_ServiceQuote","ServiceQuote","Adapter","_possibleConstructorReturn","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","quote","_len","_key","fromCart","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","_this$store","_this$store2","resources","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":"woHACsC,IAEjBA,WAAkBC,GAAAC,EAAAF,EAASG,YAAT,IAAAC,EAAAC,EAAAL,GAAA,SAAAA,IAAA,OAAAM,OAAAN,GAAAI,EAAAG,MAAAC,KAAAC,UAAA,CAelC,OAfkCC,EAAAV,EAAA,CAAA,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,SACvDL,KAAK+C,QAAU,IAAIvC,GAAgB,SAAUR,KAAKK,SAAS8hB,cAAcphB,GACzEf,KAAKoiB,UAAY,IAAI5hB,GAAgB,WAAYR,KAAKK,SAAS8hB,cAAc9e,GAC7ErD,KAAKkf,KAAO,IAAI1e,GAAgB,OAAQR,KAAKK,SAAS8hB,cAAcjd,GACpElF,KAAKqiB,SAAW,IAAI7hB,GAAgB,WAAYR,KAAKK,SAAS8hB,cAAcrC,GAChF,CAgBC,OAdD5f,EAAAuhB,EAAA,CAAA,CAAAthB,IAAA,QAAAC,MACA,WACI,OAAOJ,KAAKK,QAAQiB,IAAI,QAC5B,GAEA,CAAAnB,IAAA,SAAAC,MACA,SAAOgF,GAAqB,IAAdtE,EAAOb,UAAAkB,OAAA,QAAAC,IAAAnB,UAAA,GAAAA,UAAA,GAAG,CAAA,EACpB,OAAOD,KAAKK,QAAQiB,IAAI,SAAQwC,EAAA,CAAIsB,MAAAA,GAAUtE,IAAWgC,MAAK,SAACM,GAC3D,OAAO,IAAIJ,EAAAA,WAAWI,EAASH,KAAI,SAACqf,GAAO,OAAK,IAAIlgB,EAAQkgB,EAAQ,IACxE,GACJ,GAAC,CAAAniB,IAAA,aAAAC,MAMD,SAAWC,GACPL,KAAKK,QAAUA,CACnB,GAAC,CAAAF,IAAA,aAAAC,MAED,WACI,OAAOJ,KAAKK,OAChB,IAAC,CAAA,CAAAF,IAAA,cAAAC,MAVD,WACI,OAAA+gB,EAAWM,EAAUxc,MAAA4B,UAAA4G,MAAA9L,KAAI1B,WAC7B,KAACwhB,CAAA,CA/C0B","x_google_ignoreList":[10,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]} \ No newline at end of file diff --git a/dist/esm/storefront.js b/dist/esm/storefront.js index 5510ba5..49d4316 100644 --- a/dist/esm/storefront.js +++ b/dist/esm/storefront.js @@ -1,6924 +1,2 @@ -import t from "axios"; -function e(t, e) { - var n = Object.keys(t); - if (Object.getOwnPropertySymbols) { - var r = Object.getOwnPropertySymbols(t); - e && - (r = r.filter(function (e) { - return Object.getOwnPropertyDescriptor(t, e).enumerable; - })), - n.push.apply(n, r); - } - return n; -} -function n(t) { - for (var n = 1; n < arguments.length; n++) { - var r = null != arguments[n] ? arguments[n] : {}; - n % 2 - ? e(Object(r), !0).forEach(function (e) { - u(t, e, r[e]); - }) - : Object.getOwnPropertyDescriptors - ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) - : e(Object(r)).forEach(function (e) { - Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e)); - }); - } - return t; -} -function r(t) { - return ( - (r = - "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; - }), - r(t) - ); -} -function i(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); -} -function a(t, e) { - for (var n = 0; n < e.length; n++) { - var r = e[n]; - (r.enumerable = r.enumerable || !1), - (r.configurable = !0), - "value" in r && (r.writable = !0), - Object.defineProperty(t, r.key, r); - } -} -function o(t, e, n) { - return e && a(t.prototype, e), n && a(t, n), t; -} -function u(t, e, n) { - return ( - e in t - ? Object.defineProperty(t, e, { - value: n, - enumerable: !0, - configurable: !0, - writable: !0, - }) - : (t[e] = n), - t - ); -} -function s(t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError("Super expression must either be null or a function"); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && h(t, e); -} -function c(t) { - return ( - (c = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - }), - c(t) - ); -} -function h(t, e) { - return ( - (h = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - }), - h(t, e) - ); -} -function l() { - if ("undefined" == typeof Reflect || !Reflect.construct) return !1; - if (Reflect.construct.sham) return !1; - if ("function" == typeof Proxy) return !0; - try { - return ( - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}), - ), - !0 - ); - } catch (t) { - return !1; - } -} -function d(t, e, n) { - return ( - (d = l() - ? Reflect.construct - : function (t, e, n) { - var r = [null]; - r.push.apply(r, e); - var i = new (Function.bind.apply(t, r))(); - return n && h(i, n.prototype), i; - }), - d.apply(null, arguments) - ); -} -function f(t, e) { - if (e && ("object" == typeof e || "function" == typeof e)) return e; - if (void 0 !== e) - throw new TypeError( - "Derived constructors may only return object or undefined", - ); - return (function (t) { - if (void 0 === t) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - return t; - })(t); -} -function v(t) { - var e = l(); - return function () { - var n, - r = c(t); - if (e) { - var i = c(this).constructor; - n = Reflect.construct(r, arguments, i); - } else n = r.apply(this, arguments); - return f(this, n); - }; -} -function g(t) { - return ( - (function (t) { - if (Array.isArray(t)) return p(t); - })(t) || - (function (t) { - if ( - ("undefined" != typeof Symbol && null != t[Symbol.iterator]) || - null != t["@@iterator"] - ) - return Array.from(t); - })(t) || - (function (t, e) { - if (!t) return; - if ("string" == typeof t) return p(t, e); - var n = Object.prototype.toString.call(t).slice(8, -1); - "Object" === n && t.constructor && (n = t.constructor.name); - if ("Map" === n || "Set" === n) return Array.from(t); - if ( - "Arguments" === n || - /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) - ) - return p(t, e); - })(t) || - (function () { - throw new TypeError( - "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.", - ); - })() - ); -} -function p(t, e) { - (null == e || e > t.length) && (e = t.length); - for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; - return r; -} -function y(t, e) { - var n = Object.keys(t); - if (Object.getOwnPropertySymbols) { - var r = Object.getOwnPropertySymbols(t); - e && - (r = r.filter(function (e) { - return Object.getOwnPropertyDescriptor(t, e).enumerable; - })), - n.push.apply(n, r); - } - return n; -} -function m(t) { - for (var e = 1; e < arguments.length; e++) { - var n = null != arguments[e] ? arguments[e] : {}; - e % 2 - ? y(Object(n), !0).forEach(function (e) { - A(t, e, n[e]); - }) - : Object.getOwnPropertyDescriptors - ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) - : y(Object(n)).forEach(function (e) { - Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e)); - }); - } - return t; -} -function w(t) { - return (w = - "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; - })(t); -} -function b(t, e, n, r, i, a, o) { - try { - var u = t[a](o), - s = u.value; - } catch (t) { - return void n(t); - } - u.done ? e(s) : Promise.resolve(s).then(r, i); -} -function k(t) { - return function () { - var e = this, - n = arguments; - return new Promise(function (r, i) { - var a = t.apply(e, n); - function o(t) { - b(a, r, i, o, u, "next", t); - } - function u(t) { - b(a, r, i, o, u, "throw", t); - } - o(void 0); - }); - }; -} -function T(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); -} -function x(t, e) { - for (var n = 0; n < e.length; n++) { - var r = e[n]; - (r.enumerable = r.enumerable || !1), - (r.configurable = !0), - "value" in r && (r.writable = !0), - Object.defineProperty(t, r.key, r); - } -} -function C(t, e, n) { - return e && x(t.prototype, e), n && x(t, n), t; -} -function A(t, e, n) { - return ( - e in t - ? Object.defineProperty(t, e, { - value: n, - enumerable: !0, - configurable: !0, - writable: !0, - }) - : (t[e] = n), - t - ); -} -function E(t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError("Super expression must either be null or a function"); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && O(t, e); -} -function D(t) { - return (D = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - })(t); -} -function O(t, e) { - return (O = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - })(t, e); -} -function S() { - if ("undefined" == typeof Reflect || !Reflect.construct) return !1; - if (Reflect.construct.sham) return !1; - if ("function" == typeof Proxy) return !0; - try { - return ( - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}), - ), - !0 - ); - } catch (t) { - return !1; - } -} -function P(t, e, n) { - return (P = S() - ? Reflect.construct - : function (t, e, n) { - var r = [null]; - r.push.apply(r, e); - var i = new (Function.bind.apply(t, r))(); - return n && O(i, n.prototype), i; - }).apply(null, arguments); -} -function R(t) { - var e = "function" == typeof Map ? new Map() : void 0; - return (R = function (t) { - if ( - null === t || - ((n = t), -1 === Function.toString.call(n).indexOf("[native code]")) - ) - return t; - var n; - if ("function" != typeof t) - throw new TypeError("Super expression must either be null or a function"); - if (void 0 !== e) { - if (e.has(t)) return e.get(t); - e.set(t, r); - } - function r() { - return P(t, arguments, D(this).constructor); - } - return ( - (r.prototype = Object.create(t.prototype, { - constructor: { - value: r, - enumerable: !1, - writable: !0, - configurable: !0, - }, - })), - O(r, t) - ); - })(t); -} -function U(t, e) { - return !e || ("object" != typeof e && "function" != typeof e) - ? (function (t) { - if (void 0 === t) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - return t; - })(t) - : e; -} -function M(t) { - var e = S(); - return function () { - var n, - r = D(t); - if (e) { - var i = D(this).constructor; - n = Reflect.construct(r, arguments, i); - } else n = r.apply(this, arguments); - return U(this, n); - }; -} -function j(t, e) { - return ( - (function (t) { - if (Array.isArray(t)) return t; - })(t) || - (function (t, e) { - var n = - null == t - ? null - : ("undefined" != typeof Symbol && t[Symbol.iterator]) || - t["@@iterator"]; - if (null != n) { - var r, - i, - a = [], - o = !0, - u = !1; - try { - for ( - n = n.call(t); - !(o = (r = n.next()).done) && - (a.push(r.value), !e || a.length !== e); - o = !0 - ); - } catch (t) { - (u = !0), (i = t); - } finally { - try { - o || null == n.return || n.return(); - } finally { - if (u) throw i; - } - } - return a; - } - })(t, e) || - $(t, e) || - (function () { - throw new TypeError( - "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.", - ); - })() - ); -} -function q(t) { - return ( - (function (t) { - if (Array.isArray(t)) return N(t); - })(t) || - (function (t) { - if ( - ("undefined" != typeof Symbol && null != t[Symbol.iterator]) || - null != t["@@iterator"] - ) - return Array.from(t); - })(t) || - $(t) || - (function () { - throw new TypeError( - "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.", - ); - })() - ); -} -function $(t, e) { - if (t) { - if ("string" == typeof t) return N(t, e); - var n = Object.prototype.toString.call(t).slice(8, -1); - return ( - "Object" === n && t.constructor && (n = t.constructor.name), - "Map" === n || "Set" === n - ? Array.from(t) - : "Arguments" === n || - /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) - ? N(t, e) - : void 0 - ); - } -} -function N(t, e) { - (null == e || e > t.length) && (e = t.length); - for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; - return r; -} -var H = Array.isArray, - Y = "undefined" == typeof arguments ? void 0 : arguments, - L = function (t, e, n) { - var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : []; - if (H(t)) - if (r.length <= 6e4) t.splice.apply(t, [e, n].concat(q(r))); - else { - t.splice(e, n); - for (var i = 0; i < r.length; i += 6e4) { - var a = r.slice(i, i + 6e4); - t.splice.apply(t, [e + i, 0].concat(q(a))); - } - } - else _(arr) && t.replace(e, n, r); - }, - F = function (t) { - return t; - }, - _ = function (t) { - return t instanceof J; - }, - W = function (t, e) { - return H(t) ? t[e] : _(t) ? t.objectAt(e) : null; - }, - z = function (t, e) { - return 2 === Y.length - ? function (n) { - return e === n[t]; - } - : function (e) { - return Boolean(e[t]); - }; - }, - I = function (t, e) { - for ( - var n = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, - r = t.length, - i = n; - i < r; - i++ - ) { - var a = W(t, i); - if (e(a, i, t)) return i; - } - return -1; - }, - Q = function (t, e, n) { - var r = e.bind(n), - i = I(t, r, 0); - return -1 === i ? void 0 : W(t, i); - }, - B = function (t, e, n) { - var r = e.bind(n); - return -1 !== I(t, r, 0); - }, - G = function (t, e, n) { - var r = e.bind(n); - return ( - -1 === - I( - t, - function (t, e, n) { - return !r(t, e, n); - }, - 0, - ) - ); - }, - X = function (t, e) { - var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, - r = arguments.length > 3 ? arguments[3] : void 0, - i = t.length; - n < 0 && (n += i); - var a = - r && e != e - ? function (t) { - return t != t; - } - : function (t) { - return t === e; - }; - return I(t, a, n); - }, - K = function (t, e, n) { - return L(t, e, 0, [n]), n; - }, - J = (function (t) { - E(n, R(Array)); - var e = M(n); - function n() { - for (var t = arguments.length, r = new Array(t), i = 0; i < t; i++) - r[i] = arguments[i]; - return ( - T(this, n), - U( - H(arguments[0]) - ? e.call.apply(e, [this].concat(q(arguments[0]))) - : e.apply(this, arguments), - ) - ); - } - return ( - C(n, [ - { - key: "notEmpty", - get: function () { - return this.length > 0; - }, - }, - { - key: "empty", - get: function () { - return 0 === this.length; - }, - }, - { - key: "first", - get: function () { - return W(this, 0); - }, - }, - { - key: "last", - get: function () { - return W(this, this.length - 1); - }, - }, - { - key: "replace", - value: function (t, e) { - var n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : []; - return L(this, t, e, n), this; - }, - }, - { - key: "objectsAt", - value: function (t) { - var e = this; - return t.map(function (t) { - return W(e, t); - }); - }, - }, - { - key: "objectAt", - value: function (t) { - return W(this, t); - }, - }, - { - key: "indexOf", - value: function (t, e) { - return X(this, t, e, !1); - }, - }, - { - key: "lastIndexOf", - value: function (t, e) { - var n = this.length; - (void 0 === e || e >= n) && (e = n - 1), e < 0 && (e += n); - for (var r = e; r >= 0; r--) if (W(this, r) === t) return r; - return -1; - }, - }, - { - key: "includes", - value: function (t, e) { - return -1 !== X(this, t, e, !0); - }, - }, - { - key: "findBy", - value: function () { - return Q(this, z.apply(void 0, arguments)); - }, - }, - { - key: "findIndexBy", - value: function () { - return I(this, z.apply(void 0, arguments)); - }, - }, - { - key: "isEvery", - value: function () { - return G(this, z.apply(void 0, arguments)); - }, - }, - { - key: "isAny", - value: function () { - return B(this, z.apply(void 0, arguments)); - }, - }, - { - key: "invoke", - value: function (t) { - for ( - var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; - r < e; - r++ - ) - n[r - 1] = arguments[r]; - var i = []; - return ( - this.forEach(function (e) { - var r; - return i.push( - null === (r = e[t]) || void 0 === r - ? void 0 - : r.call.apply(r, [e].concat(n)), - ); - }), - i - ); - }, - }, - { - key: "toArray", - value: function () { - return this.map(function (t) { - return t; - }); - }, - }, - { - key: "compact", - value: function () { - return this.filter(function (t) { - return null != t; - }); - }, - }, - { - key: "sortBy", - value: function () { - var t = arguments; - return this.sort(function (e, n) { - for (var r = 0; r < t.length; r++) { - var i = t[r], - a = e[i], - o = n[i], - u = compare(a, o); - if (u) return u; - } - return 0; - }); - }, - }, - { - key: "uniqBy", - value: function (t) { - return (function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : F, - n = [], - r = new Set(), - i = - "function" == typeof e - ? e - : function (t) { - return get(t, e); - }; - return ( - t.forEach(function (t) { - var e = i(t); - r.has(e) || (r.add(e), n.push(t)); - }), - n - ); - })(this, t); - }, - }, - { - key: "without", - value: function (t) { - if (!this.includes(t)) return this; - var e = - t == t - ? function (e) { - return e !== t; - } - : function (t) { - return t == t; - }; - return this.filter(e); - }, - }, - { - key: "clear", - value: function () { - var t = this.length; - return 0 === t || this.replace(0, t, []), this; - }, - }, - { - key: "insertAt", - value: function (t, e) { - return K(this, t, e), this; - }, - }, - { - key: "replaceAt", - value: function (t, e) { - return this.replace(t, 1, [e]); - }, - }, - { - key: "removeAt", - value: function (t, e) { - return (function (t, e) { - return ( - L( - t, - e, - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : 1, - [], - ), - t - ); - })(this, t, e); - }, - }, - { - key: "pushObject", - value: function (t) { - return this.insertAt(this.length, t); - }, - }, - { - key: "pushObjects", - value: function (t) { - return this.replace(this.length, 0, t), this; - }, - }, - { - key: "popObject", - value: function () { - var t = this.length; - if (0 === t) return null; - var e = W(this, t - 1); - return this.removeAt(t - 1, 1), e; - }, - }, - { - key: "shiftObject", - value: function () { - if (0 === this.length) return null; - var t = W(this, 0); - return this.removeAt(0), t; - }, - }, - { - key: "unshiftObject", - value: function (t) { - return K(this, 0, t); - }, - }, - { - key: "unshiftObjects", - value: function (t) { - return this.replace(0, 0, t), this; - }, - }, - { - key: "reverseObjects", - value: function () { - var t = this.length; - if (0 === t) return this; - var e = this.toArray().reverse(); - return this.replace(0, t, e), this; - }, - }, - { - key: "setObjects", - value: function (t) { - if (0 === t.length) return this.clear(); - var e = this.length; - return this.replace(0, e, t), this; - }, - }, - { - key: "removeObject", - value: function (t) { - for (var e = this.length || 0; --e >= 0; ) - W(this, e) === t && this.removeAt(e); - return this; - }, - }, - { - key: "removeObjects", - value: function (t) { - for (var e = t.length - 1; e >= 0; e--) this.removeObject(t[e]); - return this; - }, - }, - { - key: "addObject", - value: function (t) { - return this.includes(t) || this.pushObject(t), this; - }, - }, - { - key: "addObjects", - value: function (t) { - var e = this; - return ( - t.forEach(function (t) { - return e.addObject(t); - }), - this - ); - }, - }, - ]), - n - ); - })(), - Z = function (t) { - var e = null == t; - if (e) return e; - if ("number" == typeof t.size) return !t.size; - var n = w(t); - if ("object" === n) { - var r = t.size; - if ("number" == typeof r) return !r; - } - if ("number" == typeof t.length && "function" !== n) return !t.length; - if ("object" === n) { - var i = t.length; - if ("number" == typeof i) return !i; - } - return !1; - }, - V = function (t) { - return Z(t) || ("string" == typeof t && !1 === /\S/.test(t)); - }; -function tt(t) { - return t instanceof ct; -} -var et = function () { - var t, e, n, r, i; - return !( - "undefined" == typeof process || - ("object" !== - w(null === (t = process) || void 0 === t ? void 0 : t.env) && - -1 === - (null === (e = process.release) || - void 0 === e || - null === (n = e.name) || - void 0 === n - ? void 0 - : n.search(/node|io.js/))) || - ("undefined" != typeof window && - "ReactNative" !== - (null === (r = window) || - void 0 === r || - null === (i = r.navigator) || - void 0 === i - ? void 0 - : i.product)) - ); - }, - nt = function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return et() - ? Et("adapter", "NodeAdapter", t) - : Et("adapter", "BrowserAdapter", t); - }, - rt = Array.isArray; -!(function () { - function t(e) { - T(this, t), - (this.place = e), - (this.geometry = null == e ? void 0 : e.geometry), - (this.components = this.parseComponents()), - (this.attributes = this.parseProperties()); - } - C(t, [ - { - key: "parse", - value: function () { - this.parseComponents(), this.parseProperties(); - }, - }, - { - key: "parseComponents", - value: function () { - var t; - return ( - (null === (t = this.place) || void 0 === t - ? void 0 - : t.address_components) || [] - ).reduce(function (t, e) { - return ( - e.types.forEach(function (n) { - t[n] = e; - }), - t - ); - }, {}); - }, - }, - { - key: "parseProperties", - value: function () { - var t, - e = { - streetNumber: this.get("street_number"), - streetName: this.get("route"), - coordinates: - null !== (t = this.geometry) && void 0 !== t && t.location - ? Object.values(this.geometry.location) - : [0, 0], - city: this.or([ - "locality", - "sublocality", - "sublocality_level_1", - "neighborhood", - "administrative_area_level_3", - "administrative_area_level_2", - ]), - county: this.get("administrative_area_level_2"), - stateShort: this.get("administrative_area_level_1", !0), - stateLong: this.get("administrative_area_level_1"), - countryShort: this.get("country", !0), - country: this.get("country", !0), - countryLong: this.get("country"), - postalCode: this.get("postal_code"), - }; - return ( - (e.address = [e.streetNumber, e.streetName] - .filter(Boolean) - .join(" ")), - e - ); - }, - }, - { - key: "all", - value: function () { - return this.attributes; - }, - }, - { - key: "or", - value: function () { - for ( - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : [], - e = 0; - e < t.length; - e++ - ) { - var n = t[e]; - if (rt(n)) { - var r = n[0], - i = n[1]; - if (this.has(r)) return this.get(r, i); - } else if (this.has(n)) return this.get(n); - } - return null; - }, - }, - { - key: "has", - value: function (t) { - return t in this.components; - }, - }, - { - key: "get", - value: function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; - return t in this.components - ? e - ? this.components[t].short_name - : this.components[t].long_name - : null; - }, - }, - { - key: "setAttributes", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return (this.attributes = m(m({}, this.attributes), t)), this; - }, - }, - { - key: "setAttribute", - value: function (t, e) { - return (this.attributes[t] = e), this; - }, - }, - { - key: "getAttribute", - value: function (t) { - return this.attributes[t] || null; - }, - }, - ]); -})(); -var it = (function () { - function t() { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, - n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; - T(this, t), (this.type = "Point"), (this.coordinates = [n, e]); - } - return ( - C( - t, - [ - { - key: "latitude", - get: function () { - return this.coordinates[1]; - }, - }, - { - key: "longitude", - get: function () { - return this.coordinates[0]; - }, - }, - { - key: "lat", - value: function () { - return this.latitude; - }, - }, - { - key: "lng", - value: function () { - return this.longitude; - }, - }, - { - key: "serialize", - value: function () { - return { type: "Point", coorindates: [this.lat(), this.lng()] }; - }, - }, - { - key: "toJson", - value: function () { - return this.serialize(); - }, - }, - { - key: "toString", - value: function () { - return "(".concat(this.latitude, ", ").concat(this.longitude, ")"); - }, - }, - ], - [ - { - key: "fromGeoJson", - value: function (e) { - var n = j(e.coordinates, 2); - return ( - (longitude = n[0]), (latitude = n[1]), new t(latitude, longitude) - ); - }, - }, - ], - ), - t - ); -})(); -"undefined" == typeof arguments || arguments; -var at = function (t, e) { - var n = t(); - return Array.isArray(n) || "object" === w(n) ? ot(n, e) : null; - }, - ot = function t(e, n) { - var r, - i = e, - a = w(e), - o = "object" === a, - u = "function" === a, - s = Array.isArray(e), - c = "string" === w(n) && n.includes(".") ? n.split(".") : [n]; - if (s || o) { - for (var h = 0; h < c.length; h++) { - if (i && void 0 === i[c[h]]) return null; - if (i) { - if ( - "object" === w((r = i = i[c[h]])) && - !Z(null == r ? void 0 : r.attributes) && - "object" === w(null == r ? void 0 : r.attributes) && - void 0 !== c[h + 1] - ) { - var l = c.slice(h + 1).join("."); - return t(i.attributes, l); - } - if ("function" == typeof i) { - var d = c.slice(h + 1).join("."); - return at(i, d); - } - } - } - return i; - } - if (u) return at(e, n); - }, - ut = function (t, e, n) { - var r = t, - i = "object" === w(t), - a = Array.isArray(t), - o = "string" === w(e) && e.includes(".") ? e.split(".") : [e], - u = o.length; - if (a || i) { - for (var s = 0; s < u - 1; s++) r[o[s]] || (r[o[s]] = {}), (r = r[o[s]]); - r[o[u - 1]] = n; - } - return n; - }, - st = (function () { - function t() { - var e = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - n = - arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; - T(this, t), (this.actions = e), (this.bind = n); - } - return ( - C(t, [ - { - key: "extend", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : null, - e = t || this.bind; - if (!e) return this; - if (null != this && this.actions && "object" === w(this.actions)) - for (var n in this.actions) { - var r = this.actions[n]; - ut(e, n, "function" == typeof r ? r.bind(e) : r); - } - return this; - }, - }, - ]), - t - ); - })(), - ct = (function () { - function t() { - var e = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - n = arguments.length > 1 ? arguments[1] : void 0, - r = arguments.length > 2 ? arguments[2] : void 0, - i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; - T(this, t), - (this.attributes = e), - (this.dirtyAttributes = {}), - (this.changes = {}), - (this.isLoading = !1), - (this.isSaving = !1), - (this.isDestroying = !1), - (this.isReloading = !1), - (this.resource = r), - (this.options = i), - (this.version = i.version || "v1"), - this.setAdapter(n); - } - return ( - C(t, [ - { - key: "setAdapter", - value: function (t) { - var e; - return ( - (this.adapter = t), - (this.store = new Ot(this.resource, t, { - onAfterFetch: this.syncAttributes.bind(this), - actions: - null === (e = this.options) || void 0 === e - ? void 0 - : e.actions, - })), - this - ); - }, - }, - { - key: "id", - get: function () { - return this.getAttribute("id"); - }, - }, - { - key: "create", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}, - n = this.mergeAttributes(e); - return ( - this.setFlags(["isLoading", "isSaving"]), - this.store.create(n).then(function (e) { - return t.setFlags(["isLoading", "isSaving"], !1), e; - }) - ); - }, - }, - { - key: "update", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return ( - this.setFlags(["isLoading", "isSaving"]), - this.store.update(this.attributes.id, e).then(function (e) { - return t.setFlags(["isLoading", "isSaving"], !1), e; - }) - ); - }, - }, - { - key: "destroy", - value: function () { - var t = this; - return ( - this.setFlags(["isLoading", "isDestroying"]), - this.store.destroy(this.attributes.id).then(function (e) { - return t.setFlags(["isLoading", "isDestroying"], !1), e; - }) - ); - }, - }, - { - key: "reload", - value: function () { - var t = this; - return ( - this.setFlags(["isLoading", "isReloading"]), - this.store.findRecord(this.attributes.id).then(function (e) { - return t.reset(), e; - }) - ); - }, - }, - { - key: "setFlags", - value: function () { - for ( - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : [], - e = - !(arguments.length > 1 && void 0 !== arguments[1]) || - arguments[1], - n = ["isLoading", "isSaving", "isReloading", "isDestroying"], - r = 0; - r < t.length; - r++ - ) { - var i = t[r]; - if ("string" != typeof i || !n.includes(i)) - throw new Error("".concat(i, " is not a valid flag!")); - this[i] = e; - } - return this; - }, - }, - { - key: "reset", - value: function () { - return ( - (this.dirtyAttributes = {}), - (this.changes = {}), - (this.isLoading = !1), - (this.isSaving = !1), - (this.isReloading = !1), - this - ); - }, - }, - { - key: "empty", - value: function () { - return this.reset(), (this.attribues = {}), this; - }, - }, - { - key: "save", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}, - e = this.getAttributes(); - return Z(this.id) - ? this.create(e) - : !0 === t.onlyDirty - ? this.savedirty() - : this.update(e); - }, - }, - { - key: "saveDirty", - value: function () { - for ( - var t = Object.keys(this.dirtyAttributes), e = {}, n = 0; - n < t.length; - n++ - ) { - var r = t[n]; - e[r] = this.getAttribute(r); - } - return this.update(e); - }, - }, - { - key: "createdAt", - get: function () { - return this.hasAttribute("created_at") - ? new Date(this.getAttribute("created_at")) - : null; - }, - }, - { - key: "updatedAt", - get: function () { - return this.hasAttribute("updated_at") - ? new Date(this.getAttribute("updated_at")) - : null; - }, - }, - { - key: "isLoaded", - get: function () { - return this.hasAttributes(["created_at", "id"]); - }, - }, - { - key: "isEmpty", - get: function () { - return ( - 0 === - Object.values(null == this ? void 0 : this.attributes).length - ); - }, - }, - { - key: "isNew", - get: function () { - return !this.id; - }, - }, - { - key: "isSaved", - get: function () { - return !this.isNew && this.isLoaded; - }, - }, - { - key: "isDeleted", - get: function () { - return this.hasAttributes(["deleted", "time"]); - }, - }, - { - key: "eachAttribute", - value: function (t) { - var e, - n = this; - return ( - "function" != typeof t || - Object.keys( - null !== (e = null == this ? void 0 : this.attributes) && - void 0 !== e - ? e - : {}, - ).forEach(function (e) { - var r = n.getAttribute(e); - t.call(n, r, e); - }), - this - ); - }, - }, - { - key: "changes", - value: function () { - return this.changes; - }, - }, - { - key: "getDirtyAttributes", - value: function () { - return this.dirtyAttributes; - }, - }, - { - key: "isDirty", - value: function (t) { - return t in this.dirtyAttributes; - }, - }, - { - key: "hasDirtyAttributes", - value: function () { - var t; - return ( - Object.keys( - null !== (t = null == this ? void 0 : this.dirtyAttributes) && - void 0 !== t - ? t - : {}, - ).length > 0 - ); - }, - }, - { - key: "mutate", - value: function (t, e) { - this.attributes[t] = e; - }, - }, - { - key: "setAttribute", - value: function (t) { - var e, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : null; - if (null === n && "object" === w(t)) return this.setAttributes(t); - var r = - null !== (e = null == this ? void 0 : this.attributes[t]) && - void 0 !== e - ? e - : null; - return ( - ut(this.attributes, t, n), - ut(this.dirtyAttributes, t, r), - H(null == this ? void 0 : this.changes[t]) || - (this.changes[t] = []), - this.changes[t].push({ - property: t, - previousValue: r, - value: n, - changedAt: new Date(), - }), - this - ); - }, - }, - { - key: "setAttributes", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - for (var e in t) this.setAttribute(e, t[e]); - return this; - }, - }, - { - key: "getAttribute", - value: function (t) { - var e, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : null, - r = ot( - null !== (e = null == this ? void 0 : this.attributes) && - void 0 !== e - ? e - : {}, - t, - ); - return void 0 === r ? n : r; - }, - }, - { - key: "hasAttribute", - value: function (t) { - if (H(t)) { - var e, - n = t, - r = Object.keys( - null !== (e = this.attributes) && void 0 !== e ? e : {}, - ); - return n.every(function (t) { - return r.includes(t); - }); - } - return !(null == this || !this.attributes) && t in this.attributes; - }, - }, - { - key: "hasAttributes", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : []; - return this.hasAttribute(t); - }, - }, - { - key: "isAttributeFilled", - value: function (t) { - var e = this; - return H(t) - ? this.hasAttribute(t) && - t.every(function (t) { - return !Z(e.getAttribute(t)); - }) - : this.hasAttribute(t) && !Z(this.getAttribute(t)); - }, - }, - { - key: "getAttributes", - value: function (t) { - var e = {}; - if (null == t) - return this.getAttributes(Object.keys(this.attributes)); - if ("string" == typeof t) - return this.getAttribute(Array.prototype.slice.call(arguments)); - if (!H(t)) throw new Error("No attribute properties provided!"); - for (var n = 0; n < t.length; n++) { - var r, - i, - a = t[n]; - if ("string" == typeof a) { - var o = this.getAttribute(a); - "object" !== - w(null === (r = o) || void 0 === r ? void 0 : r.attributes) || - H(null === (i = o) || void 0 === i ? void 0 : i.attributes) || - (o = o.attributes), - (e[a] = o); - } - } - return e; - }, - }, - { - key: "serialize", - value: function () { - return this.getAttributes(); - }, - }, - { - key: "mergeAttributes", - value: function () { - var t, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}, - n = - null !== (t = null == this ? void 0 : this.attributes) && - void 0 !== t - ? t - : {}; - return (this.attributes = m(m({}, n), e)), this.attributes; - }, - }, - { - key: "syncAttributes", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - this.attributes = t; - }, - }, - ]), - t - ); - })(), - ht = new st({ - getDistanceAndTime: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; - return this.adapter.get( - "".concat(this.namespace, "/").concat(t, "/distance-and-time"), - {}, - e, - ); - }, - }), - lt = (function (t) { - E(n, ct); - var e = M(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, "order", m({ actions: ht }, i)); - } - return ( - C(n, [ - { - key: "getDistanceAndTime", - value: function () { - return this.store.getDistanceAndTime(this.id); - }, - }, - ]), - n - ); - })(), - dt = (function (t) { - E(n, ct); - var e = M(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, "payload", i); - } - return ( - C(n, [ - { key: "attach", value: function (t) {} }, - { key: "entities", get: function () {} }, - { key: "dropoff", get: function () {} }, - { key: "pickup", get: function () {} }, - { - key: "waypoints", - get: function () { - return new J(this.waypoints); - }, - }, - ]), - n - ); - })(); -!(function (t) { - E(n, ct); - var e = M(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, "entity", i); - } -})(); -var ft = (function (t) { - E(n, ct); - var e = M(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, "place", i); - } - return ( - C( - n, - [ - { - key: "latitude", - get: function () { - var t; - return null === (t = this.getAttribute("location", new it())) || - void 0 === t - ? void 0 - : t.coordinates[1]; - }, - }, - { - key: "longitude", - get: function () { - var t; - return null === (t = this.getAttribute("location", new it())) || - void 0 === t - ? void 0 - : t.coordinates[0]; - }, - }, - { - key: "coordinates", - get: function () { - return [this.latitude, this.longitude]; - }, - }, - { - key: "setOwner", - value: function (t) { - return ( - tt(t) && this.setAttribute("owner", t.id), - "string" == typeof t && this.setAttribute("owner", t), - this - ); - }, - }, - ], - [ - { - key: "fromGoogleAddress", - value: function (t, e) { - var r = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}, - i = t.getAttribute("coordinates"), - a = j(i, 2), - o = a[0], - u = a[1], - s = { - name: null, - address: t.getAttribute("address"), - location: new it(o, u), - street1: t.getAttribute("streetName"), - street2: null, - city: t.getAttribute("city"), - province: t.getAttribute("stateLong"), - postal_code: t.getAttribute("postalCode"), - neighborhood: t.get("neighborhood"), - district: t.getAttribute("county"), - building: t.get("building"), - country: t.getAttribute("countryShort"), - phone: null, - security_access_code: null, - }; - return new n(s, e, r); - }, - }, - ], - ), - n - ); -})(); -!(function (t) { - E(n, ft); - var e = M(n); - function n() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, "waypoint", i); - } -})(), - (function (t) { - E(n, ct); - var e = M(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, "tracking-status", i); - } - })(), - (function (t) { - E(n, ct); - var e = M(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, "vehicle", i); - } - })(), - (function (t) { - E(n, ct); - var e = M(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, "driver", i); - } - })(), - (function (t) { - E(n, ct); - var e = M(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, "vendor", i); - } - })(), - (function (t) { - E(n, ct); - var e = M(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, "contact", i); - } - })(), - (function (t) { - E(n, ct); - var e = M(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, "zone", i); - } - })(), - (function (t) { - E(n, ct); - var e = M(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, "service-area", i); - } - })(), - (function (t) { - E(n, ct); - var e = M(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, "service-rate", i); - } - })(); -var vt = (function (t) { - E(n, ct); - var e = M(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return T(this, n), e.call(this, t, r, "service-quote", i); - } - return ( - C(n, [ - { key: "fromPreliminary", value: function () {} }, - { key: "fromPayload", value: function () {} }, - ]), - n - ); - })(), - gt = function t() { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - T(this, t), - (this.version = e.version || "v1"), - (this.host = e.host || null), - (this.namespace = e.namespace || null), - (this.headers = e.headers || {}); - }, - pt = (function (t) { - E(n, gt); - var e = M(n); - function n(t) { - var r; - return ( - T(this, n), - (r = e.call(this, t)).setHeaders({ - Authorization: "Bearer ".concat(t.publicKey), - "Content-Type": "application/json", - "User-Agent": "@fleetbase/sdk;browser", - }), - r - ); - } - return ( - C(n, [ - { - key: "setHeaders", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return (this.headers = m(m({}, this.headers), t)), this; - }, - }, - { - key: "parseJSON", - value: function (t) { - return new Promise(function (e, n) { - return t - .json() - .then(function (n) { - return e({ - statusText: t.statusText, - status: t.status, - ok: t.ok, - json: n, - }); - }) - .catch(function () { - n( - new Error( - "Oops! Something went wrong when handling your request.", - ), - ); - }); - }); - }, - }, - { - key: "request", - value: function (t) { - var e = this, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : "GET", - r = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}, - i = - arguments.length > 3 && void 0 !== arguments[3] - ? arguments[3] - : {}; - return new Promise(function (a, o) { - return fetch( - i.url || - "".concat(e.host, "/").concat(e.namespace, "/").concat(t), - m( - { - method: n, - mode: i.mode || "cors", - headers: new Headers( - m(m({}, e.headers || {}), i.headers || {}), - ), - }, - r, - ), - ) - .then(e.parseJSON) - .then(function (t) { - return t.ok - ? a(t.json) - : o( - new Error( - t.json.errors ? t.json.errors[0] : t.statusText, - ), - ); - }) - .catch(function (t) { - o(t); - }); - }); - }, - }, - { - key: "get", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}, - r = V(e) ? "" : new URLSearchParams(e).toString(); - return this.request( - "".concat(t).concat(r ? "?".concat(r) : ""), - "GET", - {}, - n, - ); - }, - }, - { - key: "post", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}; - return this.request(t, "POST", { body: JSON.stringify(e) }, n); - }, - }, - { - key: "put", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}; - return this.request(t, "PUT", { body: JSON.stringify(e) }, n); - }, - }, - { - key: "delete", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}; - return this.request(t, "DELETE", {}, e); - }, - }, - { - key: "patch", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}; - return this.request(t, "PATCH", { body: JSON.stringify(e) }, n); - }, - }, - ]), - n - ); - })(), - yt = (function (e) { - E(r, gt); - var n = M(r); - function r(e) { - var i; - return ( - T(this, r), - ((i = n.call(this, e)).axios = t.create({ - baseURL: "".concat(i.host, "/").concat(i.namespace), - headers: { - Authorization: "Bearer ".concat(e.publicKey), - "Content-Type": "application/json", - "User-Agent": "@fleetbase/sdk;node", - }, - })), - i - ); - } - return ( - C(r, [ - { - key: "setHeaders", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}, - e = this.axios.defaults.headers.common; - return (this.axios.defaults.headers.common = m(m({}, e), t)), this; - }, - }, - { - key: "transform", - value: function (t) { - return t.data; - }, - }, - { - key: "handleError", - value: function (t) { - if (t.response) { - var e = t.response.data; - if (H(e.errors)) throw new Error(e.errors[0]); - if (e.error) throw new Error(e.error); - } - throw t; - }, - }, - { - key: "get", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}, - r = V(e) ? "" : new URLSearchParams(e).toString(); - return this.axios - .get("".concat(t).concat(r ? "?".concat(r) : ""), n) - .then(this.transform.bind(this)) - .catch(this.handleError.bind(this)); - }, - }, - { - key: "post", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}; - return this.axios - .post(t, e, n) - .then(this.transform.bind(this)) - .catch(this.handleError.bind(this)); - }, - }, - { - key: "put", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}; - return this.axios - .put(t, e, n) - .then(this.transform.bind(this)) - .catch(this.handleError.bind(this)); - }, - }, - { - key: "delete", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}; - return this.axios - .delete(t, e) - .then(this.transform.bind(this)) - .catch(this.handleError.bind(this)); - }, - }, - { - key: "patch", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}; - return this.axios - .patch(t, e, n) - .then(this.transform.bind(this)) - .catch(this.handleError.bind(this)); - }, - }, - ]), - r - ); - })(), - mt = (function (t) { - E(n, gt); - var e = M(n); - function n() { - return T(this, n), e.apply(this, arguments); - } - return n; - })(), - wt = (function () { - function t(e) { - var n = - !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; - T(this, t), - A(this, "uncountableWords", [ - "equipment", - "information", - "rice", - "money", - "species", - "series", - "fish", - "sheep", - "moose", - "deer", - "news", - ]), - A(this, "pluralRules", [ - [new RegExp("(m)an$", "gi"), "$1en"], - [new RegExp("(pe)rson$", "gi"), "$1ople"], - [new RegExp("(child)$", "gi"), "$1ren"], - [new RegExp("^(ox)$", "gi"), "$1en"], - [new RegExp("(ax|test)is$", "gi"), "$1es"], - [new RegExp("(octop|vir)us$", "gi"), "$1i"], - [new RegExp("(alias|status)$", "gi"), "$1es"], - [new RegExp("(bu)s$", "gi"), "$1ses"], - [new RegExp("(buffal|tomat|potat)o$", "gi"), "$1oes"], - [new RegExp("([ti])um$", "gi"), "$1a"], - [new RegExp("sis$", "gi"), "ses"], - [new RegExp("(?:([^f])fe|([lr])f)$", "gi"), "$1$2ves"], - [new RegExp("(hive)$", "gi"), "$1s"], - [new RegExp("([^aeiouy]|qu)y$", "gi"), "$1ies"], - [new RegExp("(x|ch|ss|sh)$", "gi"), "$1es"], - [new RegExp("(matr|vert|ind)ix|ex$", "gi"), "$1ices"], - [new RegExp("([m|l])ouse$", "gi"), "$1ice"], - [new RegExp("(quiz)$", "gi"), "$1zes"], - [new RegExp("s$", "gi"), "s"], - [new RegExp("$", "gi"), "s"], - ]), - A(this, "singularRules", [ - [new RegExp("(m)en$", "gi"), "$1an"], - [new RegExp("(pe)ople$", "gi"), "$1rson"], - [new RegExp("(child)ren$", "gi"), "$1"], - [new RegExp("([ti])a$", "gi"), "$1um"], - [ - new RegExp( - "((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$", - "gi", - ), - "$1$2sis", - ], - [new RegExp("(hive)s$", "gi"), "$1"], - [new RegExp("(tive)s$", "gi"), "$1"], - [new RegExp("(curve)s$", "gi"), "$1"], - [new RegExp("([lr])ves$", "gi"), "$1f"], - [new RegExp("([^fo])ves$", "gi"), "$1fe"], - [new RegExp("([^aeiouy]|qu)ies$", "gi"), "$1y"], - [new RegExp("(s)eries$", "gi"), "$1eries"], - [new RegExp("(m)ovies$", "gi"), "$1ovie"], - [new RegExp("(x|ch|ss|sh)es$", "gi"), "$1"], - [new RegExp("([m|l])ice$", "gi"), "$1ouse"], - [new RegExp("(bus)es$", "gi"), "$1"], - [new RegExp("(o)es$", "gi"), "$1"], - [new RegExp("(shoe)s$", "gi"), "$1"], - [new RegExp("(cris|ax|test)es$", "gi"), "$1is"], - [new RegExp("(octop|vir)i$", "gi"), "$1us"], - [new RegExp("(alias|status)es$", "gi"), "$1"], - [new RegExp("^(ox)en", "gi"), "$1"], - [new RegExp("(vert|ind)ices$", "gi"), "$1ex"], - [new RegExp("(matr)ices$", "gi"), "$1ix"], - [new RegExp("(quiz)zes$", "gi"), "$1"], - [new RegExp("s$", "gi"), ""], - ]), - A(this, "nonTitlecasedWords", [ - "and", - "or", - "nor", - "a", - "an", - "the", - "so", - "but", - "to", - "of", - "at", - "by", - "from", - "into", - "on", - "onto", - "off", - "out", - "in", - "over", - "with", - "for", - ]), - A(this, "idSuffix", new RegExp("(_ids|_id)$", "g")), - A(this, "underbar", new RegExp("_", "g")), - A(this, "spaceOrUnderbar", new RegExp("[ _]", "g")), - A(this, "uppercase", new RegExp("([A-Z])", "g")), - A(this, "underbarPrefix", new RegExp("^_")), - (this.str = e), - (this.chain = n); - } - return ( - C( - t, - [ - { - key: "get", - value: function () { - return this.str; - }, - }, - { - key: "applyRules", - value: function (t, e, n, r) { - if (r) t = r; - else if (!(n.indexOf(t.toLowerCase()) > -1)) - for (var i = 0; i < e.length; i++) - if (t.match(e[i][0])) { - t = t.replace(e[i][0], e[i][1]); - break; - } - return (this.str = t), !0 === this.chain ? this : t; - }, - }, - { - key: "pluralize", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : null; - return ( - (t = t || this.str), - this.applyRules(t, this.pluralRules, this.uncountableWords, e) - ); - }, - }, - { - key: "singularize", - value: function (t, e) { - return ( - (t = t || this.str), - this.applyRules(t, this.singularRules, this.uncountableWords, e) - ); - }, - }, - { - key: "camelize", - value: function (t, e) { - for ( - var n = (t = t || this.str).split("/"), r = 0; - r < n.length; - r++ - ) { - for ( - var i = n[r].split("_"), a = e && r + 1 === n.length ? 1 : 0; - a < i.length; - a++ - ) - i[a] = i[a].charAt(0).toUpperCase() + i[a].substring(1); - n[r] = i.join(""); - } - if (((t = n.join("::")), !0 === e)) { - var o = t.charAt(0).toLowerCase(), - u = t.slice(1); - t = o + u; - } - return (this.str = t), !0 === this.chain ? this : t; - }, - }, - { - key: "underscore", - value: function (t) { - for ( - var e = (t = t || this.str).split("::"), n = 0; - n < e.length; - n++ - ) - (e[n] = e[n].replace(this.uppercase, "_$1")), - (e[n] = e[n].replace(this.underbarPrefix, "")); - return ( - (t = e.join("/").toLowerCase()), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "humanize", - value: function (t, e) { - return ( - (t = (t = (t = (t = t || this.str).toLowerCase()).replace( - this.idSuffix, - "", - )).replace(this.underbar, " ")), - e || (t = this.capitalize(t)), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "capitalize", - value: function (t) { - return ( - (t = - (t = (t = t || this.str).toLowerCase()) - .substring(0, 1) - .toUpperCase() + t.substring(1)), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "dasherize", - value: function (t) { - return ( - (t = (t = (t = t || this.str).replace( - this.spaceOrUnderbar, - "-", - )).toLowerCase()), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "normify", - value: function (t, e) { - (t = t || this.str), - !0 === e - ? ((t = this.camelize(t)), (t = this.underscore(t))) - : (t = t.toLowerCase()); - for ( - var n = (t = t.replace(this.underbar, " ")).split(" "), r = 0; - r < n.length; - r++ - ) { - for (var i = n[r].split("-"), a = 0; a < i.length; a++) - this.nonTitlecasedWords.indexOf(i[a].toLowerCase()) < 0 && - (i[a] = this.capitalize(i[a])); - n[r] = i.join("-"); - } - return ( - (t = - (t = n.join(" ")).substring(0, 1).toUpperCase() + - t.substring(1)), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "demodulize", - value: function (t) { - var e = (t = t || this.str).split("::"); - return ( - (t = e[e.length - 1]), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "tableize", - value: function (t) { - return ( - (t = t || this.str), - (t = this.pluralize(this.underscore(t))), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "classify", - value: function (t) { - return ( - (t = t || this.str), - (t = this.singularize(this.camelize(t))), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "foreignKey", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; - return ( - (t = t || this.str), - (t = - this.underscore(this.demodulize(t)) + (e ? "" : "_") + "id"), - (this.str = t), - !0 === this.chain ? this : t - ); - }, - }, - { - key: "ordinalize", - value: function (t) { - for ( - var e = (t = t || this.str).split(" "), n = 0; - n < e.length; - n++ - ) - if (NaN === parseInt(e[n])) { - var r = e[n].substring(e[n].length - 2), - i = e[n].substring(e[n].length - 1), - a = "th"; - "11" != r && - "12" != r && - "13" != r && - ("1" === i - ? (a = "st") - : "2" === i - ? (a = "nd") - : "3" === i && (a = "rd")), - (e[n] += a); - } - return ( - (t = e.join(" ")), (this.str = t), !0 === this.chain ? this : t - ); - }, - }, - ], - [ - { - key: "invoke", - value: function () { - var e = Object.values(arguments), - n = new t(null, !1), - r = arguments[0]; - return ( - e.shift(), - "function" == typeof n[r] ? n[r].apply(n, q(e)) : null - ); - }, - }, - ], - ), - t - ); - })(), - bt = function () { - var t = ["pluralize"].concat(Array.prototype.slice.call(arguments)); - return wt.invoke.apply(wt, q(t)); - }, - kt = function () { - var t = ["singularize"].concat(Array.prototype.slice.call(arguments)); - return wt.invoke.apply(wt, q(t)); - }, - Tt = function () { - var t = ["classify"].concat(Array.prototype.slice.call(arguments)); - return wt.invoke.apply(wt, q(t)); - }, - xt = { Place: ft, Payload: dt, Order: lt }, - Ct = { BrowserAdapter: pt, NodeAdapter: yt, EmberJsAdapter: mt }, - At = (function () { - function t() { - return ( - T(this, t), - (this.resources = xt), - (this.adapters = Ct), - this.lookup.apply(this, arguments) - ); - } - return ( - C(t, [ - { - key: "lookup", - value: function (t, e) { - var n = bt(t), - r = Array.prototype.slice.call(arguments).slice(2); - if (!this[n]) throw new Error("Attempted to resolve invalid type"); - if (!this[n][e]) - throw new Error( - "No ".concat(kt(t), " named ").concat(e, " to resolve"), - ); - return P(this[n][e], q(r)); - }, - }, - ]), - t - ); - })(), - Et = function () { - return P(At, Array.prototype.slice.call(arguments)); - }, - Dt = function (t) { - var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : []; - if (((t.actions = H(e) ? e : [e]), !H(e))) - return e instanceof st && e.extend(t), t; - for (var n = 0; n < e.length; n++) { - var r = e[n]; - t.extendActions(r); - } - }, - Ot = (function () { - function t(e, n) { - var r = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - T(this, t), - (this.resource = e), - (this.adapter = n || nt()), - (this.namespace = bt(e)), - (this.storage = new J()), - (this.options = r), - this.extendActions(r.actions); - } - return ( - C(t, [ - { - key: "extendActions", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : []; - return Dt(this, t); - }, - }, - { - key: "deposit", - value: function (t) { - return t; - }, - }, - { - key: "serialize", - value: function (t) { - return Et("resource", Tt(this.resource), t, this.adapter); - }, - }, - { - key: "afterFetch", - value: function (t) { - return (function (t, e) { - if ( - ("function" == typeof t.options.onAfterFetch && - t.options.onAfterFetch(e), - H(e)) - ) { - for (var n = [], r = 0; r < e.length; r++) - n.push(t.afterFetch(e[r])); - return P(J, n); - } - var i = t.serialize(e); - return t.deposit(i); - })(this, t); - }, - }, - { - key: "create", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}; - return new Promise( - (function () { - var r = k( - regeneratorRuntime.mark(function r(i, a) { - var o; - return regeneratorRuntime.wrap(function (r) { - for (;;) - switch ((r.prev = r.next)) { - case 0: - return ( - (r.next = 2), - t.adapter - .post("".concat(t.namespace), e, n) - .then(t.afterFetch.bind(t)) - .catch(a) - ); - case 2: - (o = r.sent), i(o); - case 4: - case "end": - return r.stop(); - } - }, r); - }), - ); - return function (t, e) { - return r.apply(this, arguments); - }; - })(), - ); - }, - }, - { - key: "update", - value: function (t) { - var e = this, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - r = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}; - return new Promise( - (function () { - var i = k( - regeneratorRuntime.mark(function i(a, o) { - var u; - return regeneratorRuntime.wrap(function (i) { - for (;;) - switch ((i.prev = i.next)) { - case 0: - return ( - (i.next = 2), - e.adapter - .put( - "".concat(e.namespace, "/").concat(t), - n, - r, - ) - .then(e.afterFetch.bind(e)) - .catch(o) - ); - case 2: - (u = i.sent), a(u); - case 4: - case "end": - return i.stop(); - } - }, i); - }), - ); - return function (t, e) { - return i.apply(this, arguments); - }; - })(), - ); - }, - }, - { - key: "findRecord", - value: function (t) { - var e = this, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}; - return new Promise( - (function () { - var r = k( - regeneratorRuntime.mark(function r(i, a) { - var o; - return regeneratorRuntime.wrap(function (r) { - for (;;) - switch ((r.prev = r.next)) { - case 0: - return ( - (r.next = 2), - e.adapter - .get( - "".concat(e.namespace, "/").concat(t), - {}, - n, - ) - .then(e.afterFetch.bind(e)) - .catch(a) - ); - case 2: - (o = r.sent), i(o); - case 4: - case "end": - return r.stop(); - } - }, r); - }), - ); - return function (t, e) { - return r.apply(this, arguments); - }; - })(), - ); - }, - }, - { - key: "findAll", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return new Promise( - (function () { - var n = k( - regeneratorRuntime.mark(function n(r, i) { - var a; - return regeneratorRuntime.wrap(function (n) { - for (;;) - switch ((n.prev = n.next)) { - case 0: - return ( - (n.next = 2), - t.adapter - .get("".concat(t.namespace), {}, e) - .then(t.afterFetch.bind(t)) - .catch(i) - ); - case 2: - (a = n.sent), r(a); - case 4: - case "end": - return n.stop(); - } - }, n); - }), - ); - return function (t, e) { - return n.apply(this, arguments); - }; - })(), - ); - }, - }, - { - key: "query", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}; - return new Promise( - (function () { - var r = k( - regeneratorRuntime.mark(function r(i, a) { - var o; - return regeneratorRuntime.wrap(function (r) { - for (;;) - switch ((r.prev = r.next)) { - case 0: - return ( - (r.next = 2), - t.adapter - .get("".concat(t.namespace), e, n) - .then(t.afterFetch.bind(t)) - .catch(a) - ); - case 2: - (o = r.sent), i(o); - case 4: - case "end": - return r.stop(); - } - }, r); - }), - ); - return function (t, e) { - return r.apply(this, arguments); - }; - })(), - ); - }, - }, - { - key: "queryRecord", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}; - return ( - (e.single = !0), - new Promise( - (function () { - var r = k( - regeneratorRuntime.mark(function r(i, a) { - var o; - return regeneratorRuntime.wrap(function (r) { - for (;;) - switch ((r.prev = r.next)) { - case 0: - return ( - (r.next = 2), - t.adapter - .get("".concat(t.namespace), e, n) - .then(t.afterFetch.bind(t)) - .catch(a) - ); - case 2: - (o = r.sent), i(o); - case 4: - case "end": - return r.stop(); - } - }, r); - }), - ); - return function (t, e) { - return r.apply(this, arguments); - }; - })(), - ) - ); - }, - }, - { - key: "destroy", - value: function (t) { - var e = this, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - r = tt(t) ? t.getAttribute("id") : t; - return new Promise( - (function () { - var t = k( - regeneratorRuntime.mark(function t(i, a) { - var o; - return regeneratorRuntime.wrap(function (t) { - for (;;) - switch ((t.prev = t.next)) { - case 0: - return ( - (t.next = 2), - e.adapter - .delete( - "".concat(e.namespace, "/").concat(r), - {}, - n, - ) - .then(e.afterFetch.bind(e)) - .catch(a) - ); - case 2: - (o = t.sent), i(o); - case 4: - case "end": - return t.stop(); - } - }, t); - }), - ); - return function (e, n) { - return t.apply(this, arguments); - }; - })(), - ); - }, - }, - ]), - t - ); - })(); -!(function () { - function t(e) { - var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; - if ( - (T(this, t), - (this.version = n.version || "v1"), - (this.options = { - version: this.version, - host: n.host || "https://api.fleetbase.io", - namespace: this.version || n.namespace, - debug: r, - publicKey: e, - }), - "string" != typeof e || 0 === e.length) - ) - throw new Error("⚠️ Invalid public key given to Fleetbase SDK"); - if (!et() && e.toLowerCase().startsWith("$")) - throw new Error( - "Secret key provided. You must use a public key with Fleetbase Javascript SDK!", - ); - (this.adapter = n.adapter || nt(this.options)), - (this.orders = new Ot("order", this.adapter).extendActions(ht)), - (this.entities = new Ot("entity", this.adapter)), - (this.places = new Ot("place", this.adapter)), - (this.drivers = new Ot("driver", this.adapter)), - (this.vehicles = new Ot("vehicle", this.adapter)), - (this.vendors = new Ot("vendor", this.adapter)), - (this.contacts = new Ot("contact", this.adapter)); - } - C( - t, - [ - { - key: "setAdapter", - value: function (t) { - this.adapter = t; - }, - }, - { - key: "getAdapter", - value: function () { - return this.adapter; - }, - }, - ], - [ - { - key: "newInstance", - value: function () { - return P(t, Array.prototype.slice.call(arguments)); - }, - }, - ], - ); -})(); -var St = (function (t) { - s(n, ct); - var e = v(n); - function n() { - return i(this, n), e.apply(this, arguments); - } - return ( - o(n, [ - { - key: "setAdapter", - value: function (t) { - var e; - return ( - (this.adapter = t), - (this.store = new Vn(this.resource, t, { - onAfterFetch: this.syncAttributes.bind(this), - actions: - null === (e = this.options) || void 0 === e - ? void 0 - : e.actions, - })), - this - ); - }, - }, - ]), - n - ); - })(), - Pt = new st({ - count: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - n = {}; - return ( - t && (n.store = t), - this.adapter.get("".concat(this.namespace, "/count"), n, e) - ); - }, - }), - Rt = (function (t) { - s(n, St); - var e = v(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return i(this, n), e.call(this, t, r, "review", a); - } - return ( - o(n, [ - { key: "getMedia", value: function () {} }, - { key: "getPhotos", value: function () {} }, - { key: "getVideos", value: function () {} }, - ]), - n - ); - })(), - Ut = function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return et() - ? Zn("adapter", "NodeAdapter", t) - : Zn("adapter", "BrowserAdapter", t); - }, - Mt = function () { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""; - return /^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(t); - }; -function jt() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, - e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "USD", - n = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "symbol"; - return new Intl.NumberFormat("en-US", { - style: "currency", - currency: e, - currencyDisplay: n, - }).format(t); -} -var qt = function (t) { - return ( - "string" == typeof t && - t.length > 30 && - (t.startsWith("store_") || t.startsWith("network_")) - ); - }, - $t = function (t) { - var e = null == t; - if (e) return e; - if ("number" == typeof t.size) return !t.size; - var n = r(t); - if ("object" === n) { - var i = t.size; - if ("number" == typeof i) return !i; - } - if ("number" == typeof t.length && "function" !== n) return !t.length; - if ("object" === n) { - var a = t.length; - if ("number" == typeof a) return !a; - } - return !1; - }, - Nt = (function (t) { - s(n, St); - var e = v(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return i(this, n), e.call(this, t, r, "product", a); - } - return ( - o(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, - n = t.sale_price, - r = t.currency; - return this.isOnSale - ? $t(n) || $t(r) - ? null - : jt(n / 100, r) - : $t(e) || $t(r) - ? null - : jt(e / 100, r); - }, - }, - { - key: "getReviews", - value: function () { - var t = this; - return this.adapter - .get("reviews", { store: this.id }) - .then(function (e) { - return new J( - e.map(function (e) { - return new Rt(e, t.adapter); - }), - ); - }); - }, - }, - ]), - n - ); - })(), - Ht = (function (t) { - s(n, St); - var e = v(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return i(this, n), e.call(this, t, r, "category", a); - } - return ( - o(n, [ - { - key: "getProducts", - value: function () { - var t = this; - return this.adapter - .get("products", { category: this.id }) - .then(function (e) { - return new J( - e.map(function (e) { - return new Nt(e, t.adapter); - }), - ); - }); - }, - }, - ]), - n - ); - })(), - Yt = new st({ - 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 (Mt(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); - }, - }), - Lt = (function (t) { - s(r, St); - var e = v(r); - function r() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - a = arguments.length > 1 ? arguments[1] : void 0, - o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return i(this, r), e.call(this, t, a, "customer", n({ actions: Yt }, o)); - } - return ( - o(r, [ - { - key: "setAdapter", - value: function (t) { - var e; - return ( - (this.adapter = t), - (this.store = new Vn(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: function (t) { - var e = this; - return this.adapter - .setHeaders({ "Customer-Token": this.token }) - .post("customers/register-device", t) - .then(function () { - return e; - }); - }, - }, - { - key: "getSavedPlaces", - value: function () { - var t = this; - return this.adapter - .setHeaders({ "Customer-Token": this.token }) - .get("customers/places") - .then(function (e) { - return new J( - e.map(function (e) { - return new ft(e, t.adapter); - }), - ); - }); - }, - }, - { - key: "getOrderHistory", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return this.adapter - .setHeaders({ "Customer-Token": this.token }) - .get("customers/orders", e) - .then(function (e) { - return new J( - e.map(function (e) { - return new lt(e, t.adapter); - }), - ); - }); - }, - }, - ]), - r - ); - })(), - Ft = Array.isArray, - _t = new st({ - 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, - i = 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({}, i), {}, { quantity: r }), - a, - ) - .then(this.afterFetch.bind(this)); - }, - update: function (t, e, r) { - var i = - 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({}, i), {}, { quantity: r }), - a, - ) - .then(this.afterFetch.bind(this)); - }, - remove: function (t, e) { - var n = - arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return this.adapter - .delete("".concat(this.namespace, "/").concat(t, "/").concat(e), {}, n) - .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); - }, - }), - Wt = (function (t) { - s(r, St); - var e = v(r); - function r() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - a = arguments.length > 1 ? arguments[1] : void 0, - o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return i(this, r), e.call(this, t, a, "cart", n({ actions: _t }, o)); - } - return ( - o(r, [ - { - key: "add", - value: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : 1, - n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}, - r = - arguments.length > 3 && void 0 !== arguments[3] - ? arguments[3] - : {}; - return ( - t instanceof Nt && (t = t.id), this.store.add(this.id, t, e, n, r) - ); - }, - }, - { - key: "update", - value: function (t, e) { - var n = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : {}, - r = - arguments.length > 3 && void 0 !== arguments[3] - ? arguments[3] - : {}; - return this.store.update(this.id, t, e, n, r); - }, - }, - { - 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 !Ft(t) || 0 === t.length; - }, - }, - { - key: "isNotEmpty", - get: function () { - return !this.isEmpty; - }, - }, - ]), - r - ); - })(); -function zt(t) { - if (null === t || !0 === t || !1 === t) return NaN; - var e = Number(t); - return isNaN(e) ? e : e < 0 ? Math.ceil(e) : Math.floor(e); -} -function It(t, e) { - if (e.length < t) - throw new TypeError( - t + - " argument" + - (t > 1 ? "s" : "") + - " required, but only " + - e.length + - " present", - ); -} -function Qt(t) { - It(1, arguments); - var e = Object.prototype.toString.call(t); - return t instanceof Date || ("object" == typeof t && "[object Date]" === e) - ? new Date(t.getTime()) - : "number" == typeof t || "[object Number]" === e - ? new Date(t) - : (("string" != typeof t && "[object String]" !== e) || - "undefined" == typeof console || - (console.warn( - "Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule", - ), - console.warn(new Error().stack)), - new Date(NaN)); -} -function Bt(t, e) { - It(2, arguments); - var n = Qt(t).getTime(), - r = zt(e); - return new Date(n + r); -} -function Gt(t) { - var 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 Xt(t) { - return ( - It(1, arguments), - t instanceof Date || - ("object" == typeof t && - "[object Date]" === Object.prototype.toString.call(t)) - ); -} -function Kt(t) { - if ((It(1, arguments), !Xt(t) && "number" != typeof t)) return !1; - var e = Qt(t); - return !isNaN(Number(e)); -} -var Jt = { - 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" }, - }, - Zt = function (t, e, n) { - var r, - i = Jt[t]; - return ( - (r = - "string" == typeof i - ? i - : 1 === e - ? i.one - : i.other.replace("{{count}}", e.toString())), - null != n && n.addSuffix - ? n.comparison && n.comparison > 0 - ? "in " + r - : r + " ago" - : r - ); - }; -function Vt(t) { - return function () { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - n = e.width ? String(e.width) : t.defaultWidth, - r = t.formats[n] || t.formats[t.defaultWidth]; - return r; - }; -} -var te = { - date: Vt({ - formats: { - full: "EEEE, MMMM do, y", - long: "MMMM do, y", - medium: "MMM d, y", - short: "MM/dd/yyyy", - }, - defaultWidth: "full", - }), - time: Vt({ - 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: Vt({ - formats: { - full: "{{date}} 'at' {{time}}", - long: "{{date}} 'at' {{time}}", - medium: "{{date}}, {{time}}", - short: "{{date}}, {{time}}", - }, - defaultWidth: "full", - }), - }, - ee = { - lastWeek: "'last' eeee 'at' p", - yesterday: "'yesterday at' p", - today: "'today at' p", - tomorrow: "'tomorrow at' p", - nextWeek: "eeee 'at' p", - other: "P", - }; -function ne(t) { - return function (e, n) { - var r, - i = n || {}; - if ( - "formatting" === (i.context ? String(i.context) : "standalone") && - t.formattingValues - ) { - var a = t.defaultFormattingWidth || t.defaultWidth, - o = i.width ? String(i.width) : a; - r = t.formattingValues[o] || t.formattingValues[a]; - } else { - var u = t.defaultWidth, - s = i.width ? String(i.width) : t.defaultWidth; - r = t.values[s] || t.values[u]; - } - return r[t.argumentCallback ? t.argumentCallback(e) : e]; - }; -} -function re(t) { - return function (e) { - var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - r = n.width, - i = (r && t.matchPatterns[r]) || t.matchPatterns[t.defaultMatchWidth], - a = e.match(i); - if (!a) return null; - var o, - u = a[0], - s = (r && t.parsePatterns[r]) || t.parsePatterns[t.defaultParseWidth], - c = Array.isArray(s) - ? ae(s, function (t) { - return t.test(u); - }) - : ie(s, function (t) { - return t.test(u); - }); - (o = t.valueCallback ? t.valueCallback(c) : c), - (o = n.valueCallback ? n.valueCallback(o) : o); - var h = e.slice(u.length); - return { value: o, rest: h }; - }; -} -function ie(t, e) { - for (var n in t) if (t.hasOwnProperty(n) && e(t[n])) return n; -} -function ae(t, e) { - for (var n = 0; n < t.length; n++) if (e(t[n])) return n; -} -var oe, - ue = { - code: "en-US", - formatDistance: Zt, - formatLong: te, - formatRelative: function (t, e, n, r) { - return ee[t]; - }, - localize: { - ordinalNumber: function (t, e) { - var n = Number(t), - r = n % 100; - if (r > 20 || r < 10) - switch (r % 10) { - case 1: - return n + "st"; - case 2: - return n + "nd"; - case 3: - return n + "rd"; - } - return n + "th"; - }, - era: ne({ - values: { - narrow: ["B", "A"], - abbreviated: ["BC", "AD"], - wide: ["Before Christ", "Anno Domini"], - }, - defaultWidth: "wide", - }), - quarter: ne({ - values: { - narrow: ["1", "2", "3", "4"], - abbreviated: ["Q1", "Q2", "Q3", "Q4"], - wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"], - }, - defaultWidth: "wide", - argumentCallback: function (t) { - return t - 1; - }, - }), - month: ne({ - 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: ne({ - 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: ne({ - 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: - ((oe = { - matchPattern: /^(\d+)(th|st|nd|rd)?/i, - parsePattern: /\d+/i, - valueCallback: function (t) { - return parseInt(t, 10); - }, - }), - function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : {}, - n = t.match(oe.matchPattern); - if (!n) return null; - var r = n[0], - i = t.match(oe.parsePattern); - if (!i) return null; - var a = oe.valueCallback ? oe.valueCallback(i[0]) : i[0]; - a = e.valueCallback ? e.valueCallback(a) : a; - var o = t.slice(r.length); - return { value: a, rest: o }; - }), - era: re({ - 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: re({ - 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: function (t) { - return t + 1; - }, - }), - month: re({ - 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: re({ - 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: re({ - 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 se(t, e) { - It(2, arguments); - var n = zt(e); - return Bt(t, -n); -} -function ce(t, e) { - for (var n = t < 0 ? "-" : "", r = Math.abs(t).toString(); r.length < e; ) - r = "0" + r; - return n + r; -} -var he = { - y: function (t, e) { - var n = t.getUTCFullYear(), - r = n > 0 ? n : 1 - n; - return ce("yy" === e ? r % 100 : r, e.length); - }, - M: function (t, e) { - var n = t.getUTCMonth(); - return "M" === e ? String(n + 1) : ce(n + 1, 2); - }, - d: function (t, e) { - return ce(t.getUTCDate(), e.length); - }, - a: function (t, e) { - var n = t.getUTCHours() / 12 >= 1 ? "pm" : "am"; - switch (e) { - case "a": - case "aa": - return n.toUpperCase(); - case "aaa": - return n; - case "aaaaa": - return n[0]; - default: - return "am" === n ? "a.m." : "p.m."; - } - }, - h: function (t, e) { - return ce(t.getUTCHours() % 12 || 12, e.length); - }, - H: function (t, e) { - return ce(t.getUTCHours(), e.length); - }, - m: function (t, e) { - return ce(t.getUTCMinutes(), e.length); - }, - s: function (t, e) { - return ce(t.getUTCSeconds(), e.length); - }, - S: function (t, e) { - var n = e.length, - r = t.getUTCMilliseconds(); - return ce(Math.floor(r * Math.pow(10, n - 3)), e.length); - }, -}; -function le(t) { - It(1, arguments); - var e = 1, - n = Qt(t), - r = n.getUTCDay(), - i = (r < e ? 7 : 0) + r - e; - return n.setUTCDate(n.getUTCDate() - i), n.setUTCHours(0, 0, 0, 0), n; -} -function de(t) { - It(1, arguments); - var e = Qt(t), - n = e.getUTCFullYear(), - r = new Date(0); - r.setUTCFullYear(n + 1, 0, 4), r.setUTCHours(0, 0, 0, 0); - var i = le(r), - a = new Date(0); - a.setUTCFullYear(n, 0, 4), a.setUTCHours(0, 0, 0, 0); - var o = le(a); - return e.getTime() >= i.getTime() - ? n + 1 - : e.getTime() >= o.getTime() - ? n - : n - 1; -} -function fe(t) { - It(1, arguments); - var e = de(t), - n = new Date(0); - n.setUTCFullYear(e, 0, 4), n.setUTCHours(0, 0, 0, 0); - var r = le(n); - return r; -} -function ve(t) { - It(1, arguments); - var e = Qt(t), - n = le(e).getTime() - fe(e).getTime(); - return Math.round(n / 6048e5) + 1; -} -function ge(t, e) { - It(1, arguments); - var n = e || {}, - r = n.locale, - i = r && r.options && r.options.weekStartsOn, - a = null == i ? 0 : zt(i), - o = null == n.weekStartsOn ? a : zt(n.weekStartsOn); - if (!(o >= 0 && o <= 6)) - throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); - var u = Qt(t), - s = u.getUTCDay(), - c = (s < o ? 7 : 0) + s - o; - return u.setUTCDate(u.getUTCDate() - c), u.setUTCHours(0, 0, 0, 0), u; -} -function pe(t, e) { - It(1, arguments); - var n = Qt(t, e), - r = n.getUTCFullYear(), - i = e || {}, - a = i.locale, - o = a && a.options && a.options.firstWeekContainsDate, - u = null == o ? 1 : zt(o), - s = null == i.firstWeekContainsDate ? u : zt(i.firstWeekContainsDate); - if (!(s >= 1 && s <= 7)) - throw new RangeError( - "firstWeekContainsDate must be between 1 and 7 inclusively", - ); - var c = new Date(0); - c.setUTCFullYear(r + 1, 0, s), c.setUTCHours(0, 0, 0, 0); - var h = ge(c, e), - l = new Date(0); - l.setUTCFullYear(r, 0, s), l.setUTCHours(0, 0, 0, 0); - var d = ge(l, e); - return n.getTime() >= h.getTime() - ? r + 1 - : n.getTime() >= d.getTime() - ? r - : r - 1; -} -function ye(t, e) { - It(1, arguments); - var n = e || {}, - r = n.locale, - i = r && r.options && r.options.firstWeekContainsDate, - a = null == i ? 1 : zt(i), - o = null == n.firstWeekContainsDate ? a : zt(n.firstWeekContainsDate), - u = pe(t, e), - s = new Date(0); - s.setUTCFullYear(u, 0, o), s.setUTCHours(0, 0, 0, 0); - var c = ge(s, e); - return c; -} -function me(t, e) { - It(1, arguments); - var n = Qt(t), - r = ge(n, e).getTime() - ye(n, e).getTime(); - return Math.round(r / 6048e5) + 1; -} -var we = "midnight", - be = "noon", - ke = "morning", - Te = "afternoon", - xe = "evening", - Ce = "night", - Ae = { - G: function (t, e, n) { - var r = t.getUTCFullYear() > 0 ? 1 : 0; - switch (e) { - case "G": - case "GG": - case "GGG": - return n.era(r, { width: "abbreviated" }); - case "GGGGG": - return n.era(r, { width: "narrow" }); - default: - return n.era(r, { width: "wide" }); - } - }, - y: function (t, e, n) { - if ("yo" === e) { - var r = t.getUTCFullYear(), - i = r > 0 ? r : 1 - r; - return n.ordinalNumber(i, { unit: "year" }); - } - return he.y(t, e); - }, - Y: function (t, e, n, r) { - var i = pe(t, r), - a = i > 0 ? i : 1 - i; - return "YY" === e - ? ce(a % 100, 2) - : "Yo" === e - ? n.ordinalNumber(a, { unit: "year" }) - : ce(a, e.length); - }, - R: function (t, e) { - return ce(de(t), e.length); - }, - u: function (t, e) { - return ce(t.getUTCFullYear(), e.length); - }, - Q: function (t, e, n) { - var r = Math.ceil((t.getUTCMonth() + 1) / 3); - switch (e) { - case "Q": - return String(r); - case "QQ": - return ce(r, 2); - case "Qo": - return n.ordinalNumber(r, { unit: "quarter" }); - case "QQQ": - return n.quarter(r, { width: "abbreviated", context: "formatting" }); - case "QQQQQ": - return n.quarter(r, { width: "narrow", context: "formatting" }); - default: - return n.quarter(r, { width: "wide", context: "formatting" }); - } - }, - q: function (t, e, n) { - var r = Math.ceil((t.getUTCMonth() + 1) / 3); - switch (e) { - case "q": - return String(r); - case "qq": - return ce(r, 2); - case "qo": - return n.ordinalNumber(r, { unit: "quarter" }); - case "qqq": - return n.quarter(r, { width: "abbreviated", context: "standalone" }); - case "qqqqq": - return n.quarter(r, { width: "narrow", context: "standalone" }); - default: - return n.quarter(r, { width: "wide", context: "standalone" }); - } - }, - M: function (t, e, n) { - var r = t.getUTCMonth(); - switch (e) { - case "M": - case "MM": - return he.M(t, e); - case "Mo": - return n.ordinalNumber(r + 1, { unit: "month" }); - case "MMM": - return n.month(r, { width: "abbreviated", context: "formatting" }); - case "MMMMM": - return n.month(r, { width: "narrow", context: "formatting" }); - default: - return n.month(r, { width: "wide", context: "formatting" }); - } - }, - L: function (t, e, n) { - var r = t.getUTCMonth(); - switch (e) { - case "L": - return String(r + 1); - case "LL": - return ce(r + 1, 2); - case "Lo": - return n.ordinalNumber(r + 1, { unit: "month" }); - case "LLL": - return n.month(r, { width: "abbreviated", context: "standalone" }); - case "LLLLL": - return n.month(r, { width: "narrow", context: "standalone" }); - default: - return n.month(r, { width: "wide", context: "standalone" }); - } - }, - w: function (t, e, n, r) { - var i = me(t, r); - return "wo" === e - ? n.ordinalNumber(i, { unit: "week" }) - : ce(i, e.length); - }, - I: function (t, e, n) { - var r = ve(t); - return "Io" === e - ? n.ordinalNumber(r, { unit: "week" }) - : ce(r, e.length); - }, - d: function (t, e, n) { - return "do" === e - ? n.ordinalNumber(t.getUTCDate(), { unit: "date" }) - : he.d(t, e); - }, - D: function (t, e, n) { - var r = (function (t) { - It(1, arguments); - var e = Qt(t), - n = e.getTime(); - e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0); - var r = e.getTime(), - i = n - r; - return Math.floor(i / 864e5) + 1; - })(t); - return "Do" === e - ? n.ordinalNumber(r, { unit: "dayOfYear" }) - : ce(r, e.length); - }, - E: function (t, e, n) { - var r = t.getUTCDay(); - switch (e) { - case "E": - case "EE": - case "EEE": - return n.day(r, { width: "abbreviated", context: "formatting" }); - case "EEEEE": - return n.day(r, { width: "narrow", context: "formatting" }); - case "EEEEEE": - return n.day(r, { width: "short", context: "formatting" }); - default: - return n.day(r, { width: "wide", context: "formatting" }); - } - }, - e: function (t, e, n, r) { - var i = t.getUTCDay(), - a = (i - r.weekStartsOn + 8) % 7 || 7; - switch (e) { - case "e": - return String(a); - case "ee": - return ce(a, 2); - case "eo": - return n.ordinalNumber(a, { unit: "day" }); - case "eee": - return n.day(i, { width: "abbreviated", context: "formatting" }); - case "eeeee": - return n.day(i, { width: "narrow", context: "formatting" }); - case "eeeeee": - return n.day(i, { width: "short", context: "formatting" }); - default: - return n.day(i, { width: "wide", context: "formatting" }); - } - }, - c: function (t, e, n, r) { - var i = t.getUTCDay(), - a = (i - r.weekStartsOn + 8) % 7 || 7; - switch (e) { - case "c": - return String(a); - case "cc": - return ce(a, e.length); - case "co": - return n.ordinalNumber(a, { unit: "day" }); - case "ccc": - return n.day(i, { width: "abbreviated", context: "standalone" }); - case "ccccc": - return n.day(i, { width: "narrow", context: "standalone" }); - case "cccccc": - return n.day(i, { width: "short", context: "standalone" }); - default: - return n.day(i, { width: "wide", context: "standalone" }); - } - }, - i: function (t, e, n) { - var r = t.getUTCDay(), - i = 0 === r ? 7 : r; - switch (e) { - case "i": - return String(i); - case "ii": - return ce(i, e.length); - case "io": - return n.ordinalNumber(i, { unit: "day" }); - case "iii": - return n.day(r, { width: "abbreviated", context: "formatting" }); - case "iiiii": - return n.day(r, { width: "narrow", context: "formatting" }); - case "iiiiii": - return n.day(r, { width: "short", context: "formatting" }); - default: - return n.day(r, { width: "wide", context: "formatting" }); - } - }, - a: function (t, e, n) { - var r = t.getUTCHours() / 12 >= 1 ? "pm" : "am"; - switch (e) { - case "a": - case "aa": - return n.dayPeriod(r, { - width: "abbreviated", - context: "formatting", - }); - case "aaa": - return n - .dayPeriod(r, { width: "abbreviated", context: "formatting" }) - .toLowerCase(); - case "aaaaa": - return n.dayPeriod(r, { width: "narrow", context: "formatting" }); - default: - return n.dayPeriod(r, { width: "wide", context: "formatting" }); - } - }, - b: function (t, e, n) { - var r, - i = t.getUTCHours(); - switch ( - ((r = 12 === i ? be : 0 === i ? we : i / 12 >= 1 ? "pm" : "am"), e) - ) { - case "b": - case "bb": - return n.dayPeriod(r, { - width: "abbreviated", - context: "formatting", - }); - case "bbb": - return n - .dayPeriod(r, { width: "abbreviated", context: "formatting" }) - .toLowerCase(); - case "bbbbb": - return n.dayPeriod(r, { width: "narrow", context: "formatting" }); - default: - return n.dayPeriod(r, { width: "wide", context: "formatting" }); - } - }, - B: function (t, e, n) { - var r, - i = t.getUTCHours(); - switch (((r = i >= 17 ? xe : i >= 12 ? Te : i >= 4 ? ke : Ce), e)) { - case "B": - case "BB": - case "BBB": - return n.dayPeriod(r, { - width: "abbreviated", - context: "formatting", - }); - case "BBBBB": - return n.dayPeriod(r, { width: "narrow", context: "formatting" }); - default: - return n.dayPeriod(r, { width: "wide", context: "formatting" }); - } - }, - h: function (t, e, n) { - if ("ho" === e) { - var r = t.getUTCHours() % 12; - return 0 === r && (r = 12), n.ordinalNumber(r, { unit: "hour" }); - } - return he.h(t, e); - }, - H: function (t, e, n) { - return "Ho" === e - ? n.ordinalNumber(t.getUTCHours(), { unit: "hour" }) - : he.H(t, e); - }, - K: function (t, e, n) { - var r = t.getUTCHours() % 12; - return "Ko" === e - ? n.ordinalNumber(r, { unit: "hour" }) - : ce(r, e.length); - }, - k: function (t, e, n) { - var r = t.getUTCHours(); - return ( - 0 === r && (r = 24), - "ko" === e ? n.ordinalNumber(r, { unit: "hour" }) : ce(r, e.length) - ); - }, - m: function (t, e, n) { - return "mo" === e - ? n.ordinalNumber(t.getUTCMinutes(), { unit: "minute" }) - : he.m(t, e); - }, - s: function (t, e, n) { - return "so" === e - ? n.ordinalNumber(t.getUTCSeconds(), { unit: "second" }) - : he.s(t, e); - }, - S: function (t, e) { - return he.S(t, e); - }, - X: function (t, e, n, r) { - var i = (r._originalDate || t).getTimezoneOffset(); - if (0 === i) return "Z"; - switch (e) { - case "X": - return De(i); - case "XXXX": - case "XX": - return Oe(i); - default: - return Oe(i, ":"); - } - }, - x: function (t, e, n, r) { - var i = (r._originalDate || t).getTimezoneOffset(); - switch (e) { - case "x": - return De(i); - case "xxxx": - case "xx": - return Oe(i); - default: - return Oe(i, ":"); - } - }, - O: function (t, e, n, r) { - var i = (r._originalDate || t).getTimezoneOffset(); - switch (e) { - case "O": - case "OO": - case "OOO": - return "GMT" + Ee(i, ":"); - default: - return "GMT" + Oe(i, ":"); - } - }, - z: function (t, e, n, r) { - var i = (r._originalDate || t).getTimezoneOffset(); - switch (e) { - case "z": - case "zz": - case "zzz": - return "GMT" + Ee(i, ":"); - default: - return "GMT" + Oe(i, ":"); - } - }, - t: function (t, e, n, r) { - var i = r._originalDate || t; - return ce(Math.floor(i.getTime() / 1e3), e.length); - }, - T: function (t, e, n, r) { - return ce((r._originalDate || t).getTime(), e.length); - }, - }; -function Ee(t, e) { - var n = t > 0 ? "-" : "+", - r = Math.abs(t), - i = Math.floor(r / 60), - a = r % 60; - if (0 === a) return n + String(i); - var o = e || ""; - return n + String(i) + o + ce(a, 2); -} -function De(t, e) { - return t % 60 == 0 ? (t > 0 ? "-" : "+") + ce(Math.abs(t) / 60, 2) : Oe(t, e); -} -function Oe(t, e) { - var n = e || "", - r = t > 0 ? "-" : "+", - i = Math.abs(t); - return r + ce(Math.floor(i / 60), 2) + n + ce(i % 60, 2); -} -var Se = Ae; -function Pe(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" }); - } -} -function Re(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" }); - } -} -var Ue = { - p: Re, - P: function (t, e) { - var n, - r = t.match(/(P+)(p+)?/), - i = r[1], - a = r[2]; - if (!a) return Pe(t, e); - switch (i) { - case "P": - n = e.dateTime({ width: "short" }); - break; - case "PP": - n = e.dateTime({ width: "medium" }); - break; - case "PPP": - n = e.dateTime({ width: "long" }); - break; - default: - n = e.dateTime({ width: "full" }); - } - return n.replace("{{date}}", Pe(i, e)).replace("{{time}}", Re(a, e)); - }, - }, - Me = Ue, - je = ["D", "DD"], - qe = ["YY", "YYYY"]; -function $e(t) { - return -1 !== je.indexOf(t); -} -function Ne(t) { - return -1 !== qe.indexOf(t); -} -function He(t, e, n) { - if ("YYYY" === t) - throw new RangeError( - "Use `yyyy` instead of `YYYY` (in `" - .concat(e, "`) for formatting years to the input `") - .concat(n, "`; see: https://git.io/fxCyr"), - ); - if ("YY" === t) - throw new RangeError( - "Use `yy` instead of `YY` (in `" - .concat(e, "`) for formatting years to the input `") - .concat(n, "`; see: https://git.io/fxCyr"), - ); - if ("D" === t) - throw new RangeError( - "Use `d` instead of `D` (in `" - .concat(e, "`) for formatting days of the month to the input `") - .concat(n, "`; see: https://git.io/fxCyr"), - ); - if ("DD" === t) - throw new RangeError( - "Use `dd` instead of `DD` (in `" - .concat(e, "`) for formatting days of the month to the input `") - .concat(n, "`; see: https://git.io/fxCyr"), - ); -} -var Ye = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, - Le = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, - Fe = /^'([^]*?)'?$/, - _e = /''/g, - We = /[a-zA-Z]/; -function ze(t, e, n) { - It(2, arguments); - var r = String(e), - i = n || {}, - a = i.locale || ue, - o = a.options && a.options.firstWeekContainsDate, - u = null == o ? 1 : zt(o), - s = null == i.firstWeekContainsDate ? u : zt(i.firstWeekContainsDate); - if (!(s >= 1 && s <= 7)) - throw new RangeError( - "firstWeekContainsDate must be between 1 and 7 inclusively", - ); - var c = a.options && a.options.weekStartsOn, - h = null == c ? 0 : zt(c), - l = null == i.weekStartsOn ? h : zt(i.weekStartsOn); - if (!(l >= 0 && l <= 6)) - throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); - if (!a.localize) - throw new RangeError("locale must contain localize property"); - if (!a.formatLong) - throw new RangeError("locale must contain formatLong property"); - var d = Qt(t); - if (!Kt(d)) throw new RangeError("Invalid time value"); - var f = Gt(d), - v = se(d, f), - g = { - firstWeekContainsDate: s, - weekStartsOn: l, - locale: a, - _originalDate: d, - }, - p = r - .match(Le) - .map(function (t) { - var e = t[0]; - return "p" === e || "P" === e ? (0, Me[e])(t, a.formatLong, g) : t; - }) - .join("") - .match(Ye) - .map(function (n) { - if ("''" === n) return "'"; - var r = n[0]; - if ("'" === r) return Ie(n); - var o = Se[r]; - if (o) - return ( - !i.useAdditionalWeekYearTokens && Ne(n) && He(n, e, t), - !i.useAdditionalDayOfYearTokens && $e(n) && He(n, e, t), - o(v, n, a.localize, g) - ); - if (r.match(We)) - throw new RangeError( - "Format string contains an unescaped latin alphabet character `" + - r + - "`", - ); - return n; - }) - .join(""); - return p; -} -function Ie(t) { - return t.match(Fe)[1].replace(_e, "'"); -} -function Qe(t, e) { - if (null == t) - throw new TypeError( - "assign requires that input parameter not be null or undefined", - ); - for (var n in (e = e || {})) - Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); - return t; -} -function Be(t, e, n) { - It(2, arguments); - var r = n || {}, - i = r.locale, - a = i && i.options && i.options.weekStartsOn, - o = null == a ? 0 : zt(a), - u = null == r.weekStartsOn ? o : zt(r.weekStartsOn); - if (!(u >= 0 && u <= 6)) - throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); - var s = Qt(t), - c = zt(e), - h = s.getUTCDay(), - l = c % 7, - d = (l + 7) % 7, - f = (d < u ? 7 : 0) + c - h; - return s.setUTCDate(s.getUTCDate() + f), s; -} -var Ge = /^(1[0-2]|0?\d)/, - Xe = /^(3[0-1]|[0-2]?\d)/, - Ke = /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, - Je = /^(5[0-3]|[0-4]?\d)/, - Ze = /^(2[0-3]|[0-1]?\d)/, - Ve = /^(2[0-4]|[0-1]?\d)/, - tn = /^(1[0-1]|0?\d)/, - en = /^(1[0-2]|0?\d)/, - nn = /^[0-5]?\d/, - rn = /^[0-5]?\d/, - an = /^\d/, - on = /^\d{1,2}/, - un = /^\d{1,3}/, - sn = /^\d{1,4}/, - cn = /^-?\d+/, - hn = /^-?\d/, - ln = /^-?\d{1,2}/, - dn = /^-?\d{1,3}/, - fn = /^-?\d{1,4}/, - vn = /^([+-])(\d{2})(\d{2})?|Z/, - gn = /^([+-])(\d{2})(\d{2})|Z/, - pn = /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, - yn = /^([+-])(\d{2}):(\d{2})|Z/, - mn = /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/; -function wn(t, e, n) { - var r = e.match(t); - if (!r) return null; - var i = parseInt(r[0], 10); - return { value: n ? n(i) : i, rest: e.slice(r[0].length) }; -} -function bn(t, e) { - var n = e.match(t); - return n - ? "Z" === n[0] - ? { value: 0, rest: e.slice(1) } - : { - value: - ("+" === n[1] ? 1 : -1) * - (36e5 * (n[2] ? parseInt(n[2], 10) : 0) + - 6e4 * (n[3] ? parseInt(n[3], 10) : 0) + - 1e3 * (n[5] ? parseInt(n[5], 10) : 0)), - rest: e.slice(n[0].length), - } - : null; -} -function kn(t, e) { - return wn(cn, t, e); -} -function Tn(t, e, n) { - switch (t) { - case 1: - return wn(an, e, n); - case 2: - return wn(on, e, n); - case 3: - return wn(un, e, n); - case 4: - return wn(sn, e, n); - default: - return wn(new RegExp("^\\d{1," + t + "}"), e, n); - } -} -function xn(t, e, n) { - switch (t) { - case 1: - return wn(hn, e, n); - case 2: - return wn(ln, e, n); - case 3: - return wn(dn, e, n); - case 4: - return wn(fn, e, n); - default: - return wn(new RegExp("^-?\\d{1," + t + "}"), e, n); - } -} -function Cn(t) { - switch (t) { - case "morning": - return 4; - case "evening": - return 17; - case "pm": - case "noon": - case "afternoon": - return 12; - default: - return 0; - } -} -function An(t, e) { - var n, - r = e > 0, - i = r ? e : 1 - e; - if (i <= 50) n = t || 100; - else { - var a = i + 50; - n = t + 100 * Math.floor(a / 100) - (t >= a % 100 ? 100 : 0); - } - return r ? n : 1 - n; -} -var En = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], - Dn = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; -function On(t) { - return t % 400 == 0 || (t % 4 == 0 && t % 100 != 0); -} -var Sn = { - G: { - priority: 140, - parse: function (t, e, n, r) { - switch (e) { - case "G": - case "GG": - case "GGG": - return ( - n.era(t, { width: "abbreviated" }) || - n.era(t, { width: "narrow" }) - ); - case "GGGGG": - return n.era(t, { width: "narrow" }); - default: - return ( - n.era(t, { width: "wide" }) || - n.era(t, { width: "abbreviated" }) || - n.era(t, { width: "narrow" }) - ); - } - }, - set: function (t, e, n, r) { - return ( - (e.era = n), t.setUTCFullYear(n, 0, 1), t.setUTCHours(0, 0, 0, 0), t - ); - }, - incompatibleTokens: ["R", "u", "t", "T"], - }, - y: { - priority: 130, - parse: function (t, e, n, r) { - var i = function (t) { - return { year: t, isTwoDigitYear: "yy" === e }; - }; - switch (e) { - case "y": - return Tn(4, t, i); - case "yo": - return n.ordinalNumber(t, { unit: "year", valueCallback: i }); - default: - return Tn(e.length, t, i); - } - }, - validate: function (t, e, n) { - return e.isTwoDigitYear || e.year > 0; - }, - set: function (t, e, n, r) { - var i = t.getUTCFullYear(); - if (n.isTwoDigitYear) { - var a = An(n.year, i); - return t.setUTCFullYear(a, 0, 1), t.setUTCHours(0, 0, 0, 0), t; - } - var o = "era" in e && 1 !== e.era ? 1 - n.year : n.year; - return t.setUTCFullYear(o, 0, 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"], - }, - Y: { - priority: 130, - parse: function (t, e, n, r) { - var i = function (t) { - return { year: t, isTwoDigitYear: "YY" === e }; - }; - switch (e) { - case "Y": - return Tn(4, t, i); - case "Yo": - return n.ordinalNumber(t, { unit: "year", valueCallback: i }); - default: - return Tn(e.length, t, i); - } - }, - validate: function (t, e, n) { - return e.isTwoDigitYear || e.year > 0; - }, - set: function (t, e, n, r) { - var i = pe(t, r); - if (n.isTwoDigitYear) { - var a = An(n.year, i); - return ( - t.setUTCFullYear(a, 0, r.firstWeekContainsDate), - t.setUTCHours(0, 0, 0, 0), - ge(t, r) - ); - } - var o = "era" in e && 1 !== e.era ? 1 - n.year : n.year; - return ( - t.setUTCFullYear(o, 0, r.firstWeekContainsDate), - t.setUTCHours(0, 0, 0, 0), - ge(t, r) - ); - }, - incompatibleTokens: [ - "y", - "R", - "u", - "Q", - "q", - "M", - "L", - "I", - "d", - "D", - "i", - "t", - "T", - ], - }, - R: { - priority: 130, - parse: function (t, e, n, r) { - return xn("R" === e ? 4 : e.length, t); - }, - set: function (t, e, n, r) { - var i = new Date(0); - return i.setUTCFullYear(n, 0, 4), i.setUTCHours(0, 0, 0, 0), le(i); - }, - incompatibleTokens: [ - "G", - "y", - "Y", - "u", - "Q", - "q", - "M", - "L", - "w", - "d", - "D", - "e", - "c", - "t", - "T", - ], - }, - u: { - priority: 130, - parse: function (t, e, n, r) { - return xn("u" === e ? 4 : e.length, t); - }, - set: function (t, e, n, r) { - return t.setUTCFullYear(n, 0, 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "G", - "y", - "Y", - "R", - "w", - "I", - "i", - "e", - "c", - "t", - "T", - ], - }, - Q: { - priority: 120, - parse: function (t, e, n, r) { - switch (e) { - case "Q": - case "QQ": - return Tn(e.length, t); - case "Qo": - return n.ordinalNumber(t, { unit: "quarter" }); - case "QQQ": - return ( - n.quarter(t, { width: "abbreviated", context: "formatting" }) || - n.quarter(t, { width: "narrow", context: "formatting" }) - ); - case "QQQQQ": - return n.quarter(t, { width: "narrow", context: "formatting" }); - default: - return ( - n.quarter(t, { width: "wide", context: "formatting" }) || - n.quarter(t, { width: "abbreviated", context: "formatting" }) || - n.quarter(t, { width: "narrow", context: "formatting" }) - ); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 4; - }, - set: function (t, e, n, r) { - return t.setUTCMonth(3 * (n - 1), 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "Y", - "R", - "q", - "M", - "L", - "w", - "I", - "d", - "D", - "i", - "e", - "c", - "t", - "T", - ], - }, - q: { - priority: 120, - parse: function (t, e, n, r) { - switch (e) { - case "q": - case "qq": - return Tn(e.length, t); - case "qo": - return n.ordinalNumber(t, { unit: "quarter" }); - case "qqq": - return ( - n.quarter(t, { width: "abbreviated", context: "standalone" }) || - n.quarter(t, { width: "narrow", context: "standalone" }) - ); - case "qqqqq": - return n.quarter(t, { width: "narrow", context: "standalone" }); - default: - return ( - n.quarter(t, { width: "wide", context: "standalone" }) || - n.quarter(t, { width: "abbreviated", context: "standalone" }) || - n.quarter(t, { width: "narrow", context: "standalone" }) - ); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 4; - }, - set: function (t, e, n, r) { - return t.setUTCMonth(3 * (n - 1), 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "Y", - "R", - "Q", - "M", - "L", - "w", - "I", - "d", - "D", - "i", - "e", - "c", - "t", - "T", - ], - }, - M: { - priority: 110, - parse: function (t, e, n, r) { - var i = function (t) { - return t - 1; - }; - switch (e) { - case "M": - return wn(Ge, t, i); - case "MM": - return Tn(2, t, i); - case "Mo": - return n.ordinalNumber(t, { unit: "month", valueCallback: i }); - case "MMM": - return ( - n.month(t, { width: "abbreviated", context: "formatting" }) || - n.month(t, { width: "narrow", context: "formatting" }) - ); - case "MMMMM": - return n.month(t, { width: "narrow", context: "formatting" }); - default: - return ( - n.month(t, { width: "wide", context: "formatting" }) || - n.month(t, { width: "abbreviated", context: "formatting" }) || - n.month(t, { width: "narrow", context: "formatting" }) - ); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 11; - }, - set: function (t, e, n, r) { - return t.setUTCMonth(n, 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "Y", - "R", - "q", - "Q", - "L", - "w", - "I", - "D", - "i", - "e", - "c", - "t", - "T", - ], - }, - L: { - priority: 110, - parse: function (t, e, n, r) { - var i = function (t) { - return t - 1; - }; - switch (e) { - case "L": - return wn(Ge, t, i); - case "LL": - return Tn(2, t, i); - case "Lo": - return n.ordinalNumber(t, { unit: "month", valueCallback: i }); - case "LLL": - return ( - n.month(t, { width: "abbreviated", context: "standalone" }) || - n.month(t, { width: "narrow", context: "standalone" }) - ); - case "LLLLL": - return n.month(t, { width: "narrow", context: "standalone" }); - default: - return ( - n.month(t, { width: "wide", context: "standalone" }) || - n.month(t, { width: "abbreviated", context: "standalone" }) || - n.month(t, { width: "narrow", context: "standalone" }) - ); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 11; - }, - set: function (t, e, n, r) { - return t.setUTCMonth(n, 1), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "Y", - "R", - "q", - "Q", - "M", - "w", - "I", - "D", - "i", - "e", - "c", - "t", - "T", - ], - }, - w: { - priority: 100, - parse: function (t, e, n, r) { - switch (e) { - case "w": - return wn(Je, t); - case "wo": - return n.ordinalNumber(t, { unit: "week" }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 53; - }, - set: function (t, e, n, r) { - return ge( - (function (t, e, n) { - It(2, arguments); - var r = Qt(t), - i = zt(e), - a = me(r, n) - i; - return r.setUTCDate(r.getUTCDate() - 7 * a), r; - })(t, n, r), - r, - ); - }, - incompatibleTokens: [ - "y", - "R", - "u", - "q", - "Q", - "M", - "L", - "I", - "d", - "D", - "i", - "t", - "T", - ], - }, - I: { - priority: 100, - parse: function (t, e, n, r) { - switch (e) { - case "I": - return wn(Je, t); - case "Io": - return n.ordinalNumber(t, { unit: "week" }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 53; - }, - set: function (t, e, n, r) { - return le( - (function (t, e) { - It(2, arguments); - var n = Qt(t), - r = zt(e), - i = ve(n) - r; - return n.setUTCDate(n.getUTCDate() - 7 * i), n; - })(t, n, r), - r, - ); - }, - incompatibleTokens: [ - "y", - "Y", - "u", - "q", - "Q", - "M", - "L", - "w", - "d", - "D", - "e", - "c", - "t", - "T", - ], - }, - d: { - priority: 90, - subPriority: 1, - parse: function (t, e, n, r) { - switch (e) { - case "d": - return wn(Xe, t); - case "do": - return n.ordinalNumber(t, { unit: "date" }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - var r = On(t.getUTCFullYear()), - i = t.getUTCMonth(); - return r ? e >= 1 && e <= Dn[i] : e >= 1 && e <= En[i]; - }, - set: function (t, e, n, r) { - return t.setUTCDate(n), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "Y", - "R", - "q", - "Q", - "w", - "I", - "D", - "i", - "e", - "c", - "t", - "T", - ], - }, - D: { - priority: 90, - subPriority: 1, - parse: function (t, e, n, r) { - switch (e) { - case "D": - case "DD": - return wn(Ke, t); - case "Do": - return n.ordinalNumber(t, { unit: "date" }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return On(t.getUTCFullYear()) ? e >= 1 && e <= 366 : e >= 1 && e <= 365; - }, - set: function (t, e, n, r) { - return t.setUTCMonth(0, n), t.setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "Y", - "R", - "q", - "Q", - "M", - "L", - "w", - "I", - "d", - "E", - "i", - "e", - "c", - "t", - "T", - ], - }, - E: { - priority: 90, - parse: function (t, e, n, r) { - switch (e) { - case "E": - case "EE": - case "EEE": - return ( - n.day(t, { width: "abbreviated", context: "formatting" }) || - n.day(t, { width: "short", context: "formatting" }) || - n.day(t, { width: "narrow", context: "formatting" }) - ); - case "EEEEE": - return n.day(t, { width: "narrow", context: "formatting" }); - case "EEEEEE": - return ( - n.day(t, { width: "short", context: "formatting" }) || - n.day(t, { width: "narrow", context: "formatting" }) - ); - default: - return ( - n.day(t, { width: "wide", context: "formatting" }) || - n.day(t, { width: "abbreviated", context: "formatting" }) || - n.day(t, { width: "short", context: "formatting" }) || - n.day(t, { width: "narrow", context: "formatting" }) - ); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 6; - }, - set: function (t, e, n, r) { - return (t = Be(t, n, r)).setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: ["D", "i", "e", "c", "t", "T"], - }, - e: { - priority: 90, - parse: function (t, e, n, r) { - var i = function (t) { - var e = 7 * Math.floor((t - 1) / 7); - return ((t + r.weekStartsOn + 6) % 7) + e; - }; - switch (e) { - case "e": - case "ee": - return Tn(e.length, t, i); - case "eo": - return n.ordinalNumber(t, { unit: "day", valueCallback: i }); - case "eee": - return ( - n.day(t, { width: "abbreviated", context: "formatting" }) || - n.day(t, { width: "short", context: "formatting" }) || - n.day(t, { width: "narrow", context: "formatting" }) - ); - case "eeeee": - return n.day(t, { width: "narrow", context: "formatting" }); - case "eeeeee": - return ( - n.day(t, { width: "short", context: "formatting" }) || - n.day(t, { width: "narrow", context: "formatting" }) - ); - default: - return ( - n.day(t, { width: "wide", context: "formatting" }) || - n.day(t, { width: "abbreviated", context: "formatting" }) || - n.day(t, { width: "short", context: "formatting" }) || - n.day(t, { width: "narrow", context: "formatting" }) - ); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 6; - }, - set: function (t, e, n, r) { - return (t = Be(t, n, r)).setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "y", - "R", - "u", - "q", - "Q", - "M", - "L", - "I", - "d", - "D", - "E", - "i", - "c", - "t", - "T", - ], - }, - c: { - priority: 90, - parse: function (t, e, n, r) { - var i = function (t) { - var e = 7 * Math.floor((t - 1) / 7); - return ((t + r.weekStartsOn + 6) % 7) + e; - }; - switch (e) { - case "c": - case "cc": - return Tn(e.length, t, i); - case "co": - return n.ordinalNumber(t, { unit: "day", valueCallback: i }); - case "ccc": - return ( - n.day(t, { width: "abbreviated", context: "standalone" }) || - n.day(t, { width: "short", context: "standalone" }) || - n.day(t, { width: "narrow", context: "standalone" }) - ); - case "ccccc": - return n.day(t, { width: "narrow", context: "standalone" }); - case "cccccc": - return ( - n.day(t, { width: "short", context: "standalone" }) || - n.day(t, { width: "narrow", context: "standalone" }) - ); - default: - return ( - n.day(t, { width: "wide", context: "standalone" }) || - n.day(t, { width: "abbreviated", context: "standalone" }) || - n.day(t, { width: "short", context: "standalone" }) || - n.day(t, { width: "narrow", context: "standalone" }) - ); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 6; - }, - set: function (t, e, n, r) { - return (t = Be(t, n, r)).setUTCHours(0, 0, 0, 0), t; - }, - incompatibleTokens: [ - "y", - "R", - "u", - "q", - "Q", - "M", - "L", - "I", - "d", - "D", - "E", - "i", - "e", - "t", - "T", - ], - }, - i: { - priority: 90, - parse: function (t, e, n, r) { - var i = function (t) { - return 0 === t ? 7 : t; - }; - switch (e) { - case "i": - case "ii": - return Tn(e.length, t); - case "io": - return n.ordinalNumber(t, { unit: "day" }); - case "iii": - return ( - n.day(t, { - width: "abbreviated", - context: "formatting", - valueCallback: i, - }) || - n.day(t, { - width: "short", - context: "formatting", - valueCallback: i, - }) || - n.day(t, { - width: "narrow", - context: "formatting", - valueCallback: i, - }) - ); - case "iiiii": - return n.day(t, { - width: "narrow", - context: "formatting", - valueCallback: i, - }); - case "iiiiii": - return ( - n.day(t, { - width: "short", - context: "formatting", - valueCallback: i, - }) || - n.day(t, { - width: "narrow", - context: "formatting", - valueCallback: i, - }) - ); - default: - return ( - n.day(t, { - width: "wide", - context: "formatting", - valueCallback: i, - }) || - n.day(t, { - width: "abbreviated", - context: "formatting", - valueCallback: i, - }) || - n.day(t, { - width: "short", - context: "formatting", - valueCallback: i, - }) || - n.day(t, { - width: "narrow", - context: "formatting", - valueCallback: i, - }) - ); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 7; - }, - set: function (t, e, n, r) { - return ( - (t = (function (t, e) { - It(2, arguments); - var n = zt(e); - n % 7 == 0 && (n -= 7); - var r = 1, - i = Qt(t), - a = i.getUTCDay(), - o = (((n % 7) + 7) % 7 < r ? 7 : 0) + n - a; - return i.setUTCDate(i.getUTCDate() + o), i; - })(t, n, r)), - t.setUTCHours(0, 0, 0, 0), - t - ); - }, - incompatibleTokens: [ - "y", - "Y", - "u", - "q", - "Q", - "M", - "L", - "w", - "d", - "D", - "E", - "e", - "c", - "t", - "T", - ], - }, - a: { - priority: 80, - parse: function (t, e, n, r) { - switch (e) { - case "a": - case "aa": - case "aaa": - return ( - n.dayPeriod(t, { width: "abbreviated", context: "formatting" }) || - n.dayPeriod(t, { width: "narrow", context: "formatting" }) - ); - case "aaaaa": - return n.dayPeriod(t, { width: "narrow", context: "formatting" }); - default: - return ( - n.dayPeriod(t, { width: "wide", context: "formatting" }) || - n.dayPeriod(t, { width: "abbreviated", context: "formatting" }) || - n.dayPeriod(t, { width: "narrow", context: "formatting" }) - ); - } - }, - set: function (t, e, n, r) { - return t.setUTCHours(Cn(n), 0, 0, 0), t; - }, - incompatibleTokens: ["b", "B", "H", "K", "k", "t", "T"], - }, - b: { - priority: 80, - parse: function (t, e, n, r) { - switch (e) { - case "b": - case "bb": - case "bbb": - return ( - n.dayPeriod(t, { width: "abbreviated", context: "formatting" }) || - n.dayPeriod(t, { width: "narrow", context: "formatting" }) - ); - case "bbbbb": - return n.dayPeriod(t, { width: "narrow", context: "formatting" }); - default: - return ( - n.dayPeriod(t, { width: "wide", context: "formatting" }) || - n.dayPeriod(t, { width: "abbreviated", context: "formatting" }) || - n.dayPeriod(t, { width: "narrow", context: "formatting" }) - ); - } - }, - set: function (t, e, n, r) { - return t.setUTCHours(Cn(n), 0, 0, 0), t; - }, - incompatibleTokens: ["a", "B", "H", "K", "k", "t", "T"], - }, - B: { - priority: 80, - parse: function (t, e, n, r) { - switch (e) { - case "B": - case "BB": - case "BBB": - return ( - n.dayPeriod(t, { width: "abbreviated", context: "formatting" }) || - n.dayPeriod(t, { width: "narrow", context: "formatting" }) - ); - case "BBBBB": - return n.dayPeriod(t, { width: "narrow", context: "formatting" }); - default: - return ( - n.dayPeriod(t, { width: "wide", context: "formatting" }) || - n.dayPeriod(t, { width: "abbreviated", context: "formatting" }) || - n.dayPeriod(t, { width: "narrow", context: "formatting" }) - ); - } - }, - set: function (t, e, n, r) { - return t.setUTCHours(Cn(n), 0, 0, 0), t; - }, - incompatibleTokens: ["a", "b", "t", "T"], - }, - h: { - priority: 70, - parse: function (t, e, n, r) { - switch (e) { - case "h": - return wn(en, t); - case "ho": - return n.ordinalNumber(t, { unit: "hour" }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 12; - }, - set: function (t, e, n, r) { - var i = t.getUTCHours() >= 12; - return ( - i && n < 12 - ? t.setUTCHours(n + 12, 0, 0, 0) - : i || 12 !== n - ? t.setUTCHours(n, 0, 0, 0) - : t.setUTCHours(0, 0, 0, 0), - t - ); - }, - incompatibleTokens: ["H", "K", "k", "t", "T"], - }, - H: { - priority: 70, - parse: function (t, e, n, r) { - switch (e) { - case "H": - return wn(Ze, t); - case "Ho": - return n.ordinalNumber(t, { unit: "hour" }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 23; - }, - set: function (t, e, n, r) { - return t.setUTCHours(n, 0, 0, 0), t; - }, - incompatibleTokens: ["a", "b", "h", "K", "k", "t", "T"], - }, - K: { - priority: 70, - parse: function (t, e, n, r) { - switch (e) { - case "K": - return wn(tn, t); - case "Ko": - return n.ordinalNumber(t, { unit: "hour" }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 11; - }, - set: function (t, e, n, r) { - return ( - t.getUTCHours() >= 12 && n < 12 - ? t.setUTCHours(n + 12, 0, 0, 0) - : t.setUTCHours(n, 0, 0, 0), - t - ); - }, - incompatibleTokens: ["a", "b", "h", "H", "k", "t", "T"], - }, - k: { - priority: 70, - parse: function (t, e, n, r) { - switch (e) { - case "k": - return wn(Ve, t); - case "ko": - return n.ordinalNumber(t, { unit: "hour" }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 1 && e <= 24; - }, - set: function (t, e, n, r) { - var i = n <= 24 ? n % 24 : n; - return t.setUTCHours(i, 0, 0, 0), t; - }, - incompatibleTokens: ["a", "b", "h", "H", "K", "t", "T"], - }, - m: { - priority: 60, - parse: function (t, e, n, r) { - switch (e) { - case "m": - return wn(nn, t); - case "mo": - return n.ordinalNumber(t, { unit: "minute" }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 59; - }, - set: function (t, e, n, r) { - return t.setUTCMinutes(n, 0, 0), t; - }, - incompatibleTokens: ["t", "T"], - }, - s: { - priority: 50, - parse: function (t, e, n, r) { - switch (e) { - case "s": - return wn(rn, t); - case "so": - return n.ordinalNumber(t, { unit: "second" }); - default: - return Tn(e.length, t); - } - }, - validate: function (t, e, n) { - return e >= 0 && e <= 59; - }, - set: function (t, e, n, r) { - return t.setUTCSeconds(n, 0), t; - }, - incompatibleTokens: ["t", "T"], - }, - S: { - priority: 30, - parse: function (t, e, n, r) { - return Tn(e.length, t, function (t) { - return Math.floor(t * Math.pow(10, 3 - e.length)); - }); - }, - set: function (t, e, n, r) { - return t.setUTCMilliseconds(n), t; - }, - incompatibleTokens: ["t", "T"], - }, - X: { - priority: 10, - parse: function (t, e, n, r) { - switch (e) { - case "X": - return bn(vn, t); - case "XX": - return bn(gn, t); - case "XXXX": - return bn(pn, t); - case "XXXXX": - return bn(mn, t); - default: - return bn(yn, t); - } - }, - set: function (t, e, n, r) { - return e.timestampIsSet ? t : new Date(t.getTime() - n); - }, - incompatibleTokens: ["t", "T", "x"], - }, - x: { - priority: 10, - parse: function (t, e, n, r) { - switch (e) { - case "x": - return bn(vn, t); - case "xx": - return bn(gn, t); - case "xxxx": - return bn(pn, t); - case "xxxxx": - return bn(mn, t); - default: - return bn(yn, t); - } - }, - set: function (t, e, n, r) { - return e.timestampIsSet ? t : new Date(t.getTime() - n); - }, - incompatibleTokens: ["t", "T", "X"], - }, - t: { - priority: 40, - parse: function (t, e, n, r) { - return kn(t); - }, - set: function (t, e, n, r) { - return [new Date(1e3 * n), { timestampIsSet: !0 }]; - }, - incompatibleTokens: "*", - }, - T: { - priority: 20, - parse: function (t, e, n, r) { - return kn(t); - }, - set: function (t, e, n, r) { - return [new Date(n), { timestampIsSet: !0 }]; - }, - incompatibleTokens: "*", - }, - }, - Pn = Sn, - Rn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, - Un = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, - Mn = /^'([^]*?)'?$/, - jn = /''/g, - qn = /\S/, - $n = /[a-zA-Z]/; -function Nn(t, e, n, r) { - It(3, arguments); - var i = String(t), - a = String(e), - o = r || {}, - u = o.locale || ue; - if (!u.match) throw new RangeError("locale must contain match property"); - var s = u.options && u.options.firstWeekContainsDate, - c = null == s ? 1 : zt(s), - h = null == o.firstWeekContainsDate ? c : zt(o.firstWeekContainsDate); - if (!(h >= 1 && h <= 7)) - throw new RangeError( - "firstWeekContainsDate must be between 1 and 7 inclusively", - ); - var l = u.options && u.options.weekStartsOn, - d = null == l ? 0 : zt(l), - f = null == o.weekStartsOn ? d : zt(o.weekStartsOn); - if (!(f >= 0 && f <= 6)) - throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); - if ("" === a) return "" === i ? Qt(n) : new Date(NaN); - var v, - g = { firstWeekContainsDate: h, weekStartsOn: f, locale: u }, - p = [{ priority: 10, subPriority: -1, set: Hn, index: 0 }], - y = a - .match(Un) - .map(function (t) { - var e = t[0]; - return "p" === e || "P" === e ? (0, Me[e])(t, u.formatLong, g) : t; - }) - .join("") - .match(Rn), - m = []; - for (v = 0; v < y.length; v++) { - var w = y[v]; - !o.useAdditionalWeekYearTokens && Ne(w) && He(w, a, t), - !o.useAdditionalDayOfYearTokens && $e(w) && He(w, a, t); - var b = w[0], - k = Pn[b]; - if (k) { - var T = k.incompatibleTokens; - if (Array.isArray(T)) { - for (var x = void 0, C = 0; C < m.length; C++) { - var A = m[C].token; - if (-1 !== T.indexOf(A) || A === b) { - x = m[C]; - break; - } - } - if (x) - throw new RangeError( - "The format string mustn't contain `" - .concat(x.fullToken, "` and `") - .concat(w, "` at the same time"), - ); - } else if ("*" === k.incompatibleTokens && m.length) - throw new RangeError( - "The format string mustn't contain `".concat( - w, - "` and any other token at the same time", - ), - ); - m.push({ token: b, fullToken: w }); - var E = k.parse(i, w, u.match, g); - if (!E) return new Date(NaN); - p.push({ - priority: k.priority, - subPriority: k.subPriority || 0, - set: k.set, - validate: k.validate, - value: E.value, - index: p.length, - }), - (i = E.rest); - } else { - if (b.match($n)) - throw new RangeError( - "Format string contains an unescaped latin alphabet character `" + - b + - "`", - ); - if ( - ("''" === w ? (w = "'") : "'" === b && (w = Yn(w)), 0 !== i.indexOf(w)) - ) - return new Date(NaN); - i = i.slice(w.length); - } - } - if (i.length > 0 && qn.test(i)) return new Date(NaN); - var D = p - .map(function (t) { - return t.priority; - }) - .sort(function (t, e) { - return e - t; - }) - .filter(function (t, e, n) { - return n.indexOf(t) === e; - }) - .map(function (t) { - return p - .filter(function (e) { - return e.priority === t; - }) - .sort(function (t, e) { - return e.subPriority - t.subPriority; - }); - }) - .map(function (t) { - return t[0]; - }), - O = Qt(n); - if (isNaN(O)) return new Date(NaN); - var S = se(O, Gt(O)), - P = {}; - for (v = 0; v < D.length; v++) { - var R = D[v]; - if (R.validate && !R.validate(S, R.value, g)) return new Date(NaN); - var U = R.set(S, P, R.value, g); - U[0] ? ((S = U[0]), Qe(P, U[1])) : (S = U); - } - return S; -} -function Hn(t, e) { - if (e.timestampIsSet) return t; - var n = new Date(0); - return ( - n.setFullYear(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()), - n.setHours( - t.getUTCHours(), - t.getUTCMinutes(), - t.getUTCSeconds(), - t.getUTCMilliseconds(), - ), - n - ); -} -function Yn(t) { - return t.match(Mn)[1].replace(jn, "'"); -} -var Ln = (function (t) { - s(n, St); - var e = v(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return i(this, n), e.call(this, t, r, "store-hour", a); - } - return ( - o(n, [ - { - 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, - n = Math.abs(t - e); - return Math.floor(n / 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 Nn(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 Nn(t, e ? "HH:mm:ss" : "HH:mm", new Date()); - }, - }, - { - key: "humanReadableHoursRange", - get: function () { - return Kt(this.startDateInstance) && Kt(this.endDateInstance) - ? "" - .concat(ze(this.startDateInstance, "p"), " - ") - .concat(ze(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!"); - }, - }, - ]), - n - ); - })(), - Fn = (function (t) { - s(n, St); - var e = v(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return i(this, n), e.call(this, t, r, "store-location", a); - } - return ( - o(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 J( - this.getAttribute("hours").map(function (t) { - return new Ln(t); - }), - ); - }, - }, - { - key: "isAlwaysOpen", - get: function () { - return this.hours.every(function (t) { - return null == t ? void 0 : t.is24Hours; - }); - }, - }, - { - key: "today", - get: function () { - var t = ze(new Date(), "EEEE"); - return this.schedule[t]; - }, - }, - { - key: "schedule", - get: function () { - for ( - var t = {}, - e = [ - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - "Sunday", - ], - n = 0; - n < e.length; - n++ - ) { - t[e[n]] = new J(); - } - for (var r = 0; r < this.hours.length; r++) { - var i = this.hours.objectAt(r); - t[i.day].pushObject(i); - } - return t; - }, - }, - { - 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!"); - }, - }, - ]), - n - ); - })(), - _n = (function (t) { - s(n, St); - var e = v(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return i(this, n), e.call(this, t, r, "payment-gateway", a); - } - return ( - o(n, [ - { - 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!", - ); - }, - }, - ]), - n - ); - })(), - Wn = (function (t) { - s(r, St); - 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, - a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return i(this, r), e.call(this, t, n, "store", a); - } - return ( - o(r, [ - { - key: "getReviews", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return this.adapter - .get("reviews", n({ store: this.id }, e)) - .then(function (e) { - return new J( - e.map(function (e) { - return new Rt(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", n({ store: this.id }, e)) - .then(function (e) { - return new J( - e.map(function (e) { - return ( - e.place && (e.place = new ft(e.place)), - new Fn(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 Fn(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 J( - e.map(function (e) { - return new _n(e, t.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); - }); - }, - }, - ]), - r - ); - })(), - zn = (function (t) { - s(n, St); - var e = v(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return i(this, n), e.call(this, t, r, "network", a); - } - return ( - o(n, [ - { - key: "getTags", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return this.adapter.get("tags", t); - }, - }, - { - key: "getStores", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return this.adapter.get("stores", e).then(function (e) { - return new J( - e.map(function (e) { - return new Wn(e, t.adapter); - }), - ); - }); - }, - }, - { - key: "getStoreLocations", - value: function () { - var t = this, - e = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return this.adapter.get("store-locations", e).then(function (e) { - return new J( - e.map(function (e) { - return new Fn(e, t.adapter); - }), - ); - }); - }, - }, - { - key: "getPaymentGateways", - value: function () { - var t = this; - return this.adapter.get("gateways").then(function (e) { - return new J( - e.map(function (e) { - return new _n(e, t.adapter); - }), - ); - }); - }, - }, - ]), - n - ); - })(), - In = Array.isArray, - Qn = (function (t) { - s(n, vt); - var e = v(n); - function n() { - var t, - r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - a = arguments.length > 1 ? arguments[1] : void 0, - o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return ( - i(this, n), - r instanceof gt - ? f(t, (t = e.call(this, {}, r, "service-quote", o))) - : e.call(this, r, a, "service-quote", o) - ); - } - return ( - o( - n, - [ - { - key: "setAdapter", - value: function (t) { - var e; - return ( - (this.adapter = t), - (this.store = new Vn(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, - n = t.currency; - return $t(e) || $t(n) ? null : jt(e / 100, n); - }, - }, - { - key: "fromCart", - value: function (t, e, r) { - var i, - a, - o, - u = this, - s = - arguments.length > 3 && void 0 !== arguments[3] - ? arguments[3] - : "storefront", - c = - arguments.length > 4 && - void 0 !== arguments[4] && - arguments[4]; - return ( - null !== (i = t) && void 0 !== i && i.id && (t = t.id), - null !== (a = e) && void 0 !== a && a.id && (e = e.id), - null !== (o = r) && void 0 !== o && o.id && (r = r.id), - this.adapter - .get("service-quotes/from-cart", { - origin: t, - destination: e, - cart: r, - config: s, - all: c, - }) - .then(function (t) { - return In(t) - ? new J( - t.map(function (t) { - return new n(t, u.adapter); - }), - ) - : new n(t, u.adapter); - }) - ); - }, - }, - ], - [ - { - key: "getFromCart", - value: function (t) { - for ( - var e = new n(t), - r = arguments.length, - i = new Array(r > 1 ? r - 1 : 0), - a = 1; - a < r; - a++ - ) - i[a - 1] = arguments[a]; - return e.fromCart.apply(e, i); - }, - }, - ], - ), - n - ); - })(), - Bn = new st({ - create: void 0, - findAll: void 0, - query: void 0, - queryRecord: void 0, - initialize: function (t, e, r, i) { - var a = - arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {}, - o = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : {}; - return ( - tt(t) && (t = t.id), - tt(e) && (e = e.id), - tt(r) && (r = r.id), - tt(i) && (i = i.getAttribute("code")), - this.adapter.get( - "".concat(this.namespace, "/before"), - n( - n({}, a), - {}, - { customer: t, cart: e, serviceQuote: r, gateway: i }, - ), - o, - ) - ); - }, - captureOrder: function (t) { - var e = - 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: e }, - n, - ) - .then(function (t) { - return new lt(t); - }); - }, - }), - Gn = (function (t) { - s(n, St); - var e = v(n); - function n() { - var t = - arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, - r = arguments.length > 1 ? arguments[1] : void 0, - a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; - return i(this, n), e.call(this, t, r, "checkout", a); - } - return ( - o(n, [ - { - 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); - }, - }, - ]), - n - ); - })(), - Xn = { - Product: Nt, - Category: Ht, - Customer: Lt, - Cart: Wt, - DeliveryServiceQuote: Qn, - Store: Wn, - StoreLocation: Fn, - StoreHour: Ln, - Checkout: Gn, - Review: Rt, - }, - Kn = { BrowserAdapter: pt, NodeAdapter: yt }, - Jn = (function () { - function t() { - return ( - i(this, t), - (this.resources = Xn), - (this.adapters = Kn), - this.lookup.apply(this, arguments) - ); - } - return ( - o(t, [ - { - key: "lookup", - value: function (t, e) { - var n = bt(t), - r = Array.prototype.slice.call(arguments).slice(2); - if (!this[n]) throw new Error("Attempted to resolve invalid type"); - if (!this[n][e]) - throw new Error( - "No ".concat(kt(t), " named ").concat(e, " to resolve"), - ); - return d(this[n][e], g(r)); - }, - }, - ]), - t - ); - })(), - Zn = function () { - return d(Jn, Array.prototype.slice.call(arguments)); - }, - Vn = (function (t) { - s(n, Ot); - var e = v(n); - function n() { - return i(this, n), e.apply(this, arguments); - } - return ( - o(n, [ - { - key: "extendActions", - value: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : []; - return Dt(this, t); - }, - }, - { - key: "serialize", - value: function (t) { - return Zn("resource", Tt(this.resource), t, this.adapter); - }, - }, - ]), - n - ); - })(), - tr = (function () { - function t(e) { - var n = - arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, - r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; - if ( - (i(this, t), - (this.version = n.version || "v1"), - (this.options = { - version: this.version, - host: n.host || "https://api.fleetbase.io", - namespace: "storefront/".concat(this.version) || n.namespace, - publicKey: e, - debug: r, - }), - !qt(e)) - ) - throw new Error("⚠️ Invalid Storefront key given to Storefront SDK"); - (this.adapter = n.adapter || Ut(this.options)), - (this.products = new Vn("product", this.adapter)), - (this.categories = new Vn("category", this.adapter)), - (this.reviews = new Vn("review", this.adapter).extendActions(Pt)), - (this.customers = new Vn("customer", this.adapter).extendActions(Yt)), - (this.cart = new Vn("cart", this.adapter).extendActions(_t)), - (this.checkout = new Vn("checkout", this.adapter).extendActions(Bn)); - } - return ( - o( - 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", n({ query: t }, e)) - .then(function (t) { - return new J( - t.map(function (t) { - return new Nt(t); - }), - ); - }); - }, - }, - { - key: "setAdapter", - value: function (t) { - this.adapter = t; - }, - }, - { - key: "getAdapter", - value: function () { - return this.adapter; - }, - }, - ], - [ - { - key: "newInstance", - value: function () { - return d(t, Array.prototype.slice.call(arguments)); - }, - }, - ], - ), - t - ); - })(); -export { - Wt as Cart, - Ht as Category, - Gn as Checkout, - Lt as Customer, - Qn as DeliveryServiceQuote, - zn as Network, - _n as PaymentGateway, - Nt as Product, - Rt as Review, - Wn as Store, - Ln as StoreHour, - Fn as StoreLocation, - tr as default, -}; +import{Resource as t,StoreActions as e,isNodeEnvironment as n,isEmpty as r,Collection as a,Place as i,Order as o,Adapter as s,ServiceQuote as u,isResource as c,pluralize as d,singularize as h,BrowserAdapter as l,NodeAdapter as f,extendStoreActions as g,classify as m,Store as w}from"@fleetbase/sdk";function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:{},n={};return t&&(n.store=t),this.adapter.get("".concat(this.namespace,"/count"),n,e)}}),C=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"review",a)}return x(n,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),n}();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",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:n}).format(t)}var j=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"product",a)}return x(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,n=t.sale_price,a=t.currency;return this.isOnSale?r(n)||r(a)?null:W(n/100,a):r(e)||r(a)?null:W(e/100,a)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(e){return new a(e.map((function(e){return new C(e,t.adapter)})))}))}}]),n}(),F=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"category",a)}return x(n,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(e){return new a(e.map((function(e){return new j(e,t.adapter)})))}))}}]),n}(),L=new e({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",p({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",p({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",p({identity:t,code:e},n)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),R=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"customer",p({actions:L},a))}return x(n,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ke(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:function(t){var e=this;return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",t).then((function(){return e}))}},{key:"getSavedPlaces",value:function(){var t=this;return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/places").then((function(e){return new a(e.map((function(e){return new i(e,t.adapter)})))}))}},{key:"getOrderHistory",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/orders",e).then((function(e){return new a(e.map((function(e){return new o(e,t.adapter)})))}))}}]),n}(),Q=Array.isArray,I=new e({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,r=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),p(p({},r),{},{quantity:n}),a).then(this.afterFetch.bind(this))},update:function(t,e,n){var r=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),p(p({},r),{},{quantity:n}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},n).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)}}),G=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"cart",p({actions:I},a))}return x(n,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof j&&(t=t.id),this.store.add(this.id,t,e,n,r)}},{key:"update",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,n,r)}},{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}}]),n}(),B=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"payment-gateway",a)}return x(n,[{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!")}}]),n}();function X(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 _(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function z(t,e){const n=X(t);return isNaN(e)?_(t,NaN):e?(n.setDate(n.getDate()+e),n):n}const $=6048e5,K=864e5;let U={};function J(){return U}function V(t,e){const n=J(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=X(t),i=a.getDay(),o=(i=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function et(t){const e=X(t);return e.setHours(0,0,0,0),e}function nt(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 rt(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 n=X(t);return!isNaN(Number(n))}const at={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 it(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const ot={date:it({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:it({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:it({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},st={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ut(t){return(e,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,a=n?.width?String(n.width):e;r=t.formattingValues[a]||t.formattingValues[e]}else{const e=t.defaultWidth,a=n?.width?String(n.width):t.defaultWidth;r=t.values[a]||t.values[e]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function ct(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let n=0;nt.test(o))):function(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n;return}(s,(t=>t.test(o)));let c;c=t.valueCallback?t.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:e.slice(o.length)}}}var dt;const ht={code:"en-US",formatDistance:(t,e,n)=>{let r;const a=at[t];return r="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:ot,formatRelative:(t,e,n,r)=>st[t],localize:{ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:ut({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ut({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:ut({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:ut({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:ut({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:(dt={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const n=t.match(dt.matchPattern);if(!n)return null;const r=n[0],a=t.match(dt.parsePattern);if(!a)return null;let i=dt.valueCallback?dt.valueCallback(a[0]):a[0];return i=e.valueCallback?e.valueCallback(i):i,{value:i,rest:t.slice(r.length)}}),era:ct({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:ct({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:ct({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:ct({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:ct({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 lt(t){const e=X(t),n=function(t,e){const n=et(t),r=et(e),a=n.getTime()-nt(n),i=r.getTime()-nt(r);return Math.round((a-i)/K)}(e,function(t){const e=X(t),n=_(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}(e));return n+1}function ft(t){const e=X(t),n=Z(e).getTime()-function(t){const e=tt(t),n=_(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Z(n)}(e).getTime();return Math.round(n/$)+1}function gt(t,e){const n=X(t),r=n.getFullYear(),a=J(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,o=_(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=V(o,e),u=_(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const c=V(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function mt(t,e){const n=X(t),r=V(n,e).getTime()-function(t,e){const n=J(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=gt(t,e),i=_(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),V(i,e)}(n,e).getTime();return Math.round(r/$)+1}function wt(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const yt={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return wt("yy"===e?r%100:r,e.length)},M(t,e){const n=t.getMonth();return"M"===e?String(n+1):wt(n+1,2)},d:(t,e)=>wt(t.getDate(),e.length),a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(t,e)=>wt(t.getHours()%12||12,e.length),H:(t,e)=>wt(t.getHours(),e.length),m:(t,e)=>wt(t.getMinutes(),e.length),s:(t,e)=>wt(t.getSeconds(),e.length),S(t,e){const n=e.length,r=t.getMilliseconds();return wt(Math.floor(r*Math.pow(10,n-3)),e.length)}},pt="midnight",vt="noon",bt="morning",kt="afternoon",xt="evening",Tt="night",Mt={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){const e=t.getFullYear(),r=e>0?e:1-e;return n.ordinalNumber(r,{unit:"year"})}return yt.y(t,e)},Y:function(t,e,n,r){const a=gt(t,r),i=a>0?a:1-a;if("YY"===e){return wt(i%100,2)}return"Yo"===e?n.ordinalNumber(i,{unit:"year"}):wt(i,e.length)},R:function(t,e){return wt(tt(t),e.length)},u:function(t,e){return wt(t.getFullYear(),e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return wt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return wt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return yt.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return wt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=mt(t,r);return"wo"===e?n.ordinalNumber(a,{unit:"week"}):wt(a,e.length)},I:function(t,e,n){const r=ft(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):wt(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getDate(),{unit:"date"}):yt.d(t,e)},D:function(t,e,n){const r=lt(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):wt(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return wt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return wt(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=0===r?7:r;switch(e){case"i":return String(a);case"ii":return wt(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(a=12===r?vt:0===r?pt:r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(a=r>=17?xt:r>=12?kt:r>=4?bt:Tt,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),n.ordinalNumber(e,{unit:"hour"})}return yt.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getHours(),{unit:"hour"}):yt.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):wt(r,e.length)},k:function(t,e,n){let r=t.getHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):wt(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):yt.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getSeconds(),{unit:"second"}):yt.s(t,e)},S:function(t,e){return yt.S(t,e)},X:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return Pt(a);case"XXXX":case"XX":return St(a);default:return St(a,":")}},x:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return Pt(a);case"xxxx":case"xx":return St(a);default:return St(a,":")}},O:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Dt(a,":");default:return"GMT"+St(a,":")}},z:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Dt(a,":");default:return"GMT"+St(a,":")}},t:function(t,e,n,r){const a=r._originalDate||t;return wt(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,n,r){return wt((r._originalDate||t).getTime(),e.length)}};function Dt(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.floor(r/60),i=r%60;return 0===i?n+String(a):n+String(a)+e+wt(i,2)}function Pt(t,e){if(t%60==0){return(t>0?"-":"+")+wt(Math.abs(t)/60,2)}return St(t,e)}function St(t,e=""){const n=t>0?"-":"+",r=Math.abs(t);return n+wt(Math.floor(r/60),2)+e+wt(r%60,2)}const Ot=(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"})}},At=(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"})}},Et={p:At,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return Ot(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",Ot(r,e)).replace("{{time}}",At(a,e))}},Ht=["D","DD"],Yt=["YY","YYYY"];function qt(t){return-1!==Ht.indexOf(t)}function Nt(t){return-1!==Yt.indexOf(t)}function Ct(t,e,n){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${n}\`; 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 \`${n}\`; 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 \`${n}\`; 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 \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const Wt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,jt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ft=/^'([^]*?)'?$/,Lt=/''/g,Rt=/[a-zA-Z]/;function Qt(t,e,n){const r=J(),a=n?.locale??r.locale??ht,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=X(t);if(!rt(s))throw new RangeError("Invalid time value");const u={firstWeekContainsDate:i,weekStartsOn:o,locale:a,_originalDate:s};return e.match(jt).map((function(t){const e=t[0];if("p"===e||"P"===e){return(0,Et[e])(t,a.formatLong)}return t})).join("").match(Wt).map((function(r){if("''"===r)return"'";const i=r[0];if("'"===i)return function(t){const e=t.match(Ft);if(!e)return t;return e[1].replace(Lt,"'")}(r);const o=Mt[i];if(o)return!n?.useAdditionalWeekYearTokens&&Nt(r)&&Ct(r,e,String(t)),!n?.useAdditionalDayOfYearTokens&&qt(r)&&Ct(r,e,String(t)),o(s,r,a.localize,u);if(i.match(Rt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("")}class It{subPriority=0;validate(t,e){return!0}}class Gt extends It{constructor(t,e,n,r,a){super(),this.value=t,this.validateValue=e,this.setValue=n,this.priority=r,a&&(this.subPriority=a)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,n){return this.setValue(t,e,this.value,n)}}class Bt extends It{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:_(t,function(t,e){const n=e instanceof Date?_(e,0):new e(0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),n}(t,Date))}}class Xt{run(t,e,n,r){const a=this.parse(t,e,n,r);return a?{setter:new Gt(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(t,e,n){return!0}}const _t=/^(1[0-2]|0?\d)/,zt=/^(3[0-1]|[0-2]?\d)/,$t=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Kt=/^(5[0-3]|[0-4]?\d)/,Ut=/^(2[0-3]|[0-1]?\d)/,Jt=/^(2[0-4]|[0-1]?\d)/,Vt=/^(1[0-1]|0?\d)/,Zt=/^(1[0-2]|0?\d)/,te=/^[0-5]?\d/,ee=/^[0-5]?\d/,ne=/^\d/,re=/^\d{1,2}/,ae=/^\d{1,3}/,ie=/^\d{1,4}/,oe=/^-?\d+/,se=/^-?\d/,ue=/^-?\d{1,2}/,ce=/^-?\d{1,3}/,de=/^-?\d{1,4}/,he=/^([+-])(\d{2})(\d{2})?|Z/,le=/^([+-])(\d{2})(\d{2})|Z/,fe=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ge=/^([+-])(\d{2}):(\d{2})|Z/,me=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function we(t,e){return t?{value:e(t.value),rest:t.rest}:t}function ye(t,e){const n=e.match(t);return n?{value:parseInt(n[0],10),rest:e.slice(n[0].length)}:null}function pe(t,e){const n=e.match(t);if(!n)return null;if("Z"===n[0])return{value:0,rest:e.slice(1)};return{value:("+"===n[1]?1:-1)*(36e5*(n[2]?parseInt(n[2],10):0)+6e4*(n[3]?parseInt(n[3],10):0)+1e3*(n[5]?parseInt(n[5],10):0)),rest:e.slice(n[0].length)}}function ve(t){return ye(oe,t)}function be(t,e){switch(t){case 1:return ye(ne,e);case 2:return ye(re,e);case 3:return ye(ae,e);case 4:return ye(ie,e);default:return ye(new RegExp("^\\d{1,"+t+"}"),e)}}function ke(t,e){switch(t){case 1:return ye(se,e);case 2:return ye(ue,e);case 3:return ye(ce,e);case 4:return ye(de,e);default:return ye(new RegExp("^-?\\d{1,"+t+"}"),e)}}function xe(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Te(t,e){const n=e>0,r=n?e:1-e;let a;if(r<=50)a=t||100;else{const e=r+50;a=t+100*Math.floor(e/100)-(t>=e%100?100:0)}return n?a:1-a}function Me(t){return t%400==0||t%4==0&&t%100!=0}const De=[31,28,31,30,31,30,31,31,30,31,30,31],Pe=[31,29,31,30,31,30,31,31,30,31,30,31];function Se(t,e,n){const r=J(),a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=X(t),o=i.getDay(),s=7-a;return z(i,e<0||e>6?e-(o+s)%7:((e%7+7)%7+s)%7-(o+s)%7)}function Oe(t,e){const n=X(t),r=function(t){let e=X(t).getDay();return 0===e&&(e=7),e}(n);return z(n,e-r)}const Ae={G:new class extends Xt{priority=140;parse(t,e,n){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}}set(t,e,n){return e.era=n,t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Xt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,n){const r=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return we(be(4,t),r);case"yo":return we(n.ordinalNumber(t,{unit:"year"}),r);default:return we(be(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n){const r=t.getFullYear();if(n.isTwoDigitYear){const e=Te(n.year,r);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const a="era"in e&&1!==e.era?1-n.year:n.year;return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Xt{priority=130;parse(t,e,n){const r=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return we(be(4,t),r);case"Yo":return we(n.ordinalNumber(t,{unit:"year"}),r);default:return we(be(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n,r){const a=gt(t,r);if(n.isTwoDigitYear){const e=Te(n.year,a);return t.setFullYear(e,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),V(t,r)}const i="era"in e&&1!==e.era?1-n.year:n.year;return t.setFullYear(i,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),V(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Xt{priority=130;parse(t,e){return ke("R"===e?4:e.length,t)}set(t,e,n){const r=_(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Z(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Xt{priority=130;parse(t,e){return ke("u"===e?4:e.length,t)}set(t,e,n){return t.setFullYear(n,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 Xt{priority=120;parse(t,e,n){switch(e){case"Q":case"QQ":return be(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth(3*(n-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 Xt{priority=120;parse(t,e,n){switch(e){case"q":case"qq":return be(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth(3*(n-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 Xt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,n){const r=t=>t-1;switch(e){case"M":return we(ye(_t,t),r);case"MM":return we(be(2,t),r);case"Mo":return we(n.ordinalNumber(t,{unit:"month"}),r);case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}},L:new class extends Xt{priority=110;parse(t,e,n){const r=t=>t-1;switch(e){case"L":return we(ye(_t,t),r);case"LL":return we(be(2,t),r);case"Lo":return we(n.ordinalNumber(t,{unit:"month"}),r);case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,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 Xt{priority=100;parse(t,e,n){switch(e){case"w":return ye(Kt,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return be(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n,r){return V(function(t,e,n){const r=X(t),a=mt(r,n)-e;return r.setDate(r.getDate()-7*a),r}(t,n,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Xt{priority=100;parse(t,e,n){switch(e){case"I":return ye(Kt,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return be(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n){return Z(function(t,e){const n=X(t),r=ft(n)-e;return n.setDate(n.getDate()-7*r),n}(t,n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Xt{priority=90;subPriority=1;parse(t,e,n){switch(e){case"d":return ye(zt,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return be(e.length,t)}}validate(t,e){const n=Me(t.getFullYear()),r=t.getMonth();return n?e>=1&&e<=Pe[r]:e>=1&&e<=De[r]}set(t,e,n){return t.setDate(n),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Xt{priority=90;subpriority=1;parse(t,e,n){switch(e){case"D":case"DD":return ye($t,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return be(e.length,t)}}validate(t,e){return Me(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,n){return t.setMonth(0,n),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 Xt{priority=90;parse(t,e,n){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=Se(t,n,r)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Xt{priority=90;parse(t,e,n,r){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return we(be(e.length,t),a);case"eo":return we(n.ordinalNumber(t,{unit:"day"}),a);case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=Se(t,n,r)).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 Xt{priority=90;parse(t,e,n,r){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return we(be(e.length,t),a);case"co":return we(n.ordinalNumber(t,{unit:"day"}),a);case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=Se(t,n,r)).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 Xt{priority=90;parse(t,e,n){const r=t=>0===t?7:t;switch(e){case"i":case"ii":return be(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return we(n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return we(n.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return we(n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r);default:return we(n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,e){return e>=1&&e<=7}set(t,e,n){return(t=Oe(t,n)).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 Xt{priority=80;parse(t,e,n){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(xe(n),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Xt{priority=80;parse(t,e,n){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(xe(n),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Xt{priority=80;parse(t,e,n){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(xe(n),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Xt{priority=70;parse(t,e,n){switch(e){case"h":return ye(Zt,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return be(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,n){const r=t.getHours()>=12;return r&&n<12?t.setHours(n+12,0,0,0):r||12!==n?t.setHours(n,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Xt{priority=70;parse(t,e,n){switch(e){case"H":return ye(Ut,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return be(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,n){return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Xt{priority=70;parse(t,e,n){switch(e){case"K":return ye(Vt,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return be(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.getHours()>=12&&n<12?t.setHours(n+12,0,0,0):t.setHours(n,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Xt{priority=70;parse(t,e,n){switch(e){case"k":return ye(Jt,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return be(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,n){const r=n<=24?n%24:n;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Xt{priority=60;parse(t,e,n){switch(e){case"m":return ye(te,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return be(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setMinutes(n,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Xt{priority=50;parse(t,e,n){switch(e){case"s":return ye(ee,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return be(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setSeconds(n,0),t}incompatibleTokens=["t","T"]},S:new class extends Xt{priority=30;parse(t,e){return we(be(e.length,t),(t=>Math.floor(t*Math.pow(10,3-e.length))))}set(t,e,n){return t.setMilliseconds(n),t}incompatibleTokens=["t","T"]},X:new class extends Xt{priority=10;parse(t,e){switch(e){case"X":return pe(he,t);case"XX":return pe(le,t);case"XXXX":return pe(fe,t);case"XXXXX":return pe(me,t);default:return pe(ge,t)}}set(t,e,n){return e.timestampIsSet?t:_(t,t.getTime()-nt(t)-n)}incompatibleTokens=["t","T","x"]},x:new class extends Xt{priority=10;parse(t,e){switch(e){case"x":return pe(he,t);case"xx":return pe(le,t);case"xxxx":return pe(fe,t);case"xxxxx":return pe(me,t);default:return pe(ge,t)}}set(t,e,n){return e.timestampIsSet?t:_(t,t.getTime()-nt(t)-n)}incompatibleTokens=["t","T","X"]},t:new class extends Xt{priority=40;parse(t){return ve(t)}set(t,e,n){return[_(t,1e3*n),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Xt{priority=20;parse(t){return ve(t)}set(t,e,n){return[_(t,n),{timestampIsSet:!0}]}incompatibleTokens="*"}},Ee=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,He=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ye=/^'([^]*?)'?$/,qe=/''/g,Ne=/\S/,Ce=/[a-zA-Z]/;function We(t,e,n,r){const a=Object.assign({},J()),i=r?.locale??a.locale??ht,o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(""===e)return""===t?X(n):_(n,NaN);const u={firstWeekContainsDate:o,weekStartsOn:s,locale:i},c=[new Bt],d=e.match(He).map((t=>{const e=t[0];if(e in Et){return(0,Et[e])(t,i.formatLong)}return t})).join("").match(Ee),h=[];for(let a of d){!r?.useAdditionalWeekYearTokens&&Nt(a)&&Ct(a,e,t),!r?.useAdditionalDayOfYearTokens&&qt(a)&&Ct(a,e,t);const o=a[0],s=Ae[o];if(s){const{incompatibleTokens:e}=s;if(Array.isArray(e)){const t=h.find((t=>e.includes(t.token)||t.token===o));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:o,fullToken:a});const r=s.run(t,a,i.match,u);if(!r)return _(n,NaN);c.push(r.setter),t=r.rest}else{if(o.match(Ce))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");if("''"===a?a="'":"'"===o&&(a=a.match(Ye)[1].replace(qe,"'")),0!==t.indexOf(a))return _(n,NaN);t=t.slice(a.length)}}if(t.length>0&&Ne.test(t))return _(n,NaN);const l=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,n)=>n.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=X(n);if(isNaN(f.getTime()))return _(n,NaN);const g={};for(const t of l){if(!t.validate(f,u))return _(n,NaN);const e=t.set(f,g,u);Array.isArray(e)?(f=e[0],Object.assign(g,e[1])):f=e}return _(n,f)}var je=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"store-hour",a)}return x(n,[{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,n=Math.abs(t-e);return Math.floor(n/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 We(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 We(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return rt(this.startDateInstance)&&rt(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!")}}]),n}(),Fe=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"store-location",a)}return x(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 a(this.getAttribute("hours").map((function(t){return new je(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={},e=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"store",a)}return x(n,[{key:"getReviews",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",p({store:this.id},e)).then((function(e){return new a(e.map((function(e){return new C(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",p({store:this.id},e)).then((function(e){return new a(e.map((function(e){return e.place&&(e.place=new i(e.place)),new Fe(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 Fe(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 a(e.map((function(e){return new B(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new B(t,e.adapter)}))}}]),n}(),Re=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"network",a)}return x(n,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getStores",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("stores",e).then((function(e){return new a(e.map((function(e){return new Le(e,t.adapter)})))}))}},{key:"getStoreLocations",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("store-locations",e).then((function(e){return new a(e.map((function(e){return new Fe(e,t.adapter)})))}))}},{key:"getPaymentGateways",value:function(){var t=this;return this.adapter.get("gateways").then((function(e){return new a(e.map((function(e){return new B(e,t.adapter)})))}))}}]),n}(),Qe=Array.isArray,Ie=function(t){M(n,u);var e=E(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),r instanceof s?A(t,t=e.call(this,{},r,"service-quote",i)):e.call(this,r,a,"service-quote",i)}return x(n,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ke(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,n=t.currency;return r(e)||r(n)?null:W(e/100,n)}},{key:"fromCart",value:function(t,e,r){var i,o,s,u=this,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"storefront",d=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return null!==(i=t)&&void 0!==i&&i.id&&(t=t.id),null!==(o=e)&&void 0!==o&&o.id&&(e=e.id),null!==(s=r)&&void 0!==s&&s.id&&(r=r.id),this.adapter.get("service-quotes/from-cart",{origin:t,destination:e,cart:r,config:c,all:d}).then((function(t){return Qe(t)?new a(t.map((function(t){return new n(t,u.adapter)}))):new n(t,u.adapter)}))}}],[{key:"getFromCart",value:function(t){for(var e=new n(t),r=arguments.length,a=new Array(r>1?r-1:0),i=1;i4&&void 0!==arguments[4]?arguments[4]:{},i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return c(t)&&(t=t.id),c(e)&&(e=e.id),c(n)&&(n=n.id),c(r)&&(r=r.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),p(p({},a),{},{customer:t,cart:e,serviceQuote:n,gateway:r}),i)},captureOrder:function(t){var e=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:e},n).then((function(t){return new o(t)}))}}),Be=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"checkout",a)}return x(n,[{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)}}]),n}(),Xe={Product:j,Category:F,Customer:R,Cart:G,DeliveryServiceQuote:Ie,Store:Le,StoreLocation:Fe,StoreHour:je,Checkout:Be,Review:C},_e={BrowserAdapter:l,NodeAdapter:f},ze=function(){function t(){return b(this,t),this.resources=Xe,this.adapters=_e,this.lookup.apply(this,arguments)}return x(t,[{key:"lookup",value:function(t,e){var n=d(t),r=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][e])throw new Error("No ".concat(h(t)," named ").concat(e," to resolve"));return O(this[n][e],H(r))}}]),t}(),$e=function(){return O(ze,Array.prototype.slice.call(arguments))},Ke=function(t){M(n,w);var e=E(n);function n(){return b(this,n),e.apply(this,arguments)}return x(n,[{key:"extendActions",value:function(){return g(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:[])}},{key:"serialize",value:function(t){return $e("resource",m(this.resource),t,this.adapter)}}]),n}(),Ue=function(){function t(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(b(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:i},!("string"==typeof(r=e)&&r.length>30&&(r.startsWith("store_")||r.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 n()?$e("adapter","NodeAdapter",t):$e("adapter","BrowserAdapter",t)}(this.options),this.products=new Ke("product",this.adapter),this.categories=new Ke("category",this.adapter),this.reviews=new Ke("review",this.adapter).extendActions(N),this.customers=new Ke("customer",this.adapter).extendActions(L),this.cart=new Ke("cart",this.adapter).extendActions(I),this.checkout=new Ke("checkout",this.adapter).extendActions(Ge)}return x(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",p({query:t},e)).then((function(t){return new a(t.map((function(t){return new j(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return O(t,Array.prototype.slice.call(arguments))}}]),t}();export{G as Cart,F as Category,Be as Checkout,R as Customer,Ie as DeliveryServiceQuote,Re as Network,B as PaymentGateway,j as Product,C as Review,Le as Store,je as StoreHour,Fe as StoreLocation,Ue as default}; //# sourceMappingURL=storefront.js.map diff --git a/dist/esm/storefront.js.map b/dist/esm/storefront.js.map index 7061bd1..5cc3534 100644 --- a/dist/esm/storefront.js.map +++ b/dist/esm/storefront.js.map @@ -1 +1 @@ -{"version":3,"file":"storefront.js","sources":["../../node_modules/@fleetbase/sdk/dist/esm/fleetbase.js","../../src/resource.js","../../src/resources/review.js","../../src/utils/detect-adapter.js","../../src/utils/is-phone.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/resources/cart.js","../../node_modules/date-fns/esm/_lib/toInteger/index.js","../../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../../node_modules/date-fns/esm/toDate/index.js","../../node_modules/date-fns/esm/addMilliseconds/index.js","../../node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js","../../node_modules/date-fns/esm/isDate/index.js","../../node_modules/date-fns/esm/isValid/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js","../../node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js","../../node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js","../../node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/match/index.js","../../node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js","../../node_modules/date-fns/esm/locale/en-US/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js","../../node_modules/date-fns/esm/subMilliseconds/index.js","../../node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","../../node_modules/date-fns/esm/_lib/format/lightFormatters/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js","../../node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js","../../node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js","../../node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js","../../node_modules/date-fns/esm/_lib/getUTCWeek/index.js","../../node_modules/date-fns/esm/_lib/format/formatters/index.js","../../node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js","../../node_modules/date-fns/esm/_lib/format/longFormatters/index.js","../../node_modules/date-fns/esm/_lib/protectedTokens/index.js","../../node_modules/date-fns/esm/format/index.js","../../node_modules/date-fns/esm/_lib/assign/index.js","../../node_modules/date-fns/esm/_lib/setUTCDay/index.js","../../node_modules/date-fns/esm/parse/_lib/parsers/index.js","../../node_modules/date-fns/esm/_lib/setUTCWeek/index.js","../../node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js","../../node_modules/date-fns/esm/_lib/setUTCISODay/index.js","../../node_modules/date-fns/esm/parse/index.js","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/payment-gateway.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"],"sourcesContent":["import t from\"axios\";function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:[];if(A(t))if(r.length<=6e4)t.splice.apply(t,[e,n].concat(m(r)));else{t.splice(e,n);for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:0,r=t.length,i=n;i2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=t.length;n<0&&(n+=i);var o=r&&e!=e?function(t){return t!=t}:function(t){return t===e};return S(t,o,n)},F=function(t,e,n){return $(t,e,0,[n]),n},D=function(t){h(n,g(Array));var e=y(n);function n(){for(var t=arguments.length,r=new Array(t),i=0;i0}},{key:\"empty\",get:function(){return 0===this.length}},{key:\"first\",get:function(){return j(this,0)}},{key:\"last\",get:function(){return j(this,this.length-1)}},{key:\"replace\",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return $(this,t,e,n),this}},{key:\"objectsAt\",value:function(t){var e=this;return t.map((function(t){return j(e,t)}))}},{key:\"objectAt\",value:function(t){return j(this,t)}},{key:\"indexOf\",value:function(t,e){return L(this,t,e,!1)}},{key:\"lastIndexOf\",value:function(t,e){var n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(var r=e;r>=0;r--)if(j(this,r)===t)return r;return-1}},{key:\"includes\",value:function(t,e){return-1!==L(this,t,e,!0)}},{key:\"findBy\",value:function(){return _(this,O.apply(void 0,arguments))}},{key:\"findIndexBy\",value:function(){return S(this,O.apply(void 0,arguments))}},{key:\"isEvery\",value:function(){return z(this,O.apply(void 0,arguments))}},{key:\"isAny\",value:function(){return P(this,O.apply(void 0,arguments))}},{key:\"invoke\",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:R,n=[],r=new Set,i=\"function\"==typeof e?e:function(t){return get(t,e)};return t.forEach((function(t){var e=i(t);r.has(e)||(r.add(e),n.push(t))})),n}(this,t)}},{key:\"without\",value:function(t){if(!this.includes(t))return this;var e=t==t?function(e){return e!==t}:function(t){return t==t};return this.filter(e)}},{key:\"clear\",value:function(){var t=this.length;return 0===t||this.replace(0,t,[]),this}},{key:\"insertAt\",value:function(t,e){return F(this,t,e),this}},{key:\"replaceAt\",value:function(t,e){return this.replace(t,1,[e])}},{key:\"removeAt\",value:function(t,e){return function(t,e){return $(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,[]),t}(this,t,e)}},{key:\"pushObject\",value:function(t){return this.insertAt(this.length,t)}},{key:\"pushObjects\",value:function(t){return this.replace(this.length,0,t),this}},{key:\"popObject\",value:function(){var t=this.length;if(0===t)return null;var e=j(this,t-1);return this.removeAt(t-1,1),e}},{key:\"shiftObject\",value:function(){if(0===this.length)return null;var t=j(this,0);return this.removeAt(0),t}},{key:\"unshiftObject\",value:function(t){return F(this,0,t)}},{key:\"unshiftObjects\",value:function(t){return this.replace(0,0,t),this}},{key:\"reverseObjects\",value:function(){var t=this.length;if(0===t)return this;var e=this.toArray().reverse();return this.replace(0,t,e),this}},{key:\"setObjects\",value:function(t){if(0===t.length)return this.clear();var e=this.length;return this.replace(0,e,t),this}},{key:\"removeObject\",value:function(t){for(var e=this.length||0;--e>=0;){j(this,e)===t&&this.removeAt(e)}return this}},{key:\"removeObjects\",value:function(t){for(var e=t.length-1;e>=0;e--)this.removeObject(t[e]);return this}},{key:\"addObject\",value:function(t){return this.includes(t)||this.pushObject(t),this}},{key:\"addObjects\",value:function(t){var e=this;return t.forEach((function(t){return e.addObject(t)})),this}}]),n}(),C=function(t){var e=null==t;if(e)return e;if(\"number\"==typeof t.size)return!t.size;var n=r(t);if(\"object\"===n){var i=t.size;if(\"number\"==typeof i)return!i}if(\"number\"==typeof t.length&&\"function\"!==n)return!t.length;if(\"object\"===n){var o=t.length;if(\"number\"==typeof o)return!o}return!1},T=function(t){return C(t)||\"string\"==typeof t&&!1===/\\S/.test(t)};function N(t){return isFinite(t)&&Math.abs(t)<=90}function q(t){return isFinite(t)&&Math.abs(t)<=180&&Math.abs(t)>=90}function B(t){return t instanceof Y}var U=function(){var t,e,n,i,o;return!(\"undefined\"==typeof process||\"object\"!==r(null===(t=process)||void 0===t?void 0:t.env)&&-1===(null===(e=process.release)||void 0===e||null===(n=e.name)||void 0===n?void 0:n.search(/node|io.js/))||\"undefined\"!=typeof window&&\"ReactNative\"!==(null===(i=window)||void 0===i||null===(o=i.navigator)||void 0===o?void 0:o.product))},I=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U()?Rt(\"adapter\",\"NodeAdapter\",t):Rt(\"adapter\",\"BrowserAdapter\",t)},J=Array.isArray,K=function(){function t(e){s(this,t),this.place=e,this.geometry=null==e?void 0:e.geometry,this.components=this.parseComponents(),this.attributes=this.parseProperties()}return a(t,[{key:\"parse\",value:function(){this.parseComponents(),this.parseProperties()}},{key:\"parseComponents\",value:function(){var t;return((null===(t=this.place)||void 0===t?void 0:t.address_components)||[]).reduce((function(t,e){return e.types.forEach((function(n){t[n]=e})),t}),{})}},{key:\"parseProperties\",value:function(){var t,e={streetNumber:this.get(\"street_number\"),streetName:this.get(\"route\"),coordinates:null!==(t=this.geometry)&&void 0!==t&&t.location?Object.values(this.geometry.location):[0,0],city:this.or([\"locality\",\"sublocality\",\"sublocality_level_1\",\"neighborhood\",\"administrative_area_level_3\",\"administrative_area_level_2\"]),county:this.get(\"administrative_area_level_2\"),stateShort:this.get(\"administrative_area_level_1\",!0),stateLong:this.get(\"administrative_area_level_1\"),countryShort:this.get(\"country\",!0),country:this.get(\"country\",!0),countryLong:this.get(\"country\"),postalCode:this.get(\"postal_code\")};return e.address=[e.streetNumber,e.streetName].filter(Boolean).join(\" \"),e}},{key:\"all\",value:function(){return this.attributes}},{key:\"or\",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=0;e1&&void 0!==arguments[1]&&arguments[1];return t in this.components?e?this.components[t].short_name:this.components[t].long_name:null}},{key:\"setAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.attributes=n(n({},this.attributes),t),this}},{key:\"setAttribute\",value:function(t,e){return this.attributes[t]=e,this}},{key:\"getAttribute\",value:function(t){return this.attributes[t]||null}}]),t}(),M=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s(this,t),this.type=\"Point\",this.coordinates=[n,e]}return a(t,[{key:\"latitude\",get:function(){return this.coordinates[1]}},{key:\"longitude\",get:function(){return this.coordinates[0]}},{key:\"lat\",value:function(){return this.latitude}},{key:\"lng\",value:function(){return this.longitude}},{key:\"serialize\",value:function(){return{type:\"Point\",coorindates:[this.lat(),this.lng()]}}},{key:\"toJson\",value:function(){return this.serialize()}},{key:\"toString\",value:function(){return\"(\".concat(this.latitude,\", \").concat(this.longitude,\")\")}}],[{key:\"fromGeoJson\",value:function(e){var n=b(e.coordinates,2);return longitude=n[0],latitude=n[1],new t(latitude,longitude)}}]),t}();\"undefined\"==typeof arguments||arguments;var W=function(t,e){var n=t();return Array.isArray(n)||\"object\"===r(n)?H(n,e):null},H=function t(e,n){var i,o=e,s=r(e),u=\"object\"===s,a=\"function\"===s,c=Array.isArray(e),h=\"string\"===r(n)&&n.includes(\".\")?n.split(\".\"):[n];if(c||u){for(var l=0;l0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;s(this,t),this.actions=e,this.bind=n}return a(t,[{key:\"extend\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=t||this.bind;if(!e)return this;if(null!=this&&this.actions&&\"object\"===r(this.actions))for(var n in this.actions){var i=this.actions[n];\"function\"==typeof i?G(e,n,i.bind(e)):G(e,n,i)}return this}}]),t}(),Y=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};s(this,t),this.attributes=e,this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isDestroying=!1,this.isReloading=!1,this.resource=r,this.options=i,this.version=i.version||\"v1\",this.setAdapter(n)}return a(t,[{key:\"setAdapter\",value:function(t){var e;return this.adapter=t,this.store=new jt(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:\"id\",get:function(){return this.getAttribute(\"id\")}},{key:\"create\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.mergeAttributes(e);return this.setFlags([\"isLoading\",\"isSaving\"]),this.store.create(n).then((function(e){return t.setFlags([\"isLoading\",\"isSaving\"],!1),e}))}},{key:\"update\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setFlags([\"isLoading\",\"isSaving\"]),this.store.update(this.attributes.id,e).then((function(e){return t.setFlags([\"isLoading\",\"isSaving\"],!1),e}))}},{key:\"destroy\",value:function(){var t=this;return this.setFlags([\"isLoading\",\"isDestroying\"]),this.store.destroy(this.attributes.id).then((function(e){return t.setFlags([\"isLoading\",\"isDestroying\"],!1),e}))}},{key:\"reload\",value:function(){var t=this;return this.setFlags([\"isLoading\",\"isReloading\"]),this.store.findRecord(this.attributes.id).then((function(e){return t.reset(),e}))}},{key:\"setFlags\",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=[\"isLoading\",\"isSaving\",\"isReloading\",\"isDestroying\"],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAttributes();return C(this.id)?this.create(e):!0===t.onlyDirty?this.savedirty():this.update(e)}},{key:\"saveDirty\",value:function(){for(var t=Object.keys(this.dirtyAttributes),e={},n=0;n0}},{key:\"mutate\",value:function(t,e){this.attributes[t]=e}},{key:\"setAttribute\",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===n&&\"object\"===r(t))return this.setAttributes(t);var i=null!==(e=null==this?void 0:this.attributes[t])&&void 0!==e?e:null;return G(this.attributes,t,n),G(this.dirtyAttributes,t,i),A(null==this?void 0:this.changes[t])||(this.changes[t]=[]),this.changes[t].push({property:t,previousValue:i,value:n,changedAt:new Date}),this}},{key:\"setAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)this.setAttribute(e,t[e]);return this}},{key:\"getAttribute\",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=H(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{},t);return void 0===r?n:r}},{key:\"hasAttribute\",value:function(t){if(A(t)){var e,n=t,r=Object.keys(null!==(e=this.attributes)&&void 0!==e?e:{});return n.every((function(t){return r.includes(t)}))}return!(null==this||!this.attributes)&&t in this.attributes}},{key:\"hasAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.hasAttribute(t)}},{key:\"isAttributeFilled\",value:function(t){var e=this;return A(t)?this.hasAttribute(t)&&t.every((function(t){return!C(e.getAttribute(t))})):this.hasAttribute(t)&&!C(this.getAttribute(t))}},{key:\"getAttributes\",value:function(t){var e={};if(null==t)return this.getAttributes(Object.keys(this.attributes));if(\"string\"==typeof t)return this.getAttribute(Array.prototype.slice.call(arguments));if(!A(t))throw new Error(\"No attribute properties provided!\");for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=null!==(t=null==this?void 0:this.attributes)&&void 0!==t?t:{};return this.attributes=n(n({},r),e),this.attributes}},{key:\"syncAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attributes=t}}]),t}(),Z=new V({getDistanceAndTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get(\"\".concat(this.namespace,\"/\").concat(t,\"/distance-and-time\"),{},e)}}),Q=function(t){h(r,Y);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,r),e.call(this,t,i,\"order\",n({actions:Z},o))}return a(r,[{key:\"getDistanceAndTime\",value:function(){return this.store.getDistanceAndTime(this.id)}}]),r}(),X=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"payload\",i)}return a(n,[{key:\"attach\",value:function(t){}},{key:\"entities\",get:function(){}},{key:\"dropoff\",get:function(){}},{key:\"pickup\",get:function(){}},{key:\"waypoints\",get:function(){return new D(this.waypoints)}}]),n}(),tt=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"entity\",i)}return n}(),et=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"place\",i)}return a(n,[{key:\"latitude\",get:function(){var t;return null===(t=this.getAttribute(\"location\",new M))||void 0===t?void 0:t.coordinates[1]}},{key:\"longitude\",get:function(){var t;return null===(t=this.getAttribute(\"location\",new M))||void 0===t?void 0:t.coordinates[0]}},{key:\"coordinates\",get:function(){return[this.latitude,this.longitude]}},{key:\"setOwner\",value:function(t){return B(t)&&this.setAttribute(\"owner\",t.id),\"string\"==typeof t&&this.setAttribute(\"owner\",t),this}}],[{key:\"fromGoogleAddress\",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.getAttribute(\"coordinates\"),o=b(i,2),s=o[0],u=o[1],a={name:null,address:t.getAttribute(\"address\"),location:new M(s,u),street1:t.getAttribute(\"streetName\"),street2:null,city:t.getAttribute(\"city\"),province:t.getAttribute(\"stateLong\"),postal_code:t.getAttribute(\"postalCode\"),neighborhood:t.get(\"neighborhood\"),district:t.getAttribute(\"county\"),building:t.get(\"building\"),country:t.getAttribute(\"countryShort\"),phone:null,security_access_code:null};return new n(a,e,r)}}]),n}(),nt=function(t){h(n,et);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"waypoint\",i)}return n}(),rt=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"tracking-status\",i)}return n}(),it=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"vehicle\",i)}return n}(),ot=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"driver\",i)}return n}(),st=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"vendor\",i)}return n}(),ut=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"contact\",i)}return n}(),at=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"zone\",i)}return n}(),ct=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"service-area\",i)}return n}(),ht=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"service-rate\",i)}return n}(),lt=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"service-quote\",i)}return a(n,[{key:\"fromPreliminary\",value:function(){}},{key:\"fromPayload\",value:function(){}}]),n}(),vt=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,t),this.version=e.version||\"v1\",this.host=e.host||null,this.namespace=e.namespace||null,this.headers=e.headers||{}},ft=function(t){h(r,vt);var e=y(r);function r(t){var n;return s(this,r),(n=e.call(this,t)).setHeaders({Authorization:\"Bearer \".concat(t.publicKey),\"Content-Type\":\"application/json\",\"User-Agent\":\"@fleetbase/sdk;browser\"}),n}return a(r,[{key:\"setHeaders\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.headers=n(n({},this.headers),t),this}},{key:\"parseJSON\",value:function(t){return new Promise((function(e,n){return t.json().then((function(n){return e({statusText:t.statusText,status:t.status,ok:t.ok,json:n})})).catch((function(){n(new Error(\"Oops! Something went wrong when handling your request.\"))}))}))}},{key:\"request\",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"GET\",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(s,u){return fetch(o.url||\"\".concat(e.host,\"/\").concat(e.namespace,\"/\").concat(t),n({method:r,mode:o.mode||\"cors\",headers:new Headers(n(n({},e.headers||{}),o.headers||{}))},i)).then(e.parseJSON).then((function(t){return t.ok?s(t.json):u(new Error(t.json.errors?t.json.errors[0]:t.statusText))})).catch((function(t){u(t)}))}))}},{key:\"get\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=T(e)?\"\":new URLSearchParams(e).toString();return this.request(\"\".concat(t).concat(r?\"?\".concat(r):\"\"),\"GET\",{},n)}},{key:\"post\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,\"POST\",{body:JSON.stringify(e)},n)}},{key:\"put\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,\"PUT\",{body:JSON.stringify(e)},n)}},{key:\"delete\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(t,\"DELETE\",{},e)}},{key:\"patch\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,\"PATCH\",{body:JSON.stringify(e)},n)}}]),r}(),dt=function(e){h(i,vt);var r=y(i);function i(e){var n;return s(this,i),(n=r.call(this,e)).axios=t.create({baseURL:\"\".concat(n.host,\"/\").concat(n.namespace),headers:{Authorization:\"Bearer \".concat(e.publicKey),\"Content-Type\":\"application/json\",\"User-Agent\":\"@fleetbase/sdk;node\"}}),n}return a(i,[{key:\"setHeaders\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.axios.defaults.headers.common;return this.axios.defaults.headers.common=n(n({},e),t),this}},{key:\"transform\",value:function(t){return t.data}},{key:\"handleError\",value:function(t){if(t.response){var e=t.response.data;if(A(e.errors))throw new Error(e.errors[0]);if(e.error)throw new Error(e.error)}throw t}},{key:\"get\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=T(e)?\"\":new URLSearchParams(e).toString();return this.axios.get(\"\".concat(t).concat(r?\"?\".concat(r):\"\"),n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"post\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.post(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"put\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.put(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"delete\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.axios.delete(t,e).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"patch\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.patch(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}}]),i}(),gt=function(t){h(n,vt);var e=y(n);function n(){return s(this,n),e.apply(this,arguments)}return n}(),pt=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];s(this,t),c(this,\"uncountableWords\",[\"equipment\",\"information\",\"rice\",\"money\",\"species\",\"series\",\"fish\",\"sheep\",\"moose\",\"deer\",\"news\"]),c(this,\"pluralRules\",[[new RegExp(\"(m)an$\",\"gi\"),\"$1en\"],[new RegExp(\"(pe)rson$\",\"gi\"),\"$1ople\"],[new RegExp(\"(child)$\",\"gi\"),\"$1ren\"],[new RegExp(\"^(ox)$\",\"gi\"),\"$1en\"],[new RegExp(\"(ax|test)is$\",\"gi\"),\"$1es\"],[new RegExp(\"(octop|vir)us$\",\"gi\"),\"$1i\"],[new RegExp(\"(alias|status)$\",\"gi\"),\"$1es\"],[new RegExp(\"(bu)s$\",\"gi\"),\"$1ses\"],[new RegExp(\"(buffal|tomat|potat)o$\",\"gi\"),\"$1oes\"],[new RegExp(\"([ti])um$\",\"gi\"),\"$1a\"],[new RegExp(\"sis$\",\"gi\"),\"ses\"],[new RegExp(\"(?:([^f])fe|([lr])f)$\",\"gi\"),\"$1$2ves\"],[new RegExp(\"(hive)$\",\"gi\"),\"$1s\"],[new RegExp(\"([^aeiouy]|qu)y$\",\"gi\"),\"$1ies\"],[new RegExp(\"(x|ch|ss|sh)$\",\"gi\"),\"$1es\"],[new RegExp(\"(matr|vert|ind)ix|ex$\",\"gi\"),\"$1ices\"],[new RegExp(\"([m|l])ouse$\",\"gi\"),\"$1ice\"],[new RegExp(\"(quiz)$\",\"gi\"),\"$1zes\"],[new RegExp(\"s$\",\"gi\"),\"s\"],[new RegExp(\"$\",\"gi\"),\"s\"]]),c(this,\"singularRules\",[[new RegExp(\"(m)en$\",\"gi\"),\"$1an\"],[new RegExp(\"(pe)ople$\",\"gi\"),\"$1rson\"],[new RegExp(\"(child)ren$\",\"gi\"),\"$1\"],[new RegExp(\"([ti])a$\",\"gi\"),\"$1um\"],[new RegExp(\"((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$\",\"gi\"),\"$1$2sis\"],[new RegExp(\"(hive)s$\",\"gi\"),\"$1\"],[new RegExp(\"(tive)s$\",\"gi\"),\"$1\"],[new RegExp(\"(curve)s$\",\"gi\"),\"$1\"],[new RegExp(\"([lr])ves$\",\"gi\"),\"$1f\"],[new RegExp(\"([^fo])ves$\",\"gi\"),\"$1fe\"],[new RegExp(\"([^aeiouy]|qu)ies$\",\"gi\"),\"$1y\"],[new RegExp(\"(s)eries$\",\"gi\"),\"$1eries\"],[new RegExp(\"(m)ovies$\",\"gi\"),\"$1ovie\"],[new RegExp(\"(x|ch|ss|sh)es$\",\"gi\"),\"$1\"],[new RegExp(\"([m|l])ice$\",\"gi\"),\"$1ouse\"],[new RegExp(\"(bus)es$\",\"gi\"),\"$1\"],[new RegExp(\"(o)es$\",\"gi\"),\"$1\"],[new RegExp(\"(shoe)s$\",\"gi\"),\"$1\"],[new RegExp(\"(cris|ax|test)es$\",\"gi\"),\"$1is\"],[new RegExp(\"(octop|vir)i$\",\"gi\"),\"$1us\"],[new RegExp(\"(alias|status)es$\",\"gi\"),\"$1\"],[new RegExp(\"^(ox)en\",\"gi\"),\"$1\"],[new RegExp(\"(vert|ind)ices$\",\"gi\"),\"$1ex\"],[new RegExp(\"(matr)ices$\",\"gi\"),\"$1ix\"],[new RegExp(\"(quiz)zes$\",\"gi\"),\"$1\"],[new RegExp(\"s$\",\"gi\"),\"\"]]),c(this,\"nonTitlecasedWords\",[\"and\",\"or\",\"nor\",\"a\",\"an\",\"the\",\"so\",\"but\",\"to\",\"of\",\"at\",\"by\",\"from\",\"into\",\"on\",\"onto\",\"off\",\"out\",\"in\",\"over\",\"with\",\"for\"]),c(this,\"idSuffix\",new RegExp(\"(_ids|_id)$\",\"g\")),c(this,\"underbar\",new RegExp(\"_\",\"g\")),c(this,\"spaceOrUnderbar\",new RegExp(\"[ _]\",\"g\")),c(this,\"uppercase\",new RegExp(\"([A-Z])\",\"g\")),c(this,\"underbarPrefix\",new RegExp(\"^_\")),this.str=e,this.chain=n}return a(t,[{key:\"get\",value:function(){return this.str}},{key:\"applyRules\",value:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:null;return t=t||this.str,this.applyRules(t,this.pluralRules,this.uncountableWords,e)}},{key:\"singularize\",value:function(t,e){return t=t||this.str,this.applyRules(t,this.singularRules,this.uncountableWords,e)}},{key:\"camelize\",value:function(t,e){for(var n=(t=t||this.str).split(\"/\"),r=0;r1&&void 0!==arguments[1]&&arguments[1];return t=t||this.str,t=this.underscore(this.demodulize(t))+(e?\"\":\"_\")+\"id\",this.str=t,!0===this.chain?this:t}},{key:\"ordinalize\",value:function(t){for(var e=(t=t||this.str).split(\" \"),n=0;n1&&void 0!==arguments[1]?arguments[1]:[];if(t.actions=A(e)?e:[e],!A(e))return e instanceof V&&e.extend(t),t;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};s(this,t),this.resource=e,this.adapter=n||I(),this.namespace=yt(e),this.storage=new D,this.options=r,this.extendActions(r.actions)}return a(t,[{key:\"extendActions\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Et(this,t)}},{key:\"deposit\",value:function(t){return t}},{key:\"serialize\",value:function(t){return Rt(\"resource\",wt(this.resource),t,this.adapter)}},{key:\"afterFetch\",value:function(t){return function(t,e){if(\"function\"==typeof t.options.onAfterFetch&&t.options.onAfterFetch(e),A(e)){for(var n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.post(\"\".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"update\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(function(){var i=o(regeneratorRuntime.mark((function i(o,s){var u;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,e.adapter.put(\"\".concat(e.namespace,\"/\").concat(t),n,r).then(e.afterFetch.bind(e)).catch(s);case 2:u=i.sent,o(u);case 4:case\"end\":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}())}},{key:\"findRecord\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.adapter.get(\"\".concat(e.namespace,\"/\").concat(t),{},n).then(e.afterFetch.bind(e)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"findAll\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var n=o(regeneratorRuntime.mark((function n(r,i){var o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.adapter.get(\"\".concat(t.namespace),{},e).then(t.afterFetch.bind(t)).catch(i);case 2:o=n.sent,r(o);case 4:case\"end\":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}())}},{key:\"query\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get(\"\".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"queryRecord\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.single=!0,new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get(\"\".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"destroy\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=B(t)?t.getAttribute(\"id\"):t;return new Promise(function(){var t=o(regeneratorRuntime.mark((function t(i,o){var s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.adapter.delete(\"\".concat(e.namespace,\"/\").concat(r),{},n).then(e.afterFetch.bind(e)).catch(o);case 2:s=t.sent,i(s);case 4:case\"end\":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())}}]),t}(),Ot=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(s(this,t),this.version=n.version||\"v1\",this.options={version:this.version,host:n.host||\"https://api.fleetbase.io\",namespace:this.version||n.namespace,debug:r,publicKey:e},\"string\"!=typeof e||0===e.length)throw new Error(\"⚠️ Invalid public key given to Fleetbase SDK\");if(!U()&&e.toLowerCase().startsWith(\"$\"))throw new Error(\"Secret key provided. You must use a public key with Fleetbase Javascript SDK!\");this.adapter=n.adapter||I(this.options),this.orders=new jt(\"order\",this.adapter).extendActions(Z),this.entities=new jt(\"entity\",this.adapter),this.places=new jt(\"place\",this.adapter),this.drivers=new jt(\"driver\",this.adapter),this.vehicles=new jt(\"vehicle\",this.adapter),this.vendors=new jt(\"vendor\",this.adapter),this.contacts=new jt(\"contact\",this.adapter)}return a(t,[{key:\"setAdapter\",value:function(t){this.adapter=t}},{key:\"getAdapter\",value:function(){return this.adapter}}],[{key:\"newInstance\",value:function(){return d(t,Array.prototype.slice.call(arguments))}}]),t}();export default Ot;export{vt as Adapter,ft as BrowserAdapter,D as Collection,ut as Contact,ot as Driver,gt as EmberJsAdapter,tt as Entity,K as GoogleAddress,dt as NodeAdapter,Q as Order,X as Payload,et as Place,M as Point,Y as Resource,ct as ServiceArea,lt as ServiceQuote,ht as ServiceRate,jt as Store,V as StoreActions,rt as TrackingStatus,it as Vehicle,st as Vendor,nt as Waypoint,at as Zone,mt as camelize,wt as classify,kt as dasherize,Et as extendStoreActions,N as isLatitude,q as isLongitude,U as isNodeEnvironment,B as isResource,yt as pluralize,bt as singularize};\n//# sourceMappingURL=fleetbase.js.map\n","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}","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 };","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;","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n}\n\nexport default isPhone;","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', { style: 'currency', currency, currencyDisplay }).format(amount);\n}","const isKeyValid = (key) => {\n return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_'));\n};\n\nexport default isKeyValid;","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\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}","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\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 StorefrontStore from '../store';\nimport Resource from '../resource';\nimport { Contact, Place, Order, Collection, StoreActions } from '@fleetbase/sdk';\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', { identity, mode });\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', { actions: customerActions, ...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 token() {\n return this.getAttribute('token');\n }\n\n 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 getSavedPlaces() {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/places')\n .then((places) => {\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n });\n }\n\n getOrderHistory(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/orders', params)\n .then((orders) => {\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n });\n }\n}\n\nexport { customerActions };\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\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","export default function toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n\n var number = Number(dirtyNumber);\n\n if (isNaN(number)) {\n return number;\n }\n\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\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 * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\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 */\n\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument); // Clone the date\n\n if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule\"); // eslint-disable-next-line no-console\n\n console.warn(new Error().stack);\n }\n\n return new Date(NaN);\n }\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\n\nexport default function addMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var timestamp = toDate(dirtyDate).getTime();\n var amount = toInteger(dirtyAmount);\n return new Date(timestamp + amount);\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 default function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\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 * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {*} value - the value to check\n * @returns {boolean} true if the given value is a date\n * @throws {TypeError} 1 arguments required\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 */\n\nexport default function isDate(value) {\n requiredArgs(1, arguments);\n return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';\n}","import isDate from \"../isDate/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\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]{@link 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 * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Now `isValid` doesn't throw an exception\n * if the first argument is not an instance of Date.\n * Instead, argument is converted beforehand using `toDate`.\n *\n * Examples:\n *\n * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |\n * |---------------------------|---------------|---------------|\n * | `new Date()` | `true` | `true` |\n * | `new Date('2016-01-01')` | `true` | `true` |\n * | `new Date('')` | `false` | `false` |\n * | `new Date(1488370835081)` | `true` | `true` |\n * | `new Date(NaN)` | `false` | `false` |\n * | `'2016-01-01'` | `TypeError` | `false` |\n * | `''` | `TypeError` | `false` |\n * | `1488370835081` | `TypeError` | `true` |\n * | `NaN` | `TypeError` | `false` |\n *\n * We introduce this change to make *date-fns* consistent with ECMAScript behavior\n * that try to coerce arguments to the expected type\n * (which is also the case with other *date-fns* functions).\n *\n * @param {*} date - the date to check\n * @returns {Boolean} the date is valid\n * @throws {TypeError} 1 argument required\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 */\n\nexport default function isValid(dirtyDate) {\n requiredArgs(1, arguments);\n\n if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {\n return false;\n }\n\n var date = toDate(dirtyDate);\n return !isNaN(Number(date));\n}","var formatDistanceLocale = {\n lessThanXSeconds: {\n one: 'less than a second',\n other: 'less than {{count}} seconds'\n },\n xSeconds: {\n one: '1 second',\n other: '{{count}} seconds'\n },\n halfAMinute: 'half a minute',\n lessThanXMinutes: {\n one: 'less than a minute',\n other: 'less than {{count}} minutes'\n },\n xMinutes: {\n one: '1 minute',\n other: '{{count}} minutes'\n },\n aboutXHours: {\n one: 'about 1 hour',\n other: 'about {{count}} hours'\n },\n xHours: {\n one: '1 hour',\n other: '{{count}} hours'\n },\n xDays: {\n one: '1 day',\n other: '{{count}} days'\n },\n aboutXWeeks: {\n one: 'about 1 week',\n other: 'about {{count}} weeks'\n },\n xWeeks: {\n one: '1 week',\n other: '{{count}} weeks'\n },\n aboutXMonths: {\n one: 'about 1 month',\n other: 'about {{count}} months'\n },\n xMonths: {\n one: '1 month',\n other: '{{count}} months'\n },\n aboutXYears: {\n one: 'about 1 year',\n other: 'about {{count}} years'\n },\n xYears: {\n one: '1 year',\n other: '{{count}} years'\n },\n overXYears: {\n one: 'over 1 year',\n other: 'over {{count}} years'\n },\n almostXYears: {\n one: 'almost 1 year',\n other: 'almost {{count}} years'\n }\n};\n\nvar formatDistance = function (token, count, options) {\n var result;\n var tokenValue = formatDistanceLocale[token];\n\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 !== null && options !== void 0 && 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\nexport default formatDistance;","export default function buildFormatLongFn(args) {\n return function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // TODO: Remove String()\n var width = options.width ? String(options.width) : args.defaultWidth;\n var format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}","import buildFormatLongFn from \"../../../_lib/buildFormatLongFn/index.js\";\nvar dateFormats = {\n full: 'EEEE, MMMM do, y',\n long: 'MMMM do, y',\n medium: 'MMM d, y',\n short: 'MM/dd/yyyy'\n};\nvar 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};\nvar dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: '{{date}}, {{time}}',\n short: '{{date}}, {{time}}'\n};\nvar formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: 'full'\n }),\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: 'full'\n }),\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: 'full'\n })\n};\nexport default formatLong;","var 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\nvar formatRelative = function (token, _date, _baseDate, _options) {\n return formatRelativeLocale[token];\n};\n\nexport default formatRelative;","export default function buildLocalizeFn(args) {\n return function (dirtyIndex, dirtyOptions) {\n var options = dirtyOptions || {};\n var context = options.context ? String(options.context) : 'standalone';\n var valuesArray;\n\n if (context === 'formatting' && args.formattingValues) {\n var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n var width = options.width ? String(options.width) : defaultWidth;\n valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n var _defaultWidth = args.defaultWidth;\n\n var _width = options.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[_width] || args.values[_defaultWidth];\n }\n\n var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challange you to try to remove it!\n\n return valuesArray[index];\n };\n}","export default function buildMatchFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var width = options.width;\n var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n var matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n\n var matchedString = matchResult[0];\n var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n }) : findKey(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n });\n var value;\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}\n\nfunction findKey(object, predicate) {\n for (var key in object) {\n if (object.hasOwnProperty(key) && predicate(object[key])) {\n return key;\n }\n }\n\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (var key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n\n return undefined;\n}","import buildMatchFn from \"../../../_lib/buildMatchFn/index.js\";\nimport buildMatchPatternFn from \"../../../_lib/buildMatchPatternFn/index.js\";\nvar matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nvar parseOrdinalNumberPattern = /\\d+/i;\nvar 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};\nvar parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i]\n};\nvar matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i\n};\nvar parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i]\n};\nvar 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};\nvar parseMonthPatterns = {\n 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],\n 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]\n};\nvar 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};\nvar 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};\nvar 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};\nvar 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};\nvar match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: function (value) {\n return parseInt(value, 10);\n }\n }),\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseEraPatterns,\n defaultParseWidth: 'any'\n }),\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: 'any',\n valueCallback: function (index) {\n return index + 1;\n }\n }),\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: 'any'\n }),\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseDayPatterns,\n defaultParseWidth: 'any'\n }),\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: 'any',\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: 'any'\n })\n};\nexport default match;","export default function buildMatchPatternFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n var matchedString = matchResult[0];\n var parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}","import formatDistance from \"./_lib/formatDistance/index.js\";\nimport formatLong from \"./_lib/formatLong/index.js\";\nimport formatRelative from \"./_lib/formatRelative/index.js\";\nimport localize from \"./_lib/localize/index.js\";\nimport match from \"./_lib/match/index.js\";\n\n/**\n * @type {Locale}\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}\n * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}\n */\nvar locale = {\n code: 'en-US',\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0\n /* Sunday */\n ,\n firstWeekContainsDate: 1\n }\n};\nexport default locale;","import buildLocalizeFn from \"../../../_lib/buildLocalizeFn/index.js\";\nvar eraValues = {\n narrow: ['B', 'A'],\n abbreviated: ['BC', 'AD'],\n wide: ['Before Christ', 'Anno Domini']\n};\nvar quarterValues = {\n narrow: ['1', '2', '3', '4'],\n abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],\n wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']\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.\n\nvar monthValues = {\n narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\n abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n};\nvar 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: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n};\nvar 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};\nvar 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\nvar ordinalNumber = function (dirtyNumber, _options) {\n var number = Number(dirtyNumber); // 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 var rem100 = number % 100;\n\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + 'st';\n\n case 2:\n return number + 'nd';\n\n case 3:\n return number + 'rd';\n }\n }\n\n return number + 'th';\n};\n\nvar localize = {\n ordinalNumber: ordinalNumber,\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: 'wide'\n }),\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: 'wide',\n argumentCallback: function (quarter) {\n return quarter - 1;\n }\n }),\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: 'wide'\n }),\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: 'wide'\n }),\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: 'wide',\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: 'wide'\n })\n};\nexport default localize;","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subMilliseconds\n * @category Millisecond Helpers\n * @summary Subtract the specified number of milliseconds from the given date.\n *\n * @description\n * Subtract the specified number of milliseconds from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:\n * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:29.250\n */\n\nexport default function subMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, -amount);\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n\n while (output.length < targetLength) {\n output = '0' + output;\n }\n\n return sign + output;\n}","import addLeadingZeros from \"../../addLeadingZeros/index.js\";\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\nvar formatters = {\n // Year\n y: function (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 var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);\n },\n // Month\n M: function (date, token) {\n var month = date.getUTCMonth();\n return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n // Day of the month\n d: function (date, token) {\n return addLeadingZeros(date.getUTCDate(), token.length);\n },\n // AM or PM\n a: function (date, token) {\n var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return dayPeriodEnumValue.toUpperCase();\n\n case 'aaa':\n return dayPeriodEnumValue;\n\n case 'aaaaa':\n return dayPeriodEnumValue[0];\n\n case 'aaaa':\n default:\n return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';\n }\n },\n // Hour [1-12]\n h: function (date, token) {\n return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);\n },\n // Hour [0-23]\n H: function (date, token) {\n return addLeadingZeros(date.getUTCHours(), token.length);\n },\n // Minute\n m: function (date, token) {\n return addLeadingZeros(date.getUTCMinutes(), token.length);\n },\n // Second\n s: function (date, token) {\n return addLeadingZeros(date.getUTCSeconds(), token.length);\n },\n // Fraction of second\n S: function (date, token) {\n var numberOfDigits = token.length;\n var milliseconds = date.getUTCMilliseconds();\n var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));\n return addLeadingZeros(fractionalSeconds, token.length);\n }\n};\nexport default formatters;","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getUTCFullYear();\n var fourthOfJanuaryOfNextYear = new Date(0);\n fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);\n var fourthOfJanuaryOfThisYear = new Date(0);\n fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCISOWeek(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}","import getUTCISOWeekYear from \"../getUTCISOWeekYear/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var year = getUTCISOWeekYear(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setUTCFullYear(year, 0, 4);\n fourthOfJanuary.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCISOWeek(fourthOfJanuary);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport startOfUTCISOWeekYear from \"../startOfUTCISOWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // 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\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeek(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate, dirtyOptions);\n var year = date.getUTCFullYear();\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var firstWeekOfNextYear = new Date(0);\n firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);\n var firstWeekOfThisYear = new Date(0);\n firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);\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}","import toInteger from \"../toInteger/index.js\";\nimport getUTCWeekYear from \"../getUTCWeekYear/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\n var year = getUTCWeekYear(dirtyDate, dirtyOptions);\n var firstWeek = new Date(0);\n firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCWeek(firstWeek, dirtyOptions);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport startOfUTCWeekYear from \"../startOfUTCWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // 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\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import lightFormatters from \"../lightFormatters/index.js\";\nimport getUTCDayOfYear from \"../../../_lib/getUTCDayOfYear/index.js\";\nimport getUTCISOWeek from \"../../../_lib/getUTCISOWeek/index.js\";\nimport getUTCISOWeekYear from \"../../../_lib/getUTCISOWeekYear/index.js\";\nimport getUTCWeek from \"../../../_lib/getUTCWeek/index.js\";\nimport getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport addLeadingZeros from \"../../addLeadingZeros/index.js\";\nvar 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 * | | 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\nvar formatters = {\n // Era\n G: function (date, token, localize) {\n var era = date.getUTCFullYear() > 0 ? 1 : 0;\n\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return localize.era(era, {\n width: 'abbreviated'\n });\n // A, B\n\n case 'GGGGG':\n return localize.era(era, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return localize.era(era, {\n width: 'wide'\n });\n }\n },\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === 'yo') {\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, {\n unit: 'year'\n });\n }\n\n return lightFormatters.y(date, token);\n },\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year\n\n if (token === 'YY') {\n var twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n } // Ordinal number\n\n\n if (token === 'Yo') {\n return localize.ordinalNumber(weekYear, {\n unit: 'year'\n });\n } // Padding\n\n\n return addLeadingZeros(weekYear, token.length);\n },\n // ISO week-numbering year\n R: function (date, token) {\n var isoWeekYear = getUTCISOWeekYear(date); // Padding\n\n return addLeadingZeros(isoWeekYear, token.length);\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 var year = date.getUTCFullYear();\n return addLeadingZeros(year, token.length);\n },\n // Quarter\n Q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'QQ':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\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\n case 'QQQQQ':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone quarter\n q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'qq':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\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\n case 'qqqqq':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Month\n M: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n case 'M':\n case 'MM':\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return localize.month(month, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone month\n L: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return String(month + 1);\n // 01, 02, ..., 12\n\n case 'LL':\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return localize.month(month, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Local week of year\n w: function (date, token, localize, options) {\n var week = getUTCWeek(date, options);\n\n if (token === 'wo') {\n return localize.ordinalNumber(week, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(week, token.length);\n },\n // ISO week of year\n I: function (date, token, localize) {\n var isoWeek = getUTCISOWeek(date);\n\n if (token === 'Io') {\n return localize.ordinalNumber(isoWeek, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n // Day of the month\n d: function (date, token, localize) {\n if (token === 'do') {\n return localize.ordinalNumber(date.getUTCDate(), {\n unit: 'date'\n });\n }\n\n return lightFormatters.d(date, token);\n },\n // Day of year\n D: function (date, token, localize) {\n var dayOfYear = getUTCDayOfYear(date);\n\n if (token === 'Do') {\n return localize.ordinalNumber(dayOfYear, {\n unit: 'dayOfYear'\n });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n // Day of week\n E: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n\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\n case 'EEEEE':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Local day of week\n e: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\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\n case 'ee':\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n\n case 'eo':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'eee':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (same as in `e`)\n case 'c':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'cc':\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n\n case 'co':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'ccc':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // ISO day of week\n i: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n\n switch (token) {\n // 2\n case 'i':\n return String(isoDayOfWeek);\n // 02\n\n case 'ii':\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n\n case 'io':\n return localize.ordinalNumber(isoDayOfWeek, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'iiiii':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'iiiiii':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'iiii':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM or PM\n a: function (date, token, localize) {\n var hours = date.getUTCHours();\n var 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\n case 'aaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'aaaaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\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\n case 'bbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'bbbbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\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\n case 'BBBBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === 'ho') {\n var hours = date.getUTCHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return lightFormatters.h(date, token);\n },\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === 'Ho') {\n return localize.ordinalNumber(date.getUTCHours(), {\n unit: 'hour'\n });\n }\n\n return lightFormatters.H(date, token);\n },\n // Hour [0-11]\n K: function (date, token, localize) {\n var hours = date.getUTCHours() % 12;\n\n if (token === 'Ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Hour [1-24]\n k: function (date, token, localize) {\n var hours = date.getUTCHours();\n if (hours === 0) hours = 24;\n\n if (token === 'ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Minute\n m: function (date, token, localize) {\n if (token === 'mo') {\n return localize.ordinalNumber(date.getUTCMinutes(), {\n unit: 'minute'\n });\n }\n\n return lightFormatters.m(date, token);\n },\n // Second\n s: function (date, token, localize) {\n if (token === 'so') {\n return localize.ordinalNumber(date.getUTCSeconds(), {\n unit: 'second'\n });\n }\n\n return lightFormatters.s(date, token);\n },\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var 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 // 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\n case 'XXXX':\n case 'XX':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\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\n case 'XXXXX':\n case 'XXX': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case 'x':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\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\n case 'xxxx':\n case 'xx':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\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\n case 'xxxxx':\n case 'xxx': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var 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\n case 'OOOO':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var 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\n case 'zzzz':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n }\n};\n\nfunction formatTimezoneShort(offset, dirtyDelimiter) {\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = Math.floor(absOffset / 60);\n var minutes = absOffset % 60;\n\n if (minutes === 0) {\n return sign + String(hours);\n }\n\n var delimiter = dirtyDelimiter || '';\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {\n if (offset % 60 === 0) {\n var sign = offset > 0 ? '-' : '+';\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n\n return formatTimezone(offset, dirtyDelimiter);\n}\n\nfunction formatTimezone(offset, dirtyDelimiter) {\n var delimiter = dirtyDelimiter || '';\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n var minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n\nexport default formatters;","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCDayOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var timestamp = date.getTime();\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n var startOfYearTimestamp = date.getTime();\n var difference = timestamp - startOfYearTimestamp;\n return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;\n}","function dateLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'P':\n return formatLong.date({\n width: 'short'\n });\n\n case 'PP':\n return formatLong.date({\n width: 'medium'\n });\n\n case 'PPP':\n return formatLong.date({\n width: 'long'\n });\n\n case 'PPPP':\n default:\n return formatLong.date({\n width: 'full'\n });\n }\n}\n\nfunction timeLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'p':\n return formatLong.time({\n width: 'short'\n });\n\n case 'pp':\n return formatLong.time({\n width: 'medium'\n });\n\n case 'ppp':\n return formatLong.time({\n width: 'long'\n });\n\n case 'pppp':\n default:\n return formatLong.time({\n width: 'full'\n });\n }\n}\n\nfunction dateTimeLongFormatter(pattern, formatLong) {\n var matchResult = pattern.match(/(P+)(p+)?/);\n var datePattern = matchResult[1];\n var timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n var dateTimeFormat;\n\n switch (datePattern) {\n case 'P':\n dateTimeFormat = formatLong.dateTime({\n width: 'short'\n });\n break;\n\n case 'PP':\n dateTimeFormat = formatLong.dateTime({\n width: 'medium'\n });\n break;\n\n case 'PPP':\n dateTimeFormat = formatLong.dateTime({\n width: 'long'\n });\n break;\n\n case 'PPPP':\n default:\n dateTimeFormat = formatLong.dateTime({\n width: 'full'\n });\n break;\n }\n\n return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));\n}\n\nvar longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter\n};\nexport default longFormatters;","var protectedDayOfYearTokens = ['D', 'DD'];\nvar protectedWeekYearTokens = ['YY', 'YYYY'];\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\nexport function throwProtectedError(token, format, input) {\n if (token === 'YYYY') {\n throw new RangeError(\"Use `yyyy` instead of `YYYY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'YY') {\n throw new RangeError(\"Use `yy` instead of `YY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'D') {\n throw new RangeError(\"Use `d` instead of `D` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'DD') {\n throw new RangeError(\"Use `dd` instead of `DD` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n }\n}","import isValid from \"../isValid/index.js\";\nimport defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport formatters from \"../_lib/format/formatters/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\"; // 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\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\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://git.io/fxCyr\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, Su, Sa | |\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, Su, Sa | 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, Su, Sa | |\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, Su, Sa | |\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]{@link https://date-fns.org/docs/getISOWeekYear}\n * and [getWeekYear]{@link 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://git.io/fxCyr\n *\n * 9. `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://git.io/fxCyr\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The second argument is now required for the sake of explicitness.\n *\n * ```javascript\n * // Before v2.0.0\n * format(new Date(2016, 0, 1))\n *\n * // v2.0.0 onward\n * format(new Date(2016, 0, 1), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n * ```\n *\n * - New format string API for `format` function\n * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).\n * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.\n *\n * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.\n *\n * @param {Date|Number} date - the original date\n * @param {String} format - the string of tokens\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {String} the formatted date string\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * var 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 * var 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 * var result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\n\nexport default function format(dirtyDate, dirtyFormatStr, dirtyOptions) {\n requiredArgs(2, arguments);\n var formatStr = String(dirtyFormatStr);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (!locale.localize) {\n throw new RangeError('locale must contain localize property');\n }\n\n if (!locale.formatLong) {\n throw new RangeError('locale must contain formatLong property');\n }\n\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\n\n\n var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);\n var utcDate = subMilliseconds(originalDate, timezoneOffset);\n var formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate\n };\n var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, formatterOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp).map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n var firstCharacter = substring[0];\n\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n var formatter = formatters[firstCharacter];\n\n if (formatter) {\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n return formatter(utcDate, substring, locale.localize, formatterOptions);\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n }\n\n return substring;\n }).join('');\n return result;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","export default function assign(target, dirtyObject) {\n if (target == null) {\n throw new TypeError('assign requires that input parameter not be null or undefined');\n }\n\n dirtyObject = dirtyObject || {};\n\n for (var property in dirtyObject) {\n if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) {\n target[property] = dirtyObject[property];\n }\n }\n\n return target;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {\n requiredArgs(2, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = toInteger(dirtyDay);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport setUTCDay from \"../../../_lib/setUTCDay/index.js\";\nimport setUTCISODay from \"../../../_lib/setUTCISODay/index.js\";\nimport setUTCISOWeek from \"../../../_lib/setUTCISOWeek/index.js\";\nimport setUTCWeek from \"../../../_lib/setUTCWeek/index.js\";\nimport startOfUTCISOWeek from \"../../../_lib/startOfUTCISOWeek/index.js\";\nimport startOfUTCWeek from \"../../../_lib/startOfUTCWeek/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\nvar MILLISECONDS_IN_MINUTE = 60000;\nvar MILLISECONDS_IN_SECOND = 1000;\nvar numericPatterns = {\n month: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/,\n // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/,\n // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/,\n // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/,\n // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/,\n // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/,\n // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n minute: /^[0-5]?\\d/,\n // 0 to 59\n second: /^[0-5]?\\d/,\n // 0 to 59\n singleDigit: /^\\d/,\n // 0 to 9\n twoDigits: /^\\d{1,2}/,\n // 0 to 99\n threeDigits: /^\\d{1,3}/,\n // 0 to 999\n fourDigits: /^\\d{1,4}/,\n // 0 to 9999\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/,\n // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/,\n // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/,\n // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/ // 0 to 9999, -0 to -9999\n\n};\nvar 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\nfunction parseNumericPattern(pattern, string, valueCallback) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n var value = parseInt(matchResult[0], 10);\n return {\n value: valueCallback ? valueCallback(value) : value,\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseTimezonePattern(pattern, string) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n } // Input is 'Z'\n\n\n if (matchResult[0] === 'Z') {\n return {\n value: 0,\n rest: string.slice(1)\n };\n }\n\n var sign = matchResult[1] === '+' ? 1 : -1;\n var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n return {\n value: sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * MILLISECONDS_IN_SECOND),\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseAnyDigitsSigned(string, valueCallback) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback);\n}\n\nfunction parseNDigits(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction parseNDigitsSigned(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^-?\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction dayPeriodEnumToHours(enumValue) {\n switch (enumValue) {\n case 'morning':\n return 4;\n\n case 'evening':\n return 17;\n\n case 'pm':\n case 'noon':\n case 'afternoon':\n return 12;\n\n case 'am':\n case 'midnight':\n case 'night':\n default:\n return 0;\n }\n}\n\nfunction normalizeTwoDigitYear(twoDigitYear, currentYear) {\n var isCommonEra = currentYear > 0; // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n\n var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n var result;\n\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n var rangeEnd = absCurrentYear + 50;\n var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n var isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nvar DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nvar DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // User for validation\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\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\n\nvar parsers = {\n // Era\n G: {\n priority: 140,\n parse: function (string, token, match, _options) {\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n // A, B\n\n case 'GGGGG':\n return match.era(string, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return match.era(string, {\n width: 'wide'\n }) || match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n }\n },\n set: function (date, flags, value, _options) {\n flags.era = value;\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['R', 'u', 't', 'T']\n },\n // Year\n y: {\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 |\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'yy'\n };\n };\n\n switch (token) {\n case 'y':\n return parseNDigits(4, string, valueCallback);\n\n case 'yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, _options) {\n var currentYear = date.getUTCFullYear();\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Local week-numbering year\n Y: {\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'YY'\n };\n };\n\n switch (token) {\n case 'Y':\n return parseNDigits(4, string, valueCallback);\n\n case 'Yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, options) {\n var currentYear = getUTCWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week-numbering year\n R: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'R') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (_date, _flags, value, _options) {\n var firstWeekOfYear = new Date(0);\n firstWeekOfYear.setUTCFullYear(value, 0, 4);\n firstWeekOfYear.setUTCHours(0, 0, 0, 0);\n return startOfUTCISOWeek(firstWeekOfYear);\n },\n incompatibleTokens: ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Extended year\n u: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'u') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Quarter\n Q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n case 'QQ':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone quarter\n q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n case 'qq':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Month\n M: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'M':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'MM':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone month\n L: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'LL':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Local week of year\n w: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'w':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'wo':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCWeek(setUTCWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week of year\n I: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'I':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'Io':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCISOWeek(setUTCISOWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Day of the month\n d: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'd':\n return parseNumericPattern(numericPatterns.date, string);\n\n case 'do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n var month = date.getUTCMonth();\n\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 set: function (date, _flags, value, _options) {\n date.setUTCDate(value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Day of year\n D: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'D':\n case 'DD':\n return parseNumericPattern(numericPatterns.dayOfYear, string);\n\n case 'Do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(0, value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']\n },\n // Day of week\n E: {\n priority: 90,\n parse: function (string, token, match, _options) {\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T']\n },\n // Local day of week\n e: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var 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':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'eo':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'eee':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']\n },\n // Stand-alone local day of week\n c: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var 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':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'co':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'ccc':\n return match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']\n },\n // ISO day of week\n i: {\n priority: 90,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n if (value === 0) {\n return 7;\n }\n\n return value;\n };\n\n switch (token) {\n // 2\n case 'i':\n case 'ii':\n // 02\n return parseNDigits(token.length, string);\n // 2nd\n\n case 'io':\n return match.ordinalNumber(string, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // T\n\n case 'iiiii':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tu\n\n case 'iiiiii':\n return match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tuesday\n\n case 'iiii':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 7;\n },\n set: function (date, _flags, value, options) {\n date = setUTCISODay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']\n },\n // AM or PM\n a: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'a':\n case 'aa':\n case 'aaa':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaaa':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // AM, PM, midnight\n b: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'b':\n case 'bb':\n case 'bbb':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbbb':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // in the morning, in the afternoon, in the evening, at night\n B: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 't', 'T']\n },\n // Hour [1-12]\n h: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'h':\n return parseNumericPattern(numericPatterns.hour12h, string);\n\n case 'ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 12;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setUTCHours(0, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['H', 'K', 'k', 't', 'T']\n },\n // Hour [0-23]\n H: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'H':\n return parseNumericPattern(numericPatterns.hour23h, string);\n\n case 'Ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 23;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(value, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T']\n },\n // Hour [0-11]\n K: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'K':\n return parseNumericPattern(numericPatterns.hour11h, string);\n\n case 'Ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T']\n },\n // Hour [1-24]\n k: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'k':\n return parseNumericPattern(numericPatterns.hour24h, string);\n\n case 'ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 24;\n },\n set: function (date, _flags, value, _options) {\n var hours = value <= 24 ? value % 24 : value;\n date.setUTCHours(hours, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T']\n },\n // Minute\n m: {\n priority: 60,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'm':\n return parseNumericPattern(numericPatterns.minute, string);\n\n case 'mo':\n return match.ordinalNumber(string, {\n unit: 'minute'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMinutes(value, 0, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Second\n s: {\n priority: 50,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 's':\n return parseNumericPattern(numericPatterns.second, string);\n\n case 'so':\n return match.ordinalNumber(string, {\n unit: 'second'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCSeconds(value, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Fraction of second\n S: {\n priority: 30,\n parse: function (string, token, _match, _options) {\n var valueCallback = function (value) {\n return Math.floor(value * Math.pow(10, -token.length + 3));\n };\n\n return parseNDigits(token.length, string, valueCallback);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMilliseconds(value);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Timezone (ISO-8601. +00:00 is `'Z'`)\n X: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'X':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'XX':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'XXXX':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'XXXXX':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'XXX':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'x']\n },\n // Timezone (ISO-8601)\n x: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'x':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'xx':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'xxxx':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'xxxxx':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'xxx':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'X']\n },\n // Seconds timestamp\n t: {\n priority: 40,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value * 1000), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n },\n // Milliseconds timestamp\n T: {\n priority: 20,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n }\n};\nexport default parsers;","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCWeek from \"../getUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCWeek(dirtyDate, dirtyWeek, options) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var week = toInteger(dirtyWeek);\n var diff = getUTCWeek(date, options) - week;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCISOWeek from \"../getUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISOWeek(dirtyDate, dirtyISOWeek) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var isoWeek = toInteger(dirtyISOWeek);\n var diff = getUTCISOWeek(date) - isoWeek;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISODay(dirtyDate, dirtyDay) {\n requiredArgs(2, arguments);\n var day = toInteger(dirtyDay);\n\n if (day % 7 === 0) {\n day = day - 7;\n }\n\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport assign from \"../_lib/assign/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport parsers from \"./_lib/parsers/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar TIMEZONE_UNIT_PRIORITY = 10; // 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\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar notWhitespaceRegExp = /\\S/;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\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://git.io/fxCyr\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, Su, Sa | |\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, Su, Sa | 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, Su, Sa | |\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, Su, Sa | |\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, 0001, ..., 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]{@link https://date-fns.org/docs/setISOWeekYear}\n * and [setWeekYear]{@link 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://git.io/fxCyr\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://git.io/fxCyr\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 * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Old `parse` was renamed to `toDate`.\n * Now `parse` is a new function which parses a string using a provided format.\n *\n * ```javascript\n * // Before v2.0.0\n * parse('2016-01-01')\n *\n * // v2.0.0 onward (toDate no longer accepts a string)\n * toDate(1392098430000) // Unix to timestamp\n * toDate(new Date(2014, 1, 11, 11, 30, 30)) // Cloning the date\n * parse('2016-01-01', 'yyyy-MM-dd', new Date())\n * ```\n *\n * @param {String} dateString - the string to parse\n * @param {String} formatString - the string of tokens\n * @param {Date|Number} referenceDate - defines values missing from the parsed dateString\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {Date} the parsed date\n * @throws {TypeError} 3 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} `options.locale` must contain `match` property\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} 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 */\n\nexport default function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, dirtyOptions) {\n requiredArgs(3, arguments);\n var dateString = String(dirtyDateString);\n var formatString = String(dirtyFormatString);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n\n if (!locale.match) {\n throw new RangeError('locale must contain match property');\n }\n\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (formatString === '') {\n if (dateString === '') {\n return toDate(dirtyReferenceDate);\n } else {\n return new Date(NaN);\n }\n }\n\n var subFnOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale\n }; // If timezone isn't specified, it will be set to the system timezone\n\n var setters = [{\n priority: TIMEZONE_UNIT_PRIORITY,\n subPriority: -1,\n set: dateToSystemTimezone,\n index: 0\n }];\n var i;\n var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, subFnOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp);\n var usedTokens = [];\n\n for (i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n var firstCharacter = token[0];\n var parser = parsers[firstCharacter];\n\n if (parser) {\n var incompatibleTokens = parser.incompatibleTokens;\n\n if (Array.isArray(incompatibleTokens)) {\n var incompatibleToken = void 0;\n\n for (var _i = 0; _i < usedTokens.length; _i++) {\n var usedToken = usedTokens[_i].token;\n\n if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {\n incompatibleToken = usedTokens[_i];\n break;\n }\n }\n\n if (incompatibleToken) {\n throw new RangeError(\"The format string mustn't contain `\".concat(incompatibleToken.fullToken, \"` and `\").concat(token, \"` at the same time\"));\n }\n } else if (parser.incompatibleTokens === '*' && usedTokens.length) {\n throw new RangeError(\"The format string mustn't contain `\".concat(token, \"` and any other token at the same time\"));\n }\n\n usedTokens.push({\n token: firstCharacter,\n fullToken: token\n });\n var parseResult = parser.parse(dateString, token, locale.match, subFnOptions);\n\n if (!parseResult) {\n return new Date(NaN);\n }\n\n setters.push({\n priority: parser.priority,\n subPriority: parser.subPriority || 0,\n set: parser.set,\n validate: parser.validate,\n value: parseResult.value,\n index: setters.length\n });\n dateString = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n } // Replace two single quote characters with one single quote character\n\n\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n } // Cut token from string, or, if string doesn't match the token, return Invalid Date\n\n\n if (dateString.indexOf(token) === 0) {\n dateString = dateString.slice(token.length);\n } else {\n return new Date(NaN);\n }\n }\n } // Check if the remaining input contains something other than whitespace\n\n\n if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {\n return new Date(NaN);\n }\n\n var uniquePrioritySetters = setters.map(function (setter) {\n return setter.priority;\n }).sort(function (a, b) {\n return b - a;\n }).filter(function (priority, index, array) {\n return array.indexOf(priority) === index;\n }).map(function (priority) {\n return setters.filter(function (setter) {\n return setter.priority === priority;\n }).sort(function (a, b) {\n return b.subPriority - a.subPriority;\n });\n }).map(function (setterArray) {\n return setterArray[0];\n });\n var date = toDate(dirtyReferenceDate);\n\n if (isNaN(date)) {\n return new Date(NaN);\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37\n\n\n var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));\n var flags = {};\n\n for (i = 0; i < uniquePrioritySetters.length; i++) {\n var setter = uniquePrioritySetters[i];\n\n if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {\n return new Date(NaN);\n }\n\n var result = setter.set(utcDate, flags, setter.value, subFnOptions); // Result is tuple (date, flags)\n\n if (result[0]) {\n utcDate = result[0];\n assign(flags, result[1]); // Result is date\n } else {\n utcDate = result;\n }\n }\n\n return utcDate;\n}\n\nfunction dateToSystemTimezone(date, flags) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n var convertedDate = new Date(0);\n convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());\n return convertedDate;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\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\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}","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}","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 Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Store from './store';\nimport { Collection, Place } from '@fleetbase/sdk';\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 getStores(params = {}) {\n return this.adapter.get('stores', params).then((stores) => {\n return new Collection(stores.map(attributes => {\n return new Store(attributes, this.adapter);\n }));\n });\n }\n\n getStoreLocations(params = {}) {\n return this.adapter.get('store-locations', params).then((locations) => {\n return new Collection(locations.map(attributes => {\n return new StoreLocation(attributes, this.adapter);\n }));\n });\n }\n \n getPaymentGateways() {\n return this.adapter.get('gateways').then((gateways) => {\n return new Collection(gateways.map(attributes => {\n return new PaymentGateway(attributes, this.adapter);\n }));\n });\n }\n}","import StorefrontStore from '../store';\nimport Cart from './cart';\nimport StoreLocation from './store-location';\nimport { ServiceQuote, ServiceRate, Place, Collection, Adapter } from '@fleetbase/sdk';\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 static getFromCart(adapter, ...params) {\n const quote = new DeliveryServiceQuote(adapter);\n\n return quote.fromCart(...params);\n }\n\n fromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n\n if (destination?.id) {\n destination = destination.id;\n }\n\n if (cart?.id) {\n cart = cart.id;\n }\n\n return this.adapter.get('service-quotes/from-cart', { origin, destination, cart, config, all }).then(serviceQuotes => {\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 });\n }\n}","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions, isResource, Order } from '@fleetbase/sdk';\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, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, 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 {\n Resolver,\n lookup\n};\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}","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\t * Builds an instance of the Fleetbase Storefront SDK\n\t *\n\t * @param {String} storeKey The access key for the storefront store\n\t * @param {Object} config The config object\n\t * @param {Boolean} debug Enable debug mode\n\t * @return {Storefront} Instance\n\t */\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"],"names":["isArray","Array","StorefrontResource","Resource","adapter","store","StorefrontStore","this","resource","onAfterFetch","syncAttributes","bind","actions","options","_this$options","reviewActions","StoreActions","count","storeId","params","get","namespace","Review","attributes","detectAdapter","isNodeEnvironment","lookup","isPhone","phone","test","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isKeyValid","key","length","startsWith","isEmpty","obj","none","size","objectType","Product","getAttribute","getAttributes","price","sale_price","isOnSale","id","then","reviews","Collection","map","_this","Category","category","products","customerActions","login","identity","password","post","Error","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","token","setHeaders","places","Place","_this2","orders","Order","_this3","cartActions","undefined","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","toInteger","dirtyNumber","NaN","number","Number","isNaN","Math","ceil","floor","requiredArgs","required","args","TypeError","toDate","argument","arguments","argStr","Object","prototype","toString","call","Date","getTime","console","warn","stack","addMilliseconds","dirtyDate","dirtyAmount","timestamp","getTimezoneOffsetInMilliseconds","date","utcDate","UTC","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isDate","value","isValid","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","result","tokenValue","replace","addSuffix","comparison","buildFormatLongFn","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","dirtyIndex","dirtyOptions","valuesArray","context","formattingValues","defaultFormattingWidth","_defaultWidth","_width","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","pattern","findKey","valueCallback","rest","slice","object","predicate","hasOwnProperty","array","formatDistance","formatRelative","_date","_baseDate","_options","localize","ordinalNumber","rem100","era","narrow","abbreviated","wide","quarter","month","day","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","weekStartsOn","firstWeekContainsDate","subMilliseconds","addLeadingZeros","targetLength","sign","output","abs","y","signedYear","getUTCFullYear","year","M","getUTCMonth","d","getUTCDate","a","dayPeriodEnumValue","getUTCHours","toUpperCase","h","H","m","getUTCMinutes","s","getUTCSeconds","S","numberOfDigits","milliseconds","getUTCMilliseconds","pow","startOfUTCISOWeek","getUTCDay","diff","setUTCDate","setUTCHours","getUTCISOWeekYear","fourthOfJanuaryOfNextYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","startOfUTCISOWeekYear","fourthOfJanuary","getUTCISOWeek","round","startOfUTCWeek","locale","localeWeekStartsOn","defaultWeekStartsOn","RangeError","getUTCWeekYear","localeFirstWeekContainsDate","defaultFirstWeekContainsDate","firstWeekOfNextYear","firstWeekOfThisYear","startOfUTCWeekYear","firstWeek","getUTCWeek","dayPeriodEnum","formatters","G","unit","lightFormatters","Y","signedWeekYear","weekYear","R","u","Q","q","L","w","week","I","isoWeek","D","dayOfYear","setUTCMonth","startOfYearTimestamp","difference","getUTCDayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","toLowerCase","b","hours","B","K","k","X","_localize","timezoneOffset","_originalDate","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","originalDate","T","offset","dirtyDelimiter","absOffset","minutes","delimiter","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeFormat","datePattern","timePattern","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","indexOf","isProtectedWeekYearToken","throwProtectedError","input","concat","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","dirtyFormatStr","formatStr","defaultLocale","formatterOptions","substring","firstCharacter","longFormatter","join","cleanEscapedString","formatter","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","assign","target","dirtyObject","property","setUTCDay","dirtyDay","currentDay","remainder","dayIndex","numericPatterns","timezonePatterns","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","enumValue","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","isLeapYearIndex","parsers","priority","parse","set","flags","incompatibleTokens","isTwoDigitYear","validate","normalizedTwoDigitYear","_match","_flags","firstWeekOfYear","dirtyWeek","setUTCWeek","dirtyISOWeek","setUTCISOWeek","subPriority","isLeapYear","wholeWeekDays","setUTCISODay","isPM","setUTCMinutes","setUTCSeconds","setUTCMilliseconds","timestampIsSet","_token","notWhitespaceRegExp","dirtyDateString","dirtyFormatString","dirtyReferenceDate","dateString","formatString","subFnOptions","setters","dateToSystemTimezone","tokens","usedTokens","parser","incompatibleToken","_i","usedToken","fullToken","push","uniquePrioritySetters","setter","sort","filter","setterArray","convertedDate","setFullYear","setHours","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","PaymentGateway","type","Store","storeLocations","place","gateways","_this4","_this5","Network","stores","locations","DeliveryServiceQuote","ServiceQuote","Adapter","origin","destination","cart","config","all","_origin","_destination","_cart","serviceQuotes","serviceQuote","quote","fromCart","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","resources","adapters","BrowserAdapter","NodeAdapter","Resolver","className","pluralize","singularize","extendStoreActions","json","classify","Storefront","storeKey","debug","version","host","publicKey","categories","extendActions","customers","checkout","product"],"mappings":"01PAAA,IAAQA,EAAYC,MAAZD,QAAAA,EAAAA,oBAAAA,eAAAA,EAAAA,6yrCCGaE,mBAA2BC,kHAOjCC,qBACFA,QAAUA,OACVC,MAAQ,IAAIC,GAAgBC,KAAKC,SAAUJ,EAAS,CACrDK,aAAcF,KAAKG,eAAeC,KAAKJ,MACvCK,kBAASL,KAAKM,4BAALC,EAAcF,UAGpBL,cCdTQ,GAAgB,IAAIC,GAAa,CACnCC,MAAO,SAAUC,OAASL,yDAAU,GAC1BM,EAAS,UAEXD,IACAC,EAAOd,MAAQa,GAGZX,KAAKH,QAAQgB,cAAOb,KAAKc,oBAAmBF,EAAQN,MAI9CS,mBAAenB,gCAC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AAW,IAAI1f,GAAQ0f,oCAQlE,SAAWriB,QACFA,QAAUA,4BAGnB,kBACWG,KAAKH,qCAThB,oBACe2hB,6BAAcra"} \ 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/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","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 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 getSavedPlaces() {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/places')\n .then((places) => {\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n });\n }\n\n getOrderHistory(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/orders', params)\n .then((orders) => {\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\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 getStores(params = {}) {\n return this.adapter.get('stores', params).then((stores) => {\n return new Collection(\n stores.map((attributes) => {\n return new Store(attributes, this.adapter);\n })\n );\n });\n }\n\n getStoreLocations(params = {}) {\n return this.adapter.get('store-locations', params).then((locations) => {\n return new Collection(\n locations.map((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateways() {\n return this.adapter.get('gateways').then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\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 static getFromCart(adapter, ...params) {\n const quote = new DeliveryServiceQuote(adapter);\n\n return quote.fromCart(...params);\n }\n\n fromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n\n if (destination?.id) {\n destination = destination.id;\n }\n\n if (cart?.id) {\n cart = cart.id;\n }\n\n return this.adapter\n .get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n })\n .then((serviceQuotes) => {\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 });\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","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","isEmpty","_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","token","setHeaders","_this2","places","Place","_this3","orders","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","toLowerCase","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","stores","locations","DeliveryServiceQuote","_ServiceQuote","ServiceQuote","Adapter","_possibleConstructorReturn","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","quote","_len","_key","fromCart","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","_this$store","_this$store2","resources","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":"+0HACsC,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,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lgB,EAAQkgB,EAAQ,IACxE,GACJ,GAAC,CAAAniB,IAAA,aAAAC,MAMD,SAAWC,GACPL,KAAKK,QAAUA,CACnB,GAAC,CAAAF,IAAA,aAAAC,MAED,WACI,OAAOJ,KAAKK,OAChB,IAAC,CAAA,CAAAF,IAAA,cAAAC,MAVD,WACI,OAAA+gB,EAAWM,EAAUxc,MAAA4B,UAAA4G,MAAA9L,KAAI1B,WAC7B,KAACwhB,CAAA,CA/C0B","x_google_ignoreList":[10,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]} \ No newline at end of file diff --git a/package.json b/package.json index 2d09a2a..02841fa 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,6 @@ }, "dependencies": { "@fleetbase/sdk": "1.2.7", - "date-fns": "^3.0.1" + "date-fns": "^3.0.5" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7324e84..cec1c3d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,8 +5,8 @@ dependencies: specifier: 1.2.7 version: 1.2.7 date-fns: - specifier: ^3.0.1 - version: 3.0.1 + specifier: ^3.0.5 + version: 3.0.5 devDependencies: '@babel/core': @@ -2101,8 +2101,8 @@ packages: which: 2.0.2 dev: true - /date-fns@3.0.1: - resolution: { integrity: sha512-cr9igCUa0QSqgAMj7JOrYTY6Nh1rmyGrFDko7ADqfmaQqP/I2N4rlfrLl7AWuzDaoIpz6MNjoEcTPzgZYIrhnA== } + /date-fns@3.0.5: + resolution: { integrity: sha512-Q4Tq5c5s/Zl/zbgdWf6pejn9ru7UwdIlLfvEEg1hVsQNQ7LKt76qIduagIT9OPK7+JCv1mAKherdU6bOqGYDnw== } dev: false /debug@3.2.7: diff --git a/rollup.config.js b/rollup.config.js index c19e62f..c5cd6e4 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,13 +1,11 @@ -// rollup.config.js -import { terser } from 'rollup-plugin-terser'; -// import { eslint } from 'rollup-plugin-eslint'; -import { nodeResolve } from '@rollup/plugin-node-resolve'; -import babel from '@rollup/plugin-babel'; -import pkg from './package.json'; +const { terser } = require('rollup-plugin-terser'); +const { nodeResolve } = require('@rollup/plugin-node-resolve'); +const babel = require('@rollup/plugin-babel'); +const pkg = require('./package.json'); const input = ['src/storefront.js']; -export default [ +module.exports = [ { // umd input, diff --git a/src/resources/checkout.js b/src/resources/checkout.js index 9b72acc..f3edfb0 100644 --- a/src/resources/checkout.js +++ b/src/resources/checkout.js @@ -1,6 +1,5 @@ +import { Order, StoreActions, isResource } from '@fleetbase/sdk'; import Resource from '../resource'; -import Product from './product'; -import { StoreActions, isResource, Order } from '@fleetbase/sdk'; const checkoutActions = new StoreActions({ create: undefined, diff --git a/src/resources/customer.js b/src/resources/customer.js index 678d6a1..5fa0e52 100644 --- a/src/resources/customer.js +++ b/src/resources/customer.js @@ -1,6 +1,6 @@ -import StorefrontStore from '../store'; +import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk'; import Resource from '../resource'; -import { Contact, Place, Order, Collection, StoreActions } from '@fleetbase/sdk'; +import StorefrontStore from '../store'; import { isPhone } from '../utils'; const customerActions = new StoreActions({ diff --git a/src/resources/delivery-service-quote.js b/src/resources/delivery-service-quote.js index e1f457a..0707b0d 100644 --- a/src/resources/delivery-service-quote.js +++ b/src/resources/delivery-service-quote.js @@ -1,7 +1,5 @@ +import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk'; import StorefrontStore from '../store'; -import Cart from './cart'; -import StoreLocation from './store-location'; -import { ServiceQuote, ServiceRate, Place, Collection, Adapter } from '@fleetbase/sdk'; import { formatCurrency, isEmpty } from '../utils'; const { isArray } = Array; diff --git a/src/resources/network.js b/src/resources/network.js index 8026bbe..ef4a80e 100644 --- a/src/resources/network.js +++ b/src/resources/network.js @@ -1,8 +1,8 @@ +import { Collection } from '@fleetbase/sdk'; import Resource from '../resource'; -import StoreLocation from './store-location'; import PaymentGateway from './payment-gateway'; import Store from './store'; -import { Collection, Place } from '@fleetbase/sdk'; +import StoreLocation from './store-location'; export default class Network extends Resource { constructor(attributes = {}, adapter, options = {}) { From 48fc2be8b8cebd4bf8c73641c1e162f94715eeaf Mon Sep 17 00:00:00 2001 From: Turtuvshin Date: Fri, 22 Dec 2023 15:09:16 +0800 Subject: [PATCH 3/7] refactor: enhanced functionalities and error handling in Customer, Network, and DeliveryService classes --- src/resources/customer.js | 41 ++++++++++++++++--------- src/resources/delivery-service-quote.js | 36 +++++++++++----------- src/resources/network.js | 40 ++++++++++-------------- 3 files changed, 60 insertions(+), 57 deletions(-) diff --git a/src/resources/customer.js b/src/resources/customer.js index 5fa0e52..e7d63de 100644 --- a/src/resources/customer.js +++ b/src/resources/customer.js @@ -66,7 +66,7 @@ export default class Customer extends Resource { return this.getAttribute('token'); } - syncDevice(token) { + async syncDevice(token) { return this.adapter .setHeaders({ 'Customer-Token': this.token }) .post('customers/register-device', token) @@ -75,22 +75,33 @@ export default class Customer extends Resource { }); } - getSavedPlaces() { - return this.adapter - .setHeaders({ 'Customer-Token': this.token }) - .get('customers/places') - .then((places) => { - return new Collection(places.map((attributes) => new Place(attributes, this.adapter))); - }); + async performAuthorizedRequest(endpoint, params = {}, method = 'GET') { + try { + const headers = { 'Customer-Token': this.token }; + const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params); + return response; + } catch (error) { + console.error(`Error in ${method} request to ${endpoint}:`, error); + throw error; + } } - getOrderHistory(params = {}) { - return this.adapter - .setHeaders({ 'Customer-Token': this.token }) - .get('customers/orders', params) - .then((orders) => { - return new Collection(orders.map((attributes) => new Order(attributes, this.adapter))); - }); + async getSavedPlaces() { + try { + const places = await this.performAuthorizedRequest('customers/places'); + return new Collection(places.map((attributes) => new Place(attributes, this.adapter))); + } catch (error) { + throw new Error('Failed to retrieve saved places'); + } + } + + async getOrderHistory(params = {}) { + try { + const orders = await this.performAuthorizedRequest('customers/orders', params); + return new Collection(orders.map((attributes) => new Order(attributes, this.adapter))); + } catch (error) { + throw new Error('Failed to retrieve order history'); + } } } diff --git a/src/resources/delivery-service-quote.js b/src/resources/delivery-service-quote.js index 0707b0d..24f490a 100644 --- a/src/resources/delivery-service-quote.js +++ b/src/resources/delivery-service-quote.js @@ -39,39 +39,39 @@ export default class DeliveryServiceQuote extends ServiceQuote { return formatCurrency(amount / 100, currency); } - static getFromCart(adapter, ...params) { - const quote = new DeliveryServiceQuote(adapter); - - return quote.fromCart(...params); - } - - fromCart(origin, destination, cart, config = 'storefront', all = false) { + async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) { if (origin?.id) { origin = origin.id; } - if (destination?.id) { destination = destination.id; } - if (cart?.id) { cart = cart.id; } - return this.adapter - .get('service-quotes/from-cart', { + try { + const serviceQuotes = await this.adapter.get('service-quotes/from-cart', { origin, destination, cart, config, all, - }) - .then((serviceQuotes) => { - if (isArray(serviceQuotes)) { - return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter))); - } - - return new DeliveryServiceQuote(serviceQuotes, this.adapter); }); + + if (isArray(serviceQuotes)) { + return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter))); + } + + return new DeliveryServiceQuote(serviceQuotes, this.adapter); + } catch (error) { + console.error('Error fetching service quotes:', error); + throw error; + } + } + + static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) { + const quote = new DeliveryServiceQuote(adapter); + return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all); } } diff --git a/src/resources/network.js b/src/resources/network.js index ef4a80e..094441f 100644 --- a/src/resources/network.js +++ b/src/resources/network.js @@ -13,33 +13,25 @@ export default class Network extends Resource { return this.adapter.get('tags', params); } - getStores(params = {}) { - return this.adapter.get('stores', params).then((stores) => { - return new Collection( - stores.map((attributes) => { - return new Store(attributes, this.adapter); - }) - ); - }); + async getResourceCollection(endpoint, ResourceClass, params = {}) { + try { + const resources = await this.adapter.get(endpoint, params); + return new Collection(resources.map((attributes) => new ResourceClass(attributes, this.adapter))); + } catch (error) { + console.error(`Error fetching ${endpoint}:`, error); + throw error; + } } - getStoreLocations(params = {}) { - return this.adapter.get('store-locations', params).then((locations) => { - return new Collection( - locations.map((attributes) => { - return new StoreLocation(attributes, this.adapter); - }) - ); - }); + async getStores(params = {}) { + return this.getResourceCollection('stores', Store, params); } - getPaymentGateways() { - return this.adapter.get('gateways').then((gateways) => { - return new Collection( - gateways.map((attributes) => { - return new PaymentGateway(attributes, this.adapter); - }) - ); - }); + async getStoreLocations(params = {}) { + return this.getResourceCollection('store-locations', StoreLocation, params); + } + + async getPaymentGateways() { + return this.getResourceCollection('gateways', PaymentGateway); } } From 865cef287f078d0d608bea8cd268cf8a37ac5cde Mon Sep 17 00:00:00 2001 From: Turtuvshin Date: Fri, 22 Dec 2023 15:32:24 +0800 Subject: [PATCH 4/7] generate type declarations --- 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 | 5 +- pnpm-lock.yaml | 9 ++++ tsconfig.json | 10 ++++ types/cart-store.d.ts | 13 ++++++ types/customer-store.d.ts | 7 +++ types/resolver.d.ts | 33 +++++++++++++ types/resource.d.ts | 2 + types/resources.d.ts | 13 ++++++ types/resources/cart.d.ts | 16 +++++++ types/resources/category.d.ts | 5 ++ types/resources/checkout.d.ts | 8 ++++ types/resources/customer.d.ts | 12 +++++ types/resources/delivery-service-quote.d.ts | 16 +++++++ types/resources/network.d.ts | 10 ++++ types/resources/payment-gateway.d.ts | 16 +++++++ types/resources/product.d.ts | 10 ++++ types/resources/review.d.ts | 9 ++++ types/resources/store-hour.d.ts | 15 ++++++ types/resources/store-location.d.ts | 14 ++++++ types/resources/store.d.ts | 9 ++++ types/store.d.ts | 5 ++ types/storefront.d.ts | 52 +++++++++++++++++++++ types/utils/detect-adapter.d.ts | 2 + types/utils/format-currency.d.ts | 1 + types/utils/get-countries.d.ts | 2 + types/utils/index.d.ts | 7 +++ types/utils/is-email.d.ts | 2 + types/utils/is-empty.d.ts | 2 + types/utils/is-key-valid.d.ts | 2 + types/utils/is-phone.d.ts | 2 + 36 files changed, 313 insertions(+), 8 deletions(-) create mode 100644 tsconfig.json create mode 100644 types/cart-store.d.ts create mode 100644 types/customer-store.d.ts create mode 100644 types/resolver.d.ts create mode 100644 types/resource.d.ts create mode 100644 types/resources.d.ts create mode 100644 types/resources/cart.d.ts create mode 100644 types/resources/category.d.ts create mode 100644 types/resources/checkout.d.ts create mode 100644 types/resources/customer.d.ts create mode 100644 types/resources/delivery-service-quote.d.ts create mode 100644 types/resources/network.d.ts create mode 100644 types/resources/payment-gateway.d.ts create mode 100644 types/resources/product.d.ts create mode 100644 types/resources/review.d.ts create mode 100644 types/resources/store-hour.d.ts create mode 100644 types/resources/store-location.d.ts create mode 100644 types/resources/store.d.ts create mode 100644 types/store.d.ts create mode 100644 types/storefront.d.ts create mode 100644 types/utils/detect-adapter.d.ts create mode 100644 types/utils/format-currency.d.ts create mode 100644 types/utils/get-countries.d.ts create mode 100644 types/utils/index.d.ts create mode 100644 types/utils/is-email.d.ts create mode 100644 types/utils/is-empty.d.ts create mode 100644 types/utils/is-key-valid.d.ts create mode 100644 types/utils/is-phone.d.ts diff --git a/dist/@fleetbase/storefront.min.js b/dist/@fleetbase/storefront.min.js index aab9a64..61cc219 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 n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function r(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:{},n={};return t&&(n.store=t),this.adapter.get("".concat(this.namespace,"/count"),n,e)}}),b=function(t){c(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,r,"review",a)}return s(n,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),n}(p);function k(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:n}).format(t)}var x=function(t){c(r,t);var n=m(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,r),n.call(this,t,e,"product",a)}return s(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"]),n=t.price,r=t.sale_price,a=t.currency;return this.isOnSale?e.isEmpty(r)||e.isEmpty(a)?null:k(r/100,a):e.isEmpty(n)||e.isEmpty(a)?null:k(n/100,a)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(n){return new e.Collection(n.map((function(e){return new b(e,t.adapter)})))}))}}]),r}(p),T=function(t){c(r,t);var n=m(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,r),n.call(this,t,e,"category",a)}return s(r,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(n){return new e.Collection(n.map((function(e){return new x(e,t.adapter)})))}))}}]),r}(p),M=new e.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)}}),D=function(t){c(a,t);var n=m(a);function a(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,a),n.call(this,t,e,"customer",r({actions:M},i))}return s(a,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ce(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:function(t){var e=this;return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",t).then((function(){return e}))}},{key:"getSavedPlaces",value:function(){var t=this;return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/places").then((function(n){return new e.Collection(n.map((function(n){return new e.Place(n,t.adapter)})))}))}},{key:"getOrderHistory",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/orders",n).then((function(n){return new e.Collection(n.map((function(n){return new e.Order(n,t.adapter)})))}))}}]),a}(p),P=Array.isArray,S=new e.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,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),r(r({},a),{},{quantity:n}),o).then(this.afterFetch.bind(this))},update:function(t,e,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),r(r({},a),{},{quantity:n}),o).then(this.afterFetch.bind(this))},remove:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},n).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)}}),O=function(t){c(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,a,"cart",r({actions:S},i))}return s(n,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof x&&(t=t.id),this.store.add(this.id,t,e,n,r)}},{key:"update",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,n,r)}},{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!P(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),n}(p),A=function(t){c(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,r,"payment-gateway",a)}return s(n,[{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!")}}]),n}(p);function E(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 H(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function q(t,e){const n=E(t);return isNaN(e)?H(t,NaN):e?(n.setDate(n.getDate()+e),n):n}const Y=6048e5,C=864e5;let N={};function W(){return N}function j(t,e){const n=W(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=E(t),o=a.getDay(),i=(o=a.getTime()?n+1:e.getTime()>=i.getTime()?n:n-1}function L(t){const e=E(t);return e.setHours(0,0,0,0),e}function Q(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 I(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 n=E(t);return!isNaN(Number(n))}const G={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 B(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const X={date:B({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:B({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:B({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},z={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function _(t){return(e,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,a=n?.width?String(n.width):e;r=t.formattingValues[a]||t.formattingValues[e]}else{const e=t.defaultWidth,a=n?.width?String(n.width):t.defaultWidth;r=t.values[a]||t.values[e]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function $(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;const i=o[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let n=0;nt.test(i))):function(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var K;const U={code:"en-US",formatDistance:(t,e,n)=>{let r;const a=G[t];return r="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:X,formatRelative:(t,e,n,r)=>z[t],localize:{ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:_({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:_({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:_({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:_({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:_({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:(K={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const n=t.match(K.matchPattern);if(!n)return null;const r=n[0],a=t.match(K.parsePattern);if(!a)return null;let o=K.valueCallback?K.valueCallback(a[0]):a[0];return o=e.valueCallback?e.valueCallback(o):o,{value:o,rest:t.slice(r.length)}}),era:$({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:$({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:$({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:$({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:$({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 J(t){const e=E(t),n=function(t,e){const n=L(t),r=L(e),a=n.getTime()-Q(n),o=r.getTime()-Q(r);return Math.round((a-o)/C)}(e,function(t){const e=E(t),n=H(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}(e));return n+1}function V(t){const e=E(t),n=R(e).getTime()-function(t){const e=F(t),n=H(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),R(n)}(e).getTime();return Math.round(n/Y)+1}function Z(t,e){const n=E(t),r=n.getFullYear(),a=W(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=H(t,0);i.setFullYear(r+1,0,o),i.setHours(0,0,0,0);const s=j(i,e),u=H(t,0);u.setFullYear(r,0,o),u.setHours(0,0,0,0);const c=j(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function tt(t,e){const n=E(t),r=j(n,e).getTime()-function(t,e){const n=W(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=Z(t,e),o=H(t,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),j(o,e)}(n,e).getTime();return Math.round(r/Y)+1}function et(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const nt={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return et("yy"===e?r%100:r,e.length)},M(t,e){const n=t.getMonth();return"M"===e?String(n+1):et(n+1,2)},d:(t,e)=>et(t.getDate(),e.length),a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(t,e)=>et(t.getHours()%12||12,e.length),H:(t,e)=>et(t.getHours(),e.length),m:(t,e)=>et(t.getMinutes(),e.length),s:(t,e)=>et(t.getSeconds(),e.length),S(t,e){const n=e.length,r=t.getMilliseconds();return et(Math.floor(r*Math.pow(10,n-3)),e.length)}},rt="midnight",at="noon",ot="morning",it="afternoon",st="evening",ut="night",ct={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){const e=t.getFullYear(),r=e>0?e:1-e;return n.ordinalNumber(r,{unit:"year"})}return nt.y(t,e)},Y:function(t,e,n,r){const a=Z(t,r),o=a>0?a:1-a;if("YY"===e){return et(o%100,2)}return"Yo"===e?n.ordinalNumber(o,{unit:"year"}):et(o,e.length)},R:function(t,e){return et(F(t),e.length)},u:function(t,e){return et(t.getFullYear(),e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return et(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return et(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return nt.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return et(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=tt(t,r);return"wo"===e?n.ordinalNumber(a,{unit:"week"}):et(a,e.length)},I:function(t,e,n){const r=V(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):et(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getDate(),{unit:"date"}):nt.d(t,e)},D:function(t,e,n){const r=J(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):et(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return et(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return et(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=0===r?7:r;switch(e){case"i":return String(a);case"ii":return et(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(a=12===r?at:0===r?rt:r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(a=r>=17?st:r>=12?it:r>=4?ot:ut,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),n.ordinalNumber(e,{unit:"hour"})}return nt.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getHours(),{unit:"hour"}):nt.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):et(r,e.length)},k:function(t,e,n){let r=t.getHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):et(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):nt.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getSeconds(),{unit:"second"}):nt.s(t,e)},S:function(t,e){return nt.S(t,e)},X:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return lt(a);case"XXXX":case"XX":return ht(a);default:return ht(a,":")}},x:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return lt(a);case"xxxx":case"xx":return ht(a);default:return ht(a,":")}},O:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+dt(a,":");default:return"GMT"+ht(a,":")}},z:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+dt(a,":");default:return"GMT"+ht(a,":")}},t:function(t,e,n,r){const a=r._originalDate||t;return et(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,n,r){return et((r._originalDate||t).getTime(),e.length)}};function dt(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.floor(r/60),o=r%60;return 0===o?n+String(a):n+String(a)+e+et(o,2)}function lt(t,e){if(t%60==0){return(t>0?"-":"+")+et(Math.abs(t)/60,2)}return ht(t,e)}function ht(t,e=""){const n=t>0?"-":"+",r=Math.abs(t);return n+et(Math.floor(r/60),2)+e+et(r%60,2)}const ft=(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"})}},gt=(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"})}},mt={p:gt,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return ft(t,e);let o;switch(r){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}}",ft(r,e)).replace("{{time}}",gt(a,e))}},wt=["D","DD"],yt=["YY","YYYY"];function pt(t){return-1!==wt.indexOf(t)}function vt(t){return-1!==yt.indexOf(t)}function bt(t,e,n){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${n}\`; 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 \`${n}\`; 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 \`${n}\`; 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 \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const kt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Tt=/^'([^]*?)'?$/,Mt=/''/g,Dt=/[a-zA-Z]/;function Pt(t,e,n){const r=W(),a=n?.locale??r.locale??U,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=E(t);if(!I(s))throw new RangeError("Invalid time value");const u={firstWeekContainsDate:o,weekStartsOn:i,locale:a,_originalDate:s};return e.match(xt).map((function(t){const e=t[0];if("p"===e||"P"===e){return(0,mt[e])(t,a.formatLong)}return t})).join("").match(kt).map((function(r){if("''"===r)return"'";const o=r[0];if("'"===o)return function(t){const e=t.match(Tt);if(!e)return t;return e[1].replace(Mt,"'")}(r);const i=ct[o];if(i)return!n?.useAdditionalWeekYearTokens&&vt(r)&&bt(r,e,String(t)),!n?.useAdditionalDayOfYearTokens&&pt(r)&&bt(r,e,String(t)),i(s,r,a.localize,u);if(o.match(Dt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}class St{subPriority=0;validate(t,e){return!0}}class Ot extends St{constructor(t,e,n,r,a){super(),this.value=t,this.validateValue=e,this.setValue=n,this.priority=r,a&&(this.subPriority=a)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,n){return this.setValue(t,e,this.value,n)}}class At extends St{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:H(t,function(t,e){const n=e instanceof Date?H(e,0):new e(0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),n}(t,Date))}}class Et{run(t,e,n,r){const a=this.parse(t,e,n,r);return a?{setter:new Ot(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(t,e,n){return!0}}const Ht=/^(1[0-2]|0?\d)/,qt=/^(3[0-1]|[0-2]?\d)/,Yt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Ct=/^(5[0-3]|[0-4]?\d)/,Nt=/^(2[0-3]|[0-1]?\d)/,Wt=/^(2[0-4]|[0-1]?\d)/,jt=/^(1[0-1]|0?\d)/,Rt=/^(1[0-2]|0?\d)/,Ft=/^[0-5]?\d/,Lt=/^[0-5]?\d/,Qt=/^\d/,It=/^\d{1,2}/,Gt=/^\d{1,3}/,Bt=/^\d{1,4}/,Xt=/^-?\d+/,zt=/^-?\d/,_t=/^-?\d{1,2}/,$t=/^-?\d{1,3}/,Kt=/^-?\d{1,4}/,Ut=/^([+-])(\d{2})(\d{2})?|Z/,Jt=/^([+-])(\d{2})(\d{2})|Z/,Vt=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,Zt=/^([+-])(\d{2}):(\d{2})|Z/,te=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function ee(t,e){return t?{value:e(t.value),rest:t.rest}:t}function ne(t,e){const n=e.match(t);return n?{value:parseInt(n[0],10),rest:e.slice(n[0].length)}:null}function re(t,e){const n=e.match(t);if(!n)return null;if("Z"===n[0])return{value:0,rest:e.slice(1)};return{value:("+"===n[1]?1:-1)*(36e5*(n[2]?parseInt(n[2],10):0)+6e4*(n[3]?parseInt(n[3],10):0)+1e3*(n[5]?parseInt(n[5],10):0)),rest:e.slice(n[0].length)}}function ae(t){return ne(Xt,t)}function oe(t,e){switch(t){case 1:return ne(Qt,e);case 2:return ne(It,e);case 3:return ne(Gt,e);case 4:return ne(Bt,e);default:return ne(new RegExp("^\\d{1,"+t+"}"),e)}}function ie(t,e){switch(t){case 1:return ne(zt,e);case 2:return ne(_t,e);case 3:return ne($t,e);case 4:return ne(Kt,e);default:return ne(new RegExp("^-?\\d{1,"+t+"}"),e)}}function se(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function ue(t,e){const n=e>0,r=n?e:1-e;let a;if(r<=50)a=t||100;else{const e=r+50;a=t+100*Math.floor(e/100)-(t>=e%100?100:0)}return n?a:1-a}function ce(t){return t%400==0||t%4==0&&t%100!=0}const de=[31,28,31,30,31,30,31,31,30,31,30,31],le=[31,29,31,30,31,30,31,31,30,31,30,31];function he(t,e,n){const r=W(),a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=E(t),i=o.getDay(),s=7-a;return q(o,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function fe(t,e){const n=E(t),r=function(t){let e=E(t).getDay();return 0===e&&(e=7),e}(n);return q(n,e-r)}const ge={G:new class extends Et{priority=140;parse(t,e,n){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}}set(t,e,n){return e.era=n,t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Et{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,n){const r=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return ee(oe(4,t),r);case"yo":return ee(n.ordinalNumber(t,{unit:"year"}),r);default:return ee(oe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n){const r=t.getFullYear();if(n.isTwoDigitYear){const e=ue(n.year,r);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const a="era"in e&&1!==e.era?1-n.year:n.year;return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Et{priority=130;parse(t,e,n){const r=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return ee(oe(4,t),r);case"Yo":return ee(n.ordinalNumber(t,{unit:"year"}),r);default:return ee(oe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n,r){const a=Z(t,r);if(n.isTwoDigitYear){const e=ue(n.year,a);return t.setFullYear(e,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),j(t,r)}const o="era"in e&&1!==e.era?1-n.year:n.year;return t.setFullYear(o,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),j(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Et{priority=130;parse(t,e){return ie("R"===e?4:e.length,t)}set(t,e,n){const r=H(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),R(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Et{priority=130;parse(t,e){return ie("u"===e?4:e.length,t)}set(t,e,n){return t.setFullYear(n,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 Et{priority=120;parse(t,e,n){switch(e){case"Q":case"QQ":return oe(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth(3*(n-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 Et{priority=120;parse(t,e,n){switch(e){case"q":case"qq":return oe(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth(3*(n-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 Et{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,n){const r=t=>t-1;switch(e){case"M":return ee(ne(Ht,t),r);case"MM":return ee(oe(2,t),r);case"Mo":return ee(n.ordinalNumber(t,{unit:"month"}),r);case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}},L:new class extends Et{priority=110;parse(t,e,n){const r=t=>t-1;switch(e){case"L":return ee(ne(Ht,t),r);case"LL":return ee(oe(2,t),r);case"Lo":return ee(n.ordinalNumber(t,{unit:"month"}),r);case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,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 Et{priority=100;parse(t,e,n){switch(e){case"w":return ne(Ct,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return oe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n,r){return j(function(t,e,n){const r=E(t),a=tt(r,n)-e;return r.setDate(r.getDate()-7*a),r}(t,n,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Et{priority=100;parse(t,e,n){switch(e){case"I":return ne(Ct,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return oe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n){return R(function(t,e){const n=E(t),r=V(n)-e;return n.setDate(n.getDate()-7*r),n}(t,n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Et{priority=90;subPriority=1;parse(t,e,n){switch(e){case"d":return ne(qt,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return oe(e.length,t)}}validate(t,e){const n=ce(t.getFullYear()),r=t.getMonth();return n?e>=1&&e<=le[r]:e>=1&&e<=de[r]}set(t,e,n){return t.setDate(n),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Et{priority=90;subpriority=1;parse(t,e,n){switch(e){case"D":case"DD":return ne(Yt,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return oe(e.length,t)}}validate(t,e){return ce(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,n){return t.setMonth(0,n),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 Et{priority=90;parse(t,e,n){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=he(t,n,r)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Et{priority=90;parse(t,e,n,r){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return ee(oe(e.length,t),a);case"eo":return ee(n.ordinalNumber(t,{unit:"day"}),a);case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=he(t,n,r)).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 Et{priority=90;parse(t,e,n,r){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return ee(oe(e.length,t),a);case"co":return ee(n.ordinalNumber(t,{unit:"day"}),a);case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=he(t,n,r)).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 Et{priority=90;parse(t,e,n){const r=t=>0===t?7:t;switch(e){case"i":case"ii":return oe(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return ee(n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return ee(n.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return ee(n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r);default:return ee(n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,e){return e>=1&&e<=7}set(t,e,n){return(t=fe(t,n)).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 Et{priority=80;parse(t,e,n){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(se(n),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Et{priority=80;parse(t,e,n){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(se(n),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Et{priority=80;parse(t,e,n){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(se(n),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Et{priority=70;parse(t,e,n){switch(e){case"h":return ne(Rt,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return oe(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,n){const r=t.getHours()>=12;return r&&n<12?t.setHours(n+12,0,0,0):r||12!==n?t.setHours(n,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Et{priority=70;parse(t,e,n){switch(e){case"H":return ne(Nt,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return oe(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,n){return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Et{priority=70;parse(t,e,n){switch(e){case"K":return ne(jt,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return oe(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.getHours()>=12&&n<12?t.setHours(n+12,0,0,0):t.setHours(n,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Et{priority=70;parse(t,e,n){switch(e){case"k":return ne(Wt,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return oe(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,n){const r=n<=24?n%24:n;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Et{priority=60;parse(t,e,n){switch(e){case"m":return ne(Ft,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return oe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setMinutes(n,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Et{priority=50;parse(t,e,n){switch(e){case"s":return ne(Lt,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return oe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setSeconds(n,0),t}incompatibleTokens=["t","T"]},S:new class extends Et{priority=30;parse(t,e){return ee(oe(e.length,t),(t=>Math.floor(t*Math.pow(10,3-e.length))))}set(t,e,n){return t.setMilliseconds(n),t}incompatibleTokens=["t","T"]},X:new class extends Et{priority=10;parse(t,e){switch(e){case"X":return re(Ut,t);case"XX":return re(Jt,t);case"XXXX":return re(Vt,t);case"XXXXX":return re(te,t);default:return re(Zt,t)}}set(t,e,n){return e.timestampIsSet?t:H(t,t.getTime()-Q(t)-n)}incompatibleTokens=["t","T","x"]},x:new class extends Et{priority=10;parse(t,e){switch(e){case"x":return re(Ut,t);case"xx":return re(Jt,t);case"xxxx":return re(Vt,t);case"xxxxx":return re(te,t);default:return re(Zt,t)}}set(t,e,n){return e.timestampIsSet?t:H(t,t.getTime()-Q(t)-n)}incompatibleTokens=["t","T","X"]},t:new class extends Et{priority=40;parse(t){return ae(t)}set(t,e,n){return[H(t,1e3*n),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Et{priority=20;parse(t){return ae(t)}set(t,e,n){return[H(t,n),{timestampIsSet:!0}]}incompatibleTokens="*"}},me=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,we=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ye=/^'([^]*?)'?$/,pe=/''/g,ve=/\S/,be=/[a-zA-Z]/;function ke(t,e,n,r){const a=Object.assign({},W()),o=r?.locale??a.locale??U,i=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(""===e)return""===t?E(n):H(n,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:o},c=[new At],d=e.match(we).map((t=>{const e=t[0];if(e in mt){return(0,mt[e])(t,o.formatLong)}return t})).join("").match(me),l=[];for(let a of d){!r?.useAdditionalWeekYearTokens&&vt(a)&&bt(a,e,t),!r?.useAdditionalDayOfYearTokens&&pt(a)&&bt(a,e,t);const i=a[0],s=ge[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 \`${a}\` at the same time`)}else if("*"===s.incompatibleTokens&&l.length>0)throw new RangeError(`The format string mustn't contain \`${a}\` and any other token at the same time`);l.push({token:i,fullToken:a});const r=s.run(t,a,o.match,u);if(!r)return H(n,NaN);c.push(r.setter),t=r.rest}else{if(i.match(be))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");if("''"===a?a="'":"'"===i&&(a=a.match(ye)[1].replace(pe,"'")),0!==t.indexOf(a))return H(n,NaN);t=t.slice(a.length)}}if(t.length>0&&ve.test(t))return H(n,NaN);const h=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,n)=>n.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=E(n);if(isNaN(f.getTime()))return H(n,NaN);const g={};for(const t of h){if(!t.validate(f,u))return H(n,NaN);const e=t.set(f,g,u);Array.isArray(e)?(f=e[0],Object.assign(g,e[1])):f=e}return H(n,f)}var xe=function(t){c(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,r,"store-hour",a)}return s(n,[{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,n=Math.abs(t-e);return Math.floor(n/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 ke(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 ke(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return I(this.startDateInstance)&&I(this.endDateInstance)?"".concat(Pt(this.startDateInstance,"p")," - ").concat(Pt(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!")}}]),n}(p),Te=function(t){c(r,t);var n=m(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,r),n.call(this,t,e,"store-location",a)}return s(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 e.Collection(this.getAttribute("hours").map((function(t){return new xe(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=Pt(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},n=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],r=0;r0&&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 o(this,a),n.call(this,t,e,"store",r)}return s(a,[{key:"getReviews",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",r({store:this.id},n)).then((function(n){return new e.Collection(n.map((function(e){return new b(e,t.adapter)})))}))}},{key:"getLocations",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",r({store:this.id},n)).then((function(n){return new e.Collection(n.map((function(n){return n.place&&(n.place=new e.Place(n.place)),new Te(n,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 Te(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",n).then((function(n){return new e.Collection(n.map((function(e){return new A(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new A(t,e.adapter)}))}}]),a}(p),De=function(t){c(r,t);var n=m(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,r),n.call(this,t,e,"network",a)}return s(r,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getStores",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("stores",n).then((function(n){return new e.Collection(n.map((function(e){return new Me(e,t.adapter)})))}))}},{key:"getStoreLocations",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("store-locations",n).then((function(n){return new e.Collection(n.map((function(e){return new Te(e,t.adapter)})))}))}},{key:"getPaymentGateways",value:function(){var t=this;return this.adapter.get("gateways").then((function(n){return new e.Collection(n.map((function(e){return new A(e,t.adapter)})))}))}}]),r}(p),Pe=Array.isArray,Se=function(t){c(r,t);var n=m(r);function r(){var t,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,r),a instanceof e.Adapter?g(t,t=n.call(this,{},a,"service-quote",s)):n.call(this,a,i,"service-quote",s)}return s(r,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ce(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"]),n=t.amount,r=t.currency;return e.isEmpty(n)||e.isEmpty(r)?null:k(n/100,r)}},{key:"fromCart",value:function(t,n,a){var o,i,s,u=this,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"storefront",d=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return null!==(o=t)&&void 0!==o&&o.id&&(t=t.id),null!==(i=n)&&void 0!==i&&i.id&&(n=n.id),null!==(s=a)&&void 0!==s&&s.id&&(a=a.id),this.adapter.get("service-quotes/from-cart",{origin:t,destination:n,cart:a,config:c,all:d}).then((function(t){return Pe(t)?new e.Collection(t.map((function(t){return new r(t,u.adapter)}))):new r(t,u.adapter)}))}}],[{key:"getFromCart",value:function(t){for(var e=new r(t),n=arguments.length,a=new Array(n>1?n-1:0),o=1;o4&&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(n)&&(n=n.id),e.isResource(a)&&(a=a.id),e.isResource(o)&&(o=o.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),r(r({},i),{},{customer:t,cart:n,serviceQuote:a,gateway:o}),s)},captureOrder:function(t){var n=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:n},r).then((function(t){return new e.Order(t)}))}}),Ae=function(t){c(n,t);var e=m(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,r,"checkout",a)}return s(n,[{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)}}]),n}(p),Ee={Product:x,Category:T,Customer:D,Cart:O,DeliveryServiceQuote:Se,Store:Me,StoreLocation:Te,StoreHour:xe,Checkout:Ae,Review:b},He={BrowserAdapter:e.BrowserAdapter,NodeAdapter:e.NodeAdapter},qe=function(){function t(){return o(this,t),this.resources=Ee,this.adapters=He,this.lookup.apply(this,arguments)}return s(t,[{key:"lookup",value:function(t,n){var r=e.pluralize(t),a=Array.prototype.slice.call(arguments).slice(2);if(!this[r])throw new Error("Attempted to resolve invalid type");if(!this[r][n])throw new Error("No ".concat(e.singularize(t)," named ").concat(n," to resolve"));return f(this[r][n],w(a))}}]),t}(),Ye=function(){return f(qe,Array.prototype.slice.call(arguments))},Ce=function(t){c(r,t);var n=m(r);function r(){return o(this,r),n.apply(this,arguments)}return s(r,[{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 Ye("resource",e.classify(this.resource),t,this.adapter)}}]),r}(e.Store),Ne=function(){function t(n){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(o(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:n,debug:i},!("string"==typeof(r=n)&&r.length>30&&(r.startsWith("store_")||r.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 e.isNodeEnvironment()?Ye("adapter","NodeAdapter",t):Ye("adapter","BrowserAdapter",t)}(this.options),this.products=new Ce("product",this.adapter),this.categories=new Ce("category",this.adapter),this.reviews=new Ce("review",this.adapter).extendActions(v),this.customers=new Ce("customer",this.adapter).extendActions(M),this.cart=new Ce("cart",this.adapter).extendActions(S),this.checkout=new Ce("checkout",this.adapter).extendActions(Oe)}return s(t,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"search",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",r({query:t},n)).then((function(t){return new e.Collection(t.map((function(t){return new x(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return f(t,Array.prototype.slice.call(arguments))}}]),t}();t.Cart=O,t.Category=T,t.Checkout=Ae,t.Customer=D,t.DeliveryServiceQuote=Se,t.Network=De,t.PaymentGateway=A,t.Product=x,t.Review=b,t.Store=Me,t.StoreHour=xe,t.StoreLocation=Te,t.default=Ne})); +!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})); //# sourceMappingURL=storefront.min.js.map diff --git a/dist/@fleetbase/storefront.min.js.map b/dist/@fleetbase/storefront.min.js.map index 991e401..5a9a72c 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/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","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 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 getSavedPlaces() {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/places')\n .then((places) => {\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n });\n }\n\n getOrderHistory(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/orders', params)\n .then((orders) => {\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\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 getStores(params = {}) {\n return this.adapter.get('stores', params).then((stores) => {\n return new Collection(\n stores.map((attributes) => {\n return new Store(attributes, this.adapter);\n })\n );\n });\n }\n\n getStoreLocations(params = {}) {\n return this.adapter.get('store-locations', params).then((locations) => {\n return new Collection(\n locations.map((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateways() {\n return this.adapter.get('gateways').then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\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 static getFromCart(adapter, ...params) {\n const quote = new DeliveryServiceQuote(adapter);\n\n return quote.fromCart(...params);\n }\n\n fromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n\n if (destination?.id) {\n destination = destination.id;\n }\n\n if (cart?.id) {\n cart = cart.id;\n }\n\n return this.adapter\n .get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n })\n .then((serviceQuotes) => {\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 });\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","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","isEmpty","_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","token","setHeaders","_this2","places","Place","_this3","orders","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","toLowerCase","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","stores","locations","DeliveryServiceQuote","_ServiceQuote","Adapter","_possibleConstructorReturn","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","quote","_len","_key","fromCart","ServiceQuote","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","_this$store","_this$store2","resources","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":"u1HACsC,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,OAJIH,IACAG,EAAOf,MAAQY,GAGZnB,KAAKK,QAAQkB,IAAGC,GAAAA,OAAIxB,KAAKyB,UAAS,UAAUH,EAAQR,EAC/D,IAGiBY,WAAMhC,GAAAC,EAAA+B,EAAAhC,GAAA,IAAAE,EAAAC,EAAA6B,GACvB,SAAAA,IAAoD,IAAxCC,EAAU1B,UAAAmB,OAAA,QAAAC,IAAApB,UAAA,GAAAA,UAAA,GAAG,CAAA,EAAII,EAAOJ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,EAAQkgB,EAAQ,IACxE,GACJ,GAAC,CAAApiB,IAAA,aAAAC,MAMD,SAAWC,GACPL,KAAKK,QAAUA,CACnB,GAAC,CAAAF,IAAA,aAAAC,MAED,WACI,OAAOJ,KAAKK,OAChB,IAAC,CAAA,CAAAF,IAAA,cAAAC,MAVD,WACI,OAAAghB,EAAWM,EAAUxc,MAAA4B,UAAA4G,MAAA9L,KAAI3B,WAC7B,KAACyhB,CAAA,CA/C0B","x_google_ignoreList":[10,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]} \ 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.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","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,Y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E3D,KAAKiiB,KAAO,IAAIzhB,GAAgB,OAAQR,KAAKK,SAASglB,cAAc3d,GACpE1H,KAAKulB,SAAW,IAAI/kB,GAAgB,WAAYR,KAAKK,SAASglB,cAAcpC,GAChF,CAgBC,OAdD/iB,EAAAykB,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 cea201e..f4025e7 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 n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:{},n={};return t&&(n.store=t),this.adapter.get("".concat(this.namespace,"/count"),n,e)}}),v=function(t){u(n,y);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"review",o)}return i(n,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),n}();function b(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:n}).format(t)}var k=function(e){u(r,y);var n=g(r);function r(){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 a(this,r),n.call(this,t,e,"product",o)}return i(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 e=this.getAttributes(["price","sale_price","currency"]),n=e.price,r=e.sale_price,a=e.currency;return this.isOnSale?t.isEmpty(r)||t.isEmpty(a)?null:b(r/100,a):t.isEmpty(n)||t.isEmpty(a)?null:b(n/100,a)}},{key:"getReviews",value:function(){var e=this;return this.adapter.get("reviews",{store:this.id}).then((function(n){return new t.Collection(n.map((function(t){return new v(t,e.adapter)})))}))}}]),r}(),x=function(e){u(r,y);var n=g(r);function r(){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 a(this,r),n.call(this,t,e,"category",o)}return i(r,[{key:"getProducts",value:function(){var e=this;return this.adapter.get("products",{category:this.id}).then((function(n){return new t.Collection(n.map((function(t){return new k(t,e.adapter)})))}))}}]),r}(),T=new t.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)}}),M=function(e){u(o,y);var r=g(o);function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,o),r.call(this,t,e,"customer",n({actions:T},i))}return i(o,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ye(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:function(t){var e=this;return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",t).then((function(){return e}))}},{key:"getSavedPlaces",value:function(){var e=this;return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/places").then((function(n){return new t.Collection(n.map((function(n){return new t.Place(n,e.adapter)})))}))}},{key:"getOrderHistory",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/orders",n).then((function(n){return new t.Collection(n.map((function(n){return new t.Order(n,e.adapter)})))}))}}]),o}(),D=Array.isArray,P=new t.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,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),n(n({},a),{},{quantity:r}),o).then(this.afterFetch.bind(this))},update:function(t,e,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),n(n({},a),{},{quantity:r}),o).then(this.afterFetch.bind(this))},remove:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},n).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)}}),S=function(t){u(r,y);var e=g(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,r),e.call(this,t,o,"cart",n({actions:P},i))}return i(r,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof k&&(t=t.id),this.store.add(this.id,t,e,n,r)}},{key:"update",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,n,r)}},{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!D(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),r}(),O=function(t){u(n,y);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"payment-gateway",o)}return i(n,[{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!")}}]),n}();function A(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 E(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function H(t,e){const n=A(t);return isNaN(e)?E(t,NaN):e?(n.setDate(n.getDate()+e),n):n}const q=6048e5,Y=864e5;let C={};function N(){return C}function W(t,e){const n=N(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=A(t),o=a.getDay(),i=(o=a.getTime()?n+1:e.getTime()>=i.getTime()?n:n-1}function F(t){const e=A(t);return e.setHours(0,0,0,0),e}function L(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 Q(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 n=A(t);return!isNaN(Number(n))}const I={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 G(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const B={date:G({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:G({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:G({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},X={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function _(t){return(e,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,a=n?.width?String(n.width):e;r=t.formattingValues[a]||t.formattingValues[e]}else{const e=t.defaultWidth,a=n?.width?String(n.width):t.defaultWidth;r=t.values[a]||t.values[e]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function z(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;const i=o[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let n=0;nt.test(i))):function(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var $;const K={code:"en-US",formatDistance:(t,e,n)=>{let r;const a=I[t];return r="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:B,formatRelative:(t,e,n,r)=>X[t],localize:{ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:_({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:_({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:_({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:_({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:_({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:($={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const n=t.match($.matchPattern);if(!n)return null;const r=n[0],a=t.match($.parsePattern);if(!a)return null;let o=$.valueCallback?$.valueCallback(a[0]):a[0];return o=e.valueCallback?e.valueCallback(o):o,{value:o,rest:t.slice(r.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 U(t){const e=A(t),n=function(t,e){const n=F(t),r=F(e),a=n.getTime()-L(n),o=r.getTime()-L(r);return Math.round((a-o)/Y)}(e,function(t){const e=A(t),n=E(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}(e));return n+1}function J(t){const e=A(t),n=j(e).getTime()-function(t){const e=R(t),n=E(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),j(n)}(e).getTime();return Math.round(n/q)+1}function V(t,e){const n=A(t),r=n.getFullYear(),a=N(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=E(t,0);i.setFullYear(r+1,0,o),i.setHours(0,0,0,0);const s=W(i,e),u=E(t,0);u.setFullYear(r,0,o),u.setHours(0,0,0,0);const c=W(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Z(t,e){const n=A(t),r=W(n,e).getTime()-function(t,e){const n=N(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=V(t,e),o=E(t,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),W(o,e)}(n,e).getTime();return Math.round(r/q)+1}function tt(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const et={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return tt("yy"===e?r%100:r,e.length)},M(t,e){const n=t.getMonth();return"M"===e?String(n+1):tt(n+1,2)},d:(t,e)=>tt(t.getDate(),e.length),a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(t,e)=>tt(t.getHours()%12||12,e.length),H:(t,e)=>tt(t.getHours(),e.length),m:(t,e)=>tt(t.getMinutes(),e.length),s:(t,e)=>tt(t.getSeconds(),e.length),S(t,e){const n=e.length,r=t.getMilliseconds();return tt(Math.floor(r*Math.pow(10,n-3)),e.length)}},nt="midnight",rt="noon",at="morning",ot="afternoon",it="evening",st="night",ut={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){const e=t.getFullYear(),r=e>0?e:1-e;return n.ordinalNumber(r,{unit:"year"})}return et.y(t,e)},Y:function(t,e,n,r){const a=V(t,r),o=a>0?a:1-a;if("YY"===e){return tt(o%100,2)}return"Yo"===e?n.ordinalNumber(o,{unit:"year"}):tt(o,e.length)},R:function(t,e){return tt(R(t),e.length)},u:function(t,e){return tt(t.getFullYear(),e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return tt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return tt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return et.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return tt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Z(t,r);return"wo"===e?n.ordinalNumber(a,{unit:"week"}):tt(a,e.length)},I:function(t,e,n){const r=J(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):tt(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getDate(),{unit:"date"}):et.d(t,e)},D:function(t,e,n){const r=U(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):tt(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return tt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return tt(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=0===r?7:r;switch(e){case"i":return String(a);case"ii":return tt(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(a=12===r?rt:0===r?nt:r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(a=r>=17?it:r>=12?ot:r>=4?at:st,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),n.ordinalNumber(e,{unit:"hour"})}return et.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getHours(),{unit:"hour"}):et.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):tt(r,e.length)},k:function(t,e,n){let r=t.getHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):tt(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):et.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getSeconds(),{unit:"second"}):et.s(t,e)},S:function(t,e){return et.S(t,e)},X:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return dt(a);case"XXXX":case"XX":return lt(a);default:return lt(a,":")}},x:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return dt(a);case"xxxx":case"xx":return lt(a);default:return lt(a,":")}},O:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ct(a,":");default:return"GMT"+lt(a,":")}},z:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ct(a,":");default:return"GMT"+lt(a,":")}},t:function(t,e,n,r){const a=r._originalDate||t;return tt(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,n,r){return tt((r._originalDate||t).getTime(),e.length)}};function ct(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.floor(r/60),o=r%60;return 0===o?n+String(a):n+String(a)+e+tt(o,2)}function dt(t,e){if(t%60==0){return(t>0?"-":"+")+tt(Math.abs(t)/60,2)}return lt(t,e)}function lt(t,e=""){const n=t>0?"-":"+",r=Math.abs(t);return n+tt(Math.floor(r/60),2)+e+tt(r%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"})}},ft=(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"})}},gt={p:ft,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return ht(t,e);let o;switch(r){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(r,e)).replace("{{time}}",ft(a,e))}},mt=["D","DD"],wt=["YY","YYYY"];function yt(t){return-1!==mt.indexOf(t)}function pt(t){return-1!==wt.indexOf(t)}function vt(t,e,n){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${n}\`; 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 \`${n}\`; 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 \`${n}\`; 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 \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const bt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xt=/^'([^]*?)'?$/,Tt=/''/g,Mt=/[a-zA-Z]/;function Dt(t,e,n){const r=N(),a=n?.locale??r.locale??K,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=A(t);if(!Q(s))throw new RangeError("Invalid time value");const u={firstWeekContainsDate:o,weekStartsOn:i,locale:a,_originalDate:s};return e.match(kt).map((function(t){const e=t[0];if("p"===e||"P"===e){return(0,gt[e])(t,a.formatLong)}return t})).join("").match(bt).map((function(r){if("''"===r)return"'";const o=r[0];if("'"===o)return function(t){const e=t.match(xt);if(!e)return t;return e[1].replace(Tt,"'")}(r);const i=ut[o];if(i)return!n?.useAdditionalWeekYearTokens&&pt(r)&&vt(r,e,String(t)),!n?.useAdditionalDayOfYearTokens&&yt(r)&&vt(r,e,String(t)),i(s,r,a.localize,u);if(o.match(Mt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}class Pt{subPriority=0;validate(t,e){return!0}}class St extends Pt{constructor(t,e,n,r,a){super(),this.value=t,this.validateValue=e,this.setValue=n,this.priority=r,a&&(this.subPriority=a)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,n){return this.setValue(t,e,this.value,n)}}class Ot extends Pt{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:E(t,function(t,e){const n=e instanceof Date?E(e,0):new e(0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),n}(t,Date))}}class At{run(t,e,n,r){const a=this.parse(t,e,n,r);return a?{setter:new St(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(t,e,n){return!0}}const Et=/^(1[0-2]|0?\d)/,Ht=/^(3[0-1]|[0-2]?\d)/,qt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Yt=/^(5[0-3]|[0-4]?\d)/,Ct=/^(2[0-3]|[0-1]?\d)/,Nt=/^(2[0-4]|[0-1]?\d)/,Wt=/^(1[0-1]|0?\d)/,jt=/^(1[0-2]|0?\d)/,Rt=/^[0-5]?\d/,Ft=/^[0-5]?\d/,Lt=/^\d/,Qt=/^\d{1,2}/,It=/^\d{1,3}/,Gt=/^\d{1,4}/,Bt=/^-?\d+/,Xt=/^-?\d/,_t=/^-?\d{1,2}/,zt=/^-?\d{1,3}/,$t=/^-?\d{1,4}/,Kt=/^([+-])(\d{2})(\d{2})?|Z/,Ut=/^([+-])(\d{2})(\d{2})|Z/,Jt=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,Vt=/^([+-])(\d{2}):(\d{2})|Z/,Zt=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function te(t,e){return t?{value:e(t.value),rest:t.rest}:t}function ee(t,e){const n=e.match(t);return n?{value:parseInt(n[0],10),rest:e.slice(n[0].length)}:null}function ne(t,e){const n=e.match(t);if(!n)return null;if("Z"===n[0])return{value:0,rest:e.slice(1)};return{value:("+"===n[1]?1:-1)*(36e5*(n[2]?parseInt(n[2],10):0)+6e4*(n[3]?parseInt(n[3],10):0)+1e3*(n[5]?parseInt(n[5],10):0)),rest:e.slice(n[0].length)}}function re(t){return ee(Bt,t)}function ae(t,e){switch(t){case 1:return ee(Lt,e);case 2:return ee(Qt,e);case 3:return ee(It,e);case 4:return ee(Gt,e);default:return ee(new RegExp("^\\d{1,"+t+"}"),e)}}function oe(t,e){switch(t){case 1:return ee(Xt,e);case 2:return ee(_t,e);case 3:return ee(zt,e);case 4:return ee($t,e);default:return ee(new RegExp("^-?\\d{1,"+t+"}"),e)}}function ie(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 n=e>0,r=n?e:1-e;let a;if(r<=50)a=t||100;else{const e=r+50;a=t+100*Math.floor(e/100)-(t>=e%100?100:0)}return n?a:1-a}function ue(t){return t%400==0||t%4==0&&t%100!=0}const ce=[31,28,31,30,31,30,31,31,30,31,30,31],de=[31,29,31,30,31,30,31,31,30,31,30,31];function le(t,e,n){const r=N(),a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=A(t),i=o.getDay(),s=7-a;return H(o,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function he(t,e){const n=A(t),r=function(t){let e=A(t).getDay();return 0===e&&(e=7),e}(n);return H(n,e-r)}const fe={G:new class extends At{priority=140;parse(t,e,n){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}}set(t,e,n){return e.era=n,t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends At{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,n){const r=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return te(ae(4,t),r);case"yo":return te(n.ordinalNumber(t,{unit:"year"}),r);default:return te(ae(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n){const r=t.getFullYear();if(n.isTwoDigitYear){const e=se(n.year,r);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const a="era"in e&&1!==e.era?1-n.year:n.year;return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}},Y:new class extends At{priority=130;parse(t,e,n){const r=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return te(ae(4,t),r);case"Yo":return te(n.ordinalNumber(t,{unit:"year"}),r);default:return te(ae(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n,r){const a=V(t,r);if(n.isTwoDigitYear){const e=se(n.year,a);return t.setFullYear(e,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),W(t,r)}const o="era"in e&&1!==e.era?1-n.year:n.year;return t.setFullYear(o,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),W(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends At{priority=130;parse(t,e){return oe("R"===e?4:e.length,t)}set(t,e,n){const r=E(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),j(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends At{priority=130;parse(t,e){return oe("u"===e?4:e.length,t)}set(t,e,n){return t.setFullYear(n,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 At{priority=120;parse(t,e,n){switch(e){case"Q":case"QQ":return ae(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth(3*(n-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 At{priority=120;parse(t,e,n){switch(e){case"q":case"qq":return ae(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth(3*(n-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 At{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,n){const r=t=>t-1;switch(e){case"M":return te(ee(Et,t),r);case"MM":return te(ae(2,t),r);case"Mo":return te(n.ordinalNumber(t,{unit:"month"}),r);case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}},L:new class extends At{priority=110;parse(t,e,n){const r=t=>t-1;switch(e){case"L":return te(ee(Et,t),r);case"LL":return te(ae(2,t),r);case"Lo":return te(n.ordinalNumber(t,{unit:"month"}),r);case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,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 At{priority=100;parse(t,e,n){switch(e){case"w":return ee(Yt,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return ae(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n,r){return W(function(t,e,n){const r=A(t),a=Z(r,n)-e;return r.setDate(r.getDate()-7*a),r}(t,n,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends At{priority=100;parse(t,e,n){switch(e){case"I":return ee(Yt,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return ae(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n){return j(function(t,e){const n=A(t),r=J(n)-e;return n.setDate(n.getDate()-7*r),n}(t,n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends At{priority=90;subPriority=1;parse(t,e,n){switch(e){case"d":return ee(Ht,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return ae(e.length,t)}}validate(t,e){const n=ue(t.getFullYear()),r=t.getMonth();return n?e>=1&&e<=de[r]:e>=1&&e<=ce[r]}set(t,e,n){return t.setDate(n),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends At{priority=90;subpriority=1;parse(t,e,n){switch(e){case"D":case"DD":return ee(qt,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return ae(e.length,t)}}validate(t,e){return ue(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,n){return t.setMonth(0,n),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 At{priority=90;parse(t,e,n){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=le(t,n,r)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends At{priority=90;parse(t,e,n,r){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return te(ae(e.length,t),a);case"eo":return te(n.ordinalNumber(t,{unit:"day"}),a);case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=le(t,n,r)).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 At{priority=90;parse(t,e,n,r){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return te(ae(e.length,t),a);case"co":return te(n.ordinalNumber(t,{unit:"day"}),a);case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=le(t,n,r)).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 At{priority=90;parse(t,e,n){const r=t=>0===t?7:t;switch(e){case"i":case"ii":return ae(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return te(n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return te(n.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return te(n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r);default:return te(n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,e){return e>=1&&e<=7}set(t,e,n){return(t=he(t,n)).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 At{priority=80;parse(t,e,n){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(ie(n),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends At{priority=80;parse(t,e,n){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(ie(n),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends At{priority=80;parse(t,e,n){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(ie(n),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends At{priority=70;parse(t,e,n){switch(e){case"h":return ee(jt,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return ae(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,n){const r=t.getHours()>=12;return r&&n<12?t.setHours(n+12,0,0,0):r||12!==n?t.setHours(n,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends At{priority=70;parse(t,e,n){switch(e){case"H":return ee(Ct,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return ae(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,n){return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends At{priority=70;parse(t,e,n){switch(e){case"K":return ee(Wt,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return ae(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.getHours()>=12&&n<12?t.setHours(n+12,0,0,0):t.setHours(n,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends At{priority=70;parse(t,e,n){switch(e){case"k":return ee(Nt,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return ae(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,n){const r=n<=24?n%24:n;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends At{priority=60;parse(t,e,n){switch(e){case"m":return ee(Rt,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return ae(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setMinutes(n,0,0),t}incompatibleTokens=["t","T"]},s:new class extends At{priority=50;parse(t,e,n){switch(e){case"s":return ee(Ft,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return ae(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setSeconds(n,0),t}incompatibleTokens=["t","T"]},S:new class extends At{priority=30;parse(t,e){return te(ae(e.length,t),(t=>Math.floor(t*Math.pow(10,3-e.length))))}set(t,e,n){return t.setMilliseconds(n),t}incompatibleTokens=["t","T"]},X:new class extends At{priority=10;parse(t,e){switch(e){case"X":return ne(Kt,t);case"XX":return ne(Ut,t);case"XXXX":return ne(Jt,t);case"XXXXX":return ne(Zt,t);default:return ne(Vt,t)}}set(t,e,n){return e.timestampIsSet?t:E(t,t.getTime()-L(t)-n)}incompatibleTokens=["t","T","x"]},x:new class extends At{priority=10;parse(t,e){switch(e){case"x":return ne(Kt,t);case"xx":return ne(Ut,t);case"xxxx":return ne(Jt,t);case"xxxxx":return ne(Zt,t);default:return ne(Vt,t)}}set(t,e,n){return e.timestampIsSet?t:E(t,t.getTime()-L(t)-n)}incompatibleTokens=["t","T","X"]},t:new class extends At{priority=40;parse(t){return re(t)}set(t,e,n){return[E(t,1e3*n),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends At{priority=20;parse(t){return re(t)}set(t,e,n){return[E(t,n),{timestampIsSet:!0}]}incompatibleTokens="*"}},ge=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,me=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,we=/^'([^]*?)'?$/,ye=/''/g,pe=/\S/,ve=/[a-zA-Z]/;function be(t,e,n,r){const a=Object.assign({},N()),o=r?.locale??a.locale??K,i=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(""===e)return""===t?A(n):E(n,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:o},c=[new Ot],d=e.match(me).map((t=>{const e=t[0];if(e in gt){return(0,gt[e])(t,o.formatLong)}return t})).join("").match(ge),l=[];for(let a of d){!r?.useAdditionalWeekYearTokens&&pt(a)&&vt(a,e,t),!r?.useAdditionalDayOfYearTokens&&yt(a)&&vt(a,e,t);const i=a[0],s=fe[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 \`${a}\` at the same time`)}else if("*"===s.incompatibleTokens&&l.length>0)throw new RangeError(`The format string mustn't contain \`${a}\` and any other token at the same time`);l.push({token:i,fullToken:a});const r=s.run(t,a,o.match,u);if(!r)return E(n,NaN);c.push(r.setter),t=r.rest}else{if(i.match(ve))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");if("''"===a?a="'":"'"===i&&(a=a.match(we)[1].replace(ye,"'")),0!==t.indexOf(a))return E(n,NaN);t=t.slice(a.length)}}if(t.length>0&&pe.test(t))return E(n,NaN);const h=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,n)=>n.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=A(n);if(isNaN(f.getTime()))return E(n,NaN);const g={};for(const t of h){if(!t.validate(f,u))return E(n,NaN);const e=t.set(f,g,u);Array.isArray(e)?(f=e[0],Object.assign(g,e[1])):f=e}return E(n,f)}var ke=function(t){u(n,y);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"store-hour",o)}return i(n,[{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,n=Math.abs(t-e);return Math.floor(n/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 be(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 be(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return Q(this.startDateInstance)&&Q(this.endDateInstance)?"".concat(Dt(this.startDateInstance,"p")," - ").concat(Dt(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!")}}]),n}(),xe=function(e){u(r,y);var n=g(r);function r(){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 a(this,r),n.call(this,t,e,"store-location",o)}return i(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 t.Collection(this.getAttribute("hours").map((function(t){return new ke(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=Dt(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var e={},n=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],r=0;r0&&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 a(this,o),r.call(this,t,e,"store",n)}return i(o,[{key:"getReviews",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",n({store:this.id},r)).then((function(n){return new t.Collection(n.map((function(t){return new v(t,e.adapter)})))}))}},{key:"getLocations",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",n({store:this.id},r)).then((function(n){return new t.Collection(n.map((function(n){return n.place&&(n.place=new t.Place(n.place)),new xe(n,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 xe(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",n).then((function(n){return new t.Collection(n.map((function(t){return new O(t,e.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new O(t,e.adapter)}))}}]),o}(),Me=function(e){u(r,y);var n=g(r);function r(){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 a(this,r),n.call(this,t,e,"network",o)}return i(r,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getStores",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("stores",n).then((function(n){return new t.Collection(n.map((function(t){return new Te(t,e.adapter)})))}))}},{key:"getStoreLocations",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("store-locations",n).then((function(n){return new t.Collection(n.map((function(t){return new xe(t,e.adapter)})))}))}},{key:"getPaymentGateways",value:function(){var e=this;return this.adapter.get("gateways").then((function(n){return new t.Collection(n.map((function(t){return new O(t,e.adapter)})))}))}}]),r}(),De=Array.isArray,Pe=function(e){u(r,t.ServiceQuote);var n=g(r);function r(){var e,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,r),o instanceof t.Adapter?f(e,e=n.call(this,{},o,"service-quote",s)):n.call(this,o,i,"service-quote",s)}return i(r,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ye(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 e=this.getAttributes(["amount","currency"]),n=e.amount,r=e.currency;return t.isEmpty(n)||t.isEmpty(r)?null:b(n/100,r)}},{key:"fromCart",value:function(e,n,a){var o,i,s,u=this,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"storefront",d=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return null!==(o=e)&&void 0!==o&&o.id&&(e=e.id),null!==(i=n)&&void 0!==i&&i.id&&(n=n.id),null!==(s=a)&&void 0!==s&&s.id&&(a=a.id),this.adapter.get("service-quotes/from-cart",{origin:e,destination:n,cart:a,config:c,all:d}).then((function(e){return De(e)?new t.Collection(e.map((function(t){return new r(t,u.adapter)}))):new r(e,u.adapter)}))}}],[{key:"getFromCart",value:function(t){for(var e=new r(t),n=arguments.length,a=new Array(n>1?n-1:0),o=1;o4&&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(r)&&(r=r.id),t.isResource(a)&&(a=a.id),t.isResource(o)&&(o=o.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),n(n({},i),{},{customer:e,cart:r,serviceQuote:a,gateway:o}),s)},captureOrder:function(e){var n=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:e,transactionDetails:n},r).then((function(e){return new t.Order(e)}))}}),Oe=function(t){u(n,y);var e=g(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,n),e.call(this,t,r,"checkout",o)}return i(n,[{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)}}]),n}(),Ae={Product:k,Category:x,Customer:M,Cart:S,DeliveryServiceQuote:Pe,Store:Te,StoreLocation:xe,StoreHour:ke,Checkout:Oe,Review:v},Ee={BrowserAdapter:t.BrowserAdapter,NodeAdapter:t.NodeAdapter},He=function(){function e(){return a(this,e),this.resources=Ae,this.adapters=Ee,this.lookup.apply(this,arguments)}return i(e,[{key:"lookup",value:function(e,n){var r=t.pluralize(e),a=Array.prototype.slice.call(arguments).slice(2);if(!this[r])throw new Error("Attempted to resolve invalid type");if(!this[r][n])throw new Error("No ".concat(t.singularize(e)," named ").concat(n," to resolve"));return h(this[r][n],m(a))}}]),e}(),qe=function(){return h(He,Array.prototype.slice.call(arguments))},Ye=function(e){u(r,t.Store);var n=g(r);function r(){return a(this,r),n.apply(this,arguments)}return i(r,[{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 qe("resource",t.classify(this.resource),e,this.adapter)}}]),r}(),Ce=function(){function e(n){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(a(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:n,debug:i},!("string"==typeof(r=n)&&r.length>30&&(r.startsWith("store_")||r.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()?qe("adapter","NodeAdapter",e):qe("adapter","BrowserAdapter",e)}(this.options),this.products=new Ye("product",this.adapter),this.categories=new Ye("category",this.adapter),this.reviews=new Ye("review",this.adapter).extendActions(p),this.customers=new Ye("customer",this.adapter).extendActions(T),this.cart=new Ye("cart",this.adapter).extendActions(P),this.checkout=new Ye("checkout",this.adapter).extendActions(Se)}return i(e,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"search",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",n({query:e},r)).then((function(e){return new t.Collection(e.map((function(t){return new k(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return h(e,Array.prototype.slice.call(arguments))}}]),e}();exports.Cart=S,exports.Category=x,exports.Checkout=Oe,exports.Customer=M,exports.DeliveryServiceQuote=Pe,exports.Network=Me,exports.PaymentGateway=O,exports.Product=k,exports.Review=v,exports.Store=Te,exports.StoreHour=ke,exports.StoreLocation=xe,exports.default=Ce; +"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; //# sourceMappingURL=storefront.js.map diff --git a/dist/cjs/storefront.js.map b/dist/cjs/storefront.js.map index ac7e0b9..17205a4 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/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","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 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 getSavedPlaces() {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/places')\n .then((places) => {\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n });\n }\n\n getOrderHistory(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/orders', params)\n .then((orders) => {\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\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 getStores(params = {}) {\n return this.adapter.get('stores', params).then((stores) => {\n return new Collection(\n stores.map((attributes) => {\n return new Store(attributes, this.adapter);\n })\n );\n });\n }\n\n getStoreLocations(params = {}) {\n return this.adapter.get('store-locations', params).then((locations) => {\n return new Collection(\n locations.map((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateways() {\n return this.adapter.get('gateways').then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\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 static getFromCart(adapter, ...params) {\n const quote = new DeliveryServiceQuote(adapter);\n\n return quote.fromCart(...params);\n }\n\n fromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n\n if (destination?.id) {\n destination = destination.id;\n }\n\n if (cart?.id) {\n cart = cart.id;\n }\n\n return this.adapter\n .get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n })\n .then((serviceQuotes) => {\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 });\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","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","isEmpty","_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","token","setHeaders","_this2","places","Place","_this3","orders","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","toLowerCase","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","stores","locations","DeliveryServiceQuote","_ServiceQuote","ServiceQuote","Adapter","_possibleConstructorReturn","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","quote","_len","_key","fromCart","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","_this$store","_this$store2","resources","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":"woHACsC,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,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,EAAA,CAAA,CAAAthB,IAAA,QAAAC,MACA,WACI,OAAOJ,KAAKK,QAAQiB,IAAI,QAC5B,GAEA,CAAAnB,IAAA,SAAAC,MACA,SAAOgF,GAAqB,IAAdtE,EAAOb,UAAAkB,OAAA,QAAAC,IAAAnB,UAAA,GAAAA,UAAA,GAAG,CAAA,EACpB,OAAOD,KAAKK,QAAQiB,IAAI,SAAQwC,EAAA,CAAIsB,MAAAA,GAAUtE,IAAWgC,MAAK,SAACM,GAC3D,OAAO,IAAIJ,EAAAA,WAAWI,EAASH,KAAI,SAACqf,GAAO,OAAK,IAAIlgB,EAAQkgB,EAAQ,IACxE,GACJ,GAAC,CAAAniB,IAAA,aAAAC,MAMD,SAAWC,GACPL,KAAKK,QAAUA,CACnB,GAAC,CAAAF,IAAA,aAAAC,MAED,WACI,OAAOJ,KAAKK,OAChB,IAAC,CAAA,CAAAF,IAAA,cAAAC,MAVD,WACI,OAAA+gB,EAAWM,EAAUxc,MAAA4B,UAAA4G,MAAA9L,KAAI1B,WAC7B,KAACwhB,CAAA,CA/C0B","x_google_ignoreList":[10,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]} \ 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.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,SA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,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 49d4316..c8741de 100644 --- a/dist/esm/storefront.js +++ b/dist/esm/storefront.js @@ -1,2 +1,2 @@ -import{Resource as t,StoreActions as e,isNodeEnvironment as n,isEmpty as r,Collection as a,Place as i,Order as o,Adapter as s,ServiceQuote as u,isResource as c,pluralize as d,singularize as h,BrowserAdapter as l,NodeAdapter as f,extendStoreActions as g,classify as m,Store as w}from"@fleetbase/sdk";function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:{},n={};return t&&(n.store=t),this.adapter.get("".concat(this.namespace,"/count"),n,e)}}),C=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"review",a)}return x(n,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),n}();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",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:n}).format(t)}var j=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"product",a)}return x(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,n=t.sale_price,a=t.currency;return this.isOnSale?r(n)||r(a)?null:W(n/100,a):r(e)||r(a)?null:W(e/100,a)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(e){return new a(e.map((function(e){return new C(e,t.adapter)})))}))}}]),n}(),F=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"category",a)}return x(n,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(e){return new a(e.map((function(e){return new j(e,t.adapter)})))}))}}]),n}(),L=new e({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",p({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",p({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",p({identity:t,code:e},n)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),R=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"customer",p({actions:L},a))}return x(n,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ke(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:function(t){var e=this;return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",t).then((function(){return e}))}},{key:"getSavedPlaces",value:function(){var t=this;return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/places").then((function(e){return new a(e.map((function(e){return new i(e,t.adapter)})))}))}},{key:"getOrderHistory",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).get("customers/orders",e).then((function(e){return new a(e.map((function(e){return new o(e,t.adapter)})))}))}}]),n}(),Q=Array.isArray,I=new e({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,r=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),p(p({},r),{},{quantity:n}),a).then(this.afterFetch.bind(this))},update:function(t,e,n){var r=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),p(p({},r),{},{quantity:n}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},n).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)}}),G=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"cart",p({actions:I},a))}return x(n,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof j&&(t=t.id),this.store.add(this.id,t,e,n,r)}},{key:"update",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,n,r)}},{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}}]),n}(),B=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"payment-gateway",a)}return x(n,[{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!")}}]),n}();function X(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 _(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function z(t,e){const n=X(t);return isNaN(e)?_(t,NaN):e?(n.setDate(n.getDate()+e),n):n}const $=6048e5,K=864e5;let U={};function J(){return U}function V(t,e){const n=J(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=X(t),i=a.getDay(),o=(i=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function et(t){const e=X(t);return e.setHours(0,0,0,0),e}function nt(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 rt(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 n=X(t);return!isNaN(Number(n))}const at={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 it(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const ot={date:it({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:it({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:it({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},st={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ut(t){return(e,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,a=n?.width?String(n.width):e;r=t.formattingValues[a]||t.formattingValues[e]}else{const e=t.defaultWidth,a=n?.width?String(n.width):t.defaultWidth;r=t.values[a]||t.values[e]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function ct(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let n=0;nt.test(o))):function(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n;return}(s,(t=>t.test(o)));let c;c=t.valueCallback?t.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:e.slice(o.length)}}}var dt;const ht={code:"en-US",formatDistance:(t,e,n)=>{let r;const a=at[t];return r="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:ot,formatRelative:(t,e,n,r)=>st[t],localize:{ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:ut({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ut({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:ut({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:ut({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:ut({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:(dt={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const n=t.match(dt.matchPattern);if(!n)return null;const r=n[0],a=t.match(dt.parsePattern);if(!a)return null;let i=dt.valueCallback?dt.valueCallback(a[0]):a[0];return i=e.valueCallback?e.valueCallback(i):i,{value:i,rest:t.slice(r.length)}}),era:ct({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:ct({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:ct({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:ct({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:ct({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 lt(t){const e=X(t),n=function(t,e){const n=et(t),r=et(e),a=n.getTime()-nt(n),i=r.getTime()-nt(r);return Math.round((a-i)/K)}(e,function(t){const e=X(t),n=_(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}(e));return n+1}function ft(t){const e=X(t),n=Z(e).getTime()-function(t){const e=tt(t),n=_(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Z(n)}(e).getTime();return Math.round(n/$)+1}function gt(t,e){const n=X(t),r=n.getFullYear(),a=J(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,o=_(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=V(o,e),u=_(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const c=V(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function mt(t,e){const n=X(t),r=V(n,e).getTime()-function(t,e){const n=J(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=gt(t,e),i=_(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),V(i,e)}(n,e).getTime();return Math.round(r/$)+1}function wt(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const yt={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return wt("yy"===e?r%100:r,e.length)},M(t,e){const n=t.getMonth();return"M"===e?String(n+1):wt(n+1,2)},d:(t,e)=>wt(t.getDate(),e.length),a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(t,e)=>wt(t.getHours()%12||12,e.length),H:(t,e)=>wt(t.getHours(),e.length),m:(t,e)=>wt(t.getMinutes(),e.length),s:(t,e)=>wt(t.getSeconds(),e.length),S(t,e){const n=e.length,r=t.getMilliseconds();return wt(Math.floor(r*Math.pow(10,n-3)),e.length)}},pt="midnight",vt="noon",bt="morning",kt="afternoon",xt="evening",Tt="night",Mt={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){const e=t.getFullYear(),r=e>0?e:1-e;return n.ordinalNumber(r,{unit:"year"})}return yt.y(t,e)},Y:function(t,e,n,r){const a=gt(t,r),i=a>0?a:1-a;if("YY"===e){return wt(i%100,2)}return"Yo"===e?n.ordinalNumber(i,{unit:"year"}):wt(i,e.length)},R:function(t,e){return wt(tt(t),e.length)},u:function(t,e){return wt(t.getFullYear(),e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return wt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return wt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return yt.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return wt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=mt(t,r);return"wo"===e?n.ordinalNumber(a,{unit:"week"}):wt(a,e.length)},I:function(t,e,n){const r=ft(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):wt(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getDate(),{unit:"date"}):yt.d(t,e)},D:function(t,e,n){const r=lt(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):wt(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return wt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return wt(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=0===r?7:r;switch(e){case"i":return String(a);case"ii":return wt(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(a=12===r?vt:0===r?pt:r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(a=r>=17?xt:r>=12?kt:r>=4?bt:Tt,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),n.ordinalNumber(e,{unit:"hour"})}return yt.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getHours(),{unit:"hour"}):yt.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):wt(r,e.length)},k:function(t,e,n){let r=t.getHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):wt(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):yt.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getSeconds(),{unit:"second"}):yt.s(t,e)},S:function(t,e){return yt.S(t,e)},X:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return Pt(a);case"XXXX":case"XX":return St(a);default:return St(a,":")}},x:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return Pt(a);case"xxxx":case"xx":return St(a);default:return St(a,":")}},O:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Dt(a,":");default:return"GMT"+St(a,":")}},z:function(t,e,n,r){const a=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Dt(a,":");default:return"GMT"+St(a,":")}},t:function(t,e,n,r){const a=r._originalDate||t;return wt(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,n,r){return wt((r._originalDate||t).getTime(),e.length)}};function Dt(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.floor(r/60),i=r%60;return 0===i?n+String(a):n+String(a)+e+wt(i,2)}function Pt(t,e){if(t%60==0){return(t>0?"-":"+")+wt(Math.abs(t)/60,2)}return St(t,e)}function St(t,e=""){const n=t>0?"-":"+",r=Math.abs(t);return n+wt(Math.floor(r/60),2)+e+wt(r%60,2)}const Ot=(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"})}},At=(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"})}},Et={p:At,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return Ot(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",Ot(r,e)).replace("{{time}}",At(a,e))}},Ht=["D","DD"],Yt=["YY","YYYY"];function qt(t){return-1!==Ht.indexOf(t)}function Nt(t){return-1!==Yt.indexOf(t)}function Ct(t,e,n){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${n}\`; 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 \`${n}\`; 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 \`${n}\`; 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 \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const Wt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,jt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ft=/^'([^]*?)'?$/,Lt=/''/g,Rt=/[a-zA-Z]/;function Qt(t,e,n){const r=J(),a=n?.locale??r.locale??ht,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=X(t);if(!rt(s))throw new RangeError("Invalid time value");const u={firstWeekContainsDate:i,weekStartsOn:o,locale:a,_originalDate:s};return e.match(jt).map((function(t){const e=t[0];if("p"===e||"P"===e){return(0,Et[e])(t,a.formatLong)}return t})).join("").match(Wt).map((function(r){if("''"===r)return"'";const i=r[0];if("'"===i)return function(t){const e=t.match(Ft);if(!e)return t;return e[1].replace(Lt,"'")}(r);const o=Mt[i];if(o)return!n?.useAdditionalWeekYearTokens&&Nt(r)&&Ct(r,e,String(t)),!n?.useAdditionalDayOfYearTokens&&qt(r)&&Ct(r,e,String(t)),o(s,r,a.localize,u);if(i.match(Rt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("")}class It{subPriority=0;validate(t,e){return!0}}class Gt extends It{constructor(t,e,n,r,a){super(),this.value=t,this.validateValue=e,this.setValue=n,this.priority=r,a&&(this.subPriority=a)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,n){return this.setValue(t,e,this.value,n)}}class Bt extends It{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:_(t,function(t,e){const n=e instanceof Date?_(e,0):new e(0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),n}(t,Date))}}class Xt{run(t,e,n,r){const a=this.parse(t,e,n,r);return a?{setter:new Gt(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(t,e,n){return!0}}const _t=/^(1[0-2]|0?\d)/,zt=/^(3[0-1]|[0-2]?\d)/,$t=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Kt=/^(5[0-3]|[0-4]?\d)/,Ut=/^(2[0-3]|[0-1]?\d)/,Jt=/^(2[0-4]|[0-1]?\d)/,Vt=/^(1[0-1]|0?\d)/,Zt=/^(1[0-2]|0?\d)/,te=/^[0-5]?\d/,ee=/^[0-5]?\d/,ne=/^\d/,re=/^\d{1,2}/,ae=/^\d{1,3}/,ie=/^\d{1,4}/,oe=/^-?\d+/,se=/^-?\d/,ue=/^-?\d{1,2}/,ce=/^-?\d{1,3}/,de=/^-?\d{1,4}/,he=/^([+-])(\d{2})(\d{2})?|Z/,le=/^([+-])(\d{2})(\d{2})|Z/,fe=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ge=/^([+-])(\d{2}):(\d{2})|Z/,me=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function we(t,e){return t?{value:e(t.value),rest:t.rest}:t}function ye(t,e){const n=e.match(t);return n?{value:parseInt(n[0],10),rest:e.slice(n[0].length)}:null}function pe(t,e){const n=e.match(t);if(!n)return null;if("Z"===n[0])return{value:0,rest:e.slice(1)};return{value:("+"===n[1]?1:-1)*(36e5*(n[2]?parseInt(n[2],10):0)+6e4*(n[3]?parseInt(n[3],10):0)+1e3*(n[5]?parseInt(n[5],10):0)),rest:e.slice(n[0].length)}}function ve(t){return ye(oe,t)}function be(t,e){switch(t){case 1:return ye(ne,e);case 2:return ye(re,e);case 3:return ye(ae,e);case 4:return ye(ie,e);default:return ye(new RegExp("^\\d{1,"+t+"}"),e)}}function ke(t,e){switch(t){case 1:return ye(se,e);case 2:return ye(ue,e);case 3:return ye(ce,e);case 4:return ye(de,e);default:return ye(new RegExp("^-?\\d{1,"+t+"}"),e)}}function xe(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Te(t,e){const n=e>0,r=n?e:1-e;let a;if(r<=50)a=t||100;else{const e=r+50;a=t+100*Math.floor(e/100)-(t>=e%100?100:0)}return n?a:1-a}function Me(t){return t%400==0||t%4==0&&t%100!=0}const De=[31,28,31,30,31,30,31,31,30,31,30,31],Pe=[31,29,31,30,31,30,31,31,30,31,30,31];function Se(t,e,n){const r=J(),a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=X(t),o=i.getDay(),s=7-a;return z(i,e<0||e>6?e-(o+s)%7:((e%7+7)%7+s)%7-(o+s)%7)}function Oe(t,e){const n=X(t),r=function(t){let e=X(t).getDay();return 0===e&&(e=7),e}(n);return z(n,e-r)}const Ae={G:new class extends Xt{priority=140;parse(t,e,n){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}}set(t,e,n){return e.era=n,t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Xt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,n){const r=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return we(be(4,t),r);case"yo":return we(n.ordinalNumber(t,{unit:"year"}),r);default:return we(be(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n){const r=t.getFullYear();if(n.isTwoDigitYear){const e=Te(n.year,r);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const a="era"in e&&1!==e.era?1-n.year:n.year;return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Xt{priority=130;parse(t,e,n){const r=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return we(be(4,t),r);case"Yo":return we(n.ordinalNumber(t,{unit:"year"}),r);default:return we(be(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n,r){const a=gt(t,r);if(n.isTwoDigitYear){const e=Te(n.year,a);return t.setFullYear(e,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),V(t,r)}const i="era"in e&&1!==e.era?1-n.year:n.year;return t.setFullYear(i,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),V(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Xt{priority=130;parse(t,e){return ke("R"===e?4:e.length,t)}set(t,e,n){const r=_(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Z(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Xt{priority=130;parse(t,e){return ke("u"===e?4:e.length,t)}set(t,e,n){return t.setFullYear(n,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 Xt{priority=120;parse(t,e,n){switch(e){case"Q":case"QQ":return be(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth(3*(n-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 Xt{priority=120;parse(t,e,n){switch(e){case"q":case"qq":return be(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth(3*(n-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 Xt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,n){const r=t=>t-1;switch(e){case"M":return we(ye(_t,t),r);case"MM":return we(be(2,t),r);case"Mo":return we(n.ordinalNumber(t,{unit:"month"}),r);case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}},L:new class extends Xt{priority=110;parse(t,e,n){const r=t=>t-1;switch(e){case"L":return we(ye(_t,t),r);case"LL":return we(be(2,t),r);case"Lo":return we(n.ordinalNumber(t,{unit:"month"}),r);case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,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 Xt{priority=100;parse(t,e,n){switch(e){case"w":return ye(Kt,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return be(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n,r){return V(function(t,e,n){const r=X(t),a=mt(r,n)-e;return r.setDate(r.getDate()-7*a),r}(t,n,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Xt{priority=100;parse(t,e,n){switch(e){case"I":return ye(Kt,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return be(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n){return Z(function(t,e){const n=X(t),r=ft(n)-e;return n.setDate(n.getDate()-7*r),n}(t,n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Xt{priority=90;subPriority=1;parse(t,e,n){switch(e){case"d":return ye(zt,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return be(e.length,t)}}validate(t,e){const n=Me(t.getFullYear()),r=t.getMonth();return n?e>=1&&e<=Pe[r]:e>=1&&e<=De[r]}set(t,e,n){return t.setDate(n),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Xt{priority=90;subpriority=1;parse(t,e,n){switch(e){case"D":case"DD":return ye($t,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return be(e.length,t)}}validate(t,e){return Me(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,n){return t.setMonth(0,n),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 Xt{priority=90;parse(t,e,n){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=Se(t,n,r)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Xt{priority=90;parse(t,e,n,r){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return we(be(e.length,t),a);case"eo":return we(n.ordinalNumber(t,{unit:"day"}),a);case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=Se(t,n,r)).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 Xt{priority=90;parse(t,e,n,r){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return we(be(e.length,t),a);case"co":return we(n.ordinalNumber(t,{unit:"day"}),a);case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,r){return(t=Se(t,n,r)).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 Xt{priority=90;parse(t,e,n){const r=t=>0===t?7:t;switch(e){case"i":case"ii":return be(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return we(n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return we(n.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return we(n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r);default:return we(n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,e){return e>=1&&e<=7}set(t,e,n){return(t=Oe(t,n)).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 Xt{priority=80;parse(t,e,n){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(xe(n),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Xt{priority=80;parse(t,e,n){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(xe(n),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Xt{priority=80;parse(t,e,n){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(xe(n),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Xt{priority=70;parse(t,e,n){switch(e){case"h":return ye(Zt,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return be(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,n){const r=t.getHours()>=12;return r&&n<12?t.setHours(n+12,0,0,0):r||12!==n?t.setHours(n,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Xt{priority=70;parse(t,e,n){switch(e){case"H":return ye(Ut,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return be(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,n){return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Xt{priority=70;parse(t,e,n){switch(e){case"K":return ye(Vt,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return be(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.getHours()>=12&&n<12?t.setHours(n+12,0,0,0):t.setHours(n,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Xt{priority=70;parse(t,e,n){switch(e){case"k":return ye(Jt,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return be(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,n){const r=n<=24?n%24:n;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Xt{priority=60;parse(t,e,n){switch(e){case"m":return ye(te,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return be(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setMinutes(n,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Xt{priority=50;parse(t,e,n){switch(e){case"s":return ye(ee,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return be(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setSeconds(n,0),t}incompatibleTokens=["t","T"]},S:new class extends Xt{priority=30;parse(t,e){return we(be(e.length,t),(t=>Math.floor(t*Math.pow(10,3-e.length))))}set(t,e,n){return t.setMilliseconds(n),t}incompatibleTokens=["t","T"]},X:new class extends Xt{priority=10;parse(t,e){switch(e){case"X":return pe(he,t);case"XX":return pe(le,t);case"XXXX":return pe(fe,t);case"XXXXX":return pe(me,t);default:return pe(ge,t)}}set(t,e,n){return e.timestampIsSet?t:_(t,t.getTime()-nt(t)-n)}incompatibleTokens=["t","T","x"]},x:new class extends Xt{priority=10;parse(t,e){switch(e){case"x":return pe(he,t);case"xx":return pe(le,t);case"xxxx":return pe(fe,t);case"xxxxx":return pe(me,t);default:return pe(ge,t)}}set(t,e,n){return e.timestampIsSet?t:_(t,t.getTime()-nt(t)-n)}incompatibleTokens=["t","T","X"]},t:new class extends Xt{priority=40;parse(t){return ve(t)}set(t,e,n){return[_(t,1e3*n),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Xt{priority=20;parse(t){return ve(t)}set(t,e,n){return[_(t,n),{timestampIsSet:!0}]}incompatibleTokens="*"}},Ee=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,He=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ye=/^'([^]*?)'?$/,qe=/''/g,Ne=/\S/,Ce=/[a-zA-Z]/;function We(t,e,n,r){const a=Object.assign({},J()),i=r?.locale??a.locale??ht,o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(""===e)return""===t?X(n):_(n,NaN);const u={firstWeekContainsDate:o,weekStartsOn:s,locale:i},c=[new Bt],d=e.match(He).map((t=>{const e=t[0];if(e in Et){return(0,Et[e])(t,i.formatLong)}return t})).join("").match(Ee),h=[];for(let a of d){!r?.useAdditionalWeekYearTokens&&Nt(a)&&Ct(a,e,t),!r?.useAdditionalDayOfYearTokens&&qt(a)&&Ct(a,e,t);const o=a[0],s=Ae[o];if(s){const{incompatibleTokens:e}=s;if(Array.isArray(e)){const t=h.find((t=>e.includes(t.token)||t.token===o));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:o,fullToken:a});const r=s.run(t,a,i.match,u);if(!r)return _(n,NaN);c.push(r.setter),t=r.rest}else{if(o.match(Ce))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");if("''"===a?a="'":"'"===o&&(a=a.match(Ye)[1].replace(qe,"'")),0!==t.indexOf(a))return _(n,NaN);t=t.slice(a.length)}}if(t.length>0&&Ne.test(t))return _(n,NaN);const l=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,n)=>n.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=X(n);if(isNaN(f.getTime()))return _(n,NaN);const g={};for(const t of l){if(!t.validate(f,u))return _(n,NaN);const e=t.set(f,g,u);Array.isArray(e)?(f=e[0],Object.assign(g,e[1])):f=e}return _(n,f)}var je=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"store-hour",a)}return x(n,[{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,n=Math.abs(t-e);return Math.floor(n/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 We(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 We(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return rt(this.startDateInstance)&&rt(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!")}}]),n}(),Fe=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"store-location",a)}return x(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 a(this.getAttribute("hours").map((function(t){return new je(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={},e=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"store",a)}return x(n,[{key:"getReviews",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",p({store:this.id},e)).then((function(e){return new a(e.map((function(e){return new C(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",p({store:this.id},e)).then((function(e){return new a(e.map((function(e){return e.place&&(e.place=new i(e.place)),new Fe(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 Fe(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 a(e.map((function(e){return new B(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new B(t,e.adapter)}))}}]),n}(),Re=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"network",a)}return x(n,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getStores",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("stores",e).then((function(e){return new a(e.map((function(e){return new Le(e,t.adapter)})))}))}},{key:"getStoreLocations",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("store-locations",e).then((function(e){return new a(e.map((function(e){return new Fe(e,t.adapter)})))}))}},{key:"getPaymentGateways",value:function(){var t=this;return this.adapter.get("gateways").then((function(e){return new a(e.map((function(e){return new B(e,t.adapter)})))}))}}]),n}(),Qe=Array.isArray,Ie=function(t){M(n,u);var e=E(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),r instanceof s?A(t,t=e.call(this,{},r,"service-quote",i)):e.call(this,r,a,"service-quote",i)}return x(n,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ke(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,n=t.currency;return r(e)||r(n)?null:W(e/100,n)}},{key:"fromCart",value:function(t,e,r){var i,o,s,u=this,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"storefront",d=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return null!==(i=t)&&void 0!==i&&i.id&&(t=t.id),null!==(o=e)&&void 0!==o&&o.id&&(e=e.id),null!==(s=r)&&void 0!==s&&s.id&&(r=r.id),this.adapter.get("service-quotes/from-cart",{origin:t,destination:e,cart:r,config:c,all:d}).then((function(t){return Qe(t)?new a(t.map((function(t){return new n(t,u.adapter)}))):new n(t,u.adapter)}))}}],[{key:"getFromCart",value:function(t){for(var e=new n(t),r=arguments.length,a=new Array(r>1?r-1:0),i=1;i4&&void 0!==arguments[4]?arguments[4]:{},i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return c(t)&&(t=t.id),c(e)&&(e=e.id),c(n)&&(n=n.id),c(r)&&(r=r.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),p(p({},a),{},{customer:t,cart:e,serviceQuote:n,gateway:r}),i)},captureOrder:function(t){var e=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:e},n).then((function(t){return new o(t)}))}}),Be=function(t){M(n,q);var e=E(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,n),e.call(this,t,r,"checkout",a)}return x(n,[{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)}}]),n}(),Xe={Product:j,Category:F,Customer:R,Cart:G,DeliveryServiceQuote:Ie,Store:Le,StoreLocation:Fe,StoreHour:je,Checkout:Be,Review:C},_e={BrowserAdapter:l,NodeAdapter:f},ze=function(){function t(){return b(this,t),this.resources=Xe,this.adapters=_e,this.lookup.apply(this,arguments)}return x(t,[{key:"lookup",value:function(t,e){var n=d(t),r=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][e])throw new Error("No ".concat(h(t)," named ").concat(e," to resolve"));return O(this[n][e],H(r))}}]),t}(),$e=function(){return O(ze,Array.prototype.slice.call(arguments))},Ke=function(t){M(n,w);var e=E(n);function n(){return b(this,n),e.apply(this,arguments)}return x(n,[{key:"extendActions",value:function(){return g(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:[])}},{key:"serialize",value:function(t){return $e("resource",m(this.resource),t,this.adapter)}}]),n}(),Ue=function(){function t(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(b(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:i},!("string"==typeof(r=e)&&r.length>30&&(r.startsWith("store_")||r.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 n()?$e("adapter","NodeAdapter",t):$e("adapter","BrowserAdapter",t)}(this.options),this.products=new Ke("product",this.adapter),this.categories=new Ke("category",this.adapter),this.reviews=new Ke("review",this.adapter).extendActions(N),this.customers=new Ke("customer",this.adapter).extendActions(L),this.cart=new Ke("cart",this.adapter).extendActions(I),this.checkout=new Ke("checkout",this.adapter).extendActions(Ge)}return x(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",p({query:t},e)).then((function(t){return new a(t.map((function(t){return new j(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return O(t,Array.prototype.slice.call(arguments))}}]),t}();export{G as Cart,F as Category,Be as Checkout,R as Customer,Ie as DeliveryServiceQuote,Re as Network,B as PaymentGateway,j as Product,C as Review,Le as Store,je as StoreHour,Fe as StoreLocation,Ue 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.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}; //# sourceMappingURL=storefront.js.map diff --git a/dist/esm/storefront.js.map b/dist/esm/storefront.js.map index 5cc3534..a428db8 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/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","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 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 getSavedPlaces() {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/places')\n .then((places) => {\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n });\n }\n\n getOrderHistory(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .get('customers/orders', params)\n .then((orders) => {\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\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 getStores(params = {}) {\n return this.adapter.get('stores', params).then((stores) => {\n return new Collection(\n stores.map((attributes) => {\n return new Store(attributes, this.adapter);\n })\n );\n });\n }\n\n getStoreLocations(params = {}) {\n return this.adapter.get('store-locations', params).then((locations) => {\n return new Collection(\n locations.map((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateways() {\n return this.adapter.get('gateways').then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\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 static getFromCart(adapter, ...params) {\n const quote = new DeliveryServiceQuote(adapter);\n\n return quote.fromCart(...params);\n }\n\n fromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n\n if (destination?.id) {\n destination = destination.id;\n }\n\n if (cart?.id) {\n cart = cart.id;\n }\n\n return this.adapter\n .get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n })\n .then((serviceQuotes) => {\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 });\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","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","isEmpty","_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","token","setHeaders","_this2","places","Place","_this3","orders","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","toLowerCase","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","stores","locations","DeliveryServiceQuote","_ServiceQuote","ServiceQuote","Adapter","_possibleConstructorReturn","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","quote","_len","_key","fromCart","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","_this$store","_this$store2","resources","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":"+0HACsC,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,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,IAAoD,IAAxCC,EAAUzB,UAAAkB,OAAA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CAAA,CA/C0B","x_google_ignoreList":[10,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]} \ 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.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,OAJIH,IACAG,EAAOd,MAAQW,GAGZlB,KAAKK,QAAQiB,IAAGC,GAAAA,OAAIvB,KAAKwB,UAAS,UAAUH,EAAQP,EAC/D,IAGiBW,WAAMhC,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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 02841fa..11c41bf 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "lint:tests": "eslint tests", "bundle": "rollup -c", "dev": "rollup -c -w", - "test": "mocha --require @babel/polyfill --require @babel/register --require source-map-support/register tests/*.test.js", + "test": "mocha --require @babel/polyfill --require @babel/register --require source-map-support/register tests/**/*.test.js", "prepare": "husky install", "format": "prettier . --write" }, @@ -58,7 +58,8 @@ "rollup": "^4.9.1", "rollup-plugin-eslint": "^7.0.0", "rollup-plugin-terser": "^7.0.2", - "source-map-support": "^0.5.21" + "source-map-support": "^0.5.21", + "typescript": "^5.3.3" }, "dependencies": { "@fleetbase/sdk": "1.2.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cec1c3d..2606c4e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -72,6 +72,9 @@ devDependencies: source-map-support: specifier: ^0.5.21 version: 0.5.21 + typescript: + specifier: ^5.3.3 + version: 5.3.3 packages: /@aashutoshrathi/word-wrap@1.2.6: @@ -4369,6 +4372,12 @@ packages: is-typed-array: 1.1.12 dev: true + /typescript@5.3.3: + resolution: { integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== } + engines: { node: '>=14.17' } + hasBin: true + dev: true + /unbox-primitive@1.0.2: resolution: { integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== } dependencies: diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..9198700 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, + "module": "commonjs" /* Specify what module code is generated. */, + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, + "strict": false /* Enable all strict type-checking options. */, + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} diff --git a/types/cart-store.d.ts b/types/cart-store.d.ts new file mode 100644 index 0000000..e82261d --- /dev/null +++ b/types/cart-store.d.ts @@ -0,0 +1,13 @@ +export default class CartStore extends Store { + request(method: any, uri: any, data: any, options: any): any; + add(id: any, productId: any, quantity?: number, data?: {}, options?: {}): any; + update(id: any, cartItemId: any, quantity: any, data?: {}, options?: {}): any; + remove(id: any, cartItemId: any, options?: {}): any; + empty(id: any, options?: {}): any; + retrieve(id?: string): Promise; + create(): void; + findAll(): void; + query(): void; + queryRecord(): void; +} +import Store from './store'; diff --git a/types/customer-store.d.ts b/types/customer-store.d.ts new file mode 100644 index 0000000..3b78685 --- /dev/null +++ b/types/customer-store.d.ts @@ -0,0 +1,7 @@ +export default class CustomerStore extends Store { + request(method: any, uri: any, data: any, options: any): any; + login(identity: any, password?: any, attributes?: {}): any; + verifySmsCode(phone: any, code: any, attributes?: {}): any; + retrieve(id: any): Promise; +} +import Store from './store'; diff --git a/types/resolver.d.ts b/types/resolver.d.ts new file mode 100644 index 0000000..15e73b2 --- /dev/null +++ b/types/resolver.d.ts @@ -0,0 +1,33 @@ +export class Resolver { + constructor(...args: any[]); + resources: { + Product: typeof Product; + Category: typeof Category; + Customer: typeof Customer; + Cart: typeof Cart; + DeliveryServiceQuote: typeof DeliveryServiceQuote; + Store: typeof Store; + StoreLocation: typeof StoreLocation; + StoreHour: typeof StoreHour; + Checkout: typeof Checkout; + Review: typeof Review; + }; + adapters: { + BrowserAdapter: typeof BrowserAdapter; + NodeAdapter: typeof NodeAdapter; + }; + lookup(type: any, className: any, ...args: any[]): any; +} +export function lookup(...args: any[]): Resolver; +import { Product } from './resources'; +import { Category } from './resources'; +import { Customer } from './resources'; +import { Cart } from './resources'; +import { DeliveryServiceQuote } from './resources'; +import { Store } from './resources'; +import { StoreLocation } from './resources'; +import { StoreHour } from './resources'; +import { Checkout } from './resources'; +import { Review } from './resources'; +import { BrowserAdapter } from '@fleetbase/sdk'; +import { NodeAdapter } from '@fleetbase/sdk'; diff --git a/types/resource.d.ts b/types/resource.d.ts new file mode 100644 index 0000000..99cec7d --- /dev/null +++ b/types/resource.d.ts @@ -0,0 +1,2 @@ +export default class StorefrontResource extends Resource {} +import { Resource } from '@fleetbase/sdk'; diff --git a/types/resources.d.ts b/types/resources.d.ts new file mode 100644 index 0000000..77c6cc7 --- /dev/null +++ b/types/resources.d.ts @@ -0,0 +1,13 @@ +import Product from './resources/product'; +import Category from './resources/category'; +import Customer from './resources/customer'; +import Cart from './resources/cart'; +import Network from './resources/network'; +import Store from './resources/store'; +import StoreLocation from './resources/store-location'; +import StoreHour from './resources/store-hour'; +import DeliveryServiceQuote from './resources/delivery-service-quote'; +import Checkout from './resources/checkout'; +import PaymentGateway from './resources/payment-gateway'; +import Review from './resources/review'; +export { Product, Category, Customer, Cart, Network, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review }; diff --git a/types/resources/cart.d.ts b/types/resources/cart.d.ts new file mode 100644 index 0000000..637b0e9 --- /dev/null +++ b/types/resources/cart.d.ts @@ -0,0 +1,16 @@ +export default class Cart extends Resource { + constructor(attributes: {}, adapter: any, options?: {}); + add(productId: any, quantity?: number, data?: {}, options?: {}): any; + update(cartItemId: any, quantity: any, data?: {}, options?: {}): Promise; + remove(cartItemId: any, options?: {}): any; + empty(options?: {}): any; + delete(): [type]; + refresh(): any; + subtotal(): number; + contents(): any; + hasProduct(productId: any): boolean; + get isNotEmpty(): boolean; +} +import Resource from '../resource'; +export const cartActions: StoreActions; +import { StoreActions } from '@fleetbase/sdk'; diff --git a/types/resources/category.d.ts b/types/resources/category.d.ts new file mode 100644 index 0000000..ea7e532 --- /dev/null +++ b/types/resources/category.d.ts @@ -0,0 +1,5 @@ +export default class Category extends Resource { + constructor(attributes: {}, adapter: any, options?: {}); + getProducts(): any; +} +import Resource from '../resource'; diff --git a/types/resources/checkout.d.ts b/types/resources/checkout.d.ts new file mode 100644 index 0000000..277236a --- /dev/null +++ b/types/resources/checkout.d.ts @@ -0,0 +1,8 @@ +export default class Checkout extends Resource { + constructor(attributes: {}, adapter: any, options?: {}); + initialize(...args: any[]): any; + captureOrder(...args: any[]): any; +} +import Resource from '../resource'; +export const checkoutActions: StoreActions; +import { StoreActions } from '@fleetbase/sdk'; diff --git a/types/resources/customer.d.ts b/types/resources/customer.d.ts new file mode 100644 index 0000000..10b4a56 --- /dev/null +++ b/types/resources/customer.d.ts @@ -0,0 +1,12 @@ +export default class Customer extends Resource { + constructor(attributes: {}, adapter: any, options?: {}); + get token(): any; + syncDevice(token: any): Promise; + performAuthorizedRequest(endpoint: any, params?: {}, method?: string): Promise; + getSavedPlaces(): Promise; + getOrderHistory(params?: {}): Promise; +} +import Resource from '../resource'; +import { Collection } from '@fleetbase/sdk'; +export const customerActions: StoreActions; +import { StoreActions } from '@fleetbase/sdk'; diff --git a/types/resources/delivery-service-quote.d.ts b/types/resources/delivery-service-quote.d.ts new file mode 100644 index 0000000..e441639 --- /dev/null +++ b/types/resources/delivery-service-quote.d.ts @@ -0,0 +1,16 @@ +export default class DeliveryServiceQuote extends ServiceQuote { + static getFromCart(adapter: any, origin: any, destination: any, cart: any, config?: string, all?: boolean): Promise; + constructor(attributes: {}, adapter: any, options?: {}); + /** + * Set a new adapter to the resource instance, this will update the Store instance + * + * @param {Adapter} adapter + * @return {Resource} this + */ + setAdapter(adapter: Adapter): Resource; + get formattedAmount(): string; + fetchServiceQuotesFromCart(origin: any, destination: any, cart: any, config?: string, all?: boolean): Promise; +} +import { ServiceQuote } from '@fleetbase/sdk'; +import { Adapter } from '@fleetbase/sdk'; +import { Collection } from '@fleetbase/sdk'; diff --git a/types/resources/network.d.ts b/types/resources/network.d.ts new file mode 100644 index 0000000..ab956a5 --- /dev/null +++ b/types/resources/network.d.ts @@ -0,0 +1,10 @@ +export default class Network extends Resource { + constructor(attributes: {}, adapter: any, options?: {}); + getTags(params?: {}): any; + getResourceCollection(endpoint: any, ResourceClass: any, params?: {}): Promise; + getStores(params?: {}): Promise; + getStoreLocations(params?: {}): Promise; + getPaymentGateways(): Promise; +} +import Resource from '../resource'; +import { Collection } from '@fleetbase/sdk'; diff --git a/types/resources/payment-gateway.d.ts b/types/resources/payment-gateway.d.ts new file mode 100644 index 0000000..f3244b3 --- /dev/null +++ b/types/resources/payment-gateway.d.ts @@ -0,0 +1,16 @@ +export default class PaymentGateway extends Resource { + constructor(attributes: {}, adapter: any, options?: {}); + get type(): any; + get code(): any; + get isCashGateway(): boolean; + get isStripeGateway(): boolean; + setCheckoutToken(token: any): void; + token: any; + getCheckoutToken(): any; + findRecord(): void; + create(): void; + update(): void; + destroy(): void; + reload(): void; +} +import Resource from '../resource'; diff --git a/types/resources/product.d.ts b/types/resources/product.d.ts new file mode 100644 index 0000000..3f4ed4e --- /dev/null +++ b/types/resources/product.d.ts @@ -0,0 +1,10 @@ +export default class Product extends Resource { + constructor(attributes: {}, adapter: any, options?: {}); + variants(): any; + addons(): any; + get isOnSale(): any; + get isNotOnSale(): boolean; + get formattedAmount(): string; + getReviews(): any; +} +import Resource from '../resource'; diff --git a/types/resources/review.d.ts b/types/resources/review.d.ts new file mode 100644 index 0000000..6b5c876 --- /dev/null +++ b/types/resources/review.d.ts @@ -0,0 +1,9 @@ +export default class Review extends Resource { + constructor(attributes: {}, adapter: any, options?: {}); + getMedia(): void; + getPhotos(): void; + getVideos(): void; +} +import Resource from '../resource'; +export const reviewActions: StoreActions; +import { StoreActions } from '@fleetbase/sdk'; diff --git a/types/resources/store-hour.d.ts b/types/resources/store-hour.d.ts new file mode 100644 index 0000000..74a39e1 --- /dev/null +++ b/types/resources/store-hour.d.ts @@ -0,0 +1,15 @@ +export default class StoreHour extends Resource { + constructor(attributes: {}, adapter: any, options?: {}); + get day(): any; + get isClosed(): boolean; + get is24Hours(): boolean; + get startDateInstance(): Date; + get endDateInstance(): Date; + get humanReadableHoursRange(): string; + get humanReadableHours(): string; + create(): void; + update(): void; + destroy(): void; + reload(): void; +} +import Resource from '../resource'; diff --git a/types/resources/store-location.d.ts b/types/resources/store-location.d.ts new file mode 100644 index 0000000..d912ae7 --- /dev/null +++ b/types/resources/store-location.d.ts @@ -0,0 +1,14 @@ +export default class StoreLocation extends Resource { + constructor(attributes: {}, adapter: any, options?: {}); + get latitude(): any; + get longitude(): any; + get hours(): Collection; + get isAlwaysOpen(): boolean; + get today(): any; + get schedule(): {}; + create(): void; + update(): void; + destroy(): void; +} +import Resource from '../resource'; +import { Collection } from '@fleetbase/sdk'; diff --git a/types/resources/store.d.ts b/types/resources/store.d.ts new file mode 100644 index 0000000..1384648 --- /dev/null +++ b/types/resources/store.d.ts @@ -0,0 +1,9 @@ +export default class Store extends Resource { + constructor(attributes: {}, adapter: any, options?: {}); + getReviews(params?: {}): any; + getLocations(params?: {}): any; + getLocation(id: any): any; + getPaymentGateways(params?: {}): any; + getPaymentGateway(id: any): any; +} +import Resource from '../resource'; diff --git a/types/store.d.ts b/types/store.d.ts new file mode 100644 index 0000000..25b2a5e --- /dev/null +++ b/types/store.d.ts @@ -0,0 +1,5 @@ +export default class StorefrontStore extends Store { + constructor(...args: any[]); + serialize(json: any): import('./resolver').Resolver; +} +import { Store } from '@fleetbase/sdk'; diff --git a/types/storefront.d.ts b/types/storefront.d.ts new file mode 100644 index 0000000..4cbf4f1 --- /dev/null +++ b/types/storefront.d.ts @@ -0,0 +1,52 @@ +/** + * // instance + * const storefront = new Storefront(); + * + */ +export default class Storefront { + static newInstance(...args: any[]): Storefront; + /** + * Builds an instance of the Fleetbase Storefront SDK + * + * @param {String} storeKey The access key for the storefront store + * @param {Object} config The config object + * @param {Boolean} debug Enable debug mode + * @return {Storefront} Instance + */ + constructor(storeKey: string, config?: any, debug?: boolean); + version: any; + options: { + version: any; + host: any; + namespace: any; + publicKey: string; + debug: boolean; + }; + adapter: any; + products: StorefrontStore; + categories: StorefrontStore; + reviews: any; + customers: any; + cart: any; + checkout: any; + /** loads information about this storefront */ + about(): any; + /** search products in store or network */ + search(query: any, options?: {}): any; + setAdapter(adapter: any): void; + getAdapter(): any; +} +import StorefrontStore from './store'; +import { Product } from './resources'; +import { Category } from './resources'; +import { Customer } from './resources'; +import { Cart } from './resources'; +import { Store } from './resources'; +import { StoreLocation } from './resources'; +import { StoreHour } from './resources'; +import { DeliveryServiceQuote } from './resources'; +import { Checkout } from './resources'; +import { PaymentGateway } from './resources'; +import { Review } from './resources'; +import { Network } from './resources'; +export { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network }; diff --git a/types/utils/detect-adapter.d.ts b/types/utils/detect-adapter.d.ts new file mode 100644 index 0000000..697ba87 --- /dev/null +++ b/types/utils/detect-adapter.d.ts @@ -0,0 +1,2 @@ +export default detectAdapter; +declare function detectAdapter(options?: {}): import('../resolver').Resolver; diff --git a/types/utils/format-currency.d.ts b/types/utils/format-currency.d.ts new file mode 100644 index 0000000..5a0f9db --- /dev/null +++ b/types/utils/format-currency.d.ts @@ -0,0 +1 @@ +export default function formatCurrency(amount?: number, currency?: string, currencyDisplay?: string): string; diff --git a/types/utils/get-countries.d.ts b/types/utils/get-countries.d.ts new file mode 100644 index 0000000..7bb3ebb --- /dev/null +++ b/types/utils/get-countries.d.ts @@ -0,0 +1,2 @@ +export default getCountries; +declare function getCountries(_country?: any): any; diff --git a/types/utils/index.d.ts b/types/utils/index.d.ts new file mode 100644 index 0000000..adc5d87 --- /dev/null +++ b/types/utils/index.d.ts @@ -0,0 +1,7 @@ +import detectAdapter from './detect-adapter'; +import isKeyValid from './is-key-valid'; +import isEmail from './is-email'; +import isPhone from './is-phone'; +import isEmpty from './is-empty'; +import formatCurrency from './format-currency'; +export { detectAdapter, isKeyValid, isEmail, isPhone, isEmpty, formatCurrency }; diff --git a/types/utils/is-email.d.ts b/types/utils/is-email.d.ts new file mode 100644 index 0000000..871067f --- /dev/null +++ b/types/utils/is-email.d.ts @@ -0,0 +1,2 @@ +export default isEmail; +declare function isEmail(email?: string): boolean; diff --git a/types/utils/is-empty.d.ts b/types/utils/is-empty.d.ts new file mode 100644 index 0000000..611ade3 --- /dev/null +++ b/types/utils/is-empty.d.ts @@ -0,0 +1,2 @@ +export default isEmpty; +declare function isEmpty(obj: any): boolean; diff --git a/types/utils/is-key-valid.d.ts b/types/utils/is-key-valid.d.ts new file mode 100644 index 0000000..7c73d3b --- /dev/null +++ b/types/utils/is-key-valid.d.ts @@ -0,0 +1,2 @@ +export default isKeyValid; +declare function isKeyValid(key: any): any; diff --git a/types/utils/is-phone.d.ts b/types/utils/is-phone.d.ts new file mode 100644 index 0000000..2daa6d5 --- /dev/null +++ b/types/utils/is-phone.d.ts @@ -0,0 +1,2 @@ +export default isPhone; +declare function isPhone(phone?: string): boolean; From e9ffe2e02f901e7ed4f3f546bba5817339a59f68 Mon Sep 17 00:00:00 2001 From: Turtuvshin Date: Fri, 22 Dec 2023 15:52:04 +0800 Subject: [PATCH 5/7] created gh action --- .github/workflows/ci.yml | 102 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ef33829 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,102 @@ +name: storefront-js + +on: + push: + branches: [main, dev-**] + tags: + - 'v*' + pull_request: + branches: [main, dev-**] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] # Build on Node.js 16 + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - uses: actions/cache@v3 + id: npm-cache + with: + path: ~/.pnpm-store # Replace this with the path you want to cache + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Setup pnpm + uses: pnpm/action-setup@v2.0.1 + with: + version: latest + + - name: Install Dependencies + run: pnpm install + + - name: Build + run: pnpm run bundle + + npm_publish: + needs: build + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js 18.x + uses: actions/setup-node@v4 + with: + node-version: 18.x + + - name: Setup pnpm + uses: pnpm/action-setup@v2.0.1 + with: + version: latest + + - name: Install Dependencies + run: pnpm install + + - name: Build + run: pnpm run bundle + + - name: Set up npm + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc + + - name: Publish + run: npm publish --access public + + github_publish: + needs: build + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js 18.x + uses: actions/setup-node@v4 + with: + node-version: 18.x + + - name: Setup pnpm + uses: pnpm/action-setup@v2.0.1 + with: + version: latest + + - name: Install Dependencies + run: pnpm install + + - name: Build + run: pnpm run bundle + + - name: Configure npm for GitHub registry + run: | + echo "@fleetbase:registry=https://npm.pkg.github.com/" >> ~/.npmrc + echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc + + - name: Publish to GitHub registry + run: npm publish From 369741eb0da2b1f73de162923bcbabe9f1c748f9 Mon Sep 17 00:00:00 2001 From: Turtuvshin Date: Fri, 22 Dec 2023 17:08:48 +0800 Subject: [PATCH 6/7] bump version to 1.1.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 11c41bf..5e0d28f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fleetbase/storefront", - "version": "1.1.5", + "version": "1.1.6", "description": "Fleetbase Storefront JS & Node SDK", "main": "dist/cjs/storefront.js", "module": "dist/esm/storefront.js", From 94c5444d99ba8e97eedc42fcc6203008fea099df Mon Sep 17 00:00:00 2001 From: Turtuvshin Date: Fri, 22 Dec 2023 17:12:27 +0800 Subject: [PATCH 7/7] fixed invalid links on readme --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5ff4577..1eb4ff9 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,14 @@ Ecommerce companion SDK & API for Fleetbase, build custom shopping experiences f

- - Version + + Version - - Downloads/week + + Downloads/week - - Bundle Size + + Bundle Size License