2024-11-22

2024-11-22

fonc(db) exporte la BDD de production
This commit is contained in:
gcch 2024-11-22 19:18:51 +01:00
commit 2b13af6421
77 changed files with 20281 additions and 2988 deletions

View file

@ -0,0 +1,3 @@
<?php
error_reporting(E_ALL & ~E_WARNING & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_NOTICE);
?>

File diff suppressed because one or more lines are too long

View file

@ -123,23 +123,23 @@
#panneau-panier .panneau__instructions-code-promo__code-promo {
display: flex;
flex-flow: row wrap;
width: fit-content;
place-content: center;
width: fit-content;
margin: auto;
/*
* 1. Longueur minimale pour le Bouton n'ait pas à changer de taille quel que soit son texte
*/
}
#panneau-panier .panneau__instructions-code-promo__code-promo button {
min-width: 9rem; /* 1 */
padding: var(--espace-xs) var(--espace-xl);
text-transform: lowercase;
border: 1px solid var(--couleur-noir);
border-left: initial;
min-width: 9rem; /* 1 */
}
#panneau-panier .panneau__instructions-code-promo__code-promo__message {
margin-top: var(--espace-m);
flex-basis: 100%;
margin-top: var(--espace-m);
}
#panneau-panier .panneau__sous-totaux {
width: min(30rem, 100%);

View file

@ -1 +1 @@
{"version":3,"sourceRoot":"","sources":["../../../src/sass/layouts/_panneau-panier.scss","../../../src/sass/layouts/_panneau-informations-client.scss","../../../src/sass/pages/page-panier.scss"],"names":[],"mappings":";AAEA;EACE;;AAEA;EACE;;AAIF;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAGA;EACE;;AAEA;EACE;;AAGF;EACE;EACA;;AAMN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAIJ;EACE;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;AAEA;AASA;AAAA;AAAA;AAAA;AAmBA;AASA;;AApCA;EACE;EACA;EACA;EACA;EACA;;AAOF;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EAEE;EACA;;AAKJ;EACE;EACA;EACA;EACA;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;;AAOR;EACE;EACA;EACA;EACA;AAEA;AAAA;AAAA;AAAA;;AAIA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;AAEA;AAAA;AAAA;;AAGA;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;;AAKN;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAKA;EACE;;AAEA;EACE;;AAMR;EACE;EACA;EACA;EACA;EACA;;AAKJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;;AC7NN;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAIF;EAEE;EACA;EACA;EAGA;EAEA;EACA;;AAEA;EACE;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EACE;;AAMN;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAKF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGE;EACE;;AAOV;EACE;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAIA;EACE;;AAKN;EACE;EACA;EACA;;AAEA;EACE;;AAIJ;EACE;;AAKJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;;AC1JN;AAAA;AAAA;AAAA;AAIA;AACE;EACA;AAEA;EACA;EAEA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAGA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAKN;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EACA;;AAKF;EACE;;AAGF;EACE","file":"page-panier.css"}
{"version":3,"sourceRoot":"","sources":["../../../src/sass/layouts/_panneau-panier.scss","../../../src/sass/layouts/_panneau-informations-client.scss","../../../src/sass/pages/page-panier.scss"],"names":[],"mappings":";AAEA;EACE;;AAEA;EACE;;AAIF;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAGA;EACE;;AAEA;EACE;;AAGF;EACE;EACA;;AAMN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAIJ;EACE;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;AAEA;AASA;AAAA;AAAA;AAAA;AAkBA;AASA;;AAnCA;EACE;EACA;EACA;EACA;EACA;;AAOF;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAKJ;EACE;EACA;EACA;EACA;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;;AAOR;EACE;EACA;EACA;EACA;AAEA;AAAA;AAAA;AAAA;;AAIA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;AAEA;AAAA;AAAA;;AAGA;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;;AAKN;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAKA;EACE;;AAEA;EACE;;AAMR;EACE;EACA;EACA;EACA;EACA;;AAKJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;;AC5NN;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAIF;EAEE;EACA;EACA;EAGA;EAEA;EACA;;AAEA;EACE;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EACE;;AAMN;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAKF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGE;EACE;;AAOV;EACE;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAIA;EACE;;AAKN;EACE;EACA;EACA;;AAEA;EACE;;AAIJ;EACE;;AAKJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;;AC1JN;AAAA;AAAA;AAAA;AAIA;AACE;EACA;AAEA;EACA;EAEA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAGA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAKN;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EACA;;AAKF;EACE;;AAGF;EACE","file":"page-panier.css"}

File diff suppressed because one or more lines are too long

View file

