New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

alga-js

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alga-js - npm Package Compare versions

Comparing version

to
0.1.0-alpha-8

13

lib/alga.cjs.js

@@ -83,13 +83,2 @@ 'use strict';

var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __awaiter(thisArg, _arguments, P, generator) {

@@ -605,3 +594,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

//newValue = newDate.toLocaleTimeString(locale, options)
newValue = new Intl.DateTimeFormat(locale, __assign({ timeStyle: 'medium' }, options)).format(newDate);
newValue = new Intl.DateTimeFormat(locale, options).format(newDate);
}

@@ -608,0 +597,0 @@ }

@@ -79,13 +79,2 @@ var uniq = function (fromArray, byProp) {

var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __awaiter(thisArg, _arguments, P, generator) {

@@ -601,3 +590,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

//newValue = newDate.toLocaleTimeString(locale, options)
newValue = new Intl.DateTimeFormat(locale, __assign({ timeStyle: 'medium' }, options)).format(newDate);
newValue = new Intl.DateTimeFormat(locale, options).format(newDate);
}

@@ -604,0 +593,0 @@ }

17

lib/alga.js

@@ -1,1 +0,16 @@

var date=function(e){"use strict";var r=function(e,r){void 0===r&&(r="");for(var t=[],n=Number(r),o=new Set,a=0,u=e;a<u.length;a++){var i=u[a];if("object"==typeof i&&null!==i&&"string"==typeof r&&""!==r&&!1===Array.isArray(i))o.has(i[r])||(t.push(i),o.add(i[r]));else if(Array.isArray(i)&&!1===isNaN(n)&&Number(i.length)>Number(r)){var l=Number(r);o.has(i[l])||(t.push(i),o.add(i[l]))}else o.has(JSON.stringify(i))||(t.push(i),o.add(JSON.stringify(i)))}return t},t=function(){return t=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},t.apply(this,arguments)};function n(e,r,t,n){return new(t||(t=Promise))((function(o,a){function u(e){try{l(n.next(e))}catch(e){a(e)}}function i(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(u,i)}l((n=n.apply(e,r||[])).next())}))}function o(e,r){var t,n,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;u;)try{if(t=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,n=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=r.call(e,u)}catch(e){a=[6,e],n=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}}function a(e,r,t){if(t||2===arguments.length)for(var n,o=0,a=r.length;o<a;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))}var u=function(e,r){void 0===r&&(r={prop:"id",parent:"parent",children:"children"});var t,n=Array.from(e),o=r,a=function(e){var r=e;return void 0!==e[o.children]&&null!==e[o.children]||(r[o.children]=u(e[o.prop]),r[o.children].length<=0&&delete r[o.children]),delete r[o.parent],r},u=function(e){var r=[];return i(e).length>=1&&i(e).forEach((function(e){r.push(a(e))})),r},i=function(e){return n.filter((function(r){return r[o.parent]===e}))};return(t=n).filter((function(e){return"object"==typeof e&&null!==e&&!t.map((function(e){return String(e[o.prop]).trim()})).includes(String(e[o.parent]).trim())})).map((function(e){return a(e)}))},i=function(e,r){void 0===r&&(r={prop:"id",parent:"parent",children:"children"});var t=[],n=r,o=function(e,r){e.length>=1&&Array.from(e).forEach((function(e){if("object"==typeof e&&null!==e){var a=e;a[n.parent]=r[n.prop],"object"==typeof a[n.children]&&Array.isArray(a[n.children])&&(o(a[n.children],e),delete a[n.children]),t.push(a)}}))};return Array.from(e).forEach((function(e){if("object"==typeof e&&null!==e){var r=e;r[n.parent]="0","object"==typeof r[n.children]&&Array.isArray(r[n.children])&&(o(r[n.children],e),delete r[n.children]),t.push(r)}})),t},l=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n=Object.assign({},e),o=0,a=r;o<a.length;o++){var u=a[o];u in n&&delete n[u]}return n},c=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n={},o=new Set(r.map((function(e){return String(e)}))),a=0,u=Object.keys(e);a<u.length;a++){var i=u[a];o.has(String(e[i]))||(n[i]=e[i])}return n},f=l,m=c,s=function(e,r,t){void 0===t&&(t="asc");var n=Array.from(e);return"asc"===t?n.sort((function(e,t){if(r in e&&r in t){if(!1===isNaN(e[r])&&!1===isNaN(t[r]))return Number(e[r])-Number(t[r]);if("string"==typeof e[r]&&"string"==typeof t[r]){var n=e[r].toLowerCase(),o=t[r].toLowerCase(),a=0;return n<o?a=-1:n>o&&(a=1),a}}})):"desc"===t&&n.sort((function(e,t){if(r in e&&r in t){if(!1===isNaN(e[r])&&!1===isNaN(t[r]))return Number(t[r])-Number(e[r]);if("string"==typeof e[r]&&"string"==typeof t[r]){var n=e[r].toLowerCase(),o=t[r].toLowerCase(),a=0;return o<n?a=-1:o>n&&(a=1),a}}})),n},v=s,d=Object.freeze({__proto__:null,uniq:r,take:function(e,r,t){void 0===t&&(t="");var n=[],o=Number(r);return Array.isArray(e)&&e.length>=1&&("object"==typeof e[0]&&null!==e[0]&&"string"==typeof r&&Object.keys(e[0]).includes(r)?(n=e.map((function(e){return e[r]})),"uniq"===t&&(n=Array.from(new Set(n)))):Array.isArray(e[0])&&!1===isNaN(o)?(n=e.map((function(e){return e[o]})),"uniq"===t&&(n=Array.from(new Set(n)))):"function"==typeof r&&(n=e.filter((function(e){return r(e)})),""!==t&&(n=n.map((function(e){return e[t]}))))),n},nested:u,nestedAsync:function(e,r){return void 0===r&&(r={}),n(void 0,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(u(t,r))]}}))}))},flatten:i,flattenAsync:function(e,r){return void 0===r&&(r={}),n(void 0,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(i(t,r))]}}))}))},search:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var o=[],u=function(t){var n=Array.from(e).filter((function(e){if(!1===isNaN(e)&&Number(e)===Number(t))return!0;if("string"==typeof e&&String(e).toLowerCase().includes(String(t).toLowerCase()))return!0;if("object"==typeof e&&null!==e)for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];if(!1===isNaN(e[o])&&Number(e[o])===Number(t))return!0;if("string"==typeof e[o]&&String(e[o]).toLowerCase().includes(String(t).toLowerCase()))return!0}return!1}));o=r(a(a([],o,!0),n,!0))},i=0,l=t.flat();i<l.length;i++){var c=l[i];u(c)}return o},searchBy:function(e,t,n){for(var o=[],u=function(t){var u=Array.from(e).filter((function(e){for(var r=0,o=Array.from(n);r<o.length;r++){var a=o[r];if(a in e){if(!1===isNaN(e[a])&&Number(e[a])===Number(t))return!0;if("string"==typeof e[a]&&-1!==String(e[a]).toLowerCase().indexOf(String(t).toLowerCase()))return!0}}return!1}));o=r(a(a([],o,!0),u,!0))},i=0,l=t;i<l.length;i++){u(l[i])}return o},filter:function(e,r){for(var t=Array.from(e),n=c(r,"",0),o=function(e){var r=t.filter((function(r){if(e in r){if(!1===isNaN(r[e])&&Number(r[e])===Number(n[e]))return!0;if("string"==typeof r[e]&&String(r[e]).toLowerCase().includes(String(n[e]).toLowerCase()))return!0}return!1}));t=r},a=0,u=Object.keys(n);a<u.length;a++){o(u[a])}return t},sortBy:s,sort:v,order:function(e,r){return void 0===r&&(r="order"),Array.from(e).map((function(e,t){return"object"==typeof e&&null!==e&&(e[r]=Number(t)+1),e}))},paginate:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=10);var n=Array.from(e),o=Number(t)*Number(r)-(Number(t)-1),a=Number(t)*Number(r);return n.slice(o-1,a<=n.length?a:n.length)},pages:function(e,r){void 0===r&&(r=10);var t=Array.isArray(e)?e.length:e,n=Number(t)/Number(r);return Math.ceil(n)},pageInfo:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=10);var n=Array.from(e),o=Number(t)*Number(r)-(Number(t)-1),a=Number(t)*Number(r);return{from:n.length>=1?o:0,start:n.length>=1?o:0,to:a<=n.length?a:n.length,end:a<=n.length?a:n.length,of:n.length,length:n.length}},pagination:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=0);var n=[],o=Number(e)<Number(r)?Number(e):Number(r),a=Number(r)<1?1:Number(r),u=o+Number(t),i=a-Number(t);if(0===Number(t))for(var l=1;l<=Number(e);l++)n.push(String(l));else{if(a>1)for(l=i;l<a;l++)n.push(String(l));for(l=o;l<=u;l++)n.push(String(l))}var c=n.filter((function(e){return Number(e)>0})).filter((function(r){return Number(r)<=Number(e)}));return u<Number(e)&&0!==Number(t)&&c.push("..."),i>1&&0!==Number(t)&&c.unshift("..."),c},duplication:function(e,r){void 0===r&&(r="");var t=[],n=Array.from(new Set(e));""!==r&&(n=Array.from(new Set(e.map((function(e){return e[r]})))));for(var o=function(n){var o=Array.from(e).filter((function(e){return""!==r?e[r]===n:e===n}));Number(o.length)>=2&&o.forEach((function(e){t.push(e)}))},a=0,u=n;a<u.length;a++){o(u[a])}return t},duplicationGroup:function(e,r){void 0===r&&(r="");var t={},n=new Set,o=Array.from(new Set(e));""!==r&&(o=Array.from(new Set(e.map((function(e){return e[r]})))));for(var a=function(o){var a=Array.from(e).filter((function(e){return""!==r?e[r]===o:e===o}));n.has(a.length)||(n.add(a.length),t[a.length]=[]),a.forEach((function(e){t[a.length].push(e)}))},u=0,i=o;u<i.length;u++){a(i[u])}return t}}),b=function(e){var r=String(e);return 1===r.length&&(r="0"+r),r},h=function(e,r,n,o){void 0===r&&(r=""),void 0===n&&(n=""),void 0===o&&(o={});var a=new Date(e||null),u="".concat(a.getFullYear(),"-").concat(b(Number(a.getMonth())+1),"-").concat(b(a.getDate())," ").concat(b(a.getHours()),":").concat(b(a.getMinutes()),":").concat(b(a.getSeconds()));return""===n&&"UTC"===(null==o?void 0:o.timeZone)&&(u="".concat(a.getUTCFullYear(),"-").concat(b(Number(a.getUTCMonth())+1),"-").concat(b(a.getUTCDate())," ").concat(b(a.getUTCHours()),":").concat(b(a.getUTCMinutes()),":").concat(b(a.getUTCSeconds()))),"date"===r?(u="".concat(a.getFullYear(),"-").concat(b(Number(a.getMonth())+1),"-").concat(b(a.getDate())),""===n&&"UTC"===(null==o?void 0:o.timeZone)&&(u="".concat(a.getUTCFullYear(),"-").concat(b(Number(a.getUTCMonth())+1),"-").concat(b(a.getUTCDate()))),""!==n&&(u=new Intl.DateTimeFormat(n,o).format(a))):"time"===r?(u="".concat(b(a.getHours()),":").concat(b(a.getMinutes()),":").concat(b(a.getSeconds())),""===n&&"UTC"===(null==o?void 0:o.timeZone)&&(u="".concat(b(a.getUTCHours()),":").concat(b(a.getUTCMinutes()),":").concat(b(a.getUTCSeconds()))),""!==n&&(u=new Intl.DateTimeFormat(n,t({timeStyle:"medium"},o)).format(a))):""!==n&&(u=new Intl.DateTimeFormat(n,o).format(a)),u},p=function(e,r){var t=new Date(e).toJSON().split(/T|\./);return"date"===r?Number(t[0].replaceAll("-","")):"time"===r?Number(t[1].replaceAll(":","")):new Date(e).valueOf()},g=function(){return Number((new Date).getFullYear())},N=function(){return Number((new Date).getMonth())},y=function(e,r){void 0===e&&(e=g()),void 0===r&&(r=N());var t=Number(new Date(e,r,0).getDate());return[28,29,30,31].includes(t)?t:31},w=function(e,r){void 0===e&&(e=g()),void 0===r&&(r=N());for(var t=[],n=Number(new Date(e,Number(r)-1,1).getDay()),o=Number(n)-1;o>=0;o--)t.push(Number(new Date(e,Number(r)-1,Number("-"+o)).getDate()));return t},A=function(e,r){var t=Number(new Date(r).getMonth())-Number(new Date(e).getMonth()),n=12*(Number(new Date(r).getFullYear())-Number(new Date(e).getFullYear()));return Math.floor(t+n)},M=Object.freeze({__proto__:null,now:function(e,r,t){void 0===e&&(e=""),void 0===r&&(r=""),void 0===t&&(t={});var n=new Date;return h(n,e,r,t)},format:h,isBefore:function(e,r,t){void 0===t&&(t="dateTime");var n=!1;return p(e,t)<p(r,t)&&(n=!0),n},isAfter:function(e,r,t){void 0===t&&(t="dateTime");var n=!1;return p(e,t)>p(r,t)&&(n=!0),n},isBetween:function(e,r,t,n){void 0===n&&(n="dateTime");var o=p(e,n),a=p(r,n),u=p(t,n),i=!1;return o>=a&&o<=u&&(i=!0),i},daysInMonth:y,daysOfPrevMonth:w,daysOfNextMonth:function(e,r){void 0===e&&(e=g()),void 0===r&&(r=N());var t=Number(new Date(e,Number(r)-1,y(e,r)).getDay()),n=6-Number(t),o=Number(y(e,r))+Number(w(e,r).length)+Number(n);return Number(n)+(42-Number(o))},daysInYear:function(e){return void 0===e&&(e=g()),Number(e)%400==0||Number(e)%100!=0&&Number(e)%4==0?366:365},daysInBetween:function(e,r,t){void 0===t&&(t="dateTime");var n=p(e,t),o=p(r,t),a=Number(o)-Number(n);return Math.floor(a/864e5)},monthsInBetween:A,yearsInBetween:function(e,r){return Math.floor(A(e,r)/12)},doubleFormat:b,month:function(e,r,t,n){void 0===e&&(e=g()),void 0===r&&(r=N()),void 0===t&&(t="en-US"),void 0===n&&(n="long");var o=new Date(e,Number(r)-1);return new Intl.DateTimeFormat(t,{month:n}).format(o)},months:function(e,r){void 0===e&&(e="en-US"),void 0===r&&(r="long");for(var t=[],n=Number((new Date).getFullYear()),o=0;o<=11;o++){var a={},u=new Date(n,o);a.value=b(Number(o)+1),a.text=new Intl.DateTimeFormat(e,{month:r}).format(u),t.push(a)}return t},years:function(e,r){void 0===e&&(e=(new Date).getFullYear()),void 0===r&&(r=5);for(var t=[],n=Number(e)-(Number(r)+1),o=Number(e)+Number(r),a=n;a<=o;a++)t.push(a);return t}}),S=Object.freeze({__proto__:null,separator:function(e,r,t,n){void 0===r&&(r=","),void 0===t&&(t=!1),void 0===n&&(n=2);var o="."===r?"de-DE":"en-US",a=String(new Intl.NumberFormat(o).format(Number(e)));if(!0===t){var u=String(Number(e));u=u.includes(".")?(u=Number(u).toFixed(n)).split(".")[1]:new Array(n).fill(0).join("");var i="."===r?",":".";a=(a=a.split(i)[0].trim())+i+u}return a},percentage:function(e,r,t){void 0===t&&(t=!1);var n=String(Math.round(100*(Number(e)/Number(r)-1)));return!0===t&&(n+="%"),n},unit:function(e,r,t){void 0===r&&(r=2),void 0===t&&(t="normal");var n=[{id:1,value:1,symbol:""},{id:2,value:1e3,symbol:"K"},{id:3,value:1e6,symbol:"M"},{id:4,value:1e9,symbol:"G"},{id:5,value:1e12,symbol:"T"},{id:6,value:1e15,symbol:"P"},{id:7,value:1e18,symbol:"E"},{id:8,value:1e21,symbol:"Z"},{id:9,value:1e24,symbol:"Y"}];"normal"!==t&&(n=n.map((function(e){return"decimal"===t?2===e.id&&(e.symbol="k"):"money"===t?4===e.id&&(e.symbol="B"):"binary"===t?1!==e.id&&(e.value=e.value+24*(e.id-1),e.symbol=e.symbol+"i"):"byte"===t&&1!==e.id&&(e.value=e.value+24*(e.id-1),e.symbol=e.symbol+"B"),e})));var o=n.slice().reverse().find((function(r){return Number(e)>=r.value}));return o?(Number(e)/o.value).toFixed(r).replace(/\.0+$|(\.[0-9]*[1-9])0+$/,"$1")+""+o.symbol:"0"},spaceBetween:function(e){return String(e).replace(/\d{4}(?=.)/g,"$& ")},roundOf:function(e){var r=[1,1e3,1e6,1e9,1e12,1e15,1e18,1e21,1e24].slice().reverse().find((function(r){return Number(e)>=r}));return Math.round(Number(e)/r)*r},between:function(e,r,t){void 0===t&&(t=!0);var n=t?Number(e)+1:Number(e),o=t?Number(r)-1:Number(r),a=Math.floor(Math.random()*Number(o));return a<=n&&(a=Number(n)+Number(a)),a},isBetween:function(e,r,t){var n=Number(e),o=Number(r),a=Number(t),u=!1;return n>=o&&n<=a&&(u=!0),u}}),C=Object.freeze({__proto__:null,remove:l,removeBy:c,removeByKey:f,removeByVal:m}),D=function(e,r){void 0===r&&(r="raw");var t=encodeURI(e);return"param"===r&&(t=encodeURIComponent(e)),t},T=function(e,r){void 0===r&&(r="raw");var t=decodeURI(e);return"param"===r&&(t=decodeURIComponent(e)),t},_=function(e,r){void 0===r&&(r="");var t=e;return t="multiple"===r?t.toLowerCase().replace(/\w\S*/g,(function(e){return e.replace(/^\w/,(function(e){return e.toUpperCase()}))})):"single"===r?t.toLowerCase().trimStart().replace(/^\w/,(function(e){return e.toUpperCase()})):t.trimStart().replace(/^\w/,(function(e){return e.toUpperCase()}))},O=Object.freeze({__proto__:null,urlEncode:D,urlDecode:T,urlEncodeAsync:function(e,r){return void 0===r&&(r="raw"),n(void 0,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(D(t,r))]}}))}))},urlDecodeAsync:function(e,r){return void 0===r&&(r="raw"),n(void 0,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(T(t,r))]}}))}))},uniqid:function(e){void 0===e&&(e=0);var r="",t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=String(Math.abs((new Date).valueOf()));Number(e)>=1&&(r+=String(Number(e)+1));for(var o=0;o<n.length;o++)r+=t.charAt(Math.floor(Math.random()*t.length)),r+=n.charAt(o);return r},random:function(e,r){void 0===e&&(e=11),void 0===r&&(r="");var t="",n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_~!@#$%^&*()+={}[]|:;<>,./?";"alphadash"===r?n=n.slice(0,64):"alphanumeric"===r?n=n.slice(0,62):"alpha"===r?n=n.slice(10,62):"hex"===r?n=n.slice(0,16):"numeric"===r&&(n=n.slice(0,10));for(var o=0;o<e;o++)t+=n.charAt(Math.floor(Math.random()*n.length));return t},capitalize:_,camelCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=_(r,"multiple")).trimStart().replace(/^\w/,(function(e){return e.toLowerCase()})).replaceAll(" ","")},pascalCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=_(r,"multiple")).replaceAll(" ","")},snakeCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=_(r,"multiple")).replaceAll(" ","").replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,r){return(r>0?"_":"")+e.toLowerCase()}))},kebabCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=_(r,"multiple")).replaceAll(" ","").replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,r){return(r>0?"-":"")+e.toLowerCase()}))},slug:function(e,r,t){void 0===r&&(r=0),void 0===t&&(t=0);var n=e.trim();return n=(n=n.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")).replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-"),Number(r)>0&&(n=n.slice(0,Number(r))),Number(t)>0&&(n=n+"-"+t),n}}),F=Object.freeze({__proto__:null,relative:function(e,r,t,n,o){void 0===r&&(r="utc"),void 0===t&&(t="en-US"),void 0===n&&(n={}),void 0===o&&(o="long");var a=new Date,u=new Date(e);"utc"!==r&&(u=new Date(new Date(e).toJSON()));var i=Math.round((u.valueOf()-a.valueOf())/1e3),l=new Intl.RelativeTimeFormat(t,n).format(i,"second");"short"===o&&(l="".concat(Math.abs(Math.round(i)),"s"));var c=i/31536e3;if(Math.abs(c)>1){var f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"year"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"y"))}else if(c=i/2592e3,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"month"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"mo"))}else if(c=i/86400,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"day"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"d"))}else if(c=i/3600,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"hour"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"h"))}else if(c=i/60,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"minute"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"m"))}return l},hoursInBetween:function(e,r){var t=new Date(e),n=new Date(r),o=Math.abs(Number(t.getTime())-Number(n.getTime()));return Number((o/36e5).toFixed(0))}});return e.array=d,e.date=M,e.number=S,e.object=C,e.string=O,e.time=F,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
var date=function(e){"use strict";var r=function(e,r){void 0===r&&(r="");for(var t=[],n=Number(r),o=new Set,a=0,u=e;a<u.length;a++){var i=u[a];if("object"==typeof i&&null!==i&&"string"==typeof r&&""!==r&&!1===Array.isArray(i))o.has(i[r])||(t.push(i),o.add(i[r]));else if(Array.isArray(i)&&!1===isNaN(n)&&Number(i.length)>Number(r)){var l=Number(r);o.has(i[l])||(t.push(i),o.add(i[l]))}else o.has(JSON.stringify(i))||(t.push(i),o.add(JSON.stringify(i)))}return t};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function t(e,r,t,n){return new(t||(t=Promise))((function(o,a){function u(e){try{l(n.next(e))}catch(e){a(e)}}function i(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(u,i)}l((n=n.apply(e,r||[])).next())}))}function n(e,r){var t,n,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;u;)try{if(t=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,n=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=r.call(e,u)}catch(e){a=[6,e],n=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}}function o(e,r,t){if(t||2===arguments.length)for(var n,o=0,a=r.length;o<a;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))}var a=function(e,r){void 0===r&&(r={prop:"id",parent:"parent",children:"children"});var t,n=Array.from(e),o=r,a=function(e){var r=e;return void 0!==e[o.children]&&null!==e[o.children]||(r[o.children]=u(e[o.prop]),r[o.children].length<=0&&delete r[o.children]),delete r[o.parent],r},u=function(e){var r=[];return i(e).length>=1&&i(e).forEach((function(e){r.push(a(e))})),r},i=function(e){return n.filter((function(r){return r[o.parent]===e}))};return(t=n).filter((function(e){return"object"==typeof e&&null!==e&&!t.map((function(e){return String(e[o.prop]).trim()})).includes(String(e[o.parent]).trim())})).map((function(e){return a(e)}))},u=function(e,r){void 0===r&&(r={prop:"id",parent:"parent",children:"children"});var t=[],n=r,o=function(e,r){e.length>=1&&Array.from(e).forEach((function(e){if("object"==typeof e&&null!==e){var a=e;a[n.parent]=r[n.prop],"object"==typeof a[n.children]&&Array.isArray(a[n.children])&&(o(a[n.children],e),delete a[n.children]),t.push(a)}}))};return Array.from(e).forEach((function(e){if("object"==typeof e&&null!==e){var r=e;r[n.parent]="0","object"==typeof r[n.children]&&Array.isArray(r[n.children])&&(o(r[n.children],e),delete r[n.children]),t.push(r)}})),t},i=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n=Object.assign({},e),o=0,a=r;o<a.length;o++){var u=a[o];u in n&&delete n[u]}return n},l=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n={},o=new Set(r.map((function(e){return String(e)}))),a=0,u=Object.keys(e);a<u.length;a++){var i=u[a];o.has(String(e[i]))||(n[i]=e[i])}return n},c=i,f=l,m=function(e,r,t){void 0===t&&(t="asc");var n=Array.from(e);return"asc"===t?n.sort((function(e,t){if(r in e&&r in t){if(!1===isNaN(e[r])&&!1===isNaN(t[r]))return Number(e[r])-Number(t[r]);if("string"==typeof e[r]&&"string"==typeof t[r]){var n=e[r].toLowerCase(),o=t[r].toLowerCase(),a=0;return n<o?a=-1:n>o&&(a=1),a}}})):"desc"===t&&n.sort((function(e,t){if(r in e&&r in t){if(!1===isNaN(e[r])&&!1===isNaN(t[r]))return Number(t[r])-Number(e[r]);if("string"==typeof e[r]&&"string"==typeof t[r]){var n=e[r].toLowerCase(),o=t[r].toLowerCase(),a=0;return o<n?a=-1:o>n&&(a=1),a}}})),n},s=m,v=Object.freeze({__proto__:null,uniq:r,take:function(e,r,t){void 0===t&&(t="");var n=[],o=Number(r);return Array.isArray(e)&&e.length>=1&&("object"==typeof e[0]&&null!==e[0]&&"string"==typeof r&&Object.keys(e[0]).includes(r)?(n=e.map((function(e){return e[r]})),"uniq"===t&&(n=Array.from(new Set(n)))):Array.isArray(e[0])&&!1===isNaN(o)?(n=e.map((function(e){return e[o]})),"uniq"===t&&(n=Array.from(new Set(n)))):"function"==typeof r&&(n=e.filter((function(e){return r(e)})),""!==t&&(n=n.map((function(e){return e[t]}))))),n},nested:a,nestedAsync:function(e,r){return void 0===r&&(r={}),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(a(t,r))]}}))}))},flatten:u,flattenAsync:function(e,r){return void 0===r&&(r={}),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(u(t,r))]}}))}))},search:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var a=[],u=function(t){var n=Array.from(e).filter((function(e){if(!1===isNaN(e)&&Number(e)===Number(t))return!0;if("string"==typeof e&&String(e).toLowerCase().includes(String(t).toLowerCase()))return!0;if("object"==typeof e&&null!==e)for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];if(!1===isNaN(e[o])&&Number(e[o])===Number(t))return!0;if("string"==typeof e[o]&&String(e[o]).toLowerCase().includes(String(t).toLowerCase()))return!0}return!1}));a=r(o(o([],a,!0),n,!0))},i=0,l=t.flat();i<l.length;i++){var c=l[i];u(c)}return a},searchBy:function(e,t,n){for(var a=[],u=function(t){var u=Array.from(e).filter((function(e){for(var r=0,o=Array.from(n);r<o.length;r++){var a=o[r];if(a in e){if(!1===isNaN(e[a])&&Number(e[a])===Number(t))return!0;if("string"==typeof e[a]&&-1!==String(e[a]).toLowerCase().indexOf(String(t).toLowerCase()))return!0}}return!1}));a=r(o(o([],a,!0),u,!0))},i=0,l=t;i<l.length;i++){u(l[i])}return a},filter:function(e,r){for(var t=Array.from(e),n=l(r,"",0),o=function(e){var r=t.filter((function(r){if(e in r){if(!1===isNaN(r[e])&&Number(r[e])===Number(n[e]))return!0;if("string"==typeof r[e]&&String(r[e]).toLowerCase().includes(String(n[e]).toLowerCase()))return!0}return!1}));t=r},a=0,u=Object.keys(n);a<u.length;a++){o(u[a])}return t},sortBy:m,sort:s,order:function(e,r){return void 0===r&&(r="order"),Array.from(e).map((function(e,t){return"object"==typeof e&&null!==e&&(e[r]=Number(t)+1),e}))},paginate:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=10);var n=Array.from(e),o=Number(t)*Number(r)-(Number(t)-1),a=Number(t)*Number(r);return n.slice(o-1,a<=n.length?a:n.length)},pages:function(e,r){void 0===r&&(r=10);var t=Array.isArray(e)?e.length:e,n=Number(t)/Number(r);return Math.ceil(n)},pageInfo:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=10);var n=Array.from(e),o=Number(t)*Number(r)-(Number(t)-1),a=Number(t)*Number(r);return{from:n.length>=1?o:0,start:n.length>=1?o:0,to:a<=n.length?a:n.length,end:a<=n.length?a:n.length,of:n.length,length:n.length}},pagination:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=0);var n=[],o=Number(e)<Number(r)?Number(e):Number(r),a=Number(r)<1?1:Number(r),u=o+Number(t),i=a-Number(t);if(0===Number(t))for(var l=1;l<=Number(e);l++)n.push(String(l));else{if(a>1)for(l=i;l<a;l++)n.push(String(l));for(l=o;l<=u;l++)n.push(String(l))}var c=n.filter((function(e){return Number(e)>0})).filter((function(r){return Number(r)<=Number(e)}));return u<Number(e)&&0!==Number(t)&&c.push("..."),i>1&&0!==Number(t)&&c.unshift("..."),c},duplication:function(e,r){void 0===r&&(r="");var t=[],n=Array.from(new Set(e));""!==r&&(n=Array.from(new Set(e.map((function(e){return e[r]})))));for(var o=function(n){var o=Array.from(e).filter((function(e){return""!==r?e[r]===n:e===n}));Number(o.length)>=2&&o.forEach((function(e){t.push(e)}))},a=0,u=n;a<u.length;a++){o(u[a])}return t},duplicationGroup:function(e,r){void 0===r&&(r="");var t={},n=new Set,o=Array.from(new Set(e));""!==r&&(o=Array.from(new Set(e.map((function(e){return e[r]})))));for(var a=function(o){var a=Array.from(e).filter((function(e){return""!==r?e[r]===o:e===o}));n.has(a.length)||(n.add(a.length),t[a.length]=[]),a.forEach((function(e){t[a.length].push(e)}))},u=0,i=o;u<i.length;u++){a(i[u])}return t}}),d=function(e){var r=String(e);return 1===r.length&&(r="0"+r),r},b=function(e,r,t,n){void 0===r&&(r=""),void 0===t&&(t=""),void 0===n&&(n={});var o=new Date(e||null),a="".concat(o.getFullYear(),"-").concat(d(Number(o.getMonth())+1),"-").concat(d(o.getDate())," ").concat(d(o.getHours()),":").concat(d(o.getMinutes()),":").concat(d(o.getSeconds()));return""===t&&"UTC"===(null==n?void 0:n.timeZone)&&(a="".concat(o.getUTCFullYear(),"-").concat(d(Number(o.getUTCMonth())+1),"-").concat(d(o.getUTCDate())," ").concat(d(o.getUTCHours()),":").concat(d(o.getUTCMinutes()),":").concat(d(o.getUTCSeconds()))),"date"===r?(a="".concat(o.getFullYear(),"-").concat(d(Number(o.getMonth())+1),"-").concat(d(o.getDate())),""===t&&"UTC"===(null==n?void 0:n.timeZone)&&(a="".concat(o.getUTCFullYear(),"-").concat(d(Number(o.getUTCMonth())+1),"-").concat(d(o.getUTCDate()))),""!==t&&(a=new Intl.DateTimeFormat(t,n).format(o))):"time"===r?(a="".concat(d(o.getHours()),":").concat(d(o.getMinutes()),":").concat(d(o.getSeconds())),""===t&&"UTC"===(null==n?void 0:n.timeZone)&&(a="".concat(d(o.getUTCHours()),":").concat(d(o.getUTCMinutes()),":").concat(d(o.getUTCSeconds()))),""!==t&&(a=new Intl.DateTimeFormat(t,n).format(o))):""!==t&&(a=new Intl.DateTimeFormat(t,n).format(o)),a},h=function(e,r){var t=new Date(e).toJSON().split(/T|\./);return"date"===r?Number(t[0].replaceAll("-","")):"time"===r?Number(t[1].replaceAll(":","")):new Date(e).valueOf()},p=function(){return Number((new Date).getFullYear())},g=function(){return Number((new Date).getMonth())},N=function(e,r){void 0===e&&(e=p()),void 0===r&&(r=g());var t=Number(new Date(e,r,0).getDate());return[28,29,30,31].includes(t)?t:31},y=function(e,r){void 0===e&&(e=p()),void 0===r&&(r=g());for(var t=[],n=Number(new Date(e,Number(r)-1,1).getDay()),o=Number(n)-1;o>=0;o--)t.push(Number(new Date(e,Number(r)-1,Number("-"+o)).getDate()));return t},w=function(e,r){var t=Number(new Date(r).getMonth())-Number(new Date(e).getMonth()),n=12*(Number(new Date(r).getFullYear())-Number(new Date(e).getFullYear()));return Math.floor(t+n)},A=Object.freeze({__proto__:null,now:function(e,r,t){void 0===e&&(e=""),void 0===r&&(r=""),void 0===t&&(t={});var n=new Date;return b(n,e,r,t)},format:b,isBefore:function(e,r,t){void 0===t&&(t="dateTime");var n=!1;return h(e,t)<h(r,t)&&(n=!0),n},isAfter:function(e,r,t){void 0===t&&(t="dateTime");var n=!1;return h(e,t)>h(r,t)&&(n=!0),n},isBetween:function(e,r,t,n){void 0===n&&(n="dateTime");var o=h(e,n),a=h(r,n),u=h(t,n),i=!1;return o>=a&&o<=u&&(i=!0),i},daysInMonth:N,daysOfPrevMonth:y,daysOfNextMonth:function(e,r){void 0===e&&(e=p()),void 0===r&&(r=g());var t=Number(new Date(e,Number(r)-1,N(e,r)).getDay()),n=6-Number(t),o=Number(N(e,r))+Number(y(e,r).length)+Number(n);return Number(n)+(42-Number(o))},daysInYear:function(e){return void 0===e&&(e=p()),Number(e)%400==0||Number(e)%100!=0&&Number(e)%4==0?366:365},daysInBetween:function(e,r,t){void 0===t&&(t="dateTime");var n=h(e,t),o=h(r,t),a=Number(o)-Number(n);return Math.floor(a/864e5)},monthsInBetween:w,yearsInBetween:function(e,r){return Math.floor(w(e,r)/12)},doubleFormat:d,month:function(e,r,t,n){void 0===e&&(e=p()),void 0===r&&(r=g()),void 0===t&&(t="en-US"),void 0===n&&(n="long");var o=new Date(e,Number(r)-1);return new Intl.DateTimeFormat(t,{month:n}).format(o)},months:function(e,r){void 0===e&&(e="en-US"),void 0===r&&(r="long");for(var t=[],n=Number((new Date).getFullYear()),o=0;o<=11;o++){var a={},u=new Date(n,o);a.value=d(Number(o)+1),a.text=new Intl.DateTimeFormat(e,{month:r}).format(u),t.push(a)}return t},years:function(e,r){void 0===e&&(e=(new Date).getFullYear()),void 0===r&&(r=5);for(var t=[],n=Number(e)-(Number(r)+1),o=Number(e)+Number(r),a=n;a<=o;a++)t.push(a);return t}}),M=Object.freeze({__proto__:null,separator:function(e,r,t,n){void 0===r&&(r=","),void 0===t&&(t=!1),void 0===n&&(n=2);var o="."===r?"de-DE":"en-US",a=String(new Intl.NumberFormat(o).format(Number(e)));if(!0===t){var u=String(Number(e));u=u.includes(".")?(u=Number(u).toFixed(n)).split(".")[1]:new Array(n).fill(0).join("");var i="."===r?",":".";a=(a=a.split(i)[0].trim())+i+u}return a},percentage:function(e,r,t){void 0===t&&(t=!1);var n=String(Math.round(100*(Number(e)/Number(r)-1)));return!0===t&&(n+="%"),n},unit:function(e,r,t){void 0===r&&(r=2),void 0===t&&(t="normal");var n=[{id:1,value:1,symbol:""},{id:2,value:1e3,symbol:"K"},{id:3,value:1e6,symbol:"M"},{id:4,value:1e9,symbol:"G"},{id:5,value:1e12,symbol:"T"},{id:6,value:1e15,symbol:"P"},{id:7,value:1e18,symbol:"E"},{id:8,value:1e21,symbol:"Z"},{id:9,value:1e24,symbol:"Y"}];"normal"!==t&&(n=n.map((function(e){return"decimal"===t?2===e.id&&(e.symbol="k"):"money"===t?4===e.id&&(e.symbol="B"):"binary"===t?1!==e.id&&(e.value=e.value+24*(e.id-1),e.symbol=e.symbol+"i"):"byte"===t&&1!==e.id&&(e.value=e.value+24*(e.id-1),e.symbol=e.symbol+"B"),e})));var o=n.slice().reverse().find((function(r){return Number(e)>=r.value}));return o?(Number(e)/o.value).toFixed(r).replace(/\.0+$|(\.[0-9]*[1-9])0+$/,"$1")+""+o.symbol:"0"},spaceBetween:function(e){return String(e).replace(/\d{4}(?=.)/g,"$& ")},roundOf:function(e){var r=[1,1e3,1e6,1e9,1e12,1e15,1e18,1e21,1e24].slice().reverse().find((function(r){return Number(e)>=r}));return Math.round(Number(e)/r)*r},between:function(e,r,t){void 0===t&&(t=!0);var n=t?Number(e)+1:Number(e),o=t?Number(r)-1:Number(r),a=Math.floor(Math.random()*Number(o));return a<=n&&(a=Number(n)+Number(a)),a},isBetween:function(e,r,t){var n=Number(e),o=Number(r),a=Number(t),u=!1;return n>=o&&n<=a&&(u=!0),u}}),S=Object.freeze({__proto__:null,remove:i,removeBy:l,removeByKey:c,removeByVal:f}),C=function(e,r){void 0===r&&(r="raw");var t=encodeURI(e);return"param"===r&&(t=encodeURIComponent(e)),t},D=function(e,r){void 0===r&&(r="raw");var t=decodeURI(e);return"param"===r&&(t=decodeURIComponent(e)),t},T=function(e,r){void 0===r&&(r="");var t=e;return t="multiple"===r?t.toLowerCase().replace(/\w\S*/g,(function(e){return e.replace(/^\w/,(function(e){return e.toUpperCase()}))})):"single"===r?t.toLowerCase().trimStart().replace(/^\w/,(function(e){return e.toUpperCase()})):t.trimStart().replace(/^\w/,(function(e){return e.toUpperCase()}))},_=Object.freeze({__proto__:null,urlEncode:C,urlDecode:D,urlEncodeAsync:function(e,r){return void 0===r&&(r="raw"),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(C(t,r))]}}))}))},urlDecodeAsync:function(e,r){return void 0===r&&(r="raw"),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(D(t,r))]}}))}))},uniqid:function(e){void 0===e&&(e=0);var r="",t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=String(Math.abs((new Date).valueOf()));Number(e)>=1&&(r+=String(Number(e)+1));for(var o=0;o<n.length;o++)r+=t.charAt(Math.floor(Math.random()*t.length)),r+=n.charAt(o);return r},random:function(e,r){void 0===e&&(e=11),void 0===r&&(r="");var t="",n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_~!@#$%^&*()+={}[]|:;<>,./?";"alphadash"===r?n=n.slice(0,64):"alphanumeric"===r?n=n.slice(0,62):"alpha"===r?n=n.slice(10,62):"hex"===r?n=n.slice(0,16):"numeric"===r&&(n=n.slice(0,10));for(var o=0;o<e;o++)t+=n.charAt(Math.floor(Math.random()*n.length));return t},capitalize:T,camelCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=T(r,"multiple")).trimStart().replace(/^\w/,(function(e){return e.toLowerCase()})).replaceAll(" ","")},pascalCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=T(r,"multiple")).replaceAll(" ","")},snakeCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=T(r,"multiple")).replaceAll(" ","").replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,r){return(r>0?"_":"")+e.toLowerCase()}))},kebabCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=T(r,"multiple")).replaceAll(" ","").replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,r){return(r>0?"-":"")+e.toLowerCase()}))},slug:function(e,r,t){void 0===r&&(r=0),void 0===t&&(t=0);var n=e.trim();return n=(n=n.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")).replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-"),Number(r)>0&&(n=n.slice(0,Number(r))),Number(t)>0&&(n=n+"-"+t),n}}),F=Object.freeze({__proto__:null,relative:function(e,r,t,n,o){void 0===r&&(r="utc"),void 0===t&&(t="en-US"),void 0===n&&(n={}),void 0===o&&(o="long");var a=new Date,u=new Date(e);"utc"!==r&&(u=new Date(new Date(e).toJSON()));var i=Math.round((u.valueOf()-a.valueOf())/1e3),l=new Intl.RelativeTimeFormat(t,n).format(i,"second");"short"===o&&(l="".concat(Math.abs(Math.round(i)),"s"));var c=i/31536e3;if(Math.abs(c)>1){var f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"year"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"y"))}else if(c=i/2592e3,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"month"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"mo"))}else if(c=i/86400,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"day"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"d"))}else if(c=i/3600,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"hour"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"h"))}else if(c=i/60,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"minute"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"m"))}return l},hoursInBetween:function(e,r){var t=new Date(e),n=new Date(r),o=Math.abs(Number(t.getTime())-Number(n.getTime()));return Number((o/36e5).toFixed(0))}});return e.array=v,e.date=A,e.number=M,e.object=S,e.string=_,e.time=F,Object.defineProperty(e,"__esModule",{value:!0}),e}({});

@@ -5,28 +5,2 @@ 'use strict';

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var doubleFormat = function (arg) {

@@ -66,3 +40,3 @@ var newStr = String(arg);

//newValue = newDate.toLocaleTimeString(locale, options)
newValue = new Intl.DateTimeFormat(locale, __assign({ timeStyle: 'medium' }, options)).format(newDate);
newValue = new Intl.DateTimeFormat(locale, options).format(newDate);
}

@@ -69,0 +43,0 @@ }

