@postnord/pn-marketweb-components 3.4.36 → 3.4.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/pn-marketweb-siteheader-login-button_5.cjs.entry.js +3 -3
- package/cjs/pn-marketweb-siteheader-login-button_5.cjs.entry.js.map +1 -1
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.js +2 -2
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.js.map +1 -1
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.js +1 -1
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.js.map +1 -1
- package/components/pn-marketweb-siteheader-login-button2.js +2 -2
- package/components/pn-marketweb-siteheader-login-button2.js.map +1 -1
- package/components/pn-marketweb-siteheader-login-profileselection2.js +1 -1
- package/components/pn-marketweb-siteheader-login-profileselection2.js.map +1 -1
- package/esm/pn-marketweb-siteheader-login-button_5.entry.js +3 -3
- package/esm/pn-marketweb-siteheader-login-button_5.entry.js.map +1 -1
- package/package.json +1 -1
- package/pn-market-web-components/p-bba1a00a.entry.js +2 -0
- package/pn-market-web-components/p-bba1a00a.entry.js.map +1 -0
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/pn-market-web-components/p-2b9e6252.entry.js +0 -2
- package/pn-market-web-components/p-2b9e6252.entry.js.map +0 -1
|
@@ -39,11 +39,11 @@ const PnMarketwebSiteheaderLoginButton = class {
|
|
|
39
39
|
this.loginUrl = getLoginUrl(this.useMarketwebLogin, this.environment);
|
|
40
40
|
}
|
|
41
41
|
nagivateToLoginUrl() {
|
|
42
|
-
const navigationUrl = `${this.loginUrl}${window.location.href}`;
|
|
42
|
+
const navigationUrl = `${this.loginUrl}${encodeURIComponent(window.location.href)}`;
|
|
43
43
|
return navigationUrl;
|
|
44
44
|
}
|
|
45
45
|
render() {
|
|
46
|
-
return (index.h(index.Host, { key: '
|
|
46
|
+
return (index.h(index.Host, { key: '1b59b2a7ddcb13b6e018e5a9dfe2d70c00650a54' }, index.h("pn-button", { key: 'fdee62f0d6bfa293bf9b84f41342b5c57f11faa5', href: this.nagivateToLoginUrl() }, this.label)));
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
PnMarketwebSiteheaderLoginButton.style = PnMarketwebSiteheaderLoginButtonStyle0;
|
|
@@ -349,7 +349,7 @@ const PnMarketwebSiteheaderLoginProfileselection = class {
|
|
|
349
349
|
.filter(x => x.selected !== true)
|
|
350
350
|
.map(organization => {
|
|
351
351
|
let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;
|
|
352
|
-
return (index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, index.h("a", { href: `${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${window.location.href}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, organization.name), index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, organization.customerNumber ? organization.customerNumber : this.userEmail)), index.h("pn-icon", { icon: arrow_right.arrow_right, small: "false", color: "blue700" }))));
|
|
352
|
+
return (index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, index.h("a", { href: `${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, organization.name), index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, organization.customerNumber ? organization.customerNumber : this.userEmail)), index.h("pn-icon", { icon: arrow_right.arrow_right, small: "false", color: "blue700" }))));
|
|
353
353
|
}), this.logoutLink ? (index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-logout" }, index.h("a", { href: this.logoutLink.href, rel: "nofollower noopener", id: "pn-marketweb-header-logoutlink", onClick: () => pnMarketwebSiteheaderStore.state.loginManager.clearUserData(), class: "pn-marketweb-siteheader-login-profileselection-logout-link" }, this.logoutLink.linkText))) : null));
|
|
354
354
|
}
|
|
355
355
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pn-marketweb-siteheader-login-button.pn-marketweb-siteheader-login-links.pn-marketweb-siteheader-login-mypage-button.pn-marketweb-siteheader-login-profileselection.pn-marketweb-siteheader-unified-login.entry.cjs.js","mappings":";;;;;;;;;AAAO,MAAM,WAAW,GAAG,CAAC,iBAAyB,EAAE,WAAkB;IAEzE,MAAM,sBAAsB,GAAG,YAAY,CAAC;IAE5C,MAAM,UAAU,GAAG,uFAAuF,CAAC;IAC3G,MAAM,WAAW,GAAG,qFAAqF,CAAC;IAC1G,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;IAE9C,IAAG,iBAAiB,EAClB;QACE,OAAO,iBAAiB,CAAC;KAC1B;SACK,IAAI,WAAW,CAAC,WAAW,EAAE,KAAK,sBAAsB,EAAE;QAC5D,OAAO,UAAU,CAAC;KACnB;SAAM;QACH,OAAO,WAAW,CAAC;KACtB;AACH,CAAC;;ACjBH,MAAM,mCAAmC,GAAG,EAAE,CAAC;AAC/C,+CAAe,mCAAmC;;MCOrC,gCAAgC;;;qBAEnB,QAAQ;iCACK,KAAK;2BACZ,OAAO;;;IAErC,QAAQ,CAAS;IAEjB,iBAAiB;QACf,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;KACvE;IAED,kBAAkB;QAChB,MAAM,aAAa,GAAG,GAAG,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,C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AAsE,IAC/EA,iBAAK,KAAK,EAAC,mEAAmE,IAAE,YAAY,CAAC,IAAI,CAAO,EACxGA,iBAAK,KAAK,EAAC,0EAA0E,IAClF,YAAY,CAAC,cAAc,GAAG,YAAY,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CACvE,CACF,EACNA,qBAAS,IAAI,EAAEG,uBAAW,EAAE,KAAK,EAAC,OAAO,EAAC,KAAK,EAAC,SAAS,GAAW,CAClE,CACA,EACN;SACH,CAAC,EAEH,IAAI,CAAC,UAAU,IACdH,iBAAK,KAAK,EAAC,uDAAuD,IAEhEA,eACE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,EAC1B,GAAG,EAAC,qBAAqB,EACzB,EAAE,EAAC,gCAAgC,EACnC,OAAO,EAAE,MAAME,gCAAW,CAAC,YAAY,CAAC,aAAa,EAAE,EACvD,KAAK,EAAC,4DAA4D,IAEjE,IAAI,CAAC,UAAU,CAAC,QAAQ,CACvB,CACA,IACJ,IAAI,CACH,EACP;KACH;;;;AClRH,MAAM,oCAAoC,GAAG,EAAE,CAAC;AAChD,gDAAe,oCAAoC;;MCKtC,iCAAiC;;;wBAEhB,KAAK;;;;;;;;IAOjC,MAAM;QACJ,QACEF,QAACC,UAAI,uDACF,IAAI,CAAC,QAAQ,IACZD,yDAA6C,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,GAAI,KAEnGA,kDACI,KAAK,EAAE,IAAI,CAAC,UAAU,EACtB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EACzC,WAAW,EAAE,IAAI,CAAC,WAAW,GAC3B,CACP,CACI,EACP;KACH;;;;;;;;;;","names":["h","Host","headerState","arrow_right"],"sources":["src/components/layout-components/pn-marketweb-siteheader/unifiedLoginHelper.ts","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.scss?tag=pn-marketweb-siteheader-login-button","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.scss?tag=pn-marketweb-siteheader-login-links","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.scss?tag=pn-marketweb-siteheader-login-mypage-button","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.scss?tag=pn-marketweb-siteheader-login-profileselection","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.scss?tag=pn-marketweb-siteheader-unified-login","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.tsx"],"sourcesContent":["export const getLoginUrl = (useMarketwebLogin:boolean, environment:string) => {\n\nconst environment_Production = \"PRODUCTION\";\n\nconst devAuthUrl = 'https://atportal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst prodAuthUrl = 'https://portal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst marketwebLoginUrl = '/login?returnUrl=';\n\nif(useMarketwebLogin)\n {\n return marketwebLoginUrl;\n }\n else if (environment.toUpperCase() !== environment_Production) {\n return devAuthUrl;\n } else {\n return prodAuthUrl;\n } \n };\n","pn-marketweb-siteheader-login-button {\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\nimport { getLoginUrl } from './unifiedLoginHelper';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-button',\n styleUrl: 'pn-marketweb-siteheader-login-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Log in';\n @Prop() useMarketwebLogin: boolean = false;\n @Prop() environment: string = 'local';\n \n loginUrl: string;\n\n componentWillLoad() {\n this.loginUrl = getLoginUrl(this.useMarketwebLogin, this.environment);\n }\n\n nagivateToLoginUrl() {\n const navigationUrl = `${this.loginUrl}${window.location.href}`;\n return navigationUrl;\n }\n\n render() {\n return (\n <Host>\n <pn-button href={this.nagivateToLoginUrl()}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n","@import '../../../globals/main.scss';\n\n@import './pn-marketweb-siteheader-common.scss';\n\npn-marketweb-siteheader-login-links {\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog } from './pn-marketweb-siteheader-types';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-links',\n styleUrl: 'pn-marketweb-siteheader-login-links.scss',\n})\nexport class PnMarketwebSiteheaderLoginLinks {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() idNamespace: string = '';\n @Prop({ reflect: true }) loggedin: boolean = false;\n @Prop() username: string = '';\n @Prop() showUnifiedLogin: boolean = false;\n\n componentWillLoad() {\n this.init();\n }\n\n @Watch('loginDialog')\n async init() {\n this.adjustLoginLinks();\n }\n adjustLoginLinks() {\n if (!this.loginDialog) {\n return;\n }\n\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n link.href = link.href.replace('window.location.href', window.location.href);\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loginMenuLinks) {\n this.loginDialog?.loginMenuLinks.forEach(adjustLink);\n }\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.loginDialog.legacyLoginLinks = [\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.loginUrl),\n linkText: this.loginDialog.loginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n linkType: 'primary',\n primaryLinkApperance: true,\n },\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.registerUrl),\n linkText: this.loginDialog.createLoginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n primaryLinkApperance: false,\n },\n ];\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {\n username: null,\n loggedin: false,\n };\n if (this.username) {\n hostElementAttribute.username = this.username;\n hostElementAttribute.loggedin = this.loggedin;\n }\n return (\n <Host {...hostElementAttribute}>\n {!this.loginDialog.overrideLoginMenu ? (\n <div data-loggedin={this.loggedin + ''}>\n {this.loggedin ? (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.loggedInLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n ) : (\n <div>\n {/* Get login links from API */}\n {this.loginDialog.loginMenuLinks?.length > 0 ? (\n <pn-marketweb-siteheader-login-linklist\n heading={this.loginDialog.loginTitle}\n links={this.loginDialog.loginMenuLinks}\n idNamespace={this.idNamespace}\n showUnifiedLogin={this.showUnifiedLogin}\n ></pn-marketweb-siteheader-login-linklist>\n ) : (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.legacyLoginLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n )}\n </div>\n )}\n </div>\n ) : null}\n\n {/* Override the default logic for some markets such as DK */}\n {this.loginDialog.overrideLoginMenu ? (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.loginMenuLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n ) : null}\n </Host>\n );\n }\n}\n","pn-marketweb-siteheader-login-mypage-button {\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-mypage-button',\n styleUrl: 'pn-marketweb-siteheader-login-mypage-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginMypageButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Mina sidor!';\n @Prop() myPageUrl: string;\n\n render() {\n return (\n <Host>\n <pn-button href={this.myPageUrl}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n","@import '../../../globals/main.scss';\n\n@import './pn-marketweb-siteheader-common.scss';\n\npn-marketweb-siteheader-login-profileselection {\n}\n\n.pn-marketweb-siteheader-login-profileselection-heading {\n display: block;\n padding: 0.5rem 0 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user,\n.pn-marketweb-siteheader-login-profileselection-currentprofile {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-name,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-name {\n line-height: 1;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-description,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-divider {\n height: 1rem;\n width: 100%;\n background: $blue400;\n position: relative;\n\n margin-left: -1em; // Negative positioning due to nav dropdown's padding\n margin-top: 1.6rem;\n margin-bottom: 1.6rem;\n border-radius: 0 0.6em 0.6em 0;\n padding: 0;\n &::after {\n content: '';\n width: 0.6em;\n height: 0.6em;\n border-radius: 50%;\n position: absolute;\n right: 0;\n top: 0;\n background: inherit;\n transform: translateX(calc(100% + 0.2em));\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption {\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-link {\n display: flex;\n background: $white;\n transition: background 0.15s ease-in-out;\n // width:100%;\n margin: 0 -1em; // Negative margin due to dropdown content padding\n padding: 0.6rem 1.6rem;\n text-decoration: none;\n color: $blue700;\n align-items: center;\n &:hover,\n &:focus,\n &:active {\n background: $gray50;\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-content {\n flex-grow: 1;\n}\n.pn-marketweb-siteheader-login-profileselection-profileoption-name {\n font-weight: 700;\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout {\n padding: 1.6rem;\n text-align: center;\n width: 100%;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout-link {\n display: inline-block;\n font-weight: 500;\n color: $blue700;\n text-decoration: none;\n &:hover,\n &:focus,\n &:active {\n text-decoration: underline;\n }\n}\n","import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n <div class=\"pn-marketweb-siteheader-login-profileselection-divider\"></div>\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${window.location.href}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\"\n >\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">{organization.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <a\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n >\n {this.logoutLink.linkText}\n </a>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n","","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pn-marketweb-siteheader-unified-login',\n styleUrl: 'pn-marketweb-siteheader-unified-login.scss',\n})\nexport class PnMarketwebSiteheaderUnifiedLogin {\n @Element() hostElement: HTMLElement;\n @Prop() loggedIn: boolean = false;\n @Prop() myPageLabel: string;\n @Prop() myPageUrl: string;\n @Prop() logInLabel: string;\n @Prop() useMarketwebLogin: boolean;\n @Prop() environment: string;\n\n render() {\n return (\n <Host>\n {this.loggedIn ? (\n <pn-marketweb-siteheader-login-mypage-button label={this.myPageLabel} myPageUrl={this.myPageUrl} />\n ) : (\n <pn-marketweb-siteheader-login-button \n label={this.logInLabel} \n useMarketwebLogin={this.useMarketwebLogin} \n environment={this.environment}\n />\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"pn-marketweb-siteheader-login-button.pn-marketweb-siteheader-login-links.pn-marketweb-siteheader-login-mypage-button.pn-marketweb-siteheader-login-profileselection.pn-marketweb-siteheader-unified-login.entry.cjs.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AC,UAAU,CAAC,IAAI,EAC1B,GAAG,EAAC,qBAAqB,EACzB,EAAE,EAAC,gCAAgC,EACnC,OAAO,EAAE,MAAME,gCAAW,CAAC,YAAY,CAAC,aAAa,EAAE,EACvD,KAAK,EAAC,4DAA4D,IAEjE,IAAI,CAAC,UAAU,CAAC,QAAQ,CACvB,CACA,IACJ,IAAI,CACH,EACP;KACH;;;;AClRH,MAAM,oCAAoC,GAAG,EAAE,CAAC;AAChD,gDAAe,oCAAoC;;MCKtC,iCAAiC;;;wBAEhB,KAAK;;;;;;;;IAOjC,MAAM;QACJ,QACEF,QAACC,UAAI,uDACF,IAAI,CAAC,QAAQ,IACZD,yDAA6C,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,GAAI,KAEnGA,kDACI,KAAK,EAAE,IAAI,CAAC,UAAU,EACtB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EACzC,WAAW,EAAE,IAAI,CAAC,WAAW,GAC3B,CACP,CACI,EACP;KACH;;;;;;;;;;","names":["h","Host","headerState","arrow_right"],"sources":["src/components/layout-components/pn-marketweb-siteheader/unifiedLoginHelper.ts","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.scss?tag=pn-marketweb-siteheader-login-button","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.scss?tag=pn-marketweb-siteheader-login-links","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.scss?tag=pn-marketweb-siteheader-login-mypage-button","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.scss?tag=pn-marketweb-siteheader-login-profileselection","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.scss?tag=pn-marketweb-siteheader-unified-login","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.tsx"],"sourcesContent":["export const getLoginUrl = (useMarketwebLogin:boolean, environment:string) => {\n\nconst environment_Production = \"PRODUCTION\";\n\nconst devAuthUrl = 'https://atportal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst prodAuthUrl = 'https://portal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst marketwebLoginUrl = '/login?returnUrl=';\n\nif(useMarketwebLogin)\n {\n return marketwebLoginUrl;\n }\n else if (environment.toUpperCase() !== environment_Production) {\n return devAuthUrl;\n } else {\n return prodAuthUrl;\n } \n };\n","pn-marketweb-siteheader-login-button {\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\nimport { getLoginUrl } from './unifiedLoginHelper';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-button',\n styleUrl: 'pn-marketweb-siteheader-login-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Log in';\n @Prop() useMarketwebLogin: boolean = false;\n @Prop() environment: string = 'local';\n \n loginUrl: string;\n\n componentWillLoad() {\n this.loginUrl = getLoginUrl(this.useMarketwebLogin, this.environment);\n }\n\n nagivateToLoginUrl() {\n const navigationUrl = `${this.loginUrl}${encodeURIComponent(window.location.href)}`;\n return navigationUrl;\n }\n\n render() {\n return (\n <Host>\n <pn-button href={this.nagivateToLoginUrl()}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n","@import '../../../globals/main.scss';\n\n@import './pn-marketweb-siteheader-common.scss';\n\npn-marketweb-siteheader-login-links {\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog } from './pn-marketweb-siteheader-types';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-links',\n styleUrl: 'pn-marketweb-siteheader-login-links.scss',\n})\nexport class PnMarketwebSiteheaderLoginLinks {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() idNamespace: string = '';\n @Prop({ reflect: true }) loggedin: boolean = false;\n @Prop() username: string = '';\n @Prop() showUnifiedLogin: boolean = false;\n\n componentWillLoad() {\n this.init();\n }\n\n @Watch('loginDialog')\n async init() {\n this.adjustLoginLinks();\n }\n adjustLoginLinks() {\n if (!this.loginDialog) {\n return;\n }\n\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n link.href = link.href.replace('window.location.href', window.location.href);\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loginMenuLinks) {\n this.loginDialog?.loginMenuLinks.forEach(adjustLink);\n }\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.loginDialog.legacyLoginLinks = [\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.loginUrl),\n linkText: this.loginDialog.loginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n linkType: 'primary',\n primaryLinkApperance: true,\n },\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.registerUrl),\n linkText: this.loginDialog.createLoginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n primaryLinkApperance: false,\n },\n ];\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {\n username: null,\n loggedin: false,\n };\n if (this.username) {\n hostElementAttribute.username = this.username;\n hostElementAttribute.loggedin = this.loggedin;\n }\n return (\n <Host {...hostElementAttribute}>\n {!this.loginDialog.overrideLoginMenu ? (\n <div data-loggedin={this.loggedin + ''}>\n {this.loggedin ? (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.loggedInLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n ) : (\n <div>\n {/* Get login links from API */}\n {this.loginDialog.loginMenuLinks?.length > 0 ? (\n <pn-marketweb-siteheader-login-linklist\n heading={this.loginDialog.loginTitle}\n links={this.loginDialog.loginMenuLinks}\n idNamespace={this.idNamespace}\n showUnifiedLogin={this.showUnifiedLogin}\n ></pn-marketweb-siteheader-login-linklist>\n ) : (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.legacyLoginLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n )}\n </div>\n )}\n </div>\n ) : null}\n\n {/* Override the default logic for some markets such as DK */}\n {this.loginDialog.overrideLoginMenu ? (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.loginMenuLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n ) : null}\n </Host>\n );\n }\n}\n","pn-marketweb-siteheader-login-mypage-button {\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-mypage-button',\n styleUrl: 'pn-marketweb-siteheader-login-mypage-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginMypageButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Mina sidor!';\n @Prop() myPageUrl: string;\n\n render() {\n return (\n <Host>\n <pn-button href={this.myPageUrl}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n","@import '../../../globals/main.scss';\n\n@import './pn-marketweb-siteheader-common.scss';\n\npn-marketweb-siteheader-login-profileselection {\n}\n\n.pn-marketweb-siteheader-login-profileselection-heading {\n display: block;\n padding: 0.5rem 0 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user,\n.pn-marketweb-siteheader-login-profileselection-currentprofile {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-name,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-name {\n line-height: 1;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-description,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-divider {\n height: 1rem;\n width: 100%;\n background: $blue400;\n position: relative;\n\n margin-left: -1em; // Negative positioning due to nav dropdown's padding\n margin-top: 1.6rem;\n margin-bottom: 1.6rem;\n border-radius: 0 0.6em 0.6em 0;\n padding: 0;\n &::after {\n content: '';\n width: 0.6em;\n height: 0.6em;\n border-radius: 50%;\n position: absolute;\n right: 0;\n top: 0;\n background: inherit;\n transform: translateX(calc(100% + 0.2em));\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption {\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-link {\n display: flex;\n background: $white;\n transition: background 0.15s ease-in-out;\n // width:100%;\n margin: 0 -1em; // Negative margin due to dropdown content padding\n padding: 0.6rem 1.6rem;\n text-decoration: none;\n color: $blue700;\n align-items: center;\n &:hover,\n &:focus,\n &:active {\n background: $gray50;\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-content {\n flex-grow: 1;\n}\n.pn-marketweb-siteheader-login-profileselection-profileoption-name {\n font-weight: 700;\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout {\n padding: 1.6rem;\n text-align: center;\n width: 100%;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout-link {\n display: inline-block;\n font-weight: 500;\n color: $blue700;\n text-decoration: none;\n &:hover,\n &:focus,\n &:active {\n text-decoration: underline;\n }\n}\n","import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n <div class=\"pn-marketweb-siteheader-login-profileselection-divider\"></div>\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\"\n >\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">{organization.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <a\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n >\n {this.logoutLink.linkText}\n </a>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n","","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pn-marketweb-siteheader-unified-login',\n styleUrl: 'pn-marketweb-siteheader-unified-login.scss',\n})\nexport class PnMarketwebSiteheaderUnifiedLogin {\n @Element() hostElement: HTMLElement;\n @Prop() loggedIn: boolean = false;\n @Prop() myPageLabel: string;\n @Prop() myPageUrl: string;\n @Prop() logInLabel: string;\n @Prop() useMarketwebLogin: boolean;\n @Prop() environment: string;\n\n render() {\n return (\n <Host>\n {this.loggedIn ? (\n <pn-marketweb-siteheader-login-mypage-button label={this.myPageLabel} myPageUrl={this.myPageUrl} />\n ) : (\n <pn-marketweb-siteheader-login-button \n label={this.logInLabel} \n useMarketwebLogin={this.useMarketwebLogin} \n environment={this.environment}\n />\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -12,11 +12,11 @@ export class PnMarketwebSiteheaderLoginButton {
|
|
|
12
12
|
this.loginUrl = getLoginUrl(this.useMarketwebLogin, this.environment);
|
|
13
13
|
}
|
|
14
14
|
nagivateToLoginUrl() {
|
|
15
|
-
const navigationUrl = `${this.loginUrl}${window.location.href}`;
|
|
15
|
+
const navigationUrl = `${this.loginUrl}${encodeURIComponent(window.location.href)}`;
|
|
16
16
|
return navigationUrl;
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: '1b59b2a7ddcb13b6e018e5a9dfe2d70c00650a54' }, h("pn-button", { key: 'fdee62f0d6bfa293bf9b84f41342b5c57f11faa5', href: this.nagivateToLoginUrl() }, this.label)));
|
|
20
20
|
}
|
|
21
21
|
static get is() { return "pn-marketweb-siteheader-login-button"; }
|
|
22
22
|
static get originalStyleUrls() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pn-marketweb-siteheader-login-button.js","sourceRoot":"","sources":["../../../../src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAMnD,MAAM,OAAO,gCAAgC;;qBAEnB,QAAQ;iCACK,KAAK;2BACZ,OAAO;;IAH1B,WAAW,CAAc;IAKpC,QAAQ,CAAS;IAEjB,iBAAiB;QACf,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACxE,CAAC;IAED,kBAAkB;QAChB,MAAM,aAAa,GAAG,GAAG,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"pn-marketweb-siteheader-login-button.js","sourceRoot":"","sources":["../../../../src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAMnD,MAAM,OAAO,gCAAgC;;qBAEnB,QAAQ;iCACK,KAAK;2BACZ,OAAO;;IAH1B,WAAW,CAAc;IAKpC,QAAQ,CAAS;IAEjB,iBAAiB;QACf,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACxE,CAAC;IAED,kBAAkB;QAChB,MAAM,aAAa,GAAG,GAAG,IAAI,CAAC,QAAQ,GAAG,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACpF,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,kEAAW,IAAI,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAG,IAAI,CAAC,KAAK,CAAa,CAC/D,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop } from '@stencil/core';\n\nimport { getLoginUrl } from './unifiedLoginHelper';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-button',\n styleUrl: 'pn-marketweb-siteheader-login-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Log in';\n @Prop() useMarketwebLogin: boolean = false;\n @Prop() environment: string = 'local';\n \n loginUrl: string;\n\n componentWillLoad() {\n this.loginUrl = getLoginUrl(this.useMarketwebLogin, this.environment);\n }\n\n nagivateToLoginUrl() {\n const navigationUrl = `${this.loginUrl}${encodeURIComponent(window.location.href)}`;\n return navigationUrl;\n }\n\n render() {\n return (\n <Host>\n <pn-button href={this.nagivateToLoginUrl()}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -197,7 +197,7 @@ export class PnMarketwebSiteheaderLoginProfileselection {
|
|
|
197
197
|
.filter(x => x.selected !== true)
|
|
198
198
|
.map(organization => {
|
|
199
199
|
let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;
|
|
200
|
-
return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${window.location.href}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, organization.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, organization.customerNumber ? organization.customerNumber : this.userEmail)), h("pn-icon", { icon: arrow_right, small: "false", color: "blue700" }))));
|
|
200
|
+
return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, organization.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, organization.customerNumber ? organization.customerNumber : this.userEmail)), h("pn-icon", { icon: arrow_right, small: "false", color: "blue700" }))));
|
|
201
201
|
}), this.logoutLink ? (h("div", { class: "pn-marketweb-siteheader-login-profileselection-logout" }, h("a", { href: this.logoutLink.href, rel: "nofollower noopener", id: "pn-marketweb-header-logoutlink", onClick: () => headerState.loginManager.clearUserData(), class: "pn-marketweb-siteheader-login-profileselection-logout-link" }, this.logoutLink.linkText))) : null));
|
|
202
202
|
}
|
|
203
203
|
static get is() { return "pn-marketweb-siteheader-login-profileselection"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pn-marketweb-siteheader-login-profileselection.js","sourceRoot":"","sources":["../../../../src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGzE,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,E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C,YAAY,CAAC,aAAa,EAAE,EACvD,KAAK,EAAC,4DAA4D,IAEjE,IAAI,CAAC,UAAU,CAAC,QAAQ,CACvB,CACA,CACP,CAAC,CAAC,CAAC,IAAI,CACH,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n <div class=\"pn-marketweb-siteheader-login-profileselection-divider\"></div>\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${window.location.href}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\"\n >\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">{organization.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <a\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n >\n {this.logoutLink.linkText}\n </a>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pn-marketweb-siteheader-login-profileselection.js","sourceRoot":"","sources":["../../../../src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGzE,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAMlE,MAAM,OAAO,0CAA0C;;2BAID,IAAI;wBAC7B,EAAE;wBACD,KAAK;2BACH,EAAE;uBACN,IAAI;oBACC;YAC7B,WAAW,EAAE,EAAE;YACf,iBAAiB,EAAE,EAAE;YACrB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,eAAe,EAAE,EAAE;YACnB,6BAA6B,EAAE,EAAE;SAChB;oBAEQ,IA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n <div class=\"pn-marketweb-siteheader-login-profileselection-divider\"></div>\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\"\n >\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">{organization.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <a\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n >\n {this.logoutLink.linkText}\n </a>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -33,11 +33,11 @@ const PnMarketwebSiteheaderLoginButton = /*@__PURE__*/ proxyCustomElement(class
|
|
|
33
33
|
this.loginUrl = getLoginUrl(this.useMarketwebLogin, this.environment);
|
|
34
34
|
}
|
|
35
35
|
nagivateToLoginUrl() {
|
|
36
|
-
const navigationUrl = `${this.loginUrl}${window.location.href}`;
|
|
36
|
+
const navigationUrl = `${this.loginUrl}${encodeURIComponent(window.location.href)}`;
|
|
37
37
|
return navigationUrl;
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
return (h(Host, { key: '
|
|
40
|
+
return (h(Host, { key: '1b59b2a7ddcb13b6e018e5a9dfe2d70c00650a54' }, h("pn-button", { key: 'fdee62f0d6bfa293bf9b84f41342b5c57f11faa5', href: this.nagivateToLoginUrl() }, this.label)));
|
|
41
41
|
}
|
|
42
42
|
static get style() { return PnMarketwebSiteheaderLoginButtonStyle0; }
|
|
43
43
|
}, [0, "pn-marketweb-siteheader-login-button", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pn-marketweb-siteheader-login-button2.js","mappings":";;AAAO,MAAM,WAAW,GAAG,CAAC,iBAAyB,EAAE,WAAkB;IAEzE,MAAM,sBAAsB,GAAG,YAAY,CAAC;IAE5C,MAAM,UAAU,GAAG,uFAAuF,CAAC;IAC3G,MAAM,WAAW,GAAG,qFAAqF,CAAC;IAC1G,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;IAE9C,IAAG,iBAAiB,EAClB;QACE,OAAO,iBAAiB,CAAC;KAC1B;SACK,IAAI,WAAW,CAAC,WAAW,EAAE,KAAK,sBAAsB,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I,CAAC,QAAQ,GAAG,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACpF,OAAO,aAAa,CAAC;KACtB;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,kEAAW,IAAI,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAG,IAAI,CAAC,KAAK,CAAa,CAC/D,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/layout-components/pn-marketweb-siteheader/unifiedLoginHelper.ts","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.scss?tag=pn-marketweb-siteheader-login-button","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.tsx"],"sourcesContent":["export const getLoginUrl = (useMarketwebLogin:boolean, environment:string) => {\n\nconst environment_Production = \"PRODUCTION\";\n\nconst devAuthUrl = 'https://atportal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst prodAuthUrl = 'https://portal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst marketwebLoginUrl = '/login?returnUrl=';\n\nif(useMarketwebLogin)\n {\n return marketwebLoginUrl;\n }\n else if (environment.toUpperCase() !== environment_Production) {\n return devAuthUrl;\n } else {\n return prodAuthUrl;\n } \n };\n","pn-marketweb-siteheader-login-button {\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\nimport { getLoginUrl } from './unifiedLoginHelper';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-button',\n styleUrl: 'pn-marketweb-siteheader-login-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Log in';\n @Prop() useMarketwebLogin: boolean = false;\n @Prop() environment: string = 'local';\n \n loginUrl: string;\n\n componentWillLoad() {\n this.loginUrl = getLoginUrl(this.useMarketwebLogin, this.environment);\n }\n\n nagivateToLoginUrl() {\n const navigationUrl = `${this.loginUrl}${encodeURIComponent(window.location.href)}`;\n return navigationUrl;\n }\n\n render() {\n return (\n <Host>\n <pn-button href={this.nagivateToLoginUrl()}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -203,7 +203,7 @@ const PnMarketwebSiteheaderLoginProfileselection = /*@__PURE__*/ proxyCustomElem
|
|
|
203
203
|
.filter(x => x.selected !== true)
|
|
204
204
|
.map(organization => {
|
|
205
205
|
let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;
|
|
206
|
-
return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${window.location.href}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, organization.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, organization.customerNumber ? organization.customerNumber : this.userEmail)), h("pn-icon", { icon: arrow_right, small: "false", color: "blue700" }))));
|
|
206
|
+
return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, organization.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, organization.customerNumber ? organization.customerNumber : this.userEmail)), h("pn-icon", { icon: arrow_right, small: "false", color: "blue700" }))));
|
|
207
207
|
}), this.logoutLink ? (h("div", { class: "pn-marketweb-siteheader-login-profileselection-logout" }, h("a", { href: this.logoutLink.href, rel: "nofollower noopener", id: "pn-marketweb-header-logoutlink", onClick: () => state.loginManager.clearUserData(), class: "pn-marketweb-siteheader-login-profileselection-logout-link" }, this.logoutLink.linkText))) : null));
|
|
208
208
|
}
|
|
209
209
|
static get style() { return PnMarketwebSiteheaderLoginProfileselectionStyle0; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pn-marketweb-siteheader-login-profileselection2.js","mappings":";;;;AAAA,MAAM,6CAA6C,GAAG,4zEAA4zE,CAAC;AACn3E,yDAAe,6CAA6C;;MCU/C,0CAA0C;;;;2BAID,IAAI;wBAC7B,EAAE;wBACD,KAAK;2BACH,EAAE;uBACN,IAAI;oBACC;YAC7B,WAAW,EAAE,EAAE;YACf,iBAAiB,EAAE,EAAE;YACrB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,eAAe,EAAE,EAAE;YACnB,6BAA6B,EAAE,EAAE;SAChB;oBAEQ,IAAI;0BAEQ,IAAI;wBACf,IAAI;yBACH,EAAE;8BAEwC,IAAI;8BACF,EAAE;;;IAE3E,iBAAiB;QACf,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,6BAA6B,EAAE;YACrE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC;SACxD;QACD,IAAI,CAAC,IAAI,EAAE,CAAC;KACb;IAED,IAAI;QACF,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB;IACD,MAAM,aAAa;QACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;YACpD,OAAO;SACR;QACD,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,C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CAAC,cAAc,GAAG,YAAY,CAAC,cAAc,CAAC;YAC9H,QACE,WAAK,KAAK,EAAC,8DAA8D,IAEvE,SACE,IAAI,EAAE,GAAG,IAAI,CAAC,QAAQ,uCAAuC,cAAc,cAAc,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,EAC/G,KAAK,EAAC,mEAAmE,IAEzE,WAAK,KAAK,EAAC,sEAAsE,IAC/E,WAAK,KAAK,EAAC,mEAAmE,IAAE,YAAY,CAAC,IAAI,CAAO,EACxG,WAAK,KAAK,EAAC,0EAA0E,IAClF,YAAY,CAAC,cAAc,GAAG,YAAY,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CACvE,CACF,EACN,eAAS,IAAI,EAAE,WAAW,EAAE,KAAK,EAAC,OAAO,EAAC,KAAK,EAAC,SAAS,GAAW,CAClE,CACA,EACN;SACH,CAAC,EAEH,IAAI,CAAC,UAAU,IACd,WAAK,KAAK,EAAC,uDAAuD,IAEhE,SACE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,EAC1B,GAAG,EAAC,qBAAqB,EACzB,EAAE,EAAC,gCAAgC,EACnC,OAAO,EAAE,MAAMA,KAAW,CAAC,YAAY,CAAC,aAAa,EAAE,EACvD,KAAK,EAAC,4DAA4D,IAEjE,IAAI,CAAC,UAAU,CAAC,QAAQ,CACvB,CACA,IACJ,IAAI,CACH,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["headerState"],"sources":["src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.scss?tag=pn-marketweb-siteheader-login-profileselection","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n\n@import './pn-marketweb-siteheader-common.scss';\n\npn-marketweb-siteheader-login-profileselection {\n}\n\n.pn-marketweb-siteheader-login-profileselection-heading {\n display: block;\n padding: 0.5rem 0 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user,\n.pn-marketweb-siteheader-login-profileselection-currentprofile {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-name,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-name {\n line-height: 1;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-description,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-divider {\n height: 1rem;\n width: 100%;\n background: $blue400;\n position: relative;\n\n margin-left: -1em; // Negative positioning due to nav dropdown's padding\n margin-top: 1.6rem;\n margin-bottom: 1.6rem;\n border-radius: 0 0.6em 0.6em 0;\n padding: 0;\n &::after {\n content: '';\n width: 0.6em;\n height: 0.6em;\n border-radius: 50%;\n position: absolute;\n right: 0;\n top: 0;\n background: inherit;\n transform: translateX(calc(100% + 0.2em));\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption {\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-link {\n display: flex;\n background: $white;\n transition: background 0.15s ease-in-out;\n // width:100%;\n margin: 0 -1em; // Negative margin due to dropdown content padding\n padding: 0.6rem 1.6rem;\n text-decoration: none;\n color: $blue700;\n align-items: center;\n &:hover,\n &:focus,\n &:active {\n background: $gray50;\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-content {\n flex-grow: 1;\n}\n.pn-marketweb-siteheader-login-profileselection-profileoption-name {\n font-weight: 700;\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout {\n padding: 1.6rem;\n text-align: center;\n width: 100%;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout-link {\n display: inline-block;\n font-weight: 500;\n color: $blue700;\n text-decoration: none;\n &:hover,\n &:focus,\n &:active {\n text-decoration: underline;\n }\n}\n","import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n <div class=\"pn-marketweb-siteheader-login-profileselection-divider\"></div>\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${window.location.href}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\"\n >\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">{organization.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <a\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n >\n {this.logoutLink.linkText}\n </a>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"pn-marketweb-siteheader-login-profileselection2.js","mappings":";;;;AAAA,MAAM,6CAA6C,GAAG,4zEAA4zE,CAAC;AACn3E,yDAAe,6CAA6C;;MCU/C,0CAA0C;;;;2BAID,IAAI;wBAC7B,EAAE;wBACD,KAAK;2BACH,EAAE;uBACN,IAAI;oBACC;YAC7B,WAAW,EAAE,EAAE;YACf,iBAAiB,EAAE,EAAE;YACrB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,eAAe,EAAE,EAAE;YACnB,6BAA6B,EAAE,EAAE;SAChB;oBAEQ,IAAI;0BAEQ,IAAI;wBACf,IAAI;yBACH,EAAE;8BAEwC,IAAI;8BACF,EAAE;;;IAE3E,iBAAiB;QACf,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,6BAA6B,EAAE;YACrE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC;SACxD;QACD,IAAI,CAAC,IAAI,EAAE,CAAC;KACb;IAED,IAAI;QACF,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB;IACD,MAAM,aAAa;QACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;YACpD,OAAO;SACR;QACD,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ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G,YAAY,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,cAAc,GAAG,YAAY,CAAC,cAAc,CAAC;YAC9H,QACE,WAAK,KAAK,EAAC,8DAA8D,IAEvE,SACE,IAAI,EAAE,GAAG,IAAI,CAAC,QAAQ,uCAAuC,cAAc,cAAc,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EACnI,KAAK,EAAC,mEAAmE,IAEzE,WAAK,KAAK,EAAC,sEAAsE,IAC/E,WAAK,KAAK,EAAC,mEAAmE,IAAE,YAAY,CAAC,IAAI,CAAO,EACxG,WAAK,KAAK,EAAC,0EAA0E,IAClF,YAAY,CAAC,cAAc,GAAG,YAAY,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CACvE,CACF,EACN,eAAS,IAAI,EAAE,WAAW,EAAE,KAAK,EAAC,OAAO,EAAC,KAAK,EAAC,SAAS,GAAW,CAClE,CACA,EACN;SACH,CAAC,EAEH,IAAI,CAAC,UAAU,IACd,WAAK,KAAK,EAAC,uDAAuD,IAEhE,SACE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,EAC1B,GAAG,EAAC,qBAAqB,EACzB,EAAE,EAAC,gCAAgC,EACnC,OAAO,EAAE,MAAMA,KAAW,CAAC,YAAY,CAAC,aAAa,EAAE,EACvD,KAAK,EAAC,4DAA4D,IAEjE,IAAI,CAAC,UAAU,CAAC,QAAQ,CACvB,CACA,IACJ,IAAI,CACH,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["headerState"],"sources":["src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.scss?tag=pn-marketweb-siteheader-login-profileselection","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n\n@import './pn-marketweb-siteheader-common.scss';\n\npn-marketweb-siteheader-login-profileselection {\n}\n\n.pn-marketweb-siteheader-login-profileselection-heading {\n display: block;\n padding: 0.5rem 0 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user,\n.pn-marketweb-siteheader-login-profileselection-currentprofile {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-name,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-name {\n line-height: 1;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-description,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-divider {\n height: 1rem;\n width: 100%;\n background: $blue400;\n position: relative;\n\n margin-left: -1em; // Negative positioning due to nav dropdown's padding\n margin-top: 1.6rem;\n margin-bottom: 1.6rem;\n border-radius: 0 0.6em 0.6em 0;\n padding: 0;\n &::after {\n content: '';\n width: 0.6em;\n height: 0.6em;\n border-radius: 50%;\n position: absolute;\n right: 0;\n top: 0;\n background: inherit;\n transform: translateX(calc(100% + 0.2em));\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption {\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-link {\n display: flex;\n background: $white;\n transition: background 0.15s ease-in-out;\n // width:100%;\n margin: 0 -1em; // Negative margin due to dropdown content padding\n padding: 0.6rem 1.6rem;\n text-decoration: none;\n color: $blue700;\n align-items: center;\n &:hover,\n &:focus,\n &:active {\n background: $gray50;\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-content {\n flex-grow: 1;\n}\n.pn-marketweb-siteheader-login-profileselection-profileoption-name {\n font-weight: 700;\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout {\n padding: 1.6rem;\n text-align: center;\n width: 100%;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout-link {\n display: inline-block;\n font-weight: 500;\n color: $blue700;\n text-decoration: none;\n &:hover,\n &:focus,\n &:active {\n text-decoration: underline;\n }\n}\n","import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n <div class=\"pn-marketweb-siteheader-login-profileselection-divider\"></div>\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\"\n >\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">{organization.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <a\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n >\n {this.logoutLink.linkText}\n </a>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -35,11 +35,11 @@ const PnMarketwebSiteheaderLoginButton = class {
|
|
|
35
35
|
this.loginUrl = getLoginUrl(this.useMarketwebLogin, this.environment);
|
|
36
36
|
}
|
|
37
37
|
nagivateToLoginUrl() {
|
|
38
|
-
const navigationUrl = `${this.loginUrl}${window.location.href}`;
|
|
38
|
+
const navigationUrl = `${this.loginUrl}${encodeURIComponent(window.location.href)}`;
|
|
39
39
|
return navigationUrl;
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
|
-
return (h(Host, { key: '
|
|
42
|
+
return (h(Host, { key: '1b59b2a7ddcb13b6e018e5a9dfe2d70c00650a54' }, h("pn-button", { key: 'fdee62f0d6bfa293bf9b84f41342b5c57f11faa5', href: this.nagivateToLoginUrl() }, this.label)));
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
PnMarketwebSiteheaderLoginButton.style = PnMarketwebSiteheaderLoginButtonStyle0;
|
|
@@ -345,7 +345,7 @@ const PnMarketwebSiteheaderLoginProfileselection = class {
|
|
|
345
345
|
.filter(x => x.selected !== true)
|
|
346
346
|
.map(organization => {
|
|
347
347
|
let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;
|
|
348
|
-
return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${window.location.href}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, organization.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, organization.customerNumber ? organization.customerNumber : this.userEmail)), h("pn-icon", { icon: arrow_right, small: "false", color: "blue700" }))));
|
|
348
|
+
return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, organization.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, organization.customerNumber ? organization.customerNumber : this.userEmail)), h("pn-icon", { icon: arrow_right, small: "false", color: "blue700" }))));
|
|
349
349
|
}), this.logoutLink ? (h("div", { class: "pn-marketweb-siteheader-login-profileselection-logout" }, h("a", { href: this.logoutLink.href, rel: "nofollower noopener", id: "pn-marketweb-header-logoutlink", onClick: () => state.loginManager.clearUserData(), class: "pn-marketweb-siteheader-login-profileselection-logout-link" }, this.logoutLink.linkText))) : null));
|
|
350
350
|
}
|
|
351
351
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pn-marketweb-siteheader-login-button.pn-marketweb-siteheader-login-links.pn-marketweb-siteheader-login-mypage-button.pn-marketweb-siteheader-login-profileselection.pn-marketweb-siteheader-unified-login.entry.js","mappings":";;;;;AAAO,MAAM,WAAW,GAAG,CAAC,iBAAyB,EAAE,WAAkB;IAEzE,MAAM,sBAAsB,GAAG,YAAY,CAAC;IAE5C,MAAM,UAAU,GAAG,uFAAuF,CAAC;IAC3G,MAAM,WAAW,GAAG,qFAAqF,CAAC;IAC1G,MAAM,iBAAiB,GAAG,mBAAmB,CAAC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BAEhB,KAAK;;;;;;;;IAOjC,MAAM;QACJ,QACE,EAAC,IAAI,uDACF,IAAI,CAAC,QAAQ,IACZ,mDAA6C,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,GAAI,KAEnG,4CACI,KAAK,EAAE,IAAI,CAAC,UAAU,EACtB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EACzC,WAAW,EAAE,IAAI,CAAC,WAAW,GAC3B,CACP,CACI,EACP;KACH;;;;;;","names":["headerState"],"sources":["src/components/layout-components/pn-marketweb-siteheader/unifiedLoginHelper.ts","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.scss?tag=pn-marketweb-siteheader-login-button","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.scss?tag=pn-marketweb-siteheader-login-links","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.scss?tag=pn-marketweb-siteheader-login-mypage-button","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.scss?tag=pn-marketweb-siteheader-login-profileselection","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.scss?tag=pn-marketweb-siteheader-unified-login","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.tsx"],"sourcesContent":["export const getLoginUrl = (useMarketwebLogin:boolean, environment:string) => {\n\nconst environment_Production = \"PRODUCTION\";\n\nconst devAuthUrl = 'https://atportal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst prodAuthUrl = 'https://portal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst marketwebLoginUrl = '/login?returnUrl=';\n\nif(useMarketwebLogin)\n {\n return marketwebLoginUrl;\n }\n else if (environment.toUpperCase() !== environment_Production) {\n return devAuthUrl;\n } else {\n return prodAuthUrl;\n } \n };\n","pn-marketweb-siteheader-login-button {\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\nimport { getLoginUrl } from './unifiedLoginHelper';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-button',\n styleUrl: 'pn-marketweb-siteheader-login-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Log in';\n @Prop() useMarketwebLogin: boolean = false;\n @Prop() environment: string = 'local';\n \n loginUrl: string;\n\n componentWillLoad() {\n this.loginUrl = getLoginUrl(this.useMarketwebLogin, this.environment);\n }\n\n nagivateToLoginUrl() {\n const navigationUrl = `${this.loginUrl}${window.location.href}`;\n return navigationUrl;\n }\n\n render() {\n return (\n <Host>\n <pn-button href={this.nagivateToLoginUrl()}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n","@import '../../../globals/main.scss';\n\n@import './pn-marketweb-siteheader-common.scss';\n\npn-marketweb-siteheader-login-links {\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog } from './pn-marketweb-siteheader-types';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-links',\n styleUrl: 'pn-marketweb-siteheader-login-links.scss',\n})\nexport class PnMarketwebSiteheaderLoginLinks {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() idNamespace: string = '';\n @Prop({ reflect: true }) loggedin: boolean = false;\n @Prop() username: string = '';\n @Prop() showUnifiedLogin: boolean = false;\n\n componentWillLoad() {\n this.init();\n }\n\n @Watch('loginDialog')\n async init() {\n this.adjustLoginLinks();\n }\n adjustLoginLinks() {\n if (!this.loginDialog) {\n return;\n }\n\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n link.href = link.href.replace('window.location.href', window.location.href);\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loginMenuLinks) {\n this.loginDialog?.loginMenuLinks.forEach(adjustLink);\n }\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.loginDialog.legacyLoginLinks = [\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.loginUrl),\n linkText: this.loginDialog.loginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n linkType: 'primary',\n primaryLinkApperance: true,\n },\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.registerUrl),\n linkText: this.loginDialog.createLoginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n primaryLinkApperance: false,\n },\n ];\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {\n username: null,\n loggedin: false,\n };\n if (this.username) {\n hostElementAttribute.username = this.username;\n hostElementAttribute.loggedin = this.loggedin;\n }\n return (\n <Host {...hostElementAttribute}>\n {!this.loginDialog.overrideLoginMenu ? (\n <div data-loggedin={this.loggedin + ''}>\n {this.loggedin ? (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.loggedInLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n ) : (\n <div>\n {/* Get login links from API */}\n {this.loginDialog.loginMenuLinks?.length > 0 ? (\n <pn-marketweb-siteheader-login-linklist\n heading={this.loginDialog.loginTitle}\n links={this.loginDialog.loginMenuLinks}\n idNamespace={this.idNamespace}\n showUnifiedLogin={this.showUnifiedLogin}\n ></pn-marketweb-siteheader-login-linklist>\n ) : (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.legacyLoginLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n )}\n </div>\n )}\n </div>\n ) : null}\n\n {/* Override the default logic for some markets such as DK */}\n {this.loginDialog.overrideLoginMenu ? (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.loginMenuLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n ) : null}\n </Host>\n );\n }\n}\n","pn-marketweb-siteheader-login-mypage-button {\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-mypage-button',\n styleUrl: 'pn-marketweb-siteheader-login-mypage-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginMypageButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Mina sidor!';\n @Prop() myPageUrl: string;\n\n render() {\n return (\n <Host>\n <pn-button href={this.myPageUrl}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n","@import '../../../globals/main.scss';\n\n@import './pn-marketweb-siteheader-common.scss';\n\npn-marketweb-siteheader-login-profileselection {\n}\n\n.pn-marketweb-siteheader-login-profileselection-heading {\n display: block;\n padding: 0.5rem 0 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user,\n.pn-marketweb-siteheader-login-profileselection-currentprofile {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-name,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-name {\n line-height: 1;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-description,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-divider {\n height: 1rem;\n width: 100%;\n background: $blue400;\n position: relative;\n\n margin-left: -1em; // Negative positioning due to nav dropdown's padding\n margin-top: 1.6rem;\n margin-bottom: 1.6rem;\n border-radius: 0 0.6em 0.6em 0;\n padding: 0;\n &::after {\n content: '';\n width: 0.6em;\n height: 0.6em;\n border-radius: 50%;\n position: absolute;\n right: 0;\n top: 0;\n background: inherit;\n transform: translateX(calc(100% + 0.2em));\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption {\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-link {\n display: flex;\n background: $white;\n transition: background 0.15s ease-in-out;\n // width:100%;\n margin: 0 -1em; // Negative margin due to dropdown content padding\n padding: 0.6rem 1.6rem;\n text-decoration: none;\n color: $blue700;\n align-items: center;\n &:hover,\n &:focus,\n &:active {\n background: $gray50;\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-content {\n flex-grow: 1;\n}\n.pn-marketweb-siteheader-login-profileselection-profileoption-name {\n font-weight: 700;\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout {\n padding: 1.6rem;\n text-align: center;\n width: 100%;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout-link {\n display: inline-block;\n font-weight: 500;\n color: $blue700;\n text-decoration: none;\n &:hover,\n &:focus,\n &:active {\n text-decoration: underline;\n }\n}\n","import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n <div class=\"pn-marketweb-siteheader-login-profileselection-divider\"></div>\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${window.location.href}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\"\n >\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">{organization.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <a\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n >\n {this.logoutLink.linkText}\n </a>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n","","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pn-marketweb-siteheader-unified-login',\n styleUrl: 'pn-marketweb-siteheader-unified-login.scss',\n})\nexport class PnMarketwebSiteheaderUnifiedLogin {\n @Element() hostElement: HTMLElement;\n @Prop() loggedIn: boolean = false;\n @Prop() myPageLabel: string;\n @Prop() myPageUrl: string;\n @Prop() logInLabel: string;\n @Prop() useMarketwebLogin: boolean;\n @Prop() environment: string;\n\n render() {\n return (\n <Host>\n {this.loggedIn ? (\n <pn-marketweb-siteheader-login-mypage-button label={this.myPageLabel} myPageUrl={this.myPageUrl} />\n ) : (\n <pn-marketweb-siteheader-login-button \n label={this.logInLabel} \n useMarketwebLogin={this.useMarketwebLogin} \n environment={this.environment}\n />\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"pn-marketweb-siteheader-login-button.pn-marketweb-siteheader-login-links.pn-marketweb-siteheader-login-mypage-button.pn-marketweb-siteheader-login-profileselection.pn-marketweb-siteheader-unified-login.entry.js","mappings":";;;;;AAAO,MAAM,WAAW,GAAG,CAAC,iBAAyB,EAAE,WAAkB;IAEzE,MAAM,sBAAsB,GAAG,YAAY,CAAC;IAE5C,MAAM,UAAU,GAAG,uFAAuF,CAAC;IAC3G,MAAM,WAAW,GAAG,qFAAqF,CAAC;IAC1G,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;IAE9C,IAAG,iBAAiB,EAClB;QACE,OAAO,iBAAiB,CAAC;KAC1B;SACK,IAAI,WAAW,CAAC,WAAW,EAAE,KAAK,sBAAsB,EAAE;QAC5D,OAAO,UAAU,CAAC;KACnB;SAAM;QACH,OAAO,WAAW,CAAC;KACtB;AACH,CAAC;;ACjBH,MAAM,mCAAmC,GAAG,EAAE,CAAC;AAC/C,+CAAe,mCAAmC;;MCOrC,gCAAgC;;;qBAEnB,QAAQ;iCACK,KAAK;2BACZ,OAAO;;;IAErC,QAAQ,CAAS;IAEjB,iBAAiB;QACf,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;KACvE;IAED,kBAAkB;QAChB,MAAM,aAAa,GAAG,GAAG,IAAI,CAAC,QAAQ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AK,EAAC,mEAAmE,IAEzE,WAAK,KAAK,EAAC,sEAAsE,IAC/E,WAAK,KAAK,EAAC,mEAAmE,IAAE,YAAY,CAAC,IAAI,CAAO,EACxG,WAAK,KAAK,EAAC,0EAA0E,IAClF,YAAY,CAAC,cAAc,GAAG,YAAY,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CACvE,CACF,EACN,eAAS,IAAI,EAAE,WAAW,EAAE,KAAK,EAAC,OAAO,EAAC,KAAK,EAAC,SAAS,GAAW,CAClE,CACA,EACN;SACH,CAAC,EAEH,IAAI,CAAC,UAAU,IACd,WAAK,KAAK,EAAC,uDAAuD,IAEhE,SACE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,EAC1B,GAAG,EAAC,qBAAqB,EACzB,EAAE,EAAC,gCAAgC,EACnC,OAAO,EAAE,MAAMA,KAAW,CAAC,YAAY,CAAC,aAAa,EAAE,EACvD,KAAK,EAAC,4DAA4D,IAEjE,IAAI,CAAC,UAAU,CAAC,QAAQ,CACvB,CACA,IACJ,IAAI,CACH,EACP;KACH;;;;AClRH,MAAM,oCAAoC,GAAG,EAAE,CAAC;AAChD,gDAAe,oCAAoC;;MCKtC,iCAAiC;;;wBAEhB,KAAK;;;;;;;;IAOjC,MAAM;QACJ,QACE,EAAC,IAAI,uDACF,IAAI,CAAC,QAAQ,IACZ,mDAA6C,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,GAAI,KAEnG,4CACI,KAAK,EAAE,IAAI,CAAC,UAAU,EACtB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EACzC,WAAW,EAAE,IAAI,CAAC,WAAW,GAC3B,CACP,CACI,EACP;KACH;;;;;;","names":["headerState"],"sources":["src/components/layout-components/pn-marketweb-siteheader/unifiedLoginHelper.ts","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.scss?tag=pn-marketweb-siteheader-login-button","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.scss?tag=pn-marketweb-siteheader-login-links","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.scss?tag=pn-marketweb-siteheader-login-mypage-button","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.scss?tag=pn-marketweb-siteheader-login-profileselection","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.scss?tag=pn-marketweb-siteheader-unified-login","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.tsx"],"sourcesContent":["export const getLoginUrl = (useMarketwebLogin:boolean, environment:string) => {\n\nconst environment_Production = \"PRODUCTION\";\n\nconst devAuthUrl = 'https://atportal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst prodAuthUrl = 'https://portal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst marketwebLoginUrl = '/login?returnUrl=';\n\nif(useMarketwebLogin)\n {\n return marketwebLoginUrl;\n }\n else if (environment.toUpperCase() !== environment_Production) {\n return devAuthUrl;\n } else {\n return prodAuthUrl;\n } \n };\n","pn-marketweb-siteheader-login-button {\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\nimport { getLoginUrl } from './unifiedLoginHelper';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-button',\n styleUrl: 'pn-marketweb-siteheader-login-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Log in';\n @Prop() useMarketwebLogin: boolean = false;\n @Prop() environment: string = 'local';\n \n loginUrl: string;\n\n componentWillLoad() {\n this.loginUrl = getLoginUrl(this.useMarketwebLogin, this.environment);\n }\n\n nagivateToLoginUrl() {\n const navigationUrl = `${this.loginUrl}${encodeURIComponent(window.location.href)}`;\n return navigationUrl;\n }\n\n render() {\n return (\n <Host>\n <pn-button href={this.nagivateToLoginUrl()}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n","@import '../../../globals/main.scss';\n\n@import './pn-marketweb-siteheader-common.scss';\n\npn-marketweb-siteheader-login-links {\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog } from './pn-marketweb-siteheader-types';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-links',\n styleUrl: 'pn-marketweb-siteheader-login-links.scss',\n})\nexport class PnMarketwebSiteheaderLoginLinks {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() idNamespace: string = '';\n @Prop({ reflect: true }) loggedin: boolean = false;\n @Prop() username: string = '';\n @Prop() showUnifiedLogin: boolean = false;\n\n componentWillLoad() {\n this.init();\n }\n\n @Watch('loginDialog')\n async init() {\n this.adjustLoginLinks();\n }\n adjustLoginLinks() {\n if (!this.loginDialog) {\n return;\n }\n\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n link.href = link.href.replace('window.location.href', window.location.href);\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loginMenuLinks) {\n this.loginDialog?.loginMenuLinks.forEach(adjustLink);\n }\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.loginDialog.legacyLoginLinks = [\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.loginUrl),\n linkText: this.loginDialog.loginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n linkType: 'primary',\n primaryLinkApperance: true,\n },\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.registerUrl),\n linkText: this.loginDialog.createLoginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n primaryLinkApperance: false,\n },\n ];\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {\n username: null,\n loggedin: false,\n };\n if (this.username) {\n hostElementAttribute.username = this.username;\n hostElementAttribute.loggedin = this.loggedin;\n }\n return (\n <Host {...hostElementAttribute}>\n {!this.loginDialog.overrideLoginMenu ? (\n <div data-loggedin={this.loggedin + ''}>\n {this.loggedin ? (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.loggedInLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n ) : (\n <div>\n {/* Get login links from API */}\n {this.loginDialog.loginMenuLinks?.length > 0 ? (\n <pn-marketweb-siteheader-login-linklist\n heading={this.loginDialog.loginTitle}\n links={this.loginDialog.loginMenuLinks}\n idNamespace={this.idNamespace}\n showUnifiedLogin={this.showUnifiedLogin}\n ></pn-marketweb-siteheader-login-linklist>\n ) : (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.legacyLoginLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n )}\n </div>\n )}\n </div>\n ) : null}\n\n {/* Override the default logic for some markets such as DK */}\n {this.loginDialog.overrideLoginMenu ? (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.loginMenuLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n ) : null}\n </Host>\n );\n }\n}\n","pn-marketweb-siteheader-login-mypage-button {\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-mypage-button',\n styleUrl: 'pn-marketweb-siteheader-login-mypage-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginMypageButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Mina sidor!';\n @Prop() myPageUrl: string;\n\n render() {\n return (\n <Host>\n <pn-button href={this.myPageUrl}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n","@import '../../../globals/main.scss';\n\n@import './pn-marketweb-siteheader-common.scss';\n\npn-marketweb-siteheader-login-profileselection {\n}\n\n.pn-marketweb-siteheader-login-profileselection-heading {\n display: block;\n padding: 0.5rem 0 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user,\n.pn-marketweb-siteheader-login-profileselection-currentprofile {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-name,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-name {\n line-height: 1;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-description,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-divider {\n height: 1rem;\n width: 100%;\n background: $blue400;\n position: relative;\n\n margin-left: -1em; // Negative positioning due to nav dropdown's padding\n margin-top: 1.6rem;\n margin-bottom: 1.6rem;\n border-radius: 0 0.6em 0.6em 0;\n padding: 0;\n &::after {\n content: '';\n width: 0.6em;\n height: 0.6em;\n border-radius: 50%;\n position: absolute;\n right: 0;\n top: 0;\n background: inherit;\n transform: translateX(calc(100% + 0.2em));\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption {\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-link {\n display: flex;\n background: $white;\n transition: background 0.15s ease-in-out;\n // width:100%;\n margin: 0 -1em; // Negative margin due to dropdown content padding\n padding: 0.6rem 1.6rem;\n text-decoration: none;\n color: $blue700;\n align-items: center;\n &:hover,\n &:focus,\n &:active {\n background: $gray50;\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-content {\n flex-grow: 1;\n}\n.pn-marketweb-siteheader-login-profileselection-profileoption-name {\n font-weight: 700;\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout {\n padding: 1.6rem;\n text-align: center;\n width: 100%;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout-link {\n display: inline-block;\n font-weight: 500;\n color: $blue700;\n text-decoration: none;\n &:hover,\n &:focus,\n &:active {\n text-decoration: underline;\n }\n}\n","import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n <div class=\"pn-marketweb-siteheader-login-profileselection-divider\"></div>\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\"\n >\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">{organization.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <a\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n >\n {this.logoutLink.linkText}\n </a>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n","","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pn-marketweb-siteheader-unified-login',\n styleUrl: 'pn-marketweb-siteheader-unified-login.scss',\n})\nexport class PnMarketwebSiteheaderUnifiedLogin {\n @Element() hostElement: HTMLElement;\n @Prop() loggedIn: boolean = false;\n @Prop() myPageLabel: string;\n @Prop() myPageUrl: string;\n @Prop() logInLabel: string;\n @Prop() useMarketwebLogin: boolean;\n @Prop() environment: string;\n\n render() {\n return (\n <Host>\n {this.loggedIn ? (\n <pn-marketweb-siteheader-login-mypage-button label={this.myPageLabel} myPageUrl={this.myPageUrl} />\n ) : (\n <pn-marketweb-siteheader-login-button \n label={this.logInLabel} \n useMarketwebLogin={this.useMarketwebLogin} \n environment={this.environment}\n />\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
package/package.json
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,g as i,h as t,d as n}from"./p-bb1c965e.js";import{s as o}from"./p-13190b30.js";import{a as s}from"./p-36b39340.js";import"./p-2509d18d.js";const r=(e,i)=>{const t="PRODUCTION";const n="https://atportal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=";const o="https://portal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=";const s="/login?returnUrl=";if(e){return s}else if(i.toUpperCase()!==t){return n}else{return o}};const l="";const a=l;const h=class{constructor(i){e(this,i);this.label="Log in";this.useMarketwebLogin=false;this.environment="local"}get hostElement(){return i(this)}loginUrl;componentWillLoad(){this.loginUrl=r(this.useMarketwebLogin,this.environment)}nagivateToLoginUrl(){const e=`${this.loginUrl}${encodeURIComponent(window.location.href)}`;return e}render(){return t(n,{key:"1b59b2a7ddcb13b6e018e5a9dfe2d70c00650a54"},t("pn-button",{key:"fdee62f0d6bfa293bf9b84f41342b5c57f11faa5",href:this.nagivateToLoginUrl()},this.label))}};h.style=a;const d="pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}";const c=d;const p=class{constructor(i){e(this,i);this.loginDialog=null;this.idNamespace="";this.loggedin=false;this.username="";this.showUnifiedLogin=false}get hostElement(){return i(this)}componentWillLoad(){this.init()}async init(){this.adjustLoginLinks()}adjustLoginLinks(){if(!this.loginDialog){return}const e=(e,i)=>{if(!e.isLogoutLink){e.isLogoutLink=e.pageLink.indexOf("location.href")!==-1&&e.pageLink.indexOf("logout")!==-1}if(e.isLogoutLink){e.href=o.loginManager.getLogoutUrl(e.href)}e.href=e.href.replace("window.location.href",window.location.href);if(i===0&&!e.href){e.href=o.loginManager.getLoginUrl();e.linkType="primary"}if(e.primaryLinkApperance&&!e.linkType){e.linkType="primary"}};if(this.loginDialog?.loginMenuLinks){this.loginDialog?.loginMenuLinks.forEach(e)}if(this.loginDialog?.loggedInLinks){this.loginDialog?.loggedInLinks.forEach(e)}this.loginDialog.legacyLoginLinks=[{href:o.loginManager.getLoginUrl(this.loginDialog.loginUrl),linkText:this.loginDialog.loginLinkText,openInNewWindow:false,isLogoutLink:false,pageLink:null,linkType:"primary",primaryLinkApperance:true},{href:o.loginManager.getLoginUrl(this.loginDialog.registerUrl),linkText:this.loginDialog.createLoginLinkText,openInNewWindow:false,isLogoutLink:false,pageLink:null,primaryLinkApperance:false}]}render(){if(!this.loginDialog){return}let e={username:null,loggedin:false};if(this.username){e.username=this.username;e.loggedin=this.loggedin}return t(n,{...e},!this.loginDialog.overrideLoginMenu?t("div",{"data-loggedin":this.loggedin+""},this.loggedin?t("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loggedInLinks,idNamespace:this.idNamespace}):t("div",null,this.loginDialog.loginMenuLinks?.length>0?t("pn-marketweb-siteheader-login-linklist",{heading:this.loginDialog.loginTitle,links:this.loginDialog.loginMenuLinks,idNamespace:this.idNamespace,showUnifiedLogin:this.showUnifiedLogin}):t("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.legacyLoginLinks,idNamespace:this.idNamespace}))):null,this.loginDialog.overrideLoginMenu?t("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loginMenuLinks,idNamespace:this.idNamespace}):null)}static get watchers(){return{loginDialog:["init"]}}};p.style=c;const f="";const u=f;const m=class{constructor(i){e(this,i);this.label="Mina sidor!";this.myPageUrl=undefined}get hostElement(){return i(this)}render(){return t(n,{key:"d6b3c9d56b4348d13418daf7233241d9cea5a538"},t("pn-button",{key:"09365225d5b096600c23fe44faea1d1e8acfdb42",href:this.myPageUrl},this.label))}};m.style=u;const g='pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.pn-marketweb-siteheader-login-profileselection-heading{display:block;padding:0.5rem 0 1rem}.pn-marketweb-siteheader-login-profileselection-user,.pn-marketweb-siteheader-login-profileselection-currentprofile{margin-top:1rem;margin-bottom:1rem}.pn-marketweb-siteheader-login-profileselection-user-name,.pn-marketweb-siteheader-login-profileselection-currentprofile-name{line-height:1}.pn-marketweb-siteheader-login-profileselection-user-description,.pn-marketweb-siteheader-login-profileselection-currentprofile-description{font-weight:400;white-space:normal;word-break:break-all;color:#5e554a;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-divider{height:1rem;width:100%;background:#00a0d6;position:relative;margin-left:-1em;margin-top:1.6rem;margin-bottom:1.6rem;border-radius:0 0.6em 0.6em 0;padding:0}.pn-marketweb-siteheader-login-profileselection-divider::after{content:"";width:0.6em;height:0.6em;border-radius:50%;position:absolute;right:0;top:0;background:inherit;transform:translateX(calc(100% + 0.2em))}.pn-marketweb-siteheader-login-profileselection-profileoption-link{display:flex;background:#ffffff;transition:background 0.15s ease-in-out;margin:0 -1em;padding:0.6rem 1.6rem;text-decoration:none;color:#005d92;align-items:center}.pn-marketweb-siteheader-login-profileselection-profileoption-link:hover,.pn-marketweb-siteheader-login-profileselection-profileoption-link:focus,.pn-marketweb-siteheader-login-profileselection-profileoption-link:active{background:#f3f2f2}.pn-marketweb-siteheader-login-profileselection-profileoption-content{flex-grow:1}.pn-marketweb-siteheader-login-profileselection-profileoption-name{font-weight:700}.pn-marketweb-siteheader-login-profileselection-profileoption-description{font-weight:400;white-space:normal;word-break:break-all;color:#5e554a;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-logout{padding:1.6rem;text-align:center;width:100%}.pn-marketweb-siteheader-login-profileselection-logout-link{display:inline-block;font-weight:500;color:#005d92;text-decoration:none}.pn-marketweb-siteheader-login-profileselection-logout-link:hover,.pn-marketweb-siteheader-login-profileselection-logout-link:focus,.pn-marketweb-siteheader-login-profileselection-logout-link:active{text-decoration:underline}';const b=g;const k=class{constructor(i){e(this,i);this.loginDialog=null;this.endpoint="";this.loggedin=false;this.idNamespace="";this.heading=null;this.i18n={searchlabel:"",searchplaceholder:"",searchbuttontext:"",menuHomeButton:"",menuGoBackButton:"",mainMenuButton:"",menuStartButton:"",profileSelectionFlyoutHeading:""};this.user=null;this.logoutLink=null;this.userName=null;this.userEmail="";this.currentProfile=null;this.profileoptions=[]}get hostElement(){return i(this)}componentWillLoad(){if(this.heading===null&&this.i18n?.profileSelectionFlyoutHeading){this.heading=this.i18n.profileSelectionFlyoutHeading}this.init()}init(){this.updateUserInfo();this.adjustLoginLinks();this.fetchProfiles()}async fetchProfiles(){if(!this.loggedin||this.profileoptions.length>0){return}let e=`${this.endpoint}${this.endpoint.lastIndexOf("/")>-1&&this.endpoint.lastIndexOf("/")===this.endpoint.length-1?"":"/"}api/user/parentorganizations`;const i=await fetch(e);const t=await i.json();const n={loggedin:true,organizations:[{name:"Forsheda Livs AB",customerNumber:"5564513603",id:"dbba867d-1dff-3dbb-b420-c57b4b828b73",selected:true,profiles:[{name:"Forsheda Livs AB",customerNumber:"20685482",id:"f757ba28-9a73-15a2-f128-4b394d970f3f",ssid:"",selected:false,customerGroup:"Business"},{name:"ICA MAXI KUNGSBACKA",customerNumber:"20831191",id:"5aea41df-32b0-3f7e-2946-78598360177d",ssid:"259686",selected:true,customerGroup:"Agent"}]},{name:"Hem Livs i Kungsbacka AB",customerNumber:"5565271250",id:"97ca363c-40ef-cca9-7a3c-9e7f025567c2",selected:false,profiles:[{name:"ICA KVANTUM KUNGSBACKA",customerNumber:"20831193",id:"fbd61ffd-41c6-2206-b88e-cfef91e1dc39",ssid:"259691",selected:false,customerGroup:"Agent"}]},{name:"ICA SUPERMARKET TORGET",customerNumber:"5568902679",id:"7cb76a94-e1a5-5f57-58fd-bc563851b28e",selected:false,profiles:[{name:"ICA SUPERMARKET TORGET",customerNumber:"20831212",id:"3a2db017-b68f-6fa0-fe70-542c08cd97ce",ssid:"",selected:false,customerGroup:"Agent"}]}]};const o=window.location.href.indexOf("localhost:6008")!==-1?n:t;if(!o||!o.organizations||!o.organizations.length){return}o.organizations.forEach((e=>{if(e.selected===true&&e.profiles){const i=e.profiles.filter((e=>e.selected===true));if(i&&i[0]&&i[0].customerGroup.toLocaleLowerCase()==="agent"&&i[0].ssid){e.customerNumber=i[0].ssid}}else{if(e.customerNumber.length===10&&e.customerNumber.substring(0,2)==="55"){e.customerNumber=e.customerNumber.substring(0,6)+"-"+e.customerNumber.substring(6)}this.profileoptions.push(e)}}));let s=o.organizations.filter((e=>e.selected===true))[0];const r={name:this.userName,customerNumber:"",id:"",selected:!s,profiles:[]};if(!s){s=r}if(s&&s.name){this.currentProfile=s}this.profileoptions.push(r)}adjustLoginLinks(){const e=(e,i)=>{if(!e.isLogoutLink){e.isLogoutLink=e.pageLink.indexOf("location.href")!==-1&&e.pageLink.indexOf("logout")!==-1}if(e.isLogoutLink){e.href=o.loginManager.getLogoutUrl(e.href)}if(i===0&&!e.href){e.href=o.loginManager.getLoginUrl();e.linkType="primary"}if(e.primaryLinkApperance&&!e.linkType){e.linkType="primary"}};if(this.loginDialog?.loggedInLinks){this.loginDialog?.loggedInLinks.forEach(e)}this.logoutLink=this.loginDialog?.loggedInLinks.filter((e=>e.isLogoutLink))[0]??null}updateUserInfo(){const e=o.loginManager.getUserInfo();this.user=e;if(!e){return}if(e&&e.email){this.userEmail=e.email}if(e&&e.given_name){this.userName=e.given_name+(e?.family_name?` ${e?.family_name}`:"")}if(e&&e.given_name){this.userName=e.given_name;return}if(e&&e.family_name){this.userName=e.family_name;return}if(e&&e.username){this.userName=e.username;return}}filterLogoutLink(e){return e.filter((e=>!e.isLogoutLink))}render(){if(!this.loginDialog){return}let e={};return t(n,{...e},this.heading?t("strong",{class:"pn-marketweb-siteheader-login-profileselection-heading"},this.heading):null,this.currentProfile!==null&&this.currentProfile.name?t("div",{class:"pn-marketweb-siteheader-login-profileselection-currentprofile"},t("div",{class:"pn-marketweb-siteheader-login-profileselection-currentprofile-name"},this.currentProfile.name),t("div",{class:"pn-marketweb-siteheader-login-profileselection-currentprofile-description"},this.currentProfile.customerNumber?this.currentProfile.customerNumber:this.userEmail)):null,t("pn-marketweb-siteheader-login-linklist",{links:this.filterLogoutLink(this.loginDialog.loggedInLinks),idNamespace:this.idNamespace}),t("div",{class:"pn-marketweb-siteheader-login-profileselection-divider"}),this.profileoptions.filter((e=>e.selected!==true)).map((e=>{let i=e.profiles.length>0?e.profiles[0].customerNumber:e.customerNumber;return t("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption"},t("a",{href:`${this.endpoint}/api/user/setprofile?customernumber=${i}&returnUrl=${encodeURIComponent(window.location.href)}`,class:"pn-marketweb-siteheader-login-profileselection-profileoption-link"},t("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-content"},t("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-name"},e.name),t("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-description"},e.customerNumber?e.customerNumber:this.userEmail)),t("pn-icon",{icon:s,small:"false",color:"blue700"})))})),this.logoutLink?t("div",{class:"pn-marketweb-siteheader-login-profileselection-logout"},t("a",{href:this.logoutLink.href,rel:"nofollower noopener",id:"pn-marketweb-header-logoutlink",onClick:()=>o.loginManager.clearUserData(),class:"pn-marketweb-siteheader-login-profileselection-logout-link"},this.logoutLink.linkText)):null)}};k.style=b;const w="";const v=w;const L=class{constructor(i){e(this,i);this.loggedIn=false;this.myPageLabel=undefined;this.myPageUrl=undefined;this.logInLabel=undefined;this.useMarketwebLogin=undefined;this.environment=undefined}get hostElement(){return i(this)}render(){return t(n,{key:"d8a36a509acd7a3265f79c097315747a48d51ace"},this.loggedIn?t("pn-marketweb-siteheader-login-mypage-button",{label:this.myPageLabel,myPageUrl:this.myPageUrl}):t("pn-marketweb-siteheader-login-button",{label:this.logInLabel,useMarketwebLogin:this.useMarketwebLogin,environment:this.environment}))}};L.style=v;export{h as pn_marketweb_siteheader_login_button,p as pn_marketweb_siteheader_login_links,m as pn_marketweb_siteheader_login_mypage_button,k as pn_marketweb_siteheader_login_profileselection,L as pn_marketweb_siteheader_unified_login};
|
|
2
|
+
//# sourceMappingURL=p-bba1a00a.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getLoginUrl","useMarketwebLogin","environment","environment_Production","devAuthUrl","prodAuthUrl","marketwebLoginUrl","toUpperCase","pnMarketwebSiteheaderLoginButtonCss","PnMarketwebSiteheaderLoginButtonStyle0","PnMarketwebSiteheaderLoginButton","loginUrl","componentWillLoad","this","nagivateToLoginUrl","navigationUrl","encodeURIComponent","window","location","href","render","h","Host","key","label","pnMarketwebSiteheaderLoginLinksCss","PnMarketwebSiteheaderLoginLinksStyle0","PnMarketwebSiteheaderLoginLinks","init","adjustLoginLinks","loginDialog","adjustLink","link","i","isLogoutLink","pageLink","indexOf","headerState","loginManager","getLogoutUrl","replace","linkType","primaryLinkApperance","loginMenuLinks","forEach","loggedInLinks","legacyLoginLinks","linkText","loginLinkText","openInNewWindow","registerUrl","createLoginLinkText","hostElementAttribute","username","loggedin","overrideLoginMenu","links","idNamespace","length","heading","loginTitle","showUnifiedLogin","pnMarketwebSiteheaderLoginMypageButtonCss","PnMarketwebSiteheaderLoginMypageButtonStyle0","PnMarketwebSiteheaderLoginMypageButton","myPageUrl","pnMarketwebSiteheaderLoginProfileselectionCss","PnMarketwebSiteheaderLoginProfileselectionStyle0","PnMarketwebSiteheaderLoginProfileselection","searchlabel","searchplaceholder","searchbuttontext","menuHomeButton","menuGoBackButton","mainMenuButton","menuStartButton","profileSelectionFlyoutHeading","i18n","updateUserInfo","fetchProfiles","profileoptions","apiUrl","endpoint","lastIndexOf","req","fetch","reqdata","json","fallbackData","organizations","name","customerNumber","id","selected","profiles","ssid","customerGroup","data","org","selectedProfile","filter","x","toLocaleLowerCase","substring","push","currentProfileObj","userProfileOption","userName","currentProfile","logoutLink","userInfo","getUserInfo","user","email","userEmail","given_name","family_name","filterLogoutLink","class","map","organization","icon","arrow_right","small","color","rel","onClick","clearUserData","pnMarketwebSiteheaderUnifiedLoginCss","PnMarketwebSiteheaderUnifiedLoginStyle0","PnMarketwebSiteheaderUnifiedLogin","loggedIn","myPageLabel","logInLabel"],"sources":["src/components/layout-components/pn-marketweb-siteheader/unifiedLoginHelper.ts","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.scss?tag=pn-marketweb-siteheader-login-button","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.scss?tag=pn-marketweb-siteheader-login-links","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.scss?tag=pn-marketweb-siteheader-login-mypage-button","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.scss?tag=pn-marketweb-siteheader-login-profileselection","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.scss?tag=pn-marketweb-siteheader-unified-login","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.tsx"],"sourcesContent":["export const getLoginUrl = (useMarketwebLogin:boolean, environment:string) => {\n\nconst environment_Production = \"PRODUCTION\";\n\nconst devAuthUrl = 'https://atportal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst prodAuthUrl = 'https://portal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst marketwebLoginUrl = '/login?returnUrl=';\n\nif(useMarketwebLogin)\n {\n return marketwebLoginUrl;\n }\n else if (environment.toUpperCase() !== environment_Production) {\n return devAuthUrl;\n } else {\n return prodAuthUrl;\n } \n };\n","pn-marketweb-siteheader-login-button {\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\nimport { getLoginUrl } from './unifiedLoginHelper';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-button',\n styleUrl: 'pn-marketweb-siteheader-login-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Log in';\n @Prop() useMarketwebLogin: boolean = false;\n @Prop() environment: string = 'local';\n \n loginUrl: string;\n\n componentWillLoad() {\n this.loginUrl = getLoginUrl(this.useMarketwebLogin, this.environment);\n }\n\n nagivateToLoginUrl() {\n const navigationUrl = `${this.loginUrl}${encodeURIComponent(window.location.href)}`;\n return navigationUrl;\n }\n\n render() {\n return (\n <Host>\n <pn-button href={this.nagivateToLoginUrl()}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n","@import '../../../globals/main.scss';\n\n@import './pn-marketweb-siteheader-common.scss';\n\npn-marketweb-siteheader-login-links {\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog } from './pn-marketweb-siteheader-types';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-links',\n styleUrl: 'pn-marketweb-siteheader-login-links.scss',\n})\nexport class PnMarketwebSiteheaderLoginLinks {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() idNamespace: string = '';\n @Prop({ reflect: true }) loggedin: boolean = false;\n @Prop() username: string = '';\n @Prop() showUnifiedLogin: boolean = false;\n\n componentWillLoad() {\n this.init();\n }\n\n @Watch('loginDialog')\n async init() {\n this.adjustLoginLinks();\n }\n adjustLoginLinks() {\n if (!this.loginDialog) {\n return;\n }\n\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n link.href = link.href.replace('window.location.href', window.location.href);\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loginMenuLinks) {\n this.loginDialog?.loginMenuLinks.forEach(adjustLink);\n }\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.loginDialog.legacyLoginLinks = [\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.loginUrl),\n linkText: this.loginDialog.loginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n linkType: 'primary',\n primaryLinkApperance: true,\n },\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.registerUrl),\n linkText: this.loginDialog.createLoginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n primaryLinkApperance: false,\n },\n ];\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {\n username: null,\n loggedin: false,\n };\n if (this.username) {\n hostElementAttribute.username = this.username;\n hostElementAttribute.loggedin = this.loggedin;\n }\n return (\n <Host {...hostElementAttribute}>\n {!this.loginDialog.overrideLoginMenu ? (\n <div data-loggedin={this.loggedin + ''}>\n {this.loggedin ? (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.loggedInLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n ) : (\n <div>\n {/* Get login links from API */}\n {this.loginDialog.loginMenuLinks?.length > 0 ? (\n <pn-marketweb-siteheader-login-linklist\n heading={this.loginDialog.loginTitle}\n links={this.loginDialog.loginMenuLinks}\n idNamespace={this.idNamespace}\n showUnifiedLogin={this.showUnifiedLogin}\n ></pn-marketweb-siteheader-login-linklist>\n ) : (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.legacyLoginLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n )}\n </div>\n )}\n </div>\n ) : null}\n\n {/* Override the default logic for some markets such as DK */}\n {this.loginDialog.overrideLoginMenu ? (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.loginMenuLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n ) : null}\n </Host>\n );\n }\n}\n","pn-marketweb-siteheader-login-mypage-button {\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-mypage-button',\n styleUrl: 'pn-marketweb-siteheader-login-mypage-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginMypageButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Mina sidor!';\n @Prop() myPageUrl: string;\n\n render() {\n return (\n <Host>\n <pn-button href={this.myPageUrl}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n","@import '../../../globals/main.scss';\n\n@import './pn-marketweb-siteheader-common.scss';\n\npn-marketweb-siteheader-login-profileselection {\n}\n\n.pn-marketweb-siteheader-login-profileselection-heading {\n display: block;\n padding: 0.5rem 0 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user,\n.pn-marketweb-siteheader-login-profileselection-currentprofile {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-name,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-name {\n line-height: 1;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-description,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-divider {\n height: 1rem;\n width: 100%;\n background: $blue400;\n position: relative;\n\n margin-left: -1em; // Negative positioning due to nav dropdown's padding\n margin-top: 1.6rem;\n margin-bottom: 1.6rem;\n border-radius: 0 0.6em 0.6em 0;\n padding: 0;\n &::after {\n content: '';\n width: 0.6em;\n height: 0.6em;\n border-radius: 50%;\n position: absolute;\n right: 0;\n top: 0;\n background: inherit;\n transform: translateX(calc(100% + 0.2em));\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption {\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-link {\n display: flex;\n background: $white;\n transition: background 0.15s ease-in-out;\n // width:100%;\n margin: 0 -1em; // Negative margin due to dropdown content padding\n padding: 0.6rem 1.6rem;\n text-decoration: none;\n color: $blue700;\n align-items: center;\n &:hover,\n &:focus,\n &:active {\n background: $gray50;\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-content {\n flex-grow: 1;\n}\n.pn-marketweb-siteheader-login-profileselection-profileoption-name {\n font-weight: 700;\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout {\n padding: 1.6rem;\n text-align: center;\n width: 100%;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout-link {\n display: inline-block;\n font-weight: 500;\n color: $blue700;\n text-decoration: none;\n &:hover,\n &:focus,\n &:active {\n text-decoration: underline;\n }\n}\n","import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n <div class=\"pn-marketweb-siteheader-login-profileselection-divider\"></div>\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\"\n >\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">{organization.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <a\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n >\n {this.logoutLink.linkText}\n </a>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n",null,"import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pn-marketweb-siteheader-unified-login',\n styleUrl: 'pn-marketweb-siteheader-unified-login.scss',\n})\nexport class PnMarketwebSiteheaderUnifiedLogin {\n @Element() hostElement: HTMLElement;\n @Prop() loggedIn: boolean = false;\n @Prop() myPageLabel: string;\n @Prop() myPageUrl: string;\n @Prop() logInLabel: string;\n @Prop() useMarketwebLogin: boolean;\n @Prop() environment: string;\n\n render() {\n return (\n <Host>\n {this.loggedIn ? (\n <pn-marketweb-siteheader-login-mypage-button label={this.myPageLabel} myPageUrl={this.myPageUrl} />\n ) : (\n <pn-marketweb-siteheader-login-button \n label={this.logInLabel} \n useMarketwebLogin={this.useMarketwebLogin} \n environment={this.environment}\n />\n )}\n </Host>\n );\n }\n}\n"],"mappings":"yJAAO,MAAMA,EAAc,CAACC,EAA2BC,KAEvD,MAAMC,EAAyB,aAE/B,MAAMC,EAAa,wFACnB,MAAMC,EAAc,sFACpB,MAAMC,EAA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,EAAuC,GAC7C,MAAAC,EAAeD,E,MCKFE,EAAiC,M,uCAEhB,M,2KAO5B,MAAA9G,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACFV,KAAKsH,SACJ9G,EAAA,+CAA6CG,MAAOX,KAAKuH,YAAanE,UAAWpD,KAAKoD,YAEtF5C,EAAA,wCACIG,MAAOX,KAAKwH,WACZpI,kBAAmBY,KAAKZ,kBACxBC,YAAaW,KAAKX,c","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,b as a}from"./p-bb1c965e.js";export{s as setNonce}from"./p-bb1c965e.js";import{g as n}from"./p-e1255160.js";var o=()=>{{r(t.prototype)}const a=import.meta.url;const n={};if(a!==""){n.resourcesUrl=new URL(".",a).href}return e(n)};var r=e=>{const t=e.cloneNode;e.cloneNode=function(e){if(this.nodeName==="TEMPLATE"){return t.call(this,e)}const a=t.call(this,false);const n=this.childNodes;if(e){for(let e=0;e<n.length;e++){if(n[e].nodeType!==2){a.appendChild(n[e].cloneNode(true))}}}return a}};o().then((async e=>{await n();return a(JSON.parse('[["p-1374c7bd",[[4,"pn-marketweb-siteheader",{"market":[1537],"language":[1537],"siteid":[1],"environment":[1537],"userToken":[1,"user-token"],"userFullname":[1,"user-fullname"],"userLoggedin":[516,"user-loggedin"],"endpoint":[1],"hideSiteSelector":[1540,"hide-site-selector"],"hideHomeMenuItem":[1540,"hide-home-menu-item"],"hideLanguageSelector":[1540,"hide-language-selector"],"hideSearch":[1540,"hide-search"],"hideLogin":[1540,"hide-login"],"showProfileSelection":[1540,"show-profile-selection"],"showUnifiedLogin":[4,"show-unified-login"],"siteDomainInUrls":[4,"site-domain-in-urls"],"AutocompleteEndpoint":[1,"autocomplete-endpoint"],"sessionForward":[4,"session-forward"],"cache":[4],"searchPlaceholder":[1,"search-placeholder"],"spaMode":[4,"spa-mode"],"checkUserLoggedInStateInterval":[2,"check-user-logged-in-state-interval"],"useMarketwebLogin":[4,"use-marketweb-login"],"pageId":[1,"page-id"],"i18n":[32],"gotData":[32],"fetchingData":[32],"homePageLink":[32],"menuItems":[32],"siteDefinition":[32],"search":[32],"siteSelector":[32],"languageSelector":[32],"languageOptions":[32],"loginDialog":[32],"minimizeSearch":[32],"loggedIn":[32]},[[0,"setLanguage","onLanguageSelectorChange"],[0,"loginStateChange","onLoginStateChange"],[9,"resize","handleResize"]],{"language":["onLanguageChange"],"market":["onMarketChange"]}]]],["p-c47b5782",[[0,"pn-proxio-findprice",{"endpoint":[1025],"language":[1025],"market":[1025],"showMedium":[4,"show-medium"],"showInternational":[4,"show-international"],"maxAbroadKg":[2,"max-abroad-kg"],"weightListName":[1,"weight-list-name"],"cache":[4],"filteredItems":[32],"weight":[32],"weightvalue":[32],"countrycodevalue":[32],"sizecategory":[32],"data":[32]},null,{"market":["setState"],"language":["setState"],"sizecategory":["filterItems"],"weightvalue":["filterItems"],"countrycodevalue":["filterItems"]}]]],["p-ffd62b09",[[0,"pn-find-price",{"source":[1],"language":[1025],"market":[1025],"filteredItems":[32],"weight":[32],"weightvalue":[32],"sourceData":[32],"sizecategory":[32]},null,{"market":["setState"],"language":["setState"],"sizecategory":["filterItems"],"weightvalue":["filterItems"]}]]],["p-1f3e8d59",[[0,"pn-find-service-and-price",{"source":[1],"language":[1025],"market":[1025],"filteredItems":[32],"postagetype":[32],"weight":[32],"weightvalue":[32],"deliveryscope":[32],"sourceData":[32]},null,{"market":["setState"],"language":["setState"],"postagetype":["filterItems"],"deliveryscope":["filterItems"],"weightvalue":["filterItems"]}]]],["p-a6c5b069",[[4,"pn-product-pricelist",{"source":[1],"language":[1025],"market":[1025],"productid":[1],"filteredItems":[32],"sourceData":[32],"gotData":[32],"loading":[32],"postagetype":[32],"weight":[32],"weightvalue":[32]},null,{"market":["setState"],"language":["setState"],"postagetype":["filterItems"],"weightvalue":["filterItems"]}]]],["p-eb0380be",[[0,"pn-proxio-pricegroup",{"endpoint":[1025],"language":[1],"market":[1],"tariffid":[1],"cache":[4],"activeWeightIndex":[32],"data":[32],"i18n":[32]},[[0,"activeWeightIndex","setActiveWeightIndex"],[0,"language","setLanguage"]]]]],["p-93a318bb",[[0,"pn-product-pricelist-result",{"item":[1040],"description":[16],"shownitems":[16],"showMeasurement":[4,"show-measurement"],"weightText":[32]},null,{"item":["composeItems"]}]]],["p-a54a298b",[[4,"pn-marketweb-sitefooter",{"market":[1537],"language":[1537],"environment":[1537],"endpoint":[1],"siteDomainInUrls":[4,"site-domain-in-urls"],"cache":[4],"theme":[513],"backgroundcolor":[513],"showSwan":[4,"show-swan"],"headingLevel":[1,"heading-level"],"siteDefinition":[32],"footerContent":[32],"i18n":[32],"gotData":[32],"fetchingData":[32]},null,{"language":["onLanguageChange"],"market":["onMarketChange"]}]]],["p-a395e8ed",[[4,"pn-media-block",{"blockHeight":[1,"block-height"],"imageSrc":[1,"image-src"],"imageSrcSmallScreenFormat":[1,"image-src-small-screen-format"],"imageAltText":[1,"image-alt-text"],"videoSrc":[1,"video-src"],"parallaxScroll":[4,"parallax-scroll"],"showOverlayLayer":[4,"show-overlay-layer"],"customOverlayBackground":[1,"custom-overlay-background"],"animateOverlayBackground":[4,"animate-overlay-background"],"scrollSnapBlock":[4,"scroll-snap-block"],"fixedBackground":[4,"fixed-background"],"blockHeading":[1,"block-heading"],"blockHeadingLevel":[2,"block-heading-level"],"blockPreamble":[1,"block-preamble"],"marginBottom":[4,"margin-bottom"],"pnPlayOnScrollObserverOptions":[32],"calculatedBlockHeight":[32],"hasButtonSlot":[32]}]]],["p-34dc822a",[[0,"pn-dropdown-with-multi-input-rows",{"dropdownData":[1,"dropdown-data"],"languageCode":[1,"language-code"],"firstDropdownLabel":[1,"first-dropdown-label"],"firstDropdownHelperText":[1,"first-dropdown-helper-text"],"secondDropdownLabel":[1,"second-dropdown-label"],"secondDropdownHelperText":[1,"second-dropdown-helper-text"],"secondDropdownMax":[2,"second-dropdown-max"],"deleteMultipleRowsWarningText":[1,"delete-multiple-rows-warning-text"],"confirmDeleteButtonText":[1,"confirm-delete-button-text"],"abortDeleteButtonText":[1,"abort-delete-button-text"],"fristInputLabel":[1,"frist-input-label"],"fristInputPlaceholder":[1,"frist-input-placeholder"],"firstInputMin":[2,"first-input-min"],"firstInputMax":[2,"first-input-max"],"firstInputWarning":[2,"first-input-warning"],"firstInputWarningText":[1,"first-input-warning-text"],"firstInputLowErrorText":[1,"first-input-low-error-text"],"firstInputHighErrorText":[1,"first-input-high-error-text"],"secondInputLabel":[1,"second-input-label"],"secondInputPlaceholder":[1,"second-input-placeholder"],"secondInputMin":[2,"second-input-min"],"secondInputMax":[2,"second-input-max"],"secondInputWarning":[2,"second-input-warning"],"secondInputWarningText":[1,"second-input-warning-text"],"secondInputLowErrorText":[1,"second-input-low-error-text"],"secondInputHighErrorText":[1,"second-input-high-error-text"],"disabledDates":[1,"disabled-dates"],"dateLabel":[1,"date-label"],"datePlaceholder":[1,"date-placeholder"],"dateDaysFromToday":[2,"date-days-from-today"],"yearsToAddToEndDate":[2,"years-to-add-to-end-date"],"sumFieldLabel":[1,"sum-field-label"],"addRowText":[1,"add-row-text"],"elementHelperText":[1,"element-helper-text"],"dropdownDataRoot":[32],"secondDropdownArr":[32],"rowData":[32],"formValues":[32],"firstValidDateString":[32],"lastValidDateString":[32],"rowSum":[32],"minRowCount":[32],"showDelteConfirm":[32]},[[0,"rowValueChange","predefinedValueChange"],[0,"firstInputChange","predefinedValueChange"],[0,"secondInputChange","predefinedValueChange"],[0,"deleteRowEvent","deleteRowEvent"]]]]],["p-5614b82e",[[0,"pn-multi-row-connected-dropdown",{"dropdownData":[1,"dropdown-data"],"languageCode":[1,"language-code"],"label":[1],"firstDropdownLabel":[1,"first-dropdown-label"],"secondDropdownLabel":[1,"second-dropdown-label"],"dropdownPlaceholder":[1,"dropdown-placeholder"],"addRowText":[1,"add-row-text"],"inputFildLabel":[1,"input-fild-label"],"inputFildPlaceholder":[1,"input-fild-placeholder"],"disabledDates":[1,"disabled-dates"],"dateButtonText":[1,"date-button-text"],"datePlaceholder":[1,"date-placeholder"],"dateDaysFromToday":[2,"date-days-from-today"],"allowMultipleRows":[4,"allow-multiple-rows"],"allowMultipleDates":[4,"allow-multiple-dates"],"startDateLabel":[1,"start-date-label"],"endDateLabel":[1,"end-date-label"],"multiDateHelperText":[1,"multi-date-helper-text"],"generateDatesButtonText":[1,"generate-dates-button-text"],"saveDateButtonText":[1,"save-date-button-text"],"noDatesText":[1,"no-dates-text"],"yearsToAddToEndDate":[2,"years-to-add-to-end-date"],"minAmount":[2,"min-amount"],"errorMessageEmpty":[1,"error-message-empty"],"errorMessageMinAmount":[1,"error-message-min-amount"],"minWarningAmount":[2,"min-warning-amount"],"warningMessageMinAmount":[1,"warning-message-min-amount"],"rowCount":[32],"rowData":[32],"formValues":[32]},[[0,"rowValueChange","predefinedValueChange"],[0,"deleteRowEvent","deleteRowEvent"]]]]],["p-91791451",[[0,"pn-multiple-input",{"label":[1],"placeholder":[1],"addRowButtonText":[1,"add-row-button-text"],"rowData":[32]}]]],["p-1ec21bd6",[[0,"pn-parcel-tracker",{"formActionUrl":[1,"form-action-url"],"heading":[1],"buttonLabel":[1,"button-label"],"locale":[1],"placeholder":[1],"inputName":[1,"input-name"],"currentWidth":[32]},[[9,"resize","handleViewportSizeChange"]]]]],["p-9e2c992d",[[0,"pn-pex-pricefinder",{"language":[1],"currency":[1],"apiUrl":[1,"api-url"],"i18n":[32],"fromzip":[32],"tozip":[32],"weight":[32],"when":[32],"response":[32]},[[0,"language","setLanguage"]]]]],["p-e2e3ac2f",[[0,"pn-share",{"link":[1],"language":[1537],"i18n":[32]},null,{"language":["onLanguageChange"]}]]],["p-a38118be",[[4,"pn-stats-info",{"heading":[1],"dataArray":[1,"data-array"],"backgroundUrl":[1,"background-url"],"myParsedArray":[32]},null,{"dataArray":["parseMyArrayProp"]}]]],["p-59cb7166",[[0,"pn-address-autofill",{"market":[1537],"environment":[1537],"endpoint":[1],"cache":[4],"countryCode":[1,"country-code"],"language":[1],"postalCodeProps":[1,"postal-code-props"],"cityProps":[1,"city-props"],"streetAddressProps":[1,"street-address-props"],"streetNumberProps":[1,"street-number-props"],"postalCode":[32],"city":[32],"streetAddress":[32],"streetNumber":[32],"validAddress":[32],"translation":[32],"postalCodeRequiredLabel":[32],"streetRequiredLabel":[32],"fullAddress":[32],"isLoading":[32]}]]],["p-066e9db9",[[4,"pn-animated-tile",{"toggled":[32],"transitionClassName":[32],"animateIcon":[32]},null,{"toggled":["onToggledHandler"]}]]],["p-de1b8176",[[0,"pn-app-banner",{"appName":[1,"app-name"],"appDescription":[1,"app-description"],"ctaText":[1,"cta-text"],"appleStoreLink":[1,"apple-store-link"],"googleStoreLink":[1,"google-store-link"],"isClosed":[32],"storeLink":[32],"isLocalStorageAvailable":[32]}]]],["p-4e3059dd",[[4,"pn-bonus-progressbar",{"icon":[1],"heading":[1],"sumtext":[513],"theme":[513],"bonuspercentage":[1],"currency":[513],"value":[1538],"min":[1538],"max":[1538],"valuepercentage":[32],"progresspercentage":[32],"levelValues":[32],"currentLevelAdjustedValue":[32]},null,{"currentLevelAdjustedValue":["setValuePercentage"],"value":["setValuePercentage"],"min":["setValuePercentage"],"max":["setValuePercentage"]}]]],["p-c5772021",[[0,"pn-bonus-progressbar-level",{"current":[516],"value":[1538],"bonuspercentage":[1537],"visualpercentage":[1538],"percentage":[32],"max":[32],"min":[32],"currency":[32]}]]],["p-42f9f2c3",[[0,"pn-breakpoints",{"breakPointClass":[1,"break-point-class"],"currentWidth":[32]},[[9,"resize","handleViewportSizeChange"]]]]],["p-278cda98",[[0,"pn-chart",{"labels":[1],"dataSets":[1,"data-sets"],"dataChartType":[8,"data-chart-type"],"myChartCtxRef":[32]},null,{"dataSets":["dataChangeHandler"],"labels":["labelsChangeHandler"]}]]],["p-a419cd91",[[4,"pn-charts-card",{"header":[1],"highlight":[1],"preamble":[1],"label":[1],"source":[1],"sourceUrl":[1,"source-url"],"ctaLinkText":[1,"cta-link-text"],"openInNewWindow":[4,"open-in-new-window"]}]]],["p-24086c59",[[4,"pn-cta-block",{"heading":[1],"bodyText":[1,"body-text"],"pnBackgroundColor":[1,"pn-background-color"],"isLarge":[4,"is-large"],"isCentered":[4,"is-centered"],"isSmall":[4,"is-small"],"contentTop":[4,"content-top"]}]]],["p-f15cec50",[[4,"pn-customernumber-selector",{"language":[1537],"open":[1540],"heading":[1],"description":[1],"i18n":[32]}]]],["p-4e58a3cf",[[4,"pn-customernumber-selector-option",{"heading":[1],"description":[1],"url":[1]}]]],["p-517decc5",[[0,"pn-date-and-time",{"languageCode":[1,"language-code"],"dateAndTimeLabel":[1,"date-and-time-label"],"dateDaysFromToday":[2,"date-days-from-today"],"validTimeRangeMinutes":[2,"valid-time-range-minutes"],"errorMessage":[1,"error-message"],"dateHelperText":[1,"date-helper-text"],"timeHelperText":[1,"time-helper-text"],"disableWeekends":[4,"disable-weekends"],"disabledDates":[1,"disabled-dates"],"datePlacehodler":[1,"date-placehodler"],"language":[32],"hourArr":[32],"minuteArr":[32],"formValue":[32],"invalidTimespan":[32],"selectedDate":[32],"selectedFromHour":[32],"selectedFromMin":[32],"selectedToHour":[32],"selectedToMin":[32],"firstValidDateString":[32],"lastValidDateString":[32]}]]],["p-3823577e",[[4,"pn-dropdown-choice-adds-row",{"dropdownData":[1,"dropdown-data"],"languageCode":[1,"language-code"],"addRowDropdownName":[1,"add-row-dropdown-name"],"addRowDropdownPlaceholder":[1,"add-row-dropdown-placeholder"],"addRowDropdownLabel":[1,"add-row-dropdown-label"],"rowNameLabel":[1,"row-name-label"],"rowHasDropdown":[4,"row-has-dropdown"],"rowDropdownLabel":[1,"row-dropdown-label"],"rowDropdownPlaceholder":[1,"row-dropdown-placeholder"],"rowInputLabel":[1,"row-input-label"],"rowDeleteButtonText":[1,"row-delete-button-text"],"totalInputLimit":[2,"total-input-limit"],"inputLimitWarning":[1,"input-limit-warning"],"inputEmptyWarning":[1,"input-empty-warning"],"dropdownEmptyWarning":[1,"dropdown-empty-warning"],"nextRowIndex":[32],"rowSelectDropdownArr":[32],"formValue":[32]},null,{"dropdownData":["dropdownDataWatcher"]}]]],["p-9e4983f2",[[4,"pn-hero-block-international",{"heading":[1],"subHeading":[1,"sub-heading"],"preamble":[1],"animateLogo":[4,"animate-logo"],"showSideLoader":[4,"show-side-loader"],"centeredLayout":[4,"centered-layout"]}]]],["p-e6e012fb",[[0,"pn-line-shape"]]],["p-4cd45df9",[[4,"pn-link-list",{"heading":[1],"label":[1],"preamble":[1],"url":[1],"showMoreLabel":[1,"show-more-label"],"showMoreUrl":[1,"show-more-url"]}]]],["p-b5105c2d",[[0,"pn-marketweb-icon",{"symbol":[1],"small":[4],"color":[1]}]]],["p-3a15e364",[[1,"pn-marketweb-search",{"disabled":[4],"placeholder":[1],"inputid":[1],"name":[1],"autocomplete":[1],"list":[1],"value":[1],"label":[1],"loading":[4],"button":[1],"light":[4],"suggestionObserver":[32],"hasClonedInput":[32],"listSuggestion":[32]},[[0,"input","inputHandler"]]]]],["p-8baf0a85",[[4,"pn-product-tile"]]],["p-27a9104e",[[4,"pn-profile-modal",{"heading":[1],"continueCtaText":[1,"continue-cta-text"],"choosenCompanyText":[1,"choosen-company-text"],"toText":[1,"to-text"],"chooseCustomerNumberText":[1,"choose-customer-number-text"],"isLoading":[32]},[[0,"urlSelected","onUrlSelected"]]]]],["p-d647d45e",[[4,"pn-profile-modal-customernumber",{"url":[513],"customernumber":[513],"selected":[516]}]]],["p-4cd6ecf4",[[4,"pn-profile-modal-profile",{"heading":[513],"description":[513],"url":[513],"selected":[1028],"showCustomerNumbers":[516,"show-customer-numbers"],"pleaseSelectText":[513,"please-select-text"],"visible":[1540],"identifier":[32]}]]],["p-cd71fee1",[[4,"pn-profile-modal-type",{"typeid":[513],"name":[1025],"selected":[1028],"selectedprofile":[1025]},null,{"selected":["onSelectedChange"]}]]],["p-c7cab50e",[[4,"pn-profile-selector",{"language":[1537],"returnUrl":[1,"return-url"],"heading":[1],"i18n":[32],"isLoading":[32],"numberOfProfiles":[32]}]]],["p-21e7c38e",[[0,"pn-profile-selector-option",{"heading":[1],"description":[1],"url":[1]}]]],["p-b9505c69",[[4,"pn-quick-cta",{"heading":[1],"preamble":[1]}]]],["p-fc157a1e",[[4,"pn-quote-card",{"quote":[1],"name":[1],"occupation":[1]}]]],["p-310a41ee",[[4,"pn-sidenav",{"language":[1],"navLabel":[1,"nav-label"],"i18n":[32]},[[0,"language","setLanguage"],[0,"openSubMenuLevelChange","onOpenSubMenuLevelChange"]]]]],["p-3c36dcdc",[[4,"pn-sidenav-level",{"level":[32],"levelId":[32],"isOpen":[32],"parentName":[32],"parentHref":[32],"parentLinkId":[32],"alignment":[32]},null,{"isOpen":["onOpen"]}]]],["p-da823949",[[4,"pn-sidenav-link",{"name":[1],"href":[1],"target":[1],"linkid":[1],"icon":[1],"currentSelection":[4,"current-selection"],"levelId":[32],"open":[32],"hasChildren":[32]}]]],["p-98b57467",[[4,"pn-sidenav-togglebutton",{"label":[1],"i18n":[32]}]]],["p-d0a085cc",[[4,"pn-spotlight",{"heading":[1],"preamble":[1],"isDynamic":[4,"is-dynamic"],"addDynamic":[32]}]]],["p-725aba56",[[4,"pn-teaser-card",{"text":[1],"heading":[1],"label":[1],"headingLevel":[2,"heading-level"],"dataCardColor":[513,"data-card-color"],"dataCardAlignment":[513,"data-card-alignment"],"hasCtaSlotContent":[32],"hasIllustrationSlot":[32]}]]],["p-3c2f8663",[[4,"pn-usp-promoter",{"heading":[1],"headingExtension":[1,"heading-extension"],"bodyText":[1,"body-text"],"backgroundGradient":[1,"background-gradient"],"fullWidth":[4,"full-width"],"rightAlign":[4,"right-align"],"hideMobileImage":[4,"hide-mobile-image"]}]]],["p-dd2c705b",[[0,"pn-proxio-findprice-result",{"item":[1040],"activeweight":[1026],"shownitems":[16],"Usp1":[1,"usp-1"],"Usp2":[1,"usp-2"],"Usp3":[1,"usp-3"],"description":[16],"showMeasurement":[4,"show-measurement"],"showInternational":[4,"show-international"],"selectedCountrycode":[1,"selected-countrycode"],"market":[1],"language":[1025],"weightText":[32],"linkId":[32],"shopLabel":[32],"shopUrl":[32],"shopId":[32],"i18n":[32]},null,{"item":["composeItems"],"activeweight":["getPriceString","getProductLink"]}]]],["p-6896773d",[[0,"pn-find-service-and-price-result",{"item":[1040],"shownitems":[16],"weightText":[32]},null,{"item":["composeItems"]}]]],["p-560e5291",[[0,"pn-play-on-scroll",{"videoSrc":[1,"video-src"],"observerOptions":[16],"showOverlay":[4,"show-overlay"],"videoId":[32],"isManuallyPaused":[32],"isPaused":[32]}]]],["p-b358bfd4",[[0,"pn-dropdown-with-multi-input-rows-row",{"languageCode":[1,"language-code"],"fristInputPlaceholder":[1,"frist-input-placeholder"],"firstInputMin":[2,"first-input-min"],"firstInputMax":[2,"first-input-max"],"firstInputWarning":[2,"first-input-warning"],"firstInputWarningText":[1,"first-input-warning-text"],"firstInputLowErrorText":[1,"first-input-low-error-text"],"firstInputHighErrorText":[1,"first-input-high-error-text"],"secondInputPlaceholder":[1,"second-input-placeholder"],"secondInputMin":[2,"second-input-min"],"secondInputMax":[2,"second-input-max"],"secondInputWarning":[2,"second-input-warning"],"secondInputWarningText":[1,"second-input-warning-text"],"secondInputLowErrorText":[1,"second-input-low-error-text"],"secondInputHighErrorText":[1,"second-input-high-error-text"],"dateLabel":[1,"date-label"],"datePlaceholder":[1,"date-placeholder"],"firstValidDate":[1,"first-valid-date"],"lastValidDate":[1,"last-valid-date"],"predefinedValue":[1,"predefined-value"],"rowIndex":[2,"row-index"],"minRowCount":[2,"min-row-count"],"disabledDates":[1,"disabled-dates"],"showFirstInputWarning":[32],"showFirstInputLowError":[32],"showFirstInputHighError":[32],"showSecondInputWarning":[32],"showSecondInputLowError":[32],"showSecondInputHighError":[32],"firstInputValue":[32],"secondInputValue":[32],"dateValue":[32]},null,{"predefinedValue":["applyPredefinedValue"]}]]],["p-28c2eea1",[[0,"pn-multi-row-connected-dropdown-row",{"dropdownData":[1,"dropdown-data"],"languageCode":[1,"language-code"],"label":[1],"firstDropdownLabel":[1,"first-dropdown-label"],"secondDropdownLabel":[1,"second-dropdown-label"],"dropdownPlaceholder":[1,"dropdown-placeholder"],"addRowText":[1,"add-row-text"],"inputFildLabel":[1,"input-fild-label"],"inputFildPlaceholder":[1,"input-fild-placeholder"],"disabledDates":[1,"disabled-dates"],"dateButtonText":[1,"date-button-text"],"datePlaceholder":[1,"date-placeholder"],"dateDaysFromToday":[2,"date-days-from-today"],"allowMultipleDates":[4,"allow-multiple-dates"],"startDateLabel":[1,"start-date-label"],"endDateLabel":[1,"end-date-label"],"multiDateHelperText":[1,"multi-date-helper-text"],"generateDatesButtonText":[1,"generate-dates-button-text"],"saveDateButtonText":[1,"save-date-button-text"],"noDatesText":[1,"no-dates-text"],"index":[2],"predefinedValue":[1,"predefined-value"],"yearsToAddToEndDate":[2,"years-to-add-to-end-date"],"minAmount":[2,"min-amount"],"errorMessageEmpty":[1,"error-message-empty"],"errorMessageMinAmount":[1,"error-message-min-amount"],"minWarningAmount":[2,"min-warning-amount"],"warningMessageMinAmount":[1,"warning-message-min-amount"],"buttonsArray":[32],"firstDropdownArr":[32],"secondDropdownArr":[32],"firstDropdownClass":[32],"secondDropdownClass":[32],"firstValidDateString":[32],"lastValidDateString":[32],"firstDropdownPlaceholder":[32],"secondDropdownPlaceholder":[32],"startDateValue":[32],"endDateValue":[32],"generatedDatesArr":[32],"selectedButtonValue":[32],"inputFieldValue":[32],"dateValue":[32],"daysArr":[32]},null,{"predefinedValue":["applyPredefinedValue"]}]]],["p-77a35f5e",[[4,"pn-share-item",{"link":[1],"text":[1]}]]],["p-45b8cadb",[[0,"pn-stats-info-data",{"format":[1],"formatStyle":[1,"format-style"],"startValue":[2,"start-value"],"data":[2],"unit":[1],"preamble":[1],"duration":[2],"index":[2],"hasBeenShown":[32],"compId":[32]},null,{"hasBeenShown":["watchStateHandlder"]}]]],["p-2aa0d929",[[0,"pn-find-price-result",{"item":[1040],"shownitems":[16],"Usp1":[1,"usp-1"],"Usp2":[1,"usp-2"],"Usp3":[1,"usp-3"],"description":[16],"showMeasurement":[4,"show-measurement"],"weightText":[32],"linkId":[32],"shopLabel":[32],"shopUrl":[32],"shopId":[32]},null,{"item":["composeItems"]}]]],["p-47644c25",[[1,"pn-filter-checkbox",{"value":[520],"name":[1],"checkboxid":[1],"disabled":[4],"checked":[4],"indeterminate":[1028]},[[0,"change","handlechange"]]]]],["p-5f15e75e",[[4,"pn-mainnav-link",{"name":[1],"href":[1],"target":[1],"linkid":[1],"levelId":[32],"open":[32],"hasChildren":[32]}]]],["p-8e104e81",[[4,"pn-site-footer",{"url":[1],"linktitle":[1],"theme":[513]}],[4,"pn-site-footer-col",{"theme":[513]}],[0,"pn-swan",{"licenseNumber":[1,"license-number"],"language":[1537],"linkTo":[1,"link-to"],"i18n":[32]},null,{"language":["onLanguageChange"]}]]],["p-4d2ca281",[[4,"pn-choice-button",{"value":[520],"name":[1],"choiceid":[1],"type":[1],"disabled":[4],"checked":[4],"indeterminate":[1028]},[[0,"change","handlechange"]]]]],["p-f3c35d22",[[0,"pn-product-tile-info",{"label":[1],"text":[1],"icon":[1]}],[0,"pn-product-tile-price",{"label":[1],"amount":[1],"currency":[1],"url":[1]}]]],["p-59549c74",[[4,"pn-scroll",{"observerOptions":[16],"behaviourClasses":[1,"behaviour-classes"],"transitionDurationSeconds":[2,"transition-duration-seconds"],"shouldLoop":[4,"should-loop"],"intersectFunc":[16],"notIntersectFunc":[16],"compId":[32]}],[0,"pn-video-overlay",{"language":[1],"isPaused":[4,"is-paused"],"showOverlay":[4,"show-overlay"],"i18n":[32]},null,{"language":["onLanguageChange"]}]]],["p-6a5f7dee",[[0,"pn-marketweb-siteheader-login-linklist",{"heading":[1],"links":[16],"idNamespace":[1,"id-namespace"],"showUnifiedLogin":[4,"show-unified-login"]}]]],["p-1f51ae34",[[0,"pn-marketweb-input",{"disabled":[4],"error":[1],"invalid":[4],"helpertext":[1],"label":[1],"placeholder":[1],"inputid":[1],"name":[1],"required":[4],"type":[1025],"autocomplete":[1],"valid":[4],"value":[1],"maxlength":[1],"min":[1],"max":[1],"step":[1],"pattern":[1],"showText":[32]}]]],["p-5fc3c481",[[4,"pn-titletag",{"icon":[1],"color":[1537]}]]],["p-2b9e6252",[[0,"pn-marketweb-siteheader-unified-login",{"loggedIn":[4,"logged-in"],"myPageLabel":[1,"my-page-label"],"myPageUrl":[1,"my-page-url"],"logInLabel":[1,"log-in-label"],"useMarketwebLogin":[4,"use-marketweb-login"],"environment":[1]}],[0,"pn-marketweb-siteheader-login-links",{"loginDialog":[1040],"idNamespace":[1,"id-namespace"],"loggedin":[516],"username":[1],"showUnifiedLogin":[4,"show-unified-login"]},null,{"loginDialog":["init"]}],[0,"pn-marketweb-siteheader-login-profileselection",{"loginDialog":[1040],"endpoint":[1],"loggedin":[4],"idNamespace":[1,"id-namespace"],"heading":[1],"i18n":[16],"currentProfile":[1040],"profileoptions":[1040],"user":[32],"logoutLink":[32],"userName":[32],"userEmail":[32]}],[0,"pn-marketweb-siteheader-login-button",{"label":[1],"useMarketwebLogin":[4,"use-marketweb-login"],"environment":[1]}],[0,"pn-marketweb-siteheader-login-mypage-button",{"label":[1],"myPageUrl":[1,"my-page-url"]}]]],["p-4f27858c",[[0,"pn-marketweb-siteheader-login",{"endpoint":[1],"token":[1],"i18n":[16],"siteUrl":[1,"site-url"],"emitEvents":[4,"emit-events"],"loginDialog":[1040],"fullname":[1],"loggedin":[4],"showProfileSelection":[1028,"show-profile-selection"],"showUnifiedLogin":[4,"show-unified-login"],"checkUserLoggedInStateInterval":[2,"check-user-logged-in-state-interval"],"environment":[1],"useMarketwebLogin":[4,"use-marketweb-login"],"loginLinks":[32],"toggleButtonText":[32],"username":[32]},null,{"i18n":["init"],"loginDialog":["init"]}],[4,"pn-mainnav-level",{"label":[1537],"level":[32],"levelId":[32],"isOpen":[32],"parentName":[32],"parentHref":[32],"parentLinkId":[32],"listCount":[32],"alignment":[32]},null,{"label":["setState"],"isOpen":["onOpen"]}],[4,"pn-language-selector",{"value":[1537],"selectedLanguageName":[32],"options":[32],"i18n":[32]},null,{"value":["setSelectedLanguageName","setTranslations","onValueChange"]}],[0,"pn-language-selector-option",{"name":[1],"code":[1],"url":[1],"selected":[4],"currentLanguage":[1,"current-language"]}],[4,"pn-mainnav",{"market":[1],"language":[1],"navigationId":[1,"navigation-id"],"openMenu":[1028,"open-menu"],"navLabel":[1,"nav-label"]},[[0,"language","setLanguage"],[0,"market","setMarket"],[0,"menuLanguageChange","onLanguageChange"],[0,"setmenuopenstate","setMenuOpenState"],[0,"openMenuLevelChange","onOpenMenuLevelChange"]]],[4,"pn-mainnav-list",{"heading":[1],"linkCount":[32]}],[0,"pn-marketweb-siteheader-search",{"i18n":[8,"i-1-8n"],"showOnlyLink":[1028,"show-only-link"],"hideSearch":[1028,"hide-search"],"language":[1537],"siteid":[1],"search":[1040],"primary":[4],"icononly":[4],"autoCompleteOptions":[32]}],[4,"pn-site-selector",{"buttontext":[1537],"heading":[1537],"language":[1537],"i18n":[32]}],[0,"pn-site-selector-item",{"url":[1],"heading":[1],"description":[1],"newwindow":[4]}]]],["p-2fa074f2",[[4,"pn-proxio-productcard"],[0,"pn-proxio-productcard-description",{"heading":[1],"highlight":[1],"description":[1],"list":[1040]}],[0,"pn-proxio-productcard-information",{"label":[1],"information":[16]}],[0,"pn-proxio-productcard-pricelink",{"price":[1],"vatText":[1,"vat-text"],"link":[1],"linktext":[1]}]]],["p-17f93c62",[[0,"pn-product-card-info",{"rulle":[1],"paket":[1],"label":[1],"text":[1]}],[0,"pn-product-card-price",{"label":[1],"amount":[1],"currency":[1],"note":[1],"url":[1],"service":[1],"linkid":[1]}],[4,"pn-product-card"]]]]'),e)}));
|
|
1
|
+
import{p as e,H as t,b as a}from"./p-bb1c965e.js";export{s as setNonce}from"./p-bb1c965e.js";import{g as n}from"./p-e1255160.js";var o=()=>{{r(t.prototype)}const a=import.meta.url;const n={};if(a!==""){n.resourcesUrl=new URL(".",a).href}return e(n)};var r=e=>{const t=e.cloneNode;e.cloneNode=function(e){if(this.nodeName==="TEMPLATE"){return t.call(this,e)}const a=t.call(this,false);const n=this.childNodes;if(e){for(let e=0;e<n.length;e++){if(n[e].nodeType!==2){a.appendChild(n[e].cloneNode(true))}}}return a}};o().then((async e=>{await n();return a(JSON.parse('[["p-1374c7bd",[[4,"pn-marketweb-siteheader",{"market":[1537],"language":[1537],"siteid":[1],"environment":[1537],"userToken":[1,"user-token"],"userFullname":[1,"user-fullname"],"userLoggedin":[516,"user-loggedin"],"endpoint":[1],"hideSiteSelector":[1540,"hide-site-selector"],"hideHomeMenuItem":[1540,"hide-home-menu-item"],"hideLanguageSelector":[1540,"hide-language-selector"],"hideSearch":[1540,"hide-search"],"hideLogin":[1540,"hide-login"],"showProfileSelection":[1540,"show-profile-selection"],"showUnifiedLogin":[4,"show-unified-login"],"siteDomainInUrls":[4,"site-domain-in-urls"],"AutocompleteEndpoint":[1,"autocomplete-endpoint"],"sessionForward":[4,"session-forward"],"cache":[4],"searchPlaceholder":[1,"search-placeholder"],"spaMode":[4,"spa-mode"],"checkUserLoggedInStateInterval":[2,"check-user-logged-in-state-interval"],"useMarketwebLogin":[4,"use-marketweb-login"],"pageId":[1,"page-id"],"i18n":[32],"gotData":[32],"fetchingData":[32],"homePageLink":[32],"menuItems":[32],"siteDefinition":[32],"search":[32],"siteSelector":[32],"languageSelector":[32],"languageOptions":[32],"loginDialog":[32],"minimizeSearch":[32],"loggedIn":[32]},[[0,"setLanguage","onLanguageSelectorChange"],[0,"loginStateChange","onLoginStateChange"],[9,"resize","handleResize"]],{"language":["onLanguageChange"],"market":["onMarketChange"]}]]],["p-c47b5782",[[0,"pn-proxio-findprice",{"endpoint":[1025],"language":[1025],"market":[1025],"showMedium":[4,"show-medium"],"showInternational":[4,"show-international"],"maxAbroadKg":[2,"max-abroad-kg"],"weightListName":[1,"weight-list-name"],"cache":[4],"filteredItems":[32],"weight":[32],"weightvalue":[32],"countrycodevalue":[32],"sizecategory":[32],"data":[32]},null,{"market":["setState"],"language":["setState"],"sizecategory":["filterItems"],"weightvalue":["filterItems"],"countrycodevalue":["filterItems"]}]]],["p-ffd62b09",[[0,"pn-find-price",{"source":[1],"language":[1025],"market":[1025],"filteredItems":[32],"weight":[32],"weightvalue":[32],"sourceData":[32],"sizecategory":[32]},null,{"market":["setState"],"language":["setState"],"sizecategory":["filterItems"],"weightvalue":["filterItems"]}]]],["p-1f3e8d59",[[0,"pn-find-service-and-price",{"source":[1],"language":[1025],"market":[1025],"filteredItems":[32],"postagetype":[32],"weight":[32],"weightvalue":[32],"deliveryscope":[32],"sourceData":[32]},null,{"market":["setState"],"language":["setState"],"postagetype":["filterItems"],"deliveryscope":["filterItems"],"weightvalue":["filterItems"]}]]],["p-a6c5b069",[[4,"pn-product-pricelist",{"source":[1],"language":[1025],"market":[1025],"productid":[1],"filteredItems":[32],"sourceData":[32],"gotData":[32],"loading":[32],"postagetype":[32],"weight":[32],"weightvalue":[32]},null,{"market":["setState"],"language":["setState"],"postagetype":["filterItems"],"weightvalue":["filterItems"]}]]],["p-eb0380be",[[0,"pn-proxio-pricegroup",{"endpoint":[1025],"language":[1],"market":[1],"tariffid":[1],"cache":[4],"activeWeightIndex":[32],"data":[32],"i18n":[32]},[[0,"activeWeightIndex","setActiveWeightIndex"],[0,"language","setLanguage"]]]]],["p-93a318bb",[[0,"pn-product-pricelist-result",{"item":[1040],"description":[16],"shownitems":[16],"showMeasurement":[4,"show-measurement"],"weightText":[32]},null,{"item":["composeItems"]}]]],["p-a54a298b",[[4,"pn-marketweb-sitefooter",{"market":[1537],"language":[1537],"environment":[1537],"endpoint":[1],"siteDomainInUrls":[4,"site-domain-in-urls"],"cache":[4],"theme":[513],"backgroundcolor":[513],"showSwan":[4,"show-swan"],"headingLevel":[1,"heading-level"],"siteDefinition":[32],"footerContent":[32],"i18n":[32],"gotData":[32],"fetchingData":[32]},null,{"language":["onLanguageChange"],"market":["onMarketChange"]}]]],["p-a395e8ed",[[4,"pn-media-block",{"blockHeight":[1,"block-height"],"imageSrc":[1,"image-src"],"imageSrcSmallScreenFormat":[1,"image-src-small-screen-format"],"imageAltText":[1,"image-alt-text"],"videoSrc":[1,"video-src"],"parallaxScroll":[4,"parallax-scroll"],"showOverlayLayer":[4,"show-overlay-layer"],"customOverlayBackground":[1,"custom-overlay-background"],"animateOverlayBackground":[4,"animate-overlay-background"],"scrollSnapBlock":[4,"scroll-snap-block"],"fixedBackground":[4,"fixed-background"],"blockHeading":[1,"block-heading"],"blockHeadingLevel":[2,"block-heading-level"],"blockPreamble":[1,"block-preamble"],"marginBottom":[4,"margin-bottom"],"pnPlayOnScrollObserverOptions":[32],"calculatedBlockHeight":[32],"hasButtonSlot":[32]}]]],["p-34dc822a",[[0,"pn-dropdown-with-multi-input-rows",{"dropdownData":[1,"dropdown-data"],"languageCode":[1,"language-code"],"firstDropdownLabel":[1,"first-dropdown-label"],"firstDropdownHelperText":[1,"first-dropdown-helper-text"],"secondDropdownLabel":[1,"second-dropdown-label"],"secondDropdownHelperText":[1,"second-dropdown-helper-text"],"secondDropdownMax":[2,"second-dropdown-max"],"deleteMultipleRowsWarningText":[1,"delete-multiple-rows-warning-text"],"confirmDeleteButtonText":[1,"confirm-delete-button-text"],"abortDeleteButtonText":[1,"abort-delete-button-text"],"fristInputLabel":[1,"frist-input-label"],"fristInputPlaceholder":[1,"frist-input-placeholder"],"firstInputMin":[2,"first-input-min"],"firstInputMax":[2,"first-input-max"],"firstInputWarning":[2,"first-input-warning"],"firstInputWarningText":[1,"first-input-warning-text"],"firstInputLowErrorText":[1,"first-input-low-error-text"],"firstInputHighErrorText":[1,"first-input-high-error-text"],"secondInputLabel":[1,"second-input-label"],"secondInputPlaceholder":[1,"second-input-placeholder"],"secondInputMin":[2,"second-input-min"],"secondInputMax":[2,"second-input-max"],"secondInputWarning":[2,"second-input-warning"],"secondInputWarningText":[1,"second-input-warning-text"],"secondInputLowErrorText":[1,"second-input-low-error-text"],"secondInputHighErrorText":[1,"second-input-high-error-text"],"disabledDates":[1,"disabled-dates"],"dateLabel":[1,"date-label"],"datePlaceholder":[1,"date-placeholder"],"dateDaysFromToday":[2,"date-days-from-today"],"yearsToAddToEndDate":[2,"years-to-add-to-end-date"],"sumFieldLabel":[1,"sum-field-label"],"addRowText":[1,"add-row-text"],"elementHelperText":[1,"element-helper-text"],"dropdownDataRoot":[32],"secondDropdownArr":[32],"rowData":[32],"formValues":[32],"firstValidDateString":[32],"lastValidDateString":[32],"rowSum":[32],"minRowCount":[32],"showDelteConfirm":[32]},[[0,"rowValueChange","predefinedValueChange"],[0,"firstInputChange","predefinedValueChange"],[0,"secondInputChange","predefinedValueChange"],[0,"deleteRowEvent","deleteRowEvent"]]]]],["p-5614b82e",[[0,"pn-multi-row-connected-dropdown",{"dropdownData":[1,"dropdown-data"],"languageCode":[1,"language-code"],"label":[1],"firstDropdownLabel":[1,"first-dropdown-label"],"secondDropdownLabel":[1,"second-dropdown-label"],"dropdownPlaceholder":[1,"dropdown-placeholder"],"addRowText":[1,"add-row-text"],"inputFildLabel":[1,"input-fild-label"],"inputFildPlaceholder":[1,"input-fild-placeholder"],"disabledDates":[1,"disabled-dates"],"dateButtonText":[1,"date-button-text"],"datePlaceholder":[1,"date-placeholder"],"dateDaysFromToday":[2,"date-days-from-today"],"allowMultipleRows":[4,"allow-multiple-rows"],"allowMultipleDates":[4,"allow-multiple-dates"],"startDateLabel":[1,"start-date-label"],"endDateLabel":[1,"end-date-label"],"multiDateHelperText":[1,"multi-date-helper-text"],"generateDatesButtonText":[1,"generate-dates-button-text"],"saveDateButtonText":[1,"save-date-button-text"],"noDatesText":[1,"no-dates-text"],"yearsToAddToEndDate":[2,"years-to-add-to-end-date"],"minAmount":[2,"min-amount"],"errorMessageEmpty":[1,"error-message-empty"],"errorMessageMinAmount":[1,"error-message-min-amount"],"minWarningAmount":[2,"min-warning-amount"],"warningMessageMinAmount":[1,"warning-message-min-amount"],"rowCount":[32],"rowData":[32],"formValues":[32]},[[0,"rowValueChange","predefinedValueChange"],[0,"deleteRowEvent","deleteRowEvent"]]]]],["p-91791451",[[0,"pn-multiple-input",{"label":[1],"placeholder":[1],"addRowButtonText":[1,"add-row-button-text"],"rowData":[32]}]]],["p-1ec21bd6",[[0,"pn-parcel-tracker",{"formActionUrl":[1,"form-action-url"],"heading":[1],"buttonLabel":[1,"button-label"],"locale":[1],"placeholder":[1],"inputName":[1,"input-name"],"currentWidth":[32]},[[9,"resize","handleViewportSizeChange"]]]]],["p-9e2c992d",[[0,"pn-pex-pricefinder",{"language":[1],"currency":[1],"apiUrl":[1,"api-url"],"i18n":[32],"fromzip":[32],"tozip":[32],"weight":[32],"when":[32],"response":[32]},[[0,"language","setLanguage"]]]]],["p-e2e3ac2f",[[0,"pn-share",{"link":[1],"language":[1537],"i18n":[32]},null,{"language":["onLanguageChange"]}]]],["p-a38118be",[[4,"pn-stats-info",{"heading":[1],"dataArray":[1,"data-array"],"backgroundUrl":[1,"background-url"],"myParsedArray":[32]},null,{"dataArray":["parseMyArrayProp"]}]]],["p-59cb7166",[[0,"pn-address-autofill",{"market":[1537],"environment":[1537],"endpoint":[1],"cache":[4],"countryCode":[1,"country-code"],"language":[1],"postalCodeProps":[1,"postal-code-props"],"cityProps":[1,"city-props"],"streetAddressProps":[1,"street-address-props"],"streetNumberProps":[1,"street-number-props"],"postalCode":[32],"city":[32],"streetAddress":[32],"streetNumber":[32],"validAddress":[32],"translation":[32],"postalCodeRequiredLabel":[32],"streetRequiredLabel":[32],"fullAddress":[32],"isLoading":[32]}]]],["p-066e9db9",[[4,"pn-animated-tile",{"toggled":[32],"transitionClassName":[32],"animateIcon":[32]},null,{"toggled":["onToggledHandler"]}]]],["p-de1b8176",[[0,"pn-app-banner",{"appName":[1,"app-name"],"appDescription":[1,"app-description"],"ctaText":[1,"cta-text"],"appleStoreLink":[1,"apple-store-link"],"googleStoreLink":[1,"google-store-link"],"isClosed":[32],"storeLink":[32],"isLocalStorageAvailable":[32]}]]],["p-4e3059dd",[[4,"pn-bonus-progressbar",{"icon":[1],"heading":[1],"sumtext":[513],"theme":[513],"bonuspercentage":[1],"currency":[513],"value":[1538],"min":[1538],"max":[1538],"valuepercentage":[32],"progresspercentage":[32],"levelValues":[32],"currentLevelAdjustedValue":[32]},null,{"currentLevelAdjustedValue":["setValuePercentage"],"value":["setValuePercentage"],"min":["setValuePercentage"],"max":["setValuePercentage"]}]]],["p-c5772021",[[0,"pn-bonus-progressbar-level",{"current":[516],"value":[1538],"bonuspercentage":[1537],"visualpercentage":[1538],"percentage":[32],"max":[32],"min":[32],"currency":[32]}]]],["p-42f9f2c3",[[0,"pn-breakpoints",{"breakPointClass":[1,"break-point-class"],"currentWidth":[32]},[[9,"resize","handleViewportSizeChange"]]]]],["p-278cda98",[[0,"pn-chart",{"labels":[1],"dataSets":[1,"data-sets"],"dataChartType":[8,"data-chart-type"],"myChartCtxRef":[32]},null,{"dataSets":["dataChangeHandler"],"labels":["labelsChangeHandler"]}]]],["p-a419cd91",[[4,"pn-charts-card",{"header":[1],"highlight":[1],"preamble":[1],"label":[1],"source":[1],"sourceUrl":[1,"source-url"],"ctaLinkText":[1,"cta-link-text"],"openInNewWindow":[4,"open-in-new-window"]}]]],["p-24086c59",[[4,"pn-cta-block",{"heading":[1],"bodyText":[1,"body-text"],"pnBackgroundColor":[1,"pn-background-color"],"isLarge":[4,"is-large"],"isCentered":[4,"is-centered"],"isSmall":[4,"is-small"],"contentTop":[4,"content-top"]}]]],["p-f15cec50",[[4,"pn-customernumber-selector",{"language":[1537],"open":[1540],"heading":[1],"description":[1],"i18n":[32]}]]],["p-4e58a3cf",[[4,"pn-customernumber-selector-option",{"heading":[1],"description":[1],"url":[1]}]]],["p-517decc5",[[0,"pn-date-and-time",{"languageCode":[1,"language-code"],"dateAndTimeLabel":[1,"date-and-time-label"],"dateDaysFromToday":[2,"date-days-from-today"],"validTimeRangeMinutes":[2,"valid-time-range-minutes"],"errorMessage":[1,"error-message"],"dateHelperText":[1,"date-helper-text"],"timeHelperText":[1,"time-helper-text"],"disableWeekends":[4,"disable-weekends"],"disabledDates":[1,"disabled-dates"],"datePlacehodler":[1,"date-placehodler"],"language":[32],"hourArr":[32],"minuteArr":[32],"formValue":[32],"invalidTimespan":[32],"selectedDate":[32],"selectedFromHour":[32],"selectedFromMin":[32],"selectedToHour":[32],"selectedToMin":[32],"firstValidDateString":[32],"lastValidDateString":[32]}]]],["p-3823577e",[[4,"pn-dropdown-choice-adds-row",{"dropdownData":[1,"dropdown-data"],"languageCode":[1,"language-code"],"addRowDropdownName":[1,"add-row-dropdown-name"],"addRowDropdownPlaceholder":[1,"add-row-dropdown-placeholder"],"addRowDropdownLabel":[1,"add-row-dropdown-label"],"rowNameLabel":[1,"row-name-label"],"rowHasDropdown":[4,"row-has-dropdown"],"rowDropdownLabel":[1,"row-dropdown-label"],"rowDropdownPlaceholder":[1,"row-dropdown-placeholder"],"rowInputLabel":[1,"row-input-label"],"rowDeleteButtonText":[1,"row-delete-button-text"],"totalInputLimit":[2,"total-input-limit"],"inputLimitWarning":[1,"input-limit-warning"],"inputEmptyWarning":[1,"input-empty-warning"],"dropdownEmptyWarning":[1,"dropdown-empty-warning"],"nextRowIndex":[32],"rowSelectDropdownArr":[32],"formValue":[32]},null,{"dropdownData":["dropdownDataWatcher"]}]]],["p-9e4983f2",[[4,"pn-hero-block-international",{"heading":[1],"subHeading":[1,"sub-heading"],"preamble":[1],"animateLogo":[4,"animate-logo"],"showSideLoader":[4,"show-side-loader"],"centeredLayout":[4,"centered-layout"]}]]],["p-e6e012fb",[[0,"pn-line-shape"]]],["p-4cd45df9",[[4,"pn-link-list",{"heading":[1],"label":[1],"preamble":[1],"url":[1],"showMoreLabel":[1,"show-more-label"],"showMoreUrl":[1,"show-more-url"]}]]],["p-b5105c2d",[[0,"pn-marketweb-icon",{"symbol":[1],"small":[4],"color":[1]}]]],["p-3a15e364",[[1,"pn-marketweb-search",{"disabled":[4],"placeholder":[1],"inputid":[1],"name":[1],"autocomplete":[1],"list":[1],"value":[1],"label":[1],"loading":[4],"button":[1],"light":[4],"suggestionObserver":[32],"hasClonedInput":[32],"listSuggestion":[32]},[[0,"input","inputHandler"]]]]],["p-8baf0a85",[[4,"pn-product-tile"]]],["p-27a9104e",[[4,"pn-profile-modal",{"heading":[1],"continueCtaText":[1,"continue-cta-text"],"choosenCompanyText":[1,"choosen-company-text"],"toText":[1,"to-text"],"chooseCustomerNumberText":[1,"choose-customer-number-text"],"isLoading":[32]},[[0,"urlSelected","onUrlSelected"]]]]],["p-d647d45e",[[4,"pn-profile-modal-customernumber",{"url":[513],"customernumber":[513],"selected":[516]}]]],["p-4cd6ecf4",[[4,"pn-profile-modal-profile",{"heading":[513],"description":[513],"url":[513],"selected":[1028],"showCustomerNumbers":[516,"show-customer-numbers"],"pleaseSelectText":[513,"please-select-text"],"visible":[1540],"identifier":[32]}]]],["p-cd71fee1",[[4,"pn-profile-modal-type",{"typeid":[513],"name":[1025],"selected":[1028],"selectedprofile":[1025]},null,{"selected":["onSelectedChange"]}]]],["p-c7cab50e",[[4,"pn-profile-selector",{"language":[1537],"returnUrl":[1,"return-url"],"heading":[1],"i18n":[32],"isLoading":[32],"numberOfProfiles":[32]}]]],["p-21e7c38e",[[0,"pn-profile-selector-option",{"heading":[1],"description":[1],"url":[1]}]]],["p-b9505c69",[[4,"pn-quick-cta",{"heading":[1],"preamble":[1]}]]],["p-fc157a1e",[[4,"pn-quote-card",{"quote":[1],"name":[1],"occupation":[1]}]]],["p-310a41ee",[[4,"pn-sidenav",{"language":[1],"navLabel":[1,"nav-label"],"i18n":[32]},[[0,"language","setLanguage"],[0,"openSubMenuLevelChange","onOpenSubMenuLevelChange"]]]]],["p-3c36dcdc",[[4,"pn-sidenav-level",{"level":[32],"levelId":[32],"isOpen":[32],"parentName":[32],"parentHref":[32],"parentLinkId":[32],"alignment":[32]},null,{"isOpen":["onOpen"]}]]],["p-da823949",[[4,"pn-sidenav-link",{"name":[1],"href":[1],"target":[1],"linkid":[1],"icon":[1],"currentSelection":[4,"current-selection"],"levelId":[32],"open":[32],"hasChildren":[32]}]]],["p-98b57467",[[4,"pn-sidenav-togglebutton",{"label":[1],"i18n":[32]}]]],["p-d0a085cc",[[4,"pn-spotlight",{"heading":[1],"preamble":[1],"isDynamic":[4,"is-dynamic"],"addDynamic":[32]}]]],["p-725aba56",[[4,"pn-teaser-card",{"text":[1],"heading":[1],"label":[1],"headingLevel":[2,"heading-level"],"dataCardColor":[513,"data-card-color"],"dataCardAlignment":[513,"data-card-alignment"],"hasCtaSlotContent":[32],"hasIllustrationSlot":[32]}]]],["p-3c2f8663",[[4,"pn-usp-promoter",{"heading":[1],"headingExtension":[1,"heading-extension"],"bodyText":[1,"body-text"],"backgroundGradient":[1,"background-gradient"],"fullWidth":[4,"full-width"],"rightAlign":[4,"right-align"],"hideMobileImage":[4,"hide-mobile-image"]}]]],["p-dd2c705b",[[0,"pn-proxio-findprice-result",{"item":[1040],"activeweight":[1026],"shownitems":[16],"Usp1":[1,"usp-1"],"Usp2":[1,"usp-2"],"Usp3":[1,"usp-3"],"description":[16],"showMeasurement":[4,"show-measurement"],"showInternational":[4,"show-international"],"selectedCountrycode":[1,"selected-countrycode"],"market":[1],"language":[1025],"weightText":[32],"linkId":[32],"shopLabel":[32],"shopUrl":[32],"shopId":[32],"i18n":[32]},null,{"item":["composeItems"],"activeweight":["getPriceString","getProductLink"]}]]],["p-6896773d",[[0,"pn-find-service-and-price-result",{"item":[1040],"shownitems":[16],"weightText":[32]},null,{"item":["composeItems"]}]]],["p-560e5291",[[0,"pn-play-on-scroll",{"videoSrc":[1,"video-src"],"observerOptions":[16],"showOverlay":[4,"show-overlay"],"videoId":[32],"isManuallyPaused":[32],"isPaused":[32]}]]],["p-b358bfd4",[[0,"pn-dropdown-with-multi-input-rows-row",{"languageCode":[1,"language-code"],"fristInputPlaceholder":[1,"frist-input-placeholder"],"firstInputMin":[2,"first-input-min"],"firstInputMax":[2,"first-input-max"],"firstInputWarning":[2,"first-input-warning"],"firstInputWarningText":[1,"first-input-warning-text"],"firstInputLowErrorText":[1,"first-input-low-error-text"],"firstInputHighErrorText":[1,"first-input-high-error-text"],"secondInputPlaceholder":[1,"second-input-placeholder"],"secondInputMin":[2,"second-input-min"],"secondInputMax":[2,"second-input-max"],"secondInputWarning":[2,"second-input-warning"],"secondInputWarningText":[1,"second-input-warning-text"],"secondInputLowErrorText":[1,"second-input-low-error-text"],"secondInputHighErrorText":[1,"second-input-high-error-text"],"dateLabel":[1,"date-label"],"datePlaceholder":[1,"date-placeholder"],"firstValidDate":[1,"first-valid-date"],"lastValidDate":[1,"last-valid-date"],"predefinedValue":[1,"predefined-value"],"rowIndex":[2,"row-index"],"minRowCount":[2,"min-row-count"],"disabledDates":[1,"disabled-dates"],"showFirstInputWarning":[32],"showFirstInputLowError":[32],"showFirstInputHighError":[32],"showSecondInputWarning":[32],"showSecondInputLowError":[32],"showSecondInputHighError":[32],"firstInputValue":[32],"secondInputValue":[32],"dateValue":[32]},null,{"predefinedValue":["applyPredefinedValue"]}]]],["p-28c2eea1",[[0,"pn-multi-row-connected-dropdown-row",{"dropdownData":[1,"dropdown-data"],"languageCode":[1,"language-code"],"label":[1],"firstDropdownLabel":[1,"first-dropdown-label"],"secondDropdownLabel":[1,"second-dropdown-label"],"dropdownPlaceholder":[1,"dropdown-placeholder"],"addRowText":[1,"add-row-text"],"inputFildLabel":[1,"input-fild-label"],"inputFildPlaceholder":[1,"input-fild-placeholder"],"disabledDates":[1,"disabled-dates"],"dateButtonText":[1,"date-button-text"],"datePlaceholder":[1,"date-placeholder"],"dateDaysFromToday":[2,"date-days-from-today"],"allowMultipleDates":[4,"allow-multiple-dates"],"startDateLabel":[1,"start-date-label"],"endDateLabel":[1,"end-date-label"],"multiDateHelperText":[1,"multi-date-helper-text"],"generateDatesButtonText":[1,"generate-dates-button-text"],"saveDateButtonText":[1,"save-date-button-text"],"noDatesText":[1,"no-dates-text"],"index":[2],"predefinedValue":[1,"predefined-value"],"yearsToAddToEndDate":[2,"years-to-add-to-end-date"],"minAmount":[2,"min-amount"],"errorMessageEmpty":[1,"error-message-empty"],"errorMessageMinAmount":[1,"error-message-min-amount"],"minWarningAmount":[2,"min-warning-amount"],"warningMessageMinAmount":[1,"warning-message-min-amount"],"buttonsArray":[32],"firstDropdownArr":[32],"secondDropdownArr":[32],"firstDropdownClass":[32],"secondDropdownClass":[32],"firstValidDateString":[32],"lastValidDateString":[32],"firstDropdownPlaceholder":[32],"secondDropdownPlaceholder":[32],"startDateValue":[32],"endDateValue":[32],"generatedDatesArr":[32],"selectedButtonValue":[32],"inputFieldValue":[32],"dateValue":[32],"daysArr":[32]},null,{"predefinedValue":["applyPredefinedValue"]}]]],["p-77a35f5e",[[4,"pn-share-item",{"link":[1],"text":[1]}]]],["p-45b8cadb",[[0,"pn-stats-info-data",{"format":[1],"formatStyle":[1,"format-style"],"startValue":[2,"start-value"],"data":[2],"unit":[1],"preamble":[1],"duration":[2],"index":[2],"hasBeenShown":[32],"compId":[32]},null,{"hasBeenShown":["watchStateHandlder"]}]]],["p-2aa0d929",[[0,"pn-find-price-result",{"item":[1040],"shownitems":[16],"Usp1":[1,"usp-1"],"Usp2":[1,"usp-2"],"Usp3":[1,"usp-3"],"description":[16],"showMeasurement":[4,"show-measurement"],"weightText":[32],"linkId":[32],"shopLabel":[32],"shopUrl":[32],"shopId":[32]},null,{"item":["composeItems"]}]]],["p-47644c25",[[1,"pn-filter-checkbox",{"value":[520],"name":[1],"checkboxid":[1],"disabled":[4],"checked":[4],"indeterminate":[1028]},[[0,"change","handlechange"]]]]],["p-5f15e75e",[[4,"pn-mainnav-link",{"name":[1],"href":[1],"target":[1],"linkid":[1],"levelId":[32],"open":[32],"hasChildren":[32]}]]],["p-8e104e81",[[4,"pn-site-footer",{"url":[1],"linktitle":[1],"theme":[513]}],[4,"pn-site-footer-col",{"theme":[513]}],[0,"pn-swan",{"licenseNumber":[1,"license-number"],"language":[1537],"linkTo":[1,"link-to"],"i18n":[32]},null,{"language":["onLanguageChange"]}]]],["p-4d2ca281",[[4,"pn-choice-button",{"value":[520],"name":[1],"choiceid":[1],"type":[1],"disabled":[4],"checked":[4],"indeterminate":[1028]},[[0,"change","handlechange"]]]]],["p-f3c35d22",[[0,"pn-product-tile-info",{"label":[1],"text":[1],"icon":[1]}],[0,"pn-product-tile-price",{"label":[1],"amount":[1],"currency":[1],"url":[1]}]]],["p-59549c74",[[4,"pn-scroll",{"observerOptions":[16],"behaviourClasses":[1,"behaviour-classes"],"transitionDurationSeconds":[2,"transition-duration-seconds"],"shouldLoop":[4,"should-loop"],"intersectFunc":[16],"notIntersectFunc":[16],"compId":[32]}],[0,"pn-video-overlay",{"language":[1],"isPaused":[4,"is-paused"],"showOverlay":[4,"show-overlay"],"i18n":[32]},null,{"language":["onLanguageChange"]}]]],["p-6a5f7dee",[[0,"pn-marketweb-siteheader-login-linklist",{"heading":[1],"links":[16],"idNamespace":[1,"id-namespace"],"showUnifiedLogin":[4,"show-unified-login"]}]]],["p-1f51ae34",[[0,"pn-marketweb-input",{"disabled":[4],"error":[1],"invalid":[4],"helpertext":[1],"label":[1],"placeholder":[1],"inputid":[1],"name":[1],"required":[4],"type":[1025],"autocomplete":[1],"valid":[4],"value":[1],"maxlength":[1],"min":[1],"max":[1],"step":[1],"pattern":[1],"showText":[32]}]]],["p-5fc3c481",[[4,"pn-titletag",{"icon":[1],"color":[1537]}]]],["p-bba1a00a",[[0,"pn-marketweb-siteheader-unified-login",{"loggedIn":[4,"logged-in"],"myPageLabel":[1,"my-page-label"],"myPageUrl":[1,"my-page-url"],"logInLabel":[1,"log-in-label"],"useMarketwebLogin":[4,"use-marketweb-login"],"environment":[1]}],[0,"pn-marketweb-siteheader-login-links",{"loginDialog":[1040],"idNamespace":[1,"id-namespace"],"loggedin":[516],"username":[1],"showUnifiedLogin":[4,"show-unified-login"]},null,{"loginDialog":["init"]}],[0,"pn-marketweb-siteheader-login-profileselection",{"loginDialog":[1040],"endpoint":[1],"loggedin":[4],"idNamespace":[1,"id-namespace"],"heading":[1],"i18n":[16],"currentProfile":[1040],"profileoptions":[1040],"user":[32],"logoutLink":[32],"userName":[32],"userEmail":[32]}],[0,"pn-marketweb-siteheader-login-button",{"label":[1],"useMarketwebLogin":[4,"use-marketweb-login"],"environment":[1]}],[0,"pn-marketweb-siteheader-login-mypage-button",{"label":[1],"myPageUrl":[1,"my-page-url"]}]]],["p-4f27858c",[[0,"pn-marketweb-siteheader-login",{"endpoint":[1],"token":[1],"i18n":[16],"siteUrl":[1,"site-url"],"emitEvents":[4,"emit-events"],"loginDialog":[1040],"fullname":[1],"loggedin":[4],"showProfileSelection":[1028,"show-profile-selection"],"showUnifiedLogin":[4,"show-unified-login"],"checkUserLoggedInStateInterval":[2,"check-user-logged-in-state-interval"],"environment":[1],"useMarketwebLogin":[4,"use-marketweb-login"],"loginLinks":[32],"toggleButtonText":[32],"username":[32]},null,{"i18n":["init"],"loginDialog":["init"]}],[4,"pn-mainnav-level",{"label":[1537],"level":[32],"levelId":[32],"isOpen":[32],"parentName":[32],"parentHref":[32],"parentLinkId":[32],"listCount":[32],"alignment":[32]},null,{"label":["setState"],"isOpen":["onOpen"]}],[4,"pn-language-selector",{"value":[1537],"selectedLanguageName":[32],"options":[32],"i18n":[32]},null,{"value":["setSelectedLanguageName","setTranslations","onValueChange"]}],[0,"pn-language-selector-option",{"name":[1],"code":[1],"url":[1],"selected":[4],"currentLanguage":[1,"current-language"]}],[4,"pn-mainnav",{"market":[1],"language":[1],"navigationId":[1,"navigation-id"],"openMenu":[1028,"open-menu"],"navLabel":[1,"nav-label"]},[[0,"language","setLanguage"],[0,"market","setMarket"],[0,"menuLanguageChange","onLanguageChange"],[0,"setmenuopenstate","setMenuOpenState"],[0,"openMenuLevelChange","onOpenMenuLevelChange"]]],[4,"pn-mainnav-list",{"heading":[1],"linkCount":[32]}],[0,"pn-marketweb-siteheader-search",{"i18n":[8,"i-1-8n"],"showOnlyLink":[1028,"show-only-link"],"hideSearch":[1028,"hide-search"],"language":[1537],"siteid":[1],"search":[1040],"primary":[4],"icononly":[4],"autoCompleteOptions":[32]}],[4,"pn-site-selector",{"buttontext":[1537],"heading":[1537],"language":[1537],"i18n":[32]}],[0,"pn-site-selector-item",{"url":[1],"heading":[1],"description":[1],"newwindow":[4]}]]],["p-2fa074f2",[[4,"pn-proxio-productcard"],[0,"pn-proxio-productcard-description",{"heading":[1],"highlight":[1],"description":[1],"list":[1040]}],[0,"pn-proxio-productcard-information",{"label":[1],"information":[16]}],[0,"pn-proxio-productcard-pricelink",{"price":[1],"vatText":[1,"vat-text"],"link":[1],"linktext":[1]}]]],["p-17f93c62",[[0,"pn-product-card-info",{"rulle":[1],"paket":[1],"label":[1],"text":[1]}],[0,"pn-product-card-price",{"label":[1],"amount":[1],"currency":[1],"note":[1],"url":[1],"service":[1],"linkid":[1]}],[4,"pn-product-card"]]]]'),e)}));
|
|
2
2
|
//# sourceMappingURL=pn-market-web-components.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,g as i,h as t,d as n}from"./p-bb1c965e.js";import{s}from"./p-13190b30.js";import{a as o}from"./p-36b39340.js";import"./p-2509d18d.js";const r=(e,i)=>{const t="PRODUCTION";const n="https://atportal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=";const s="https://portal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=";const o="/login?returnUrl=";if(e){return o}else if(i.toUpperCase()!==t){return n}else{return s}};const l="";const a=l;const h=class{constructor(i){e(this,i);this.label="Log in";this.useMarketwebLogin=false;this.environment="local"}get hostElement(){return i(this)}loginUrl;componentWillLoad(){this.loginUrl=r(this.useMarketwebLogin,this.environment)}nagivateToLoginUrl(){const e=`${this.loginUrl}${window.location.href}`;return e}render(){return t(n,{key:"888e88fe3c6867e43b21bf31bb7a69af7f8434c3"},t("pn-button",{key:"162d656af10524e517867214105eb9593cd2fbd4",href:this.nagivateToLoginUrl()},this.label))}};h.style=a;const d="pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}";const c=d;const p=class{constructor(i){e(this,i);this.loginDialog=null;this.idNamespace="";this.loggedin=false;this.username="";this.showUnifiedLogin=false}get hostElement(){return i(this)}componentWillLoad(){this.init()}async init(){this.adjustLoginLinks()}adjustLoginLinks(){if(!this.loginDialog){return}const e=(e,i)=>{if(!e.isLogoutLink){e.isLogoutLink=e.pageLink.indexOf("location.href")!==-1&&e.pageLink.indexOf("logout")!==-1}if(e.isLogoutLink){e.href=s.loginManager.getLogoutUrl(e.href)}e.href=e.href.replace("window.location.href",window.location.href);if(i===0&&!e.href){e.href=s.loginManager.getLoginUrl();e.linkType="primary"}if(e.primaryLinkApperance&&!e.linkType){e.linkType="primary"}};if(this.loginDialog?.loginMenuLinks){this.loginDialog?.loginMenuLinks.forEach(e)}if(this.loginDialog?.loggedInLinks){this.loginDialog?.loggedInLinks.forEach(e)}this.loginDialog.legacyLoginLinks=[{href:s.loginManager.getLoginUrl(this.loginDialog.loginUrl),linkText:this.loginDialog.loginLinkText,openInNewWindow:false,isLogoutLink:false,pageLink:null,linkType:"primary",primaryLinkApperance:true},{href:s.loginManager.getLoginUrl(this.loginDialog.registerUrl),linkText:this.loginDialog.createLoginLinkText,openInNewWindow:false,isLogoutLink:false,pageLink:null,primaryLinkApperance:false}]}render(){if(!this.loginDialog){return}let e={username:null,loggedin:false};if(this.username){e.username=this.username;e.loggedin=this.loggedin}return t(n,{...e},!this.loginDialog.overrideLoginMenu?t("div",{"data-loggedin":this.loggedin+""},this.loggedin?t("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loggedInLinks,idNamespace:this.idNamespace}):t("div",null,this.loginDialog.loginMenuLinks?.length>0?t("pn-marketweb-siteheader-login-linklist",{heading:this.loginDialog.loginTitle,links:this.loginDialog.loginMenuLinks,idNamespace:this.idNamespace,showUnifiedLogin:this.showUnifiedLogin}):t("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.legacyLoginLinks,idNamespace:this.idNamespace}))):null,this.loginDialog.overrideLoginMenu?t("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loginMenuLinks,idNamespace:this.idNamespace}):null)}static get watchers(){return{loginDialog:["init"]}}};p.style=c;const f="";const u=f;const m=class{constructor(i){e(this,i);this.label="Mina sidor!";this.myPageUrl=undefined}get hostElement(){return i(this)}render(){return t(n,{key:"d6b3c9d56b4348d13418daf7233241d9cea5a538"},t("pn-button",{key:"09365225d5b096600c23fe44faea1d1e8acfdb42",href:this.myPageUrl},this.label))}};m.style=u;const g='pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.pn-marketweb-siteheader-login-profileselection-heading{display:block;padding:0.5rem 0 1rem}.pn-marketweb-siteheader-login-profileselection-user,.pn-marketweb-siteheader-login-profileselection-currentprofile{margin-top:1rem;margin-bottom:1rem}.pn-marketweb-siteheader-login-profileselection-user-name,.pn-marketweb-siteheader-login-profileselection-currentprofile-name{line-height:1}.pn-marketweb-siteheader-login-profileselection-user-description,.pn-marketweb-siteheader-login-profileselection-currentprofile-description{font-weight:400;white-space:normal;word-break:break-all;color:#5e554a;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-divider{height:1rem;width:100%;background:#00a0d6;position:relative;margin-left:-1em;margin-top:1.6rem;margin-bottom:1.6rem;border-radius:0 0.6em 0.6em 0;padding:0}.pn-marketweb-siteheader-login-profileselection-divider::after{content:"";width:0.6em;height:0.6em;border-radius:50%;position:absolute;right:0;top:0;background:inherit;transform:translateX(calc(100% + 0.2em))}.pn-marketweb-siteheader-login-profileselection-profileoption-link{display:flex;background:#ffffff;transition:background 0.15s ease-in-out;margin:0 -1em;padding:0.6rem 1.6rem;text-decoration:none;color:#005d92;align-items:center}.pn-marketweb-siteheader-login-profileselection-profileoption-link:hover,.pn-marketweb-siteheader-login-profileselection-profileoption-link:focus,.pn-marketweb-siteheader-login-profileselection-profileoption-link:active{background:#f3f2f2}.pn-marketweb-siteheader-login-profileselection-profileoption-content{flex-grow:1}.pn-marketweb-siteheader-login-profileselection-profileoption-name{font-weight:700}.pn-marketweb-siteheader-login-profileselection-profileoption-description{font-weight:400;white-space:normal;word-break:break-all;color:#5e554a;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-logout{padding:1.6rem;text-align:center;width:100%}.pn-marketweb-siteheader-login-profileselection-logout-link{display:inline-block;font-weight:500;color:#005d92;text-decoration:none}.pn-marketweb-siteheader-login-profileselection-logout-link:hover,.pn-marketweb-siteheader-login-profileselection-logout-link:focus,.pn-marketweb-siteheader-login-profileselection-logout-link:active{text-decoration:underline}';const b=g;const k=class{constructor(i){e(this,i);this.loginDialog=null;this.endpoint="";this.loggedin=false;this.idNamespace="";this.heading=null;this.i18n={searchlabel:"",searchplaceholder:"",searchbuttontext:"",menuHomeButton:"",menuGoBackButton:"",mainMenuButton:"",menuStartButton:"",profileSelectionFlyoutHeading:""};this.user=null;this.logoutLink=null;this.userName=null;this.userEmail="";this.currentProfile=null;this.profileoptions=[]}get hostElement(){return i(this)}componentWillLoad(){if(this.heading===null&&this.i18n?.profileSelectionFlyoutHeading){this.heading=this.i18n.profileSelectionFlyoutHeading}this.init()}init(){this.updateUserInfo();this.adjustLoginLinks();this.fetchProfiles()}async fetchProfiles(){if(!this.loggedin||this.profileoptions.length>0){return}let e=`${this.endpoint}${this.endpoint.lastIndexOf("/")>-1&&this.endpoint.lastIndexOf("/")===this.endpoint.length-1?"":"/"}api/user/parentorganizations`;const i=await fetch(e);const t=await i.json();const n={loggedin:true,organizations:[{name:"Forsheda Livs AB",customerNumber:"5564513603",id:"dbba867d-1dff-3dbb-b420-c57b4b828b73",selected:true,profiles:[{name:"Forsheda Livs AB",customerNumber:"20685482",id:"f757ba28-9a73-15a2-f128-4b394d970f3f",ssid:"",selected:false,customerGroup:"Business"},{name:"ICA MAXI KUNGSBACKA",customerNumber:"20831191",id:"5aea41df-32b0-3f7e-2946-78598360177d",ssid:"259686",selected:true,customerGroup:"Agent"}]},{name:"Hem Livs i Kungsbacka AB",customerNumber:"5565271250",id:"97ca363c-40ef-cca9-7a3c-9e7f025567c2",selected:false,profiles:[{name:"ICA KVANTUM KUNGSBACKA",customerNumber:"20831193",id:"fbd61ffd-41c6-2206-b88e-cfef91e1dc39",ssid:"259691",selected:false,customerGroup:"Agent"}]},{name:"ICA SUPERMARKET TORGET",customerNumber:"5568902679",id:"7cb76a94-e1a5-5f57-58fd-bc563851b28e",selected:false,profiles:[{name:"ICA SUPERMARKET TORGET",customerNumber:"20831212",id:"3a2db017-b68f-6fa0-fe70-542c08cd97ce",ssid:"",selected:false,customerGroup:"Agent"}]}]};const s=window.location.href.indexOf("localhost:6008")!==-1?n:t;if(!s||!s.organizations||!s.organizations.length){return}s.organizations.forEach((e=>{if(e.selected===true&&e.profiles){const i=e.profiles.filter((e=>e.selected===true));if(i&&i[0]&&i[0].customerGroup.toLocaleLowerCase()==="agent"&&i[0].ssid){e.customerNumber=i[0].ssid}}else{if(e.customerNumber.length===10&&e.customerNumber.substring(0,2)==="55"){e.customerNumber=e.customerNumber.substring(0,6)+"-"+e.customerNumber.substring(6)}this.profileoptions.push(e)}}));let o=s.organizations.filter((e=>e.selected===true))[0];const r={name:this.userName,customerNumber:"",id:"",selected:!o,profiles:[]};if(!o){o=r}if(o&&o.name){this.currentProfile=o}this.profileoptions.push(r)}adjustLoginLinks(){const e=(e,i)=>{if(!e.isLogoutLink){e.isLogoutLink=e.pageLink.indexOf("location.href")!==-1&&e.pageLink.indexOf("logout")!==-1}if(e.isLogoutLink){e.href=s.loginManager.getLogoutUrl(e.href)}if(i===0&&!e.href){e.href=s.loginManager.getLoginUrl();e.linkType="primary"}if(e.primaryLinkApperance&&!e.linkType){e.linkType="primary"}};if(this.loginDialog?.loggedInLinks){this.loginDialog?.loggedInLinks.forEach(e)}this.logoutLink=this.loginDialog?.loggedInLinks.filter((e=>e.isLogoutLink))[0]??null}updateUserInfo(){const e=s.loginManager.getUserInfo();this.user=e;if(!e){return}if(e&&e.email){this.userEmail=e.email}if(e&&e.given_name){this.userName=e.given_name+(e?.family_name?` ${e?.family_name}`:"")}if(e&&e.given_name){this.userName=e.given_name;return}if(e&&e.family_name){this.userName=e.family_name;return}if(e&&e.username){this.userName=e.username;return}}filterLogoutLink(e){return e.filter((e=>!e.isLogoutLink))}render(){if(!this.loginDialog){return}let e={};return t(n,{...e},this.heading?t("strong",{class:"pn-marketweb-siteheader-login-profileselection-heading"},this.heading):null,this.currentProfile!==null&&this.currentProfile.name?t("div",{class:"pn-marketweb-siteheader-login-profileselection-currentprofile"},t("div",{class:"pn-marketweb-siteheader-login-profileselection-currentprofile-name"},this.currentProfile.name),t("div",{class:"pn-marketweb-siteheader-login-profileselection-currentprofile-description"},this.currentProfile.customerNumber?this.currentProfile.customerNumber:this.userEmail)):null,t("pn-marketweb-siteheader-login-linklist",{links:this.filterLogoutLink(this.loginDialog.loggedInLinks),idNamespace:this.idNamespace}),t("div",{class:"pn-marketweb-siteheader-login-profileselection-divider"}),this.profileoptions.filter((e=>e.selected!==true)).map((e=>{let i=e.profiles.length>0?e.profiles[0].customerNumber:e.customerNumber;return t("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption"},t("a",{href:`${this.endpoint}/api/user/setprofile?customernumber=${i}&returnUrl=${window.location.href}`,class:"pn-marketweb-siteheader-login-profileselection-profileoption-link"},t("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-content"},t("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-name"},e.name),t("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-description"},e.customerNumber?e.customerNumber:this.userEmail)),t("pn-icon",{icon:o,small:"false",color:"blue700"})))})),this.logoutLink?t("div",{class:"pn-marketweb-siteheader-login-profileselection-logout"},t("a",{href:this.logoutLink.href,rel:"nofollower noopener",id:"pn-marketweb-header-logoutlink",onClick:()=>s.loginManager.clearUserData(),class:"pn-marketweb-siteheader-login-profileselection-logout-link"},this.logoutLink.linkText)):null)}};k.style=b;const w="";const v=w;const L=class{constructor(i){e(this,i);this.loggedIn=false;this.myPageLabel=undefined;this.myPageUrl=undefined;this.logInLabel=undefined;this.useMarketwebLogin=undefined;this.environment=undefined}get hostElement(){return i(this)}render(){return t(n,{key:"d8a36a509acd7a3265f79c097315747a48d51ace"},this.loggedIn?t("pn-marketweb-siteheader-login-mypage-button",{label:this.myPageLabel,myPageUrl:this.myPageUrl}):t("pn-marketweb-siteheader-login-button",{label:this.logInLabel,useMarketwebLogin:this.useMarketwebLogin,environment:this.environment}))}};L.style=v;export{h as pn_marketweb_siteheader_login_button,p as pn_marketweb_siteheader_login_links,m as pn_marketweb_siteheader_login_mypage_button,k as pn_marketweb_siteheader_login_profileselection,L as pn_marketweb_siteheader_unified_login};
|
|
2
|
-
//# sourceMappingURL=p-2b9e6252.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getLoginUrl","useMarketwebLogin","environment","environment_Production","devAuthUrl","prodAuthUrl","marketwebLoginUrl","toUpperCase","pnMarketwebSiteheaderLoginButtonCss","PnMarketwebSiteheaderLoginButtonStyle0","PnMarketwebSiteheaderLoginButton","loginUrl","componentWillLoad","this","nagivateToLoginUrl","navigationUrl","window","location","href","render","h","Host","key","label","pnMarketwebSiteheaderLoginLinksCss","PnMarketwebSiteheaderLoginLinksStyle0","PnMarketwebSiteheaderLoginLinks","init","adjustLoginLinks","loginDialog","adjustLink","link","i","isLogoutLink","pageLink","indexOf","headerState","loginManager","getLogoutUrl","replace","linkType","primaryLinkApperance","loginMenuLinks","forEach","loggedInLinks","legacyLoginLinks","linkText","loginLinkText","openInNewWindow","registerUrl","createLoginLinkText","hostElementAttribute","username","loggedin","overrideLoginMenu","links","idNamespace","length","heading","loginTitle","showUnifiedLogin","pnMarketwebSiteheaderLoginMypageButtonCss","PnMarketwebSiteheaderLoginMypageButtonStyle0","PnMarketwebSiteheaderLoginMypageButton","myPageUrl","pnMarketwebSiteheaderLoginProfileselectionCss","PnMarketwebSiteheaderLoginProfileselectionStyle0","PnMarketwebSiteheaderLoginProfileselection","searchlabel","searchplaceholder","searchbuttontext","menuHomeButton","menuGoBackButton","mainMenuButton","menuStartButton","profileSelectionFlyoutHeading","i18n","updateUserInfo","fetchProfiles","profileoptions","apiUrl","endpoint","lastIndexOf","req","fetch","reqdata","json","fallbackData","organizations","name","customerNumber","id","selected","profiles","ssid","customerGroup","data","org","selectedProfile","filter","x","toLocaleLowerCase","substring","push","currentProfileObj","userProfileOption","userName","currentProfile","logoutLink","userInfo","getUserInfo","user","email","userEmail","given_name","family_name","filterLogoutLink","class","map","organization","icon","arrow_right","small","color","rel","onClick","clearUserData","pnMarketwebSiteheaderUnifiedLoginCss","PnMarketwebSiteheaderUnifiedLoginStyle0","PnMarketwebSiteheaderUnifiedLogin","loggedIn","myPageLabel","logInLabel"],"sources":["src/components/layout-components/pn-marketweb-siteheader/unifiedLoginHelper.ts","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.scss?tag=pn-marketweb-siteheader-login-button","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.scss?tag=pn-marketweb-siteheader-login-links","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.scss?tag=pn-marketweb-siteheader-login-mypage-button","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.scss?tag=pn-marketweb-siteheader-login-profileselection","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.scss?tag=pn-marketweb-siteheader-unified-login","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.tsx"],"sourcesContent":["export const getLoginUrl = (useMarketwebLogin:boolean, environment:string) => {\n\nconst environment_Production = \"PRODUCTION\";\n\nconst devAuthUrl = 'https://atportal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst prodAuthUrl = 'https://portal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst marketwebLoginUrl = '/login?returnUrl=';\n\nif(useMarketwebLogin)\n {\n return marketwebLoginUrl;\n }\n else if (environment.toUpperCase() !== environment_Production) {\n return devAuthUrl;\n } else {\n return prodAuthUrl;\n } \n };\n","pn-marketweb-siteheader-login-button {\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\nimport { getLoginUrl } from './unifiedLoginHelper';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-button',\n styleUrl: 'pn-marketweb-siteheader-login-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Log in';\n @Prop() useMarketwebLogin: boolean = false;\n @Prop() environment: string = 'local';\n \n loginUrl: string;\n\n componentWillLoad() {\n this.loginUrl = getLoginUrl(this.useMarketwebLogin, this.environment);\n }\n\n nagivateToLoginUrl() {\n const navigationUrl = `${this.loginUrl}${window.location.href}`;\n return navigationUrl;\n }\n\n render() {\n return (\n <Host>\n <pn-button href={this.nagivateToLoginUrl()}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n","@import '../../../globals/main.scss';\n\n@import './pn-marketweb-siteheader-common.scss';\n\npn-marketweb-siteheader-login-links {\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog } from './pn-marketweb-siteheader-types';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-links',\n styleUrl: 'pn-marketweb-siteheader-login-links.scss',\n})\nexport class PnMarketwebSiteheaderLoginLinks {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() idNamespace: string = '';\n @Prop({ reflect: true }) loggedin: boolean = false;\n @Prop() username: string = '';\n @Prop() showUnifiedLogin: boolean = false;\n\n componentWillLoad() {\n this.init();\n }\n\n @Watch('loginDialog')\n async init() {\n this.adjustLoginLinks();\n }\n adjustLoginLinks() {\n if (!this.loginDialog) {\n return;\n }\n\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n link.href = link.href.replace('window.location.href', window.location.href);\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loginMenuLinks) {\n this.loginDialog?.loginMenuLinks.forEach(adjustLink);\n }\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.loginDialog.legacyLoginLinks = [\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.loginUrl),\n linkText: this.loginDialog.loginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n linkType: 'primary',\n primaryLinkApperance: true,\n },\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.registerUrl),\n linkText: this.loginDialog.createLoginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n primaryLinkApperance: false,\n },\n ];\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {\n username: null,\n loggedin: false,\n };\n if (this.username) {\n hostElementAttribute.username = this.username;\n hostElementAttribute.loggedin = this.loggedin;\n }\n return (\n <Host {...hostElementAttribute}>\n {!this.loginDialog.overrideLoginMenu ? (\n <div data-loggedin={this.loggedin + ''}>\n {this.loggedin ? (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.loggedInLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n ) : (\n <div>\n {/* Get login links from API */}\n {this.loginDialog.loginMenuLinks?.length > 0 ? (\n <pn-marketweb-siteheader-login-linklist\n heading={this.loginDialog.loginTitle}\n links={this.loginDialog.loginMenuLinks}\n idNamespace={this.idNamespace}\n showUnifiedLogin={this.showUnifiedLogin}\n ></pn-marketweb-siteheader-login-linklist>\n ) : (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.legacyLoginLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n )}\n </div>\n )}\n </div>\n ) : null}\n\n {/* Override the default logic for some markets such as DK */}\n {this.loginDialog.overrideLoginMenu ? (\n <pn-marketweb-siteheader-login-linklist links={this.loginDialog.loginMenuLinks} idNamespace={this.idNamespace}></pn-marketweb-siteheader-login-linklist>\n ) : null}\n </Host>\n );\n }\n}\n","pn-marketweb-siteheader-login-mypage-button {\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-mypage-button',\n styleUrl: 'pn-marketweb-siteheader-login-mypage-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginMypageButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Mina sidor!';\n @Prop() myPageUrl: string;\n\n render() {\n return (\n <Host>\n <pn-button href={this.myPageUrl}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n","@import '../../../globals/main.scss';\n\n@import './pn-marketweb-siteheader-common.scss';\n\npn-marketweb-siteheader-login-profileselection {\n}\n\n.pn-marketweb-siteheader-login-profileselection-heading {\n display: block;\n padding: 0.5rem 0 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user,\n.pn-marketweb-siteheader-login-profileselection-currentprofile {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-name,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-name {\n line-height: 1;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-description,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-divider {\n height: 1rem;\n width: 100%;\n background: $blue400;\n position: relative;\n\n margin-left: -1em; // Negative positioning due to nav dropdown's padding\n margin-top: 1.6rem;\n margin-bottom: 1.6rem;\n border-radius: 0 0.6em 0.6em 0;\n padding: 0;\n &::after {\n content: '';\n width: 0.6em;\n height: 0.6em;\n border-radius: 50%;\n position: absolute;\n right: 0;\n top: 0;\n background: inherit;\n transform: translateX(calc(100% + 0.2em));\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption {\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-link {\n display: flex;\n background: $white;\n transition: background 0.15s ease-in-out;\n // width:100%;\n margin: 0 -1em; // Negative margin due to dropdown content padding\n padding: 0.6rem 1.6rem;\n text-decoration: none;\n color: $blue700;\n align-items: center;\n &:hover,\n &:focus,\n &:active {\n background: $gray50;\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-content {\n flex-grow: 1;\n}\n.pn-marketweb-siteheader-login-profileselection-profileoption-name {\n font-weight: 700;\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-description {\n font-weight: 400;\n white-space: normal;\n word-break: break-all;\n color: $gray700;\n font-size: 0.75em;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout {\n padding: 1.6rem;\n text-align: center;\n width: 100%;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout-link {\n display: inline-block;\n font-weight: 500;\n color: $blue700;\n text-decoration: none;\n &:hover,\n &:focus,\n &:active {\n text-decoration: underline;\n }\n}\n","import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n <div class=\"pn-marketweb-siteheader-login-profileselection-divider\"></div>\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${window.location.href}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\"\n >\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">{organization.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <a\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n >\n {this.logoutLink.linkText}\n </a>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n",null,"import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pn-marketweb-siteheader-unified-login',\n styleUrl: 'pn-marketweb-siteheader-unified-login.scss',\n})\nexport class PnMarketwebSiteheaderUnifiedLogin {\n @Element() hostElement: HTMLElement;\n @Prop() loggedIn: boolean = false;\n @Prop() myPageLabel: string;\n @Prop() myPageUrl: string;\n @Prop() logInLabel: string;\n @Prop() useMarketwebLogin: boolean;\n @Prop() environment: string;\n\n render() {\n return (\n <Host>\n {this.loggedIn ? (\n <pn-marketweb-siteheader-login-mypage-button label={this.myPageLabel} myPageUrl={this.myPageUrl} />\n ) : (\n <pn-marketweb-siteheader-login-button \n label={this.logInLabel} \n useMarketwebLogin={this.useMarketwebLogin} \n environment={this.environment}\n />\n )}\n </Host>\n );\n }\n}\n"],"mappings":"oJAAO,MAAMA,EAAc,CAACC,EAA2BC,KAEvD,MAAMC,EAAyB,aAE/B,MAAMC,EAAa,wFACnB,MAAMC,EAAc,sFACpB,MAAMC,EAAoB,oBAE1B,GAAGL,EACD,CACE,OAAOK,C,MAEH,GAAIJ,EAAYK,gBAAkBJ,EAAwB,CAC5D,OAAOC,C,KACF,CACH,OAAOC,C,GCff,MAAMG,EAAsC,GAC5C,MAAAC,EAAeD,E,MCOFE,EAAgC,M,oCAEnB,S,uBACa,M,iBACP,O,kCAE9BC,SAEA,iBAAAC,GACEC,KAAKF,SAAWX,EAAYa,KAAKZ,kBAAmBY,KAAKX,Y,CAG3D,kBAAAY,GACE,MAAMC,EAAgB,GAAGF,KAAKF,WAAWK,OAAOC,SAASC,OACzD,OAAOH,C,CAGT,MAAAI,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,aAAAE,IAAA,2CAAWJ,KAAML,KAAKC,sBAAuBD,KAAKU,O,aC5B1D,MAAMC,EAAqC,kFAC3C,MAAAC,EAAeD,E,MCQFE,EAA+B,M,0CAIU,K,iBACtB,G,cACe,M,cAClB,G,sBACS,K,kCAEpC,iBAAAd,GACEC,KAAKc,M,CAIP,UAAMA,GACJd,KAAKe,kB,CAEP,gB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