{"version":3,"sources":["jsdelivr-header.js","/npm/iban-to-bic@1.4.0/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,UAAY,QAAQ,aACpB,SAAW,QAAQ,cAEzB,OAAO,QAAU,CACf,YAAY,IACV,EAAO,UAAU,qBAAqB,GAC/B,UAAU,YAAY,IAE/B,SAAA,CAAU,GAER,GADA,EAAO,UAAU,qBAAqB,IACjC,UAAU,YAAY,GAAO,OAElC,MAAM,EAAU,EAAK,MAAM,EAAG,GAC9B,IAAK,SAAS,GAAU,OAGxB,IAAI,EAQJ,MAPgB,OAAZ,EAAkB,EAAW,EAAK,OAAO,EAAG,GAC3B,OAAZ,EAAkB,EAAW,EAAK,OAAO,EAAG,GAChC,OAAZ,EAAkB,EAAW,EAAK,OAAO,EAAG,GAChC,OAAZ,EAAkB,EAAW,EAAK,OAAO,EAAG,GAChC,OAAZ,EAAkB,EAAW,EAAK,OAAO,EAAG,GAChC,OAAZ,EAAkB,EAAW,EAAK,OAAO,EAAG,GAChC,OAAZ,IAAkB,EAAW,EAAK,OAAO,EAAG,IAChD,EAEE,SAAS,GAAS,QAFzB,CAGF","file":"/npm/iban-to-bic@1.4.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/iban-to-bic@1.4.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 ibantools = require('ibantools');\nconst datasets = require('./datasets');\n\nmodule.exports = {\n  ibanIsValid(iban) {\n    iban = ibantools.electronicFormatIBAN(iban);\n    return ibantools.isValidIBAN(iban);\n  },\n  ibanToBic(iban) {\n    iban = ibantools.electronicFormatIBAN(iban);\n    if (!ibantools.isValidIBAN(iban)) return;\n\n    const country = iban.slice(0, 2);\n    if (!datasets[country]) return;\n\n    // see https://en.wikipedia.org/wiki/International_Bank_Account_Number#IBAN_formats_by_country\n    let bankCode;\n    if (country === 'AT') bankCode = iban.substr(4, 5);\n    else if (country === 'BE') bankCode = iban.substr(4, 3);\n    else if (country === 'DE') bankCode = iban.substr(4, 8);\n    else if (country === 'ES') bankCode = iban.substr(4, 4);\n    else if (country === 'FR') bankCode = iban.substr(4, 5);\n    else if (country === 'LU') bankCode = iban.substr(4, 3);\n    else if (country === 'NL') bankCode = iban.substr(4, 4);\n    if (!bankCode) return;\n\n    return datasets[country][bankCode];\n  },\n};\n"]}