{"version":3,"sources":["webpack:///./src/views/ContactUs.vue?a4dc","webpack:///./src/components/Forms/Form.vue?f8f5","webpack:///./node_modules/client-website-ts-library/plugins/view/index.ts","webpack:///./src/components/Forms/Form.vue?4717","webpack:///./src/components/Forms/Form.vue","webpack:///./src/components/Forms/Form.vue?d965","webpack:///./src/components/Forms/Form.vue?4d45","webpack:///./src/views/ContactUs.vue?6518","webpack:///./src/views/ContactUs.vue","webpack:///./src/views/ContactUs.vue?e268","webpack:///./src/views/ContactUs.vue?8f5a"],"names":["prolistAnalyticsService","ServiceManager","Get","Analytics","headService","Require","Head","evt","obj","this","getAnalyticsEvent","call","getAnalyticsData","$route","path","name","undefined","triggerAnalyticsEvent","event","GetAll","forEach","adapter","Record","result","head","bind","Promise","then","meta","Update","UpdateWithStatic","View","requestAnimationFrame","updateHead","updateAnalytics","AsyncView","$on","render","_vm","_h","$createElement","_c","_self","staticClass","style","fieldBg","attrs","loading","on","loadAutosave","_v","_s","autosaveDate","_e","domProps","definition","Options","SubmittedText","_l","section","key","SectionId","ref","refInFor","errors","ctx","type","handleFieldInput","class","submitButtonClass","submitButtonColour","submitButtonBackgroundColour","submitForm","SubmitButtonText","staticRenderFns","context","errored","submitted","autosaveManager","FormAutosave","hasAutosave","submitPercent","recaptchaService","ReCaptcha","progress","total","Math","round","console","log","Items","ClientWebsiteId","Website","Id","Forms","GetForm","def","enableAutosave","state","GetState","catch","Sections","sectionComponent","$refs","setData","fieldDef","filter","err","Key","collectData","data","normalisedData","normaliseData","SubmitForm","Valid","Submitted","$emit","resetRecaptcha","ValidationState","Errors","newValues","entry","Value","Array","length","push","i","includeRecaptcha","resolve","reject","getRecaptchaResponse","recaptchaResponse","Log","Debug","Reset","GetResponse","default","components","Section","Loader","component","staticStyle","mapSettings","office","Profiles","Settings","WebsiteId","profile","Office","Markers","Address","AddressLine1","AddressLine2","Title","FranchiseName","Coordinate","Lat","Lon","debug","Map","Form"],"mappings":"oKAAA,W,kCCAA,W,wfCcA,IAAM,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1I,KAAKsI,OAASI,EAAQC,OAEtB3I,KAAKqI,YAAc,IAAI,OAAY,CACjCO,QAAS,CACP,IAAI,OAAU,CACZC,QAAS,GAAG7I,KAAKsI,OAAOQ,gBAAgB9I,KAAKsI,OAAOS,eACpDC,MAAOhJ,KAAKsI,OAAOW,cACnBC,WAAY,CACVC,KAAM,WACNC,IAAK,kBAMbrE,QAAQsE,MAAMrJ,KAAKqI,iBAtBJ,EAAS,gBAN7B,eAAU,CACTL,WAAY,CACVsB,IAAA,OACAC,OAAA,SAGiB,WC9B+W,I,wBCQhYpB,EAAY,eACd,EACAvG,EACAqC,GACA,EACA,KACA,WACA,MAIa,aAAAkE,E","file":"js/chunk-7e320d4c.94f5fc50.js","sourcesContent":["export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ContactUs.vue?vue&type=style&index=0&id=ec24238a&scoped=true&lang=css&\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Form.vue?vue&type=style&index=0&id=726d98f2&scoped=true&lang=css&\"","import Vue from \"vue\";\r\nimport { Component } from \"vue-property-decorator\";\r\nimport { AnalyticsEvent, AnalyticsEventObject, AnalyticsPageView, IAnalyticsAdapter, PROListAnalyticsAdapter } from \"../../services/Analytics\";\r\nimport { HeadService } from \"../../services/HeadService\";\r\nimport { ServiceManager, ServiceType } from \"../../services/ServiceManager\";\r\nimport { RouteMeta } from \"../meta\";\r\n\r\ninterface ViewBase {\r\n getAnalyticsEvent?(): AnalyticsEvent | null;\r\n getAnalyticsData?(): AnalyticsEventObject | null;\r\n head?(): RouteMeta | Promise | null;\r\n}\r\n\r\n@Component\r\nclass ViewBase extends Vue {\r\n protected prolistAnalyticsService = ServiceManager.Get(ServiceType.Analytics, 'PROListAnalyticsAdapter');\r\n protected headService = ServiceManager.Require(ServiceType.Head)!;\r\n\r\n public updateAnalytics() {\r\n let evt: AnalyticsEvent | null = null;\r\n let obj: AnalyticsEventObject | null = null;\r\n\r\n if (typeof this.getAnalyticsEvent !== 'undefined') {\r\n evt = this.getAnalyticsEvent.call(this);\r\n } else if(typeof this.getAnalyticsData !== 'undefined') {\r\n obj = this.getAnalyticsData.call(this);\r\n }\r\n\r\n if (evt === null) evt = new AnalyticsPageView(this.$route.path, this.$route.name || '', obj || undefined);\r\n\r\n this.triggerAnalyticsEvent(evt);\r\n }\r\n\r\n public triggerAnalyticsEvent(event: AnalyticsEvent) {\r\n ServiceManager.GetAll(ServiceType.Analytics).forEach((adapter) => {\r\n adapter.Record(event);\r\n });\r\n }\r\n\r\n public triggerCustomAnalyticsEvent(event: AnalyticsEvent) {\r\n if (this.prolistAnalyticsService !== null) this.prolistAnalyticsService.Record(event);\r\n }\r\n\r\n protected updateHead() {\r\n if ('head' in this) {\r\n const result = this.head!.bind(this)();\r\n\r\n if(result instanceof Promise) {\r\n result.then((meta: RouteMeta | null) => {\r\n this.headService.Update(meta);\r\n });\r\n } else {\r\n this.headService.Update(result as RouteMeta | null);\r\n }\r\n } else {\r\n this.headService.UpdateWithStatic(this.$route.path);\r\n }\r\n }\r\n}\r\n\r\n@Component\r\nclass View extends ViewBase {\r\n public mounted() {\r\n requestAnimationFrame(() => {\r\n this.updateHead();\r\n this.updateAnalytics();\r\n });\r\n }\r\n}\r\n\r\n@Component\r\nclass AsyncView extends ViewBase {\r\n public mounted() {\r\n this.$on('updateView', () => {\r\n requestAnimationFrame(() => {\r\n this.updateHead();\r\n this.updateAnalytics();\r\n });\r\n });\r\n }\r\n}\r\n\r\nexport {\r\n View,\r\n AsyncView\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('form',{staticClass:\"form\",style:({'--field-bg': _vm.fieldBg})},[_c('Loader',{attrs:{\"loading\":_vm.loading}}),(_vm.hasAutosave)?_c('div',{staticClass:\"form__panel form__panel--autosaved\",on:{\"click\":_vm.loadAutosave}},[_c('p',[_vm._v(\" This form was autosaved at \"+_vm._s(_vm.autosaveDate)+\". Click here to load the autosave. \")])]):_vm._e(),(_vm.errored)?_c('div',{staticClass:\"form__panel form__panel--errored\"},[_c('p',[_vm._v(\" An error occurred. Please try again later. \")])]):_vm._e(),(_vm.definition)?[(_vm.submitted)?_c('div',{staticClass:\"form__panel form__panel--success\"},[_c('p',{domProps:{\"innerHTML\":_vm._s(_vm.definition.Options.SubmittedText)}})]):[_vm._l((_vm.definition.Sections),function(section){return _c('Section',{key:section.SectionId,ref:section.SectionId,refInFor:true,attrs:{\"def\":section,\"errors\":_vm.errors,\"form-context\":_vm.ctx,\"form-type\":_vm.type},on:{\"field_input\":_vm.handleFieldInput}})}),_c('div',{staticClass:\"center-text\"},[_c('Button',{staticClass:\"form__submit-btn\",class:_vm.submitButtonClass,attrs:{\"loading\":_vm.loading,\"colour\":_vm.submitButtonColour,\"background-colour\":_vm.submitButtonBackgroundColour},on:{\"click\":_vm.submitForm}},[_vm._v(_vm._s(_vm.definition.Options.SubmitButtonText))])],1)]]:_vm._e()],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Component, Vue, Prop } from 'vue-property-decorator';\nimport { FormDefinition, FormSubmissionValidationError, FormField, FormValue } from 'client-website-ts-library/types/Forms';\nimport {\n AutosaveManager,\n ServiceManager,\n ServiceType,\n API,\n Config,\n Logger,\n LogLevel,\n ReCaptchaService,\n} from 'client-website-ts-library/services';\nimport { Context } from 'client-website-ts-library/types';\nimport { PDFFieldData } from 'client-website-ts-library/types/Forms/FieldTypes';\nimport { IRequestProgressDelegate } from 'client-website-ts-library/services/API/IRequestProgressDelegate';\n\nimport Section from './Section.vue';\nimport Loader from '../UI/Loader.vue';\n\n@Component({\n components: {\n Section,\n Loader,\n },\n})\nexport default class Form extends Vue implements IRequestProgressDelegate {\n @Prop({ default: () => ({ Items: [] }) })\n private readonly context!: Context;\n\n @Prop()\n private readonly type!: string;\n\n @Prop()\n private readonly submitButtonColour!: string;\n\n @Prop()\n private readonly submitButtonBackgroundColour!: string;\n\n @Prop()\n private readonly submitButtonClass!: string;\n\n @Prop()\n private readonly autosaveNamespace!: string;\n\n @Prop()\n private readonly enableAutosave!: boolean;\n\n @Prop({ default: 'var(--form-field-bg)' })\n private readonly fieldBg!: string;\n\n @Prop({ default: 'var(--form-field-colour)' })\n private readonly fieldColour!: string;\n\n @Prop({ default: 'var(--form-label-colour)' })\n private readonly labelColour!: string;\n\n @Prop({ default: 'var(--form-field-border-colour)' })\n private readonly borderColour!: string;\n\n @Prop({ default: 'var(--form-label-focused-bg)' })\n private readonly labelFocusedBg!: string;\n\n @Prop({ default: 'var(--form-label-focused-colour)' })\n private readonly labelFocusedColour!: string;\n\n private ctx: Context = this.context;\n\n private errored = false;\n\n private submitted = false;\n\n private errors: FormSubmissionValidationError[] = [];\n\n private loading = true;\n\n private definition: FormDefinition | null = null;\n\n private autosaveManager: AutosaveManager = ServiceManager.Require(ServiceType.FormAutosave);\n\n private hasAutosave = false;\n\n private autosaveDate: string | null = null;\n\n private submitPercent = 0;\n\n private recaptchaService = ServiceManager.Require(ServiceType.ReCaptcha) as ReCaptchaService;\n\n onProgress(progress: number, total: number) {\n this.submitPercent = Math.round((progress / total) * 100);\n\n console.log(this.submitPercent);\n }\n\n mounted() {\n if (this.ctx === null) {\n this.ctx = {\n Items: [],\n ClientWebsiteId: Config.Website.Id,\n };\n }\n\n if (this.ctx.ClientWebsiteId === undefined) {\n this.ctx.ClientWebsiteId = Config.Website.Id;\n }\n\n API.Forms.GetForm(this.type, this.context).then((def) => {\n this.loading = false;\n this.definition = def;\n\n if (this.enableAutosave) {\n const state = this.autosaveManager.GetState(this.type);\n\n if (state !== null) {\n this.hasAutosave = true;\n }\n }\n }).catch(() => {\n this.errored = true;\n });\n }\n\n loadAutosave(): void {\n if (!this.hasAutosave) return;\n\n const state = this.autosaveManager.GetState(this.type);\n\n if (state === null) return;\n\n this.definition!.Sections.forEach((section) => {\n const sectionComponent = (this.$refs[section.SectionId] as Vue[])[0] as Section;\n\n sectionComponent.setData(state);\n });\n }\n\n private handleFieldInput(fieldDef: FormField): void {\n this.errors = this.errors.filter((err) => err.Key !== fieldDef.Key);\n }\n\n submitForm(): void {\n if (this.loading) return;\n\n this.loading = true;\n\n this.errors = [];\n\n this.collectData(true).then((data) => {\n const normalisedData = Form.normaliseData(data);\n\n console.log(normalisedData);\n\n this.loading = false;\n\n // this.context.ClientWebsiteId = Config.Website.Id;\n\n // if (this.enableAutosave) this.autosaveManager.SetState(this.type, data);\n\n API.Forms.SubmitForm(this.type, this.context, normalisedData).then((result) => {\n this.loading = false;\n\n if (!result.Valid) {\n // Reset ReCaptcha\n this.resetRecaptcha();\n\n // Update errors\n this.errors = result.ValidationState.Errors;\n } else if (result.Submitted) {\n // Inform the user that the form was submitted\n this.submitted = true;\n\n this.$emit('submitted');\n }\n }).catch(() => {\n // Reset ReCaptcha\n this.resetRecaptcha();\n\n // Inform the user that there was an error\n this.errored = true;\n });\n });\n }\n\n private static normaliseData(data: FormValue[]): FormValue[] {\n const newValues: FormValue[] = [];\n\n data.forEach((entry) => {\n if (entry.Value instanceof Array) {\n if (entry.Value.length) {\n newValues.push({\n Key: `${entry.Key}_length`,\n Value: entry.Value.length,\n });\n\n for (let i = 0; i < entry.Value.length; i += 1) {\n newValues.push({\n Key: `${entry.Key}_${i}`,\n Value: entry.Value[i],\n });\n }\n }\n } else {\n newValues.push(entry);\n }\n });\n\n return newValues;\n }\n\n private collectData(includeRecaptcha: boolean): Promise {\n return new Promise((resolve, reject) => {\n const data: FormValue[] = [];\n\n // Loop through each form secction and collect the data from it\n this.definition!.Sections.forEach((section) => {\n const sectionComponent = (this.$refs[section.SectionId] as Vue[])[0] as Section;\n\n data.push(...sectionComponent.collectData());\n });\n\n // If we also need to submit the ReCaptcha response, make sure we call getResponse on the ReCaptcha component\n if (includeRecaptcha) {\n this.getRecaptchaResponse().then((recaptchaResponse: string) => {\n Logger.Log(LogLevel.Debug, '[Form]', 'Got ReCaptcha response');\n\n data.push({\n Key: '_recaptcha',\n Value: recaptchaResponse,\n });\n\n resolve(data);\n }).catch(reject);\n\n return;\n }\n\n // If we don't need ReCaptcha, resolve straight away\n resolve(data);\n });\n }\n\n private resetRecaptcha(): void {\n this.recaptchaService.Reset();\n }\n\n private getRecaptchaResponse(): Promise {\n return this.recaptchaService.GetResponse();\n }\n}\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Form.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Form.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Form.vue?vue&type=template&id=726d98f2&scoped=true&\"\nimport script from \"./Form.vue?vue&type=script&lang=ts&\"\nexport * from \"./Form.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./Form.vue?vue&type=style&index=0&id=726d98f2&scoped=true&lang=css&\"\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 \"726d98f2\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Page',[_c('SiteMasthead',{attrs:{\"mini\":true,\"title\":\"Contact\"}}),_c('ContentRow',[_c('SectionTitle',[_vm._v(\"Get In Touch\")]),_c('ContentContainer',{staticClass:\"content-container--narrow\"},[_c('Form',{attrs:{\"type\":\"Generic.WebsiteContactForm\"}})],1)],1),(_vm.mapSettings)?_c('Deferrable',[_c('Map',{staticStyle:{\"max-height\":\"500px\"},attrs:{\"settings\":_vm.mapSettings}})],1):_vm._e()],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Component, Mixins } from 'vue-property-decorator';\nimport { Office, MapSettings, MapMarker } from 'client-website-ts-library/types';\nimport { API, Config } from 'client-website-ts-library/services';\nimport { Map } from 'client-website-ts-library/components';\nimport { View } from 'client-website-ts-library/plugins';\nimport Form from '@/components/Forms/Form.vue';\n\n@Component({\n components: {\n Map,\n Form,\n },\n})\nexport default class ContactUs extends Mixins(View) {\n private office: Office | null = null;\n\n private mapSettings: MapSettings | null = null;\n\n mounted() {\n API.Profiles.Get(Config.Website.Settings!.WebsiteId, true).then((profile) => {\n this.office = profile.Office;\n\n this.mapSettings = new MapSettings({\n Markers: [\n new MapMarker({\n Address: `${this.office.AddressLine1} ${this.office.AddressLine2}`,\n Title: this.office.FranchiseName,\n Coordinate: {\n Lat: -16.9069013,\n Lon: 145.7594106,\n },\n }),\n ],\n });\n\n console.debug(this.mapSettings);\n });\n }\n}\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--14-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ContactUs.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--14-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ContactUs.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ContactUs.vue?vue&type=template&id=ec24238a&scoped=true&\"\nimport script from \"./ContactUs.vue?vue&type=script&lang=ts&\"\nexport * from \"./ContactUs.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./ContactUs.vue?vue&type=style&index=0&id=ec24238a&scoped=true&lang=css&\"\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 \"ec24238a\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}