{"version":3,"sources":["jsdelivr-header.js","/npm/@touch4it/ical-timezones@1.9.0/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,GAAK,QAAQ,WACb,KAAO,QAAQ,aAEf,MAAQ,QAAQ,cAEhB,eAAiB,wHAEvB,SAAS,aAAa,GACpB,MAAM,EAAW,MAAM,GACvB,GAAI,EAAU,CACZ,MAAM,EAAS,KAAK,KAAK,UAAW,QAAS,GAC7C,IACE,OAAO,GAAG,aAAa,EAAQ,OACjC,CAAE,MAAO,CACX,CAEA,OAAO,IACT,CAEA,SAAS,WAAW,GAClB,OAAO,EAAQ,MACb,EAAQ,QAAQ,mBAChB,EAAQ,QAAQ,iBAEpB,CAEA,SAAS,sBAAsB,GAC7B,MAAM,EAAM,aAAa,GACzB,OAAO,GAAO,WAAW,EAC3B,CAEA,SAAS,kBAAkB,GACzB,MAAM,EAAW,MAAM,GACvB,GAAI,EAAU,CACZ,MAAM,EAAS,KAAK,KAAK,UAAW,QAAS,GAC7C,OAAO,GAAG,SAAS,SAAS,EAAQ,OACtC,CAEA,OAAO,QAAQ,OAAO,IAAI,MAAM,4BAClC,CAEA,eAAe,2BAA2B,GAExC,OAAO,iBADW,kBAAkB,GAEtC,CAEA,SAAS,eAAe,GACtB,QAAI,MAAM,IAIH,eAAe,KAAK,EAC7B,CAEA,OAAO,QAAU,CACf,0BACA,4CACA,oCACA,sDACA","file":"/npm/@touch4it/ical-timezones@1.9.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@touch4it/ical-timezones@1.9.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const fs = require('node:fs');\nconst path = require('node:path');\n\nconst zones = require('./zones.js');\n\nconst timezoneFormat = /^UTC((\\+1[34]:00)|(?:[+-](?:1[0-2]|0\\d):00)|(?:[+-]0[39]:30)|(?:\\+0[456]:30)|(?:\\+10:30)|(?:\\+0[58]:45)|(?:\\+12:45))$/;\n\nfunction getVtimezone(timezone) {\n  const zoneFile = zones[timezone];\n  if (zoneFile) {\n    const tzPath = path.join(__dirname, 'zones', zoneFile);\n    try {\n      return fs.readFileSync(tzPath, 'utf8');\n    } catch {}\n  }\n\n  return null;\n}\n\nfunction extractVTZ(content) {\n  return content.slice(\n    content.indexOf('BEGIN:VTIMEZONE'),\n    content.indexOf('END:VCALENDAR'),\n  );\n}\n\nfunction getVtimezoneComponent(timezone) {\n  const ics = getVtimezone(timezone);\n  return ics && extractVTZ(ics);\n}\n\nfunction getVtimezoneAsync(timezone) {\n  const zoneFile = zones[timezone];\n  if (zoneFile) {\n    const tzPath = path.join(__dirname, 'zones', zoneFile);\n    return fs.promises.readFile(tzPath, 'utf8');\n  }\n\n  return Promise.reject(new Error('Time zone does not exist'));\n}\n\nasync function getVtimezoneComponentAsync(timezone) {\n  const ics = await getVtimezoneAsync(timezone);\n  return extractVTZ(ics);\n}\n\nfunction timezoneExists(timezone) {\n  if (zones[timezone]) {\n    return true;\n  }\n\n  return timezoneFormat.test(timezone);\n}\n\nmodule.exports = {\n  getVtimezone,\n  getVtimezoneComponent,\n  getVtimezoneAsync,\n  getVtimezoneComponentAsync,\n  timezoneExists,\n};\n"]}