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QAAQC,MAAM,wBAAyBH,IAGzClF,KAAKyD,mBAAmB,CACtB6B,mBAAoBH,EAASI,aAAavC,IAC1CwC,kBAAmBL,EAASI,aAAa7G,KAE3CsB,KAAK6C,YAAYsC,EAASI,aAAavC,KACzC,E,6FCxFa,MAAMyC,UAA4B5F,EAAAA,GAC/CC,eAAiB,CAAC,YAAa,WAAY,cAAe,gBAE1DiB,OAAAA,GACEgE,SAASW,iBAAiB,0BAA2B5G,IAC/CA,EAAEwB,OAAO5B,KAAOsB,KAAK2F,gBAAgBjH,KACvCsB,KAAK4F,kBAAkBC,MAAMC,MAAQ,GAAGhH,EAAEiH,OAAOC,YACnD,GAEJ,CAEAC,YAAAA,CAAanH,GACPA,EAAEwB,OAAOC,MACXP,KAAKkG,mBAAmBC,UAAW,EAEnCnG,KAAKkG,mBAAmBC,UAAW,CAEvC,CAEAC,MAAAA,GACEpG,KAAKqG,eAAe5E,UAAUC,OAAO,SACvC,E,kFCtBFhC,OAAO4G,EAAIA,IAMXC,EAAAA,I","sources":["webpack://app/./app/javascript/controllers/ sync \\.js$","webpack://app/./app/javascript/controllers/application.js","webpack://app/./app/javascript/controllers/file_input_controller.js","webpack://app/./app/javascript/controllers/flash_messages_controller.js","webpack://app/./app/javascript/controllers/index.js","webpack://app/./app/javascript/controllers/verification_controller.js","webpack://app/./app/javascript/controllers/video_form_controller.js","webpack://app/./app/javascript/packs/application.js"],"sourcesContent":["var map = {\n\t\"./application.js\": 677,\n\t\"./file_input_controller.js\": 137,\n\t\"./flash_messages_controller.js\": 67,\n\t\"./index.js\": 663,\n\t\"./verification_controller.js\": 527,\n\t\"./video_form_controller.js\": 996,\n\t\"controllers/application.js\": 677,\n\t\"controllers/file_input_controller.js\": 137,\n\t\"controllers/flash_messages_controller.js\": 67,\n\t\"controllers/index.js\": 663,\n\t\"controllers/verification_controller.js\": 527,\n\t\"controllers/video_form_controller.js\": 996\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 = 461;","import { Application } from \"@hotwired/stimulus\"\n\nconst application = Application.start()\n\n// Configure Stimulus development experience\napplication.debug = false\nwindow.Stimulus = application\n\nexport { application }\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class FileInputController extends Controller {\n static targets = [\"value\", \"input\"];\n\n open() {\n this.inputTarget.click();\n }\n\n display(event) {\n const fileName = event.target.value.split(\"\\\\\").pop() || \"No file selected\";\n\n if (this.valueTarget.nodeName == \"INPUT\") {\n this.valueTarget.placeholder = fileName;\n } else {\n this.valueTarget.innerHTML = fileName;\n }\n }\n}\n","import { Controller } from '@hotwired/stimulus';\n\nconst ANIMATION_DELAY = 150;\nconst NOTIFICATION_DURATION = 10000;\nexport default class FlashMessagesController extends Controller {\n static targets = ['alert'];\n\n connect() {\n this.initAlerts();\n }\n\n initAlerts() {\n this.alertTargets.forEach((alert) => {\n setTimeout(() => {\n this.removeElement(alert);\n }, NOTIFICATION_DURATION);\n });\n }\n\n removeAlert(event) {\n const alert = event.currentTarget;\n this.removeElement(alert);\n }\n\n removeElement(element) {\n element.classList.remove('show');\n setTimeout(() => element.remove(), ANIMATION_DELAY);\n }\n}\n","// This file is auto-generated by ./bin/rails stimulus:manifest:update\n// Run that command whenever you add a new controller or create them with\n// ./bin/rails generate stimulus controllerName\n\nimport \"./application\"\nimport { definitionsFromContext } from \"@hotwired/stimulus-webpack-helpers\"\n\nconst context = require.context(\"controllers\", true, /\\.js$/)\nStimulus.load(definitionsFromContext(context))\n","import { Controller } from \"@hotwired/stimulus\";\nimport { Veriff } from \"@veriff/js-sdk\";\nimport { createVeriffFrame, MESSAGES } from \"@veriff/incontext-sdk\";\n\nexport default class extends Controller {\n static values = {\n apiKey: String,\n userId: String,\n sessionId: String,\n sessionUrl: String,\n };\n\n connect() {\n this.veriff = Veriff({\n host: \"https://stationapi.veriff.com\",\n apiKey: this.apiKeyValue,\n onSession: this.handleSession.bind(this),\n parentId: \"verify\",\n });\n\n if (this.sessionIdValue) {\n this.createFrame(this.sessionUrlValue);\n } else {\n this.createForm();\n }\n }\n\n createFrame(url) {\n createVeriffFrame({\n url,\n\n onEvent: (msg) => {\n switch (msg) {\n case MESSAGES.CANCELED:\n Turbo.visit('/profile');\n break;\n\n case MESSAGES.FINISHED:\n this.updateVerification({ status: 'processing_by_veriff' }).then(\n () => {\n Turbo.visit('/');\n },\n );\n break;\n }\n },\n });\n }\n\n createForm() {\n this.veriff.setParams({ vendorData: this.userIdValue });\n\n this.veriff.mount({\n formLabel: {\n givenName: \"First name\",\n lastName: \"Last name\",\n },\n submitBtnText: \"Verify Your Account\",\n loadingText: \"Please wait...\",\n });\n }\n\n updateVerification(params) {\n const data = new FormData();\n\n Object.entries(params).forEach(([key, value]) => {\n data.append(key, value);\n });\n\n return fetch(`/profile/verification`, {\n method: \"PUT\",\n body: data,\n headers: {\n \"X-CSRF-Token\": document\n .querySelector('meta[name=\"csrf-token\"]')\n .getAttribute(\"content\"),\n },\n });\n }\n\n handleSession(err, response) {\n if (err) {\n console.error(\"Veriff session error:\", err);\n return;\n }\n this.updateVerification({\n veriff_session_url: response.verification.url,\n veriff_session_id: response.verification.id,\n });\n this.createFrame(response.verification.url);\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class VideoFormController extends Controller {\n static targets = [\"fileInput\", \"progress\", \"progressBar\", \"submitButton\"];\n\n connect() {\n document.addEventListener(\"direct-upload:progress\", (e) => {\n if (e.target.id === this.fileInputTarget.id) {\n this.progressBarTarget.style.width = `${e.detail.progress}%`;\n }\n });\n }\n\n toggleSubmit(e) {\n if (e.target.value) {\n this.submitButtonTarget.disabled = false;\n } else {\n this.submitButtonTarget.disabled = true;\n }\n }\n\n submit() {\n this.progressTarget.classList.remove(\"d-none\");\n }\n}\n","import _ from \"lodash\";\nwindow._ = _;\n\nimport \"@hotwired/turbo-rails\";\nimport \"controllers\";\n\nimport * as ActiveStorage from \"@rails/activestorage\";\nActiveStorage.start();\n"],"names":["map","webpackContext","req","id","webpackContextResolve","__webpack_require__","o","e","Error","code","keys","Object","resolve","module","exports","application","Application","start","debug","window","Stimulus","FileInputController","Controller","static","open","this","inputTarget","click","display","event","fileName","target","value","split","pop","valueTarget","nodeName","placeholder","innerHTML","FlashMessagesController","connect","initAlerts","alertTargets","forEach","alert","setTimeout","removeElement","removeAlert","currentTarget","element","classList","remove","context","require","load","definitionsFromContext","apiKey","String","userId","sessionId","sessionUrl","veriff","Veriff","host","apiKeyValue","onSession","handleSession","bind","parentId","sessionIdValue","createFrame","sessionUrlValue","createForm","url","createVeriffFrame","onEvent","msg","MESSAGES","CANCELED","Turbo","visit","FINISHED","updateVerification","status","then","setParams","vendorData","userIdValue","mount","formLabel","givenName","lastName","submitBtnText","loadingText","params","data","FormData","entries","key","append","fetch","method","body","headers","document","querySelector","getAttribute","err","response","console","error","veriff_session_url","verification","veriff_session_id","VideoFormController","addEventListener","fileInputTarget","progressBarTarget","style","width","detail","progress","toggleSubmit","submitButtonTarget","disabled","submit","progressTarget","_","ActiveStorage"],"sourceRoot":""}