{"version":3,"sources":["enquirySelector.js"],"names":["document","getElementById","enquirySelector","Vue","el","data","querySelector","showAllQueries","allQueries","methods","urlChange","queryString","newurl","window","location","protocol","host","pathname","history","pushState","path","next","this","href","back","mounted","self","URLSearchParams","search","get","onpopstate","event","url","split","state","indexOf","console","log","replaceState","title"],"mappings":"aAAA,GAAIA,SAASC,eAAe,mBACxB,IAAMC,gBAAkB,IAAIC,IAAI,CAC5BC,GAAI,mBACJC,KAAM,WAAA,MAAO,CACTC,cAAe,GACfC,gBAAgB,EAChBC,WAAY,KAEhBC,QAAS,CACLC,UADK,SACKC,GACN,GAAIA,EACA,IAAIC,EAASC,OAAOC,SAASC,SAAW,KAAOF,OAAOC,SAASE,KAAOH,OAAOC,SAASG,SAAWN,OAE7FC,EAASC,OAAOC,SAASC,SAAW,KAAOF,OAAOC,SAASE,KAAOH,OAAOC,SAASG,SAE1FJ,OAAOK,QAAQC,UAAU,CAAEC,KAAMR,GAAU,GAAIA,IAEnDS,KATK,WAUD,MAA0B,aAAtBC,KAAKhB,eAAuD,GAAvBgB,KAAKf,eACnCM,OAAOC,SAASS,KAAM,0EAEH,SAAtBD,KAAKhB,eAAmD,GAAvBgB,KAAKf,eAK/BM,OAAOC,SAASS,KAAKD,KAAKd,YAJjCc,KAAKf,gBAAiB,OACtBe,KAAKZ,UAAU,uBAM3Bc,KArBK,WAsBDF,KAAKf,gBAAiB,EACtBe,KAAKhB,cAAgB,GACrBgB,KAAKd,WAAa,GAClBc,KAAKZ,cAGbe,QAnC4B,WAoCxB,IAAIC,EAAOJ,KACXA,KAAKf,gBAAiB,EAEa,SADjB,IAAIoB,gBAAgBd,OAAOC,SAASc,QACxCC,IAAI,gBACdP,KAAKf,gBAAiB,EACtBe,KAAKhB,cAAgB,SAEzBO,OAAOiB,WAAa,SAAUC,GAC1B,IAAMC,EAAMnB,OAAOC,SAASS,KAAKU,MAAM,KAAK,IACxCD,GAAOnB,OAAOC,SAASS,MAAuB,MAAfQ,EAAMG,OAAkBH,EAAMG,MAAMd,OAASW,EAAMG,MAAMd,KAAKe,QAAQ,eAAiB,KACtHC,QAAQC,IAAIN,GACZlB,OAAOK,QAAQoB,aAAa,KAAMtC,SAASuC,MAAOP,GAClDN,EAAKnB,gBAAiB,EACtBmB,EAAKpB,cAAgB","file":"enquirySelector.min.js","sourcesContent":["if (document.getElementById('enquirySelector')) {\r\n const enquirySelector = new Vue({\r\n el: '#enquirySelector',\r\n data: () => ({\r\n querySelector: '',\r\n showAllQueries: false,\r\n allQueries: ''\r\n }),\r\n methods: {\r\n urlChange(queryString) {\r\n if (queryString) {\r\n var newurl = window.location.protocol + \"//\" + window.location.host + window.location.pathname + queryString;\r\n } else {\r\n var newurl = window.location.protocol + \"//\" + window.location.host + window.location.pathname;\r\n }\r\n window.history.pushState({ path: newurl }, '', newurl);\r\n },\r\n next() { \r\n if (this.querySelector == 'technical' && this.showAllQueries == false) {\r\n return window.location.href =\"/help-and-support/raise-a-new-support-request/nature-of-technical-query\"\r\n } else\r\n if (this.querySelector == 'other' && this.showAllQueries == false) {\r\n this.showAllQueries = true;\r\n this.urlChange('?query-type=other') \r\n }\r\n else {\r\n return window.location.href=this.allQueries\r\n }\r\n },\r\n back() {\r\n this.showAllQueries = false;\r\n this.querySelector = '';\r\n this.allQueries = '';\r\n this.urlChange();\r\n }\r\n },\r\n mounted() {\r\n var self = this;\r\n this.showAllQueries = false;\r\n const urlParams = new URLSearchParams(window.location.search);\r\n if (urlParams.get('query-type') == 'other') {\r\n this.showAllQueries = true;\r\n this.querySelector = 'other';\r\n }\r\n window.onpopstate = function (event) {\r\n const url = window.location.href.split(\"?\")[0];\r\n if (url == window.location.href || event.state == null || (event.state.path && !event.state.path.indexOf('query-type') >= 0)) {\r\n console.log(event)\r\n window.history.replaceState(null, document.title, url);\r\n self.showAllQueries = false;\r\n self.querySelector = \"\";\r\n }\r\n };\r\n },\r\n })\r\n}\r\n"]}