2024-10-02

This commit is contained in:
gcch 2024-10-02 15:44:13 +02:00
commit 59a236f0fa
45 changed files with 230 additions and 106 deletions

View file

@ -1,2 +1,2 @@
import{r as E}from"./chunk-RU7WR4KH.js";import{x as t}from"./chunk-7BKSRZNG.js";import{p}from"./index.js";import{R as f}from"./api2.js";import{a as l,b as R,c as C}from"./dom.js";import{a as S,b as u}from"./dom2.js";import{r as n,D as T,l as A}from"./erreurs.js";import{e as N,a as _}from"./gardes.js";import{p as I,t as P}from"./reseau.js";import{W as d}from"./cart-remove-item.js";import{W as L}from"./cart.js";import{a as v}from"./utils.js";import{M as h,E as b}from"./Either.js";import"./exports.js";import"./index2.js";import"./erreurs2.js";const m=_etats,g=t(v(l),S),O=()=>{console.debug(m),g.forEach(r=>{const s=h.fromNullable(r.getAttribute(R));u(r)(C).ifLeft(()=>t(new T(`L'entrée « ${s.orDefault("CLE_PANIER_INEXISTANTE")} » n'a pas de Bouton de suppression.`),n)).ifRight(a=>{a.addEventListener("click",()=>{const i=s.ifNothing(()=>{r.remove()}).orDefault("CLE_PANIER_INEXISTANTE");a.textContent="C= C= C= C= C=┌(;・ω・)┘",b.encase(()=>p(d,{key:i})).map(c=>{I({corps:JSON.stringify(c),nonce:m.nonce,route:f}).then(async e=>{N(e)&&A("500 Server Error"),t(await e.json(),E(o=>console.debug(o)),o=>P(o,L),E(()=>r.remove()))}).catch(e=>{_(e)?(n(e),console.error(e)):console.error("e n'est pas une Erreur ?!",e)})})})})})};document.addEventListener("DOMContentLoaded",()=>{O()});
import{r as _,p as R,z as u,N as E}from"./index2.js";import{x as t}from"./chunk-7BKSRZNG.js";import{p as m}from"./index.js";import{R as l}from"./api2.js";import{a as T,b as C,c as f,d as I,A as S}from"./dom.js";import{N,T as P}from"./messages3.js";import{a as d,r as O,b as h}from"./dom2.js";import{r as c,D as L,l as v,a as U,b as g,c as B,E as b,d as M}from"./erreurs.js";import{e as w,a as y}from"./gardes.js";import{v as D}from"./messages.js";import{p as W}from"./reseau.js";import{W as k}from"./cart-remove-item.js";import{W as j}from"./cart.js";import{i}from"./erreurs2.js";import{a as x,r as z}from"./utils.js";import{M as G,E as J}from"./Either.js";import"./exports.js";import"./messages2.js";const X=_etats,q=t(x(T),d),F=t(z(C),O),Y=()=>{q.forEach(r=>{const o=G.fromNullable(r.getAttribute(f));h(r)(I).ifLeft(()=>t(new L(`L'entrée « ${o.orDefault("CLE_PANIER_INEXISTANTE")} » n'a pas de Bouton de suppression.`),c)).ifRight(s=>{s.addEventListener("click",()=>{const p=o.ifNothing(()=>{r.remove()}).orDefault("CLE_PANIER_INEXISTANTE");s.textContent="C= C= C= C= C=┌(;・ω・)┘",J.encase(()=>m(k,{key:p})).map(A=>{W({corps:JSON.stringify(A),nonce:X.nonce,route:l}).then(async e=>{w(e)&&v("500 Server Error"),t(await e.json(),n=>u(n).with({body:E.select(),status:400},i,U).with({body:E.select(),status:401},i,g).with({body:E.select(),status:404},i,B).with(E._,a=>m(j,a)).otherwise(a=>t(a,b,M)),R("items_count"),_(n=>{new BroadcastChannel(N).postMessage({donnees:n,type:P.MiseAJourPanier}),r.remove()}))}).catch(e=>{y(e)?(c(e),console.error(e)):console.error("e n'est pas une Erreur ?!",e)})})})})})},$=()=>{const r=new BroadcastChannel(N);r.onmessage=o=>{D(o).ifRight(s=>{F.setAttribute(S,String(s.donnees!==0))})}};document.addEventListener("DOMContentLoaded",()=>{Y(),$()});
//# sourceMappingURL=scripts-page-panier.js.map