{"version":3,"file":"static/js/index.91d4b885.js","sources":["webpack://mepla-simple/./src/features/app/config/configManager.ts","webpack://mepla-simple/./src/features/app/config/configType.ts","webpack://mepla-simple/./src/appConfig.ts","webpack://mepla-simple/./src/index.tsx"],"sourcesContent":["import { IAppConfig } from './configType';\n\nclass AppConfig {\n\tprivate cachedAppConfig: IAppConfig;\n\n\tpublic constructor() {\n\t\tthis.cachedAppConfig = {} as IAppConfig;\n\t}\n\n\tpublic getConfig(): IAppConfig {\n\t\treturn this.cachedAppConfig;\n\t}\n\n\tpublic setConfig(config: IAppConfig): void {\n\t\tObject.assign(this.cachedAppConfig, config);\n\t}\n}\n\nconst configManager = new AppConfig();\nexport default configManager;\n","import { PermissionsConfig } from 'features-apollo/user/types';\nimport { Permission } from 'services/apollo/types/generated';\nimport { AadEnvironment } from 'services/auth';\nimport { TestHeaderConfig } from 'services/types';\n\nexport type IAppConfig = {\n\tappEnvironment: AppEnvironment;\n\tappInsightsKey: string;\n\taadTenantId: string;\n\tauthority: string;\n\taadAppRegistrationId: string;\n\taad: AadEnvironment;\n\tservices: ServicesAppConfig;\n\tpermissions: PermissionsConfig;\n\ttranslation: TranslationAppConfig;\n\tlinks: LinksAppConfig;\n\thostnames: HostNamesAppConfig;\n\thostNameByPortalShell: { [key: string]: string };\n\tapolloRequestInspectorAvailable?: boolean;\n\th5: H5Config | null;\n};\n\nexport interface ServicesAppConfig extends TestHeaderConfig {\n\tquotecenterBackend: QuoteCenterBackendAppConfig;\n\tapproval: ServicesCommonAppConfig | undefined;\n\taddressValidation: ServicesCommonAppConfig | undefined;\n\tagreement: ServicesCommonAppConfig | undefined;\n\tbd360: ServicesCommonAppConfig | undefined;\n\tbusinessStore: businessStoreAppConfig | undefined;\n\tconfigurePrice: ServicesCommonAppConfig;\n\tcrm: CRMAppConfig | undefined;\n\tcwa: CWAAppConfig | undefined;\n\tldss: ServicesCommonAppConfig | undefined;\n\tnotifications: ServicesCommonAppConfig | undefined;\n\toneAsk: ServicesCommonAppConfig | undefined;\n\tproposal: ProposalAppConfig | undefined;\n\tproposalAttachment: ServicesCommonAppConfig | undefined;\n\tpurchase: ServicesCommonAppConfig | undefined;\n\tserviceDeskAttachments: ServicesCommonAppConfig | undefined;\n\tsignUp: ServicesCommonAppConfig | undefined;\n\tflights: FlightsAppConfig | undefined;\n}\n\nexport interface ServicesCommonAppConfig {\n\tendpoint: string;\n\tendpoint1P?: string;\n\tscopes: string[];\n\tscopes1P?: string[];\n}\n\nexport interface CRMAppConfig extends ServicesCommonAppConfig {\n\tonBehalfOf: boolean;\n\texternalLinkMSX: string;\n}\n\nexport interface businessStoreAppConfig {\n\tendpoint: string;\n\tendpointForIndirectFGI: string;\n}\n\nexport interface CWAAppConfig {\n\tendpoint: string;\n}\n\nexport interface FlightsAppConfig extends ServicesCommonAppConfig {\n\tdefaultFlightMode: DefaultFlightMode;\n\tdisplayFlightPanel: boolean;\n}\n\nexport interface PermissionAppConfig {\n\tallOf: Permission[] | undefined;\n\toneOf: Permission[];\n}\n\nexport interface ProposalAppConfig extends ServicesCommonAppConfig {\n\tendpointV12: string;\n\tsupportOfferUrl: string;\n\tclaimType: ProposalClaimTypeAppConfig;\n\tproductIds: ProposalProductIdsAppConfig;\n\ttotalAzurePlansAvailable: number;\n\tmaxDiscountableLineItems: number;\n\tmaxPurchasableLineItems: number;\n}\n\nexport interface ProposalClaimTypeAppConfig {\n\tpricingAudience: string;\n\tnationalCloud: string;\n\tagreementType: string;\n}\n\nexport interface ProposalProductIdsAppConfig {\n\tazurePlan: string;\n\tdiscountFulfillmentDocument: string;\n\tazureFamilyDiscount: string;\n}\n\nexport interface TranslationAppConfig {\n\tpseudoLoc: string;\n}\nexport interface QuoteCenterBackendAppConfig extends ServicesCommonAppConfig {\n\tuseEnvironmentOverrides: boolean;\n\tenvironmentOverrides: OverridableEnvironments;\n}\n\nexport interface OverridableEnvironments {\n\taddressvalidationenvironment?: string;\n\tadminenvironment?: string;\n\tagreementsenvironment?: string;\n\tapprovalenvironment?: string;\n\tbd360environment?: string;\n\tbusinesscontactenvironment?: string;\n\tcatalogenvironment?: string;\n\tconfigurepriceenvironment?: string;\n\tccfenvironment?: string;\n\tcreditenvironment?: string;\n\tcrmenvironment?: string;\n\tcrmfgoeenvironment?: string;\n\tdealtotalityenvironment?: string;\n\tedgeenvironment?: string;\n\tedgesearchenvironment?: string;\n\tempowermentenvironment?: string;\n\tentitlementenvironment?: string;\n\tmcapiauthorizationenvironment?: string;\n\toneaskenvironment?: string;\n\torganizationenvironment?: string;\n\tpricingscopeenvironment?: string;\n\tprojectenvironment?: string;\n\tpurchaseenvironment?: string;\n\tquoteenvironment?: string;\n\trecipientenvironment?: string;\n\trelationshipenvironment?: string;\n\tservicedeskenvironment?: string;\n\tuserpreferencesenvironment?: string;\n}\n\nexport interface HostNamesAppConfig {\n\tquotecenter: string;\n\tproposalsMicrosoftProd?: string;\n\tpartnerProd?: string;\n\tpartnerPPE?: string;\n\tpartnerInt?: string;\n\tpartnerTest?: string;\n\tmsxLocal?: string;\n\tmsxUAT?: string;\n\tmsxProd?: string;\n\tmsxPerf?: string;\n\tmsxSQA?: string;\n\tmsxDev?: string;\n\tmsxSupport?: string;\n\tmsxPreProd?: string;\n\tmsxFedSalesDev?: string;\n\tmsxUsxDemo?: string;\n}\nexport interface LinksAppConfig {\n\tprivacyUrl: string;\n\ttermsOfUseUrl: string;\n\tfabricFontsUrl: string;\n\tfabricIconUrl: string;\n\takaUrl: string;\n\tmicrosoftUrl: string;\n\tbingUrl: string;\n\tquoteCenterUrl: string;\n\tquoteCenterDemoUrl: string;\n\tquoteCenterLatestUrl: string;\n\taudioConferenceOverageRatesUrl: string;\n\tvideoConferenceOverageRatesUrl: string;\n\tglobalFinancialServicesUrl: string;\n\tsharedOnlineAccountsUrl: string;\n\tstandardSupportUrl: string;\n\tlearnB2CTenantsUrl: string;\n\tlearnDomainsAdminTakeOverUrl: string;\n\tmicrosoftCustomerAgreementScopesUrl: string;\n\tlearnFinancingTermsVideoUrl: string;\n\tlearnHelpVideoUrl: string;\n\tlearnBillingProfileUrl: string;\n\tlearnECIFPolicyUrl: string;\n\tlearnManageProposalPropertiesUrl: string;\n\tproposalDocsUrl: string;\n\tknowledgeBasePCHowToAccessUrl: string;\n\tknowledgeBaseMSXOverviewUrl: string;\n\tknowledgeBaseMSXFAQUrl: string;\n\tpartnerCenterFeedbackUrl: string;\n\tfieldLedSupportUrl: string;\n\tgetHelpUrl: string;\n\tncoeSupportDocumentationUrl?: string;\n\tncoePrivacyUrl?: string;\n\tacceptanceModesInformationUrl: string;\n\thowToGuide: string;\n\trolesAndPermissions: string;\n\tbillingAccounts: string;\n\tempowermentOrApprovals: string;\n\tviewAgreementAndTerms: string;\n\tseeMore: string;\n\tprovideFeedback: string;\n}\n\nexport enum AppEnvironment {\n\tLocal = 'DEV',\n\tLatest = 'INT',\n\tStable = 'PPE',\n\tTest = 'TEST',\n\tProd = 'PROD',\n}\n\nexport enum DefaultFlightMode {\n\tLatest = 'latest',\n\tStable = 'stable',\n\tTest = 'test',\n\tInsider = 'insider',\n\tProd = 'production',\n\tDemo = 'demo',\n\tmsxLatest = 'msxlatest',\n\tmsxStable = 'msxstable',\n\tmsxProd = 'msxprod',\n\tUsxDemo = 'usxdemo',\n\tFedSalesDev = 'fedSalesDev',\n}\n\nexport interface H5FragmentConfig {\n\tcdnUrl: string | null;\n}\n\nexport interface H5Config {\n\tworkspaces: H5FragmentConfig;\n\tterms: H5FragmentConfig;\n\tproducts: H5FragmentConfig;\n\tcommerce: H5FragmentConfig;\n}\n","// Importing indexApp.tsx is done dynamically to allow for the appsettings.json file to be loaded first.\n// If import need to be included at top level make sure those imports are not dependent on appsettings.json file.\n// It also handles the logic for overriding appsettings based on hostname for MSX environments.\n\nimport configManager from 'features/app/config/configManager';\nimport { DefaultFlightMode, FlightsAppConfig, IAppConfig } from 'features/app/config/configType';\n\nconst publicUrl = process.env.PUBLIC_URL || '';\n\nfunction isLocalUrl() {\n\treturn (\n\t\twindow.location.hostname === 'local.c3.mepla.microsoft.com' ||\n\t\twindow.location.hostname === 'localhost' ||\n\t\twindow.location.hostname === 'msxplatform.crm.dynamics.com'\n\t);\n}\n\nexport async function initializeAppConfig() {\n\ttry {\n\t\tconst response = isLocalUrl()\n\t\t\t? await fetch(`${publicUrl}/settings/ms.local.appsettings.json`)\n\t\t\t: await fetch(`${publicUrl}/appsettings.json`);\n\t\tif (!response.ok) {\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to fetch proposal workspace appsettings: ${response.status} ${response.statusText}`\n\t\t\t);\n\t\t}\n\t\tlet data = (await response.json()) as IAppConfig;\n\t\tdata = processData(data);\n\t\tconfigManager.setConfig(data);\n\t} catch (error) {\n\t\tconsole.error(`Error in proposal workspace - initializeAppConfig: ${error}`);\n\t}\n}\n\nexport function processData(data: IAppConfig): IAppConfig {\n\t// override appsettings based on hostname\n\tif (data && data.services != null) {\n\t\tswitch (window.location.hostname) {\n\t\t\tcase data.hostnames?.msxLocal:\n\t\t\tcase data.hostnames?.msxSupport: {\n\t\t\t\tdata.services.flights = {\n\t\t\t\t\t...data.services.flights,\n\t\t\t\t\tdefaultFlightMode: DefaultFlightMode.msxProd,\n\t\t\t\t} as FlightsAppConfig;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase data.hostnames?.msxDev: {\n\t\t\t\tdata.services.flights = {\n\t\t\t\t\t...data.services.flights,\n\t\t\t\t\tdefaultFlightMode: DefaultFlightMode.msxLatest,\n\t\t\t\t} as FlightsAppConfig;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase data.hostnames?.msxFedSalesDev: {\n\t\t\t\tdata.services.flights = {\n\t\t\t\t\t...data.services.flights,\n\t\t\t\t\tdefaultFlightMode: DefaultFlightMode.FedSalesDev,\n\t\t\t\t} as FlightsAppConfig;\n\t\t\t\tif (data.services.quotecenterBackend != null) {\n\t\t\t\t\tdata.services.quotecenterBackend.environmentOverrides = {\n\t\t\t\t\t\t// we're intentionally targeting the fedsalesdev1 environment to INT Quotes API to facilitate the 100-day demo\n\t\t\t\t\t\t// initiative\n\t\t\t\t\t\t...data.services.quotecenterBackend.environmentOverrides,\n\t\t\t\t\t\tcrmfgoeenvironment: 'fedsalesdev1',\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase data.hostnames?.msxUsxDemo: {\n\t\t\t\tdata.services.flights = {\n\t\t\t\t\t...data.services.flights,\n\t\t\t\t\tdefaultFlightMode: DefaultFlightMode.UsxDemo,\n\t\t\t\t} as FlightsAppConfig;\n\t\t\t\tif (data.services.quotecenterBackend != null) {\n\t\t\t\t\tdata.services.quotecenterBackend.environmentOverrides = {\n\t\t\t\t\t\t// we're intentionally targeting the usxdemo environment to INT Quotes API to facilitate the 100-day demo\n\t\t\t\t\t\t// initiative\n\t\t\t\t\t\t...data.services.quotecenterBackend.environmentOverrides,\n\t\t\t\t\t\tcrmfgoeenvironment: 'usxdemo',\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase data.hostnames?.msxPerf:\n\t\t\tcase data.hostnames?.msxPreProd:\n\t\t\tcase data.hostnames?.msxSQA:\n\t\t\tcase data.hostnames?.msxUAT: {\n\t\t\t\tdata.services.flights = {\n\t\t\t\t\t...data.services.flights,\n\t\t\t\t\tdefaultFlightMode: DefaultFlightMode.msxStable,\n\t\t\t\t} as FlightsAppConfig;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase data.hostnames?.msxProd: {\n\t\t\t\tdata.services.flights = {\n\t\t\t\t\t...data.services.flights,\n\t\t\t\t\tdefaultFlightMode: DefaultFlightMode.msxProd,\n\t\t\t\t} as FlightsAppConfig;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn data;\n}\n","// Importing indexApp.tsx is done dynamically to allow for the appsettings.json file to be loaded first.\n// If import need to be included at top level make sure those imports are not dependent on appsettings.json file.\n// It also handles the logic for overriding appsettings based on hostname for MSX environments.\n\nimport { initializeAppConfig } from 'appConfig';\n\ninitializeAppConfig().then(async () => {\n\tawait import(/* webpackChunkName: \"indexApp\" */ 'indexApp');\n});\n"],"names":["AppConfig","config","Object","AppEnvironment","DefaultFlightMode","publicUrl","process","initializeAppConfig","response","isLocalUrl","window","fetch","Error","data","processData","configManager","error","console"],"mappings":"gFAmBA,MADsB,IAhBtB,MAAMA,EACG,eAA4B,AAEpC,cAAqB,CACpB,IAAI,CAAC,eAAe,CAAG,CAAC,CACzB,CAEO,WAAwB,CAC9B,OAAO,IAAI,CAAC,eAAe,AAC5B,CAEO,UAAUC,CAAkB,CAAQ,CAC1CC,OAAO,MAAM,CAAC,IAAI,CAAC,eAAe,CAAED,EACrC,CACD,C,gCCoLYE,EAQAC,E,wDARAD,EAAAA,GAAAA,CAAAA,EAAAA,CAAAA,CAAAA,G,uEAQAC,EAAAA,GAAAA,CAAAA,EAAAA,CAAAA,CAAAA,G,w6LCrMZ,IAAMC,EAAYC,0CAUX,eAAeC,IACrB,GAAI,CACH,IAAMC,EAAWC,AARjBC,AAA6B,iCAA7BA,OAAO,QAAQ,CAAC,QAAQ,EACxBA,AAA6B,cAA7BA,OAAO,QAAQ,CAAC,QAAQ,EACxBA,AAA6B,iCAA7BA,OAAO,QAAQ,CAAC,QAAQ,CAOrB,MAAMC,MAAM,CAAC,EAAEN,EAAU,mCAAmC,CAAC,EAC7D,MAAMM,MAAM,CAAC,EAAEN,EAAU,iBAAiB,CAAC,EAC9C,GAAI,CAACG,EAAS,EAAE,CACf,MAAM,AAAII,MACT,CAAC,gDAAgD,EAAEJ,EAAS,MAAM,CAAC,CAAC,EAAEA,EAAS,UAAU,CAAC,CAAC,EAG7F,IAAIK,EAAQ,MAAML,EAAS,IAAI,GAC/BK,EAAOC,AAOF,SAAqBD,CAAgB,EAE3C,GAAIA,GAAQA,AAAiB,MAAjBA,EAAK,QAAQ,CACxB,OAAQH,OAAO,QAAQ,CAAC,QAAQ,EAC/B,KAAKG,EAAK,SA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