/* Finka.js v3.0.3 | Copyright 2025 (c) Smartbear Software and contributors | https://github.com/bitbar/finka-js/blob/master/LICENSE.md */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).finka=e()}(this,(function(){"use strict";var t=function(t,e){return t+e&4294967295};function e(e,r){var u=e[0],s=e[1],c=e[2],f=e[3];u=n(u,s,c,f,r[0],7,-680876936),f=n(f,u,s,c,r[1],12,-389564586),c=n(c,f,u,s,r[2],17,606105819),s=n(s,c,f,u,r[3],22,-1044525330),u=n(u,s,c,f,r[4],7,-176418897),f=n(f,u,s,c,r[5],12,1200080426),c=n(c,f,u,s,r[6],17,-1473231341),s=n(s,c,f,u,r[7],22,-45705983),u=n(u,s,c,f,r[8],7,1770035416),f=n(f,u,s,c,r[9],12,-1958414417),c=n(c,f,u,s,r[10],17,-42063),s=n(s,c,f,u,r[11],22,-1990404162),u=n(u,s,c,f,r[12],7,1804603682),f=n(f,u,s,c,r[13],12,-40341101),c=n(c,f,u,s,r[14],17,-1502002290),u=o(u,s=n(s,c,f,u,r[15],22,1236535329),c,f,r[1],5,-165796510),f=o(f,u,s,c,r[6],9,-1069501632),c=o(c,f,u,s,r[11],14,643717713),s=o(s,c,f,u,r[0],20,-373897302),u=o(u,s,c,f,r[5],5,-701558691),f=o(f,u,s,c,r[10],9,38016083),c=o(c,f,u,s,r[15],14,-660478335),s=o(s,c,f,u,r[4],20,-405537848),u=o(u,s,c,f,r[9],5,568446438),f=o(f,u,s,c,r[14],9,-1019803690),c=o(c,f,u,s,r[3],14,-187363961),s=o(s,c,f,u,r[8],20,1163531501),u=o(u,s,c,f,r[13],5,-1444681467),f=o(f,u,s,c,r[2],9,-51403784),c=o(c,f,u,s,r[7],14,1735328473),u=a(u,s=o(s,c,f,u,r[12],20,-1926607734),c,f,r[5],4,-378558),f=a(f,u,s,c,r[8],11,-2022574463),c=a(c,f,u,s,r[11],16,1839030562),s=a(s,c,f,u,r[14],23,-35309556),u=a(u,s,c,f,r[1],4,-1530992060),f=a(f,u,s,c,r[4],11,1272893353),c=a(c,f,u,s,r[7],16,-155497632),s=a(s,c,f,u,r[10],23,-1094730640),u=a(u,s,c,f,r[13],4,681279174),f=a(f,u,s,c,r[0],11,-358537222),c=a(c,f,u,s,r[3],16,-722521979),s=a(s,c,f,u,r[6],23,76029189),u=a(u,s,c,f,r[9],4,-640364487),f=a(f,u,s,c,r[12],11,-421815835),c=a(c,f,u,s,r[15],16,530742520),u=i(u,s=a(s,c,f,u,r[2],23,-995338651),c,f,r[0],6,-198630844),f=i(f,u,s,c,r[7],10,1126891415),c=i(c,f,u,s,r[14],15,-1416354905),s=i(s,c,f,u,r[5],21,-57434055),u=i(u,s,c,f,r[12],6,1700485571),f=i(f,u,s,c,r[3],10,-1894986606),c=i(c,f,u,s,r[10],15,-1051523),s=i(s,c,f,u,r[1],21,-2054922799),u=i(u,s,c,f,r[8],6,1873313359),f=i(f,u,s,c,r[15],10,-30611744),c=i(c,f,u,s,r[6],15,-1560198380),s=i(s,c,f,u,r[13],21,1309151649),u=i(u,s,c,f,r[4],6,-145523070),f=i(f,u,s,c,r[11],10,-1120210379),c=i(c,f,u,s,r[2],15,718787259),s=i(s,c,f,u,r[9],21,-343485551),e[0]=t(u,e[0]),e[1]=t(s,e[1]),e[2]=t(c,e[2]),e[3]=t(f,e[3])}function r(e,r,n,o,a,i){return r=t(t(r,e),t(o,i)),t(r<>>32-a,n)}function n(t,e,n,o,a,i,u){return r(e&n|~e&o,t,e,a,i,u)}function o(t,e,n,o,a,i,u){return r(e&o|n&~o,t,e,a,i,u)}function a(t,e,n,o,a,i,u){return r(e^n^o,t,e,a,i,u)}function i(t,e,n,o,a,i,u){return r(n^(e|~o),t,e,a,i,u)}function u(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return r}var s="0123456789abcdef".split("");function c(t){for(var e="",r=0;r<4;r++)e+=s[t>>8*r+4&15]+s[t>>8*r&15];return e}var f={constant:{isNodeJs:global.process&&global.process.release&&"node"===global.process.release.name},static:{getLanguage:function(){return(global.isNodeJs?process.env.LANGUAGE||process.env.LANG:navigator.language||navigator.languages&&navigator.languages[0]).substr(0,2)},getCountry:function(){if(void 0!==global.userCountry)return global.userCountry;var t;if(global.isNodeJs)t=process.env.LANG;else if((t=navigator.language).length<3&&navigator.languages)for(var e=0;e2){t=navigator.languages[e];break}var r=t.match(/^[a-z]{2}[_-]([A-Z]{2})/);return null!==r&&(t=r[1]),t},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)},parseValue:function(t){if("string"!=typeof t)return t;if(global.isNumeric(t))return parseFloat(t);var e=t.toLowerCase();return"true"===e||"false"===e?"true"===e:t},md5:function(t){return function(t){for(var e=0;e>2]|=t.charCodeAt(r)<<(r%4<<3);if(a[r>>2]|=128<<(r%4<<3),r>55)for(e(o,a),r=0;r<16;r++)a[r]=0;return a[14]=8*n,e(o,a),o}(t))}}};var l={static:{sortArrayOfObjects:function(t,e,r){var n,o,a=r?-1:1;t.sort((function(t,r){return n=t[e],o=r[e],"string"==typeof n&&(n=n.toLowerCase()),"string"==typeof o&&(o=o.toLowerCase()),n>o?1*a:n0},isInvalidOrEmpty:function(t){return!Array.isArray(t)||0===t.length}},method:{empty:function(){return this.length=0,this},absorb:function(t){return this.push.apply(this,t),this},diff:function(t){return this.filter((function(e){return t.indexOf(e)<0}))},clone:function(){return Object.clone(this)},lookFor:function(t){for(var e=0;e0;t--){var e=Math.floor(Math.rand()*(t+1)),r=this[t];this[t]=this[e],this[e]=r}return this}}};var h={static:{xor:function(t,e){return!t!=!e}}};function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}var p=["AF","CN","HU","JP","KP","KR","LT","MN","TW"],v=["BZ","FM","US"],m=36e5,d=24*m;var y={constant:{SECOND:1e3,MINUTE:6e4,HOUR:m,DAY:d,WEEK:7*d},getter:{TODAY:function(){return d*Math.floor(Date.now()/d)},YESTERDAY:function(){return Date.TODAY-d},TOMORROW:function(){return Date.TODAY+d},DAYAFTERTOMORROW:function(){return Date.TOMORROW+d}},static:{parseValue:function(t){var e=g(t);if("string"!==e){if("number"===e||t instanceof Date)return new Date(t);throw new TypeError("Unsupported value type")}switch(t.toLowerCase()){case"today":return new Date(Date.TODAY);case"yesterday":return new Date(Date.YESTERDAY);case"tomorrow":return new Date(Date.TOMORROW);case"dayaftertomorrow":return new Date(Date.DAYAFTERTOMORROW);case"now":return new Date;default:throw new Error("Unsupported string: "+t)}},daysFromNow:function(t){return Date.now()+Date.DAY*t},getLocalDateFormat:function(t){var e,r;return void 0===t&&(t=!0),e=global.getCountry()||"US",r=p.indexOf(e)>=0?"y-m-d":v.indexOf(e)>=0?"m/d/y":"d.m.y",t&&(r=(r=(r=r.replace("d","dd")).replace("m","mm")).replace("y","yyyy")),r},getTimezoneName:function(){return(new this).toString().match(/\(([^)]+)\)$/)[1]},getHms:function(t){var e={h:0,m:0,s:0,ms:0};return e.ms=Math.max(0,t%1e3),t-=e.ms,t/=1e3,e.s=Math.max(0,t%60),t-=e.s,t/=60,e.m=Math.max(0,t%60),t-=e.m,t/=60,e.h=Math.max(0,t),e},toHmsFormat:function(t,e){void 0===e&&(e="seconds");var r=Date.getHms(t),n=[];switch(e){case"hours":n.push(r.h+"h");break;case"minutes":r.h>0&&n.push(r.h+"h"),n.push(r.m+"m");break;case"seconds":r.h>0&&n.push(r.h+"h"),r.m>0&&n.push(r.m+"m"),n.push(r.s+"s");break;default:throw new TypeError("Unknown accuracy")}return n.join(" ")},toStopwatchFormat:function(t){var e=Date.getHms(t),r=e.m.pad(2)+":"+e.s.pad(2)+"."+Math.floor(e.ms/100);return e.h>0&&(r=e.h.pad(2)+":"+r),r},toTimerFormat:function(t){var e=Date.getHms(t),r=e.m.pad(2)+":"+e.s.pad(2);return e.h>0&&(r=e.h.pad(2)+":"+r),r}},method:{daysPassed:function(t){var e=g(t);if("undefined"===e?t=new Date:"number"!==e&&"string"!==e||(t=new Date(t)),!(t instanceof Date))throw new TypeError("toDate is not instance of Date");return Math.floor(Math.abs((this.getTime()-t.getTime())/Date.DAY))},toCustomDate:function(t){return t=(t=(t=t.replace("d",this.getDate().pad(2))).replace("m",(this.getMonth()+1).pad(2))).replace("y",this.getFullYear())},toUiTime:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?":".concat(this.getSeconds().pad(2)):"";return this.getHours().pad(2)+":"+this.getMinutes().pad(2)+t},toUiDate:function(){return this.toCustomDate(Date.getLocalDateFormat(!1))},toUiDateTime:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.toUiDate()+" "+this.toUiTime(t)},toInputTimeFormat:function(){return this.toUiTime(!1)},toInputDateFormat:function(){return this.toCustomDate("y-m-d")},addTime:function(t){return this.setTime(this.getTime()+t)}}};var b={static:{isJSONString:function(t){try{JSON.parse(t)}catch(t){return!1}return!0}}};var O=new function(){var t=Array.prototype.slice.call(arguments),e=4294967087,r=4294944443,n=12345,o=12345,a=123,i=12345,u=12345,s=123;0===t.length&&(t=[+new Date]);for(var c,f=(c=4022871197,function(t){t=t.toString();for(var e=0;e>>0,c=(r*=c)>>>0,c+=4294967296*(r-=c)}return 2.3283064365386963e-10*(c>>>0)}),l=0;l=0&&!Number.isNegativeZero(t)},isFloat:function(t){return Number.isNumber(t)&&t%1!=0}},method:{pad:function(t){var e=this.toString(),r=e.indexOf("."),n=t;n-=r>-1?r:e.length;for(var o=0;o0},isInvalidOrEmpty:function(t){return"string"!=typeof t||0===t.length}},method:{capitaliseFirstLetter:function(t){var e=this.valueOf();return t&&(e=e.toLowerCase()),e.replace(/[a-z]/i,(function(t){return t.toUpperCase()}))},lowerFirstLetter:function(){return this.valueOf().replace(/[a-z]/i,(function(t){return t.toLowerCase()}))},noCase:function(){var t=this.valueOf();return/^[A-Z0-9_]+$/.test(t)?t.replace(/_/g," ").toLowerCase():t=(t=(t=(t=(t=(t=(t=t.replace(/[-_]/g," ")).replace(/[^a-z0-9 ]/gi,"")).lowerFirstLetter()).replace(/([A-Za-z])([0-9])/g,(function(t,e,r){return e+" "+r}))).replace(/[A-Z][a-z]/g,(function(t){return" "+t.toLowerCase()}))).replace(/([a-z0-9])([A-Z])/g,(function(t,e,r){return e+" "+r}))).trim().replace(/\s{2,}/g," ")},toCamelCase:function(){var t=this.valueOf();return t=(t=t.noCase()).replace(/ [a-z0-9]/gi,(function(t){return t[1].toUpperCase()}))},toPascalCase:function(){return this.toCamelCase().capitaliseFirstLetter(!1)},toKebabCase:function(){var t=this.valueOf();return t=(t=t.noCase()).replace(/\s/g,"-")},toSnakeCase:function(t){var e=t||!1,r=this.valueOf();return r=(r=r.noCase()).replace(/\s/g,"_"),e?r.toUpperCase():r},toChecksum:function(){var t,e,r;for(t=this.valueOf(),r=305419896,e=0;ethis.length)&&-1!==this.indexOf(t,r)}}};function M(t){this.bytes=t,this.toReadableString=function(){return M.getReadableString(this.bytes)}}M.UNITS=["B","KB","MB","GB","TB","EB","ZB","YB"],M.B=1,M.KB=1024*M.B,M.MB=1024*M.KB,M.GB=1024*M.MB,M.TB=1024*M.GB,M.EB=1024*M.TB,M.getReadableString=function(t){var e,r=t;for(e=0;e