{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../LM.Web/Scripts/lmSurveyQuestionnaireIntro.js"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","VueApp","mixins","utils","components","GenericButton","instanceId","submissionAttempts","ui","survey","loading","hasError","errorMessage","options","identities","years","staff","pupil","parent","created","params","this","getURLParams","id","computed","hasAttempted","methods","startSurvey","_this","axios","post","concat","then","response","url","status","Error","location","href","catch","ex","console","error"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDc,EAAQd,GAAYG,EAAYH,IAKlC,IAFGe,GAAqBA,EAAoBhB,GAEtCO,EAASC,QACdD,EAASU,OAATV,GAOD,OAHAW,EAAgBJ,KAAKK,MAAMD,EAAiBb,GAAkB,IAGvDe,IAER,SAASA,IAER,IADA,IAAIC,EACIf,EAAI,EAAGA,EAAIY,EAAgBV,OAAQF,IAAK,CAG/C,IAFA,IAAIgB,EAAiBJ,EAAgBZ,GACjCiB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAed,O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OJ,KAAKd,mBAAqB,IAGrCmB,QAAS,CACPC,YAAW,WAAI,IAAAC,EAAA,KACbP,KAAKd,oBAAsB,EAE3Bc,KAAKb,GAAGC,OAAOC,SAAU,EAEzBmB,IACGC,KAAK,8DAADC,OAC2DV,KAAKf,aAEpE0B,MAAM,SAAAC,GACL,IAAcC,EAAgBD,EAAtB7F,KAAW+F,EAAWF,EAAXE,OACnB,IAAKD,GAAkB,MAAXC,EAGV,MAAM,IAAIC,MAAO,4BAFjBtC,OAAOuC,SAASC,KAAOJ,KAK1BK,OAAO,SAAAC,GACNC,QAAQC,MAAOF,GACfZ,EAAKpB,GAAGC,OAAOE,UAAW,EAC1BiB,EAAKpB,GAAGC,OAAOC,SAAU","file":"lmSurveyQuestionnaireIntro.min.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"lmSurveyQuestionnaireIntro\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/Assets/js/\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([87,\"vendor\",\"vendor.styles\",\"vendor.critical\",\"common\"]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","import \"./modules/common\";\r\nimport axios from \"axios\";\r\nimport VueApp from \"~/Scripts/new/vueApp\";\r\nimport GenericButton from \"~/Components/Common/GenericButton.vue\";\r\nimport { utils } from \"~/Scripts/vue/mixins/common\";\r\n\r\nnew VueApp( {\r\n name: \"LmSurveyQuestionnaireIntro\",\r\n mixins: [utils],\r\n components: {\r\n GenericButton,\r\n },\r\n data: () => ( {\r\n instanceId: null,\r\n submissionAttempts: 0,\r\n ui: {\r\n survey: {\r\n loading: false,\r\n hasError: false,\r\n errorMessage: \"Unable to start survey. Please try again or contact us.\",\r\n },\r\n },\r\n options: {\r\n identities: [\"Male\", \"Female\", \"Other\", \"Prefer not to say\"],\r\n years: {\r\n staff: [\"Under 3 years\", \"3-10 years\", \"10+ years\"],\r\n pupil: [\r\n \"Year 2\",\r\n \"Year 3\",\r\n \"Year 4\",\r\n \"Year 5\",\r\n \"Year 6\",\r\n \"Year 7\",\r\n \"Year 8\",\r\n \"Year 9\",\r\n \"Year 10\",\r\n \"Year 11\",\r\n \"Year 12\",\r\n \"Year 13\",\r\n ],\r\n parent: [\r\n \"Reception\",\r\n \"Year 2\",\r\n \"Year 3\",\r\n \"Year 4\",\r\n \"Year 5\",\r\n \"Year 6\",\r\n \"Year 7\",\r\n \"Year 8\",\r\n \"Year 9\",\r\n \"Year 10\",\r\n \"Year 11\",\r\n \"Year 12\",\r\n \"Year 13\",\r\n ],\r\n },\r\n },\r\n } ),\r\n created () {\r\n const params = this.getURLParams();\r\n this.instanceId = params.id;\r\n },\r\n computed: {\r\n hasAttempted () {\r\n return this.submissionAttempts > 0;\r\n },\r\n },\r\n methods: {\r\n startSurvey () {\r\n this.submissionAttempts += 1;\r\n\r\n this.ui.survey.loading = true;\r\n\r\n axios\r\n .post(\r\n `/umbraco/Survey/LmSurveySurface/GetSurveyRespondentLink?id=${this.instanceId}`,\r\n )\r\n .then( response => {\r\n const { data: url, status } = response;\r\n if ( url && status === 200 ) {\r\n window.location.href = url;\r\n } else {\r\n throw new Error( \"Response indicates error\" );\r\n }\r\n } )\r\n .catch( ex => {\r\n console.error( ex );\r\n this.ui.survey.hasError = true;\r\n this.ui.survey.loading = false;\r\n } );\r\n },\r\n\r\n },\r\n} );\r\n"],"sourceRoot":""}