it-tools/dist/client/assets/chunks/chunk-a85d88f0.js

14 lines
17 KiB
JavaScript
Raw Normal View History

2024-04-28 00:48:29 +08:00
import{_ as C}from"./chunk-a66a4022.js";import{b as S}from"./chunk-a740628f.js";import{_ as P}from"./chunk-6dc5d3af.js";import{_ as k}from"./chunk-6deddc2e.js";import{d as E,r as M,c as W,j as B,D as I,m as o,q as h,S as G,k as F,l as v,L as w,F as T,U as L,E as D}from"./chunk-449c23a2.js";import"./chunk-3db18d93.js";import"./chunk-767079b6.js";import"./chunk-9a43cce8.js";import"./chunk-340feaf0.js";/*!
* @license
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. *//**
* Validation, extraction and creation of IBAN, BBAN, BIC/SWIFT numbers plus some other helpful stuff
* @package Documentation
* @author Saša Jovanić
* @module ibantools
* @version 4.3.3
* @license MPL-2.0
* @preferred
*/function K(r,a){if(a===void 0&&(a={allowQRIBAN:!0}),r==null)return!1;var e=new RegExp("^[0-9]{2}$",""),t=r.slice(0,2),n=_[t];return n===void 0||n.bban_regexp===void 0||n.bban_regexp===null||n.chars===void 0?!1:n.chars===r.length&&e.test(r.slice(2,4))&&Q(r.slice(4),t)&&m(r)&&(a.allowQRIBAN||!l(r))}var b;(function(r){r[r.NoIBANProvided=0]="NoIBANProvided",r[r.NoIBANCountry=1]="NoIBANCountry",r[r.WrongBBANLength=2]="WrongBBANLength",r[r.WrongBBANFormat=3]="WrongBBANFormat",r[r.ChecksumNotNumber=4]="ChecksumNotNumber",r[r.WrongIBANChecksum=5]="WrongIBANChecksum",r[r.WrongAccountBankBranchChecksum=6]="WrongAccountBankBranchChecksum",r[r.QRIBANNotAllowed=7]="QRIBANNotAllowed"})(b||(b={}));function U(r,a){a===void 0&&(a={allowQRIBAN:!0});var e={errorCodes:[],valid:!0};if(r!=null&&r!==""){var t=_[r.slice(0,2)];if(!t||!(t.bban_regexp||t.chars))return e.valid=!1,e.errorCodes.push(b.NoIBANCountry),e;t&&t.chars&&t.chars!==r.length&&(e.valid=!1,e.errorCodes.push(b.WrongBBANLength)),t&&t.bban_regexp&&!d(r.slice(4),t.bban_regexp)&&(e.valid=!1,e.errorCodes.push(b.WrongBBANFormat)),t&&t.bban_validation_func&&!t.bban_validation_func(r.slice(4))&&(e.valid=!1,e.errorCodes.push(b.WrongAccountBankBranchChecksum));var n=new RegExp("^[0-9]{2}$","");n.test(r.slice(2,4))||(e.valid=!1,e.errorCodes.push(b.ChecksumNotNumber)),(e.errorCodes.indexOf(b.WrongBBANFormat)!==-1||!m(r))&&(e.valid=!1,e.errorCodes.push(b.WrongIBANChecksum)),!a.allowQRIBAN&&l(r)&&(e.valid=!1,e.errorCodes.push(b.QRIBANNotAllowed))}else e.valid=!1,e.errorCodes.push(b.NoIBANProvided);return e}function Q(r,a){if(r==null||a===void 0||a===null)return!1;var e=_[a];return e==null||e.bban_regexp===void 0||e.bban_regexp===null||e.chars===void 0||e.chars===null?!1:e.chars-4===r.length&&d(r,e.bban_regexp)?e.bban_validation_func?e.bban_validation_func(r.replace(/[\s.]+/g,"")):!0:!1}function l(r){if(r==null)return!1;var a=r.slice(0,2),e=["LI","CH"];if(!e.includes(a))return!1;var t=new RegExp("^3[0-1]{1}[0-9]{3}$","");return t.test(r.slice(4,9))}function H(r){var a={},e=Z(r);return a.iban=e||r,e&&K(e)?(a.bban=e.slice(4),a.countryCode=e.slice(0,2),a.valid=!0):a.valid=!1,a}function d(r,a){var e=new RegExp(a,"");return e.test(r)}function Z(r){return typeof r!="string"?null:r.replace(/[-\ ]/g,"").toUpperCase()}function f(r,a){if(typeof r!="string")return null;a==null&&(a=" ");var e=Z(r);return e===null?null:e.replace(/(.{4})(?!$)/g,"$1"+a)}function m(r){var a=r.slice(0,2),e=parseInt(r.slice(2,4),10),t=r.slice(4),n=O("".concat(t).concat(a,"00")),s=p(n);return 98-s===e}function O(r){return r.split("").map(function(a){var e=a.charCodeAt(0);return e>=65?(e-55).toString():a}).join("")}var R;(function(r){r[r.NoBICProvided=0]="NoBICProvided",r[r.NoBICCountry=1]="NoBICCountry",r[r.WrongBICFormat=2]="WrongBICFormat"})(R||(R={}));var Y=function(r){for(var a=[5,4,3,2,7,6,5,4,3,2],e=r.replace(/[\s.]+/g,""),t=parseInt(e.charAt(10),10),n=e.substring(0,10),s=0,g=0;g<10;g++)s+=parseInt(n.charAt(g),10)*a[g];var A=s%11;return t===(A===0?0:11-A)},J=function(r){var a=r.replace(/[\s.]+/g,""),e=parseInt(a.substring(0,a.length-2),10),t=parseInt(a.substring(a.length-2,a.length),10),n=e%97===0?97:e%97;return n===t},p=function(r){for(;r.length>2;){var a=r.slice(0,6),e=parseInt(a,10);if(isNaN(e))return NaN;r=e%97+r.slice(a.length)}return parseInt(r,10)%97},i=function(r){var a=r.replace(/[\s.]+/g,""),e=p(a);return e===1},X=function(r){for(var a=[3,9,7,1,3,9,7],e=parseInt(r.charAt(7),10),t=r.substring(0,7),n=0,s=0;s<7;s++)n+=parseInt(t.charAt(s),10)*a[s];var g=n%10;return e===(g===0?0:10-g)},j=function(r){for(var a=[4,8,5,10,9,7,3,6],e=[1,2,4,8,5,10,9,7,3,6],t=parseInt(r.charAt(8),10),n=parseInt(r.charAt(9),10),s=r.substring(0,8),g=r.substring(10,20),A=0,c=0;c<8;c++)A+=parseInt(s.charAt(c),10)*a[c];var u=A%11;if(t!==(u===0?0:u===1?1:11-u))return!1;A=0;for(var c=0;c<10;c++)A+=parseInt(g.charAt(c),10)*e[c];return u=A%11,n===(u===0?0:u===1?1:11-u)},$=function(r,a){for(var e=10,t=0;t<r.length;t++)e+=parseInt(r.charAt(t),10),e%10!==0&&(e=e%10),e=e*2,e=e%11;return a===(11-e===10?0:11-e)},V=function(r){var a=parseInt(r.charAt(