{"version":3,"sources":["webpack:///./src/components/applications/conversation/Conversation.vue?88aa","webpack:///./node_modules/core-js/modules/es.array.join.js","webpack:///./src/components/applications/conversation/Conversation.vue?3d53","webpack:///./src/chatbot-library/ChatMessage.js","webpack:///./src/chatbot-flows/conversation.flow.js","webpack:///src/components/applications/conversation/Conversation.vue","webpack:///./src/components/applications/conversation/Conversation.vue?011a","webpack:///./src/components/applications/conversation/Conversation.vue","webpack:///./src/chatbot-library/InputValidation.js","webpack:///./src/chatbot-library/ChatInput.js"],"names":["$","IndexedObject","toIndexedObject","arrayMethodIsStrict","nativeJoin","join","ES3_STRINGS","Object","STRICT_METHOD","target","proto","forced","separator","call","this","undefined","render","_vm","_h","$createElement","_c","_self","staticClass","key","attrs","conversationFlow","on","staticRenderFns","ChatMessage","value","ChatAction","setIntroductionMessage","store","commit","setVehicleBrand","setBuyerType","setEmail","setPhoneNumber","replace","createConversation","introductionMessage","state","conversation","flow","vehicleBrand","buyerType","workspaceId","workspace","id","coreApiClient","messages","then","message","conversationId","conversation_id","chat","ChatText","actions","next","callback","content","ChatButton","label","ChatInput","placeholder","mask","InputValidation","email","validator","phoneNumber","dispatch","phone_number","entry","name","components","Chatbot","Footer","data","component","tokens","pattern","String","trim","length","plate","transform","v","toLocaleUpperCase","groups","match","test"],"mappings":"gHAAA,yBAAkqB,EAAG,G,kCCCrqB,IAAIA,EAAI,EAAQ,QACZC,EAAgB,EAAQ,QACxBC,EAAkB,EAAQ,QAC1BC,EAAsB,EAAQ,QAE9BC,EAAa,GAAGC,KAEhBC,EAAcL,GAAiBM,OAC/BC,EAAgBL,EAAoB,OAAQ,KAIhDH,EAAE,CAAES,OAAQ,QAASC,OAAO,EAAMC,OAAQL,IAAgBE,GAAiB,CACzEH,KAAM,SAAcO,GAClB,OAAOR,EAAWS,KAAKX,EAAgBY,WAAqBC,IAAdH,EAA0B,IAAMA,O,yCCflF,IAAII,EAAS,WAAa,IAAIC,EAAIH,KAASI,EAAGD,EAAIE,eAAmBC,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,OAGvD,QACbmC,OACAW,QACAjB,QACAE,gB,kGC/CIN,E,6LAKelC,GACjB,OAAOA,I,2BAJP,MAAO,Y,GAFaC,QAUTiC,U","file":"js/conversation.80c3058b.js","sourcesContent":["import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/style-resources-loader/lib/index.js??ref--8-oneOf-1-4!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Conversation.vue?vue&type=style&index=0&id=3f5bae66&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/style-resources-loader/lib/index.js??ref--8-oneOf-1-4!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Conversation.vue?vue&type=style&index=0&id=3f5bae66&lang=scss&scoped=true&\"","'use strict';\nvar $ = require('../internals/export');\nvar IndexedObject = require('../internals/indexed-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar nativeJoin = [].join;\n\nvar ES3_STRINGS = IndexedObject != Object;\nvar STRICT_METHOD = arrayMethodIsStrict('join', ',');\n\n// `Array.prototype.join` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.join\n$({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {\n join: function join(separator) {\n return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);\n }\n});\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',{staticClass:\"conversation\"},[_c('Chatbot',{key:\"chatbot\",staticClass:\"chatbot\",attrs:{\"flow\":_vm.conversationFlow},on:{\"finished\":function () { return null; }}}),_c('Footer')],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import ChatAction from \"@/chatbot-library/ChatAction\"\n\nclass ChatMessage extends ChatAction {\n get name() {\n return \"message\"\n }\n\n getResponseContent(value) {\n return value\n }\n}\n\nexport default ChatMessage\n","import ChatButton from \"@/chatbot-library/ChatButton\"\nimport ChatInput from \"@/chatbot-library/ChatInput\"\nimport ChatMessage from \"@/chatbot-library/ChatMessage\"\nimport ChatText from \"@/chatbot-library/ChatText\"\nimport coreApiClient from \"core-api\"\nimport InputValidation from \"@/chatbot-library/InputValidation\"\nimport store from \"@/store\"\n\nconst setIntroductionMessage = value => {\n store.commit(\"conversation/flow/setIntroductionMessage\", value)\n}\n\nconst setVehicleBrand = value => {\n store.commit(\"conversation/flow/setVehicleBrand\", value)\n}\n\nconst setBuyerType = value => {\n store.commit(\"conversation/flow/setBuyerType\", value)\n}\n\nconst setEmail = value => {\n store.commit(\"conversation/flow/setEmail\", value)\n}\n\nconst setPhoneNumber = value => {\n store.commit(\"conversation/flow/setPhoneNumber\", value.replace(/\\s/g, \"\"))\n}\n\nconst createConversation = () => {\n let introductionMessage = store.state.conversation.flow.introductionMessage\n let vehicleBrand = store.state.conversation.flow.vehicleBrand\n let buyerType = store.state.conversation.flow.buyerType\n let workspaceId = store.state.workspace.id\n return coreApiClient.messages.store(introductionMessage, null, workspaceId, null, vehicleBrand, buyerType)\n .then(message => {\n let conversationId = message.conversation_id\n store.commit(\"conversation/flow/setConversationId\", conversationId)\n return conversationId\n })\n}\n\nlet chat = [\n new ChatText(\"introduction\",\n {\n actions: [\n new ChatMessage(\n {},\n {\n next: \"welcome\",\n callback: setIntroductionMessage\n }\n )\n ]\n }\n ),\n\n new ChatText(\"welcome\",\n {\n content: \"Bienvenue !\",\n next: \"brand-selection\"\n }\n ),\n\n new ChatText(\"brand-selection\",\n () => {\n return {\n content: \"Afin de vous orienter dans la bonne direction, avec quelle équipe souhaitez-vous être mis en relation ?\",\n actions: [\n new ChatButton(\n { label: \"Équipe Audi\" },\n {\n next: \"status-selection\",\n callback: () => setVehicleBrand(\"audi\")\n }\n ),\n new ChatButton(\n { label: \"Équipe Seat\" },\n {\n next: \"status-selection\",\n callback: () => setVehicleBrand(\"seat\")\n }\n ),\n new ChatButton(\n { label: \"Équipe Skoda\" },\n {\n next: \"status-selection\",\n callback: () => setVehicleBrand(\"skoda\")\n }\n ),\n new ChatButton(\n { label: \"Équipe Volkswagen\" },\n {\n next: \"status-selection\",\n callback: () => setVehicleBrand(\"volkswagen\")\n }\n ),\n new ChatButton(\n { label: \"Pas de préférence\" },\n { next: \"status-selection\" }\n )\n ]\n }\n }\n ),\n\n new ChatText(\"status-selection\",\n () => {\n return {\n content: \"C'est noté.\\nAvez-vous une préférence de conseiller avec qui vous souhaitez échanger ?\",\n actions: [\n new ChatButton(\n { label: \"Conseiller véhicules neufs\" },\n {\n next: \"fill-contact\",\n callback: () => setBuyerType(\"new\")\n }\n ),\n new ChatButton(\n { label: \"Conseiller véhicules d'occasion\" },\n {\n next: \"fill-contact\",\n callback: () => setBuyerType(\"occasion\")\n }\n ),\n new ChatButton(\n { label: \"Pas de préférence\" },\n { next: \"fill-contact\" }\n )\n ]\n }\n }\n ),\n\n new ChatText(\"fill-contact\",\n {\n content: \"Donnez à notre équipe un moyen de vous contacter en cas de coupure.\",\n next: \"ask-email\"\n }\n ),\n\n new ChatText(\"ask-email\",\n () => {\n return {\n content: \"Quel est votre adresse e-mail ?\",\n actions: [\n new ChatInput(\n {\n label: \"Confirmer\",\n placeholder: \"Adresse e-mail\",\n mask: InputValidation.email.mask,\n validator: InputValidation.email.validator,\n },\n {\n next: \"ask-phone-number\",\n callback: setEmail\n })\n ]\n }\n }\n ),\n\n new ChatText(\"ask-phone-number\",\n () => {\n return {\n content: \"Quel est votre numéro de téléphone ?\",\n actions: [\n new ChatInput(\n {\n label: \"Confirmer\",\n placeholder: \"Numéro de téléphone\",\n mask: InputValidation.phoneNumber.mask,\n validator: InputValidation.phoneNumber.validator,\n },\n {\n next: \"confirm-contact\",\n callback: setPhoneNumber\n })\n ]\n }\n }\n ),\n\n new ChatText(\"confirm-contact\", () => {\n return {\n content: `Vous serez averti dans cette fenêtre et par ce(s) moyen(s):\\n${store.state.conversation.flow.email}\\n${store.state.conversation.flow.phoneNumber}`,\n next: \"seller-response\"\n }\n }),\n\n new ChatText(\"seller-response\",\n () => {\n return store\n .dispatch(\"authCustomer\", {\n email: store.state.conversation.flow.email,\n phone_number: store.state.conversation.flow.phoneNumber\n })\n .then(createConversation)\n .then(conversationId => {\n return {\n content: \"Un conseiller va vous répondre\",\n conversationId,\n actions: [\n new ChatMessage(\n {},\n {\n callback: value => {\n coreApiClient.messages.store(value, null, null, conversationId)\n }\n }\n )\n ]\n }\n })\n }\n )\n]\n\nexport default {\n entry: \"introduction\",\n chat\n}\n","\n \n\n\n\n\n\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Conversation.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Conversation.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Conversation.vue?vue&type=template&id=3f5bae66&scoped=true&\"\nimport script from \"./Conversation.vue?vue&type=script&lang=js&\"\nexport * from \"./Conversation.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Conversation.vue?vue&type=style&index=0&id=3f5bae66&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"3f5bae66\",\n null\n \n)\n\nexport default component.exports","let name = {\n mask: {\n mask: \"####################\",\n tokens: { \"#\": { pattern: /[A-zÀ-ú-.' ]/ } }\n },\n\n validator: value => value && String(value).trim().length\n}\n\nlet plate = {\n mask: {\n mask: \"#########\",\n tokens: {\n \"#\": {\n pattern: /[A-z0-9]/,\n transform: v => v.toLocaleUpperCase()\n }\n }\n },\n\n transform: value => {\n value = value.replace(/\\s/g, \"\")\n let groups = value.match(/\\d+|\\D+/gi) || []\n return groups.length ? groups.join(\" \") : value\n },\n\n validator: value => /^([A-Z]{2} [0-9]{3} [A-Z]{2})$/.test(value) || /^([0-9]{1,4} [A-Z]{1,3} [0-9]{2})$/.test(value),\n}\n\nlet email = {\n mask: {\n mask: \"################################################################\",\n tokens: { \"#\": { pattern: /[A-z0-9.\\-_@]/ } }\n },\n\n // eslint-disable-next-line\n validator: value => /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/.test(value),\n}\n\nlet phoneNumber = {\n mask: \"## ## ## ## ##\",\n\n validator: value => /^[0-9]{10}$/.test((value || \"\").replace(/\\s/g, \"\"))\n}\n\nexport default {\n name,\n plate,\n email,\n phoneNumber\n}\n","import ChatAction from \"@/chatbot-library/ChatAction\"\n\nclass ChatInput extends ChatAction {\n get name() {\n return \"input\"\n }\n\n getResponseContent(value) {\n return value\n }\n}\n\nexport default ChatInput\n"],"sourceRoot":""}