import{at as e}from"./AtxYAA_D.js";import"./CaWxcOZO.js";var t={commitMessageProvider:`codex`,commitMessageModel:`gpt-5.4-mini`,timeFormat:`12h`,dateFormat:`locale`,telegramBotToken:null,telegramChatId:null},n=e(t),r=e(!0),i=e(null);async function a(){r.set(!0),i.set(null);try{let e=await fetch(`/api/settings`);if(!e.ok)return i.set(await e.text()),null;let t=await e.json();return n.set(t),t}finally{r.set(!1)}}async function o(e){let t=await fetch(`/api/settings`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return i.set(await t.text()),null;let r=await t.json();return n.set(r),r}function s(e){return String(e).padStart(2,`0`)}function c(e,t=`12h`){let n=new Date(e);return isNaN(n.getTime())?`—`:t===`24h`?new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(n):new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,hour12:!0}).format(n)}function l(e,t=`locale`){let n=new Date(e);if(isNaN(n.getTime()))return`—`;let r=n.getFullYear(),i=s(n.getMonth()+1),a=s(n.getDate());switch(t){case`iso`:return`${r}-${i}-${a}`;case`us`:return`${i}/${a}/${r}`;case`eu`:return`${a}/${i}/${r}`;case`long`:return new Intl.DateTimeFormat(void 0,{year:`numeric`,month:`long`,day:`numeric`}).format(n);default:return new Intl.DateTimeFormat(void 0,{year:`numeric`,month:`short`,day:`numeric`}).format(n)}}function u(e,t=`locale`,n=`12h`){return`${l(e,t)} ${c(e,n)}`}export{t as a,r as i,c as n,a as o,n as r,o as s,u as t};