1
|
(self.webpackChunkdemo_armandphilippot_com=self.webpackChunkdemo_armandphilippot_com||[]).push([[787],{174:function(e,t,n){"use strict";function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function i(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var r,o,l,s,c,u,p,d,m,h=[{id:"bin2dec",name:"Bin2Dec",description:{en:"Convert a binary string to a decimal number.",fr:"Convertit un nombre binaire en un nombre décimal."},path:"./projects/js-small-apps/bin2dec/index.html",repo:[{name:"Github",url:"https://github.com/ArmandPhilippot/js-small-apps/tree/main/bin2dec"},{name:"Gitlab",url:"https://gitlab.com/ArmandPhilippot/js-small-apps/-/tree/main/bin2dec"}],technologies:["Vanilla Javascript"]},{id:"budget-app",name:"Budget App",description:{en:"By selecting a language in the initialization form, only the currency is converted (the app is not translated). Also, no data is saved on page reload.",fr:"En sélectionnant une langue dans le formulaire d'initialisation, seul le format des nombres change (l'application n'est pas traduite). Aucune donnée n'est conservée après rechargement de la page."},path:"./projects/js-small-apps/budget-app/index.html",repo:[{name:"Github",url:"https://github.com/ArmandPhilippot/js-small-apps/tree/main/budget-app"},{name:"Gitlab",url:"https://gitlab.com/ArmandPhilippot/js-small-apps/-/tree/main/budget-app"}],technologies:["Vanilla Javascript"]},{id:"calculator",name:"Calculator",description:{en:"A basic calculator. Decimal part is limited to 3 digits. The first part is limited to 8 digits. If the result does not respect these limits, you will see an error.",fr:"Une simple calculette. La partie décimale est limitée à 3 chiffres. La première partie est limitée à 8 chiffres. Si le résultat ne respecte pas ces limites, vous verrez une erreur."},path:"./projects/js-small-apps/calculator/index.html",repo:[{name:"Github",url:"https://github.com/ArmandPhilippot/js-small-apps/tree/main/calculator"},{name:"Gitlab",url:"https://gitlab.com/ArmandPhilippot/js-small-apps/-/tree/main/calculator"}],technologies:["Vanilla Javascript"]},{id:"clock",name:"Clock",description:{en:"What time is it? You can have the current hour in three formats: an analogic clock, a numeric display or a text.",fr:"Quelle heure est-il ? Vous pouvez voir l'heure actuelle dans trois formats différents : une horloge analogique, un affichage numérique et sous forme de texte."},path:"./projects/js-small-apps/clock/index.html",repo:[{name:"Github",url:"https://github.com/ArmandPhilippot/js-small-apps/tree/main/clock"},{name:"Gitlab",url:"https://gitlab.com/ArmandPhilippot/js-small-apps/-/tree/main/clock"}],technologies:["Vanilla Javascript","SVG"]},{id:"color-cycle",name:"Color cycle",description:{en:"Play with hexadecimal colors. Set a color, then choose one or more increment values and start the preview.",fr:"Jouez avec les couleurs hexadécimales. Définissez une couleur, puis choisissez une ou plusieurs valeurs d'incrémentation et démarrez l'aperçu."},path:"./projects/js-small-apps/color-cycle/index.html",repo:[{name:"Github",url:"https://github.com/ArmandPhilippot/js-small-apps/tree/main/color-cycle"},{name:"Gitlab",url:"https://gitlab.com/ArmandPhilippot/js-small-apps/-/tree/main/color-cycle"}],technologies:["Vanilla Javascript"]},{id:"css-border-previewer",name:"CSS Border Previewer",description:{en:"Play with CSS borders (style, width, radius). Then, you can copy the generated code if the preview suits you.",fr:"Jouez avec les bordures CSS (style, largeur, radius). Ensuite, vous pouvez copier le code généré si l'aperçu vous satisfait."},path:"./projects/js-small-apps/css-border-previewer/index.html",repo:[{name:"Github",url:"https://github.com/ArmandPhilippot/js-small-apps/tree/main/css-border-previewer"},{name:"Gitlab",url:"https://gitlab.com/ArmandPhilippot/js-small-apps/-/tree/main/css-border-previewer"}],technologies:["Vanilla Javascript"]},{id:"meme-generator",name:"Meme Generator",description:{en:"Choose a random image, set one or more texts then position them. Your meme is ready!",fr:"Choisissez une image aléatoire, définissez un ou plusieurs textes et positionnez-les. Votre meme est prêt !"},path:"./projects/react-small-apps/meme-generator/build/index.html",repo:[{name:"Github",url:"https://github.com/ArmandPhilippot/react-small-apps/tree/main/meme-generator"},{name:"Gitlab",url:"https://gitlab.com/ArmandPhilippot/react-small-apps/-/tree/main/meme-generator"}],technologies:["React","Fetch"]},{id:"notebook",name:"Notebook",description:{en:"Create as many pages as you want and fill them. You can define a title and a body. Then you can easily navigate between your pages with the nav.",fr:"Créez autant de pages que vous le souhaitez et remplissez-les. Vous pouvez définir un titre et un corps de texte. Ensuite, vous pouvez facilement naviguer entre vos pages grâce à la navigation."},path:"./projects/react-small-apps/notebook/build/",repo:[{name:"Github",url:"https://github.com/ArmandPhilippot/react-small-apps/tree/main/notebook"},{name:"Gitlab",url:"https://gitlab.com/ArmandPhilippot/react-small-apps/-/tree/main/notebook"}],technologies:["React","React router"]},{id:"rps-game",name:"Rock Paper Scissors",description:{en:"A basic implementation of the game. Try to beat your friend or the computer.",fr:"Une implémentation du jeu. Essayez de battre votre ami ou l'ordinateur."},path:"./projects/js-small-apps/rock-paper-scissors/index.html",repo:[{name:"Github",url:"https://github.com/ArmandPhilippot/js-small-apps/tree/main/rock-paper-scissors"},{name:"Gitlab",url:"https://gitlab.com/ArmandPhilippot/js-small-apps/-/tree/main/rock-paper-scissors"}],technologies:["Vanilla Javascript"]},{id:"todos",name:"Todos",description:{en:"You can add, remove or mark as done your todos. For each todos, you can add some details in addition to the title.\n\nLogin: demo@email.com\nPassword: demo",fr:'Vous pouvez ajouter, supprimer ou marquer comme fait vos "todo". Pour chaque "todo", vous pouvez ajouter des détails en plus du titre.\n\nLogin : demo@email.com\nMot de passe : demo'},path:"./projects/react-small-apps/todos/build/",repo:[{name:"Github",url:"https://github.com/ArmandPhilippot/react-small-apps/tree/main/todos"},{name:"Gitlab",url:"https://gitlab.com/ArmandPhilippot/react-small-apps/-/tree/main/todos"}],technologies:["React","React router","Redux"]},{id:"users-list",name:"Users list",description:{en:"You can see a list of username. By clicking on it, the next column display information about the selected user.",fr:"Vous pouvez voir une liste de noms d'utilisateur. En cliquant sur l'un d'eux, la colonne suivante affiche les informations à propos de cet utilisateur."},path:"./projects/js-small-apps/users-list/index.html",repo:[{name:"Github",url:"https://github.com/ArmandPhilippot/js-small-apps/tree/main/users-list"},{name:"Gitlab",url:"https://gitlab.com/ArmandPhilippot/js-small-apps/-/tree/main/users-list"}],technologies:["Vanilla Javascript","Fetch"]}],f=n(13),g=n.n(f),b=[{code:"en",label:"English",translations:{branding:{description:"Front-end developer"},nav:{title:"Apps list:"},main:{instructions:"Select an app inside menu to see a live preview and app details (description, technologies, repositories).",project:{details:{about:"About {{name}}",repo:{one:"Repository:",other:"Repositories:",zero:"Repositories:"},tech:{one:"Technology:",other:"Technologies:",zero:"Technologies:"}}}},footer:{legalNotice:{txt:"Legal notice",link:"legal-notice.php"},license:"License MIT"}}},{code:"fr",label:"Français",translations:{branding:{description:"Intégrateur web"},nav:{title:"Liste des applications :"},main:{instructions:"Sélectionnez une application dans le menu pour afficher un aperçu en direct et les informations sur l'application (description, technologies, dépôts).",project:{details:{about:"À propos de {{name}}",repo:{one:"Dépôt :",other:"Dépôts :",zero:"Dépôt :"},tech:{one:"Technologie :",other:"Technologies :",zero:"Technologie :"}}}},footer:{legalNotice:{txt:"Mentions légales",link:"mentions-legales.php"},license:"Licence MIT"}}}];function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return g().t(e,t)}function y(e){null==e||e.classList.remove("slide-out--left"),null==e||e.classList.remove("hide"),null==e||e.classList.add("slide-in--left")}function S(){return window.innerWidth<1200}function j(){[document.querySelector("header"),document.querySelector("footer")].forEach((function(e){e.classList.contains("hide")?y(e):function(e){null==e||e.classList.remove("slide-in--left"),null==e||e.classList.add("slide-out--left"),setTimeout((function(){null==e||e.classList.add("hide")}),800)}(e)}))}function L(){var e,t=document.querySelector(".project-details");t.classList.contains("hide")?(null==(e=t)||e.classList.remove("slide-out--bottom"),null==e||e.classList.remove("hide"),null==e||e.classList.add("slide-in--up")):function(e){null==e||e.classList.remove("slide-in--up"),null==e||e.classList.add("slide-out--bottom"),setTimeout((function(){null==e||e.classList.add("hide")}),800)}(t)}function _(){var e=document.querySelector(".btn--details"),t=window.location.hash;e.style.display=t?"":"none"}function k(){var e=document.querySelector("header"),t=document.querySelector("footer"),n=document.querySelector(".toolbar"),a=document.querySelector(".project-details");S()?(e.classList.add("hide"),t.classList.add("hide"),n.classList.remove("hide"),null==a||a.classList.add("hide"),null==a||a.classList.remove("fade-in")):(y(e),y(t),n.classList.add("hide"),null==a||a.classList.remove("hide"),null==a||a.classList.add("fade-in")),_()}function z(e){var t,n=document.createElement("div"),a=document.createElement("h2"),r=null!=e&&e.technologies?function(e){if(0===e.length)return[];var t=document.createElement("h3");t.classList.add("project-details__title"),t.textContent=v("main.project.details.tech",{count:e.length});var n=document.createElement("ul"),a=e.map((function(e){var t=document.createElement("li");return t.textContent=e,t}));return n.classList.add("list","list--tech"),n.append.apply(n,i(a)),[t,n]}(e.technologies):[],o=function(e){if(0===e.length)return[];var t=document.createElement("div"),n=document.createElement("h3"),a=document.createElement("ul"),r=e.map((function(e){return t=e.name,n=e.url,a=document.createElement("li"),i=document.createElement("a"),(r=document.createElement("span")).classList.add("screen-reader-text"),r.textContent=t,i.classList.add("list__link","list__link--".concat(t.toLocaleLowerCase())),i.href=n,i.appendChild(r),a.classList.add("list__item"),a.appendChild(i),a;var t,n,a,i,r}));return n.classList.add("project-details__title"),n.textContent=v("main.project.details.repo",{count:e.length}),a.classList.add("list","list--repos"),a.append.apply(a,i(r)),t.append(n,a),[n,a]}(e.repo),l=g().currentLocale();return e.description?((t=document.createElement("div")).classList.add("project-details__description"),t.textContent=e.description[l]||""):t="",a.classList.add("project-details__title"),a.textContent=v("main.project.details.about",{name:e.name}),n.classList.add("project-details"),S()||n.classList.add("fade-in"),n.replaceChildren.apply(n,[a,t].concat(i(r),i(o))),n}function A(e){var t=function(e){return h.find((function(t){return t.id===e}))}(e),n=document.querySelector(".main"),a=z(t),i=function(e){var t=document.createElement("div"),n=function(e){var t=document.createElement("iframe");return t.src=e,t}(e);return t.classList.add("project-preview","fade-in"),t.replaceChildren(n),t}(t.path),r=document.querySelector(".btn--details");S()&&a.classList.add("hide"),r.textContent=v("main.project.details.about",{name:t.name}),r.addEventListener("click",L),window.history.pushState({},t.name,"/#".concat(e)),document.title="".concat(t.name," | Demo | Armand Philippot"),n.replaceChildren(i,a)}function x(e){document.querySelectorAll(".nav__link").forEach((function(t){t.id===e?t.classList.add("nav__link--selected"):t.classList.remove("nav__link--selected")}))}b.forEach((function(e){g().translations[e.code]=e.translations})),g().defaultLocale,d=navigator.language,m=b.find((function(e){return d.startsWith(e.code)})),p=(null==m?void 0:m.code)||"en",g().locale=p,r=document.querySelector(".branding__description"),o=document.querySelector(".nav__label"),l=document.querySelector(".copyright__license"),s=document.querySelector(".instructions"),r.textContent=v("branding.description"),o.textContent=v("nav.title"),l.title=v("footer.license"),s&&(s.textContent=v("main.instructions")),(c=document.querySelector(".nav__link--legal")).href=v("footer.legalNotice.link"),c.textContent=v("footer.legalNotice.txt"),u=document.querySelector(".nav .nav__list"),h.forEach((function(e){var t=function(e,t){var n=document.createElement("li"),a=document.createElement("a");return a.classList.add("nav__link"),a.href="/#".concat(e),a.id=e,a.textContent=t,a.addEventListener("click",(function(t){t.preventDefault(),A(e),x(e),_(),S()&&j()})),n.classList.add("nav__item"),n.appendChild(a),n}(e.id,e.name);u.appendChild(t)})),k(),window.addEventListener("resize",k),document.querySelector(".btn--menu").addEventListener("click",j),function(){var e=window.location.hash;if(e){var t=e.replace("#","");A(t),x(t)}}()},13:function(e,t,n){var a,i;i=this,a=function(){return function(e){"use strict";var t=e&&e.I18n||{},n=Array.prototype.slice,a=function(e){return("0"+e.toString()).substr(-2)},i=function(e){var t=typeof e;return"function"===t||"object"===t},r=function(e){return"function"==typeof e},o=function(e){return null!=e},l=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)},s=function(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)},c=function(e){return!0===e||!1===e},u=function(e){return null===e},p=function(e,t,n){return void 0===n||0==+n?Math[e](t):(t=+t,n=+n,isNaN(t)||"number"!=typeof n||n%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))))},d=function(e,t){return r(e)?e(t):e},m=function(e,t){var n,a,i;for(n in t)t.hasOwnProperty(n)&&(a=t[n],"string"==typeof(i=a)||"[object String]"===Object.prototype.toString.call(i)||s(a)||c(a)||l(a)||u(a)?e[n]=a:(null==e[n]&&(e[n]={}),m(e[n],a)));return e},h={day_names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbr_day_names:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],month_names:[null,"January","February","March","April","May","June","July","August","September","October","November","December"],abbr_month_names:[null,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridian:["AM","PM"]},f={precision:3,separator:".",delimiter:",",strip_insignificant_zeros:!1},g={unit:"$",precision:2,format:"%u%n",sign_first:!0,delimiter:",",separator:"."},b={unit:"%",precision:3,format:"%n%u",separator:".",delimiter:""},v=[null,"kb","mb","gb","tb"],y={defaultLocale:"en",locale:"en",defaultSeparator:".",placeholder:/(?:\{\{|%\{)(.*?)(?:\}\}?)/gm,fallbacks:!1,translations:{},missingBehaviour:"message",missingTranslationPrefix:""};return t.reset=function(){var e;for(e in y)this[e]=y[e]},t.initializeOptions=function(){var e;for(e in y)o(this[e])||(this[e]=y[e])},t.initializeOptions(),t.locales={},t.locales.get=function(e){var n=this[e]||this[t.locale]||this.default;return r(n)&&(n=n(e)),!1===l(n)&&(n=[n]),n},t.locales.default=function(e){var n=[],a=[];return e&&n.push(e),!e&&t.locale&&n.push(t.locale),t.fallbacks&&t.defaultLocale&&n.push(t.defaultLocale),n.forEach((function(e){var n=e.split("-"),i=null,r=null;3===n.length?(i=[n[0],n[1]].join("-"),r=n[0]):2===n.length&&(i=n[0]),-1===a.indexOf(e)&&a.push(e),t.fallbacks&&[i,r].forEach((function(t){null!=t&&t!==e&&-1===a.indexOf(t)&&a.push(t)}))})),n.length||n.push("en"),a},t.pluralization={},t.pluralization.get=function(e){return this[e]||this[t.locale]||this.default},t.pluralization.default=function(e){switch(e){case 0:return["zero","other"];case 1:return["one"];default:return["other"]}},t.currentLocale=function(){return this.locale||this.defaultLocale},t.isSet=o,t.lookup=function(e,t){t=t||{};var n,a,i,r,l=this.locales.get(t.locale).slice();for(i=this.getFullScope(e,t);l.length;)if(n=l.shift(),a=i.split(t.separator||this.defaultSeparator),r=this.translations[n]){for(;a.length&&null!=(r=r[a.shift()]););if(null!=r)return r}if(o(t.defaultValue))return d(t.defaultValue,e)},t.pluralizationLookupWithoutFallback=function(e,t,n){var a,r,l=this.pluralization.get(t)(e);if(i(n))for(;l.length;)if(a=l.shift(),o(n[a])){r=n[a];break}return r},t.pluralizationLookup=function(e,t,n){n=n||{};var a,r,l,s,c=this.locales.get(n.locale).slice();for(t=this.getFullScope(t,n);c.length;)if(a=c.shift(),r=t.split(n.separator||this.defaultSeparator),l=this.translations[a]){for(;r.length&&(l=l[r.shift()],i(l));)0===r.length&&(s=this.pluralizationLookupWithoutFallback(e,a,l));if(null!=s)break}return null==s&&o(n.defaultValue)&&(s=i(n.defaultValue)?this.pluralizationLookupWithoutFallback(e,n.locale,n.defaultValue):n.defaultValue,l=n.defaultValue),{message:s,translations:l}},t.meridian=function(){var e=this.lookup("time"),t=this.lookup("date");return e&&e.am&&e.pm?[e.am,e.pm]:t&&t.meridian?t.meridian:h.meridian},t.prepareOptions=function(){for(var e,t=n.call(arguments),a={};t.length;)if("object"==typeof(e=t.shift()))for(var i in e)e.hasOwnProperty(i)&&(o(a[i])||(a[i]=e[i]));return a},t.createTranslationOptions=function(e,t){var n=[{scope:e}];return o(t.defaults)&&(n=n.concat(t.defaults)),o(t.defaultValue)&&n.push({message:t.defaultValue}),n},t.translate=function(e,t){t=t||{};var n,a=this.createTranslationOptions(e,t),r=e,s=this.prepareOptions(t);return delete s.defaultValue,a.some((function(t){if(o(t.scope)?(r=t.scope,n=this.lookup(r,s)):o(t.message)&&(n=d(t.message,e)),null!=n)return!0}),this)?("string"==typeof n?n=this.interpolate(n,t):l(n)?n=n.map((function(e){return"string"==typeof e?this.interpolate(e,t):e}),this):i(n)&&o(t.count)&&(n=this.pluralize(t.count,r,t)),n):this.missingTranslation(e,t)},t.interpolate=function(e,t){if(null==e)return e;t=t||{};var n,a,i,r,l=e.match(this.placeholder);if(!l)return e;for(;l.length;)i=(n=l.shift()).replace(this.placeholder,"$1"),a=o(t[i])?t[i].toString().replace(/\$/gm,"_#$#_"):i in t?this.nullPlaceholder(n,e,t):this.missingPlaceholder(n,e,t),r=new RegExp(n.replace(/{/gm,"\\{").replace(/}/gm,"\\}")),e=e.replace(r,a);return e.replace(/_#\$#_/g,"$")},t.pluralize=function(e,t,n){var a,i;return n=this.prepareOptions({count:String(e)},n),void 0===(i=this.pluralizationLookup(e,t,n)).translations||null==i.translations?this.missingTranslation(t,n):void 0!==i.message&&null!=i.message?this.interpolate(i.message,n):(a=this.pluralization.get(n.locale),this.missingTranslation(t+"."+a(e)[0],n))},t.missingTranslation=function(e,t){if("guess"===this.missingBehaviour){var n=e.split(".").slice(-1)[0];return(this.missingTranslationPrefix.length>0?this.missingTranslationPrefix:"")+n.replace(/_/g," ").replace(/([a-z])([A-Z])/g,(function(e,t,n){return t+" "+n.toLowerCase()}))}return'[missing "'+[null!=t&&null!=t.locale?t.locale:this.currentLocale(),this.getFullScope(e,t)].join(t.separator||this.defaultSeparator)+'" translation]'},t.missingPlaceholder=function(e,t,n){return"[missing "+e+" value]"},t.nullPlaceholder=function(){return t.missingPlaceholder.apply(t,arguments)},t.toNumber=function(e,t){t=this.prepareOptions(t,this.lookup("number.format"),f);var n,a,i=e<0,r=function(e,t){return p("round",e,-t).toFixed(t)}(Math.abs(e),t.precision).toString().split("."),o=[],l=t.format||"%n",s=i?"-":"";for(e=r[0],n=r[1];e.length>0;)o.unshift(e.substr(Math.max(0,e.length-3),3)),e=e.substr(0,e.length-3);return a=o.join(t.delimiter),t.strip_insignificant_zeros&&n&&(n=n.replace(/0+$/,"")),t.precision>0&&n&&(a+=t.separator+n),(l=t.sign_first?"%s"+l:l.replace("%n","%s%n")).replace("%u",t.unit).replace("%n",a).replace("%s",s)},t.toCurrency=function(e,t){return t=this.prepareOptions(t,this.lookup("number.currency.format",t),this.lookup("number.format",t),g),this.toNumber(e,t)},t.localize=function(e,t,n){switch(n||(n={}),e){case"currency":return this.toCurrency(t,n);case"number":return e=this.lookup("number.format",n),this.toNumber(t,e);case"percentage":return this.toPercentage(t,n);default:var a;return a=e.match(/^(date|time)/)?this.toTime(e,t,n):t.toString(),this.interpolate(a,n)}},t.parseDate=function(e){var t,n,a;if(null==e)return e;if("object"==typeof e)return e;if(t=e.toString().match(/(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}):(\d{2})([\.,]\d{1,3})?)?(Z|\+00:?00)?/)){for(var i=1;i<=6;i++)t[i]=parseInt(t[i],10)||0;t[2]-=1,a=t[7]?1e3*("0"+t[7]):null,n=t[8]?new Date(Date.UTC(t[1],t[2],t[3],t[4],t[5],t[6],a)):new Date(t[1],t[2],t[3],t[4],t[5],t[6],a)}else"number"==typeof e?(n=new Date).setTime(e):e.match(/([A-Z][a-z]{2}) ([A-Z][a-z]{2}) (\d+) (\d+:\d+:\d+) ([+-]\d+) (\d+)/)?(n=new Date).setTime(Date.parse([RegExp.$1,RegExp.$2,RegExp.$3,RegExp.$6,RegExp.$4,RegExp.$5].join(" "))):(e.match(/\d+ \d+:\d+:\d+ [+-]\d+ \d+/),(n=new Date).setTime(Date.parse(e)));return n},t.strftime=function(e,n,i){i=this.lookup("date",i);var r=t.meridian();if(i||(i={}),i=this.prepareOptions(i,h),isNaN(e.getTime()))throw new Error("I18n.strftime() requires a valid date object, but received an invalid date.");var o=e.getDay(),l=e.getDate(),s=e.getFullYear(),c=e.getMonth()+1,u=e.getHours(),p=u,d=u>11?1:0,m=e.getSeconds(),f=e.getMinutes(),g=e.getTimezoneOffset(),b=Math.floor(Math.abs(g/60)),v=Math.abs(g)-60*b,y=(g>0?"-":"+")+(b.toString().length<2?"0"+b:b)+(v.toString().length<2?"0"+v:v);return p>12?p-=12:0===p&&(p=12),(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n.replace("%a",i.abbr_day_names[o])).replace("%A",i.day_names[o])).replace("%b",i.abbr_month_names[c])).replace("%B",i.month_names[c])).replace("%d",a(l))).replace("%e",l)).replace("%-d",l)).replace("%H",a(u))).replace("%-H",u)).replace("%k",u)).replace("%I",a(p))).replace("%-I",p)).replace("%l",p)).replace("%m",a(c))).replace("%-m",c)).replace("%M",a(f))).replace("%-M",f)).replace("%p",r[d])).replace("%P",r[d].toLowerCase())).replace("%S",a(m))).replace("%-S",m)).replace("%w",o)).replace("%y",a(s))).replace("%-y",a(s).replace(/^0+/,""))).replace("%Y",s)).replace("%z",y)).replace("%Z",y)},t.toTime=function(e,t,n){var a=this.parseDate(t),i=this.lookup(e,n);if(null==a)return a;var r=a.toString();return r.match(/invalid/i)?r:i?this.strftime(a,i,n):r},t.toPercentage=function(e,t){return t=this.prepareOptions(t,this.lookup("number.percentage.format",t),this.lookup("number.format",t),b),this.toNumber(e,t)},t.toHumanSize=function(e,t){for(var n,a,i,r=e,o=0;r>=1024&&o<4;)r/=1024,o+=1;return 0===o?(i=this.getFullScope("number.human.storage_units.units.byte",t),n=this.t(i,{count:r}),a=0):(i=this.getFullScope("number.human.storage_units.units."+v[o],t),n=this.t(i),a=r-Math.floor(r)==0?0:1),t=this.prepareOptions(t,{unit:n,precision:a,format:"%n%u",delimiter:""}),this.toNumber(r,t)},t.getFullScope=function(e,t){return t=t||{},l(e)&&(e=e.join(t.separator||this.defaultSeparator)),t.scope&&(e=[t.scope,e].join(t.separator||this.defaultSeparator)),e},t.extend=function(e,t){return void 0===e&&void 0===t?{}:m(e,t)},t.t=t.translate.bind(t),t.l=t.localize.bind(t),t.p=t.pluralize.bind(t),t}(i)}.call(t,n,t,e),void 0===a||(e.exports=a)}},function(e){e(e.s=174)}]);
|