{"version":3,"file":"index.mjs","names":[],"sources":["../src/util/index.ts"],"sourcesContent":["/**\n * Convert a 1-based column number to Excel column letter(s).\n * 1 → \"A\", 26 → \"Z\", 27 → \"AA\", 28 → \"AB\"\n */\nexport function columnToLetter(col: number): string {\n  let result = \"\";\n  let n = col;\n  while (n > 0) {\n    const remainder = (n - 1) % 26;\n    result = String.fromCharCode(65 + remainder) + result;\n    n = Math.floor((n - 1) / 26);\n  }\n  return result;\n}\n\n/**\n * Convert a JavaScript Date to an Excel serial number.\n * Excel epoch: January 1, 1900 = 1 (with the 1900 leap year bug).\n */\nexport function dateToSerialNumber(date: Date): number {\n  // Excel treats 1900 as a leap year (bug inherited from Lotus 1-2-3).\n  // The epoch is effectively December 30, 1899 = 0.\n  const epoch = new Date(1899, 11, 30);\n  const msPerDay = 86400000;\n  const diff = date.getTime() - epoch.getTime();\n  return diff / msPerDay;\n}\n"],"mappings":";;;;;;;;;;;AAIA,SAAgB,eAAe,KAAqB;CAClD,IAAI,SAAS;CACb,IAAI,IAAI;CACR,OAAO,IAAI,GAAG;EACZ,MAAM,aAAa,IAAI,KAAK;EAC5B,SAAS,OAAO,aAAa,KAAK,SAAS,IAAI;EAC/C,IAAI,KAAK,OAAO,IAAI,KAAK,EAAE;CAC7B;CACA,OAAO;AACT;;;;;AAMA,SAAgB,mBAAmB,MAAoB;CAGrD,MAAM,QAAQ,IAAI,KAAK,MAAM,IAAI,EAAE;CAGnC,QADa,KAAK,QAAQ,IAAI,MAAM,QAAQ,KAC9B;AAChB"}