@@ -1,27 +0,1 @@

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var doubleFormat = function (arg) {

@@ -61,3 +35,3 @@ var newStr = String(arg);

//newValue = newDate.toLocaleTimeString(locale, options)
newValue = new Intl.DateTimeFormat(locale, __assign({ timeStyle: 'medium' }, options)).format(newDate);
newValue = new Intl.DateTimeFormat(locale, options).format(newDate);
}

@@ -64,0 +38,0 @@ }

@@ -1,15 +0,1 @@

var date=function(e){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},t.apply(this,arguments)},n=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t},r=function(e,r,o,a){void 0===r&&(r=""),void 0===o&&(o=""),void 0===a&&(a={});var u=new Date(e||null),c="".concat(u.getFullYear(),"-").concat(n(Number(u.getMonth())+1),"-").concat(n(u.getDate())," ").concat(n(u.getHours()),":").concat(n(u.getMinutes()),":").concat(n(u.getSeconds()));return""===o&&"UTC"===(null==a?void 0:a.timeZone)&&(c="".concat(u.getUTCFullYear(),"-").concat(n(Number(u.getUTCMonth())+1),"-").concat(n(u.getUTCDate())," ").concat(n(u.getUTCHours()),":").concat(n(u.getUTCMinutes()),":").concat(n(u.getUTCSeconds()))),"date"===r?(c="".concat(u.getFullYear(),"-").concat(n(Number(u.getMonth())+1),"-").concat(n(u.getDate())),""===o&&"UTC"===(null==a?void 0:a.timeZone)&&(c="".concat(u.getUTCFullYear(),"-").concat(n(Number(u.getUTCMonth())+1),"-").concat(n(u.getUTCDate()))),""!==o&&(c=new Intl.DateTimeFormat(o,a).format(u))):"time"===r?(c="".concat(n(u.getHours()),":").concat(n(u.getMinutes()),":").concat(n(u.getSeconds())),""===o&&"UTC"===(null==a?void 0:a.timeZone)&&(c="".concat(n(u.getUTCHours()),":").concat(n(u.getUTCMinutes()),":").concat(n(u.getUTCSeconds()))),""!==o&&(c=new Intl.DateTimeFormat(o,t({timeStyle:"medium"},a)).format(u))):""!==o&&(c=new Intl.DateTimeFormat(o,a).format(u)),c},o=function(e,t){var n=new Date(e).toJSON().split(/T|\./);return"date"===t?Number(n[0].replaceAll("-","")):"time"===t?Number(n[1].replaceAll(":","")):new Date(e).valueOf()},a=function(){return Number((new Date).getFullYear())},u=function(){return Number((new Date).getMonth())},c=function(e,t){void 0===e&&(e=a()),void 0===t&&(t=u());var n=Number(new Date(e,t,0).getDate());return[28,29,30,31].includes(n)?n:31},i=function(e,t){void 0===e&&(e=a()),void 0===t&&(t=u());for(var n=[],r=Number(new Date(e,Number(t)-1,1).getDay()),o=Number(r)-1;o>=0;o--)n.push(Number(new Date(e,Number(t)-1,Number("-"+o)).getDate()));return n},m=function(e,t){var n=Number(new Date(t).getMonth())-Number(new Date(e).getMonth()),r=12*(Number(new Date(t).getFullYear())-Number(new Date(e).getFullYear()));return Math.floor(n+r)};return e.daysInBetween=function(e,t,n){void 0===n&&(n="dateTime");var r=o(e,n),a=o(t,n),u=Number(a)-Number(r);return Math.floor(u/864e5)},e.daysInMonth=c,e.daysInYear=function(e){return void 0===e&&(e=a()),Number(e)%400==0||Number(e)%100!=0&&Number(e)%4==0?366:365},e.daysOfNextMonth=function(e,t){void 0===e&&(e=a()),void 0===t&&(t=u());var n=Number(new Date(e,Number(t)-1,c(e,t)).getDay()),r=6-Number(n),o=Number(c(e,t))+Number(i(e,t).length)+Number(r);return Number(r)+(42-Number(o))},e.daysOfPrevMonth=i,e.doubleFormat=n,e.format=r,e.isAfter=function(e,t,n){void 0===n&&(n="dateTime");var r=!1;return o(e,n)>o(t,n)&&(r=!0),r},e.isBefore=function(e,t,n){void 0===n&&(n="dateTime");var r=!1;return o(e,n)<o(t,n)&&(r=!0),r},e.isBetween=function(e,t,n,r){void 0===r&&(r="dateTime");var a=o(e,r),u=o(t,r),c=o(n,r),i=!1;return a>=u&&a<=c&&(i=!0),i},e.month=function(e,t,n,r){void 0===e&&(e=a()),void 0===t&&(t=u()),void 0===n&&(n="en-US"),void 0===r&&(r="long");var o=new Date(e,Number(t)-1);return new Intl.DateTimeFormat(n,{month:r}).format(o)},e.months=function(e,t){void 0===e&&(e="en-US"),void 0===t&&(t="long");for(var r=[],o=Number((new Date).getFullYear()),a=0;a<=11;a++){var u={},c=new Date(o,a);u.value=n(Number(a)+1),u.text=new Intl.DateTimeFormat(e,{month:t}).format(c),r.push(u)}return r},e.monthsInBetween=m,e.now=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n={});var o=new Date;return r(o,e,t,n)},e.years=function(e,t){void 0===e&&(e=(new Date).getFullYear()),void 0===t&&(t=5);for(var n=[],r=Number(e)-(Number(t)+1),o=Number(e)+Number(t),a=r;a<=o;a++)n.push(a);return n},e.yearsInBetween=function(e,t){return Math.floor(m(e,t)/12)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
var date=function(e){"use strict";var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t},n=function(e,n,r,o){void 0===n&&(n=""),void 0===r&&(r=""),void 0===o&&(o={});var a=new Date(e||null),u="".concat(a.getFullYear(),"-").concat(t(Number(a.getMonth())+1),"-").concat(t(a.getDate())," ").concat(t(a.getHours()),":").concat(t(a.getMinutes()),":").concat(t(a.getSeconds()));return""===r&&"UTC"===(null==o?void 0:o.timeZone)&&(u="".concat(a.getUTCFullYear(),"-").concat(t(Number(a.getUTCMonth())+1),"-").concat(t(a.getUTCDate())," ").concat(t(a.getUTCHours()),":").concat(t(a.getUTCMinutes()),":").concat(t(a.getUTCSeconds()))),"date"===n?(u="".concat(a.getFullYear(),"-").concat(t(Number(a.getMonth())+1),"-").concat(t(a.getDate())),""===r&&"UTC"===(null==o?void 0:o.timeZone)&&(u="".concat(a.getUTCFullYear(),"-").concat(t(Number(a.getUTCMonth())+1),"-").concat(t(a.getUTCDate()))),""!==r&&(u=new Intl.DateTimeFormat(r,o).format(a))):"time"===n?(u="".concat(t(a.getHours()),":").concat(t(a.getMinutes()),":").concat(t(a.getSeconds())),""===r&&"UTC"===(null==o?void 0:o.timeZone)&&(u="".concat(t(a.getUTCHours()),":").concat(t(a.getUTCMinutes()),":").concat(t(a.getUTCSeconds()))),""!==r&&(u=new Intl.DateTimeFormat(r,o).format(a))):""!==r&&(u=new Intl.DateTimeFormat(r,o).format(a)),u},r=function(e,t){var n=new Date(e).toJSON().split(/T|\./);return"date"===t?Number(n[0].replaceAll("-","")):"time"===t?Number(n[1].replaceAll(":","")):new Date(e).valueOf()},o=function(){return Number((new Date).getFullYear())},a=function(){return Number((new Date).getMonth())},u=function(e,t){void 0===e&&(e=o()),void 0===t&&(t=a());var n=Number(new Date(e,t,0).getDate());return[28,29,30,31].includes(n)?n:31},c=function(e,t){void 0===e&&(e=o()),void 0===t&&(t=a());for(var n=[],r=Number(new Date(e,Number(t)-1,1).getDay()),u=Number(r)-1;u>=0;u--)n.push(Number(new Date(e,Number(t)-1,Number("-"+u)).getDate()));return n},i=function(e,t){var n=Number(new Date(t).getMonth())-Number(new Date(e).getMonth()),r=12*(Number(new Date(t).getFullYear())-Number(new Date(e).getFullYear()));return Math.floor(n+r)};return e.daysInBetween=function(e,t,n){void 0===n&&(n="dateTime");var o=r(e,n),a=r(t,n),u=Number(a)-Number(o);return Math.floor(u/864e5)},e.daysInMonth=u,e.daysInYear=function(e){return void 0===e&&(e=o()),Number(e)%400==0||Number(e)%100!=0&&Number(e)%4==0?366:365},e.daysOfNextMonth=function(e,t){void 0===e&&(e=o()),void 0===t&&(t=a());var n=Number(new Date(e,Number(t)-1,u(e,t)).getDay()),r=6-Number(n),i=Number(u(e,t))+Number(c(e,t).length)+Number(r);return Number(r)+(42-Number(i))},e.daysOfPrevMonth=c,e.doubleFormat=t,e.format=n,e.isAfter=function(e,t,n){void 0===n&&(n="dateTime");var o=!1;return r(e,n)>r(t,n)&&(o=!0),o},e.isBefore=function(e,t,n){void 0===n&&(n="dateTime");var o=!1;return r(e,n)<r(t,n)&&(o=!0),o},e.isBetween=function(e,t,n,o){void 0===o&&(o="dateTime");var a=r(e,o),u=r(t,o),c=r(n,o),i=!1;return a>=u&&a<=c&&(i=!0),i},e.month=function(e,t,n,r){void 0===e&&(e=o()),void 0===t&&(t=a()),void 0===n&&(n="en-US"),void 0===r&&(r="long");var u=new Date(e,Number(t)-1);return new Intl.DateTimeFormat(n,{month:r}).format(u)},e.months=function(e,n){void 0===e&&(e="en-US"),void 0===n&&(n="long");for(var r=[],o=Number((new Date).getFullYear()),a=0;a<=11;a++){var u={},c=new Date(o,a);u.value=t(Number(a)+1),u.text=new Intl.DateTimeFormat(e,{month:n}).format(c),r.push(u)}return r},e.monthsInBetween=i,e.now=function(e,t,r){void 0===e&&(e=""),void 0===t&&(t=""),void 0===r&&(r={});var o=new Date;return n(o,e,t,r)},e.years=function(e,t){void 0===e&&(e=(new Date).getFullYear()),void 0===t&&(t=5);for(var n=[],r=Number(e)-(Number(t)+1),o=Number(e)+Number(t),a=r;a<=o;a++)n.push(a);return n},e.yearsInBetween=function(e,t){return Math.floor(i(e,t)/12)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
{
"name": "alga-js",
"version": "0.1.0-alpha-7",
"version": "0.1.0-alpha-8",
"description": "Alga.js is a JavaScript helper to help build UI components by using any of modern web frameworks or libraries",

@@ -5,0 +5,0 @@ "module": "./lib/alga.es.js",

@@ -28,3 +28,3 @@ import { doubleFormat } from './stringDate'

//newValue = newDate.toLocaleTimeString(locale, options)
newValue = new Intl.DateTimeFormat(locale, { timeStyle: 'medium', ...options }).format(newDate)
newValue = new Intl.DateTimeFormat(locale, options).format(newDate)
}

@@ -31,0 +31,0 @@ } else {