@ -12,27 +12,27 @@
],
"integrity": "sha512-zBecrvIRiJOu6YYRpnc0k8S2hhntD+UpPtg3zhLd4KQSyWdXQTt6ubhfDTOhBtMYi/W1LLcZX89krSQqxkWfGA=="
},
"_belt_Option-91f3b350.cBye8bLJ.js": {
"file": "belt_Option-91f3b350.cBye8bLJ.js",
"_belt_Option-91f3b350.Bf2JA1bN.js": {
"file": "belt_Option-91f3b350.Bf2JA1bN.js",
"name": "belt_Option-91f3b350",
"imports": [
"web/app/themes/haiku-atelier-2024/src/scripts/lib/dom.ts"
],
"integrity": "sha512-9jLdf+ptxzABI2/IowOZjgnuQLIzj36EJ7+u1FMIXffUF+jtqNSBFfsTSpmVe1MaAivun9Bb3/fjur20hZhk8w=="
"integrity": "sha512-1yCuw+VrCUAdtJZnNCCGQjJc0WIOQw7SD5b5Xz6LQq+wZwcv4Qb2BEz/nqBWGeka7VWLGZfLl7noxG0QTSbA6g=="
},
"_exports.3IcOsN8u.js": {
"file": "exports.3IcOsN8u.js",
"_exports.B84S-6H1.js": {
"file": "exports.B84S-6H1.js",
"name": "exports",
"integrity": "sha512-cypdx7oMHdSZiIga2ymXfkWqiMhM+7lluZ4vfwcWozGCOLB0tS7QuuClk9yHMEjJjiMZB9U3bdeV3Gg0x+YrbQ=="
"integrity": "sha512-rYFoHD4l6MsBUw4QxiKCaIfX00GsFaTGihRiDcawuDV0+592g9cOFlQq8btqldNq3/pKWpS8Rg5N/j5u4C0dow=="
},
"_index-0eef19ec.DoJSf22Z.js": {
"file": "index-0eef19ec.DoJSf22Z.js",
"_index-0eef19ec.Bvb4qYFq.js": {
"file": "index-0eef19ec.Bvb4qYFq.js",
"name": "index-0eef19ec",
"imports": [
"web/app/themes/haiku-atelier-2024/src/scripts/lib/dom.ts",
"_belt_Option-91f3b350.cBye8bLJ.js"
"_belt_Option-91f3b350.Bf2JA1bN.js"
],
"integrity": "sha512-BYIJDDOI3NTIytshd2k13/Wyep1oJ6pfwg9dCdZ18XVQrzO9uj99f5wF9bS0pjKa7OkbM2F27wF817UKn6thgg=="
"integrity": "sha512-QQsyZBe+eeVwL/BrUaa8E8Xgf/qwV9yEqVkJ+iWA2WR3vQoMlQOUaHxfwLKcQL8bQSi6fiVOIaYVh+FUQIxNmQ=="
},
"_index.CeK6pfoJ.js": {
"file": "index.CeK6pfoJ.js",
@ -54,7 +54,7 @@
"name": "api",
"src": "web/app/themes/haiku-atelier-2024/src/scripts/constantes/api.ts",
"isEntry": true,
"integrity": "sha512-DrDkVrVqdTqe7XX60O++FWFn1nm/X7naPDhDe61T2m57a2seCAi0NdNoaA7+76GLG5WL7fywLGIG9V9uOhoXyg=="
"integrity": "sha512-YEgwmKHSz0gRHk88OpNlmQ0lxrSltLuvvtd+eIXJzb3fW3IHzSCvk01/EdedkiTE4ma0+9EVluldqrWygL5v/w=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/cart.ts": {
"file": "cart2.js",
@ -68,7 +68,7 @@
"name": "dom",
"src": "web/app/themes/haiku-atelier-2024/src/scripts/constantes/dom.ts",
"isEntry": true,
"integrity": "sha512-I1Z5v7vScYFe97juQAHfl5K/N6OR+BQCiVvxTIBbgPv8Y0NQMIBebWYj1/xhKB7AUSlIUYOaFvus/zOeU5TJOQ=="
"integrity": "sha512-WxVe4bxUUCGeygovzpWBFGO4/CNz1F7dtRsTUVXvF48Y+zaQHTzX73N08O8Vpd89gcfD5BLecjd9bWPH9PEnHw=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/erreurs.ts": {
"file": "erreurs.js",
@ -85,11 +85,11 @@
"integrity": "sha512-M8me/iGRLfItVHaEf+BhA3xdEIxEwdyNuN+H87daJ1jl1oOENbROB7ub6RPP47NdFsQUChTRphEhQglT+qc6RA=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/orders.ts": {
"file": "orders3.js",
"file": "orders2.js",
"name": "orders",
"src": "web/app/themes/haiku-atelier-2024/src/scripts/constantes/orders.ts",
"isEntry": true,
"integrity": "sha512-dLV15du4JF6iPF2I93pExJpqAG13hXNCrRj8hF1dO47SFaa/7S74hT3puqnojjF5g1vStbjuGX+dLVklMIZuOw=="
"integrity": "sha512-wV9B3cW/1TnjBcesuc4a2M+28+67nsmX2++/Up1QUraP4Bdzbn9RiToohkone5Z+1mZNOjB/Hrd8x7Gc+jtVvg=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/products.ts": {
"file": "products2.js",
@ -105,10 +105,10 @@
"isEntry": true,
"imports": [
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/api.ts",
"_exports.3IcOsN8u.js",
"_exports.B84S-6H1.js",
"_pipe.XPB0wEfw.js"
],
"integrity": "sha512-mskLArAQPBWERMQR6U4/xLPd+NfjZ59hrptjz2G/7KUnC8cVe33bzBkQzUHZDNxy2/YlDFXTWO6NwQjgKKzgxQ=="
"integrity": "sha512-0YzSe2XlztM9VdJ4yRiCiB+QcYXRvEdcoO9OX21OJGsptcyhNR/lXrhy4U/kSPWbeaMhWkUX3R4cayeB0DZL9Q=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/animations.ts": {
"file": "animations.js",
@ -126,9 +126,9 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts",
"_pipe.XPB0wEfw.js",
"_Either.wHNxn7Os.js",
"_exports.3IcOsN8u.js"
"_exports.B84S-6H1.js"
],
"integrity": "sha512-I/u87SjbDtW7SK4O2yinDf8MAhDVpWyRBxa4gWSoLB2tXtqjqkg5YfhJXWIf3az36oSjHunCsSRzdZjrgXUqug=="
"integrity": "sha512-0BdfhY1b/kj2rhV/KpJB1DqBWTlSves9qMjFfPvOW2fle+9IbMogjDDv4yeccGwN4QvcjJhQqgWtlPX5nwZPDw=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts": {
"file": "erreurs2.js",
@ -136,9 +136,9 @@
"src": "web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts",
"isEntry": true,
"imports": [
"_exports.3IcOsN8u.js"
"_exports.B84S-6H1.js"
],
"integrity": "sha512-Ta/Bb2Do3/sj5Dpq5mLujPDpoZdgCiyvArjHPNRaJ359JvWcL6fczyLPYAJE4VCGGbKHneDhk/e5aHIzxHJscA=="
"integrity": "sha512-3Q8EegpJS0ltN1vAo1TJ3KKVy392F3/r8a7TsK0mtAiqHXxJxxo9Oy3ztMGKLWYm0H7FQP//1uZx5Mi1y0E7LQ=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs/codes-promo.ts": {
"file": "codes-promo.js",
@ -164,7 +164,7 @@
"_MaybeAsync.AE1jnxuc.js",
"_Either.wHNxn7Os.js"
],
"integrity": "sha512-4Z9hRY3XtEbYTEViQK/Rpzxlfvx5zXtLRQtXIDbqNg7gxXbkOgF3KZaYwZdOytvbMfGDgf9XVk75VakJOdFJOA=="
"integrity": "sha512-GiKCr6BmXjQBAY2VTgiAxXdmlHLywqrEiTdwluMlM7JaVp3SSC/+5dyPb60UBdXKylyOPcDf0RMNg3uwwniLqg=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/messages.ts": {
"file": "messages.js",
@ -179,14 +179,14 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/messages.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/validation.ts",
"_Either.wHNxn7Os.js",
"_exports.3IcOsN8u.js",
"_exports.B84S-6H1.js",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/cart.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/adresses.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart-coupons.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/couts-livraison.ts"
],
"integrity": "sha512-1kRDhi1+KGja3JCleYjLnsjVDpCrRXQqB8ZGAjpuTEAMiKpSQqj3x8vPCySRvkv8wreUc2UzTOa1xCljoZ8bPA=="
"integrity": "sha512-wlzwhlDEUm0Ve46eIkBUSQA8hZSVAOZj42gCUdTy0fdeZmda64o6iz4v2+aYyaUQBbIFggxhYK3J0EQW2d42KA=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/nombres.ts": {
"file": "nombres.js",
@ -207,9 +207,9 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/erreurs.ts",
"_pipe.XPB0wEfw.js",
"_exports.3IcOsN8u.js"
"_exports.B84S-6H1.js"
],
"integrity": "sha512-F8X+ITTTDvOk6ZjYd3qIAYkZlcJ6ZgDpbSCPAJM6Q8kcxuz0OtGVREa+iOntaFU8fiLpPvx7aA4z6u0G0oFjoQ=="
"integrity": "sha512-acVk9dK0TqeQXvCLpsWbA8qwLZZ0ifyGO4+a+zuaFIawQZFSYWyZuwUzIo3D3SJdNOJds8GuFpZaG2+GSx9hIg=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/adresses.ts": {
"file": "adresses.js",
@ -304,7 +304,7 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart-coupons.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/couts-livraison.ts"
],
"integrity": "sha512-nkAa5GpdXm5SEv5taFhiOdunn7bOKm61N1kVyEHzPGM4sa1irsAzExc5RMXEsEjim4ZA7RseBjo6pngFXFxpIg=="
"integrity": "sha512-vWAKO8wnk+0YggDDgm5AlyGv6JmrqvrQl59zJGRZRD/YT7uPqMFYZvESRk5YFc2vfjwZFlHeNX99pVmBX2+12g=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/couts-livraison.ts": {
"file": "couts-livraison.js",
@ -315,7 +315,7 @@
"_index.DxUTT09Y.js",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/adresses.ts"
],
"integrity": "sha512-Wba/eKVlVqEczLMMk3dl0p9KUI7dhNomuSIqltE35s+m9svN/k+dMr49WEyFYlchuQLH6Om19wm0VmnLPvOZmg=="
"integrity": "sha512-wg5eUuBJsShnO0/emL0PQGDxI2zpJGmeVlv6+a8/rg9NBlH48Dx65RoJx4EzTZsVtCigRPxFU4/+v1VIKMUtNA=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/erreurs.ts": {
"file": "erreurs3.js",
@ -339,7 +339,7 @@
"integrity": "sha512-Mr2P09suX7KY2cCzn+cqLdRLDHPDJC/RIsFFlB0VudZZoIE9unlsB3BjSvlzmKrBly5QP3jgnq2+7dKqSHlzMw=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/v3/orders.ts": {
"file": "orders2.js",
"file": "orders3.js",
"name": "orders",
"src": "web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/v3/orders.ts",
"isEntry": true,
@ -348,7 +348,7 @@
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/orders.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/adresses.ts"
],
"integrity": "sha512-moB98oUqT6LBlhauPLs5NaX25U/sAMuCRVbfu231Ld/mvdCW4xAd9MUd4l/wrHPckLGSDcU/1jlGPcilj5QmzQ=="
"integrity": "sha512-010SyRhlWpMyhynDIgXgmDCI+E+KNBLpJEj13xmvtd97ps0q4PLxF3dOwu+T6BW6XCeLoM3ORyivxArLA8u+4A=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/v3/products.ts": {
"file": "products.js",
@ -401,9 +401,9 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts",
"_pipe.XPB0wEfw.js",
"_Either.wHNxn7Os.js",
"_exports.3IcOsN8u.js"
"_exports.B84S-6H1.js"
],
"integrity": "sha512-lFwvitUqFysRtTgYXkj89gMr6p7ZYAbJcWYdOM8enxrgeI+P5TRMgHa1cGI/odo1eUoLMZAY/ETPefDB6F6jEA=="
"integrity": "sha512-k8Ef8tyPHVgGqJbto0PpMp2SLqyeobQx9ChBTeBaigtKFUMdi+SbO5GKxOZZep0uzDtHY0bxYjOPsgcxvSvXDA=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/lib/validation.ts": {
"file": "validation.js",
@ -429,7 +429,7 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/utils.ts",
"_pipe.XPB0wEfw.js",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts",
"_exports.3IcOsN8u.js",
"_exports.B84S-6H1.js",
"_Either.wHNxn7Os.js",
"_index.DxUTT09Y.js",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/erreurs.ts",
@ -441,7 +441,7 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/couts-livraison.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/validation.ts"
],
"integrity": "sha512-owPlbtZQELd8iFvAjd99yep2RtfOCDCUR6rLSY3iqiO4Jroo0EODLGeKKCemJB/yC2TmNio/oPRg4/v4GqKNZA=="
"integrity": "sha512-5DuXjp8NW4E71AvgK4y9ge4/5ocXdS9c6Ie1wzgh76JoJg1ZNAtNhmm6lEqjKciF5jbLcfpB8G3CEq0Lf5o9kQ=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/scripts-menu-categories.ts": {
"file": "scripts-menu-categories.js",
@ -454,11 +454,11 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/utils.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/dom.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts",
"_exports.3IcOsN8u.js",
"_exports.B84S-6H1.js",
"_pipe.XPB0wEfw.js",
"_Either.wHNxn7Os.js"
],
"integrity": "sha512-psMOuhAkU7+jxe9h1Aj21zDO6K3lAhY6syq7TswuJ1a4vHtk81NtFnL6g7u02xM7b+4NZ908PZKhrqu6UlU9/Q=="
"integrity": "sha512-FLsOC5z1KT5jCHSrJRZ0UZlbJ7D6amjByUM4KGoxVeeTSsIdr/YvQWxQ8vp02zwHbwNOICx5m372SmLxSork8w=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/scripts-menu-mobile.ts": {
"file": "scripts-menu-mobile.js",
@ -470,11 +470,11 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/utils.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/dom.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts",
"_exports.3IcOsN8u.js",
"_exports.B84S-6H1.js",
"_pipe.XPB0wEfw.js",
"_Either.wHNxn7Os.js"
],
"integrity": "sha512-jfXGu7m6fl9WAyW+/q7jIvIzt0BAHzr6/3jdUnmpjl4fk6BBreYq4dCdAYBkdor0SYiojl9CP7K4UAjviu8Fow=="
"integrity": "sha512-Bc5ADRLy7iSHw9wGdk7UCNntLcYB4Z3V+nG9r2MqKIegMB4SpKEFnbUsuxfDt+5worX3WjI5rf8t2IgGvwcDOg=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/scripts-page-a-propos.ts": {
"file": "scripts-page-a-propos.js",
@ -486,12 +486,12 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/utils.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/dom.ts",
"_pipe.XPB0wEfw.js",
"_belt_Option-91f3b350.cBye8bLJ.js",
"_belt_Option-91f3b350.Bf2JA1bN.js",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts",
"_exports.3IcOsN8u.js",
"_exports.B84S-6H1.js",
"_Either.wHNxn7Os.js"
],
"integrity": "sha512-zgCzDeT+sbnhtQa6JjC+5mfYJJFc5jaY7eHYW7aXBkzVxfit6zkxVH+tjLFE5W4agDvvB9x+h/72vW+EWp3uWg=="
"integrity": "sha512-I1icDP67e89MNTZ9Rh0x8k43aZndx06lotiIWHoYzUl8q159JduYHERN7G2Gm4UHScved+y15nJqaf3DJxEskQ=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/scripts-page-accueil.ts": {
"file": "scripts-page-accueil.js",
@ -504,11 +504,11 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/utils.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/dom.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts",
"_exports.3IcOsN8u.js",
"_exports.B84S-6H1.js",
"_pipe.XPB0wEfw.js",
"_Either.wHNxn7Os.js"
],
"integrity": "sha512-XYeWeT8w4HlKIc9z3CvH16ZZ2lb5kHlxO2e0pSTL5hiyOF5JT21aQMO0OaA1izcpulUIjT+cMorXIK3/hHs2/w=="
"integrity": "sha512-mADFi63KVG8KWanBRhSCayLMNWNvUl/4/Kokhs3Ia0UuA5B4znYXCEMhIWAtqF3w9GhurzJvHG+3s0+RPrSX7A=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/scripts-page-boutique.ts": {
"file": "scripts-page-boutique.js",
@ -528,14 +528,44 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/utils.ts",
"_MaybeAsync.AE1jnxuc.js",
"_pipe.XPB0wEfw.js",
"_index-0eef19ec.DoJSf22Z.js",
"_index-0eef19ec.Bvb4qYFq.js",
"_Either.wHNxn7Os.js",
"_exports.3IcOsN8u.js",
"_exports.B84S-6H1.js",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/erreurs.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/products.ts",
"_belt_Option-91f3b350.cBye8bLJ.js"
"_belt_Option-91f3b350.Bf2JA1bN.js"
],
"integrity": "sha512-tn2cf3wz6jENK1aJWUlAx2ExPnKYCf5zXmDw4DJyshzRgdj0Polb9K7SwYh3Uqf2Ek8rh74MQKX2q7zPFbWA9A=="
"integrity": "sha512-sXtFNbqUp7NukY8C+9bSq8flJ+WAwIY7BGflFIE2MFp3IaFnYgY1JwZfwRds1bFaz5rtQpVfMWiv71A39ml+uQ=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/scripts-page-panier-adresses.ts": {
"file": "scripts-page-panier-adresses.js",
"name": "scripts-page-panier-adresses",
"src": "web/app/themes/haiku-atelier-2024/src/scripts/scripts-page-panier-adresses.ts",
"isEntry": true,
"imports": [
"_index.CeK6pfoJ.js",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/api.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/dom.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/animations.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/reseau.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart-update-customer.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/utils.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/validation.ts",
"_pipe.XPB0wEfw.js",
"_MaybeAsync.AE1jnxuc.js",
"_Either.wHNxn7Os.js",
"_exports.B84S-6H1.js",
"_index.DxUTT09Y.js",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/erreurs.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/cart.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/adresses.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart-coupons.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/couts-livraison.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/dom.ts"
],
"integrity": "sha512-1d2FUGpO7DgABdetsGEkSfeSuPEen3hO77zSs5P6jdP9RvFtDV4qMUDY1j4eSGReP0etBCxulE3viWJa0ouFPg=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/scripts-page-panier-code-promo.ts": {
"file": "scripts-page-panier-code-promo.js",
@ -563,7 +593,7 @@
"_MaybeAsync.AE1jnxuc.js",
"_pipe.XPB0wEfw.js",
"_Either.wHNxn7Os.js",
"_exports.3IcOsN8u.js",
"_exports.B84S-6H1.js",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/messages.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/erreurs.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/messages.ts",
@ -572,7 +602,7 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart-coupons.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/couts-livraison.ts"
],
"integrity": "sha512-YYKaBtgzKquj63eMhqcijL6/wgAFl1WCKSED+/q4B2h7+YibZkgBMyWOkKRZcUVWQZYHhx2PHMgWIAdRbnld/A=="
"integrity": "sha512-xoax+Th1dp0cii/tdnmUdyPflZ8EvoDbAqraSZ32T5Xd2LsTvgneZiqG0HltfD6xC1Jel10TrjpH0uE2qKp2pQ=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/scripts-page-panier.ts": {
"file": "scripts-page-panier.js",
@ -580,7 +610,6 @@
"src": "web/app/themes/haiku-atelier-2024/src/scripts/scripts-page-panier.ts",
"isEntry": true,
"imports": [
"_index.CeK6pfoJ.js",
"_index.DxUTT09Y.js",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/api.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/dom.ts",
@ -591,33 +620,33 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/messages.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/reseau.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart-remove-item.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart-update-customer.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart-update-item.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/couts-livraison.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/v3/orders.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/utils.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/validation.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/scripts-page-panier-adresses.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/scripts-page-panier-code-promo.ts",
"_pipe.XPB0wEfw.js",
"_index-0eef19ec.DoJSf22Z.js",
"_index-0eef19ec.Bvb4qYFq.js",
"_Either.wHNxn7Os.js",
"_exports.3IcOsN8u.js",
"_exports.B84S-6H1.js",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/erreurs.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/messages.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/adresses.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/validation.ts",
"_index.CeK6pfoJ.js",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/cart.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/adresses.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart-coupons.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/orders.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/erreurs.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/couts-livraison.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/animations.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart-update-customer.ts",
"_MaybeAsync.AE1jnxuc.js",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/erreurs.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/erreurs/codes-promo.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart-apply-coupon.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart-remove-coupon.ts",
"_MaybeAsync.AE1jnxuc.js",
"_belt_Option-91f3b350.cBye8bLJ.js"
"_belt_Option-91f3b350.Bf2JA1bN.js"
],
"integrity": "sha512-LrETkMtNpCGK3ohj7yLHF5vz4lIdAgQaqSzq/6Ij7TGl67V0nu+E4TOATuT56B0djGTtJJXc24fflEYEf/rW/A=="
"integrity": "sha512-XcOYahNk49sMhIAlRU+7moHa3qUgNMFkzgLFOyjpRXG2wW5hEn4z75NZJvLLlzNZy9D1d7SgQIqlq38GObfdZA=="
},
"web/app/themes/haiku-atelier-2024/src/scripts/scripts-page-produit.ts": {
"file": "scripts-page-produit.js",
@ -638,9 +667,9 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/utils.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/validation.ts",
"_pipe.XPB0wEfw.js",
"_index-0eef19ec.DoJSf22Z.js",
"_index-0eef19ec.Bvb4qYFq.js",
"_Either.wHNxn7Os.js",
"_exports.3IcOsN8u.js",
"_exports.B84S-6H1.js",
"_index.DxUTT09Y.js",
"web/app/themes/haiku-atelier-2024/src/scripts/constantes/messages.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/erreurs.ts",
@ -649,8 +678,8 @@
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/adresses.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/cart-coupons.ts",
"web/app/themes/haiku-atelier-2024/src/scripts/lib/schemas/api/couts-livraison.ts",
"_belt_Option-91f3b350.cBye8bLJ.js"
"_belt_Option-91f3b350.Bf2JA1bN.js"
],
"integrity": "sha512-4HoksAZ1TvIRrylHgveTV7HHpYiDQSxAhFCCJ7kUj8iGrwC46k9oFevH3wyFOWdxK+fsUoTjyEZ9BK7R5q64ig=="
"integrity": "sha512-MFB+v8oiEdg0uPkWNwEwk3+JCh/MZbvod9NaQ5TwMQ8zj0vlDPzwM/rsnwyx0+cwMvAefdOaCFleriysX5/xkQ=="
}
}

View file

@ -7,7 +7,6 @@ const ROUTE_API_RETIRE_ARTICLE_PANIER = `/${CHEMIN_API_REST}/wc/store/cart/remov
const ROUTE_API_MAJ_ARTICLE_PANIER = `/${CHEMIN_API_REST}/wc/store/cart/update-item`;
const ROUTE_API_MAJ_CLIENT = `/${CHEMIN_API_REST}/wc/store/cart/update-customer`;
const ROUTE_API_NOUVELLE_PRODUCTS = `/${CHEMIN_API_REST}/wc/v3/products`;
const ROUTE_API_NOUVELLE_COMMANDES = `/${CHEMIN_API_REST}/wc/v3/orders`;
const ENTETE_WC_NONCE = "Nonce";
const ENTETE_GLITCHTIP_RETRY_AFTER = "retry-after";
const ENTETE_GLITCHTIP_RATE_LIMITS = "x-sentry-rate-limits";
@ -17,12 +16,11 @@ export {
ROUTE_API_RETIRE_ARTICLE_PANIER as a,
ROUTE_API_MAJ_ARTICLE_PANIER as b,
ROUTE_API_MAJ_CLIENT as c,
ROUTE_API_NOUVELLE_COMMANDES as d,
ROUTE_API_APPLIQUE_COUPON as e,
ROUTE_API_RETIRE_COUPON as f,
ROUTE_API_AJOUTE_ARTICLE_PANIER as g,
ROUTE_API_PANIER as h,
ENTETE_GLITCHTIP_RATE_LIMITS as i,
ENTETE_GLITCHTIP_RETRY_AFTER as j
ROUTE_API_APPLIQUE_COUPON as d,
ROUTE_API_RETIRE_COUPON as e,
ROUTE_API_AJOUTE_ARTICLE_PANIER as f,
ROUTE_API_PANIER as g,
ENTETE_GLITCHTIP_RATE_LIMITS as h,
ENTETE_GLITCHTIP_RETRY_AFTER as i
};
//# sourceMappingURL=api.js.map

View file

@ -1 +1 @@
{"version":3,"file":"api.js","sources":["../../src/scripts/constantes/api.ts"],"sourcesContent":["// Chemins et Routes pour l'API WordPress\nexport const CHEMIN_API_REST = \"wp-json\";\nexport const ROUTE_API_PANIER = `/${CHEMIN_API_REST}/wc/store/cart`;\nexport const ROUTE_API_AJOUTE_ARTICLE_PANIER = `/${CHEMIN_API_REST}/wc/store/cart/add-item`;\nexport const ROUTE_API_APPLIQUE_COUPON = `/${CHEMIN_API_REST}/wc/store/cart/apply-coupon`;\nexport const ROUTE_API_RETIRE_COUPON = `/${CHEMIN_API_REST}/wc/store/cart/remove-coupon`;\nexport const ROUTE_API_COUPONS = `/${CHEMIN_API_REST}/wc/store/cart/coupons`;\nexport const ROUTE_API_RETIRE_ARTICLE_PANIER = `/${CHEMIN_API_REST}/wc/store/cart/remove-item`;\nexport const ROUTE_API_MAJ_ARTICLE_PANIER = `/${CHEMIN_API_REST}/wc/store/cart/update-item`;\nexport const ROUTE_API_MAJ_CLIENT = `/${CHEMIN_API_REST}/wc/store/cart/update-customer`;\nexport const ROUTE_API_PRODUITS = `/${CHEMIN_API_REST}/wc/store/products`;\nexport const ROUTE_API_NOUVELLE_PRODUCTS = `/${CHEMIN_API_REST}/wc/v3/products`;\nexport const ROUTE_API_NOUVELLE_COMMANDES = `/${CHEMIN_API_REST}/wc/v3/orders`;\n\n// En-têtes\nexport const ENTETE_WC_NONCE = \"Nonce\";\nexport const ENTETE_GLITCHTIP_RETRY_AFTER = \"retry-after\";\nexport const ENTETE_GLITCHTIP_RATE_LIMITS = \"x-sentry-rate-limits\";\n"],"names":[],"mappings":"AACO,MAAM,kBAAkB;AAClB,MAAA,mBAAmB,IAAI,eAAe;AACtC,MAAA,kCAAkC,IAAI,eAAe;AACrD,MAAA,4BAA4B,IAAI,eAAe;AAC/C,MAAA,0BAA0B,IAAI,eAAe;AAE7C,MAAA,kCAAkC,IAAI,eAAe;AACrD,MAAA,+BAA+B,IAAI,eAAe;AAClD,MAAA,uBAAuB,IAAI,eAAe;AAE1C,MAAA,8BAA8B,IAAI,eAAe;AACjD,MAAA,+BAA+B,IAAI,eAAe;AAGxD,MAAM,kBAAkB;AACxB,MAAM,+BAA+B;AACrC,MAAM,+BAA+B;"}
{"version":3,"file":"api.js","sources":["../../src/scripts/constantes/api.ts"],"sourcesContent":["// Chemins et Routes pour l'API WordPress\nexport const CHEMIN_API_REST = \"wp-json\";\nexport const ROUTE_API_PANIER = `/${CHEMIN_API_REST}/wc/store/cart`;\nexport const ROUTE_API_AJOUTE_ARTICLE_PANIER = `/${CHEMIN_API_REST}/wc/store/cart/add-item`;\nexport const ROUTE_API_APPLIQUE_COUPON = `/${CHEMIN_API_REST}/wc/store/cart/apply-coupon`;\nexport const ROUTE_API_RETIRE_COUPON = `/${CHEMIN_API_REST}/wc/store/cart/remove-coupon`;\nexport const ROUTE_API_COUPONS = `/${CHEMIN_API_REST}/wc/store/cart/coupons`;\nexport const ROUTE_API_RETIRE_ARTICLE_PANIER = `/${CHEMIN_API_REST}/wc/store/cart/remove-item`;\nexport const ROUTE_API_MAJ_ARTICLE_PANIER = `/${CHEMIN_API_REST}/wc/store/cart/update-item`;\nexport const ROUTE_API_MAJ_CLIENT = `/${CHEMIN_API_REST}/wc/store/cart/update-customer`;\nexport const ROUTE_API_PRODUITS = `/${CHEMIN_API_REST}/wc/store/products`;\nexport const ROUTE_API_NOUVELLE_PRODUCTS = `/${CHEMIN_API_REST}/wc/v3/products`;\nexport const ROUTE_API_NOUVELLE_COMMANDES = `/${CHEMIN_API_REST}/wc/v3/orders`;\n\n// En-têtes\nexport const ENTETE_WC_NONCE = \"Nonce\";\nexport const ENTETE_GLITCHTIP_RETRY_AFTER = \"retry-after\";\nexport const ENTETE_GLITCHTIP_RATE_LIMITS = \"x-sentry-rate-limits\";\n"],"names":[],"mappings":"AACO,MAAM,kBAAkB;AAClB,MAAA,mBAAmB,IAAI,eAAe;AACtC,MAAA,kCAAkC,IAAI,eAAe;AACrD,MAAA,4BAA4B,IAAI,eAAe;AAC/C,MAAA,0BAA0B,IAAI,eAAe;AAE7C,MAAA,kCAAkC,IAAI,eAAe;AACrD,MAAA,+BAA+B,IAAI,eAAe;AAClD,MAAA,uBAAuB,IAAI,eAAe;AAE1C,MAAA,8BAA8B,IAAI,eAAe;AAIvD,MAAM,kBAAkB;AACxB,MAAM,+BAA+B;AACrC,MAAM,+BAA+B;"}

View file

@ -1,4 +1,4 @@
import { v as valFromOption, k as some } from "./dom2.js";
import { v as valFromOption, g as some } from "./dom2.js";
function sub(n2, r, t) {
var e = new Array(t);
var u = 0;
@ -146,4 +146,4 @@ export {
is_extension as i,
mapWithDefaultU as m
};
//# sourceMappingURL=belt_Option-91f3b350.cBye8bLJ.js.map
//# sourceMappingURL=belt_Option-91f3b350.Bf2JA1bN.js.map

View file

@ -2,7 +2,7 @@ import { o as object, d as boolean, e as enum_, s as string, u as unknown, n as
import { C as CATALOG_VISIBILITIES } from "./cart2.js";
import { W as WCStoreBillingAddressSchema, a as WCStoreShippingAddressSchema } from "./adresses.js";
import { W as WCStoreCartCouponsSchema } from "./cart-coupons.js";
import { a as WCStoreShippingRateSchema } from "./couts-livraison.js";
import { W as WCStoreShippingRateSchema } from "./couts-livraison.js";
const WCStoreCartItemTotalsSchema = object({
currency_code: string(),
currency_decimal_separator: string(),

View file

@ -32,7 +32,6 @@ const WCStoreShippingRateSchema = object({
shipping_rates: array(WCStoreShippingRateShippingRateSchema)
});
export {
WCStoreShippingRateShippingRateSchema as W,
WCStoreShippingRateSchema as a
WCStoreShippingRateSchema as W
};
//# sourceMappingURL=couts-livraison.js.map

View file

@ -65,16 +65,16 @@ const SELECTEUR_PRIX_PRODUIT = ".selecteur-produit__prix";
export {
SELECTEUR_BOUTON_MENU_MOBILE as $,
ATTRIBUT_CONTIENT_ARTICLES as A,
SELECTEUR_BOUTON_ADDITION_QUANTITE as B,
SELECTEUR_BOUTON_SUPPRESSION_PANIER as C,
SELECTEUR_PRIX_LIGNE_PANIER as D,
ATTRIBUT_DESACTIVE as E,
SELECTEUR_BOUTON_CODE_PROMO as F,
SELECTEUR_CHAMP_CODE_PROMO as G,
SELECTEUR_ENSEMBLE_CODE_PROMO as H,
SELECTEUR_MESSAGE_CODE_PROMO as I,
SELECTEUR_TOTAL_REDUCTION as J,
ATTRIBUT_CHARGEMENT as K,
SELECTEUR_PRIX_LIGNE_PANIER as B,
ATTRIBUT_DESACTIVE as C,
SELECTEUR_SOUS_TOTAL_LIVRAISON_COUT as D,
SELECTEUR_SOUS_TOTAL_LIVRAISON_PRESTATAIRE as E,
ATTRIBUT_CHARGEMENT as F,
SELECTEUR_BOUTON_CODE_PROMO as G,
SELECTEUR_CHAMP_CODE_PROMO as H,
SELECTEUR_ENSEMBLE_CODE_PROMO as I,
SELECTEUR_MESSAGE_CODE_PROMO as J,
SELECTEUR_TOTAL_REDUCTION as K,
ATTRIBUT_CODE_PROMO_PRESENT as L,
SELECTEUR_BOUTON_AJOUT_PANIER as M,
SELECTEUR_SELECTEUR_QUANTITE as N,
@ -114,17 +114,17 @@ export {
SELECTEUR_ENTREES_PANIER as l,
SELECTEUR_CONTENEUR_PANIER as m,
SELECTEUR_SOUS_TOTAL_PRODUITS as n,
SELECTEUR_SOUS_TOTAL_LIVRAISON_COUT as o,
SELECTEUR_SOUS_TOTAL_LIVRAISON_PRESTATAIRE as p,
SELECTEUR_TOTAL_REDUCTION_VALEUR as o,
SELECTEUR_INSTRUCTIONS_CLIENT as p,
SELECTEUR_TOTAL_PANIER as q,
SELECTEUR_BOUTON_SEPARATION_ADRESSES as r,
SELECTEUR_FORMULAIRE_PANIER as s,
SELECTEUR_FORMULAIRE_FACTURATION as t,
SELECTEUR_BOUTON_ACTIONS_FORMULAIRE as u,
SELECTEUR_TOTAL_REDUCTION_VALEUR as v,
SELECTEUR_INSTRUCTIONS_CLIENT as w,
ATTRIBUT_CLE_PANIER as x,
SELECTEUR_BOUTON_SOUSTRACTION_QUANTITE as y,
SELECTEUR_CHAMP_QUANTITE_LIGNE_PANIER as z
ATTRIBUT_CLE_PANIER as v,
SELECTEUR_BOUTON_SOUSTRACTION_QUANTITE as w,
SELECTEUR_CHAMP_QUANTITE_LIGNE_PANIER as x,
SELECTEUR_BOUTON_ADDITION_QUANTITE as y,
SELECTEUR_BOUTON_SUPPRESSION_PANIER as z
};
//# sourceMappingURL=dom.js.map

View file

@ -1,7 +1,7 @@
import { e as creeSyntaxError, f as reporteEtLeveErreur, g as ErreurEntreeInexistante, h as ERREUR_SYNTAXE_INVALIDE, i as ERREUR_SELECTEUR_INEXISTANT } from "./erreurs2.js";
import { e as creeSyntaxError, f as reporteEtLeveErreur, g as ERREUR_SYNTAXE_INVALIDE, h as ERREUR_SELECTEUR_INEXISTANT } from "./erreurs2.js";
import { p as pipe } from "./pipe.XPB0wEfw.js";
import { E as Either, r as right, l as left, M as Maybe } from "./Either.wHNxn7Os.js";
import "./exports.3IcOsN8u.js";
import { E as Either, r as right, l as left } from "./Either.wHNxn7Os.js";
import "./exports.B84S-6H1.js";
function int_compare(e, r) {
if (e < r) {
return -1;
@ -2033,34 +2033,30 @@ const html = (strings, ...args) => pipe(
(template) => majElementInnerHtml(template)(args.reduce((prev, value, i2) => prev + value + strings[i2 + 1], strings[0])),
(template) => template.content
);
const eitherSessionStorageGet = (cle) => Maybe.fromNullable(sessionStorage.getItem(cle)).toEither(ErreurEntreeInexistante(`Clé ${cle} absente dans le stockage de session.`));
const eitherJsonParse = (chaine) => Either.encase(() => JSON.parse(chaine));
const accorderCibleASelecteur = (cible, selecteur) => cible !== null && cible.matches(selecteur);
export {
Ra as R,
recupereElementsAvecSelecteur as a,
eitherJsonParse as b,
recupereElementAvecSelecteur as c,
accorderCibleASelecteur as d,
eitherSessionStorageGet as e,
recupereElementsOuLeve as f,
equal as g,
recupereElementAvecSelecteur as b,
accorderCibleASelecteur as c,
recupereElementsOuLeve as d,
equal as e,
everyU as f,
some$1 as g,
html as h,
identity as i,
everyU as j,
some$1 as k,
values as l,
fromArray as m,
get$1 as n,
forEachU as o,
mapU as p,
reduceU as q,
values as j,
fromArray as k,
get$1 as l,
forEachU as m,
mapU as n,
reduceU as o,
append as p,
nullable_to_opt as q,
recupereElementOuLeve as r,
someU as s,
append as t,
concat$1 as t,
unsafeDeleteKey as u,
valFromOption as v,
nullable_to_opt as w,
concat$1 as x
valFromOption as v
};
//# sourceMappingURL=dom2.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
import { c as captureException } from "./exports.3IcOsN8u.js";
import { c as captureException } from "./exports.B84S-6H1.js";
const ERREUR_SYNTAXE_INVALIDE = (selecteur) => `Le selecteur "${selecteur}" est invalide`;
const ERREUR_SELECTEUR_INEXISTANT = (selecteur) => `La requête "${selecteur}" n'a retourné aucun Élément.`;
const creeSyntaxError = (message) => new SyntaxError(message);
@ -14,12 +14,6 @@ class CleNonTrouveError extends Error {
this.name = "CleNonTrouveError";
}
}
class NonExistingKeyError extends Error {
constructor(message) {
super(JSON.stringify(message));
this.name = "NonExistingKeyError";
}
}
class NotFoundError extends Error {
constructor(message = "404 NotFoundError") {
super(message);
@ -45,7 +39,6 @@ class UnknownError extends Error {
}
}
const ErreurInconnue = (erreur) => new UnknownError(erreur);
const ErreurEntreeInexistante = (message) => new NonExistingKeyError(message);
const leveErreur = (erreur) => {
throw erreur;
};
@ -73,15 +66,14 @@ export {
CleNonTrouveError as C,
ErreurInconnue as E,
ServerError as S,
leveErreur as a,
leveBadRequestError as b,
leveUnauthorizedError as c,
leveNotFoundError as d,
leveBadRequestError as a,
leveUnauthorizedError as b,
leveNotFoundError as c,
leveErreur as d,
creeSyntaxError as e,
reporteEtLeveErreur as f,
ErreurEntreeInexistante as g,
ERREUR_SYNTAXE_INVALIDE as h,
ERREUR_SELECTEUR_INEXISTANT as i,
ERREUR_SYNTAXE_INVALIDE as g,
ERREUR_SELECTEUR_INEXISTANT as h,
leveServerError as l,
reporteErreur as r
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
import { h as ROUTE_API_PANIER, E as ENTETE_WC_NONCE } from "./api.js";
import { g as ROUTE_API_PANIER, E as ENTETE_WC_NONCE } from "./api.js";
import { E as EitherAsync } from "./MaybeAsync.AE1jnxuc.js";
import { r as right, l as left } from "./Either.wHNxn7Os.js";
const ETATS = _etats;

View file

@ -1,5 +1,5 @@
import { g as equal, j as everyU, s as someU, k as some, v as valFromOption } from "./dom2.js";
import { i as is_extension, a as isSome, m as mapWithDefaultU } from "./belt_Option-91f3b350.cBye8bLJ.js";
import { e as equal, f as everyU, s as someU, g as some, v as valFromOption } from "./dom2.js";
import { i as is_extension, a as isSome, m as mapWithDefaultU } from "./belt_Option-91f3b350.Bf2JA1bN.js";
function internalToOCamlException(e) {
if (is_extension(e)) {
return e;
@ -580,4 +580,4 @@ export {
l,
tap as t
};
//# sourceMappingURL=index-0eef19ec.DoJSf22Z.js.map
//# sourceMappingURL=index-0eef19ec.Bvb4qYFq.js.map

File diff suppressed because one or more lines are too long

View file

@ -5,7 +5,7 @@ import { W as WCErrorSchema } from "./erreurs3.js";
import { M as MessageMajBoutonPanierSchema, a as MessageMajContenuPanierSchema } from "./messages2.js";
import { e as eitherParse } from "./validation.js";
import { E as Either } from "./Either.wHNxn7Os.js";
import "./exports.3IcOsN8u.js";
import "./exports.B84S-6H1.js";
import "./cart.js";
import "./cart2.js";
import "./adresses.js";

View file

@ -1,162 +1,20 @@
import { o as object, a as pipe, b as array, s as string, e as enum_, f as union, c as optional, d as boolean, u as unknown, j as integer, n as number, g as null_ } from "./index.DxUTT09Y.js";
import { T as TAX_STATUSES, O as ORDER_STATUSES } from "./orders3.js";
import { W as WCStoreBillingAddressSchema, a as WCStoreShippingAddressSchema } from "./adresses.js";
const WCV3OrdersCouponLineMetaDataSchema = object({
id: pipe(number(), integer()),
key: string(),
value: unknown()
});
const WCV3OrdersCouponLineSchema = object({
code: string(),
discount: string(),
discount_tax: string(),
discount_type: string(),
free_shipping: boolean(),
id: pipe(number(), integer()),
meta_data: array(WCV3OrdersCouponLineMetaDataSchema),
nominal_amount: number()
});
const WCV3OrdersFeeLineMetaDataSchema = object({
id: pipe(number(), integer()),
key: string(),
value: unknown()
});
const WCV3OrdersFeeLineTaxSchema = object({
id: pipe(number(), integer()),
subtotal: string(),
total: string()
});
const WCV3OrdersFeeLineSchema = object({
id: pipe(number(), integer()),
meta_data: array(WCV3OrdersFeeLineMetaDataSchema),
name: string(),
tax_class: string(),
tax_status: enum_(TAX_STATUSES),
taxes: array(WCV3OrdersFeeLineTaxSchema),
total: string(),
total_tax: string()
});
const WCV3OrdersShippingLineMetaDataSchema = object({
id: pipe(number(), integer()),
key: string(),
value: unknown()
});
const WCV3OrdersShippingLineTaxSchema = object({
id: pipe(number(), integer()),
total: string()
});
const WCV3OrdersShippingLineSchema = object({
id: optional(pipe(number(), integer())),
meta_data: optional(array(WCV3OrdersShippingLineMetaDataSchema)),
method_id: optional(string()),
method_title: optional(string()),
taxes: optional(array(WCV3OrdersShippingLineTaxSchema)),
total: optional(string()),
total_tax: optional(string())
});
const WCV3OrdersLineItemImageSchema = object({
id: union([string(), pipe(number(), integer())]),
src: string()
});
const WCV3OrdersLineItemMetaDataSchema = object({
display_key: string(),
display_value: string(),
id: pipe(number(), integer()),
key: string(),
value: unknown()
});
const WCV3OrdersLineItemTaxSchema = object({
id: pipe(number(), integer()),
subtotal: string(),
total: string()
});
const WCV3OrdersLineItemSchema = object({
id: optional(pipe(number(), integer())),
image: optional(WCV3OrdersLineItemImageSchema),
meta_data: optional(array(WCV3OrdersLineItemMetaDataSchema)),
name: optional(string()),
parent_name: optional(union([string(), null_()])),
price: optional(number()),
product_id: optional(pipe(number(), integer())),
quantity: optional(pipe(number(), integer())),
sku: optional(string()),
subtotal: optional(string()),
subtotal_tax: optional(string()),
tax_class: optional(string()),
taxes: optional(array(WCV3OrdersLineItemTaxSchema)),
total: optional(string()),
total_tax: optional(string()),
variation_id: optional(pipe(number(), integer()))
});
const WCV3OrdersArgsSchema = object({
billing: optional(WCStoreBillingAddressSchema),
coupon_lines: optional(array(WCV3OrdersCouponLineSchema)),
currency: optional(string()),
customer_id: optional(pipe(number(), integer())),
customer_note: optional(string()),
fee_lines: optional(array(WCV3OrdersFeeLineSchema)),
line_items: optional(array(WCV3OrdersLineItemSchema)),
manual_update: optional(boolean()),
parent_id: optional(pipe(number(), integer())),
payment_method: optional(string()),
payment_method_title: optional(string()),
set_paid: optional(boolean()),
shipping: optional(WCStoreShippingAddressSchema),
shipping_lines: optional(array(WCV3OrdersShippingLineSchema)),
status: optional(enum_(ORDER_STATUSES)),
transaction_id: optional(string())
});
const WCV3OrderSchema = object({
billing: WCStoreBillingAddressSchema,
cart_hash: string(),
cart_tax: string(),
coupon_lines: array(WCV3OrdersCouponLineSchema),
created_via: string(),
currency: string(),
currency_symbol: string(),
customer_id: pipe(number(), integer()),
customer_ip_address: string(),
customer_note: string(),
customer_user_agent: string(),
date_completed: union([string(), null_()]),
date_completed_gmt: union([string(), null_()]),
// Date
date_created: string(),
date_created_gmt: string(),
date_modified: string(),
date_modified_gmt: string(),
date_paid: union([string(), null_()]),
date_paid_gmt: union([string(), null_()]),
discount_tax: string(),
discount_total: string(),
fee_lines: array(WCV3OrdersFeeLineSchema),
id: pipe(number(), integer()),
is_editable: boolean(),
line_items: array(WCV3OrdersLineItemSchema),
meta_data: unknown(),
needs_payment: boolean(),
needs_processing: boolean(),
number: string(),
order_key: string(),
parent_id: pipe(number(), integer()),
payment_method: string(),
payment_method_title: string(),
payment_url: string(),
prices_include_tax: boolean(),
refunds: array(unknown()),
shipping: WCStoreShippingAddressSchema,
shipping_lines: array(WCV3OrdersShippingLineSchema),
shipping_tax: string(),
shipping_total: string(),
status: enum_(ORDER_STATUSES),
tax_lines: array(unknown()),
total: string(),
total_tax: string(),
transaction_id: string(),
version: string()
});
const ORDER_STATUSES = {
AUTO_DRAFT: "auto-draft",
CANCELLED: "cancelled",
CHECKOUT_DRAFT: "checkout-draft",
COMPLETED: "completed",
FAILED: "failed",
ON_HOLD: "on-hold",
PENDING: "pending",
PROCESSING: "processing",
REFUNDED: "refuneded"
};
const TAX_STATUSES = {
NONE: "none",
TAXABLE: "taxable"
};
export {
WCV3OrdersArgsSchema as W,
WCV3OrderSchema as a
ORDER_STATUSES as O,
TAX_STATUSES as T
};
//# sourceMappingURL=orders2.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,20 +1,158 @@
const ORDER_STATUSES = {
AUTO_DRAFT: "auto-draft",
CANCELLED: "cancelled",
CHECKOUT_DRAFT: "checkout-draft",
COMPLETED: "completed",
FAILED: "failed",
ON_HOLD: "on-hold",
PENDING: "pending",
PROCESSING: "processing",
REFUNDED: "refuneded"
};
const TAX_STATUSES = {
NONE: "none",
TAXABLE: "taxable"
};
export {
ORDER_STATUSES as O,
TAX_STATUSES as T
};
import { o as object, a as pipe, b as array, s as string, e as enum_, f as union, c as optional, d as boolean, u as unknown, j as integer, n as number, g as null_ } from "./index.DxUTT09Y.js";
import { T as TAX_STATUSES, O as ORDER_STATUSES } from "./orders2.js";
import { W as WCStoreBillingAddressSchema, a as WCStoreShippingAddressSchema } from "./adresses.js";
const WCV3OrdersCouponLineMetaDataSchema = object({
id: pipe(number(), integer()),
key: string(),
value: unknown()
});
const WCV3OrdersCouponLineSchema = object({
code: string(),
discount: string(),
discount_tax: string(),
discount_type: string(),
free_shipping: boolean(),
id: pipe(number(), integer()),
meta_data: array(WCV3OrdersCouponLineMetaDataSchema),
nominal_amount: number()
});
const WCV3OrdersFeeLineMetaDataSchema = object({
id: pipe(number(), integer()),
key: string(),
value: unknown()
});
const WCV3OrdersFeeLineTaxSchema = object({
id: pipe(number(), integer()),
subtotal: string(),
total: string()
});
const WCV3OrdersFeeLineSchema = object({
id: pipe(number(), integer()),
meta_data: array(WCV3OrdersFeeLineMetaDataSchema),
name: string(),
tax_class: string(),
tax_status: enum_(TAX_STATUSES),
taxes: array(WCV3OrdersFeeLineTaxSchema),
total: string(),
total_tax: string()
});
const WCV3OrdersShippingLineMetaDataSchema = object({
id: pipe(number(), integer()),
key: string(),
value: unknown()
});
const WCV3OrdersShippingLineTaxSchema = object({
id: pipe(number(), integer()),
total: string()
});
const WCV3OrdersShippingLineSchema = object({
id: optional(pipe(number(), integer())),
meta_data: optional(array(WCV3OrdersShippingLineMetaDataSchema)),
method_id: optional(string()),
method_title: optional(string()),
taxes: optional(array(WCV3OrdersShippingLineTaxSchema)),
total: optional(string()),
total_tax: optional(string())
});
const WCV3OrdersLineItemImageSchema = object({
id: union([string(), pipe(number(), integer())]),
src: string()
});
const WCV3OrdersLineItemMetaDataSchema = object({
display_key: string(),
display_value: string(),
id: pipe(number(), integer()),
key: string(),
value: unknown()
});
const WCV3OrdersLineItemTaxSchema = object({
id: pipe(number(), integer()),
subtotal: string(),
total: string()
});
const WCV3OrdersLineItemSchema = object({
id: optional(pipe(number(), integer())),
image: optional(WCV3OrdersLineItemImageSchema),
meta_data: optional(array(WCV3OrdersLineItemMetaDataSchema)),
name: optional(string()),
parent_name: optional(union([string(), null_()])),
price: optional(number()),
product_id: optional(pipe(number(), integer())),
quantity: optional(pipe(number(), integer())),
sku: optional(string()),
subtotal: optional(string()),
subtotal_tax: optional(string()),
tax_class: optional(string()),
taxes: optional(array(WCV3OrdersLineItemTaxSchema)),
total: optional(string()),
total_tax: optional(string()),
variation_id: optional(pipe(number(), integer()))
});
object({
billing: optional(WCStoreBillingAddressSchema),
coupon_lines: optional(array(WCV3OrdersCouponLineSchema)),
currency: optional(string()),
customer_id: optional(pipe(number(), integer())),
customer_note: optional(string()),
fee_lines: optional(array(WCV3OrdersFeeLineSchema)),
line_items: optional(array(WCV3OrdersLineItemSchema)),
manual_update: optional(boolean()),
parent_id: optional(pipe(number(), integer())),
payment_method: optional(string()),
payment_method_title: optional(string()),
set_paid: optional(boolean()),
shipping: optional(WCStoreShippingAddressSchema),
shipping_lines: optional(array(WCV3OrdersShippingLineSchema)),
status: optional(enum_(ORDER_STATUSES)),
transaction_id: optional(string())
});
object({
billing: WCStoreBillingAddressSchema,
cart_hash: string(),
cart_tax: string(),
coupon_lines: array(WCV3OrdersCouponLineSchema),
created_via: string(),
currency: string(),
currency_symbol: string(),
customer_id: pipe(number(), integer()),
customer_ip_address: string(),
customer_note: string(),
customer_user_agent: string(),
date_completed: union([string(), null_()]),
date_completed_gmt: union([string(), null_()]),
// Date
date_created: string(),
date_created_gmt: string(),
date_modified: string(),
date_modified_gmt: string(),
date_paid: union([string(), null_()]),
date_paid_gmt: union([string(), null_()]),
discount_tax: string(),
discount_total: string(),
fee_lines: array(WCV3OrdersFeeLineSchema),
id: pipe(number(), integer()),
is_editable: boolean(),
line_items: array(WCV3OrdersLineItemSchema),
meta_data: unknown(),
needs_payment: boolean(),
needs_processing: boolean(),
number: string(),
order_key: string(),
parent_id: pipe(number(), integer()),
payment_method: string(),
payment_method_title: string(),
payment_url: string(),
prices_include_tax: boolean(),
refunds: array(unknown()),
shipping: WCStoreShippingAddressSchema,
shipping_lines: array(WCV3OrdersShippingLineSchema),
shipping_tax: string(),
shipping_total: string(),
status: enum_(ORDER_STATUSES),
tax_lines: array(unknown()),
total: string(),
total_tax: string(),
transaction_id: string(),
version: string()
});
//# sourceMappingURL=orders3.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,10 +1,10 @@
import { z, N } from "./index.CeK6pfoJ.js";
import { p as parse } from "./index.DxUTT09Y.js";
import { E as ENTETE_WC_NONCE } from "./api.js";
import { b as leveBadRequestError, c as leveUnauthorizedError, d as leveNotFoundError, E as ErreurInconnue, a as leveErreur } from "./erreurs2.js";
import { a as leveBadRequestError, b as leveUnauthorizedError, c as leveNotFoundError, E as ErreurInconnue, d as leveErreur } from "./erreurs2.js";
import { e as estWCError } from "./erreurs3.js";
import { p as pipe } from "./pipe.XPB0wEfw.js";
import "./exports.3IcOsN8u.js";
import "./exports.B84S-6H1.js";
const getBackendAvecParametresUrl = (args) => fetch(
`${args.route}?${args.searchParams}`,
{

View file

@ -5,7 +5,7 @@ import { v as valideMessageMajBoutonPanier } from "./messages.js";
import { r as recupereElementDocumentEither } from "./utils.js";
import { p as pipe } from "./pipe.XPB0wEfw.js";
import "./erreurs2.js";
import "./exports.3IcOsN8u.js";
import "./exports.B84S-6H1.js";
import "./Either.wHNxn7Os.js";
import "./index.DxUTT09Y.js";
import "./erreurs3.js";

View file

@ -3,7 +3,7 @@ import { a as SELECTEUR_MENU_CATEGORIES_PRODUITS, b as SELECTEUR_ENTREE_MENU_CAT
import { a as recupereElementDansDocumentOuLeve, b as recupereElementsDansDocumentOuLeve } from "./utils.js";
import { R as Ra } from "./dom2.js";
import "./erreurs2.js";
import "./exports.3IcOsN8u.js";
import "./exports.B84S-6H1.js";
import "./pipe.XPB0wEfw.js";
import "./Either.wHNxn7Os.js";
document.addEventListener("DOMContentLoaded", () => {

View file

@ -5,7 +5,7 @@ import { $ as SELECTEUR_BOUTON_MENU_MOBILE, a0 as SELECTEUR_MENU_MOBILE, a1 as A
import { a as recupereElementDansDocumentOuLeve } from "./utils.js";
import "./dom2.js";
import "./erreurs2.js";
import "./exports.3IcOsN8u.js";
import "./exports.B84S-6H1.js";
import "./pipe.XPB0wEfw.js";
import "./Either.wHNxn7Os.js";
const not = {

View file

@ -1,10 +1,10 @@
import { a2 as ATTRIBUT_ID_ENSEMBLE_EPINGLE_BOITE, a3 as ATTRIBUT_ENSEMBLE_EPINGLE_BOITE_ACTIF, a4 as CLASS_BOUTON_FERMETURE_BOITE_TEXTE, a5 as CLASS_EPINGLE, a6 as SELECTEUR_CONTENEUR_STORYTELLING_A_PROPOS, a7 as SELECTEUR_EPINGLE, a8 as SELECTEUR_BOITE_TEXTE } from "./dom.js";
import { a as recupereElementDansDocumentOuLeve, b as recupereElementsDansDocumentOuLeve } from "./utils.js";
import { k as some, q as reduceU, w as nullable_to_opt, v as valFromOption, g as equal, x as concat, R as Ra } from "./dom2.js";
import { g as some, o as reduceU, q as nullable_to_opt, v as valFromOption, e as equal, t as concat, R as Ra } from "./dom2.js";
import { p as pipe } from "./pipe.XPB0wEfw.js";
import { _ as _1, i as is_extension, c as create, g as getExn, b as getWithDefault$1, d as isNone, a as isSome, f as flatMap$1, e as mapU, h as flatMapU, m as mapWithDefaultU } from "./belt_Option-91f3b350.cBye8bLJ.js";
import { _ as _1, i as is_extension, c as create, g as getExn, b as getWithDefault$1, d as isNone, a as isSome, f as flatMap$1, e as mapU, h as flatMapU, m as mapWithDefaultU } from "./belt_Option-91f3b350.Bf2JA1bN.js";
import "./erreurs2.js";
import "./exports.3IcOsN8u.js";
import "./exports.B84S-6H1.js";
import "./Either.wHNxn7Os.js";
var t = create("Promise.JsError");
function $$catch(r, s) {

View file

@ -3,7 +3,7 @@ import { e as estEntreDeuxNombres } from "./nombres.js";
import { a as recupereElementDansDocumentOuLeve, b as recupereElementsDansDocumentOuLeve } from "./utils.js";
import "./dom2.js";
import "./erreurs2.js";
import "./exports.3IcOsN8u.js";
import "./exports.B84S-6H1.js";
import "./pipe.XPB0wEfw.js";
import "./Either.wHNxn7Os.js";
const initialiseScrollStorytelling = () => {

View file

@ -10,12 +10,12 @@ import { W as WCV3ProductsArgsSchema, a as WCV3ProductsSchema } from "./products
import { a as recupereElementDansDocumentOuLeve, r as recupereElementDocumentEither } from "./utils.js";
import { E as EitherAsync } from "./MaybeAsync.AE1jnxuc.js";
import { p as pipe } from "./pipe.XPB0wEfw.js";
import { t as tap } from "./index-0eef19ec.DoJSf22Z.js";
import { t as tap } from "./index-0eef19ec.Bvb4qYFq.js";
import { E as Either } from "./Either.wHNxn7Os.js";
import "./exports.3IcOsN8u.js";
import "./exports.B84S-6H1.js";
import "./erreurs3.js";
import "./products2.js";
import "./belt_Option-91f3b350.cBye8bLJ.js";
import "./belt_Option-91f3b350.Bf2JA1bN.js";
const ETATS_PAGE = _etats;
const GRILLE_PRODUITS = recupereElementDansDocumentOuLeve(SELECTEUR_GRILLE_PRODUITS);
const BOUTON_PLUS_DE_PRODUITS = recupereElementDocumentEither(

View file

@ -0,0 +1,118 @@
import { z } from "./index.CeK6pfoJ.js";
import { c as ROUTE_API_MAJ_CLIENT } from "./api.js";
import { u as SELECTEUR_BOUTON_ACTIONS_FORMULAIRE, s as SELECTEUR_FORMULAIRE_PANIER, D as SELECTEUR_SOUS_TOTAL_LIVRAISON_COUT, E as SELECTEUR_SOUS_TOTAL_LIVRAISON_PRESTATAIRE, C as ATTRIBUT_DESACTIVE, F as ATTRIBUT_CHARGEMENT } from "./dom.js";
import { l as lanceAnimationCycleTexte } from "./animations.js";
import { S as ServerError } from "./erreurs2.js";
import { p as postBackend } from "./reseau.js";
import { W as WCStoreCartSchema } from "./cart.js";
import { W as WCStoreCartUpdateCustomerArgsSchema } from "./cart-update-customer.js";
import { a as recupereElementDansDocumentOuLeve, y } from "./utils.js";
import { e as eitherParse } from "./validation.js";
import { p as pipe } from "./pipe.XPB0wEfw.js";
import { E as EitherAsync } from "./MaybeAsync.AE1jnxuc.js";
import { M as Maybe } from "./Either.wHNxn7Os.js";
import "./exports.B84S-6H1.js";
import "./index.DxUTT09Y.js";
import "./erreurs3.js";
import "./cart2.js";
import "./adresses.js";
import "./cart-coupons.js";
import "./couts-livraison.js";
import "./dom2.js";
const ETATS_PAGE = _etats;
const ELEMENTS = {
BOUTON_ACTIONS_FORMULAIRE: recupereElementDansDocumentOuLeve(SELECTEUR_BOUTON_ACTIONS_FORMULAIRE),
FORMULAIRE_PANIER: recupereElementDansDocumentOuLeve(SELECTEUR_FORMULAIRE_PANIER),
SOUS_TOTAL_LIVRAISON_COUT: recupereElementDansDocumentOuLeve(SELECTEUR_SOUS_TOTAL_LIVRAISON_COUT),
SOUS_TOTAL_LIVRAISON_PRESTATAIRE: recupereElementDansDocumentOuLeve(
SELECTEUR_SOUS_TOTAL_LIVRAISON_PRESTATAIRE
)
};
const initialiseBoutonActions = () => {
ELEMENTS.BOUTON_ACTIONS_FORMULAIRE.addEventListener("click", (evenement) => {
Maybe.fromFalsy(ELEMENTS.FORMULAIRE_PANIER.checkValidity()).ifJust(() => {
evenement.preventDefault();
ELEMENTS.BOUTON_ACTIONS_FORMULAIRE.setAttribute(ATTRIBUT_DESACTIVE, "");
ELEMENTS.BOUTON_ACTIONS_FORMULAIRE.setAttribute(ATTRIBUT_CHARGEMENT, "");
const animation = lanceAnimationCycleTexte({
attribut: ATTRIBUT_CHARGEMENT,
element: ELEMENTS.BOUTON_ACTIONS_FORMULAIRE,
etapes: [
"Loading",
"Loading.",
"Loading..",
"Loading..."
]
});
animation.callback();
animation.interval = setInterval(animation.callback, 500);
}).ifJust(() => {
const donneesFormulaire = pipe(
new FormData(ELEMENTS.FORMULAIRE_PANIER),
(formData) => formData.entries(),
(entrees) => Array.from(entrees),
(tuple) => y.fromPairs(tuple)
);
const argumentsFormulaire = {
billing_address: {
address_1: donneesFormulaire["facturation-adresse"] ?? donneesFormulaire["livraison-adresse"] ?? "",
address_2: "",
city: donneesFormulaire["facturation-ville"] ?? donneesFormulaire["livraison-ville"] ?? "",
company: "",
country: "FR",
email: donneesFormulaire["facturation-email"] ?? donneesFormulaire["livraison-email"] ?? "",
first_name: donneesFormulaire["facturation-prenom"] ?? donneesFormulaire["livraison-prenom"] ?? "",
last_name: donneesFormulaire["facturation-nom"] ?? donneesFormulaire["livraison-nom"] ?? "",
phone: donneesFormulaire["facturation-telephone"] ?? donneesFormulaire["livraison-telephone"] ?? "",
postcode: donneesFormulaire["facturation-code-postal"] ?? donneesFormulaire["livraison-code-postal"] ?? "",
state: donneesFormulaire["facturation-region-etat"] ?? donneesFormulaire["livraison-region-etat"] ?? ""
},
shipping_address: {
address_1: donneesFormulaire["livraison-adresse"] ?? "",
address_2: "",
city: donneesFormulaire["livraison-ville"] ?? "",
company: "",
country: "FR",
first_name: donneesFormulaire["livraison-prenom"] ?? "",
last_name: donneesFormulaire["livraison-nom"] ?? "",
phone: donneesFormulaire["livraison-telephone"] ?? "",
postcode: donneesFormulaire["livraison-code-postal"] ?? "",
state: donneesFormulaire["livraison-region-etat"] ?? ""
}
};
void EitherAsync.liftEither(eitherParse(argumentsFormulaire, WCStoreCartUpdateCustomerArgsSchema)).map(
(args) => postBackend({
corps: JSON.stringify(args),
nonce: ETATS_PAGE.nonce,
route: ROUTE_API_MAJ_CLIENT
})
).chain(
(reponse) => EitherAsync(async ({ throwE }) => {
const reponseSimplifiee = {
body: await reponse.json(),
status: reponse.status
};
return z(reponseSimplifiee).with({ status: 500 }, () => throwE(new ServerError("500 Server Error"))).with({ status: 200 }, () => reponseSimplifiee.body).run();
})
).chain((corsReponse) => EitherAsync.liftEither(eitherParse(corsReponse, WCStoreCartSchema))).ifRight((panier) => {
console.debug(panier);
const sousTotalLivraison = panier.totals.total_shipping === "0" ? "Free" : `${String(panier.totals.total_shipping)}`;
const prestataireLivraison = panier.shipping_rates[0]?.shipping_rates[0]?.name ?? "";
ELEMENTS.SOUS_TOTAL_LIVRAISON_COUT.textContent = sousTotalLivraison;
ELEMENTS.SOUS_TOTAL_LIVRAISON_PRESTATAIRE.textContent = prestataireLivraison;
sessionStorage.setItem(
"shipping_rates",
JSON.stringify(panier.shipping_rates[0]?.shipping_rates[0] ?? "")
);
ELEMENTS.BOUTON_ACTIONS_FORMULAIRE.textContent = "Check-out";
}).ifLeft((erreur) => z(erreur).with).finally(() => {
ELEMENTS.BOUTON_ACTIONS_FORMULAIRE.removeAttribute(ATTRIBUT_CHARGEMENT);
ELEMENTS.BOUTON_ACTIONS_FORMULAIRE.removeAttribute(ATTRIBUT_DESACTIVE);
}).run();
});
});
};
export {
initialiseBoutonActions as i
};
//# sourceMappingURL=scripts-page-panier-adresses.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,10 +1,10 @@
import { z, N } from "./index.CeK6pfoJ.js";
import { V as ValiError } from "./index.DxUTT09Y.js";
import { e as ROUTE_API_APPLIQUE_COUPON, f as ROUTE_API_RETIRE_COUPON } from "./api.js";
import { F as SELECTEUR_BOUTON_CODE_PROMO, G as SELECTEUR_CHAMP_CODE_PROMO, H as SELECTEUR_ENSEMBLE_CODE_PROMO, I as SELECTEUR_MESSAGE_CODE_PROMO, q as SELECTEUR_TOTAL_PANIER, J as SELECTEUR_TOTAL_REDUCTION, v as SELECTEUR_TOTAL_REDUCTION_VALEUR, E as ATTRIBUT_DESACTIVE, K as ATTRIBUT_CHARGEMENT, L as ATTRIBUT_CODE_PROMO_PRESENT, k as ATTRIBUT_HIDDEN } from "./dom.js";
import { d as ROUTE_API_APPLIQUE_COUPON, e as ROUTE_API_RETIRE_COUPON } from "./api.js";
import { G as SELECTEUR_BOUTON_CODE_PROMO, H as SELECTEUR_CHAMP_CODE_PROMO, I as SELECTEUR_ENSEMBLE_CODE_PROMO, J as SELECTEUR_MESSAGE_CODE_PROMO, q as SELECTEUR_TOTAL_PANIER, K as SELECTEUR_TOTAL_REDUCTION, o as SELECTEUR_TOTAL_REDUCTION_VALEUR, C as ATTRIBUT_DESACTIVE, F as ATTRIBUT_CHARGEMENT, L as ATTRIBUT_CODE_PROMO_PRESENT, k as ATTRIBUT_HIDDEN } from "./dom.js";
import { E as ERREUR_CODE_PROMO_INVALIDE } from "./erreurs.js";
import { l as lanceAnimationCycleTexte } from "./animations.js";
import { d as accorderCibleASelecteur, i as identity } from "./dom2.js";
import { c as accorderCibleASelecteur, i as identity } from "./dom2.js";
import { S as ServerError } from "./erreurs2.js";
import { E as ErreurCodePromoInvalide } from "./codes-promo.js";
import { e as estReponse500 } from "./gardes.js";
@ -18,7 +18,7 @@ import { e as eitherParse } from "./validation.js";
import { E as EitherAsync } from "./MaybeAsync.AE1jnxuc.js";
import { p as pipe } from "./pipe.XPB0wEfw.js";
import { M as Maybe } from "./Either.wHNxn7Os.js";
import "./exports.3IcOsN8u.js";
import "./exports.B84S-6H1.js";
import "./messages3.js";
import "./erreurs3.js";
import "./messages2.js";

View file

@ -1,84 +1,54 @@
import { z } from "./index.CeK6pfoJ.js";
import { p as parse, V as ValiError } from "./index.DxUTT09Y.js";
import { a as ROUTE_API_RETIRE_ARTICLE_PANIER, b as ROUTE_API_MAJ_ARTICLE_PANIER, c as ROUTE_API_MAJ_CLIENT, d as ROUTE_API_NOUVELLE_COMMANDES } from "./api.js";
import { l as SELECTEUR_ENTREES_PANIER, m as SELECTEUR_CONTENEUR_PANIER, n as SELECTEUR_SOUS_TOTAL_PRODUITS, o as SELECTEUR_SOUS_TOTAL_LIVRAISON_COUT, p as SELECTEUR_SOUS_TOTAL_LIVRAISON_PRESTATAIRE, q as SELECTEUR_TOTAL_PANIER, r as SELECTEUR_BOUTON_SEPARATION_ADRESSES, s as SELECTEUR_FORMULAIRE_PANIER, t as SELECTEUR_FORMULAIRE_FACTURATION, u as SELECTEUR_BOUTON_ACTIONS_FORMULAIRE, v as SELECTEUR_TOTAL_REDUCTION_VALEUR, w as SELECTEUR_INSTRUCTIONS_CLIENT, x as ATTRIBUT_CLE_PANIER, y as SELECTEUR_BOUTON_SOUSTRACTION_QUANTITE, z as SELECTEUR_CHAMP_QUANTITE_LIGNE_PANIER, B as SELECTEUR_BOUTON_ADDITION_QUANTITE, C as SELECTEUR_BOUTON_SUPPRESSION_PANIER, A as ATTRIBUT_CONTIENT_ARTICLES, D as SELECTEUR_PRIX_LIGNE_PANIER, k as ATTRIBUT_HIDDEN, E as ATTRIBUT_DESACTIVE } from "./dom.js";
import { p as parse } from "./index.DxUTT09Y.js";
import { a as ROUTE_API_RETIRE_ARTICLE_PANIER, b as ROUTE_API_MAJ_ARTICLE_PANIER } from "./api.js";
import { l as SELECTEUR_ENTREES_PANIER, m as SELECTEUR_CONTENEUR_PANIER, n as SELECTEUR_SOUS_TOTAL_PRODUITS, o as SELECTEUR_TOTAL_REDUCTION_VALEUR, p as SELECTEUR_INSTRUCTIONS_CLIENT, q as SELECTEUR_TOTAL_PANIER, r as SELECTEUR_BOUTON_SEPARATION_ADRESSES, s as SELECTEUR_FORMULAIRE_PANIER, t as SELECTEUR_FORMULAIRE_FACTURATION, u as SELECTEUR_BOUTON_ACTIONS_FORMULAIRE, v as ATTRIBUT_CLE_PANIER, w as SELECTEUR_BOUTON_SOUSTRACTION_QUANTITE, x as SELECTEUR_CHAMP_QUANTITE_LIGNE_PANIER, y as SELECTEUR_BOUTON_ADDITION_QUANTITE, z as SELECTEUR_BOUTON_SUPPRESSION_PANIER, A as ATTRIBUT_CONTIENT_ARTICLES, B as SELECTEUR_PRIX_LIGNE_PANIER, k as ATTRIBUT_HIDDEN, C as ATTRIBUT_DESACTIVE } from "./dom.js";
import { N as NOM_CANAL_BOUTON_PANIER, a as NOM_CANAL_CONTENU_PANIER } from "./messages3.js";
import { r as recupereElementOuLeve, a as recupereElementsAvecSelecteur, e as eitherSessionStorageGet, b as eitherJsonParse, c as recupereElementAvecSelecteur } from "./dom2.js";
import { l as leveServerError, r as reporteErreur, a as leveErreur } from "./erreurs2.js";
import { a as recupereElementsAvecSelecteur, b as recupereElementAvecSelecteur, r as recupereElementOuLeve } from "./dom2.js";
import { l as leveServerError, r as reporteErreur } from "./erreurs2.js";
import { e as estReponse500, a as estError } from "./gardes.js";
import { e as emetMessageMajBoutonPanier, a as emetMessageMajContenuPanier, v as valideMessageMajBoutonPanier, b as valideMessageMajContenuPanier } from "./messages.js";
import { p as postBackend, t as traiteReponseBackendWCSelonCodesHTTP } from "./reseau.js";
import { W as WCStoreCartRemoveItemArgsSchema } from "./cart-remove-item.js";
import { W as WCStoreCartUpdateCustomerArgsSchema } from "./cart-update-customer.js";
import { W as WCStoreCartUpdateItemArgsSchema } from "./cart-update-item.js";
import { W as WCStoreCartSchema } from "./cart.js";
import { W as WCStoreShippingRateShippingRateSchema } from "./couts-livraison.js";
import { W as WCV3OrdersArgsSchema, a as WCV3OrderSchema } from "./orders2.js";
import { c as recupereElementsDocumentEither, r as recupereElementDocumentEither, a as recupereElementDansDocumentOuLeve, y, p as propEither } from "./utils.js";
import { e as eitherParse } from "./validation.js";
import { c as recupereElementsDocumentEither, a as recupereElementDansDocumentOuLeve, y, p as propEither } from "./utils.js";
import { i as initialiseBoutonActions } from "./scripts-page-panier-adresses.js";
import { i as initialiseElementsCodePromo } from "./scripts-page-panier-code-promo.js";
import { p as pipe } from "./pipe.XPB0wEfw.js";
import { l } from "./index-0eef19ec.DoJSf22Z.js";
import { l } from "./index-0eef19ec.Bvb4qYFq.js";
import { M as Maybe, E as Either } from "./Either.wHNxn7Os.js";
import "./exports.3IcOsN8u.js";
import "./exports.B84S-6H1.js";
import "./erreurs3.js";
import "./messages2.js";
import "./adresses.js";
import "./validation.js";
import "./index.CeK6pfoJ.js";
import "./cart2.js";
import "./adresses.js";
import "./cart-coupons.js";
import "./orders3.js";
import "./erreurs.js";
import "./couts-livraison.js";
import "./animations.js";
import "./cart-update-customer.js";
import "./MaybeAsync.AE1jnxuc.js";
import "./erreurs.js";
import "./codes-promo.js";
import "./cart-apply-coupon.js";
import "./cart-remove-coupon.js";
import "./MaybeAsync.AE1jnxuc.js";
import "./belt_Option-91f3b350.cBye8bLJ.js";
import "./belt_Option-91f3b350.Bf2JA1bN.js";
const ETATS_PAGE = _etats;
const ENTREES_PANIER_EITHER = recupereElementsDocumentEither(
SELECTEUR_ENTREES_PANIER
);
const CONTENEUR_PANIER = pipe(
recupereElementDocumentEither(SELECTEUR_CONTENEUR_PANIER),
recupereElementOuLeve
const CONTENEUR_PANIER = recupereElementDansDocumentOuLeve(SELECTEUR_CONTENEUR_PANIER);
const SOUS_TOTAL_PRODUITS = recupereElementDansDocumentOuLeve(SELECTEUR_SOUS_TOTAL_PRODUITS);
const SOUS_TOTAL_REDUCTION = recupereElementDansDocumentOuLeve(SELECTEUR_TOTAL_REDUCTION_VALEUR);
recupereElementDansDocumentOuLeve(SELECTEUR_INSTRUCTIONS_CLIENT);
const TOTAL_PANIER = recupereElementDansDocumentOuLeve(SELECTEUR_TOTAL_PANIER);
const BOUTON_SEPARATION_ADRESSES = recupereElementDansDocumentOuLeve(
SELECTEUR_BOUTON_SEPARATION_ADRESSES
);
const SOUS_TOTAL_PRODUITS = pipe(
recupereElementDocumentEither(SELECTEUR_SOUS_TOTAL_PRODUITS),
recupereElementOuLeve
);
const SOUS_TOTAL_LIVRAISON_COUT = pipe(
recupereElementDocumentEither(SELECTEUR_SOUS_TOTAL_LIVRAISON_COUT),
recupereElementOuLeve
);
const SOUS_TOTAL_LIVRAISON_PRESTATAIRE = pipe(
recupereElementDocumentEither(SELECTEUR_SOUS_TOTAL_LIVRAISON_PRESTATAIRE),
recupereElementOuLeve
);
const SOUS_TOTAL_REDUCTION = recupereElementDansDocumentOuLeve(
SELECTEUR_TOTAL_REDUCTION_VALEUR
);
const INSTRUCTIONS_CLIENT = recupereElementDansDocumentOuLeve(
SELECTEUR_INSTRUCTIONS_CLIENT
);
const TOTAL_PANIER = pipe(
recupereElementDocumentEither(SELECTEUR_TOTAL_PANIER),
recupereElementOuLeve
);
const BOUTON_SEPARATION_ADRESSES = pipe(
recupereElementDocumentEither(SELECTEUR_BOUTON_SEPARATION_ADRESSES),
recupereElementOuLeve
);
const FORMULAIRE_PANIER = pipe(
recupereElementDocumentEither(SELECTEUR_FORMULAIRE_PANIER),
recupereElementOuLeve
);
const FORMULAIRE_FACTURATION = pipe(
recupereElementDocumentEither(SELECTEUR_FORMULAIRE_FACTURATION),
recupereElementOuLeve
);
let BOUTON_ACTIONS_FORMULAIRE = pipe(
recupereElementDocumentEither(SELECTEUR_BOUTON_ACTIONS_FORMULAIRE),
recupereElementOuLeve
recupereElementDansDocumentOuLeve(SELECTEUR_FORMULAIRE_PANIER);
const FORMULAIRE_FACTURATION = recupereElementDansDocumentOuLeve(SELECTEUR_FORMULAIRE_FACTURATION);
recupereElementDansDocumentOuLeve(
SELECTEUR_BOUTON_ACTIONS_FORMULAIRE
);
const recupereElementDansEntreePanierOuLeve = (entree) => (selecteur) => pipe(recupereElementAvecSelecteur(entree)(selecteur), recupereElementOuLeve);
const desactiveBoutonsEntreesPanier = (entrees) => entrees.forEach((entree) => {
@ -298,167 +268,6 @@ const initialiseMajFormulairesPanier = () => {
});
});
};
const initialiseBoutonActions = () => {
BOUTON_ACTIONS_FORMULAIRE.addEventListener("click", (evenement) => {
Maybe.fromFalsy(FORMULAIRE_PANIER.checkValidity()).ifJust(() => {
evenement.preventDefault();
FORMULAIRE_PANIER.removeAttribute(ATTRIBUT_HIDDEN);
BOUTON_ACTIONS_FORMULAIRE.textContent = "Check-out";
}).ifJust(() => {
const donneesFormulaire = pipe(
new FormData(FORMULAIRE_PANIER),
(formData) => formData.entries(),
(entrees) => Array.from(entrees),
(tuple) => y.fromPairs(tuple)
);
const argumentsFormulaire = {
billing_address: {
address_1: donneesFormulaire["facturation-adresse"] ?? donneesFormulaire["livraison-adresse"] ?? "",
address_2: "",
city: donneesFormulaire["facturation-ville"] ?? donneesFormulaire["livraison-ville"] ?? "",
company: "",
country: "FR",
email: donneesFormulaire["facturation-email"] ?? donneesFormulaire["livraison-email"] ?? "",
first_name: donneesFormulaire["facturation-prenom"] ?? donneesFormulaire["livraison-prenom"] ?? "",
last_name: donneesFormulaire["facturation-nom"] ?? donneesFormulaire["livraison-nom"] ?? "",
phone: donneesFormulaire["facturation-telephone"] ?? donneesFormulaire["livraison-telephone"] ?? "",
postcode: donneesFormulaire["facturation-code-postal"] ?? donneesFormulaire["livraison-code-postal"] ?? "",
state: donneesFormulaire["facturation-region-etat"] ?? donneesFormulaire["livraison-region-etat"] ?? ""
},
shipping_address: {
address_1: donneesFormulaire["livraison-adresse"] ?? "",
address_2: "",
city: donneesFormulaire["livraison-ville"] ?? "",
company: "",
country: "FR",
first_name: donneesFormulaire["livraison-prenom"] ?? "",
last_name: donneesFormulaire["livraison-nom"] ?? "",
phone: donneesFormulaire["livraison-telephone"] ?? "",
postcode: donneesFormulaire["livraison-code-postal"] ?? "",
state: donneesFormulaire["livraison-region-etat"] ?? ""
}
};
Either.encase(
() => parse(WCStoreCartUpdateCustomerArgsSchema, argumentsFormulaire)
).map(async (args) => {
await postBackend({
corps: JSON.stringify(args),
nonce: ETATS_PAGE.nonce,
route: ROUTE_API_MAJ_CLIENT
}).then(async (reponse) => {
if (estReponse500(reponse)) leveServerError("500 Server Error");
pipe(
// Récupère la Réponse
await reponse.json(),
// Traite tous les codes HTTPs possibles
(corpsReponse) => traiteReponseBackendWCSelonCodesHTTP(
corpsReponse,
WCStoreCartSchema
),
l.tap((donnees) => {
const sousTotalLivraison = donnees.totals.total_shipping === "0" ? "Free" : `${String(donnees.totals.total_shipping)} €`;
const sousTotalPrestataire = z(donnees.shipping_rates[0]?.shipping_rates[0]?.name).with("Mondial Relay - Livraison Point Relais (Gratuit)", () => "Mondial Relay - Pickup Point").with("Free shipping", () => "Free Shipping").otherwise(() => "");
SOUS_TOTAL_LIVRAISON_COUT.textContent = sousTotalLivraison;
SOUS_TOTAL_LIVRAISON_PRESTATAIRE.textContent = sousTotalPrestataire;
sessionStorage.setItem(
"shipping_rates",
JSON.stringify(donnees.shipping_rates[0]?.shipping_rates[0] ?? "")
);
})
);
initialiseBoutonCreationCommande();
});
}).ifLeft((a) => console.error(a.issues));
});
});
};
const initialiseBoutonCreationCommande = () => {
BOUTON_ACTIONS_FORMULAIRE.outerHTML = BOUTON_ACTIONS_FORMULAIRE.outerHTML;
BOUTON_ACTIONS_FORMULAIRE = recupereElementDansDocumentOuLeve(SELECTEUR_BOUTON_ACTIONS_FORMULAIRE);
BOUTON_ACTIONS_FORMULAIRE.addEventListener("click", (evenement) => {
Maybe.fromFalsy(FORMULAIRE_PANIER.checkValidity()).ifJust(() => {
evenement.preventDefault();
BOUTON_ACTIONS_FORMULAIRE.textContent = "Submitting...";
}).ifJust(() => {
const donneesFormulaire = Object.fromEntries(new FormData(FORMULAIRE_PANIER));
const methodeLivraison = eitherSessionStorageGet("shipping_rates").chain(eitherJsonParse).chain(
(json) => eitherParse(
json,
WCStoreShippingRateShippingRateSchema
)
).ifLeft((e) => {
if (e instanceof ValiError) console.error(e.issues);
console.error("methodeLivraison", e);
BOUTON_ACTIONS_FORMULAIRE.textContent = "Check-out";
leveErreur(e);
}).unsafeCoerce();
const articlesPanier = ENTREES_PANIER_EITHER.orDefault([]).map((entree) => ({
product_id: Number(entree.getAttribute("data-id-produit")),
quantity: Number(entree.getAttribute("data-quantite")),
...entree.getAttribute("data-id-variation") && {
variation_id: Number(entree.getAttribute("data-id-variation"))
}
}));
const argumentsFormulaire = {
billing: {
address_1: donneesFormulaire["facturation-adresse"] ?? donneesFormulaire["livraison-adresse"] ?? "",
address_2: "",
city: donneesFormulaire["facturation-ville"] ?? donneesFormulaire["livraison-ville"] ?? "",
company: "",
country: "FR",
email: donneesFormulaire["facturation-email"] ?? donneesFormulaire["livraison-email"] ?? "",
first_name: donneesFormulaire["facturation-prenom"] ?? donneesFormulaire["livraison-prenom"] ?? "",
last_name: donneesFormulaire["facturation-nom"] ?? donneesFormulaire["livraison-nom"] ?? "",
phone: donneesFormulaire["facturation-telephone"] ?? donneesFormulaire["livraison-telephone"] ?? "",
postcode: donneesFormulaire["facturation-code-postal"] ?? donneesFormulaire["livraison-code-postal"] ?? "",
state: donneesFormulaire["facturation-region-etat"] ?? donneesFormulaire["livraison-region-etat"] ?? ""
},
currency: methodeLivraison.currency_code,
customer_note: INSTRUCTIONS_CLIENT.value,
line_items: articlesPanier,
shipping: {
address_1: donneesFormulaire["livraison-adresse"] ?? "",
address_2: "",
city: donneesFormulaire["livraison-ville"] ?? "",
company: "",
country: "FR",
first_name: donneesFormulaire["livraison-prenom"] ?? "",
last_name: donneesFormulaire["livraison-nom"] ?? "",
phone: donneesFormulaire["livraison-telephone"] ?? "",
postcode: donneesFormulaire["livraison-code-postal"] ?? "",
state: donneesFormulaire["livraison-region-etat"] ?? ""
},
shipping_lines: [
{
method_id: methodeLivraison.method_id,
method_title: methodeLivraison.name,
total: methodeLivraison.price
}
]
};
eitherParse(argumentsFormulaire, WCV3OrdersArgsSchema).map(async (args) => {
await postBackend({
authString: ETATS_PAGE.authString,
corps: JSON.stringify(args),
nonce: ETATS_PAGE.nonce,
route: ROUTE_API_NOUVELLE_COMMANDES
}).then(async (reponse) => {
if (estReponse500(reponse)) leveServerError("500 Server Error");
pipe(
// Récupère la Réponse
await reponse.json(),
(corpsReponse) => eitherParse(corpsReponse, WCV3OrderSchema).ifRight((reponse2) => {
const url = new URL(`https://${window.location.host}/checkout`);
url.searchParams.append("order_key", reponse2.order_key);
url.searchParams.append("order_id", String(reponse2.id));
location.assign(url);
}).ifLeft((e) => console.error(e.issues))
);
});
}).ifLeft((a) => console.error(a.issues));
});
});
};
document.addEventListener("DOMContentLoaded", () => {
initialiseMajEntreesPanier();
initialiseMajConteneurPanier();

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
import { z } from "./index.CeK6pfoJ.js";
import { g as ROUTE_API_AJOUTE_ARTICLE_PANIER, E as ENTETE_WC_NONCE } from "./api.js";
import { M as SELECTEUR_BOUTON_AJOUT_PANIER, N as SELECTEUR_SELECTEUR_QUANTITE, O as SELECTEUR_LIENS_ONGLETS, P as SELECTEUR_SECTIONS_CONTENUS, Q as SELECTEUR_PRIX_PRODUIT, R as SELECTEUR_CONTENEUR_FLECHES_DEFILEMENT, T as SELECTEUR_FLECHE_DEFILEMENT_GAUCHE, U as SELECTEUR_FLECHE_DEFILEMENT_DROITE, V as SELECTEUR_PHOTOS_PRODUIT, W as SELECTEUR_IMAGE_COLONNE_GAUCHE, X as SELECTEUR_IMAGES_COLONNE_DROITE, Y as ATTRIBUT_INDEX_IMAGE_ACTIVE, Z as ATTRIBUT_ARIA_SELECTED, k as ATTRIBUT_HIDDEN, E as ATTRIBUT_DESACTIVE, _ as ATTRIBUT_PRIX } from "./dom.js";
import { r as recupereElementOuLeve, f as recupereElementsOuLeve, R as Ra } from "./dom2.js";
import { f as ROUTE_API_AJOUTE_ARTICLE_PANIER, E as ENTETE_WC_NONCE } from "./api.js";
import { M as SELECTEUR_BOUTON_AJOUT_PANIER, N as SELECTEUR_SELECTEUR_QUANTITE, O as SELECTEUR_LIENS_ONGLETS, P as SELECTEUR_SECTIONS_CONTENUS, Q as SELECTEUR_PRIX_PRODUIT, R as SELECTEUR_CONTENEUR_FLECHES_DEFILEMENT, T as SELECTEUR_FLECHE_DEFILEMENT_GAUCHE, U as SELECTEUR_FLECHE_DEFILEMENT_DROITE, V as SELECTEUR_PHOTOS_PRODUIT, W as SELECTEUR_IMAGE_COLONNE_GAUCHE, X as SELECTEUR_IMAGES_COLONNE_DROITE, Y as ATTRIBUT_INDEX_IMAGE_ACTIVE, Z as ATTRIBUT_ARIA_SELECTED, k as ATTRIBUT_HIDDEN, C as ATTRIBUT_DESACTIVE, _ as ATTRIBUT_PRIX } from "./dom.js";
import { r as recupereElementOuLeve, d as recupereElementsOuLeve, R as Ra } from "./dom2.js";
import { l as leveServerError, r as reporteErreur } from "./erreurs2.js";
import { b as estHTMLSelectElement, e as estReponse500, a as estError } from "./gardes.js";
import { e as emetMessageMajBoutonPanier } from "./messages.js";
@ -11,9 +11,9 @@ import { W as WCStoreCartSchema } from "./cart.js";
import { r as recupereElementDocumentEither, a as recupereElementDansDocumentOuLeve, c as recupereElementsDocumentEither, b as recupereElementsDansDocumentOuLeve, y } from "./utils.js";
import { e as eitherParse } from "./validation.js";
import { p as pipe } from "./pipe.XPB0wEfw.js";
import { l } from "./index-0eef19ec.DoJSf22Z.js";
import { l } from "./index-0eef19ec.Bvb4qYFq.js";
import { M as Maybe } from "./Either.wHNxn7Os.js";
import "./exports.3IcOsN8u.js";
import "./exports.B84S-6H1.js";
import "./index.DxUTT09Y.js";
import "./messages3.js";
import "./erreurs3.js";
@ -22,7 +22,7 @@ import "./cart2.js";
import "./adresses.js";
import "./cart-coupons.js";
import "./couts-livraison.js";
import "./belt_Option-91f3b350.cBye8bLJ.js";
import "./belt_Option-91f3b350.Bf2JA1bN.js";
const ETATS_PAGE = _etats;
const deplieToutesSections = (ensembleLiensContenus) => {
ensembleLiensContenus.forEach((ensemble) => {

View file

@ -1,8 +1,8 @@
import { l as values, m as fromArray, g as equal, n as get$1, u as unsafeDeleteKey, o as forEachU, p as mapU, q as reduceU, t as append, a as recupereElementsAvecSelecteur, c as recupereElementAvecSelecteur, r as recupereElementOuLeve, f as recupereElementsOuLeve } from "./dom2.js";
import { j as values, k as fromArray, e as equal, l as get$1, u as unsafeDeleteKey, m as forEachU, n as mapU, o as reduceU, p as append, a as recupereElementsAvecSelecteur, b as recupereElementAvecSelecteur, r as recupereElementOuLeve, d as recupereElementsOuLeve } from "./dom2.js";
import { C as CleNonTrouveError } from "./erreurs2.js";
import { p as pipe } from "./pipe.XPB0wEfw.js";
import { M as Maybe } from "./Either.wHNxn7Os.js";
import "./exports.3IcOsN8u.js";
import "./exports.B84S-6H1.js";
function placeholder(e) {
}
function makeEmpty(e) {

View file

@ -12,28 +12,18 @@ use Stripe\BillingPortal\Session;
header("Content-Type: application/json; charset=utf-8");
// Récupère les informations nécessaires
/** @var WC_Session_Handler $session_wc */
/** @var WC_Session_Handler $session_wc La Session WooCommerce contenant entre autre le Panier. */
$session_wc = WC()->session;
/** @var bool $possede_session_wc */
$possede_session_wc = $session_wc->has_session();
/** @var string $url_accueil */
$url_accueil = get_page_link(get_page_by_path("home")->ID);
/** @var string $url_succes_commande */
$url_succes_commande = get_page_link(get_page_by_path("successful-order"));
/** @var string $url_echec_commande */
$url_echec_commande = get_page_link(get_page_by_path("failed-order"));
// Retourne une 403 si l'Utilisateur n'a pas de session WooCommerce
if (!$possede_session_wc) {
header("HTTP/1.1 403 Forbidden");
$reponse = ["success" => "false", "status" => "unauthorized"];
echo json_encode($reponse);
return;
}
/** @var array<string,string> $urls URLs utilisables pour rediriger l'Utilisateur. */
$urls = [
"accueil" => get_page_link(get_page_by_path("home")),
"succes_commande" => get_page_link(get_page_by_path("successful-order")),
"echec_commande" => get_page_link(get_page_by_path("failed-order")),
];
// Redirige à la page d'accueil si le Panier est vide
if (WC()->cart->is_empty()) {
header("Location: $url_accueil");
header("Location: " . $urls["accueil"]);
return;
}
@ -60,28 +50,31 @@ if (!$order_key) {
$panier = WC()->cart;
/** @var string $email_client */
$email_client = WC()->session->get("customer")["email"];
/** @var mixed $articles */
$articles = [];
/** @var array<\Stripe\Product> $articles */
$articles = collect($panier->get_cart())
->map(function ($article_panier) {
$titre_produit = match ($article_panier["data"]?->get_type() == "variable") {
true => $article_panier["data"]?->get_title() .
" (" .
explode(": ", $article_panier["data"]?->get_attribute_summary())[1] .
")",
false => $article_panier["data"]?->get_title(),
};
// TODO: Cas des Produits Simples : Pas de Attribute Summary !
foreach ($panier->get_cart() as $cle_panier => $article_panier) {
$titre_produit = $article_panier["data"]?->get_title();
$est_variation = $article_panier["variation_id"] !== null;
$titre_variation = explode(": ", $article_panier["data"]?->get_attribute_summary())[1];
$titre_variation_formatte = $est_variation ? " (" . $titre_variation . ")" : "";
array_push($articles, [
"price_data" => [
"currency" => "EUR",
"product_data" => [
"name" => "$titre_produit$titre_variation_formatte",
"images" => [wp_get_attachment_image_url($article_panier["data"]?->get_image_id())],
return [
"price_data" => [
"currency" => "EUR",
"product_data" => [
"name" => $titre_produit,
"images" => [wp_get_attachment_image_url($article_panier["data"]?->get_image_id())],
],
"unit_amount" => $article_panier["data"]?->get_price() * 100,
],
"unit_amount" => $article_panier["data"]?->get_price() * 100,
],
"quantity" => $article_panier["quantity"],
]);
}
"quantity" => $article_panier["quantity"],
];
})
->values()
->toArray();
// Récupère la Commande et la Méthode de Livraison
/** @var WC_Order $commande */
@ -98,35 +91,30 @@ $methode_livraison = [
// Met à jour les Codes promos
$coupons_stripe = collect(\Stripe\Coupon::all()->data);
$coupons_wc = collect(WC()->cart->get_coupons())
->map(function (WC_Coupon $coupon) {
return [
->map(
fn(WC_Coupon $coupon) => [
"duration" => "forever",
"id" => $coupon->get_code(),
"name" => $coupon->get_code(),
$coupon->get_discount_type() == "fixed_cart" ? "amount_off" : "percent_off" => $coupon->get_amount(),
];
})
],
)
->each(function (array $item) use ($coupons_stripe) {
// Si le code promo n'existe, le créé
// Si le code promo n'existe, le créer
if (!$coupons_stripe->contains("name", $item["name"])) {
\Stripe\Coupon::create($item);
}
});
$reductions_stripe = $coupons_wc
->map(function (array $coupon) {
return ["coupon" => $coupon["name"]];
})
->values()
->toArray();
$reductions_stripe = $coupons_wc->map(fn($coupon) => ["coupon" => $coupon["name"]])->values()->toArray();
/** @var Session $session_checkout_stripe */
$session_checkout_stripe = \Stripe\Checkout\Session::create(
[
"cancel_url" => "$url_accueil",
"cancel_url" => $urls["echec_commande"],
"customer_email" => $email_client,
"discounts" => $reductions_stripe,
"line_items" => $articles,
"mode" => "payment",
"success_url" => "$url_succes_commande?session_id={CHECKOUT_SESSION_ID}",
"success_url" => $urls["succes_commande"] . "?session_id={CHECKOUT_SESSION_ID}",
"metadata" => [
"order_id" => $order_id,
"order_key" => $order_key,
@ -152,6 +140,5 @@ $session_checkout_stripe = \Stripe\Checkout\Session::create(
// echo json_encode($session_checkout_stripe);
header("HTTP/1.1 303 See Other");
header("Location: " . $session_checkout_stripe->url);
// contact@gcch.fr
exit();

View file

@ -59,14 +59,25 @@ try {
// Récupère les données des Produits
/** @var mixed $produits Les Produits de la Commande sous forme de tableau contenant uniquement les données affichées nécessaires pour le Page. */
$produits = collect($commande->get_items())->map(function (WC_Order_Item $produit_commande) {
$produits = collect($commande->get_items())->map(function (WC_Order_Item $produit_commande) use ($commande) {
/** @var string $id_produit L'ID du Produit. */
$id_produit = $produit_commande["product_id"];
/** @var WC_Product|false $produit Les informations du Produit. */
/** @var WC_Product|WC_Product_Variable|false $produit Les informations du Produit. */
$produit = wc_get_product($produit_commande["product_id"]);
// Récupère le nom et la valeur de l'attribut du Produit
$attribut = $produit->is_type("variable")
? collect($produit->get_attributes())
->mapWithKeys(function ($atr, $cle) use ($produit_commande) {
$nom_attribut = wc_attribute_label($cle, $produit_commande->get_product());
$valeur_attribut = $produit_commande->get_product()->get_attribute($cle);
return [["nom" => $nom_attribut, "valeur" => $valeur_attribut]];
})
->toArray()
: [];
return [
"attributs" => recupere_et_formate_attributs_produit($produit->get_attributes()),
"attribut" => $attribut,
"id_produit" => $id_produit,
"image" => pipe($produit->get_image_id(), fn($id) => genere_balise_img_multiformats(id: $id, lazy: true)),
"permalien" => $produit->get_permalink(),
@ -78,10 +89,6 @@ try {
$contexte["produits"] = $produits;
echo "<pre>";
print_r($produits);
echo "</pre>";
// Charge les scripts et styles de la page
function charge_scripts_styles_page_succes_commande(): void {
wp_enqueue_style(

View file

@ -189,12 +189,12 @@ add_filter("woocommerce_rest_prepare_product_object", "genere_prix_maximal_produ
/**
* Retire la propagande commerciale de WooCommerce du menu.
*/
function retire_onglet_paiement_admin_woocommerce(): void {
remove_menu_page("admin.php?page=wc-admin&task=woocommerce-payments");
function remove_payments_ad_tab(): void {
remove_menu_page("admin.php?page=wc-settings&tab=checkout");
}
add_action("add_meta_boxes", "desactive_champs_admin_images_produit_woocommerce", 40);
add_action("admin_menu", "retire_onglet_paiement_admin_woocommerce", 999);
add_action("admin_menu", "remove_payments_ad_tab", 999);
add_action("after_setup_theme", "desactive_images_produit_woocommerce");
add_action("enqueue_block_assets", "desactive_blocs_gutenberg_woocommerce");
add_action("init", "desactive_attribution_commande_woocommerce");

View file

@ -23,6 +23,7 @@
grid-auto-rows: 1fr;
grid-template-columns:
repeat(auto-fit, minmax(var(--carte-produit-longueur-minimale), 1fr)); /* 1 */
gap: 1px; /* 2 */
min-height: var(--grille-produits-hauteur-minimale);

View file

@ -67,6 +67,7 @@
display: grid;
grid-template-columns:
repeat(auto-fit, minmax(var(--menu-entree-longueur-minimale), 1fr)); /* 1 */
gap: 1px;
place-items: center;

View file

@ -92,8 +92,7 @@
border: initial;
border-top: 1px solid var(--couleur-noir);
&::-webkit-outer-spin-button,
&::-webkit-inner-spin-button {
&::-webkit-outer-spin-button, &::-webkit-inner-spin-button {
margin: 0; /* 2 */
appearance: none; /* 2 */
}
@ -147,24 +146,24 @@
&__code-promo {
display: flex;
flex-flow: row wrap;
width: fit-content;
place-content: center;
width: fit-content;
margin: auto;
/*
* 1. Longueur minimale pour le Bouton n'ait pas à changer de taille quel que soit son texte
*/
button {
min-width: 9rem; /* 1 */
padding: var(--espace-xs) var(--espace-xl);
text-transform: lowercase;
border: 1px solid var(--couleur-noir);
border-left: initial;
min-width: 9rem; /* 1 */
}
&__message {
margin-top: var(--espace-m);
flex-basis: 100%;
margin-top: var(--espace-m);
}
}
}

View file

@ -0,0 +1,169 @@
import { D, pipe } from "@mobily/ts-belt";
import { EitherAsync, Maybe } from "purify-ts";
import { match } from "ts-pattern";
import type { WCStoreCart } from "./lib/types/api/cart";
import type { WCStoreCartUpdateCustomerArgs } from "./lib/types/api/cart-update-customer";
import type { ReponseSimplifiee } from "./lib/types/reseau";
import { ROUTE_API_MAJ_CLIENT } from "./constantes/api";
import {
ATTRIBUT_CHARGEMENT,
ATTRIBUT_DESACTIVE,
SELECTEUR_BOUTON_ACTIONS_FORMULAIRE,
SELECTEUR_FORMULAIRE_PANIER,
SELECTEUR_SOUS_TOTAL_LIVRAISON_COUT,
SELECTEUR_SOUS_TOTAL_LIVRAISON_PRESTATAIRE,
} from "./constantes/dom";
import { lanceAnimationCycleTexte } from "./lib/animations";
import { ServerError } from "./lib/erreurs";
import { postBackend } from "./lib/reseau";
import { WCStoreCartSchema } from "./lib/schemas/api/cart";
import { WCStoreCartUpdateCustomerArgsSchema } from "./lib/schemas/api/cart-update-customer";
import { recupereElementDansDocumentOuLeve } from "./lib/utils";
import { eitherParse } from "./lib/validation";
/** États utiles pour les scripts de la page. */
type EtatsPage = {
authString: string;
/** Un nonce pour l'authentification de requêtes API vers le backend WooCommerce. */
nonce: string;
};
// @ts-expect-error -- États injectés par le modèle PHP
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- États injectés par le modèle PHP
const ETATS_PAGE: EtatsPage = _etats;
const ELEMENTS = {
BOUTON_ACTIONS_FORMULAIRE: recupereElementDansDocumentOuLeve<HTMLButtonElement>(SELECTEUR_BOUTON_ACTIONS_FORMULAIRE),
FORMULAIRE_PANIER: recupereElementDansDocumentOuLeve<HTMLFormElement>(SELECTEUR_FORMULAIRE_PANIER),
SOUS_TOTAL_LIVRAISON_COUT: recupereElementDansDocumentOuLeve<HTMLElement>(SELECTEUR_SOUS_TOTAL_LIVRAISON_COUT),
SOUS_TOTAL_LIVRAISON_PRESTATAIRE: recupereElementDansDocumentOuLeve<HTMLSpanElement>(
SELECTEUR_SOUS_TOTAL_LIVRAISON_PRESTATAIRE,
),
};
export const initialiseBoutonActions = (): void => {
// Déclenche la requête pour la soumission des adresses
ELEMENTS.BOUTON_ACTIONS_FORMULAIRE.addEventListener("click", evenement => {
Maybe
// Ne fais rien si le Formulaire n'est pas valide
.fromFalsy(ELEMENTS.FORMULAIRE_PANIER.checkValidity())
.ifJust(() => {
evenement.preventDefault();
// Désactive le Bouton pour empêcher des requêtes concurrentes
ELEMENTS.BOUTON_ACTIONS_FORMULAIRE.setAttribute(ATTRIBUT_DESACTIVE, "");
ELEMENTS.BOUTON_ACTIONS_FORMULAIRE.setAttribute(ATTRIBUT_CHARGEMENT, "");
// Lance un cycle d'animation sur le texte de chargement
const animation = lanceAnimationCycleTexte({
attribut: ATTRIBUT_CHARGEMENT,
element: ELEMENTS.BOUTON_ACTIONS_FORMULAIRE,
etapes: [
"Loading",
"Loading.",
"Loading..",
"Loading...",
],
});
animation.callback();
animation.interval = setInterval(animation.callback, 500);
})
.ifJust(() => {
// Récupère les données du Formulaire
// @ts-expect-error -- Problème de typage de la librairie DOM
const donneesFormulaire: Record<string, string> = pipe(
new FormData(ELEMENTS.FORMULAIRE_PANIER),
formData => formData.entries(),
entrees => Array.from(entrees),
tuple => D.fromPairs(tuple),
);
// Transforme les données brutes en arguments de requête auprès du backend
const argumentsFormulaire: WCStoreCartUpdateCustomerArgs = {
billing_address: {
address_1: donneesFormulaire["facturation-adresse"] ?? donneesFormulaire["livraison-adresse"] ?? "",
address_2: "",
city: donneesFormulaire["facturation-ville"] ?? donneesFormulaire["livraison-ville"] ?? "",
company: "",
country: "FR",
email: donneesFormulaire["facturation-email"] ?? donneesFormulaire["livraison-email"] ?? "",
first_name: donneesFormulaire["facturation-prenom"] ?? donneesFormulaire["livraison-prenom"] ?? "",
last_name: donneesFormulaire["facturation-nom"] ?? donneesFormulaire["livraison-nom"] ?? "",
phone: donneesFormulaire["facturation-telephone"] ?? donneesFormulaire["livraison-telephone"] ?? "",
postcode: donneesFormulaire["facturation-code-postal"] ?? donneesFormulaire["livraison-code-postal"] ?? "",
state: donneesFormulaire["facturation-region-etat"] ?? donneesFormulaire["livraison-region-etat"] ?? "",
},
shipping_address: {
address_1: donneesFormulaire["livraison-adresse"] ?? "",
address_2: "",
city: donneesFormulaire["livraison-ville"] ?? "",
company: "",
country: "FR",
first_name: donneesFormulaire["livraison-prenom"] ?? "",
last_name: donneesFormulaire["livraison-nom"] ?? "",
phone: donneesFormulaire["livraison-telephone"] ?? "",
postcode: donneesFormulaire["livraison-code-postal"] ?? "",
state: donneesFormulaire["livraison-region-etat"] ?? "",
},
};
// Réalise la requête et traite sa réponse
void EitherAsync
// Vérifie le Schéma des Arguments
.liftEither(eitherParse(argumentsFormulaire, WCStoreCartUpdateCustomerArgsSchema))
.map((args: WCStoreCartUpdateCustomerArgs) =>
postBackend({
corps: JSON.stringify(args),
nonce: ETATS_PAGE.nonce,
route: ROUTE_API_MAJ_CLIENT,
})
)
// Traite les cas d'Erreur et récupère la réponse du backend
.chain((reponse: Response) =>
EitherAsync<ServerError, unknown>(async ({ throwE }) => {
const reponseSimplifiee: ReponseSimplifiee = {
body: await reponse.json(),
status: reponse.status,
};
return match(reponseSimplifiee)
.with({ status: 500 }, () => throwE(new ServerError("500 Server Error")))
.with({ status: 200 }, () => reponseSimplifiee.body)
.run();
})
)
// Vérifie le Schéma de la réponse du backend
.chain((corsReponse: unknown) => EitherAsync.liftEither(eitherParse(corsReponse, WCStoreCartSchema)))
.ifRight((panier: WCStoreCart) => {
console.debug(panier);
const sousTotalLivraison = panier.totals.total_shipping === "0"
? "Free"
: `${String(panier.totals.total_shipping)}`;
const prestataireLivraison = panier.shipping_rates[0]?.shipping_rates[0]?.name ?? "";
// Met à jour les informations de Livraison affichés à l'Utilisateur
ELEMENTS.SOUS_TOTAL_LIVRAISON_COUT.textContent = sousTotalLivraison;
ELEMENTS.SOUS_TOTAL_LIVRAISON_PRESTATAIRE.textContent = prestataireLivraison;
// Sauvegarde la Méthode de Livraison dans le Stockage de Session
sessionStorage.setItem(
"shipping_rates",
JSON.stringify(panier.shipping_rates[0]?.shipping_rates[0] ?? ""),
);
ELEMENTS.BOUTON_ACTIONS_FORMULAIRE.textContent = "Check-out";
// Active le Bouton pour la création de la Commande
// initialiseBoutonCreationCommande();
})
.ifLeft(erreur => match(erreur).with)
.finally(() => {
// Désactive l'animation de chargement et rend le Bouton de nouveau cliquable
ELEMENTS.BOUTON_ACTIONS_FORMULAIRE.removeAttribute(ATTRIBUT_CHARGEMENT);
ELEMENTS.BOUTON_ACTIONS_FORMULAIRE.removeAttribute(ATTRIBUT_DESACTIVE);
})
.run();
});
});
};

View file

@ -1,19 +1,16 @@
import { D, F, pipe } from "@mobily/ts-belt";
import { Either, Maybe } from "purify-ts";
import { match } from "ts-pattern";
import { parse, ValiError } from "valibot";
import type { MessageMajContenuPanierSchema } from "./lib/schemas/messages.ts";
import type { WCStoreCart, WCStoreCartItem, WCStoreShippingRateShippingRate } from "./lib/types/api/cart";
import type { WCStoreCartRemoveItemArgs } from "./lib/types/api/cart-remove-item";
import type { WCStoreCartUpdateCustomerArgs } from "./lib/types/api/cart-update-customer";
import type { WCStoreCartUpdateItemArgs } from "./lib/types/api/cart-update-item";
import type { WCV3Order, WCV3OrdersArgs } from "./lib/types/api/v3/orders.ts";
import type { MessageMajBoutonPanierDonnees, MessageMajContenuPanierDonnees } from "./lib/types/messages";
import {
ROUTE_API_MAJ_ARTICLE_PANIER,
ROUTE_API_MAJ_CLIENT,
ROUTE_API_NOUVELLE_COMMANDES,
ROUTE_API_RETIRE_ARTICLE_PANIER,
} from "./constantes/api.ts";
@ -34,8 +31,6 @@ import {
SELECTEUR_FORMULAIRE_PANIER,
SELECTEUR_INSTRUCTIONS_CLIENT,
SELECTEUR_PRIX_LIGNE_PANIER,
SELECTEUR_SOUS_TOTAL_LIVRAISON_COUT,
SELECTEUR_SOUS_TOTAL_LIVRAISON_PRESTATAIRE,
SELECTEUR_SOUS_TOTAL_PRODUITS,
SELECTEUR_TOTAL_PANIER,
SELECTEUR_TOTAL_REDUCTION_VALEUR,
@ -58,18 +53,13 @@ import {
} from "./lib/messages.ts";
import { postBackend, traiteReponseBackendWCSelonCodesHTTP } from "./lib/reseau.ts";
import { WCStoreCartRemoveItemArgsSchema } from "./lib/schemas/api/cart-remove-item.ts";
import { WCStoreCartUpdateCustomerArgsSchema } from "./lib/schemas/api/cart-update-customer.ts";
import { WCStoreCartUpdateItemArgsSchema } from "./lib/schemas/api/cart-update-item.ts";
import { WCStoreCartSchema } from "./lib/schemas/api/cart.ts";
import { WCStoreShippingRateShippingRateSchema } from "./lib/schemas/api/couts-livraison.ts";
import { WCV3OrdersArgsSchema, WCV3OrderSchema } from "./lib/schemas/api/v3/orders.ts";
import {
propEither,
recupereElementDansDocumentOuLeve,
recupereElementDocumentEither,
recupereElementsDocumentEither,
} from "./lib/utils.ts";
import { propEither, recupereElementDansDocumentOuLeve, recupereElementsDocumentEither } from "./lib/utils.ts";
import { eitherParse } from "./lib/validation.ts";
import { initialiseBoutonActions } from "./scripts-page-panier-adresses.ts";
import { initialiseElementsCodePromo } from "./scripts-page-panier-code-promo.ts";
type ElementsEntreePanier = {
@ -94,47 +84,18 @@ const ETATS_PAGE: EtatsPage = _etats;
const ENTREES_PANIER_EITHER: Either<SyntaxError, Array<HTMLElement>> = recupereElementsDocumentEither<HTMLElement>(
SELECTEUR_ENTREES_PANIER,
);
const CONTENEUR_PANIER: HTMLElement = pipe(
recupereElementDocumentEither<HTMLElement>(SELECTEUR_CONTENEUR_PANIER),
recupereElementOuLeve,
const CONTENEUR_PANIER: HTMLElement = recupereElementDansDocumentOuLeve(SELECTEUR_CONTENEUR_PANIER);
const SOUS_TOTAL_PRODUITS: HTMLElement = recupereElementDansDocumentOuLeve(SELECTEUR_SOUS_TOTAL_PRODUITS);
const SOUS_TOTAL_REDUCTION: HTMLSpanElement = recupereElementDansDocumentOuLeve(SELECTEUR_TOTAL_REDUCTION_VALEUR);
const INSTRUCTIONS_CLIENT: HTMLTextAreaElement = recupereElementDansDocumentOuLeve(SELECTEUR_INSTRUCTIONS_CLIENT);
const TOTAL_PANIER: HTMLParagraphElement = recupereElementDansDocumentOuLeve(SELECTEUR_TOTAL_PANIER);
const BOUTON_SEPARATION_ADRESSES: HTMLInputElement = recupereElementDansDocumentOuLeve(
SELECTEUR_BOUTON_SEPARATION_ADRESSES,
);
const SOUS_TOTAL_PRODUITS: HTMLElement = pipe(
recupereElementDocumentEither<HTMLParagraphElement>(SELECTEUR_SOUS_TOTAL_PRODUITS),
recupereElementOuLeve,
);
const SOUS_TOTAL_LIVRAISON_COUT: HTMLElement = pipe(
recupereElementDocumentEither<HTMLElement>(SELECTEUR_SOUS_TOTAL_LIVRAISON_COUT),
recupereElementOuLeve,
);
const SOUS_TOTAL_LIVRAISON_PRESTATAIRE: HTMLSpanElement = pipe(
recupereElementDocumentEither<HTMLSpanElement>(SELECTEUR_SOUS_TOTAL_LIVRAISON_PRESTATAIRE),
recupereElementOuLeve,
);
const SOUS_TOTAL_REDUCTION: HTMLSpanElement = recupereElementDansDocumentOuLeve<HTMLSpanElement>(
SELECTEUR_TOTAL_REDUCTION_VALEUR,
);
const INSTRUCTIONS_CLIENT: HTMLTextAreaElement = recupereElementDansDocumentOuLeve(
SELECTEUR_INSTRUCTIONS_CLIENT,
);
const TOTAL_PANIER: HTMLParagraphElement = pipe(
recupereElementDocumentEither<HTMLParagraphElement>(SELECTEUR_TOTAL_PANIER),
recupereElementOuLeve,
);
const BOUTON_SEPARATION_ADRESSES: HTMLInputElement = pipe(
recupereElementDocumentEither<HTMLInputElement>(SELECTEUR_BOUTON_SEPARATION_ADRESSES),
recupereElementOuLeve,
);
const FORMULAIRE_PANIER: HTMLFormElement = pipe(
recupereElementDocumentEither<HTMLFormElement>(SELECTEUR_FORMULAIRE_PANIER),
recupereElementOuLeve,
);
const FORMULAIRE_FACTURATION: HTMLDivElement = pipe(
recupereElementDocumentEither<HTMLDivElement>(SELECTEUR_FORMULAIRE_FACTURATION),
recupereElementOuLeve,
);
let BOUTON_ACTIONS_FORMULAIRE: HTMLButtonElement = pipe(
recupereElementDocumentEither<HTMLButtonElement>(SELECTEUR_BOUTON_ACTIONS_FORMULAIRE),
recupereElementOuLeve,
const FORMULAIRE_PANIER: HTMLFormElement = recupereElementDansDocumentOuLeve(SELECTEUR_FORMULAIRE_PANIER);
const FORMULAIRE_FACTURATION: HTMLDivElement = recupereElementDansDocumentOuLeve(SELECTEUR_FORMULAIRE_FACTURATION);
let BOUTON_ACTIONS_FORMULAIRE: HTMLButtonElement = recupereElementDansDocumentOuLeve(
SELECTEUR_BOUTON_ACTIONS_FORMULAIRE,
);
/**
@ -463,111 +424,6 @@ const initialiseMajFormulairesPanier = (): void => {
});
};
const initialiseBoutonActions = (): void => {
// Déclenche une requête
BOUTON_ACTIONS_FORMULAIRE.addEventListener("click", evenement => {
Maybe
// Ne fais rien si le Formulaire n'est pas valide
.fromFalsy(FORMULAIRE_PANIER.checkValidity())
.ifJust(() => {
evenement.preventDefault();
FORMULAIRE_PANIER.removeAttribute(ATTRIBUT_HIDDEN);
BOUTON_ACTIONS_FORMULAIRE.textContent = "Check-out";
})
.ifJust(() => {
// Récupère les données du Formulaire
// @ts-expect-error -- Problème de typage de la librairie DOM
const donneesFormulaire: Record<string, string> = pipe(
new FormData(FORMULAIRE_PANIER),
formData => formData.entries(),
entrees => Array.from(entrees),
tuple => D.fromPairs(tuple),
);
// Transforme les données brutes en arguments de requête auprès du backend
const argumentsFormulaire: WCStoreCartUpdateCustomerArgs = {
billing_address: {
address_1: donneesFormulaire["facturation-adresse"] ?? donneesFormulaire["livraison-adresse"] ?? "",
address_2: "",
city: donneesFormulaire["facturation-ville"] ?? donneesFormulaire["livraison-ville"] ?? "",
company: "",
country: "FR",
email: donneesFormulaire["facturation-email"] ?? donneesFormulaire["livraison-email"] ?? "",
first_name: donneesFormulaire["facturation-prenom"] ?? donneesFormulaire["livraison-prenom"] ?? "",
last_name: donneesFormulaire["facturation-nom"] ?? donneesFormulaire["livraison-nom"] ?? "",
phone: donneesFormulaire["facturation-telephone"] ?? donneesFormulaire["livraison-telephone"] ?? "",
postcode: donneesFormulaire["facturation-code-postal"] ?? donneesFormulaire["livraison-code-postal"] ?? "",
state: donneesFormulaire["facturation-region-etat"] ?? donneesFormulaire["livraison-region-etat"] ?? "",
},
shipping_address: {
address_1: donneesFormulaire["livraison-adresse"] ?? "",
address_2: "",
city: donneesFormulaire["livraison-ville"] ?? "",
company: "",
country: "FR",
first_name: donneesFormulaire["livraison-prenom"] ?? "",
last_name: donneesFormulaire["livraison-nom"] ?? "",
phone: donneesFormulaire["livraison-telephone"] ?? "",
postcode: donneesFormulaire["livraison-code-postal"] ?? "",
state: donneesFormulaire["livraison-region-etat"] ?? "",
},
};
// Réalise la requête et traite sa réponse
Either
// Valide les arguments de la requête
.encase<ValiError<typeof WCStoreCartUpdateCustomerArgsSchema>, WCStoreCartUpdateCustomerArgs>(() =>
parse(WCStoreCartUpdateCustomerArgsSchema, argumentsFormulaire)
)
.map(async (args: WCStoreCartUpdateCustomerArgs) => {
await postBackend({
corps: JSON.stringify(args),
nonce: ETATS_PAGE.nonce,
route: ROUTE_API_MAJ_CLIENT,
}).then(async (reponse: Response) => {
// Traite le cas d'erreur 500
if (estReponse500(reponse)) leveServerError("500 Server Error");
pipe(
// Récupère la Réponse
await reponse.json(),
// Traite tous les codes HTTPs possibles
(corpsReponse: unknown) =>
traiteReponseBackendWCSelonCodesHTTP<WCStoreCart, typeof WCStoreCartSchema>(
corpsReponse,
WCStoreCartSchema,
),
F.tap((donnees: WCStoreCart) => {
// Récupère et adapte les informations de Livraison
const sousTotalLivraison = donnees.totals.total_shipping === "0"
? "Free"
: `${String(donnees.totals.total_shipping)} €`;
const sousTotalPrestataire = match(donnees.shipping_rates[0]?.shipping_rates[0]?.name)
.with("Mondial Relay - Livraison Point Relais (Gratuit)", () => "Mondial Relay - Pickup Point")
.with("Free shipping", () => "Free Shipping")
.otherwise(() => "");
// Met à jour les informations de Livraison affichés à l'Utilisateur
SOUS_TOTAL_LIVRAISON_COUT.textContent = sousTotalLivraison;
SOUS_TOTAL_LIVRAISON_PRESTATAIRE.textContent = sousTotalPrestataire;
// Sauvegarde la Méthode de Livraison dans le Stockage de Session
sessionStorage.setItem(
"shipping_rates",
JSON.stringify(donnees.shipping_rates[0]?.shipping_rates[0] ?? ""),
);
}),
);
// Active le Bouton pour la création de la Commande
initialiseBoutonCreationCommande();
});
})
.ifLeft(a => console.error(a.issues));
});
});
};
const initialiseBoutonCreationCommande = (): void => {
// Permet de supprimer tout Écouteur d'Évènement assigné au Bouton
BOUTON_ACTIONS_FORMULAIRE.outerHTML = BOUTON_ACTIONS_FORMULAIRE.outerHTML;

View file

@ -9,11 +9,11 @@
<div class="contenu__textuel">
<p>
Thank you for your order, {{ session.name }}!
Thank you for your order!
</p>
<p>
You will receive an email with your order's details in a short while.
You will receive an email with your the details in a short while.
</p>
<p>
@ -45,11 +45,11 @@
<p class="detail-produit__description">
{# Affiche tous les attributs relevants pour la variation choisie #}
{% for attribut in produit.attributs %}
{% if attribut.valeur %}
{% if produit.attribut|length > 0 %}
{% for attribut in produit.attribut %}
{{ attribut.nom }}: <strong>{{ attribut.valeur }}</strong><br />
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
qty: <strong>{{ produit.quantite }}</strong>
</p>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Before After
Before After