haiku-atelier-2024/web/app/themes/haiku-atelier-2024/assets/js/reseau.CxtoDjd2.js
gcch 22e179fef1 2025-11-03 (bis)
- ajoute un .dockerignore.
- ajoute un Dockerfile.
- met à jour les dépendances.
- utilise bun comme gestionnaire de paquets npm.
- utilise une configuration Vite en TypeScript.
- ajoute les fichiers compilés JavaScript aux fichiers pris en charge par Git.
2025-11-03 17:26:01 +01:00

1 line
5.8 KiB
JavaScript

import{M as d}from"./index.BiLbLflF.js";import{i as f}from"./api.BWtmxolt.js";import{al as l,bb as h,bc as g,a0 as P,bd as u,be as y,Y as M,bf as A,bg as x,bh as S,X as v}from"./dom.DBz3b6Rw.js";var m;const w={liftEither(e){if(e.isRight())return Promise.resolve(e.extract());throw e.extract()},fromPromise(e){return e.then(w.liftEither)},throwE(e){throw e}};class c{constructor(t){this.runPromise=t,this[m]="EitherAsync",this.then=(r,n)=>this.run().then(r,n)}leftOrDefault(t){return this.run().then(r=>r.leftOrDefault(t))}orDefault(t){return this.run().then(r=>r.orDefault(t))}join(){return i(async t=>{const r=await this;if(r.isRight()){const n=await r.extract();return t.liftEither(n)}return t.liftEither(r)})}ap(t){return i(async r=>{const n=await t;if(n.isRight()){const a=await this.run();return a.isRight()?n.extract()(a.extract()):r.liftEither(a)}return r.liftEither(n)})}alt(t){return i(async r=>{const n=await this.run();if(n.isRight())return n.extract();{const a=await t;return r.liftEither(a)}})}extend(t){return i(async r=>{const n=await this.run();if(n.isRight()){const a=i.liftEither(n);return r.liftEither(h(t(a)))}return r.liftEither(n)})}async run(){try{return h(await this.runPromise(w))}catch(t){return g(t)}}bimap(t,r){return i(async n=>{const a=await this.run();try{return await n.liftEither(a.bimap(t,r))}catch(E){throw await E}})}map(t){return i(r=>this.runPromise(r).then(t))}mapLeft(t){return i(async r=>{try{return await this.runPromise(r)}catch(n){throw await t(n)}})}chain(t){return i(async r=>{const n=await this.runPromise(r);return r.fromPromise(t(n))})}chainLeft(t){return i(async r=>{try{return await this.runPromise(r)}catch(n){return r.fromPromise(t(n))}})}toMaybeAsync(){return s(async({liftMaybe:t})=>{const r=await this.run();return t(r.toMaybe())})}swap(){return i(async t=>{const r=await this.run();return r.isRight()&&t.throwE(r.extract()),t.liftEither(h(r.extract()))})}ifLeft(t){return i(async r=>{const n=await this.run();return n.ifLeft(t),r.liftEither(n)})}ifRight(t){return i(async r=>{const n=await this.run();return n.ifRight(t),r.liftEither(n)})}void(){return this.map(t=>{})}caseOf(t){return this.run().then(r=>r.caseOf(t))}finally(t){return i(({fromPromise:r})=>r(this.run().finally(t)))}}m=Symbol.toStringTag;c.prototype["fantasy-land/chain"]=c.prototype.chain;c.prototype["fantasy-land/alt"]=c.prototype.alt;const i=Object.assign(e=>new c(e),{fromPromise:e=>i(({fromPromise:t})=>t(e())),liftEither:e=>i(({liftEither:t})=>t(e)),lefts:e=>Promise.all(e.map(t=>t.run())).then(l.lefts),rights:e=>Promise.all(e.map(t=>t.run())).then(l.rights),sequence:e=>i(async t=>{let r=[];for await(const n of e){if(n.isLeft())return t.liftEither(n);r.push(n.extract())}return t.liftEither(h(r))}),all:e=>i.fromPromise(async()=>Promise.all(e).then(l.sequence))});c.prototype.constructor=i;var p;const b={liftMaybe(e){if(e.isJust())return Promise.resolve(e.extract());throw u},fromPromise(e){return e.then(b.liftMaybe)}};class o{constructor(t){this.runPromise=t,this[p]="MaybeAsync"}orDefault(t){return this.run().then(r=>r.orDefault(t))}join(){return s(async t=>{const r=await this.run();if(r.isJust()){const n=await r.extract();return t.liftMaybe(n)}return t.liftMaybe(u)})}ap(t){return s(async r=>{const n=await t;if(n.isJust()){const a=await this.run();return a.isJust()?n.extract()(a.extract()):r.liftMaybe(u)}return r.liftMaybe(u)})}alt(t){return s(async r=>{const n=await this.run();if(n.isJust())return n.extract();{const a=await t;return r.liftMaybe(a)}})}extend(t){return s(async r=>{const n=await this.run();if(n.isJust()){const a=s.liftMaybe(n);return r.liftMaybe(y(t(a)))}return r.liftMaybe(u)})}filter(t){return s(async r=>{const n=await this.run();return r.liftMaybe(n.filter(t))})}async run(){try{return y(await this.runPromise(b))}catch{return u}}map(t){return s(r=>this.runPromise(r).then(t))}chain(t){return s(async r=>{const n=await this.runPromise(r);return r.fromPromise(t(n))})}toEitherAsync(t){return i(async({liftEither:r})=>{const n=await this.run();return r(n.toEither(t))})}ifJust(t){return s(async r=>{const n=await this.run();return n.ifJust(t),r.liftMaybe(n)})}ifNothing(t){return s(async r=>{const n=await this.run();return n.ifNothing(t),r.liftMaybe(n)})}void(){return this.map(t=>{})}caseOf(t){return this.run().then(r=>r.caseOf(t))}finally(t){return s(({fromPromise:r})=>r(this.run().finally(t)))}then(t,r){return this.run().then(t,r)}}p=Symbol.toStringTag;o.prototype["fantasy-land/chain"]=o.prototype.chain;o.prototype["fantasy-land/filter"]=o.prototype.filter;o.prototype["fantasy-land/alt"]=o.prototype.alt;const s=Object.assign(e=>new o(e),{catMaybes:e=>Promise.all(e).then(P.catMaybes),fromPromise:e=>s(({fromPromise:t})=>t(e())),liftMaybe:e=>s(({liftMaybe:t})=>t(e))});o.prototype.constructor=s;const T=e=>fetch(`${e.route}?${e.searchParams}`,{credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json",[f]:e.nonce,...e.authString&&{Authorization:`Basic ${e.authString}`}},method:"GET",mode:"same-origin",signal:AbortSignal.timeout(5e3)}),B=e=>fetch(e.route,{body:e.corps,credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json",[f]:e.nonce,...e.authString&&{Authorization:`Basic ${e.authString}`}},method:"POST",mode:"same-origin",signal:AbortSignal.timeout(5e3)}),J=(e,t)=>(r,n,a)=>fetch(r,{body:n,credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json",[f]:e,...t&&a&&{Authorization:`Basic ${t}`}},method:"POST",mode:"same-origin",signal:AbortSignal.timeout(5e3)}),V=e=>i(async()=>await e),$=async e=>({body:await e.json(),status:e.status}),C=e=>d(e).with({status:400},()=>new M).with({status:401},()=>new A).with({status:403},()=>new x).with({status:404},()=>new S).with({status:500},()=>new v).otherwise(t=>new Error(String(t.status)));export{i as E,B as a,T as g,$ as n,J as p,V as s,C as t};