{ "version": 3, "sources": ["../../Views/Shared/Components/Header/CustomerService.ts"], "sourcesContent": ["\uFEFFimport {$$, get, initForm, postDataText} from \"@/Utils\";\r\nimport {CustomerSupportSubType} from \"@/enums\";\r\nimport {openPanel} from \"@/sharedComponents/Panel\";\r\n\r\nfunction initCustomerServiceForm() {\r\n const callback = function (resp: Response) {\r\n return resp.text().then(text => {\r\n get(\"customer-service-panel\").outerHTML = text;\r\n initCustomerServiceForm();\r\n });\r\n }\r\n initForm(\"customer-service-form\", callback);\r\n}\r\n\r\nfunction initNotifyPageErrorForm() {\r\n const callback = function (resp: Response) {\r\n return resp.text().then(text => {\r\n get(\"notify-page-error-panel\").outerHTML = text;\r\n initNotifyPageErrorForm();\r\n });\r\n }\r\n initForm(\"notify-page-error-form\", callback);\r\n}\r\n\r\nfunction initContactHrForm() {\r\n const callback = function (resp: Response) {\r\n return resp.text().then(text => {\r\n get(\"contact-hr-panel\").outerHTML = text;\r\n initContactHrForm();\r\n });\r\n }\r\n initForm(\"contact-hr-form\", callback);\r\n}\r\n\r\nfunction initProductHelpButtons() {\r\n $$(\"[data-help-for-product]\").forEach(x => {\r\n x.addDataBoundEventListener(\"click\", function () {\r\n const productId = parseInt(x.getAttribute(\"data-help-for-product\"));\r\n const invoiceNo = x.getAttribute(\"data-invoice-no\");\r\n const data = {productId: productId, invoiceNo: invoiceNo, type: CustomerSupportSubType.NeedHelpUsingProduct}\r\n postDataText(window.config.productHelpFormUrl, data, fillPanelAndInitForm);\r\n });\r\n });\r\n}\r\n\r\nfunction initCustomerServiceSubTypeForm() {\r\n const callback = function (resp: Response) {\r\n return resp.text().then(text => {\r\n get(\"customer-support-type\").innerHTML = text;\r\n initCustomerServiceSubTypeForm();\r\n });\r\n }\r\n initForm(\"customer-support-type-form\", callback);\r\n}\r\n\r\nexport function initCustomerService() {\r\n initCustomerServiceForm();\r\n initContactHrForm();\r\n initNotifyPageErrorForm();\r\n initCustomerServiceSubTypeForm();\r\n initProductHelpButtons();\r\n}\r\n\r\nexport function fillPanelAndInitForm(data: string) {\r\n get(\"customer-support-type\").innerHTML = data;\r\n initCustomerServiceSubTypeForm();\r\n openPanel(\"customer-support-type-panel\");\r\n}"], "mappings": "wEAIA,SAASA,GAA0B,CAO/BC,EAAS,wBANQ,SAAUC,EAAgB,CACvC,OAAOA,EAAK,KAAK,EAAE,KAAKC,GAAQ,CAC5BC,EAAI,wBAAwB,EAAE,UAAYD,EAC1CH,EAAwB,CAC5B,CAAC,CACL,CAC0C,CAC9C,CAEA,SAASK,GAA0B,CAO/BJ,EAAS,yBANQ,SAAUC,EAAgB,CACvC,OAAOA,EAAK,KAAK,EAAE,KAAKC,GAAQ,CAC5BC,EAAI,yBAAyB,EAAE,UAAYD,EAC3CE,EAAwB,CAC5B,CAAC,CACL,CAC2C,CAC/C,CAEA,SAASC,GAAoB,CAOzBL,EAAS,kBANQ,SAAUC,EAAgB,CACvC,OAAOA,EAAK,KAAK,EAAE,KAAKC,GAAQ,CAC5BC,EAAI,kBAAkB,EAAE,UAAYD,EACpCG,EAAkB,CACtB,CAAC,CACL,CACoC,CACxC,CAEA,SAASC,GAAyB,CAC9BC,EAAG,yBAAyB,EAAE,QAAQC,GAAK,CACvCA,EAAE,0BAA0B,QAAS,UAAY,CAC7C,IAAMC,EAAY,SAASD,EAAE,aAAa,uBAAuB,CAAC,EAC5DE,EAAYF,EAAE,aAAa,iBAAiB,EAC5CG,EAAO,CAAC,UAAWF,EAAW,UAAWC,EAAW,MAAiD,EAC3GE,EAAa,OAAO,OAAO,mBAAoBD,EAAME,CAAoB,CAC7E,CAAC,CACL,CAAC,CACL,CAEA,SAASC,GAAiC,CAOtCd,EAAS,6BANQ,SAAUC,EAAgB,CACvC,OAAOA,EAAK,KAAK,EAAE,KAAKC,GAAQ,CAC5BC,EAAI,uBAAuB,EAAE,UAAYD,EACzCY,EAA+B,CACnC,CAAC,CACL,CAC+C,CACnD,CAEO,SAASC,GAAsB,CAClChB,EAAwB,EACxBM,EAAkB,EAClBD,EAAwB,EACxBU,EAA+B,EAC/BR,EAAuB,CAC3B,CAEO,SAASO,EAAqBF,EAAc,CAC/CR,EAAI,uBAAuB,EAAE,UAAYQ,EACzCG,EAA+B,EAC/BE,EAAU,6BAA6B,CAC3C", "names": ["initCustomerServiceForm", "initForm", "resp", "text", "get", "initNotifyPageErrorForm", "initContactHrForm", "initProductHelpButtons", "$$", "x", "productId", "invoiceNo", "data", "postDataText", "fillPanelAndInitForm", "initCustomerServiceSubTypeForm", "initCustomerService", "openPanel"] }