haiku-atelier-2024/web/app/themes/haiku-atelier-2024/assets/js/journalisation.js
gcch a741ef973b 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:25:02 +01:00

10 lines
28 KiB
JavaScript

function ht(){import.meta.url,import("_").catch(()=>1),(async function*(){})().next()}function Ie(n){return typeof n=="function"?n:Me(n)}function Me(n){if(n==null)return()=>!1;if(n==="fatal")return e=>e.level==="fatal";if(n==="error")return e=>e.level==="fatal"||e.level==="error";if(n==="warning")return e=>e.level==="fatal"||e.level==="error"||e.level==="warning";if(n==="info")return e=>e.level==="fatal"||e.level==="error"||e.level==="warning"||e.level==="info";if(n==="debug")return e=>e.level==="fatal"||e.level==="error"||e.level==="warning"||e.level==="info"||e.level==="debug";if(n==="trace")return()=>!0;throw new TypeError(`Invalid log level: ${n}.`)}const se=["trace","debug","info","warning","error","fatal"];function ae(n,e){const t=se.indexOf(n);if(t<0)throw new TypeError(`Invalid log level: ${JSON.stringify(n)}.`);const o=se.indexOf(e);if(o<0)throw new TypeError(`Invalid log level: ${JSON.stringify(e)}.`);return t-o}function Ee(n=[]){return F.getLogger(n)}const V=Symbol.for("logtape.rootLogger");var F=class R{parent;children;category;sinks;parentSinks="inherit";filters;lowestLevel="trace";contextLocalStorage;static getLogger(e=[]){let t=V in globalThis?globalThis[V]??null:null;return t==null&&(t=new R(null,[]),globalThis[V]=t),typeof e=="string"?t.getChild(e):e.length===0?t:t.getChild(e)}constructor(e,t){this.parent=e,this.children={},this.category=t,this.sinks=[],this.filters=[]}getChild(e){const t=typeof e=="string"?e:e[0],o=this.children[t];let i=o instanceof R?o:o?.deref();return i==null&&(i=new R(this,[...this.category,t]),this.children[t]="WeakRef"in globalThis?new WeakRef(i):i),typeof e=="string"||e.length===1?i:i.getChild(e.slice(1))}reset(){for(;this.sinks.length>0;)this.sinks.shift();for(this.parentSinks="inherit";this.filters.length>0;)this.filters.shift();this.lowestLevel="trace"}resetDescendants(){for(const e of Object.values(this.children)){const t=e instanceof R?e:e.deref();t?.resetDescendants()}this.reset()}with(e){return new Fe(this,{...e})}filter(e){for(const t of this.filters)if(!t(e))return!1;return this.filters.length<1?this.parent?.filter(e)??!0:!0}*getSinks(e){if(!(this.lowestLevel===null||ae(e,this.lowestLevel)<0)){if(this.parent!=null&&this.parentSinks==="inherit")for(const t of this.parent.getSinks(e))yield t;for(const t of this.sinks)yield t}}emit(e,t){const o="category"in e?e:{...e,category:this.category};if(!(this.lowestLevel===null||ae(o.level,this.lowestLevel)<0||!this.filter(o))){for(const i of this.getSinks(o.level))if(!t?.has(i))try{i(o)}catch(l){const r=new Set(t);r.add(i),De.log("fatal","Failed to emit a log record to sink {sink}: {error}",{sink:i,error:l,record:o},r)}}}log(e,t,o,i){const l=R.getLogger().contextLocalStorage?.getStore()??{};let r;const s=typeof o=="function"?{category:this.category,level:e,timestamp:Date.now(),get message(){return fe(t,this.properties)},rawMessage:t,get properties(){return r==null&&(r={...l,...o()}),r}}:{category:this.category,level:e,timestamp:Date.now(),message:fe(t,{...l,...o}),rawMessage:t,properties:{...l,...o}};this.emit(s,i)}logLazily(e,t,o={}){const i=R.getLogger().contextLocalStorage?.getStore()??{};let l,r;function s(){if((r==null||l==null)&&(r=t((a,...g)=>(l=a,ge(a,g))),l==null))throw new TypeError("No log record was made.");return[r,l]}this.emit({category:this.category,level:e,get message(){return s()[0]},get rawMessage(){return s()[1]},timestamp:Date.now(),properties:{...i,...o}})}logTemplate(e,t,o,i={}){const l=R.getLogger().contextLocalStorage?.getStore()??{};this.emit({category:this.category,level:e,message:ge(t,o),rawMessage:t,timestamp:Date.now(),properties:{...l,...i}})}trace(e,...t){typeof e=="string"?this.log("trace",e,t[0]??{}):typeof e=="function"?this.logLazily("trace",e):Array.isArray(e)?this.logTemplate("trace",e,t):this.log("trace","{*}",e)}debug(e,...t){typeof e=="string"?this.log("debug",e,t[0]??{}):typeof e=="function"?this.logLazily("debug",e):Array.isArray(e)?this.logTemplate("debug",e,t):this.log("debug","{*}",e)}info(e,...t){typeof e=="string"?this.log("info",e,t[0]??{}):typeof e=="function"?this.logLazily("info",e):Array.isArray(e)?this.logTemplate("info",e,t):this.log("info","{*}",e)}warn(e,...t){typeof e=="string"?this.log("warning",e,t[0]??{}):typeof e=="function"?this.logLazily("warning",e):Array.isArray(e)?this.logTemplate("warning",e,t):this.log("warning","{*}",e)}warning(e,...t){this.warn(e,...t)}error(e,...t){typeof e=="string"?this.log("error",e,t[0]??{}):typeof e=="function"?this.logLazily("error",e):Array.isArray(e)?this.logTemplate("error",e,t):this.log("error","{*}",e)}fatal(e,...t){typeof e=="string"?this.log("fatal",e,t[0]??{}):typeof e=="function"?this.logLazily("fatal",e):Array.isArray(e)?this.logTemplate("fatal",e,t):this.log("fatal","{*}",e)}},Fe=class Le{logger;properties;constructor(e,t){this.logger=e,this.properties=t}get category(){return this.logger.category}get parent(){return this.logger.parent}getChild(e){return this.logger.getChild(e).with(this.properties)}with(e){return new Le(this.logger,{...this.properties,...e})}log(e,t,o,i){this.logger.log(e,t,typeof o=="function"?()=>({...this.properties,...o()}):{...this.properties,...o},i)}logLazily(e,t){this.logger.logLazily(e,t,this.properties)}logTemplate(e,t,o){this.logger.logTemplate(e,t,o,this.properties)}emit(e){const t={...e,properties:{...this.properties,...e.properties}};this.logger.emit(t)}trace(e,...t){typeof e=="string"?this.log("trace",e,t[0]??{}):typeof e=="function"?this.logLazily("trace",e):Array.isArray(e)?this.logTemplate("trace",e,t):this.log("trace","{*}",e)}debug(e,...t){typeof e=="string"?this.log("debug",e,t[0]??{}):typeof e=="function"?this.logLazily("debug",e):Array.isArray(e)?this.logTemplate("debug",e,t):this.log("debug","{*}",e)}info(e,...t){typeof e=="string"?this.log("info",e,t[0]??{}):typeof e=="function"?this.logLazily("info",e):Array.isArray(e)?this.logTemplate("info",e,t):this.log("info","{*}",e)}warn(e,...t){typeof e=="string"?this.log("warning",e,t[0]??{}):typeof e=="function"?this.logLazily("warning",e):Array.isArray(e)?this.logTemplate("warning",e,t):this.log("warning","{*}",e)}warning(e,...t){this.warn(e,...t)}error(e,...t){typeof e=="string"?this.log("error",e,t[0]??{}):typeof e=="function"?this.logLazily("error",e):Array.isArray(e)?this.logTemplate("error",e,t):this.log("error","{*}",e)}fatal(e,...t){typeof e=="string"?this.log("fatal",e,t[0]??{}):typeof e=="function"?this.logLazily("fatal",e):Array.isArray(e)?this.logTemplate("fatal",e,t):this.log("fatal","{*}",e)}};const De=F.getLogger(["logtape","meta"]);function fe(n,e){const t=n.length;if(t===0)return[""];if(!n.includes("{"))return[n];const o=[];let i=0;for(let r=0;r<t;r++){const s=n[r];if(s==="{"){if((r+1<t?n[r+1]:"")==="{"){r++;continue}const g=n.indexOf("}",r+1);if(g===-1)continue;const c=n.slice(i,r);o.push(c.replace(/{{/g,"{").replace(/}}/g,"}"));const h=n.slice(r+1,g);let b;const y=h.trim();y==="*"?b=h in e?e[h]:"*"in e?e["*"]:e:h!==y?b=h in e?e[h]:e[y]:b=e[h],o.push(b),r=g,i=r+1}else s==="}"&&r+1<t&&n[r+1]==="}"&&r++}const l=n.slice(i);return o.push(l.replace(/{{/g,"{").replace(/}}/g,"}")),o}function ge(n,e){const t=[];for(let o=0;o<n.length;o++)t.push(n[o]),o<e.length&&t.push(e[o]);return t}function te(n,e){const t=e?.compact===!0?void 0:2;return JSON.stringify(n,null,t)}const ce=Object.freeze(Object.defineProperty({__proto__:null,inspect:te},Symbol.toStringTag,{value:"Module"})),Ce={trace:"TRC",debug:"DBG",info:"INF",warning:"WRN",error:"ERR",fatal:"FTL"},$e=typeof document<"u"||typeof navigator<"u"&&navigator.product==="ReactNative"?n=>JSON.stringify(n):"Deno"in globalThis&&"inspect"in globalThis.Deno&&typeof globalThis.Deno.inspect=="function"?(n,e)=>globalThis.Deno.inspect(n,{strAbbreviateSize:1/0,iterableLimit:1/0,...e}):ce!=null&&"inspect"in ce&&typeof te=="function"?(n,e)=>te(n,{...e}):n=>JSON.stringify(n);function d(n){return n<10?`0${n}`:`${n}`}function I(n){return n<10?`00${n}`:n<100?`0${n}`:`${n}`}const J={"date-time-timezone":n=>{const e=new Date(n),t=e.getUTCFullYear(),o=d(e.getUTCMonth()+1),i=d(e.getUTCDate()),l=d(e.getUTCHours()),r=d(e.getUTCMinutes()),s=d(e.getUTCSeconds()),a=I(e.getUTCMilliseconds());return`${t}-${o}-${i} ${l}:${r}:${s}.${a} +00:00`},"date-time-tz":n=>{const e=new Date(n),t=e.getUTCFullYear(),o=d(e.getUTCMonth()+1),i=d(e.getUTCDate()),l=d(e.getUTCHours()),r=d(e.getUTCMinutes()),s=d(e.getUTCSeconds()),a=I(e.getUTCMilliseconds());return`${t}-${o}-${i} ${l}:${r}:${s}.${a} +00`},"date-time":n=>{const e=new Date(n),t=e.getUTCFullYear(),o=d(e.getUTCMonth()+1),i=d(e.getUTCDate()),l=d(e.getUTCHours()),r=d(e.getUTCMinutes()),s=d(e.getUTCSeconds()),a=I(e.getUTCMilliseconds());return`${t}-${o}-${i} ${l}:${r}:${s}.${a}`},"time-timezone":n=>{const e=new Date(n),t=d(e.getUTCHours()),o=d(e.getUTCMinutes()),i=d(e.getUTCSeconds()),l=I(e.getUTCMilliseconds());return`${t}:${o}:${i}.${l} +00:00`},"time-tz":n=>{const e=new Date(n),t=d(e.getUTCHours()),o=d(e.getUTCMinutes()),i=d(e.getUTCSeconds()),l=I(e.getUTCMilliseconds());return`${t}:${o}:${i}.${l} +00`},time:n=>{const e=new Date(n),t=d(e.getUTCHours()),o=d(e.getUTCMinutes()),i=d(e.getUTCSeconds()),l=I(e.getUTCMilliseconds());return`${t}:${o}:${i}.${l}`},date:n=>{const e=new Date(n),t=e.getUTCFullYear(),o=d(e.getUTCMonth()+1),i=d(e.getUTCDate());return`${t}-${o}-${i}`},rfc3339:n=>new Date(n).toISOString(),none:()=>null},M={ABBR:Ce,abbr:{trace:"trc",debug:"dbg",info:"inf",warning:"wrn",error:"err",fatal:"ftl"},FULL:{trace:"TRACE",debug:"DEBUG",info:"INFO",warning:"WARNING",error:"ERROR",fatal:"FATAL"},full:{trace:"trace",debug:"debug",info:"info",warning:"warning",error:"error",fatal:"fatal"},L:{trace:"T",debug:"D",info:"I",warning:"W",error:"E",fatal:"F"},l:{trace:"t",debug:"d",info:"i",warning:"w",error:"e",fatal:"f"}};function xe(n={}){const e=(()=>{const r=n.timestamp;return r==null?J["date-time-timezone"]:r==="disabled"?J.none:typeof r=="string"&&r in J?J[r]:r})(),t=n.category??"·",o=n.value??$e,i=(()=>{const r=n.level;return r==null||r==="ABBR"?s=>M.ABBR[s]:r==="abbr"?s=>M.abbr[s]:r==="FULL"?s=>M.FULL[s]:r==="full"?s=>M.full[s]:r==="L"?s=>M.L[s]:r==="l"?s=>M.l[s]:r})(),l=n.format??(({timestamp:r,level:s,category:a,message:g})=>`${r?`${r} `:""}[${s}] ${a}: ${g}`);return r=>{const s=r.message,a=s.length;let g;if(a===1)g=s[0];else if(a<=6){g="";for(let S=0;S<a;S++)g+=S%2===0?s[S]:o(s[S])}else{const S=new Array(a);for(let u=0;u<a;u++)S[u]=u%2===0?s[u]:o(s[u]);g=S.join("")}const c=e(r.timestamp),h=i(r.level),b=typeof t=="function"?t(r.category):r.category.join(t);return`${l({timestamp:c,level:h,category:b,message:g,record:r})}
`}}xe();const Z="\x1B[0m",Q={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"},X={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",strikethrough:"\x1B[9m"},Ne={trace:null,debug:"blue",info:"green",warning:"yellow",error:"red",fatal:"magenta"};function Pe(n={}){const e=n.format,t=typeof n.timestampStyle>"u"?"dim":n.timestampStyle,o=n.timestampColor??null,i=`${t==null?"":X[t]}${o==null?"":Q[o]}`,l=t==null&&o==null?"":Z,r=typeof n.levelStyle>"u"?"bold":n.levelStyle,s=n.levelColors??Ne,a=typeof n.categoryStyle>"u"?"dim":n.categoryStyle,g=n.categoryColor??null,c=`${a==null?"":X[a]}${g==null?"":Q[g]}`,h=a==null&&g==null?"":Z;return xe({timestamp:"date-time-tz",value(b){return $e(b,{colors:!0})},...n,format({timestamp:b,level:y,category:S,message:u,record:v}){const f=s[v.level];return b=`${i}${b}${l}`,y=`${r==null?"":X[r]}${f==null?"":Q[f]}${y}${r==null&&f==null?"":Z}`,e==null?`${b} ${y} ${c}${S}:${h} ${u}`:e({timestamp:b,level:y,category:`${c}${S}${h}`,message:u,record:v})}})}Pe();function je(n={}){if(!n.categorySeparator&&!n.message&&!n.properties)return r=>{if(r.message.length===3)return JSON.stringify({"@timestamp":new Date(r.timestamp).toISOString(),level:r.level==="warning"?"WARN":r.level.toUpperCase(),message:r.message[0]+JSON.stringify(r.message[1])+r.message[2],logger:r.category.join("."),properties:r.properties})+`
`;if(r.message.length===1)return JSON.stringify({"@timestamp":new Date(r.timestamp).toISOString(),level:r.level==="warning"?"WARN":r.level.toUpperCase(),message:r.message[0],logger:r.category.join("."),properties:r.properties})+`
`;let s=r.message[0];for(let a=1;a<r.message.length;a++)s+=a&1?JSON.stringify(r.message[a]):r.message[a];return JSON.stringify({"@timestamp":new Date(r.timestamp).toISOString(),level:r.level==="warning"?"WARN":r.level.toUpperCase(),message:s,logger:r.category.join("."),properties:r.properties})+`
`};const e=n.message==="template",t=n.properties??"nest:properties";let o;if(typeof n.categorySeparator=="function")o=n.categorySeparator;else{const r=n.categorySeparator??".";o=s=>s.join(r)}let i;if(t==="flatten")i=r=>r;else if(t.startsWith("prepend:")){const r=t.substring(8);if(r==="")throw new TypeError(`Invalid properties option: ${JSON.stringify(t)}. It must be of the form "prepend:<prefix>" where <prefix> is a non-empty string.`);i=s=>{const a={};for(const g in s)a[`${r}${g}`]=s[g];return a}}else if(t.startsWith("nest:")){const r=t.substring(5);i=s=>({[r]:s})}else throw new TypeError(`Invalid properties option: ${JSON.stringify(t)}. It must be "flatten", "prepend:<prefix>", or "nest:<key>".`);let l;return e?l=r=>{if(typeof r.rawMessage=="string")return r.rawMessage;let s="";for(let a=0;a<r.rawMessage.length;a++)s+=a%2<1?r.rawMessage[a]:"{}";return s}:l=r=>{const s=r.message.length;if(s===1)return r.message[0];let a="";for(let g=0;g<s;g++)a+=g%2<1?r.message[g]:JSON.stringify(r.message[g]);return a},r=>JSON.stringify({"@timestamp":new Date(r.timestamp).toISOString(),level:r.level==="warning"?"WARN":r.level.toUpperCase(),message:l(r),logger:o(r.category),...i(r.properties)})+`
`}je();const ze={trace:"background-color: gray; color: white;",debug:"background-color: gray; color: white;",info:"background-color: white; color: black;",warning:"background-color: orange; color: black;",error:"background-color: red; color: white;",fatal:"background-color: maroon; color: white;"};function We(n){let e="";const t=[];for(let l=0;l<n.message.length;l++)l%2===0?e+=n.message[l]:(e+="%o",t.push(n.message[l]));const o=new Date(n.timestamp);return[`%c${`${o.getUTCHours().toString().padStart(2,"0")}:${o.getUTCMinutes().toString().padStart(2,"0")}:${o.getUTCSeconds().toString().padStart(2,"0")}.${o.getUTCMilliseconds().toString().padStart(3,"0")}`} %c${Ce[n.level]}%c %c${n.category.join("·")} %c${e}`,"color: gray;",ze[n.level],"background-color: default;","color: gray;","color: default;",...t]}function Ae(n={}){const e=n.formatter??We,t={trace:"debug",debug:"debug",info:"info",warning:"warn",error:"error",fatal:"error",...n.levelMap??{}},o=n.console??globalThis.console,i=f=>{const L=e(f),O=t[f.level];if(O===void 0)throw new TypeError(`Invalid log level: ${f.level}.`);if(typeof L=="string"){const T=L.replace(/\r?\n$/,"");o[O](T)}else o[O](...L)};if(!n.nonBlocking)return i;const l=n.nonBlocking===!0?{}:n.nonBlocking,r=l.bufferSize??100,s=l.flushInterval??100,a=[];let g=null,c=!1,h=!1;const b=r*2;function y(){if(a.length===0)return;const f=a.splice(0);for(const L of f)try{i(L)}catch{}}function S(){h||(h=!0,setTimeout(()=>{h=!1,y()},0))}function u(){g!==null||c||(g=setInterval(()=>{y()},s))}const v=f=>{c||(a.length>=b&&a.shift(),a.push(f),a.length>=r?S():g===null&&u())};return v[Symbol.dispose]=()=>{c=!0,g!==null&&(clearInterval(g),g=null),y()},v}let ie=null;const Oe=new Set,H=new Set,Je=new Set;function Ge(n){return n.category.length===0||n.category.length===1&&n.category[0]==="logtape"||n.category.length===2&&n.category[0]==="logtape"&&n.category[1]==="meta"}function Ye(n){if(ie!=null&&!n.reset)throw new U("Already configured; if you want to reset, turn on the reset flag.");if(Je.size>0)throw new U("Previously configured async disposables are still active. Use configure() instead or explicitly dispose them using dispose().");ue();try{He(n,!1)}catch(e){throw e instanceof U&&ue(),e}}function He(n,e){ie=n;let t=!1;const o=new Set;for(const l of n.loggers){Ge(l)&&(t=!0);const r=Array.isArray(l.category)?JSON.stringify(l.category):JSON.stringify([l.category]);if(o.has(r))throw new U(`Duplicate logger configuration for category: ${r}. Each category can only be configured once.`);o.add(r);const s=F.getLogger(l.category);for(const a of l.sinks??[]){const g=n.sinks[a];if(!g)throw new U(`Sink not found: ${a}.`);s.sinks.push(g)}s.parentSinks=l.parentSinks??"inherit",l.lowestLevel!==void 0&&(s.lowestLevel=l.lowestLevel);for(const a of l.filters??[]){const g=n.filters?.[a];if(g===void 0)throw new U(`Filter not found: ${a}.`);s.filters.push(Ie(g))}Oe.add(s)}F.getLogger().contextLocalStorage=n.contextLocalStorage;for(const l of Object.values(n.sinks)){if(Symbol.asyncDispose in l)throw new U("Async disposables cannot be used with configureSync().");Symbol.dispose in l&&H.add(l)}for(const l of Object.values(n.filters??{}))if(!(l==null||typeof l=="string")){if(Symbol.asyncDispose in l)throw new U("Async disposables cannot be used with configureSync().");Symbol.dispose in l&&H.add(l)}if(typeof globalThis.EdgeRuntime!="string"&&"process"in globalThis&&!("Deno"in globalThis)){const l=globalThis.process,r=l?.on;typeof r=="function"&&r.call(l,"exit",ne)}else addEventListener("unload",ne);const i=F.getLogger(["logtape","meta"]);t||i.sinks.push(Ae()),i.info("LogTape loggers are configured. Note that LogTape itself uses the meta logger, which has category {metaLoggerCategory}. The meta logger purposes to log internal errors such as sink exceptions. If you are seeing this message, the meta logger is automatically configured. It's recommended to configure the meta logger with a separate sink so that you can easily notice if logging itself fails or is misconfigured. To turn off this message, configure the meta logger with higher log levels than {dismissLevel}. See also <https://logtape.org/manual/categories#meta-logger>.",{metaLoggerCategory:["logtape","meta"],dismissLevel:"info"})}function ue(){ne(),_e()}function _e(){const n=F.getLogger([]);n.resetDescendants(),delete n.contextLocalStorage,Oe.clear(),ie=null}function ne(){for(const n of H)n[Symbol.dispose]();H.clear()}var U=class extends Error{constructor(n){super(n),this.name="ConfigureError"}};const ee=10,he=(n=0)=>e=>`\x1B[${e+n}m`,pe=(n=0)=>e=>`\x1B[${38+n};5;${e}m`,ye=(n=0)=>(e,t,o)=>`\x1B[${38+n};2;${e};${t};${o}m`,m={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(m.modifier);const Ke=Object.keys(m.color),qe=Object.keys(m.bgColor);[...Ke,...qe];function Ve(){const n=new Map;for(const[e,t]of Object.entries(m)){for(const[o,i]of Object.entries(t))m[o]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[o]=m[o],n.set(i[0],i[1]);Object.defineProperty(m,e,{value:t,enumerable:!1})}return Object.defineProperty(m,"codes",{value:n,enumerable:!1}),m.color.close="\x1B[39m",m.bgColor.close="\x1B[49m",m.color.ansi=he(),m.color.ansi256=pe(),m.color.ansi16m=ye(),m.bgColor.ansi=he(ee),m.bgColor.ansi256=pe(ee),m.bgColor.ansi16m=ye(ee),Object.defineProperties(m,{rgbToAnsi256:{value(e,t,o){return e===t&&t===o?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(o/255*5)},enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[o]=t;o.length===3&&(o=[...o].map(l=>l+l).join(""));const i=Number.parseInt(o,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>m.rgbToAnsi256(...m.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,o,i;if(e>=232)t=((e-232)*10+8)/255,o=t,i=t;else{e-=16;const s=e%36;t=Math.floor(e/36)/5,o=Math.floor(s/6)/5,i=s%6/5}const l=Math.max(t,o,i)*2;if(l===0)return 30;let r=30+(Math.round(i)<<2|Math.round(o)<<1|Math.round(t));return l===2&&(r+=60),r},enumerable:!1},rgbToAnsi:{value:(e,t,o)=>m.ansi256ToAnsi(m.rgbToAnsi256(e,t,o)),enumerable:!1},hexToAnsi:{value:e=>m.ansi256ToAnsi(m.hexToAnsi256(e)),enumerable:!1}}),m}const A=Ve(),de=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){const n=navigator.userAgentData.brands.find(({brand:e})=>e==="Chromium");if(n&&n.version>93)return 3}return/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),ve=de!==0&&{level:de},Ze={stdout:ve,stderr:ve};function Qe(n,e,t){let o=n.indexOf(e);if(o===-1)return n;const i=e.length;let l=0,r="";do r+=n.slice(l,o)+e+t,l=o+i,o=n.indexOf(e,l);while(o!==-1);return r+=n.slice(l),r}function Xe(n,e,t,o){let i=0,l="";do{const r=n[o-1]==="\r";l+=n.slice(i,r?o-1:o)+e+(r?`\r
`:`
`)+t,i=o+1,o=n.indexOf(`
`,i)}while(o!==-1);return l+=n.slice(i),l}const{stdout:me,stderr:be}=Ze,re=Symbol("GENERATOR"),D=Symbol("STYLER"),j=Symbol("IS_EMPTY"),we=["ansi","ansi","ansi256","ansi16m"],N=Object.create(null),et=(n,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const t=me?me.level:0;n.level=e.level===void 0?t:e.level},tt=n=>{const e=(...t)=>t.join(" ");return et(e,n),Object.setPrototypeOf(e,z.prototype),e};function z(n){return tt(n)}Object.setPrototypeOf(z.prototype,Function.prototype);for(const[n,e]of Object.entries(A))N[n]={get(){const t=_(this,le(e.open,e.close,this[D]),this[j]);return Object.defineProperty(this,n,{value:t}),t}};N.visible={get(){const n=_(this,this[D],!0);return Object.defineProperty(this,"visible",{value:n}),n}};const oe=(n,e,t,...o)=>n==="rgb"?e==="ansi16m"?A[t].ansi16m(...o):e==="ansi256"?A[t].ansi256(A.rgbToAnsi256(...o)):A[t].ansi(A.rgbToAnsi(...o)):n==="hex"?oe("rgb",e,t,...A.hexToRgb(...o)):A[t][n](...o),nt=["rgb","hex","ansi256"];for(const n of nt){N[n]={get(){const{level:t}=this;return function(...o){const i=le(oe(n,we[t],"color",...o),A.color.close,this[D]);return _(this,i,this[j])}}};const e="bg"+n[0].toUpperCase()+n.slice(1);N[e]={get(){const{level:t}=this;return function(...o){const i=le(oe(n,we[t],"bgColor",...o),A.bgColor.close,this[D]);return _(this,i,this[j])}}}}const rt=Object.defineProperties(()=>{},{...N,level:{enumerable:!0,get(){return this[re].level},set(n){this[re].level=n}}}),le=(n,e,t)=>{let o,i;return t===void 0?(o=n,i=e):(o=t.openAll+n,i=e+t.closeAll),{open:n,close:e,openAll:o,closeAll:i,parent:t}},_=(n,e,t)=>{const o=(...i)=>ot(o,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(o,rt),o[re]=n,o[D]=e,o[j]=t,o},ot=(n,e)=>{if(n.level<=0||!e)return n[j]?"":e;let t=n[D];if(t===void 0)return e;const{openAll:o,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=Qe(e,t.close,t.open),t=t.parent;const l=e.indexOf(`
`);return l!==-1&&(e=Xe(e,i,o,l)),o+e+i};Object.defineProperties(z.prototype,N);const E=z();z({level:be?be.level:0});function ke(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var G={exports:{}},lt=G.exports,Te;function it(){return Te||(Te=1,(function(n){(function(e,t){n.exports?n.exports=t():e.log=t()})(lt,function(){var e=function(){},t="undefined",o=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],l={},r=null;function s(u,v){var f=u[v];if(typeof f.bind=="function")return f.bind(u);try{return Function.prototype.bind.call(f,u)}catch{return function(){return Function.prototype.apply.apply(f,[u,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function g(u){return u==="debug"&&(u="log"),typeof console===t?!1:u==="trace"&&o?a:console[u]!==void 0?s(console,u):console.log!==void 0?s(console,"log"):e}function c(){for(var u=this.getLevel(),v=0;v<i.length;v++){var f=i[v];this[f]=v<u?e:this.methodFactory(f,u,this.name)}if(this.log=this.debug,typeof console===t&&u<this.levels.SILENT)return"No console available for logging"}function h(u){return function(){typeof console!==t&&(c.call(this),this[u].apply(this,arguments))}}function b(u,v,f){return g(u)||h.apply(this,arguments)}function y(u,v){var f=this,L,O,T,C="loglevel";typeof u=="string"?C+=":"+u:typeof u=="symbol"&&(C=void 0);function q(p){var w=(i[p]||"silent").toUpperCase();if(!(typeof window===t||!C)){try{window.localStorage[C]=w;return}catch{}try{window.document.cookie=encodeURIComponent(C)+"="+w+";"}catch{}}}function W(){var p;if(!(typeof window===t||!C)){try{p=window.localStorage[C]}catch{}if(typeof p===t)try{var w=window.document.cookie,B=encodeURIComponent(C),P=w.indexOf(B+"=");P!==-1&&(p=/^([^;]+)/.exec(w.slice(P+B.length+1))[1])}catch{}return f.levels[p]===void 0&&(p=void 0),p}}function $(){if(!(typeof window===t||!C)){try{window.localStorage.removeItem(C)}catch{}try{window.document.cookie=encodeURIComponent(C)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function k(p){var w=p;if(typeof w=="string"&&f.levels[w.toUpperCase()]!==void 0&&(w=f.levels[w.toUpperCase()]),typeof w=="number"&&w>=0&&w<=f.levels.SILENT)return w;throw new TypeError("log.setLevel() called with invalid level: "+p)}f.name=u,f.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},f.methodFactory=v||b,f.getLevel=function(){return T??O??L},f.setLevel=function(p,w){return T=k(p),w!==!1&&q(T),c.call(f)},f.setDefaultLevel=function(p){O=k(p),W()||f.setLevel(p,!1)},f.resetLevel=function(){T=null,$(),c.call(f)},f.enableAll=function(p){f.setLevel(f.levels.TRACE,p)},f.disableAll=function(p){f.setLevel(f.levels.SILENT,p)},f.rebuild=function(){if(r!==f&&(L=k(r.getLevel())),c.call(f),r===f)for(var p in l)l[p].rebuild()},L=k(r?r.getLevel():"WARN");var x=W();x!=null&&(T=k(x)),c.call(f)}r=new y,r.getLogger=function(v){if(typeof v!="symbol"&&typeof v!="string"||v==="")throw new TypeError("You must supply a name when creating a logger.");var f=l[v];return f||(f=l[v]=new y(v,r.methodFactory)),f};var S=typeof window!==t?window.log:void 0;return r.noConflict=function(){return typeof window!==t&&window.log===r&&(window.log=S),r},r.getLoggers=function(){return l},r.default=r,r})})(G)),G.exports}var st=it();const at=ke(st);var Y={exports:{}},ft=Y.exports,Se;function gt(){return Se||(Se=1,(function(n){(function(e,t){n.exports?n.exports=t():e.prefix=t(e)})(ft,function(e){var t=function(c){for(var h=1,b=arguments.length,y;h<b;h++)for(y in arguments[h])Object.prototype.hasOwnProperty.call(arguments[h],y)&&(c[y]=arguments[h][y]);return c},o={template:"[%t] %l:",levelFormatter:function(c){return c.toUpperCase()},nameFormatter:function(c){return c||"root"},timestampFormatter:function(c){return c.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/,"$1")},format:void 0},i,l={},r=function(c){if(!c||!c.getLogger)throw new TypeError("Argument is not a root logger");i=c},s=function(c,h){if(!c||!c.setLevel)throw new TypeError("Argument is not a logger");var b=c.methodFactory,y=c.name||"",S=l[y]||l[""]||o;function u(v,f,L){var O=b(v,f,L),T=l[L]||l[""],C=T.template.indexOf("%t")!==-1,q=T.template.indexOf("%l")!==-1,W=T.template.indexOf("%n")!==-1;return function(){for(var $="",k=arguments.length,x=Array(k),p=0;p<k;p++)x[p]=arguments[p];if(y||!l[L]){var w=T.timestampFormatter(new Date),B=T.levelFormatter(v),P=T.nameFormatter(L);T.format?$+=T.format(B,P,w):($+=T.template,C&&($=$.replace(/%t/,w)),q&&($=$.replace(/%l/,B)),W&&($=$.replace(/%n/,P))),x.length&&typeof x[0]=="string"?x[0]=$+" "+x[0]:x.unshift($)}O.apply(void 0,x)}}return l[y]||(c.methodFactory=u),h=h||{},h.template&&(h.format=void 0),l[y]=t({},S,h),c.setLevel(c.getLevel()),i||c.warn("It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md"),c},a={reg:r,apply:s},g;return e&&(g=e.prefix,a.noConflict=function(){return e.prefix===a&&(e.prefix=g),a}),a})})(Y)),Y.exports}var ct=gt();const Re=ke(ct),ut={DEBUG:E.cyan,ERROR:E.red,INFO:E.blue,TRACE:E.magenta,WARN:E.yellow},K=at.noConflict();K.enableAll(!0);K.setDefaultLevel("DEBUG");Re.reg(K);Re.apply(K,{format(n,e,t){return`${E.gray(`[${t}]`)} ${ut[n.toUpperCase()](n)}`}});const Ue="haiku-atelier";Ye({loggers:[{category:Ue,lowestLevel:"warning",sinks:["console"]}],sinks:{console:Ae()}});const pt=Ee(Ue);export{ht as __vite_legacy_guard,K as l,pt as n};