paliari-js-utils
Advanced tools
Comparing version 0.2.18 to 0.2.19
@@ -1,1 +0,1 @@ | ||
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=6)}([function(t,e,n){"use strict";n.r(e);n(5),n(4),n(3),n(2),n(1);var r=function(t){return new Promise(function(e,n){var r=document.createElement("script");r.type="text/javascript",r.src=t,r.onload=function(){e(),r.remove()},r.onerror=function(t){return n(t)},document.body.appendChild(r)})},o=function(t,e){return String(e).split(".").forEach(function(e){if(!t)return t;t=t[e]}),t};function i(t){return(i="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})(t)}var u=function(t){return null!==t&&"object"===i(t)},c=function(t){return Object.prototype.toString.call(t).slice(8,-1)},a=function(t){return"[object Object]"===Object.prototype.toString.call(t)},f={"à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ő":"o","ù":"u","ú":"u","û":"u","ü":"u","ű":"u","ý":"y","ÿ":"y"},l=function(t){return t&&(t=(t=t.toLocaleLowerCase()).replace(/[^a-z0-9\s_-]/g,function(t){return f[t]||t.replace(/\W/," ")})),t},s=function(t){return"[object Date]"===Object.prototype.toString.call(t)},d=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},p=function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},h=function(t){return u(t)?function t(e){if(s(e))return new Date(e);if(d(e))return e;var n=Array.isArray(e)?[]:{};return Object.keys(e).forEach(function(r){n[r]=u(e[r])?t(e[r]):e[r]}),n}(t):t};function y(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var g=function t(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];if(!r.length)return e;var i=r.shift();return u(e)&&u(i)&&Object.keys(i).forEach(function(n){u(i[n])?(e[n]||Object.assign(e,y({},n,{})),t(e[n],i[n])):Object.assign(e,y({},n,i[n]))}),t.apply(void 0,[e].concat(r))},m=function(t){return function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return Object.getOwnPropertyNames(e).reduce(function(r,i){return o.push(i),a(e[i])?t(e[i],n,r,o):r[o.join(n)]=e[i],o.pop(),r},r)}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/")},v="aiCOVlB8Ws3ZSMyJ64dwtqAI5TDG1ejgcFH2YfXErxbRKhzo90pvUPNnL7umkQ",b={};v.split("").sort().forEach(function(t,e){b[v.charAt(e)]=t});var w=function(t){if(!t)return t;var e="";return t.split("").forEach(function(t){e+=b[t]||t}),e},_=[100,200,500,750],j=function(t){return _.find(function(e){if(t<=e)return e})},S=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=0,r=0;Object.keys(t).forEach(function(e){r+=Number(e)*t[e],n+=t[e]});var o=Math.pow(10,e);return n?Math.round(r/n*o)/o:0},O=function(t){return t.replace(/-/g,"_").replace(/\//g,".").toLocaleLowerCase()},E=function(t,e){return function t(e,n){return a(n)&&a(e)?Object.keys(n).reduce(function(r,o){return void 0!==e[o]&&(r[o]=a(n[o])?t(e[o],n[o]):e[o]),r},{}):e}(t,e)},k=function(t,e,n){if(!e||!n)throw{message:"Locale not found!",code:"locale_not_found"};return"".concat(l(t),"_").concat(l(e),"_").concat(l(n)).replace(/ /g,"_")},A=function(t,e){return t.find(function(t){return t.types.includes(e)})||{}},x=function(t){return k(A(t,"country").short_name,A(t,"administrative_area_level_1").short_name,A(t,"administrative_area_level_2").long_name)},L=function(t){if(!t.address_components)throw{code:"convert_place_no_address_componentes"};var e={};return e.geometry={viewport:{northeast:{lat:t.geometry.viewport.ma.l,lng:t.geometry.viewport.ga.l},southwest:{lat:t.geometry.viewport.ma.j,lng:t.geometry.viewport.ga.j}},location:{lat:t.geometry.location.lat(),lng:t.geometry.location.lng()}},e.formatted_address=t.formatted_address,e.place_id=t.place_id,e.cidade_id=x(t.address_components),e},P=function(t,e){return t.find(function(t){return t.types.includes(e)})||{}},C=function(t){return"".concat(P(t,"administrative_area_level_2").long_name," - ").concat(P(t,"administrative_area_level_1").short_name," - ").concat(P(t,"country").long_name)},M=function(){return function(t){return"desc"===t?9999999999999-Date.now():Date.now()}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"desc").toString()+Math.random().toString().substr(2,7)},F="zyxwvutsrqponmlkjihgfedcba_ZYXWVUTSRQPONMLKJIHGFEDCBA9876543210-",I=0,D=[],R=function(){var t=Date.now(),e=t===I;I=t;for(var n=new Array(8),r=7;r>=0;r--)n[r]=F.charAt(t%64),t=Math.floor(t/64);if(0!==t)throw new Error("We should have converted the entire timestamp.");var o=n.join("");if(e){for(r=11;r>=0&&63===D[r];r--)D[r]=0;D[r]++}else for(r=0;r<12;r++)D[r]=Math.floor(64*Math.random());for(r=0;r<12;r++)o+=F.charAt(D[r]);if(20!=o.length)throw new Error("Length should be 20.");return o},T=function(t){for(var e=0,n=0;n<8;n++){var r=F.indexOf(t.charAt(n));if(-1===r)throw new Error("Invalid id!");e=64*e+r}return e},N=function t(e,n){var r=e.split(""),o=r.pop(),i=n[n.indexOf(o)+1];return i?r.join("")+i:t(r.join(""),n)+n[0]},z=function(t){return N(t,F.split(""))},J=function(t){return N(t,F.split("").sort())},G={items:{},setItem:function(t,e){this.items[t]=e,localStorage.setItem(t,JSON.stringify(e))},getItem:function(t){if(void 0===this.items[t]){var e=localStorage.getItem(t);this.items[t]=e?JSON.parse(e):""}return this.items[t]},removeItem:function(t){delete this.items[t],localStorage.removeItem(t)},clear:function(){this.items={},localStorage.clear()}};function K(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var W=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Object.keys(e).forEach(function(t){"function"==typeof e[t]?n[t]=null===r[t]?null:e[t](r[t]):n[t]=r[t]||e[t]})}return function(t,e,n){e&&K(t.prototype,e),n&&K(t,n)}(t,[{key:"sanitize",value:function(t){return E(this,t)}},{key:"_liteRules",value:function(){throw new Error("Lite Rules not defined!")}},{key:"lite",value:function(){return this.sanitize(this._liteRules())}}]),t}();function B(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var H="pt_br",U=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:H;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.locales=e,this.locale=n}return function(t,e,n){e&&B(t.prototype,e),n&&B(t,n)}(t,[{key:"t",value:function(t,e){return function(t,e){return t&&e?(Object.keys(e).forEach(function(n){t=t.replace(new RegExp("%{"+n+"}","g"),e[n])}),t):t}(o(this.current,t),e)}},{key:"setLocale",value:function(t){if(this.getAvailableLocales().includes(t))return this.locale=t,this;throw new Error("Locale not found!")}},{key:"getLocale",value:function(){return this.locale}},{key:"getAvailableLocales",value:function(){return Object.keys(this.locales)}},{key:"current",get:function(){return this.locales[this.locale]}}]),t}();function q(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){Q(t,e,n[e])})}return t}function Q(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var X="current_locale",Y=function(t){var e=localStorage.getItem(X)||window.navigator.language.toLowerCase().replace("-","_");return t.getAvailableLocales().includes(e)?e:(e=e.substr(0,2),t.getAvailableLocales().includes(e)?e:H)},Z=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.i18n=e,this.fecha=n,this.current=Y(e)}return function(t,e,n){e&&V(t.prototype,e),n&&V(t,n)}(t,[{key:"reset",value:function(t){t!==this.current&&(this.current=t)}},{key:"current",set:function(t){localStorage.setItem(X,t),this.i18n.setLocale(t),this.fecha&&(this.fecha.i18n=q({},this.fecha.i18n,this.i18n.t("date_time.names")),this.fecha.masks=q({},this.fecha.masks,this.i18n.t("date_time.formats")))},get:function(){return localStorage.getItem(X)}}]),t}();n.d(e,"asyncJs",function(){return r}),n.d(e,"deepKey",function(){return o}),n.d(e,"isObject",function(){return u}),n.d(e,"getClassName",function(){return c}),n.d(e,"isHash",function(){return a}),n.d(e,"transliterate",function(){return l}),n.d(e,"isDate",function(){return s}),n.d(e,"isRegExp",function(){return d}),n.d(e,"ucfirst",function(){return p}),n.d(e,"deepClone",function(){return h}),n.d(e,"deepMerge",function(){return g}),n.d(e,"flattenObject",function(){return m}),n.d(e,"jsEncode",function(){return w}),n.d(e,"thumbRange",function(){return j}),n.d(e,"starRating",function(){return S}),n.d(e,"prepareKey",function(){return O}),n.d(e,"convertPlace",function(){return L}),n.d(e,"idCidade",function(){return k}),n.d(e,"idCidadeAddressComponent",function(){return x}),n.d(e,"nomeCidadeAddressComponent",function(){return C}),n.d(e,"idGeneratorDesc",function(){return R}),n.d(e,"idGeneratorNumeric",function(){return M}),n.d(e,"idDescTimestamp",function(){return T}),n.d(e,"prevId",function(){return z}),n.d(e,"nextId",function(){return J}),n.d(e,"BaseModel",function(){return W}),n.d(e,"I18n",function(){return U}),n.d(e,"Language",function(){return Z}),n.d(e,"sanitize",function(){return E}),n.d(e,"LocalStorageFacade",function(){return G})},function(t,e){String.prototype.trimStart||(String.prototype.trimStart=function(){return this.replace(/^[\s\uFEFF\xA0]+/,"")},String.prototype.trimLeft=String.prototype.trimStart)},function(t,e){String.prototype.trimEnd||(String.prototype.trimEnd=function(){return this.replace(/[\s\uFEFF\xA0]+$/,"")},String.prototype.trimRight=String.prototype.trimEnd)},function(t,e){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})},function(t,e){String.prototype.includes||(String.prototype.includes=function(){return-1!==String.prototype.indexOf.apply(this,arguments)})},function(t,e){Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(t,e){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),r=n.length>>>0;if(0===r)return!1;for(var o=0|e,i=Math.max(o>=0?o:r-Math.abs(o),0);i<r;){if(n[i]===t)return!0;i++}return!1}})},function(t,e,n){t.exports=n(0)}]); | ||
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=6)}([function(t,e,n){"use strict";n.r(e);n(5),n(4),n(3),n(2),n(1);var r=function(t){return new Promise(function(e,n){var r=document.createElement("script");r.type="text/javascript",r.src=t,r.onload=function(){e(),r.remove()},r.onerror=function(t){return n(t)},document.body.appendChild(r)})},o=function(t,e){return String(e).split(".").forEach(function(e){if(!t)return t;t=t[e]}),t};function i(t){return(i="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})(t)}var u=function(t){return null!==t&&"object"===i(t)},c=function(t){return Object.prototype.toString.call(t).slice(8,-1)},a=function(t){return"[object Object]"===Object.prototype.toString.call(t)},f={"à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ő":"o","ù":"u","ú":"u","û":"u","ü":"u","ű":"u","ý":"y","ÿ":"y"},l=function(t){return t&&(t=(t=t.toLocaleLowerCase()).replace(/[^a-z0-9\s_-]/g,function(t){return f[t]||t.replace(/\W/," ")})),t},s=function(t){return"[object Date]"===Object.prototype.toString.call(t)},d=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},p=function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},h=function(t){return u(t)?function t(e){if(s(e))return new Date(e);if(d(e))return e;var n=Array.isArray(e)?[]:{};return Object.keys(e).forEach(function(r){n[r]=u(e[r])?t(e[r]):e[r]}),n}(t):t};function y(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var g=function t(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];if(!r.length)return e;var i=r.shift();return u(e)&&u(i)&&Object.keys(i).forEach(function(n){u(i[n])?(e[n]||Object.assign(e,y({},n,{})),t(e[n],i[n])):Object.assign(e,y({},n,i[n]))}),t.apply(void 0,[e].concat(r))},m=function(t){return function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return Object.getOwnPropertyNames(e).reduce(function(r,i){return o.push(i),a(e[i])?t(e[i],n,r,o):r[o.join(n)]=e[i],o.pop(),r},r)}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/")},v="aiCOVlB8Ws3ZSMyJ64dwtqAI5TDG1ejgcFH2YfXErxbRKhzo90pvUPNnL7umkQ",b={};v.split("").sort().forEach(function(t,e){b[v.charAt(e)]=t});var w=function(t){if(!t)return t;var e="";return t.split("").forEach(function(t){e+=b[t]||t}),e},_=[100,200,500,750],j=function(t){return _.find(function(e){if(t<=e)return e})},S=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=0,r=0;Object.keys(t).forEach(function(e){r+=Number(e)*t[e],n+=t[e]});var o=Math.pow(10,e);return n?Math.round(r/n*o)/o:0},O=function(t){return t.replace(/-/g,"_").replace(/\//g,".").toLocaleLowerCase()},E=function(t,e){return function t(e,n){return a(n)&&a(e)?Object.keys(n).reduce(function(r,o){return void 0!==e[o]&&(r[o]=a(n[o])?t(e[o],n[o]):e[o]),r},{}):e}(t,e)},k=function(t,e,n){if(!e||!n)throw{message:"Locale not found!",code:"locale_not_found"};return"".concat(l(t),"_").concat(l(e),"_").concat(l(n)).replace(/ /g,"_")},A=function(t,e){return t.find(function(t){return t.types.includes(e)})||{}},x=function(t){return k(A(t,"country").short_name,A(t,"administrative_area_level_1").short_name,A(t,"administrative_area_level_2").long_name)},L=function(t){if(!t.address_components)throw{code:"convert_place_no_address_componentes"};var e={};return e.geometry={viewport:{northeast:{lat:t.geometry.viewport.ma.l,lng:t.geometry.viewport.ga.l},southwest:{lat:t.geometry.viewport.ma.j,lng:t.geometry.viewport.ga.j}},location:{lat:t.geometry.location.lat(),lng:t.geometry.location.lng()}},e.formatted_address=t.formatted_address,e.place_id=t.place_id,e.cidade_id=x(t.address_components),e},P=function(t,e){return t.find(function(t){return t.types.includes(e)})||{}},C=function(t){return"".concat(P(t,"administrative_area_level_2").long_name," - ").concat(P(t,"administrative_area_level_1").short_name," - ").concat(P(t,"country").long_name)},M=function(){return function(t){return"desc"===t?9999999999999-Date.now():Date.now()}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"desc").toString()+Math.random().toString().substr(2,7)},F="zyxwvutsrqponmlkjihgfedcba_ZYXWVUTSRQPONMLKJIHGFEDCBA9876543210-",I=0,D=[],R=function(){var t=Date.now(),e=t===I;I=t;for(var n=new Array(8),r=7;r>=0;r--)n[r]=F.charAt(t%64),t=Math.floor(t/64);if(0!==t)throw new Error("We should have converted the entire timestamp.");var o=n.join("");if(e){for(r=11;r>=0&&63===D[r];r--)D[r]=0;D[r]++}else for(r=0;r<12;r++)D[r]=Math.floor(64*Math.random());for(r=0;r<12;r++)o+=F.charAt(D[r]);if(20!=o.length)throw new Error("Length should be 20.");return o},T=function(t){for(var e=0,n=0;n<8;n++){var r=F.indexOf(t.charAt(n));if(-1===r)throw new Error("Invalid id!");e=64*e+r}return e},N=function t(e,n){var r=e.split(""),o=r.pop(),i=n[n.indexOf(o)+1];return i?r.join("")+i:t(r.join(""),n)+n[0]},z=function(t){return N(t,F.split(""))},J=function(t){return N(t,F.split("").sort())},G={items:{},setItem:function(t,e){this.items[t]=e,localStorage.setItem(t,JSON.stringify(e))},getItem:function(t){if(void 0===this.items[t]){var e=localStorage.getItem(t);this.items[t]=e?JSON.parse(e):""}return this.items[t]},removeItem:function(t){delete this.items[t],localStorage.removeItem(t)},clear:function(){this.items={},localStorage.clear()}};function K(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var W=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Object.keys(e).forEach(function(t){"function"==typeof e[t]?n[t]=null===r[t]?null:e[t](r[t]):n[t]=void 0===r[t]?e[t]:r[t]})}return function(t,e,n){e&&K(t.prototype,e),n&&K(t,n)}(t,[{key:"sanitize",value:function(t){return E(this,t)}},{key:"_liteRules",value:function(){throw new Error("Lite Rules not defined!")}},{key:"lite",value:function(){return this.sanitize(this._liteRules())}}]),t}();function B(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var H="pt_br",U=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:H;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.locales=e,this.locale=n}return function(t,e,n){e&&B(t.prototype,e),n&&B(t,n)}(t,[{key:"t",value:function(t,e){return function(t,e){return t&&e?(Object.keys(e).forEach(function(n){t=t.replace(new RegExp("%{"+n+"}","g"),e[n])}),t):t}(o(this.current,t),e)}},{key:"setLocale",value:function(t){if(this.getAvailableLocales().includes(t))return this.locale=t,this;throw new Error("Locale not found!")}},{key:"getLocale",value:function(){return this.locale}},{key:"getAvailableLocales",value:function(){return Object.keys(this.locales)}},{key:"current",get:function(){return this.locales[this.locale]}}]),t}();function q(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){Q(t,e,n[e])})}return t}function Q(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var X="current_locale",Y=function(t){var e=localStorage.getItem(X)||window.navigator.language.toLowerCase().replace("-","_");return t.getAvailableLocales().includes(e)?e:(e=e.substr(0,2),t.getAvailableLocales().includes(e)?e:H)},Z=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.i18n=e,this.fecha=n,this.current=Y(e)}return function(t,e,n){e&&V(t.prototype,e),n&&V(t,n)}(t,[{key:"reset",value:function(t){t!==this.current&&(this.current=t)}},{key:"current",set:function(t){localStorage.setItem(X,t),this.i18n.setLocale(t),this.fecha&&(this.fecha.i18n=q({},this.fecha.i18n,this.i18n.t("date_time.names")),this.fecha.masks=q({},this.fecha.masks,this.i18n.t("date_time.formats")))},get:function(){return localStorage.getItem(X)}}]),t}();n.d(e,"asyncJs",function(){return r}),n.d(e,"deepKey",function(){return o}),n.d(e,"isObject",function(){return u}),n.d(e,"getClassName",function(){return c}),n.d(e,"isHash",function(){return a}),n.d(e,"transliterate",function(){return l}),n.d(e,"isDate",function(){return s}),n.d(e,"isRegExp",function(){return d}),n.d(e,"ucfirst",function(){return p}),n.d(e,"deepClone",function(){return h}),n.d(e,"deepMerge",function(){return g}),n.d(e,"flattenObject",function(){return m}),n.d(e,"jsEncode",function(){return w}),n.d(e,"thumbRange",function(){return j}),n.d(e,"starRating",function(){return S}),n.d(e,"prepareKey",function(){return O}),n.d(e,"convertPlace",function(){return L}),n.d(e,"idCidade",function(){return k}),n.d(e,"idCidadeAddressComponent",function(){return x}),n.d(e,"nomeCidadeAddressComponent",function(){return C}),n.d(e,"idGeneratorDesc",function(){return R}),n.d(e,"idGeneratorNumeric",function(){return M}),n.d(e,"idDescTimestamp",function(){return T}),n.d(e,"prevId",function(){return z}),n.d(e,"nextId",function(){return J}),n.d(e,"BaseModel",function(){return W}),n.d(e,"I18n",function(){return U}),n.d(e,"Language",function(){return Z}),n.d(e,"sanitize",function(){return E}),n.d(e,"LocalStorageFacade",function(){return G})},function(t,e){String.prototype.trimStart||(String.prototype.trimStart=function(){return this.replace(/^[\s\uFEFF\xA0]+/,"")},String.prototype.trimLeft=String.prototype.trimStart)},function(t,e){String.prototype.trimEnd||(String.prototype.trimEnd=function(){return this.replace(/[\s\uFEFF\xA0]+$/,"")},String.prototype.trimRight=String.prototype.trimEnd)},function(t,e){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})},function(t,e){String.prototype.includes||(String.prototype.includes=function(){return-1!==String.prototype.indexOf.apply(this,arguments)})},function(t,e){Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(t,e){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),r=n.length>>>0;if(0===r)return!1;for(var o=0|e,i=Math.max(o>=0?o:r-Math.abs(o),0);i<r;){if(n[i]===t)return!0;i++}return!1}})},function(t,e,n){t.exports=n(0)}]); |
{ | ||
"name": "paliari-js-utils", | ||
"version": "0.2.18", | ||
"version": "0.2.19", | ||
"description": "Biblioteca de utilidades para JS", | ||
@@ -5,0 +5,0 @@ "main": "dist/paliari-js-utils.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23976