New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cpelements/pfe-navigation-account

Package Overview
Dependencies
Maintainers
4
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cpelements/pfe-navigation-account - npm Package Compare versions

Comparing version 1.0.24 to 1.0.25

222

dist/pfe-navigation-account.js

@@ -5,3 +5,3 @@ import PFElement from '../../../@patternfly/pfelement/dist/pfelement.js';

/*!
* PatternFly Elements: PfeNavigationAccount 1.0.11
* PatternFly Elements: PfeNavigationAccount 1.0.24
* @license

@@ -38,3 +38,3 @@ * Copyright 2020 Red Hat, Inc.

static get version() {
return "1.0.11";
return "1.0.24";
}

@@ -61,2 +61,6 @@

static get observedAttributes() {
return ["lang"];
}
get templateUrl() {

@@ -128,2 +132,180 @@ return "pfe-navigation-account.html";

// set default language, overridden by check in connected callback
this._lang = "en";
// Translations
this._navTranslations = {
en: {
accountDetails: 'Account details',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
ja: {
accountDetails: 'Account details JA',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
ko: {
accountDetails: 'Account details KO',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
zh: {
accountDetails: 'Account details zh',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
de: {
accountDetails: 'Account details de',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
fr: {
accountDetails: 'Account details fr',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
it: {
accountDetails: 'Account details it',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
es: {
accountDetails: 'Account details es',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
pt: {
accountDetails: 'Account details pt',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
}
};
// Ensure 'this' is tied to the component object in these member functions

@@ -144,2 +326,6 @@ this._updateAvatarSrc = this._updateAvatarSrc.bind(this);

super.connectedCallback();
if (this.hasAttribute("lang")) {
this._lang = this.getAttribute("lang");
}
}

@@ -325,15 +511,15 @@

{
text: "Account details",
text: this._navTranslations[this._lang].accountDetails,
url: "https://www.redhat.com/wapps/ugc/protected/personalInfo.html",
description: "Edit your contact info, password, location preferences, and errata notifications."
description: this._navTranslations[this._lang].accountDetailsDesc
},
{
text: "Community profile",
text: this._navTranslations[this._lang].profile,
url: "https://access.redhat.com/user",
description: "Fill out your public profile and control what content you follow."
description: this._navTranslations[this._lang].profileDesc
},
{
text: "Training & certification",
text: this._navTranslations[this._lang].training,
url: "https://rol.redhat.com/rol/app/",
description: "Access your Red Hat Learning Subscription, courses, and exams."
description: this._navTranslations[this._lang].trainingDesc
}

@@ -344,5 +530,5 @@ ],

{
text: "Subscriptions",
text: this._navTranslations[this._lang].subscriptions,
url: "https://access.redhat.com/management",
description: "Manage your subscriptions.",
description: this._navTranslations[this._lang].subscriptionsDesc,
// Should respect "Manage subs permission"

@@ -352,10 +538,10 @@ requiresRole: "portal_manage_subscriptions"

{
text: "Account team",
text: this._navTranslations[this._lang].accountTeam,
url: "https://access.redhat.com/account-team",
description: "Get help from your Red Hat account team."
description: this._navTranslations[this._lang].accountTeamDesc
},
{
text: "User management",
text: this._navTranslations[this._lang].userManagement,
url: "https://www.redhat.com/wapps/ugc/protected/usermgt/userList.html",
description: "Manage users in your organization.",
description: this._navTranslations[this._lang].userManagementDesc,
// Should respect "is Org Admin"

@@ -365,5 +551,5 @@ requiresRole: "admin:org:all"

{
text: "Support",
text: this._navTranslations[this._lang].support,
url: "https://access.redhat.com/support/cases/#/troubleshoot/",
description: "Get support for your Red Hat products."
description: this._navTranslations[this._lang].supportDesc
}

@@ -429,3 +615,3 @@ // {

// @todo Translate
accountLoginNameWrapper.innerText = `Login: ${userData.REDHAT_LOGIN}`;
accountLoginNameWrapper.innerText = `${this._navTranslations[this._lang].login}: ${userData.REDHAT_LOGIN}`;

@@ -468,3 +654,3 @@ // @todo Company name?

// @todo Translate
orgAdmin.innerText = "Organization administrator";
orgAdmin.innerText = this._navTranslations[this._lang].orgAdmin;
accountMetadataWrapper.classList.add("account-metadata--org-admin");

@@ -471,0 +657,0 @@ accountMetadataWrapper.append(orgAdmin);

6

dist/pfe-navigation-account.min.js

@@ -1,4 +0,4 @@

import a from"../../../@patternfly/pfelement/dist/pfelement.min.js";import"../../pfe-avatar/dist/pfe-avatar.min.js";
import a from"../../../@patternfly/pfelement/dist/pfelement.min.js";import"../../../@patternfly/pfe-avatar/dist/pfe-avatar.min.js";
/*!
* PatternFly Elements: PfeNavigationAccount 1.0.11
* PatternFly Elements: PfeNavigationAccount 1.0.24
* @license

@@ -26,3 +26,3 @@ * Copyright 2020 Red Hat, Inc.

*/
class t extends a{static get version(){return"1.0.11"}get html(){return'\n<style>.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.element-invisible,.visually-hidden{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}:host{display:block}:host([hidden]){display:none}.pfe-navigation__dropdown{display:block;width:calc(100% + 32px);max-width:1136px;max-width:var(--pfe-navigation--content-max-width,1136px);margin-left:-16px;margin-right:-16px;padding-top:12px;padding-bottom:12px;-webkit-column-count:auto;-moz-column-count:auto;column-count:auto;gap:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:0;margin-left:auto;margin-right:auto;padding:24px;font-size:16px;color:#151515;color:var(--pfe-navigation__dropdown--Color,#151515);background:#fff;background:var(--pfe-navigation__dropdown--Background,var(--pfe-theme--color--surface--lightest,#fff))}@media (min-width:768px){.pfe-navigation__dropdown{display:-ms-grid;display:grid;-ms-grid-columns:minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr);grid-template-columns:repeat(2,minmax(0,1fr));gap:0 32px;gap:0 var(--pfe-navigation--gutter,32px);grid-auto-flow:row;-webkit-column-count:auto;-moz-column-count:auto;column-count:auto;padding:24px 64px}}@media (min-width:1200px){.pfe-navigation__dropdown{-ms-grid-columns:minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr);grid-template-columns:repeat(3,minmax(0,1fr));padding:48px 32px;gap:0 32px;gap:0 var(--pfe-navigation--gutter,32px)}}:host(.pfe-navigation--collapse-secondary-links) .pfe-navigation__dropdown{display:block;width:calc(100% + 32px);max-width:1136px;max-width:var(--pfe-navigation--content-max-width,1136px);margin-left:-16px;margin-right:-16px;padding-top:12px;padding-bottom:12px;-webkit-column-count:auto;-moz-column-count:auto;column-count:auto;gap:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;padding:24px;gap:0}.pfe-navigation__dropdown[class]{width:auto}.pfe-navigation__dropdown li,.pfe-navigation__dropdown ul{margin:0;padding:0;list-style:none}.pfe-navigation__dropdown a{display:inline-block;color:#06c;color:var(--pfe-navigation__dropdown--link--Color,#06c);border:1px solid transparent}.pfe-navigation__dropdown a:focus,.pfe-navigation__dropdown a:hover{color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036);text-decoration:underline}.pfe-navigation__dropdown a:focus{border:1px dashed currentColor;border-top:1px dashed currentColor;outline:0}.pfe-navigation__dropdown .pfe-link-list--header,.pfe-navigation__dropdown [role=heading][aria-heading-level],.pfe-navigation__dropdown h2,.pfe-navigation__dropdown h3,.pfe-navigation__dropdown h4,.pfe-navigation__dropdown h5,.pfe-navigation__dropdown h6{margin:32px 0 .75em;margin:var(--pfe-navigation--gutter,32px) 0 .75em;padding:0;-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid;font-size:18px;font-weight:400;color:#464646;color:var(--pfe-navigation__dropdown--headings--Color,#464646)}.pfe-navigation__dropdown .pfe-link-list--header:first-child,.pfe-navigation__dropdown [role=heading][aria-heading-level]:first-child,.pfe-navigation__dropdown h2:first-child,.pfe-navigation__dropdown h3:first-child,.pfe-navigation__dropdown h4:first-child,.pfe-navigation__dropdown h5:first-child,.pfe-navigation__dropdown h6:first-child{margin-top:0}.pfe-navigation__dropdown .pfe-link-list--header a,.pfe-navigation__dropdown [role=heading][aria-heading-level] a,.pfe-navigation__dropdown h2 a,.pfe-navigation__dropdown h3 a,.pfe-navigation__dropdown h4 a,.pfe-navigation__dropdown h5 a,.pfe-navigation__dropdown h6 a{color:#464646;color:var(--pfe-navigation__dropdown--headings--Color,#464646);border:1px solid transparent}.pfe-navigation__dropdown .pfe-link-list--header a:focus,.pfe-navigation__dropdown .pfe-link-list--header a:hover,.pfe-navigation__dropdown [role=heading][aria-heading-level] a:focus,.pfe-navigation__dropdown [role=heading][aria-heading-level] a:hover,.pfe-navigation__dropdown h2 a:focus,.pfe-navigation__dropdown h2 a:hover,.pfe-navigation__dropdown h3 a:focus,.pfe-navigation__dropdown h3 a:hover,.pfe-navigation__dropdown h4 a:focus,.pfe-navigation__dropdown h4 a:hover,.pfe-navigation__dropdown h5 a:focus,.pfe-navigation__dropdown h5 a:hover,.pfe-navigation__dropdown h6 a:focus,.pfe-navigation__dropdown h6 a:hover{text-decoration:underline;color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036)}.pfe-navigation__dropdown .pfe-link-list--header a:focus,.pfe-navigation__dropdown [role=heading][aria-heading-level] a:focus,.pfe-navigation__dropdown h2 a:focus,.pfe-navigation__dropdown h3 a:focus,.pfe-navigation__dropdown h4 a:focus,.pfe-navigation__dropdown h5 a:focus,.pfe-navigation__dropdown h6 a:focus{border:1px dashed currentColor;border-top:1px dashed currentColor;outline:0}.pfe-navigation__dropdown li{margin:0 0 16px;-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid}.pfe-navigation__dropdown a,.pfe-navigation__dropdown pfe-card,.pfe-navigation__dropdown pfe-cta{-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid}.pfe-navigation__dropdown pfe-cta[pfe-priority=primary],.pfe-navigation__dropdown pfe-cta[priority=primary]{--pfe-cta--BackgroundColor:#e00;--pfe-cta--BackgroundColor--hover:#c00;--pfe-theme--ui--border-width:0}.pfe-navigation__dropdown pfe-cta[pfe-priority=primary]:focus,.pfe-navigation__dropdown pfe-cta[pfe-priority=primary]:hover,.pfe-navigation__dropdown pfe-cta[priority=primary]:focus,.pfe-navigation__dropdown pfe-cta[priority=primary]:hover{--pfe-cta--BackgroundColor:#c00}pfe-card .pfe-navigation__dropdown pfe-cta{margin-top:0}.user-info[class]{-webkit-box-ordinal-group:-9;-webkit-order:-10;-ms-flex-order:-10;order:-10;position:relative;min-height:64px;margin-bottom:24px;padding-left:76px;font-size:18px}@media (min-width:768px){.user-info[class]{-ms-grid-column:1;-ms-grid-column-span:2;grid-column:1/3;margin-bottom:32px}}:host(.pfe-navigation--collapse-secondary-links) .user-info[class]{margin-bottom:24px}.user-info[class] pfe-avatar{position:absolute;top:0;left:0;width:64px;height:64px;border-radius:50%;overflow:hidden;background:rgba(122,122,122,.2)}.user-info[class] .user-info__edit-avatar{font-size:16px;text-decoration:none;color:#06c;color:var(--pfe-navigation__dropdown--link--Color,#06c)}.user-info[class] .user-info__edit-avatar:focus,.user-info[class] .user-info__edit-avatar:hover{color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036)}.account-links{-ms-grid-row:2;grid-row:2;-ms-grid-column:1;-ms-grid-column-span:2;grid-column:1/3;font-size:14px}@media (min-width:768px){.account-links{display:-ms-grid;display:grid;-ms-grid-columns:minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr);grid-template-columns:repeat(2,minmax(0,1fr));gap:32px;gap:var(--pfe-navigation--gutter,32px);grid-auto-flow:row}}:host(.pfe-navigation--collapse-secondary-links) .account-links{display:block}.account-links li{margin-bottom:.57143em;max-width:19.28571em}@media (min-width:768px){.account-links li{margin-bottom:1.5em}}:host(.pfe-navigation--collapse-secondary-links) .account-links li{margin-bottom:.57143em}.account-links[class] a{text-decoration:none}.account-links[class] a:focus,.account-links[class] a:hover{color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036);text-decoration:none}.account-links .account-link__title[class]{font-size:1.14286em;color:#06c;color:var(--pfe-navigation__dropdown--link--Color,#06c)}@media (min-width:768px){.account-links .account-link__title[class]{margin-bottom:8px}}:host(.pfe-navigation--collapse-secondary-links) .account-links .account-link__title[class]{margin-bottom:0}.account-links a:focus .account-link__title,.account-links a:hover .account-link__title{text-decoration:underline}.account-links .account-link__description{display:none;color:#6a6e73;color:var(--pfe-navigation__dropdown--Color--secondary,#6a6e73)}@media (min-width:768px){.account-links .account-link__description{display:block}}:host(.pfe-navigation--collapse-secondary-links) .account-links .account-link__description{display:none}@media (min-width:768px){.account-metadata{-ms-grid-row:1;-ms-grid-row-span:2;grid-row:1/span 2}}.account-metadata--mobile{-webkit-box-ordinal-group:-4;-webkit-order:-5;-ms-flex-order:-5;order:-5;display:block;margin-bottom:24px}@media (min-width:768px){.account-metadata--mobile{display:none}}:host(.pfe-navigation--collapse-secondary-links) .account-metadata--mobile{display:block}.account-metadata__account-number,.account-metadata__email,.account-metadata__login-name,.account-metadata__org-admin,.account-metadata__organization{display:none}@media (min-width:768px){.account-metadata__account-number,.account-metadata__email,.account-metadata__login-name,.account-metadata__org-admin,.account-metadata__organization{display:block}}:host(.pfe-navigation--collapse-secondary-links) .account-metadata__account-number,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__email,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__login-name,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__org-admin,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__organization{display:none}.account-metadata--mobile .account-metadata__account-number,.account-metadata--mobile .account-metadata__email,.account-metadata--mobile .account-metadata__login-name,.account-metadata--mobile .account-metadata__org-admin,.account-metadata--mobile .account-metadata__organization{display:block}.account-metadata__login-name[class]{font-size:16px;margin-bottom:1.5em}.account-metadata--org-admin .account-metadata__login-name[class]{margin-bottom:.5em}.account-metadata__account-number[class],.account-metadata__org-admin[class],.account-metadata__organization[class]{font-size:14px;color:#6a6e73;color:var(--pfe-navigation__dropdown--Color--secondary,#6a6e73)}.account-metadata__org-admin{margin-bottom:1.71429em}.account-metadata__email[class]{margin-top:1.5em}.account-metadata__logout-wrapper{margin-top:3em;padding:3em 0 24px;border-top:1px solid #d2d2d2}.account-metadata__logout-wrapper[class] a{padding:.375em 1em;color:#fff;color:var(--pfe-navigation__dropdown--Color--on-highlight,#fff);background:#e00;background:var(--pfe-navigation__dropdown--highlight-color,#e00);text-decoration:none;border-radius:3px} /*# sourceMappingURL=pfe-navigation-account.min.css.map */</style>\n<div id="wrapper">\n</div>'}static get tag(){return"pfe-navigation-account"}static get meta(){return{title:"Navigation account",description:"Be awesome."}}get templateUrl(){return"pfe-navigation-account.html"}get styleUrl(){return"pfe-navigation-account.scss"}get userData(){return this.userData}set userData(a){this._processUserData(a)}static get PfeType(){return a.PfeTypes.Content}static get properties(){return{}}static get slots(){return{}}constructor(){super(t,{type:t.PfeType}),this._userData=null,this._avatars=[],this._updateAvatarSrc=this._updateAvatarSrc.bind(this),this._createAccountDropdown=this._createAccountDropdown.bind(this),this._processUserReady=this._processUserReady.bind(this),this._processUserData=this._processUserData.bind(this);const a=document.querySelector("body");a.addEventListener("user-ready",this._processUserReady),a.addEventListener("user-update",this._processUserReady)}connectedCallback(){super.connectedCallback()}disconnectedCallback(){const a=document.querySelector("body");a.removeEventListener("user-ready",this._processUserReady),a.removeEventListener("user-update",this._processUserReady)}attributeChangedCallback(a,t,e){super.attributeChangedCallback(a,t,e)}_createPfeAvatar(a,t){let e="";void 0===this.hasSlot&&(e="pfe-");const o=document.createElement("pfe-avatar");return o.setAttribute(`${e}name`,a),o.setAttribute(`${e}shape`,"circle"),"string"==typeof t&&o.setAttribute(`${e}src`,t),o}_getFullName(a){if("string"==typeof a.fullName)return a.fullName;let t="";return"string"==typeof a.firstName&&(t=a.firstName),"string"==typeof a.lastName&&(t=t.length?`${t} ${a.lastName}`:a.lastName),t.length||this.error("Couldn't get full name"),this.setAttribute("full-name",t),t}_updateAvatarSrc(a){if(null===this._userData||"string"==typeof this._userData.REDHAT_LOGIN&&a!==this._userData.REDHAT_LOGIN){let t="//access.redhat.com/api/users/avatar/";(document.domain.includes("access.")||document.domain.includes(".foo."))&&(t="/api/users/avatar/"),fetch(`${t}${a}`).then(a=>{if("object"==typeof a&&"number"==typeof a.status&&200===a.status&&"string"==typeof a.url&&!a.url.includes("blank.png")){this.setAttribute("avatar-url",a.url);for(let t=0;t<this._avatars.length;t++)this._avatars[t].setAttribute("src",a.url)}}).catch(a=>console.error(a))}}_createPfeIcon(a){let t="";void 0===this.hasSlot&&(t="pfe-");const e=document.createElement("pfe-icon");return e.setAttribute("icon",a),e.setAttribute(`${t}size`,"sm"),e.setAttribute("aria-hidden","true"),e}_createAccountMenuToggle(a){const t=this.shadowRoot.querySelector(".pfe-navigation__log-in-link"),e=document.createElement("button");e.classList.add("pfe-navigation__log-in-link","pfe-navigation__log-in-link--logged-in"),e.setAttribute("aria-label","Open user menu");const o=this._createPfeAvatar(a);return e.append(o),e.id="account__toggle",t.replaceWith(e),this._avatars.push(o),e}_createAccountDropdown(a){const t=document.createElement("div");t.id="wrapper",t.classList.add("pfe-navigation__dropdown");const e=document.createElement("h3"),o=this._getFullName(a),n=this._createPfeAvatar(o);e.classList.add("user-info"),this._avatars.push(n),n.classList.add("user-info__avatar");const i=document.createElement("div");i.classList.add("user-info__full-name"),i.innerText=o;const r=document.createElement("a");r.setAttribute("href","https://access.redhat.com/user/edit"),r.classList.add("user-info__edit-avatar"),r.innerText="Edit avatar",r.prepend(this._createPfeIcon("web-caret-right")),e.append(n),e.append(i),e.append(r);const d=[[{text:"Account details",url:"https://www.redhat.com/wapps/ugc/protected/personalInfo.html",description:"Edit your contact info, password, location preferences, and errata notifications."},{text:"Community profile",url:"https://access.redhat.com/user",description:"Fill out your public profile and control what content you follow."},{text:"Training & certification",url:"https://rol.redhat.com/rol/app/",description:"Access your Red Hat Learning Subscription, courses, and exams."}],[{text:"Subscriptions",url:"https://access.redhat.com/management",description:"Manage your subscriptions.",requiresRole:"portal_manage_subscriptions"},{text:"Account team",url:"https://access.redhat.com/account-team",description:"Get help from your Red Hat account team."},{text:"User management",url:"https://www.redhat.com/wapps/ugc/protected/usermgt/userList.html",description:"Manage users in your organization.",requiresRole:"admin:org:all"},{text:"Support",url:"https://access.redhat.com/support/cases/#/troubleshoot/",description:"Get support for your Red Hat products."}]],c=document.createElement("div");c.classList.add("account-links"),c.setAttribute("aria-label","Account managemement links");for(let t=0;t<d.length;t++){const e=d[t],o=document.createElement("ul");o.classList.add("account-links__column");for(let t=0;t<e.length;t++){const n=e[t],i=document.createElement("li"),r=document.createElement("a");let d=!0;void 0!==n.requiresRole&&(a.realm_access.roles.includes(n.requiresRole)||(d=!1)),d&&(r.setAttribute("href",n.url),r.innerHTML=`\n <div class="account-link__title">\n ${n.text}\n </div>`,n.description&&(r.innerHTML=`${r.innerHTML}\n <div class="account-link__description">\n ${n.description}\n </div>`),i.append(r),o.append(i))}c.append(o)}const s=document.createElement("div");s.classList.add("account-metadata");const p=document.createElement("h3");p.classList.add("account-metadata__login-name"),p.innerText=`Login: ${a.REDHAT_LOGIN}`;const l=document.createElement("div");l.classList.add("account-metadata__account-number"),l.innerText=`Account number: ${a.account_number}`;const u=document.createElement("div");u.classList.add("account-metadata__email"),u.innerText=a.email;const m=document.createElement("div");m.classList.add("account-metadata__logout-wrapper");const g=document.createElement("a");if(this.hasAttribute("logout-link")?g.setAttribute("href",this.getAttribute("logout-link")):this.error("Couldn't get logout link"),g.hasAttribute("href")&&(g.innerText="Log out",m.append(g)),s.append(p),a.realm_access.roles.includes("admin:org:all")){const a=document.createElement("div");a.classList.add("account-metadata__org-admin"),a.innerText="Organization administrator",s.classList.add("account-metadata--org-admin"),s.append(a)}s.append(l),s.append(u);const _=s.cloneNode(!0);return _.classList.add("account-metadata--mobile"),s.append(m),t.append(e),t.append(_),t.append(c),t.append(s),this.shadowRoot.getElementById("wrapper").replaceWith(t),t}_processUserData(a){a.fullName=this._getFullName(a),this.getAttribute("full-name")!==a.fullName&&this.setAttribute("full-name",a.fullName),null===this._userData&&this._createAccountDropdown(a),"string"==typeof a.REDHAT_LOGIN?this._updateAvatarSrc(a.REDHAT_LOGIN):this.error("Could not find Redhat Login"),this._userData=a}_processUserReady(a){const t=a.target.user;"object"==typeof t&&this._processUserData(t)}}a.create(t);export default t;
class t extends a{static get version(){return"1.0.24"}get html(){return'\n<style>.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.element-invisible,.visually-hidden{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}:host{display:block}:host([hidden]){display:none}.pfe-navigation__dropdown{display:block;width:calc(100% + 32px);max-width:1136px;max-width:var(--pfe-navigation--content-max-width,1136px);margin-left:-16px;margin-right:-16px;padding-top:12px;padding-bottom:12px;-webkit-column-count:auto;-moz-column-count:auto;column-count:auto;gap:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:0;margin-left:auto;margin-right:auto;padding:24px;font-size:16px;color:#151515;color:var(--pfe-navigation__dropdown--Color,#151515);background:#fff;background:var(--pfe-navigation__dropdown--Background,var(--pfe-theme--color--surface--lightest,#fff))}@media (min-width:768px){.pfe-navigation__dropdown{display:-ms-grid;display:grid;-ms-grid-columns:minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr);grid-template-columns:repeat(2,minmax(0,1fr));gap:0 32px;gap:0 var(--pfe-navigation--gutter,32px);grid-auto-flow:row;-webkit-column-count:auto;-moz-column-count:auto;column-count:auto;padding:24px 64px}}@media (min-width:1200px){.pfe-navigation__dropdown{-ms-grid-columns:minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr);grid-template-columns:repeat(3,minmax(0,1fr));padding:48px 32px;gap:0 32px;gap:0 var(--pfe-navigation--gutter,32px)}}:host(.pfe-navigation--collapse-secondary-links) .pfe-navigation__dropdown{display:block;width:calc(100% + 32px);max-width:1136px;max-width:var(--pfe-navigation--content-max-width,1136px);margin-left:-16px;margin-right:-16px;padding-top:12px;padding-bottom:12px;-webkit-column-count:auto;-moz-column-count:auto;column-count:auto;gap:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;padding:24px;gap:0}.pfe-navigation__dropdown[class]{width:auto}.pfe-navigation__dropdown li,.pfe-navigation__dropdown ul{margin:0;padding:0;list-style:none}.pfe-navigation__dropdown a{display:inline-block;color:#06c;color:var(--pfe-navigation__dropdown--link--Color,#06c);border:1px solid transparent}.pfe-navigation__dropdown a:focus,.pfe-navigation__dropdown a:hover{color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036);text-decoration:underline}.pfe-navigation__dropdown a:focus{border:1px dashed currentColor;border-top:1px dashed currentColor;outline:0}.pfe-navigation__dropdown .pfe-link-list--header,.pfe-navigation__dropdown [role=heading][aria-heading-level],.pfe-navigation__dropdown h2,.pfe-navigation__dropdown h3,.pfe-navigation__dropdown h4,.pfe-navigation__dropdown h5,.pfe-navigation__dropdown h6{margin:32px 0 .75em;margin:var(--pfe-navigation--gutter,32px) 0 .75em;padding:0;-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid;font-size:18px;font-weight:400;color:#464646;color:var(--pfe-navigation__dropdown--headings--Color,#464646)}.pfe-navigation__dropdown .pfe-link-list--header:first-child,.pfe-navigation__dropdown [role=heading][aria-heading-level]:first-child,.pfe-navigation__dropdown h2:first-child,.pfe-navigation__dropdown h3:first-child,.pfe-navigation__dropdown h4:first-child,.pfe-navigation__dropdown h5:first-child,.pfe-navigation__dropdown h6:first-child{margin-top:0}.pfe-navigation__dropdown .pfe-link-list--header a,.pfe-navigation__dropdown [role=heading][aria-heading-level] a,.pfe-navigation__dropdown h2 a,.pfe-navigation__dropdown h3 a,.pfe-navigation__dropdown h4 a,.pfe-navigation__dropdown h5 a,.pfe-navigation__dropdown h6 a{color:#464646;color:var(--pfe-navigation__dropdown--headings--Color,#464646);border:1px solid transparent}.pfe-navigation__dropdown .pfe-link-list--header a:focus,.pfe-navigation__dropdown .pfe-link-list--header a:hover,.pfe-navigation__dropdown [role=heading][aria-heading-level] a:focus,.pfe-navigation__dropdown [role=heading][aria-heading-level] a:hover,.pfe-navigation__dropdown h2 a:focus,.pfe-navigation__dropdown h2 a:hover,.pfe-navigation__dropdown h3 a:focus,.pfe-navigation__dropdown h3 a:hover,.pfe-navigation__dropdown h4 a:focus,.pfe-navigation__dropdown h4 a:hover,.pfe-navigation__dropdown h5 a:focus,.pfe-navigation__dropdown h5 a:hover,.pfe-navigation__dropdown h6 a:focus,.pfe-navigation__dropdown h6 a:hover{text-decoration:underline;color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036)}.pfe-navigation__dropdown .pfe-link-list--header a:focus,.pfe-navigation__dropdown [role=heading][aria-heading-level] a:focus,.pfe-navigation__dropdown h2 a:focus,.pfe-navigation__dropdown h3 a:focus,.pfe-navigation__dropdown h4 a:focus,.pfe-navigation__dropdown h5 a:focus,.pfe-navigation__dropdown h6 a:focus{border:1px dashed currentColor;border-top:1px dashed currentColor;outline:0}.pfe-navigation__dropdown li{margin:0 0 16px;-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid}.pfe-navigation__dropdown a,.pfe-navigation__dropdown pfe-card,.pfe-navigation__dropdown pfe-cta{-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid}.pfe-navigation__dropdown pfe-cta[pfe-priority=primary],.pfe-navigation__dropdown pfe-cta[priority=primary]{--pfe-cta--BackgroundColor:#e00;--pfe-cta--BackgroundColor--hover:#c00;--pfe-theme--ui--border-width:0}.pfe-navigation__dropdown pfe-cta[pfe-priority=primary]:focus,.pfe-navigation__dropdown pfe-cta[pfe-priority=primary]:hover,.pfe-navigation__dropdown pfe-cta[priority=primary]:focus,.pfe-navigation__dropdown pfe-cta[priority=primary]:hover{--pfe-cta--BackgroundColor:#c00}pfe-card .pfe-navigation__dropdown pfe-cta{margin-top:0}.user-info[class]{-webkit-box-ordinal-group:-9;-webkit-order:-10;-ms-flex-order:-10;order:-10;position:relative;min-height:64px;margin-bottom:24px;padding-left:76px;font-size:18px}@media (min-width:768px){.user-info[class]{-ms-grid-column:1;-ms-grid-column-span:2;grid-column:1/3;margin-bottom:32px}}:host(.pfe-navigation--collapse-secondary-links) .user-info[class]{margin-bottom:24px}.user-info[class] pfe-avatar{position:absolute;top:0;left:0;width:64px;height:64px;border-radius:50%;overflow:hidden;background:rgba(122,122,122,.2)}.user-info[class] .user-info__edit-avatar{font-size:16px;text-decoration:none;color:#06c;color:var(--pfe-navigation__dropdown--link--Color,#06c)}.user-info[class] .user-info__edit-avatar:focus,.user-info[class] .user-info__edit-avatar:hover{color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036)}.account-links{-ms-grid-row:2;grid-row:2;-ms-grid-column:1;-ms-grid-column-span:2;grid-column:1/3;font-size:14px}@media (min-width:768px){.account-links{display:-ms-grid;display:grid;-ms-grid-columns:minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr);grid-template-columns:repeat(2,minmax(0,1fr));gap:32px;gap:var(--pfe-navigation--gutter,32px);grid-auto-flow:row}}:host(.pfe-navigation--collapse-secondary-links) .account-links{display:block}.account-links li{margin-bottom:.57143em;max-width:19.28571em}@media (min-width:768px){.account-links li{margin-bottom:1.5em}}:host(.pfe-navigation--collapse-secondary-links) .account-links li{margin-bottom:.57143em}.account-links[class] a{text-decoration:none}.account-links[class] a:focus,.account-links[class] a:hover{color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036);text-decoration:none}.account-links .account-link__title[class]{font-size:1.14286em;color:#06c;color:var(--pfe-navigation__dropdown--link--Color,#06c)}@media (min-width:768px){.account-links .account-link__title[class]{margin-bottom:8px}}:host(.pfe-navigation--collapse-secondary-links) .account-links .account-link__title[class]{margin-bottom:0}.account-links a:focus .account-link__title,.account-links a:hover .account-link__title{text-decoration:underline}.account-links .account-link__description{display:none;color:#6a6e73;color:var(--pfe-navigation__dropdown--Color--secondary,#6a6e73)}@media (min-width:768px){.account-links .account-link__description{display:block}}:host(.pfe-navigation--collapse-secondary-links) .account-links .account-link__description{display:none}@media (min-width:768px){.account-metadata{-ms-grid-row:1;-ms-grid-row-span:2;grid-row:1/span 2}}.account-metadata--mobile{-webkit-box-ordinal-group:-4;-webkit-order:-5;-ms-flex-order:-5;order:-5;display:block;margin-bottom:24px}@media (min-width:768px){.account-metadata--mobile{display:none}}:host(.pfe-navigation--collapse-secondary-links) .account-metadata--mobile{display:block}.account-metadata__account-number,.account-metadata__email,.account-metadata__login-name,.account-metadata__org-admin,.account-metadata__organization{display:none}@media (min-width:768px){.account-metadata__account-number,.account-metadata__email,.account-metadata__login-name,.account-metadata__org-admin,.account-metadata__organization{display:block}}:host(.pfe-navigation--collapse-secondary-links) .account-metadata__account-number,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__email,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__login-name,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__org-admin,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__organization{display:none}.account-metadata--mobile .account-metadata__account-number,.account-metadata--mobile .account-metadata__email,.account-metadata--mobile .account-metadata__login-name,.account-metadata--mobile .account-metadata__org-admin,.account-metadata--mobile .account-metadata__organization{display:block}.account-metadata__login-name[class]{font-size:16px;margin-bottom:1.5em}.account-metadata--org-admin .account-metadata__login-name[class]{margin-bottom:.5em}.account-metadata__account-number[class],.account-metadata__org-admin[class],.account-metadata__organization[class]{font-size:14px;color:#6a6e73;color:var(--pfe-navigation__dropdown--Color--secondary,#6a6e73)}.account-metadata__org-admin{margin-bottom:1.71429em}.account-metadata__email[class]{margin-top:1.5em}.account-metadata__logout-wrapper{margin-top:3em;padding:3em 0 24px;border-top:1px solid #d2d2d2}.account-metadata__logout-wrapper[class] a{padding:.375em 1em;color:#fff;color:var(--pfe-navigation__dropdown--Color--on-highlight,#fff);background:#e00;background:var(--pfe-navigation__dropdown--highlight-color,#e00);text-decoration:none;border-radius:3px} /*# sourceMappingURL=pfe-navigation-account.min.css.map */</style>\n<div id="wrapper">\n</div>'}static get tag(){return"pfe-navigation-account"}static get meta(){return{title:"Navigation account",description:"Be awesome."}}static get observedAttributes(){return["lang"]}get templateUrl(){return"pfe-navigation-account.html"}get styleUrl(){return"pfe-navigation-account.scss"}get userData(){return this.userData}set userData(a){this._processUserData(a)}static get PfeType(){return a.PfeTypes.Content}static get properties(){return{}}static get slots(){return{}}constructor(){super(t,{type:t.PfeType}),this._userData=null,this._avatars=[],this._lang="en",this._navTranslations={en:{accountDetails:"Account details",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},ja:{accountDetails:"Account details JA",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},ko:{accountDetails:"Account details KO",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},zh:{accountDetails:"Account details zh",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},de:{accountDetails:"Account details de",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},fr:{accountDetails:"Account details fr",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},it:{accountDetails:"Account details it",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},es:{accountDetails:"Account details es",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},pt:{accountDetails:"Account details pt",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."}},this._updateAvatarSrc=this._updateAvatarSrc.bind(this),this._createAccountDropdown=this._createAccountDropdown.bind(this),this._processUserReady=this._processUserReady.bind(this),this._processUserData=this._processUserData.bind(this);const a=document.querySelector("body");a.addEventListener("user-ready",this._processUserReady),a.addEventListener("user-update",this._processUserReady)}connectedCallback(){super.connectedCallback(),this.hasAttribute("lang")&&(this._lang=this.getAttribute("lang"))}disconnectedCallback(){const a=document.querySelector("body");a.removeEventListener("user-ready",this._processUserReady),a.removeEventListener("user-update",this._processUserReady)}attributeChangedCallback(a,t,o){super.attributeChangedCallback(a,t,o)}_createPfeAvatar(a,t){let o="";void 0===this.hasSlot&&(o="pfe-");const n=document.createElement("pfe-avatar");return n.setAttribute(`${o}name`,a),n.setAttribute(`${o}shape`,"circle"),"string"==typeof t&&n.setAttribute(`${o}src`,t),n}_getFullName(a){if("string"==typeof a.fullName)return a.fullName;let t="";return"string"==typeof a.firstName&&(t=a.firstName),"string"==typeof a.lastName&&(t=t.length?`${t} ${a.lastName}`:a.lastName),t.length||this.error("Couldn't get full name"),this.setAttribute("full-name",t),t}_updateAvatarSrc(a){if(null===this._userData||"string"==typeof this._userData.REDHAT_LOGIN&&a!==this._userData.REDHAT_LOGIN){let t="//access.redhat.com/api/users/avatar/";(document.domain.includes("access.")||document.domain.includes(".foo."))&&(t="/api/users/avatar/"),fetch(`${t}${a}`).then(a=>{if("object"==typeof a&&"number"==typeof a.status&&200===a.status&&"string"==typeof a.url&&!a.url.includes("blank.png")){this.setAttribute("avatar-url",a.url);for(let t=0;t<this._avatars.length;t++)this._avatars[t].setAttribute("src",a.url)}}).catch(a=>console.error(a))}}_createPfeIcon(a){let t="";void 0===this.hasSlot&&(t="pfe-");const o=document.createElement("pfe-icon");return o.setAttribute("icon",a),o.setAttribute(`${t}size`,"sm"),o.setAttribute("aria-hidden","true"),o}_createAccountMenuToggle(a){const t=this.shadowRoot.querySelector(".pfe-navigation__log-in-link"),o=document.createElement("button");o.classList.add("pfe-navigation__log-in-link","pfe-navigation__log-in-link--logged-in"),o.setAttribute("aria-label","Open user menu");const n=this._createPfeAvatar(a);return o.append(n),o.id="account__toggle",t.replaceWith(o),this._avatars.push(n),o}_createAccountDropdown(a){const t=document.createElement("div");t.id="wrapper",t.classList.add("pfe-navigation__dropdown");const o=document.createElement("h3"),n=this._getFullName(a),e=this._createPfeAvatar(n);o.classList.add("user-info"),this._avatars.push(e),e.classList.add("user-info__avatar");const i=document.createElement("div");i.classList.add("user-info__full-name"),i.innerText=n;const r=document.createElement("a");r.setAttribute("href","https://access.redhat.com/user/edit"),r.classList.add("user-info__edit-avatar"),r.innerText="Edit avatar",r.prepend(this._createPfeIcon("web-caret-right")),o.append(e),o.append(i),o.append(r);const s=[[{text:this._navTranslations[this._lang].accountDetails,url:"https://www.redhat.com/wapps/ugc/protected/personalInfo.html",description:this._navTranslations[this._lang].accountDetailsDesc},{text:this._navTranslations[this._lang].profile,url:"https://access.redhat.com/user",description:this._navTranslations[this._lang].profileDesc},{text:this._navTranslations[this._lang].training,url:"https://rol.redhat.com/rol/app/",description:this._navTranslations[this._lang].trainingDesc}],[{text:this._navTranslations[this._lang].subscriptions,url:"https://access.redhat.com/management",description:this._navTranslations[this._lang].subscriptionsDesc,requiresRole:"portal_manage_subscriptions"},{text:this._navTranslations[this._lang].accountTeam,url:"https://access.redhat.com/account-team",description:this._navTranslations[this._lang].accountTeamDesc},{text:this._navTranslations[this._lang].userManagement,url:"https://www.redhat.com/wapps/ugc/protected/usermgt/userList.html",description:this._navTranslations[this._lang].userManagementDesc,requiresRole:"admin:org:all"},{text:this._navTranslations[this._lang].support,url:"https://access.redhat.com/support/cases/#/troubleshoot/",description:this._navTranslations[this._lang].supportDesc}]],c=document.createElement("div");c.classList.add("account-links"),c.setAttribute("aria-label","Account managemement links");for(let t=0;t<s.length;t++){const o=s[t],n=document.createElement("ul");n.classList.add("account-links__column");for(let t=0;t<o.length;t++){const e=o[t],i=document.createElement("li"),r=document.createElement("a");let s=!0;void 0!==e.requiresRole&&(a.realm_access.roles.includes(e.requiresRole)||(s=!1)),s&&(r.setAttribute("href",e.url),r.innerHTML=`\n <div class="account-link__title">\n ${e.text}\n </div>`,e.description&&(r.innerHTML=`${r.innerHTML}\n <div class="account-link__description">\n ${e.description}\n </div>`),i.append(r),n.append(i))}c.append(n)}const d=document.createElement("div");d.classList.add("account-metadata");const p=document.createElement("h3");p.classList.add("account-metadata__login-name"),p.innerText=`${this._navTranslations[this._lang].login}: ${a.REDHAT_LOGIN}`;const u=document.createElement("div");u.classList.add("account-metadata__account-number"),u.innerText=`Account number: ${a.account_number}`;const l=document.createElement("div");l.classList.add("account-metadata__email"),l.innerText=a.email;const m=document.createElement("div");m.classList.add("account-metadata__logout-wrapper");const g=document.createElement("a");if(this.hasAttribute("logout-link")?g.setAttribute("href",this.getAttribute("logout-link")):this.error("Couldn't get logout link"),g.hasAttribute("href")&&(g.innerText="Log out",m.append(g)),d.append(p),a.realm_access.roles.includes("admin:org:all")){const a=document.createElement("div");a.classList.add("account-metadata__org-admin"),a.innerText=this._navTranslations[this._lang].orgAdmin,d.classList.add("account-metadata--org-admin"),d.append(a)}d.append(u),d.append(l);const f=d.cloneNode(!0);return f.classList.add("account-metadata--mobile"),d.append(m),t.append(o),t.append(f),t.append(c),t.append(d),this.shadowRoot.getElementById("wrapper").replaceWith(t),t}_processUserData(a){a.fullName=this._getFullName(a),this.getAttribute("full-name")!==a.fullName&&this.setAttribute("full-name",a.fullName),null===this._userData&&this._createAccountDropdown(a),"string"==typeof a.REDHAT_LOGIN?this._updateAvatarSrc(a.REDHAT_LOGIN):this.error("Could not find Redhat Login"),this._userData=a}_processUserReady(a){const t=a.target.user;"object"==typeof t&&this._processUserData(t)}}a.create(t);export default t;
//# sourceMappingURL=pfe-navigation-account.min.js.map

@@ -90,3 +90,3 @@ (function (global, factory) {

/*!
* PatternFly Elements: PfeNavigationAccount 1.0.11
* PatternFly Elements: PfeNavigationAccount 1.0.24
* @license

@@ -161,3 +161,3 @@ * Copyright 2020 Red Hat, Inc.

get: function get() {
return "1.0.11";
return "1.0.24";
}

@@ -178,2 +178,7 @@ }, {

}, {
key: "observedAttributes",
get: function get() {
return ["lang"];
}
}, {
key: "PfeType",

@@ -230,4 +235,181 @@ get: function get() {

// Ensure 'this' is tied to the component object in these member functions
_this._updateAvatarSrc = _this._updateAvatarSrc.bind(_this);
// set default language, overridden by check in connected callback
_this._lang = "en";
// Translations
_this._navTranslations = {
en: {
accountDetails: 'Account details',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
ja: {
accountDetails: 'Account details JA',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
ko: {
accountDetails: 'Account details KO',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
zh: {
accountDetails: 'Account details zh',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
de: {
accountDetails: 'Account details de',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
fr: {
accountDetails: 'Account details fr',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
it: {
accountDetails: 'Account details it',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
es: {
accountDetails: 'Account details es',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
},
pt: {
accountDetails: 'Account details pt',
accountDetailsDesc: 'Edit your contact info, password, location preferences, and errata notifications.',
accountNumber: 'Account number',
accountTeam: 'Account team',
accountTeamDesc: 'Get help from your Red Hat account team.',
login: 'Login',
orgAdmin: 'Organization administrator',
profile: 'Community Profile',
profileDesc: 'Fill out your public profile and control what content you follow.',
subscriptions: 'Subscriptions',
subscriptionsDesc: 'Manage your subscriptions.',
support: 'Support',
supportDesc: 'Get support for your Red Hat products.',
training: 'Training & certification',
trainingDesc: 'Access your Red Hat Learning Subscription, courses, and exams.',
userManagement: 'User management',
userManagementDesc: 'Manage users in your organization.'
}
// Ensure 'this' is tied to the component object in these member functions
};_this._updateAvatarSrc = _this._updateAvatarSrc.bind(_this);
_this._createAccountDropdown = _this._createAccountDropdown.bind(_this);

@@ -249,2 +431,6 @@ _this._processUserReady = _this._processUserReady.bind(_this);

get(PfeNavigationAccount.prototype.__proto__ || Object.getPrototypeOf(PfeNavigationAccount.prototype), "connectedCallback", this).call(this);
if (this.hasAttribute("lang")) {
this._lang = this.getAttribute("lang");
}
}

@@ -450,35 +636,35 @@ }, {

[{
text: "Account details",
text: this._navTranslations[this._lang].accountDetails,
url: "https://www.redhat.com/wapps/ugc/protected/personalInfo.html",
description: "Edit your contact info, password, location preferences, and errata notifications."
description: this._navTranslations[this._lang].accountDetailsDesc
}, {
text: "Community profile",
text: this._navTranslations[this._lang].profile,
url: "https://access.redhat.com/user",
description: "Fill out your public profile and control what content you follow."
description: this._navTranslations[this._lang].profileDesc
}, {
text: "Training & certification",
text: this._navTranslations[this._lang].training,
url: "https://rol.redhat.com/rol/app/",
description: "Access your Red Hat Learning Subscription, courses, and exams."
description: this._navTranslations[this._lang].trainingDesc
}],
// Column 2
[{
text: "Subscriptions",
text: this._navTranslations[this._lang].subscriptions,
url: "https://access.redhat.com/management",
description: "Manage your subscriptions.",
description: this._navTranslations[this._lang].subscriptionsDesc,
// Should respect "Manage subs permission"
requiresRole: "portal_manage_subscriptions"
}, {
text: "Account team",
text: this._navTranslations[this._lang].accountTeam,
url: "https://access.redhat.com/account-team",
description: "Get help from your Red Hat account team."
description: this._navTranslations[this._lang].accountTeamDesc
}, {
text: "User management",
text: this._navTranslations[this._lang].userManagement,
url: "https://www.redhat.com/wapps/ugc/protected/usermgt/userList.html",
description: "Manage users in your organization.",
description: this._navTranslations[this._lang].userManagementDesc,
// Should respect "is Org Admin"
requiresRole: "admin:org:all"
}, {
text: "Support",
text: this._navTranslations[this._lang].support,
url: "https://access.redhat.com/support/cases/#/troubleshoot/",
description: "Get support for your Red Hat products."
description: this._navTranslations[this._lang].supportDesc
// {

@@ -536,3 +722,3 @@ // text: '',

// @todo Translate
accountLoginNameWrapper.innerText = "Login: " + userData.REDHAT_LOGIN;
accountLoginNameWrapper.innerText = this._navTranslations[this._lang].login + ": " + userData.REDHAT_LOGIN;

@@ -575,3 +761,3 @@ // @todo Company name?

// @todo Translate
orgAdmin.innerText = "Organization administrator";
orgAdmin.innerText = this._navTranslations[this._lang].orgAdmin;
accountMetadataWrapper.classList.add("account-metadata--org-admin");

@@ -578,0 +764,0 @@ accountMetadataWrapper.append(orgAdmin);

@@ -1,2 +0,2 @@

!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("../../../@patternfly/pfelement/dist/pfelement.umd.min"),require("../../../@patternfly/pfe-avatar/dist/pfe-avatar.umd.min")):"function"==typeof define&&define.amd?define(["../../../@patternfly/pfelement/dist/pfelement.umd.min","../../../@patternfly/pfe-avatar/dist/pfe-avatar.umd.min"],e):(a=a||self).PfeNavigationAccount=e(a.PFElement,a.PfeAvatar)}(this,function(a,e){"use strict";a=a&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a,e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},t=function(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")},e=function(a,e,t){return e&&n(a.prototype,e),t&&n(a,t),a};function n(a,e){for(var t=0;t<e.length;t++){var o=e[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(a,o.key,o)}}function i(a,e,t){null===a&&(a=Function.prototype);var o=Object.getOwnPropertyDescriptor(a,e);if(void 0!==o){if("value"in o)return o.value;o=o.get;return void 0!==o?o.call(t):void 0}if(a=Object.getPrototypeOf(a),null!==a)return i(a,e,t)}var r=function(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?a:e},e=(function(a,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}(c,a),e(c,[{key:"html",get:function(){return'\n<style>.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.element-invisible,.visually-hidden{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}:host{display:block}:host([hidden]){display:none}.pfe-navigation__dropdown{display:block;width:calc(100% + 32px);max-width:1136px;max-width:var(--pfe-navigation--content-max-width,1136px);margin-left:-16px;margin-right:-16px;padding-top:12px;padding-bottom:12px;-webkit-column-count:auto;-moz-column-count:auto;column-count:auto;gap:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:0;margin-left:auto;margin-right:auto;padding:24px;font-size:16px;color:#151515;color:var(--pfe-navigation__dropdown--Color,#151515);background:#fff;background:var(--pfe-navigation__dropdown--Background,var(--pfe-theme--color--surface--lightest,#fff))}@media (min-width:768px){.pfe-navigation__dropdown{display:-ms-grid;display:grid;-ms-grid-columns:minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr);grid-template-columns:repeat(2,minmax(0,1fr));gap:0 32px;gap:0 var(--pfe-navigation--gutter,32px);grid-auto-flow:row;-webkit-column-count:auto;-moz-column-count:auto;column-count:auto;padding:24px 64px}}@media (min-width:1200px){.pfe-navigation__dropdown{-ms-grid-columns:minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr);grid-template-columns:repeat(3,minmax(0,1fr));padding:48px 32px;gap:0 32px;gap:0 var(--pfe-navigation--gutter,32px)}}:host(.pfe-navigation--collapse-secondary-links) .pfe-navigation__dropdown{display:block;width:calc(100% + 32px);max-width:1136px;max-width:var(--pfe-navigation--content-max-width,1136px);margin-left:-16px;margin-right:-16px;padding-top:12px;padding-bottom:12px;-webkit-column-count:auto;-moz-column-count:auto;column-count:auto;gap:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;padding:24px;gap:0}.pfe-navigation__dropdown[class]{width:auto}.pfe-navigation__dropdown li,.pfe-navigation__dropdown ul{margin:0;padding:0;list-style:none}.pfe-navigation__dropdown a{display:inline-block;color:#06c;color:var(--pfe-navigation__dropdown--link--Color,#06c);border:1px solid transparent}.pfe-navigation__dropdown a:focus,.pfe-navigation__dropdown a:hover{color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036);text-decoration:underline}.pfe-navigation__dropdown a:focus{border:1px dashed currentColor;border-top:1px dashed currentColor;outline:0}.pfe-navigation__dropdown .pfe-link-list--header,.pfe-navigation__dropdown [role=heading][aria-heading-level],.pfe-navigation__dropdown h2,.pfe-navigation__dropdown h3,.pfe-navigation__dropdown h4,.pfe-navigation__dropdown h5,.pfe-navigation__dropdown h6{margin:32px 0 .75em;margin:var(--pfe-navigation--gutter,32px) 0 .75em;padding:0;-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid;font-size:18px;font-weight:400;color:#464646;color:var(--pfe-navigation__dropdown--headings--Color,#464646)}.pfe-navigation__dropdown .pfe-link-list--header:first-child,.pfe-navigation__dropdown [role=heading][aria-heading-level]:first-child,.pfe-navigation__dropdown h2:first-child,.pfe-navigation__dropdown h3:first-child,.pfe-navigation__dropdown h4:first-child,.pfe-navigation__dropdown h5:first-child,.pfe-navigation__dropdown h6:first-child{margin-top:0}.pfe-navigation__dropdown .pfe-link-list--header a,.pfe-navigation__dropdown [role=heading][aria-heading-level] a,.pfe-navigation__dropdown h2 a,.pfe-navigation__dropdown h3 a,.pfe-navigation__dropdown h4 a,.pfe-navigation__dropdown h5 a,.pfe-navigation__dropdown h6 a{color:#464646;color:var(--pfe-navigation__dropdown--headings--Color,#464646);border:1px solid transparent}.pfe-navigation__dropdown .pfe-link-list--header a:focus,.pfe-navigation__dropdown .pfe-link-list--header a:hover,.pfe-navigation__dropdown [role=heading][aria-heading-level] a:focus,.pfe-navigation__dropdown [role=heading][aria-heading-level] a:hover,.pfe-navigation__dropdown h2 a:focus,.pfe-navigation__dropdown h2 a:hover,.pfe-navigation__dropdown h3 a:focus,.pfe-navigation__dropdown h3 a:hover,.pfe-navigation__dropdown h4 a:focus,.pfe-navigation__dropdown h4 a:hover,.pfe-navigation__dropdown h5 a:focus,.pfe-navigation__dropdown h5 a:hover,.pfe-navigation__dropdown h6 a:focus,.pfe-navigation__dropdown h6 a:hover{text-decoration:underline;color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036)}.pfe-navigation__dropdown .pfe-link-list--header a:focus,.pfe-navigation__dropdown [role=heading][aria-heading-level] a:focus,.pfe-navigation__dropdown h2 a:focus,.pfe-navigation__dropdown h3 a:focus,.pfe-navigation__dropdown h4 a:focus,.pfe-navigation__dropdown h5 a:focus,.pfe-navigation__dropdown h6 a:focus{border:1px dashed currentColor;border-top:1px dashed currentColor;outline:0}.pfe-navigation__dropdown li{margin:0 0 16px;-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid}.pfe-navigation__dropdown a,.pfe-navigation__dropdown pfe-card,.pfe-navigation__dropdown pfe-cta{-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid}.pfe-navigation__dropdown pfe-cta[pfe-priority=primary],.pfe-navigation__dropdown pfe-cta[priority=primary]{--pfe-cta--BackgroundColor:#e00;--pfe-cta--BackgroundColor--hover:#c00;--pfe-theme--ui--border-width:0}.pfe-navigation__dropdown pfe-cta[pfe-priority=primary]:focus,.pfe-navigation__dropdown pfe-cta[pfe-priority=primary]:hover,.pfe-navigation__dropdown pfe-cta[priority=primary]:focus,.pfe-navigation__dropdown pfe-cta[priority=primary]:hover{--pfe-cta--BackgroundColor:#c00}pfe-card .pfe-navigation__dropdown pfe-cta{margin-top:0}.user-info[class]{-webkit-box-ordinal-group:-9;-webkit-order:-10;-ms-flex-order:-10;order:-10;position:relative;min-height:64px;margin-bottom:24px;padding-left:76px;font-size:18px}@media (min-width:768px){.user-info[class]{-ms-grid-column:1;-ms-grid-column-span:2;grid-column:1/3;margin-bottom:32px}}:host(.pfe-navigation--collapse-secondary-links) .user-info[class]{margin-bottom:24px}.user-info[class] pfe-avatar{position:absolute;top:0;left:0;width:64px;height:64px;border-radius:50%;overflow:hidden;background:rgba(122,122,122,.2)}.user-info[class] .user-info__edit-avatar{font-size:16px;text-decoration:none;color:#06c;color:var(--pfe-navigation__dropdown--link--Color,#06c)}.user-info[class] .user-info__edit-avatar:focus,.user-info[class] .user-info__edit-avatar:hover{color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036)}.account-links{-ms-grid-row:2;grid-row:2;-ms-grid-column:1;-ms-grid-column-span:2;grid-column:1/3;font-size:14px}@media (min-width:768px){.account-links{display:-ms-grid;display:grid;-ms-grid-columns:minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr);grid-template-columns:repeat(2,minmax(0,1fr));gap:32px;gap:var(--pfe-navigation--gutter,32px);grid-auto-flow:row}}:host(.pfe-navigation--collapse-secondary-links) .account-links{display:block}.account-links li{margin-bottom:.57143em;max-width:19.28571em}@media (min-width:768px){.account-links li{margin-bottom:1.5em}}:host(.pfe-navigation--collapse-secondary-links) .account-links li{margin-bottom:.57143em}.account-links[class] a{text-decoration:none}.account-links[class] a:focus,.account-links[class] a:hover{color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036);text-decoration:none}.account-links .account-link__title[class]{font-size:1.14286em;color:#06c;color:var(--pfe-navigation__dropdown--link--Color,#06c)}@media (min-width:768px){.account-links .account-link__title[class]{margin-bottom:8px}}:host(.pfe-navigation--collapse-secondary-links) .account-links .account-link__title[class]{margin-bottom:0}.account-links a:focus .account-link__title,.account-links a:hover .account-link__title{text-decoration:underline}.account-links .account-link__description{display:none;color:#6a6e73;color:var(--pfe-navigation__dropdown--Color--secondary,#6a6e73)}@media (min-width:768px){.account-links .account-link__description{display:block}}:host(.pfe-navigation--collapse-secondary-links) .account-links .account-link__description{display:none}@media (min-width:768px){.account-metadata{-ms-grid-row:1;-ms-grid-row-span:2;grid-row:1/span 2}}.account-metadata--mobile{-webkit-box-ordinal-group:-4;-webkit-order:-5;-ms-flex-order:-5;order:-5;display:block;margin-bottom:24px}@media (min-width:768px){.account-metadata--mobile{display:none}}:host(.pfe-navigation--collapse-secondary-links) .account-metadata--mobile{display:block}.account-metadata__account-number,.account-metadata__email,.account-metadata__login-name,.account-metadata__org-admin,.account-metadata__organization{display:none}@media (min-width:768px){.account-metadata__account-number,.account-metadata__email,.account-metadata__login-name,.account-metadata__org-admin,.account-metadata__organization{display:block}}:host(.pfe-navigation--collapse-secondary-links) .account-metadata__account-number,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__email,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__login-name,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__org-admin,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__organization{display:none}.account-metadata--mobile .account-metadata__account-number,.account-metadata--mobile .account-metadata__email,.account-metadata--mobile .account-metadata__login-name,.account-metadata--mobile .account-metadata__org-admin,.account-metadata--mobile .account-metadata__organization{display:block}.account-metadata__login-name[class]{font-size:16px;margin-bottom:1.5em}.account-metadata--org-admin .account-metadata__login-name[class]{margin-bottom:.5em}.account-metadata__account-number[class],.account-metadata__org-admin[class],.account-metadata__organization[class]{font-size:14px;color:#6a6e73;color:var(--pfe-navigation__dropdown--Color--secondary,#6a6e73)}.account-metadata__org-admin{margin-bottom:1.71429em}.account-metadata__email[class]{margin-top:1.5em}.account-metadata__logout-wrapper{margin-top:3em;padding:3em 0 24px;border-top:1px solid #d2d2d2}.account-metadata__logout-wrapper[class] a{padding:.375em 1em;color:#fff;color:var(--pfe-navigation__dropdown--Color--on-highlight,#fff);background:#e00;background:var(--pfe-navigation__dropdown--highlight-color,#e00);text-decoration:none;border-radius:3px} /*# sourceMappingURL=pfe-navigation-account.min.css.map */</style>\n<div id="wrapper">\n</div>'}},{key:"templateUrl",get:function(){return"pfe-navigation-account.html"}},{key:"styleUrl",get:function(){return"pfe-navigation-account.scss"}},{key:"userData",get:function(){return this.userData},set:function(a){this._processUserData(a)}}],[{key:"version",get:function(){return"1.0.11"}},{key:"tag",get:function(){return"pfe-navigation-account"}},{key:"meta",get:function(){return{title:"Navigation account",description:"Be awesome."}}},{key:"PfeType",get:function(){return a.PfeTypes.Content}},{key:"properties",get:function(){return{}}},{key:"slots",get:function(){return{}}}]),e(c,[{key:"connectedCallback",value:function(){i(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"connectedCallback",this).call(this)}},{key:"disconnectedCallback",value:function(){var a=document.querySelector("body");a.removeEventListener("user-ready",this._processUserReady),a.removeEventListener("user-update",this._processUserReady)}},{key:"attributeChangedCallback",value:function(a,e,t){i(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"attributeChangedCallback",this).call(this,a,e,t)}},{key:"_createPfeAvatar",value:function(a,e){var t="";void 0===this.hasSlot&&(t="pfe-");var o=document.createElement("pfe-avatar");return o.setAttribute(t+"name",a),o.setAttribute(t+"shape","circle"),"string"==typeof e&&o.setAttribute(t+"src",e),o}},{key:"_getFullName",value:function(a){if("string"==typeof a.fullName)return a.fullName;var e="";return"string"==typeof a.firstName&&(e=a.firstName),(e="string"==typeof a.lastName?e.length?e+" "+a.lastName:a.lastName:e).length||this.error("Couldn't get full name"),this.setAttribute("full-name",e),e}},{key:"_updateAvatarSrc",value:function(a){var e,t=this;(null===this._userData||"string"==typeof this._userData.REDHAT_LOGIN&&a!==this._userData.REDHAT_LOGIN)&&(e="//access.redhat.com/api/users/avatar/",(document.domain.includes("access.")||document.domain.includes(".foo."))&&(e="/api/users/avatar/"),fetch(""+e+a).then(function(a){if("object"===(void 0===a?"undefined":o(a))&&"number"==typeof a.status&&200===a.status&&"string"==typeof a.url&&!a.url.includes("blank.png")){t.setAttribute("avatar-url",a.url);for(var e=0;e<t._avatars.length;e++)t._avatars[e].setAttribute("src",a.url)}}).catch(function(a){return console.error(a)}))}},{key:"_createPfeIcon",value:function(a){var e="";void 0===this.hasSlot&&(e="pfe-");var t=document.createElement("pfe-icon");return t.setAttribute("icon",a),t.setAttribute(e+"size","sm"),t.setAttribute("aria-hidden","true"),t}},{key:"_createAccountMenuToggle",value:function(a){var e=this.shadowRoot.querySelector(".pfe-navigation__log-in-link"),t=document.createElement("button");t.classList.add("pfe-navigation__log-in-link","pfe-navigation__log-in-link--logged-in"),t.setAttribute("aria-label","Open user menu");a=this._createPfeAvatar(a);return t.append(a),t.id="account__toggle",e.replaceWith(t),this._avatars.push(a),t}},{key:"_createAccountDropdown",value:function(a){var e=document.createElement("div");e.id="wrapper",e.classList.add("pfe-navigation__dropdown");var t=document.createElement("h3"),o=this._getFullName(a),n=this._createPfeAvatar(o);t.classList.add("user-info"),this._avatars.push(n),n.classList.add("user-info__avatar");var i=document.createElement("div");i.classList.add("user-info__full-name"),i.innerText=o;var r=document.createElement("a");r.setAttribute("href","https://access.redhat.com/user/edit"),r.classList.add("user-info__edit-avatar"),r.innerText="Edit avatar",r.prepend(this._createPfeIcon("web-caret-right")),t.append(n),t.append(i),t.append(r);var c=[[{text:"Account details",url:"https://www.redhat.com/wapps/ugc/protected/personalInfo.html",description:"Edit your contact info, password, location preferences, and errata notifications."},{text:"Community profile",url:"https://access.redhat.com/user",description:"Fill out your public profile and control what content you follow."},{text:"Training & certification",url:"https://rol.redhat.com/rol/app/",description:"Access your Red Hat Learning Subscription, courses, and exams."}],[{text:"Subscriptions",url:"https://access.redhat.com/management",description:"Manage your subscriptions.",requiresRole:"portal_manage_subscriptions"},{text:"Account team",url:"https://access.redhat.com/account-team",description:"Get help from your Red Hat account team."},{text:"User management",url:"https://www.redhat.com/wapps/ugc/protected/usermgt/userList.html",description:"Manage users in your organization.",requiresRole:"admin:org:all"},{text:"Support",url:"https://access.redhat.com/support/cases/#/troubleshoot/",description:"Get support for your Red Hat products."}]],d=document.createElement("div");d.classList.add("account-links"),d.setAttribute("aria-label","Account managemement links");for(var p=0;p<c.length;p++){var s=c[p],l=document.createElement("ul");l.classList.add("account-links__column");for(var u=0;u<s.length;u++){var m=s[u],f=document.createElement("li"),_=document.createElement("a"),g=!0;void 0!==m.requiresRole&&(a.realm_access.roles.includes(m.requiresRole)||(g=!1)),g&&(_.setAttribute("href",m.url),_.innerHTML='\n <div class="account-link__title">\n '+m.text+"\n </div>",m.description&&(_.innerHTML=_.innerHTML+'\n <div class="account-link__description">\n '+m.description+"\n </div>"),f.append(_),l.append(f))}d.append(l)}var v=document.createElement("div");v.classList.add("account-metadata");var h=document.createElement("h3");h.classList.add("account-metadata__login-name"),h.innerText="Login: "+a.REDHAT_LOGIN;o=document.createElement("div");o.classList.add("account-metadata__account-number"),o.innerText="Account number: "+a.account_number;n=document.createElement("div");n.classList.add("account-metadata__email"),n.innerText=a.email;i=document.createElement("div");i.classList.add("account-metadata__logout-wrapper");r=document.createElement("a");this.hasAttribute("logout-link")?r.setAttribute("href",this.getAttribute("logout-link")):this.error("Couldn't get logout link"),r.hasAttribute("href")&&(r.innerText="Log out",i.append(r)),v.append(h),a.realm_access.roles.includes("admin:org:all")&&((h=document.createElement("div")).classList.add("account-metadata__org-admin"),h.innerText="Organization administrator",v.classList.add("account-metadata--org-admin"),v.append(h)),v.append(o),v.append(n);n=v.cloneNode(!0);return n.classList.add("account-metadata--mobile"),v.append(i),e.append(t),e.append(n),e.append(d),e.append(v),this.shadowRoot.getElementById("wrapper").replaceWith(e),e}},{key:"_processUserData",value:function(a){a.fullName=this._getFullName(a),this.getAttribute("full-name")!==a.fullName&&this.setAttribute("full-name",a.fullName),null===this._userData&&this._createAccountDropdown(a),"string"==typeof a.REDHAT_LOGIN?this._updateAvatarSrc(a.REDHAT_LOGIN):this.error("Could not find Redhat Login"),this._userData=a}},{key:"_processUserReady",value:function(a){a=a.target.user;"object"===(void 0===a?"undefined":o(a))&&this._processUserData(a)}}]),c);function c(){t(this,c);var a=r(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,c,{type:c.PfeType}));a._userData=null,a._avatars=[],a._updateAvatarSrc=a._updateAvatarSrc.bind(a),a._createAccountDropdown=a._createAccountDropdown.bind(a),a._processUserReady=a._processUserReady.bind(a),a._processUserData=a._processUserData.bind(a);var e=document.querySelector("body");return e.addEventListener("user-ready",a._processUserReady),e.addEventListener("user-update",a._processUserReady),a}return a.create(e),e});
!function(t,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("../../../@patternfly/pfelement/dist/pfelement.umd.min"),require("../../../@patternfly/pfe-avatar/dist/pfe-avatar.umd.min")):"function"==typeof define&&define.amd?define(["../../../@patternfly/pfelement/dist/pfelement.umd.min","../../../@patternfly/pfe-avatar/dist/pfe-avatar.umd.min"],a):(t=t||self).PfeNavigationAccount=a(t.PFElement,t.PfeAvatar)}(this,function(t,a){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,a=a&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e=function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")},a=function(t,a,e){return a&&o(t.prototype,a),e&&o(t,e),t};function o(t,a){for(var e=0;e<a.length;e++){var n=a[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function i(t,a,e){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,a);if(void 0!==n){if("value"in n)return n.value;n=n.get;return void 0!==n?n.call(e):void 0}if(t=Object.getPrototypeOf(t),null!==t)return i(t,a,e)}var r=function(t,a){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!=typeof a&&"function"!=typeof a?t:a},a=(function(t,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function, not "+typeof a);t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),a&&(Object.setPrototypeOf?Object.setPrototypeOf(t,a):t.__proto__=a)}(c,t),a(c,[{key:"html",get:function(){return'\n<style>.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.element-invisible,.visually-hidden{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}:host{display:block}:host([hidden]){display:none}.pfe-navigation__dropdown{display:block;width:calc(100% + 32px);max-width:1136px;max-width:var(--pfe-navigation--content-max-width,1136px);margin-left:-16px;margin-right:-16px;padding-top:12px;padding-bottom:12px;-webkit-column-count:auto;-moz-column-count:auto;column-count:auto;gap:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:0;margin-left:auto;margin-right:auto;padding:24px;font-size:16px;color:#151515;color:var(--pfe-navigation__dropdown--Color,#151515);background:#fff;background:var(--pfe-navigation__dropdown--Background,var(--pfe-theme--color--surface--lightest,#fff))}@media (min-width:768px){.pfe-navigation__dropdown{display:-ms-grid;display:grid;-ms-grid-columns:minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr);grid-template-columns:repeat(2,minmax(0,1fr));gap:0 32px;gap:0 var(--pfe-navigation--gutter,32px);grid-auto-flow:row;-webkit-column-count:auto;-moz-column-count:auto;column-count:auto;padding:24px 64px}}@media (min-width:1200px){.pfe-navigation__dropdown{-ms-grid-columns:minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr);grid-template-columns:repeat(3,minmax(0,1fr));padding:48px 32px;gap:0 32px;gap:0 var(--pfe-navigation--gutter,32px)}}:host(.pfe-navigation--collapse-secondary-links) .pfe-navigation__dropdown{display:block;width:calc(100% + 32px);max-width:1136px;max-width:var(--pfe-navigation--content-max-width,1136px);margin-left:-16px;margin-right:-16px;padding-top:12px;padding-bottom:12px;-webkit-column-count:auto;-moz-column-count:auto;column-count:auto;gap:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;padding:24px;gap:0}.pfe-navigation__dropdown[class]{width:auto}.pfe-navigation__dropdown li,.pfe-navigation__dropdown ul{margin:0;padding:0;list-style:none}.pfe-navigation__dropdown a{display:inline-block;color:#06c;color:var(--pfe-navigation__dropdown--link--Color,#06c);border:1px solid transparent}.pfe-navigation__dropdown a:focus,.pfe-navigation__dropdown a:hover{color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036);text-decoration:underline}.pfe-navigation__dropdown a:focus{border:1px dashed currentColor;border-top:1px dashed currentColor;outline:0}.pfe-navigation__dropdown .pfe-link-list--header,.pfe-navigation__dropdown [role=heading][aria-heading-level],.pfe-navigation__dropdown h2,.pfe-navigation__dropdown h3,.pfe-navigation__dropdown h4,.pfe-navigation__dropdown h5,.pfe-navigation__dropdown h6{margin:32px 0 .75em;margin:var(--pfe-navigation--gutter,32px) 0 .75em;padding:0;-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid;font-size:18px;font-weight:400;color:#464646;color:var(--pfe-navigation__dropdown--headings--Color,#464646)}.pfe-navigation__dropdown .pfe-link-list--header:first-child,.pfe-navigation__dropdown [role=heading][aria-heading-level]:first-child,.pfe-navigation__dropdown h2:first-child,.pfe-navigation__dropdown h3:first-child,.pfe-navigation__dropdown h4:first-child,.pfe-navigation__dropdown h5:first-child,.pfe-navigation__dropdown h6:first-child{margin-top:0}.pfe-navigation__dropdown .pfe-link-list--header a,.pfe-navigation__dropdown [role=heading][aria-heading-level] a,.pfe-navigation__dropdown h2 a,.pfe-navigation__dropdown h3 a,.pfe-navigation__dropdown h4 a,.pfe-navigation__dropdown h5 a,.pfe-navigation__dropdown h6 a{color:#464646;color:var(--pfe-navigation__dropdown--headings--Color,#464646);border:1px solid transparent}.pfe-navigation__dropdown .pfe-link-list--header a:focus,.pfe-navigation__dropdown .pfe-link-list--header a:hover,.pfe-navigation__dropdown [role=heading][aria-heading-level] a:focus,.pfe-navigation__dropdown [role=heading][aria-heading-level] a:hover,.pfe-navigation__dropdown h2 a:focus,.pfe-navigation__dropdown h2 a:hover,.pfe-navigation__dropdown h3 a:focus,.pfe-navigation__dropdown h3 a:hover,.pfe-navigation__dropdown h4 a:focus,.pfe-navigation__dropdown h4 a:hover,.pfe-navigation__dropdown h5 a:focus,.pfe-navigation__dropdown h5 a:hover,.pfe-navigation__dropdown h6 a:focus,.pfe-navigation__dropdown h6 a:hover{text-decoration:underline;color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036)}.pfe-navigation__dropdown .pfe-link-list--header a:focus,.pfe-navigation__dropdown [role=heading][aria-heading-level] a:focus,.pfe-navigation__dropdown h2 a:focus,.pfe-navigation__dropdown h3 a:focus,.pfe-navigation__dropdown h4 a:focus,.pfe-navigation__dropdown h5 a:focus,.pfe-navigation__dropdown h6 a:focus{border:1px dashed currentColor;border-top:1px dashed currentColor;outline:0}.pfe-navigation__dropdown li{margin:0 0 16px;-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid}.pfe-navigation__dropdown a,.pfe-navigation__dropdown pfe-card,.pfe-navigation__dropdown pfe-cta{-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid}.pfe-navigation__dropdown pfe-cta[pfe-priority=primary],.pfe-navigation__dropdown pfe-cta[priority=primary]{--pfe-cta--BackgroundColor:#e00;--pfe-cta--BackgroundColor--hover:#c00;--pfe-theme--ui--border-width:0}.pfe-navigation__dropdown pfe-cta[pfe-priority=primary]:focus,.pfe-navigation__dropdown pfe-cta[pfe-priority=primary]:hover,.pfe-navigation__dropdown pfe-cta[priority=primary]:focus,.pfe-navigation__dropdown pfe-cta[priority=primary]:hover{--pfe-cta--BackgroundColor:#c00}pfe-card .pfe-navigation__dropdown pfe-cta{margin-top:0}.user-info[class]{-webkit-box-ordinal-group:-9;-webkit-order:-10;-ms-flex-order:-10;order:-10;position:relative;min-height:64px;margin-bottom:24px;padding-left:76px;font-size:18px}@media (min-width:768px){.user-info[class]{-ms-grid-column:1;-ms-grid-column-span:2;grid-column:1/3;margin-bottom:32px}}:host(.pfe-navigation--collapse-secondary-links) .user-info[class]{margin-bottom:24px}.user-info[class] pfe-avatar{position:absolute;top:0;left:0;width:64px;height:64px;border-radius:50%;overflow:hidden;background:rgba(122,122,122,.2)}.user-info[class] .user-info__edit-avatar{font-size:16px;text-decoration:none;color:#06c;color:var(--pfe-navigation__dropdown--link--Color,#06c)}.user-info[class] .user-info__edit-avatar:focus,.user-info[class] .user-info__edit-avatar:hover{color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036)}.account-links{-ms-grid-row:2;grid-row:2;-ms-grid-column:1;-ms-grid-column-span:2;grid-column:1/3;font-size:14px}@media (min-width:768px){.account-links{display:-ms-grid;display:grid;-ms-grid-columns:minmax(0,1fr) var(--pfe-navigation--gutter,32px) minmax(0,1fr);grid-template-columns:repeat(2,minmax(0,1fr));gap:32px;gap:var(--pfe-navigation--gutter,32px);grid-auto-flow:row}}:host(.pfe-navigation--collapse-secondary-links) .account-links{display:block}.account-links li{margin-bottom:.57143em;max-width:19.28571em}@media (min-width:768px){.account-links li{margin-bottom:1.5em}}:host(.pfe-navigation--collapse-secondary-links) .account-links li{margin-bottom:.57143em}.account-links[class] a{text-decoration:none}.account-links[class] a:focus,.account-links[class] a:hover{color:#036;color:var(--pfe-navigation__dropdown--link--Color--hover,#036);text-decoration:none}.account-links .account-link__title[class]{font-size:1.14286em;color:#06c;color:var(--pfe-navigation__dropdown--link--Color,#06c)}@media (min-width:768px){.account-links .account-link__title[class]{margin-bottom:8px}}:host(.pfe-navigation--collapse-secondary-links) .account-links .account-link__title[class]{margin-bottom:0}.account-links a:focus .account-link__title,.account-links a:hover .account-link__title{text-decoration:underline}.account-links .account-link__description{display:none;color:#6a6e73;color:var(--pfe-navigation__dropdown--Color--secondary,#6a6e73)}@media (min-width:768px){.account-links .account-link__description{display:block}}:host(.pfe-navigation--collapse-secondary-links) .account-links .account-link__description{display:none}@media (min-width:768px){.account-metadata{-ms-grid-row:1;-ms-grid-row-span:2;grid-row:1/span 2}}.account-metadata--mobile{-webkit-box-ordinal-group:-4;-webkit-order:-5;-ms-flex-order:-5;order:-5;display:block;margin-bottom:24px}@media (min-width:768px){.account-metadata--mobile{display:none}}:host(.pfe-navigation--collapse-secondary-links) .account-metadata--mobile{display:block}.account-metadata__account-number,.account-metadata__email,.account-metadata__login-name,.account-metadata__org-admin,.account-metadata__organization{display:none}@media (min-width:768px){.account-metadata__account-number,.account-metadata__email,.account-metadata__login-name,.account-metadata__org-admin,.account-metadata__organization{display:block}}:host(.pfe-navigation--collapse-secondary-links) .account-metadata__account-number,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__email,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__login-name,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__org-admin,:host(.pfe-navigation--collapse-secondary-links) .account-metadata__organization{display:none}.account-metadata--mobile .account-metadata__account-number,.account-metadata--mobile .account-metadata__email,.account-metadata--mobile .account-metadata__login-name,.account-metadata--mobile .account-metadata__org-admin,.account-metadata--mobile .account-metadata__organization{display:block}.account-metadata__login-name[class]{font-size:16px;margin-bottom:1.5em}.account-metadata--org-admin .account-metadata__login-name[class]{margin-bottom:.5em}.account-metadata__account-number[class],.account-metadata__org-admin[class],.account-metadata__organization[class]{font-size:14px;color:#6a6e73;color:var(--pfe-navigation__dropdown--Color--secondary,#6a6e73)}.account-metadata__org-admin{margin-bottom:1.71429em}.account-metadata__email[class]{margin-top:1.5em}.account-metadata__logout-wrapper{margin-top:3em;padding:3em 0 24px;border-top:1px solid #d2d2d2}.account-metadata__logout-wrapper[class] a{padding:.375em 1em;color:#fff;color:var(--pfe-navigation__dropdown--Color--on-highlight,#fff);background:#e00;background:var(--pfe-navigation__dropdown--highlight-color,#e00);text-decoration:none;border-radius:3px} /*# sourceMappingURL=pfe-navigation-account.min.css.map */</style>\n<div id="wrapper">\n</div>'}},{key:"templateUrl",get:function(){return"pfe-navigation-account.html"}},{key:"styleUrl",get:function(){return"pfe-navigation-account.scss"}},{key:"userData",get:function(){return this.userData},set:function(t){this._processUserData(t)}}],[{key:"version",get:function(){return"1.0.24"}},{key:"tag",get:function(){return"pfe-navigation-account"}},{key:"meta",get:function(){return{title:"Navigation account",description:"Be awesome."}}},{key:"observedAttributes",get:function(){return["lang"]}},{key:"PfeType",get:function(){return t.PfeTypes.Content}},{key:"properties",get:function(){return{}}},{key:"slots",get:function(){return{}}}]),a(c,[{key:"connectedCallback",value:function(){i(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"connectedCallback",this).call(this),this.hasAttribute("lang")&&(this._lang=this.getAttribute("lang"))}},{key:"disconnectedCallback",value:function(){var t=document.querySelector("body");t.removeEventListener("user-ready",this._processUserReady),t.removeEventListener("user-update",this._processUserReady)}},{key:"attributeChangedCallback",value:function(t,a,e){i(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"attributeChangedCallback",this).call(this,t,a,e)}},{key:"_createPfeAvatar",value:function(t,a){var e="";void 0===this.hasSlot&&(e="pfe-");var n=document.createElement("pfe-avatar");return n.setAttribute(e+"name",t),n.setAttribute(e+"shape","circle"),"string"==typeof a&&n.setAttribute(e+"src",a),n}},{key:"_getFullName",value:function(t){if("string"==typeof t.fullName)return t.fullName;var a="";return"string"==typeof t.firstName&&(a=t.firstName),(a="string"==typeof t.lastName?a.length?a+" "+t.lastName:t.lastName:a).length||this.error("Couldn't get full name"),this.setAttribute("full-name",a),a}},{key:"_updateAvatarSrc",value:function(t){var a,e=this;(null===this._userData||"string"==typeof this._userData.REDHAT_LOGIN&&t!==this._userData.REDHAT_LOGIN)&&(a="//access.redhat.com/api/users/avatar/",(document.domain.includes("access.")||document.domain.includes(".foo."))&&(a="/api/users/avatar/"),fetch(""+a+t).then(function(t){if("object"===(void 0===t?"undefined":n(t))&&"number"==typeof t.status&&200===t.status&&"string"==typeof t.url&&!t.url.includes("blank.png")){e.setAttribute("avatar-url",t.url);for(var a=0;a<e._avatars.length;a++)e._avatars[a].setAttribute("src",t.url)}}).catch(function(t){return console.error(t)}))}},{key:"_createPfeIcon",value:function(t){var a="";void 0===this.hasSlot&&(a="pfe-");var e=document.createElement("pfe-icon");return e.setAttribute("icon",t),e.setAttribute(a+"size","sm"),e.setAttribute("aria-hidden","true"),e}},{key:"_createAccountMenuToggle",value:function(t){var a=this.shadowRoot.querySelector(".pfe-navigation__log-in-link"),e=document.createElement("button");e.classList.add("pfe-navigation__log-in-link","pfe-navigation__log-in-link--logged-in"),e.setAttribute("aria-label","Open user menu");t=this._createPfeAvatar(t);return e.append(t),e.id="account__toggle",a.replaceWith(e),this._avatars.push(t),e}},{key:"_createAccountDropdown",value:function(t){var a=document.createElement("div");a.id="wrapper",a.classList.add("pfe-navigation__dropdown");var e=document.createElement("h3"),n=this._getFullName(t),o=this._createPfeAvatar(n);e.classList.add("user-info"),this._avatars.push(o),o.classList.add("user-info__avatar");var i=document.createElement("div");i.classList.add("user-info__full-name"),i.innerText=n;var r=document.createElement("a");r.setAttribute("href","https://access.redhat.com/user/edit"),r.classList.add("user-info__edit-avatar"),r.innerText="Edit avatar",r.prepend(this._createPfeIcon("web-caret-right")),e.append(o),e.append(i),e.append(r);var c=[[{text:this._navTranslations[this._lang].accountDetails,url:"https://www.redhat.com/wapps/ugc/protected/personalInfo.html",description:this._navTranslations[this._lang].accountDetailsDesc},{text:this._navTranslations[this._lang].profile,url:"https://access.redhat.com/user",description:this._navTranslations[this._lang].profileDesc},{text:this._navTranslations[this._lang].training,url:"https://rol.redhat.com/rol/app/",description:this._navTranslations[this._lang].trainingDesc}],[{text:this._navTranslations[this._lang].subscriptions,url:"https://access.redhat.com/management",description:this._navTranslations[this._lang].subscriptionsDesc,requiresRole:"portal_manage_subscriptions"},{text:this._navTranslations[this._lang].accountTeam,url:"https://access.redhat.com/account-team",description:this._navTranslations[this._lang].accountTeamDesc},{text:this._navTranslations[this._lang].userManagement,url:"https://www.redhat.com/wapps/ugc/protected/usermgt/userList.html",description:this._navTranslations[this._lang].userManagementDesc,requiresRole:"admin:org:all"},{text:this._navTranslations[this._lang].support,url:"https://access.redhat.com/support/cases/#/troubleshoot/",description:this._navTranslations[this._lang].supportDesc}]],s=document.createElement("div");s.classList.add("account-links"),s.setAttribute("aria-label","Account managemement links");for(var u=0;u<c.length;u++){var p=c[u],d=document.createElement("ul");d.classList.add("account-links__column");for(var l=0;l<p.length;l++){var m=p[l],g=document.createElement("li"),f=document.createElement("a"),_=!0;void 0!==m.requiresRole&&(t.realm_access.roles.includes(m.requiresRole)||(_=!1)),_&&(f.setAttribute("href",m.url),f.innerHTML='\n <div class="account-link__title">\n '+m.text+"\n </div>",m.description&&(f.innerHTML=f.innerHTML+'\n <div class="account-link__description">\n '+m.description+"\n </div>"),g.append(f),d.append(g))}s.append(d)}var h=document.createElement("div");h.classList.add("account-metadata");var v=document.createElement("h3");v.classList.add("account-metadata__login-name"),v.innerText=this._navTranslations[this._lang].login+": "+t.REDHAT_LOGIN;n=document.createElement("div");n.classList.add("account-metadata__account-number"),n.innerText="Account number: "+t.account_number;o=document.createElement("div");o.classList.add("account-metadata__email"),o.innerText=t.email;i=document.createElement("div");i.classList.add("account-metadata__logout-wrapper");r=document.createElement("a");this.hasAttribute("logout-link")?r.setAttribute("href",this.getAttribute("logout-link")):this.error("Couldn't get logout link"),r.hasAttribute("href")&&(r.innerText="Log out",i.append(r)),h.append(v),t.realm_access.roles.includes("admin:org:all")&&((v=document.createElement("div")).classList.add("account-metadata__org-admin"),v.innerText=this._navTranslations[this._lang].orgAdmin,h.classList.add("account-metadata--org-admin"),h.append(v)),h.append(n),h.append(o);o=h.cloneNode(!0);return o.classList.add("account-metadata--mobile"),h.append(i),a.append(e),a.append(o),a.append(s),a.append(h),this.shadowRoot.getElementById("wrapper").replaceWith(a),a}},{key:"_processUserData",value:function(t){t.fullName=this._getFullName(t),this.getAttribute("full-name")!==t.fullName&&this.setAttribute("full-name",t.fullName),null===this._userData&&this._createAccountDropdown(t),"string"==typeof t.REDHAT_LOGIN?this._updateAvatarSrc(t.REDHAT_LOGIN):this.error("Could not find Redhat Login"),this._userData=t}},{key:"_processUserReady",value:function(t){t=t.target.user;"object"===(void 0===t?"undefined":n(t))&&this._processUserData(t)}}]),c);function c(){e(this,c);var t=r(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,c,{type:c.PfeType}));t._userData=null,t._avatars=[],t._lang="en",t._navTranslations={en:{accountDetails:"Account details",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},ja:{accountDetails:"Account details JA",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},ko:{accountDetails:"Account details KO",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},zh:{accountDetails:"Account details zh",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},de:{accountDetails:"Account details de",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},fr:{accountDetails:"Account details fr",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},it:{accountDetails:"Account details it",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},es:{accountDetails:"Account details es",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."},pt:{accountDetails:"Account details pt",accountDetailsDesc:"Edit your contact info, password, location preferences, and errata notifications.",accountNumber:"Account number",accountTeam:"Account team",accountTeamDesc:"Get help from your Red Hat account team.",login:"Login",orgAdmin:"Organization administrator",profile:"Community Profile",profileDesc:"Fill out your public profile and control what content you follow.",subscriptions:"Subscriptions",subscriptionsDesc:"Manage your subscriptions.",support:"Support",supportDesc:"Get support for your Red Hat products.",training:"Training & certification",trainingDesc:"Access your Red Hat Learning Subscription, courses, and exams.",userManagement:"User management",userManagementDesc:"Manage users in your organization."}},t._updateAvatarSrc=t._updateAvatarSrc.bind(t),t._createAccountDropdown=t._createAccountDropdown.bind(t),t._processUserReady=t._processUserReady.bind(t),t._processUserData=t._processUserData.bind(t);var a=document.querySelector("body");return a.addEventListener("user-ready",t._processUserReady),a.addEventListener("user-update",t._processUserReady),t}return t.create(a),a});
//# sourceMappingURL=pfe-navigation-account.umd.min.js.map

@@ -14,3 +14,3 @@ {

},
"version": "1.0.24",
"version": "1.0.25",
"keywords": [

@@ -17,0 +17,0 @@ "web-components",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc