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,EAAMO,OAASd,EAAEmG,OAAO,CAAC,EAAGhG,KAAKW,QACjCP,EAAMU,SAAWA,EAASd,KAAKW,QAC/BX,KAAK8F,IAAI4C,QAAQtI,EACrB,IAEJP,EAAE8I,GAAGxI,UAAY,WACb,IAAIyI,EAAiBC,MAAMzC,UAAU0C,MAAMrC,KAAKsC,UAAW,GAC3D,OAAO/I,KAAKF,MAAK,WACb,IAAImG,EAAiBpG,EAAEG,MAAMC,KAAK,sBAClC,QAAuBmH,IAAnBnB,EAA8B,CAC9B,IAAI+C,EAAW5G,EAAU6D,GAAiBgD,EAASL,EAAe,GAC9DlD,EAAUU,UAAUjB,eAAe8D,GACnCD,EAASC,GAAQC,MAAMF,EAAUJ,EAAeE,MAAM,IACG,OAAlDjG,OAAOoG,GAAQnG,MAAM,0BAC5BkG,EAAS9C,aAAaO,KAAKuC,EAAUC,GACrCD,EAAS7C,SAETtG,EAAEsJ,MAAM,+CAA+CnG,QAAQ,QAASiG,GAEhF,MACI,IAAIvD,EAAU1F,KAAM4I,EAAe,GAAIA,EAAe,GAE9D,GACJ,CACJ,OA7NoC,2DAInC,CAPD","sources":["webpack://enerfip/./app/javascript/javascript/pages/projects/countdown.js","webpack://enerfip/./app/javascript/i18n/setup.js.erb","webpack://enerfip/./vendor/assets/unmaintained_components/jquery.countdown/dist/jquery.countdown.js"],"sourcesContent":["import \"jquery.countdown/dist/jquery.countdown.js\";\nimport I18n from \"../../../i18n/setup.js.erb\";\n\n$(function() {\n function flashCountDown() {\n var date = $(this).data('start-time');\n var $this = $(this);\n $this.countdown(date, function(event) {\n var days_template = '%D ' + I18n.t('countdown.days_short') + '';\n var hrs_template = '%H ' + I18n.t('countdown.hours_short') + '';\n var mins_template = '%M ' + I18n.t('countdown.minutes_short') + '';\n var secs_template = '%S ' + I18n.t('countdown.seconds_short') + '';\n if(event.offset.totalDays > 0) {\n $this.html(event.strftime(days_template + hrs_template + mins_template + secs_template));\n } else {\n var totalHours = event.offset.totalDays * 24 + event.offset.hours;\n hrs_template = '' + totalHours + ' ' + I18n.t('countdown.hours_short') + '';\n $this.html(event.strftime(hrs_template + mins_template + secs_template));\n }\n\n if(event.offset.totalSeconds <= 0) {\n $this.html(I18n.t('countdown.collect_started'));\n }\n }).on('finish.countdown', function(event) {\n $this.html(I18n.t('countdown.collect_started'));\n top.location.reload();\n });\n }\n $('.countdown-widget-countdown').each(flashCountDown);\n});\n","import { I18n } from \"i18n-js\"\nconst i18n = new I18n()\n\n i18n.store({fr: {\"countdown\":{\"collect_started\":\"La collecte a démarré !\",\"days_short\":\"j.\",\"hours_short\":\"h.\",\"minutes_short\":\"min.\",\"seconds_short\":\"sec.\"},\"recaptcha\":{\"error_message\":\"Veuillez désactiver tout bloqueur de publicités ou autres extensions qui pourraient interférer avec le processus de connexion et recharger la page.\"},\"documents\":{\"buttons\":{\"edit\":\"Modifier\"},\"dropzone\":{\"message\":\"Glissez / déposez votre document ici ou cliquez pour le sélectionner sur votre ordinateur\"}},\"subscriptions\":{\"buttons\":{\"invest\":\"Investir\",\"invest_anyway\":\"Investir quand même\",\"waiting\":\"...un Instant\"},\"errors\":{\"max_exceeded\":\"Le montant que vous souhaitez investir est supérieur au maximum autorisé sur le projet\"},\"tokens\":{\"partner_error_message\":\"Vous n'êtes pas éligible à investir en tant que partenaire veuillez contacter le service Relations Investisseurs\"}},\"investor_app\":{\"bank_accounts\":{\"validation\":{\"bic_invalid\":\"BIC invalide\",\"iban_invalid\":\"IBAN invalide\"}}}}});\n\n i18n.store({en: {\"countdown\":{\"collect_started\":\"The collection has started!\",\"days_short\":\"j.\",\"hours_short\":\"h.\",\"minutes_short\":\"min.\",\"seconds_short\":\"sec.\"},\"recaptcha\":{\"error_message\":\"Please disable any add blockers or other extensions that may be interfering with the sign in process and reload the page.\"},\"documents\":{\"buttons\":{\"edit\":\"Edit\"},\"dropzone\":{\"message\":\"Drag and drop your document here or click to select it on your computer\"}},\"subscriptions\":{\"buttons\":{\"invest\":\"Invest\",\"invest_anyway\":\"Investing anyway\",\"waiting\":\"...an Instant\"},\"errors\":{\"max_exceeded\":\"The amount you wish to invest is greater than the maximum authorized for the project\"},\"tokens\":{\"partner_error_message\":\"If you are not eligible to invest as a partner, please contact the Investor Relations department\"}},\"investor_app\":{\"bank_accounts\":{\"validation\":{\"bic_invalid\":\"Invalid BIC\",\"iban_invalid\":\"Invalid IBAN\"}}}}});\n\n i18n.store({es: {\"countdown\":{\"collect_started\":\"¡La recaudación ha comenzado!\",\"days_short\":\"d.\",\"hours_short\":\"h.\",\"minutes_short\":\"min.\",\"seconds_short\":\"seg.\"},\"recaptcha\":{\"error_message\":\"Por favor, desactiva cualquier bloqueador de anuncios u otras extensiones que puedan estar interfiriendo con el proceso de inicio de sesión y recarga la página.\"},\"documents\":{\"buttons\":{\"edit\":\"Modificar\"},\"dropzone\":{\"message\":\"Arrastra / suelta tu documento aquí o haz clic para seleccionarlo en tu ordenador\"}},\"subscriptions\":{\"buttons\":{\"invest\":\"Invertir\",\"invest_anyway\":\"Invertir de todos modos\",\"waiting\":\"...un momento\"},\"errors\":{\"max_exceeded\":\"El importe que deseas invertir es superior al máximo autorizado en el proyecto\"},\"tokens\":{\"partner_error_message\":\"No cumples con los requisitos para invertir como socio, contacta con el servicio al cliente.\"}},\"investor_app\":{\"bank_accounts\":{\"validation\":{\"bic_invalid\":\"BIC inválido\",\"iban_invalid\":\"IBAN inválido\"}}}}});\n\n i18n.store({it: {\"countdown\":{\"collect_started\":\"La campagna di raccolta è iniziata!\",\"days_short\":\"j.\",\"hours_short\":\"h.\",\"minutes_short\":\"min.\",\"seconds_short\":\"secco.\"},\"recaptcha\":{\"error_message\":\"Si prega di disabilitare qualsiasi blocco pubblicità o altre estensioni che potrebbero interferire con il processo di accesso e ricaricare la pagina.\"},\"documents\":{\"buttons\":{\"edit\":\"Modificare\"},\"dropzone\":{\"message\":\"Trascinate qui il tuo documento o fate clic per selezionarlo sul tuo computer\"}},\"subscriptions\":{\"buttons\":{\"invest\":\"Investire\",\"invest_anyway\":\"Investire comunque\",\"waiting\":\"... un istante\"},\"errors\":{\"max_exceeded\":\"L'importo che si desidera investire è superiore al limite massimo autorizzato per il progetto\"},\"tokens\":{\"partner_error_message\":\"Se non siete idonei a investire come partner, contattate l'Ufficio relazioni con gli investitori\"}},\"investor_app\":{\"bank_accounts\":{\"validation\":{\"bic_invalid\":\"BIC non valido\",\"iban_invalid\":\"IBAN non valido\"}}}}});\n\n i18n.store({nl: {\"countdown\":{\"collect_started\":\"De inzamelingsactie is begonnen!\",\"days_short\":\"d\",\"hours_short\":\"u\",\"minutes_short\":\"min\",\"seconds_short\":\"sec\"},\"recaptcha\":{\"error_message\":\"Schakel eventuele adblockers of andere extensies uit die het aanmeldingsproces kunnen verstoren en herlaad de pagina.\"},\"documents\":{\"buttons\":{\"edit\":\"Aanpassen\"},\"dropzone\":{\"message\":\"Sleep je document hierheen of klik om het op je computer te selecteren\"}},\"subscriptions\":{\"buttons\":{\"invest\":\"Investeer\",\"invest_anyway\":\"Toch investeren\",\"waiting\":\"...een ogenblik\"},\"errors\":{\"max_exceeded\":\"Het bedrag dat je wilt investeren is hoger dan het toegestane maximum voor het project\"},\"tokens\":{\"partner_error_message\":\"Als je niet in aanmerking komt om als partner te investeren, neem dan contact op met de afdeling Investeerdersrelaties\"}}}});\n\n\ni18n.defaultLocale = \"en\";\ni18n.fallbacks = true // also see Rails config.i18n.fallbacks\ni18n.locale = document.documentElement.lang\n\nexport default i18n\n","/*!\n * The Final Countdown for jQuery v2.2.0 (http://hilios.github.io/jQuery.countdown/)\n * Copyright (c) 2016 Edson Hilios\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n(function(factory) {\n \"use strict\";\n if (typeof define === \"function\" && define.amd) {\n define([ \"jquery\" ], factory);\n } else {\n factory(jQuery);\n }\n})(function($) {\n \"use strict\";\n var instances = [], matchers = [], defaultOptions = {\n precision: 100,\n elapse: false,\n defer: false\n };\n matchers.push(/^[0-9]*$/.source);\n matchers.push(/([0-9]{1,2}\\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source);\n matchers.push(/[0-9]{4}([\\/\\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source);\n matchers = new RegExp(matchers.join(\"|\"));\n function parseDateString(dateString) {\n if (dateString instanceof Date) {\n return dateString;\n }\n if (String(dateString).match(matchers)) {\n if (String(dateString).match(/^[0-9]*$/)) {\n dateString = Number(dateString);\n }\n if (String(dateString).match(/\\-/)) {\n dateString = String(dateString).replace(/\\-/g, \"/\");\n }\n return new Date(dateString);\n } else {\n throw new Error(\"Couldn't cast `\" + dateString + \"` to a date object.\");\n }\n }\n var DIRECTIVE_KEY_MAP = {\n Y: \"years\",\n m: \"months\",\n n: \"daysToMonth\",\n d: \"daysToWeek\",\n w: \"weeks\",\n W: \"weeksToMonth\",\n H: \"hours\",\n M: \"minutes\",\n S: \"seconds\",\n D: \"totalDays\",\n I: \"totalHours\",\n N: \"totalMinutes\",\n T: \"totalSeconds\"\n };\n function escapedRegExp(str) {\n var sanitize = str.toString().replace(/([.?*+^$[\\]\\\\(){}|-])/g, \"\\\\$1\");\n return new RegExp(sanitize);\n }\n function strftime(offsetObject) {\n return function(format) {\n var directives = format.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);\n if (directives) {\n for (var i = 0, len = directives.length; i < len; ++i) {\n var directive = directives[i].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/), regexp = escapedRegExp(directive[0]), modifier = directive[1] || \"\", plural = directive[3] || \"\", value = null;\n directive = directive[2];\n if (DIRECTIVE_KEY_MAP.hasOwnProperty(directive)) {\n value = DIRECTIVE_KEY_MAP[directive];\n value = Number(offsetObject[value]);\n }\n if (value !== null) {\n if (modifier === \"!\") {\n value = pluralize(plural, value);\n }\n if (modifier === \"\") {\n if (value < 10) {\n value = \"0\" + value.toString();\n }\n }\n format = format.replace(regexp, value.toString());\n }\n }\n }\n format = format.replace(/%%/, \"%\");\n return format;\n };\n }\n function pluralize(format, count) {\n var plural = \"s\", singular = \"\";\n if (format) {\n format = format.replace(/(:|;|\\s)/gi, \"\").split(/\\,/);\n if (format.length === 1) {\n plural = format[0];\n } else {\n singular = format[0];\n plural = format[1];\n }\n }\n if (Math.abs(count) > 1) {\n return plural;\n } else {\n return singular;\n }\n }\n var Countdown = function(el, finalDate, options) {\n this.el = el;\n this.$el = $(el);\n this.interval = null;\n this.offset = {};\n this.options = $.extend({}, defaultOptions);\n this.instanceNumber = instances.length;\n instances.push(this);\n this.$el.data(\"countdown-instance\", this.instanceNumber);\n if (options) {\n if (typeof options === \"function\") {\n this.$el.on(\"update.countdown\", options);\n this.$el.on(\"stoped.countdown\", options);\n this.$el.on(\"finish.countdown\", options);\n } else {\n this.options = $.extend({}, defaultOptions, options);\n }\n }\n this.setFinalDate(finalDate);\n if (this.options.defer === false) {\n this.start();\n }\n };\n $.extend(Countdown.prototype, {\n start: function() {\n if (this.interval !== null) {\n clearInterval(this.interval);\n }\n var self = this;\n this.update();\n this.interval = setInterval(function() {\n self.update.call(self);\n }, this.options.precision);\n },\n stop: function() {\n clearInterval(this.interval);\n this.interval = null;\n this.dispatchEvent(\"stoped\");\n },\n toggle: function() {\n if (this.interval) {\n this.stop();\n } else {\n this.start();\n }\n },\n pause: function() {\n this.stop();\n },\n resume: function() {\n this.start();\n },\n remove: function() {\n this.stop.call(this);\n instances[this.instanceNumber] = null;\n delete this.$el.data().countdownInstance;\n },\n setFinalDate: function(value) {\n this.finalDate = parseDateString(value);\n },\n update: function() {\n if (this.$el.closest(\"html\").length === 0) {\n this.remove();\n return;\n }\n var hasEventsAttached = $._data(this.el, \"events\") !== undefined, now = new Date(), newTotalSecsLeft;\n newTotalSecsLeft = this.finalDate.getTime() - now.getTime();\n newTotalSecsLeft = Math.ceil(newTotalSecsLeft / 1e3);\n newTotalSecsLeft = !this.options.elapse && newTotalSecsLeft < 0 ? 0 : Math.abs(newTotalSecsLeft);\n if (this.totalSecsLeft === newTotalSecsLeft || !hasEventsAttached) {\n return;\n } else {\n this.totalSecsLeft = newTotalSecsLeft;\n }\n this.elapsed = now >= this.finalDate;\n this.offset = {\n seconds: this.totalSecsLeft % 60,\n minutes: Math.floor(this.totalSecsLeft / 60) % 60,\n hours: Math.floor(this.totalSecsLeft / 60 / 60) % 24,\n days: Math.floor(this.totalSecsLeft / 60 / 60 / 24) % 7,\n daysToWeek: Math.floor(this.totalSecsLeft / 60 / 60 / 24) % 7,\n daysToMonth: Math.floor(this.totalSecsLeft / 60 / 60 / 24 % 30.4368),\n weeks: Math.floor(this.totalSecsLeft / 60 / 60 / 24 / 7),\n weeksToMonth: Math.floor(this.totalSecsLeft / 60 / 60 / 24 / 7) % 4,\n months: Math.floor(this.totalSecsLeft / 60 / 60 / 24 / 30.4368),\n years: Math.abs(this.finalDate.getFullYear() - now.getFullYear()),\n totalDays: Math.floor(this.totalSecsLeft / 60 / 60 / 24),\n totalHours: Math.floor(this.totalSecsLeft / 60 / 60),\n totalMinutes: Math.floor(this.totalSecsLeft / 60),\n totalSeconds: this.totalSecsLeft\n };\n if (!this.options.elapse && this.totalSecsLeft === 0) {\n this.stop();\n this.dispatchEvent(\"finish\");\n } else {\n this.dispatchEvent(\"update\");\n }\n },\n dispatchEvent: function(eventName) {\n var event = $.Event(eventName + \".countdown\");\n event.finalDate = this.finalDate;\n event.elapsed = this.elapsed;\n event.offset = $.extend({}, this.offset);\n event.strftime = strftime(this.offset);\n this.$el.trigger(event);\n }\n });\n $.fn.countdown = function() {\n var argumentsArray = Array.prototype.slice.call(arguments, 0);\n return this.each(function() {\n var instanceNumber = $(this).data(\"countdown-instance\");\n if (instanceNumber !== undefined) {\n var instance = instances[instanceNumber], method = argumentsArray[0];\n if (Countdown.prototype.hasOwnProperty(method)) {\n instance[method].apply(instance, argumentsArray.slice(1));\n } else if (String(method).match(/^[$A-Z_][0-9A-Z_$]*$/i) === null) {\n instance.setFinalDate.call(instance, method);\n instance.start();\n } else {\n $.error(\"Method %s does not exist on jQuery.countdown\".replace(/\\%s/gi, method));\n }\n } else {\n new Countdown(this, argumentsArray[0], argumentsArray[1]);\n }\n });\n };\n});"],"names":["$","each","date","this","data","$this","countdown","event","days_template","I18n","t","hrs_template","mins_template","secs_template","offset","totalDays","html","strftime","hours","totalSeconds","on","top","location","reload","i18n","store","fr","en","es","it","nl","defaultLocale","fallbacks","locale","document","documentElement","lang","factory","define","instances","matchers","defaultOptions","precision","elapse","defer","parseDateString","dateString","Date","String","match","Number","replace","Error","push","source","RegExp","join","DIRECTIVE_KEY_MAP","Y","m","n","d","w","W","H","M","S","D","I","N","T","escapedRegExp","str","sanitize","toString","offsetObject","format","directives","i","len","length","directive","regexp","modifier","plural","value","hasOwnProperty","pluralize","count","singular","split","Math","abs","Countdown","el","finalDate","options","$el","interval","extend","instanceNumber","setFinalDate","start","prototype","clearInterval","self","update","setInterval","call","stop","dispatchEvent","toggle","pause","resume","remove","countdownInstance","closest","newTotalSecsLeft","hasEventsAttached","undefined","_data","now","getTime","ceil","totalSecsLeft","elapsed","seconds","minutes","floor","days","daysToWeek","daysToMonth","weeks","weeksToMonth","months","years","getFullYear","totalHours","totalMinutes","eventName","Event","trigger","fn","argumentsArray","Array","slice","arguments","instance","method","apply","error"],"sourceRoot":""}