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AOC,QAAUD,OAAOC,SAAW,CAAC,EACpCD,OAAOC,QAAQ6E,iBAAmB,IAAI9B,EAAiB7H,EAAE,4BACzD6E,OAAOC,QAAQ6E,iBAAiB/B,MAClC,I,QCEAgC,EAAAA,M","sources":["webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-91756c732417/app/packs/src/decidim/friendly_signup/setup_confirmations.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-91756c732417/app/packs/images/ sync ^\\.\\/.*$","webpack://app/webpack/bootstrap","webpack://app/webpack/runtime/hasOwnProperty shorthand","webpack://app/webpack/runtime/publicPath","webpack://app/../usr/local/bundle/gems/decidim-core-0.27.5/app/packs/src/decidim/icon.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-91756c732417/app/packs/src/decidim/friendly_signup/lib/password_toggler.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-91756c732417/app/packs/src/decidim/friendly_signup/setup_password.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-91756c732417/app/packs/src/decidim/friendly_signup/lib/instant_validator.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-91756c732417/app/packs/src/decidim/friendly_signup/setup_validations.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-91756c732417/app/packs/entrypoints/decidim_friendly_signup.js"],"sourcesContent":["$(() => {\n const $inputs = $('.confirmation-code-inputs input[type=\"number\"]');\n const $form = $inputs.closest(\"form\");\n const intRegex = /^\\d+$/;\n let disableManual = false;\n\n // Parses the individual digits into the individual boxes.\n const pasteValues = (element, $first) => {\n const values = element.split(\"\");\n let $inputBox = $first;\n\n $(values).each((index) => {\n $inputBox.val(values[index]);\n $inputBox = $inputBox.next('input[type=\"number\"]');\n if ($inputBox.length === 0) {\n $form.find('button[type=\"submit\"]').prop(\"disabled\", true);\n $form.submit();\n }\n });\n };\n\n $inputs.on(\"focus\", (e) => {\n $(e.target).select();\n });\n\n // Prevents user from manually entering non-digits.\n $inputs.on(\"input.fromManual\", (e) => {\n if (disableManual) {\n return;\n }\n const $this = $(e.target);\n if (intRegex.test($this.val())) {\n pasteValues($this.val(), $this);\n $this.next('input[type=\"number\"]').focus();\n } else {\n $this.val(\"\");\n }\n });\n\n $inputs.on(\"paste\", (evt) => {\n const $this = $(evt.target);\n const originalValue = $this.val();\n $this.val(\"\");\n disableManual = true;\n $this.one(\"input.fromPaste\", (e) => {\n const $currentInputBox = $(e.target);\n\n const pastedValue = $currentInputBox.val();\n if (intRegex.test(pastedValue)) {\n pasteValues(pastedValue, $inputs.eq(0));\n }\n else {\n $this.val(originalValue);\n }\n disableManual = false;\n });\n });\n});\n","var map = {\n\t\"./decidim/friendly_signup/icon.svg\": 92568\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 18316;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","__webpack_require__.p = \"/decidim-packs/\";","const DEFAULT_ATTRIBUTES = {\n role: \"img\",\n \"aria-hidden\": \"true\"\n};\n\n/**\n * Generates a Decidim icon element and returns it as a string.\n * @param {String} iconKey - the key of the icon to be generated\n * @param {Object} attributes - extra attributes to define for the icon SVG\n * @param {int} wait - number of milliseconds to wait before executing the function.\n * @private\n * @returns {Void} - Returns nothing.\n */\nexport default function icon(iconKey, attributes = {}) {\n const iconAttributes = $.extend(DEFAULT_ATTRIBUTES, attributes);\n const title = iconAttributes.title || iconAttributes.ariaLabel;\n Reflect.deleteProperty(iconAttributes, \"title\");\n\n const htmlAttributes = {\n \"class\": `icon icon--${iconKey}`\n };\n Object.keys(iconAttributes).forEach((key) => {\n // Convert the key to dash-format.\n const newKey = key.replace(/([A-Z])/g, (ucw) => `-${ucw[0].toLowerCase()}`);\n if (typeof htmlAttributes[key] === \"undefined\") {\n htmlAttributes[newKey] = iconAttributes[key];\n } else {\n htmlAttributes[newKey] = `${htmlAttributes[newKey]} ${iconAttributes[key]}`;\n }\n });\n\n const iconsPath = window.Decidim.config.get(\"icons_path\");\n const elHtml = ``;\n const $el = $(elHtml);\n if (title) {\n $el.prepend(`${title}`);\n } else {\n // This keeps accessibility audit tools happy\n $el.prepend(`${iconKey}`);\n // Force hidden if title is not defined\n htmlAttributes[\"aria-hidden\"] = \"true\";\n }\n $el.attr(htmlAttributes);\n\n return $(\"
\").append($el).html();\n}\n","import icon from \"src/decidim/icon\"\n\nexport default class PasswordToggler {\n constructor($password, $confirmation) {\n this.$password = $password.first();\n this.$confirmation = $confirmation.first();\n this.$input = this.$password.find('input[type=\"password\"]');\n this.$inputConfirmation = this.$confirmation.find('input[type=\"password\"]');\n this.$form = this.$input.closest(\"form\");\n this.texts = {\n showPassword: this.$password.data(\"showPassword\") || \"Show password\",\n hidePassword: this.$password.data(\"hidePassword\") || \"Hide password\",\n hiddenPassword: this.$password.data(\"hiddenPassword\") || \"Your password is hidden\",\n shownPassword: this.$password.data(\"shownPassword\") || \"Your password is shown\"\n }\n this.icons = {\n show: icon(\"eye\", {title: this.texts.showPassword})\n }\n }\n\n // Call init() to hide the password confirmation and add a \"view password\" inline button\n init() {\n this.createControls();\n this.$confirmation.hide();\n this.$button.on(\"click.password_toggler\", (evt) => this.toggleVisibiliy(evt));\n this.$input.on(\"change.password_toggler\", () => {\n this.$inputConfirmation.val(this.$input.val());\n });\n // to prevent browsers trying to use autocomplete, turn the type back to password before submitting\n this.$form.on(\"submit.password_toggler\", () => {\n this.$inputConfirmation.val(this.$input.val());\n this.hidePassword();\n });\n }\n\n // Call destroy() to switch back to the original password/password confirmation boxes\n destroy() {\n this.$button.off(\"click.password_toggler\");\n this.$input.off(\"change.password_toggler\");\n this.$form.off(\"submit.password_toggler\");\n const $input = this.$input.detach();\n this.$inputGroup.replaceWith($input);\n this.$confirmation.show();\n }\n\n createControls() {\n this.$button = $(``);\n this.$buttonGroup = $('');\n this.$statusText = $(`${this.texts.hiddenPassword}`);\n // ensure error message is handled by foundation abide\n this.$input.next(\".form-error\").attr(\"data-form-error-for\", this.$input.attr(\"id\"));\n this.$buttonGroup.html(this.$button);\n this.$input.wrap('').\n after(this.$statusText).\n after(this.$buttonGroup);\n this.$inputGroup = this.$input.parent();\n }\n\n toggleVisibiliy(evt) {\n evt.preventDefault();\n if (this.isText()) {\n this.hidePassword();\n } else {\n this.showPassword();\n }\n }\n\n showPassword() {\n this.$statusText.text(this.texts.shownPassword);\n this.$button.attr(\"aria-label\", this.texts.hidePassword).addClass(\"crossed\");\n this.$input.attr(\"type\", \"text\");\n }\n\n hidePassword() {\n this.$statusText.text(this.texts.hiddenPassword);\n this.$button.attr(\"aria-label\", this.texts.showPassword).removeClass(\"crossed\")\n this.$input.attr(\"type\", \"password\");\n }\n\n isText() {\n return this.$input.attr(\"type\") === \"text\"\n }\n}\n","import PasswordToggler from \"src/decidim/friendly_signup/lib/password_toggler\";\n\n$(() => {\n window.Decidim = window.Decidim || {};\n window.Decidim.passwordToggler = new PasswordToggler($(\".user-password\"), $(\".user-password-confirmation\"));\n window.Decidim.passwordToggler.init();\n});\n","/* eslint-disable line-comment-position, no-ternary, no-inline-comments */\n\n// Instant, server-side validation\n// compatible with abide classes https://get.foundation/sites/docs/abide.html\nexport default class InstantValidator {\n // ms before xhr check\n get TIMEOUT() {\n return 600;\n }\n\n constructor($form) {\n this.$form = $form;\n this.$inputs = $form.find(\"[data-instant-attribute]\");\n this.url = this.$form.data(\"validationUrl\");\n this.timeoutId = null;\n }\n\n init() {\n if (!this.url || !this.$form.length) {\n return;\n }\n this.$form.foundation(\"disableValidation\");\n // this final validation prevents abide from resetting the field when user loses focus\n this.$inputs.on(\"blur\", (evt) => {\n // If it's empty (or not tampered), run the validation\n if (this.value($(evt.target)) === \"\") {\n this.validate($(evt.target));\n }\n });\n this.$inputs.on(\"input\", (evt) => {\n let $input = $(evt.currentTarget);\n clearTimeout(this.timeoutId);\n this.timeoutId = setTimeout(() => {\n this.validate($input);\n }, this.TIMEOUT);\n });\n }\n\n value($input) {\n return $input.val().trim();\n }\n\n attribute($input) {\n return $input.data(\"instantAttribute\");\n }\n\n target($input) {\n const $target = this.$form.find($input.data(\"instantTarget\"));\n return $target.length\n ? $target\n : $input;\n }\n\n validate($input) {\n let $recheck = $($input.data(\"instantRecheck\"));\n this.tamper($input);\n this.post($input).done((response) => {\n this.setFeedback(response, $input);\n });\n\n if ($recheck.length && this.isTampered($recheck)) {\n this.validate($recheck)\n }\n }\n\n setFeedback(data, $input) {\n if (data.valid) {\n this.clearErrors($input);\n } else {\n this.addErrors(this.target($input), data.error);\n }\n }\n\n tamper($dest) {\n $dest.data(\"tampered\", $dest.val().trim() !== \"\");\n }\n\n isTampered($dest) {\n return $dest.data(\"tampered\");\n }\n\n addErrors($dest, msg) {\n if ($dest.closest(\"label\").find(\".form-error\").length > 1) {\n // Decidim may add and additional error class that does not play well with abide\n $dest.closest(\"label\").find(\".form-error:last\").remove();\n }\n this.$form.foundation(\"addErrorClasses\", $dest);\n if (msg) {\n $dest.closest(\"label\").find(\".form-error\").html(msg);\n }\n }\n\n clearErrors($dest) {\n this.$form.foundation(\"removeErrorClasses\", $dest);\n }\n\n post($input) {\n return $.ajax(this.url, {\n method: \"POST\",\n data: `${this.$form.serialize()}&attribute=${this.attribute($input)}`\n });\n }\n}\n","import InstantValidator from \"src/decidim/friendly_signup/lib/instant_validator\";\n\n$(() => {\n window.Decidim = window.Decidim || {};\n window.Decidim.instantValidator = new InstantValidator($(\"form.instant-validation\"));\n window.Decidim.instantValidator.init();\n});\n","import \"src/decidim/friendly_signup/setup_password\"\nimport \"src/decidim/friendly_signup/setup_validations\"\nimport \"src/decidim/friendly_signup/setup_confirmations\"\n\n// CSS\nimport \"entrypoints/decidim_friendly_signup.scss\";\n\n// Images\nrequire.context(\"../images\", true)\n"],"names":["$","$inputs","$form","closest","intRegex","disableManual","pasteValues","element","$first","values","split","$inputBox","each","index","val","next","length","find","prop","submit","on","e","target","select","$this","test","focus","evt","originalValue","one","pastedValue","eq","map","webpackContext","req","id","webpackContextResolve","__webpack_require__","o","Error","code","keys","Object","resolve","module","exports","__webpack_module_cache__","moduleId","cachedModule","undefined","__webpack_modules__","obj","prototype","hasOwnProperty","call","p","DEFAULT_ATTRIBUTES","role","icon","iconKey","attributes","arguments","iconAttributes","extend","title","ariaLabel","Reflect","deleteProperty","htmlAttributes","concat","forEach","key","newKey","replace","ucw","toLowerCase","iconsPath","window","Decidim","config","get","elHtml","$el","prepend","attr","append","html","PasswordToggler","$password","$confirmation","_classCallCheck","this","first","$input","$inputConfirmation","texts","showPassword","data","hidePassword","hiddenPassword","shownPassword","icons","show","value","_this","createControls","hide","$button","toggleVisibiliy","off","detach","$inputGroup","replaceWith","$buttonGroup","$statusText","wrap","after","parent","preventDefault","isText","text","addClass","removeClass","passwordToggler","init","InstantValidator","url","timeoutId","foundation","validate","currentTarget","clearTimeout","setTimeout","TIMEOUT","trim","$target","_this2","$recheck","tamper","post","done","response","setFeedback","isTampered","valid","clearErrors","addErrors","error","$dest","msg","remove","ajax","method","serialize","attribute","instantValidator","require"],"sourceRoot":""}