{"version":3,"file":"index-etOBk3l5.js","sources":["../../Client/business/AppSetting/index.ts"],"sourcesContent":["import { toBoolean } from '@shared/Common';\r\n\r\nexport enum AppSetting {\r\n AdmittedCommercial = 'admittedCommercialEnabled',\r\n AllowedStatesFlood = 'allowedStatesFlood',\r\n AgentNotificationsFeatureFlag = 'agentNotificationsFeatureFlag',\r\n Banner = 'bannerEnabled',\r\n BannerLevel = 'bannerLevel',\r\n BannerMessage = 'bannerMessage',\r\n BaseUrl = 'baseUrl',\r\n CommercialEmail = 'commercialEmail',\r\n CommercialPreflightUploads = 'commercialPreflightUploadsEnabled',\r\n VaveMaxEffectiveDateDays = 'vaveMaxEffectiveDateDays',\r\n EnvironmentType = 'environmentType',\r\n FloodFeatureFlag = 'floodFeatureFlag',\r\n HomeownersEAndS = 'homeownersEandSEnabled',\r\n RequestEAndSQuoteEnabled = 'requestEAndSQuoteEnabled',\r\n}\r\n\r\n/* Returns the value from a boolean AppSetting. */\r\nexport function getBooleanAppSetting(appSetting: AppSetting) {\r\n return toBoolean((window as any)[appSetting]);\r\n}\r\n\r\n/* Returns the value from a string AppSetting. */\r\nexport function getStringAppSetting(appSetting: AppSetting) {\r\n const stringSetting: string = (window as any)[appSetting];\r\n return stringSetting;\r\n}\r\n\r\n/** Returns the string array value from a comma-delineated string list AppSetting. */\r\nexport function getListAppSetting(appSetting: AppSetting): string[] {\r\n const stringList: string = (window as any)[appSetting];\r\n\r\n if (!!stringList) {\r\n const listNoCommas = stringList.split(','),\r\n arrayTrimmedValues = listNoCommas.map(s => s.trim());\r\n return arrayTrimmedValues;\r\n }\r\n\r\n return [];\r\n}\r\n\r\n/** Returns true if the provided value is included in an app setting list. */\r\nexport function isInListAppSetting(appSetting: AppSetting, value: string): boolean {\r\n const stringList = getListAppSetting(appSetting);\r\n return stringList.includes(value);\r\n}\r\n\r\n/** Returns the HTML string from an encoded HTML AppSetting.\r\n * AppSettings can only use encoded html, so this passes the encoded string through a textarea element, which decodes it as an html string. */\r\nexport function getHtmlAppSetting(appSetting: AppSetting): string {\r\n const textArea = document.createElement('textarea');\r\n textArea.innerHTML = (window as any)[appSetting];\r\n return textArea.value;\r\n}\r\n\r\n/** Returns the number value from a number AppSetting. */\r\nexport function getNumberAppSetting(appSetting: AppSetting): number {\r\n const numberSetting: number = (window as any)[appSetting];\r\n return numberSetting;\r\n}\r\n"],"names":["AppSetting","getBooleanAppSetting","appSetting","toBoolean","getStringAppSetting","getNumberAppSetting"],"mappings":"yCAEY,IAAAA,GAAAA,IACRA,EAAA,mBAAqB,4BACrBA,EAAA,mBAAqB,qBACrBA,EAAA,8BAAgC,gCAChCA,EAAA,OAAS,gBACTA,EAAA,YAAc,cACdA,EAAA,cAAgB,gBAChBA,EAAA,QAAU,UACVA,EAAA,gBAAkB,kBAClBA,EAAA,2BAA6B,oCAC7BA,EAAA,yBAA2B,2BAC3BA,EAAA,gBAAkB,kBAClBA,EAAA,iBAAmB,mBACnBA,EAAA,gBAAkB,yBAClBA,EAAA,yBAA2B,2BAdnBA,IAAAA,GAAA,CAAA,CAAA,EAkBL,SAASC,EAAqBC,EAAwB,CAClD,OAAAC,EAAW,OAAeD,CAAU,CAAC,CAChD,CAGO,SAASE,EAAoBF,EAAwB,CAEjD,OADwB,OAAeA,CAAU,CAE5D,CA8BO,SAASG,EAAoBH,EAAgC,CAEzD,OADwB,OAAeA,CAAU,CAE5D"}