Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cpelements/cp-documentation

Package Overview
Dependencies
Maintainers
5
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cpelements/cp-documentation - npm Package Compare versions

Comparing version 0.1.43 to 0.1.44

163

dist/cp-documentation.js
import PFElement from '../../../@patternfly/pfelement/dist/pfelement.js';
import '../../../@patternfly/pfe-codeblock/dist/pfe-codeblock.js';
/*!
* PatternFly Elements: PfeDocumentation 0.1.43
* PatternFly Elements: PfeDocumentation 0.1.44
* @license

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

if (!Element.prototype.closest) {
Element.prototype.closest = function(s) {
Element.prototype.closest = function (s) {
var el = this;

@@ -49,2 +50,83 @@

/**
* ChildNode.append() polyfill
* https://gomakethings.com/adding-an-element-to-the-end-of-a-set-of-elements-with-vanilla-javascript/
* @author Chris Ferdinandi
* @license MIT
*/
(function (arr) {
arr.forEach(function (item) {
if (item.hasOwnProperty("prepend")) {
return;
}
Object.defineProperty(item, "prepend", {
configurable: true,
enumerable: true,
writable: true,
value: function prepend() {
var argArr = Array.prototype.slice.call(arguments),
docFrag = document.createDocumentFragment();
argArr.forEach(function (argItem) {
var isNode = argItem instanceof Node;
docFrag.appendChild(
isNode ? argItem : document.createTextNode(String(argItem))
);
});
this.insertBefore(docFrag, this.firstChild);
},
});
});
})([Element.prototype, Document.prototype, DocumentFragment.prototype]);
/**
* Prepend Polyfill
* @see https://vanillajstoolkit.com/polyfills/prepend/
* ChildNode.prepend() polyfill
* https://github.com/jserz/js_piece/blob/master/DOM/ParentNode/append()/append().md
*/
(function (arr) {
arr.forEach(function (item) {
if (item.hasOwnProperty("prepend")) {
return;
}
Object.defineProperty(item, "prepend", {
configurable: true,
enumerable: true,
writable: true,
value: function prepend() {
var argArr = Array.prototype.slice.call(arguments),
docFrag = document.createDocumentFragment();
argArr.forEach(function (argItem) {
var isNode = argItem instanceof Node;
docFrag.appendChild(
isNode ? argItem : document.createTextNode(String(argItem))
);
});
this.insertBefore(docFrag, this.firstChild);
},
});
});
})([Element.prototype, Document.prototype, DocumentFragment.prototype]);
/**
* Includes Polyfill
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes#polyfill
*/
if (!String.prototype.includes) {
String.prototype.includes = function (search, start) {
if (search instanceof RegExp) {
throw TypeError("first argument must not be a RegExp");
}
if (start === undefined) {
start = 0;
}
return this.indexOf(search, start) !== -1;
};
}
// Config for mutation observer to see if things change inside of the component

@@ -55,3 +137,3 @@ const lightDomObserverConfig = {

subtree: true,
childList: true
childList: true,
};

@@ -61,3 +143,3 @@

static get version() {
return "0.1.43";
return "0.1.44";
}

@@ -234,4 +316,3 @@

disconnectedCallback() {
}
disconnectedCallback() {}

@@ -387,3 +468,3 @@ attributeChangedCallback(attr, oldVal, newVal) {

this.childNodes.forEach(childNode => {
this.childNodes.forEach((childNode) => {
const cloneNode = childNode.cloneNode(true);

@@ -416,9 +497,7 @@ newContentWrapper.append(cloneNode);

if (this._contentType === "assembly") {
const moduleWrapper = additionalResourcesWrapper.closest(
"section, article"
);
const moduleWrapper =
additionalResourcesWrapper.closest("section, article");
if (moduleWrapper) {
const additionalResourcesH2 = additionalResourcesWrapper.querySelector(
"h2"
);
const additionalResourcesH2 =
additionalResourcesWrapper.querySelector("h2");
const isLastItem = index === additionalResourcesWrappers.length - 1;

@@ -469,2 +548,46 @@ // We should only have one guide additional resources, and it ought to be the last additional resources

const codeBlocks = newContentWrapper.querySelectorAll("pre");
for (let index = 0; index < codeBlocks.length; index++) {
const codeBlock = codeBlocks[index];
const pfeCodeblockWrapper = document.createElement("pfe-codeblock");
const codeBlockClasses = codeBlock.getAttribute("class");
// pfeCodeblockWrapper.setAttribute('code-theme', 'dark');
codeBlock.setAttribute("codeblock-container", "");
const getCodeLanguage = (classString) => {
const codeBlockClassesArray = codeBlockClasses.split(" ");
for (let j = 0; j < codeBlockClassesArray.length; j++) {
const className = codeBlockClassesArray[j];
if (className.substring(0, 9) === "language-") {
return className.substring(9);
}
}
};
if (codeBlockClasses) {
const codeLanguage = getCodeLanguage(codeBlockClasses);
if (codeLanguage) {
pfeCodeblockWrapper.setAttribute("code-language", codeLanguage);
}
}
codeBlock.removeAttribute("class");
codeBlock.parentElement.replaceChild(pfeCodeblockWrapper, codeBlock);
pfeCodeblockWrapper.append(codeBlock);
}
const tables = newContentWrapper.querySelectorAll("table");
for (let index = 0; index < tables.length; index++) {
const table = tables[index];
if (!table.parentElement.classList.contains("table-wrapper")) {
const tableWrapper = document.createElement("div");
tableWrapper.classList.add("table-wrapper");
table.parentElement.replaceChild(tableWrapper, table);
tableWrapper.append(table);
}
}
// --------------------------------------------

@@ -526,4 +649,4 @@ // End best time to do DOM manipulation in Shadow Dom

fetch(this._portalEnvironmentFix(endpointUrl))
.then(response => response.json())
.then(data => {
.then((response) => response.json())
.then((data) => {
if (typeof data.module === "object") {

@@ -538,3 +661,3 @@ this.setAttribute("pfe-loaded", "");

// This will throw an error: "Unexpected token < in JSON", it's because Pantheon is sending HTML 404's, not JSON
.catch(error => console.error(`${this.tag}: ${error}`));
.catch((error) => console.error(`${this.tag}: ${error}`));
}

@@ -560,5 +683,4 @@ }

_addIncludedInGuides(moduleData) {
let moduleUuid = this._contentData.variantToModuleMap[
moduleData.variant_uuid
];
let moduleUuid =
this._contentData.variantToModuleMap[moduleData.variant_uuid];

@@ -645,3 +767,4 @@ // Make sure there's only one instance of this module

if (!relatedTopicContentWrapper) {
const relatedTopicContentElements = this._createRelatedContentWrapper();
const relatedTopicContentElements =
this._createRelatedContentWrapper();
relatedTopicContentWrapper = relatedTopicContentElements[0];

@@ -648,0 +771,0 @@ relatedTopicContentElements[1].append(includedInGuidesWrapper);

12

dist/cp-documentation.min.js

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

import e from"../../../@patternfly/pfelement/dist/pfelement.min.js";
import e from"../../../@patternfly/pfelement/dist/pfelement.min.js";import"../../../@patternfly/pfe-codeblock/dist/pfe-codeblock.min.js";
/*!
* PatternFly Elements: PfeDocumentation 0.1.43
* PatternFly Elements: PfeDocumentation 0.1.44
* @license

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

*/
Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null});const t={characterData:!0,subtree:!0,childList:!0};class o extends e{static get version(){return"0.1.43"}get html(){return'<style>:host{display:block}:host([hidden]){display:none}:host([pfe-c-non-prod]) abbr[style],:host([pfe-c-non-prod]) address[style],:host([pfe-c-non-prod]) article[style],:host([pfe-c-non-prod]) aside[style],:host([pfe-c-non-prod]) b[style],:host([pfe-c-non-prod]) blockquote[style],:host([pfe-c-non-prod]) body[style],:host([pfe-c-non-prod]) canvas[style],:host([pfe-c-non-prod]) caption[style],:host([pfe-c-non-prod]) cite[style],:host([pfe-c-non-prod]) code[style],:host([pfe-c-non-prod]) dd[style],:host([pfe-c-non-prod]) del[style],:host([pfe-c-non-prod]) details[style],:host([pfe-c-non-prod]) dfn[style],:host([pfe-c-non-prod]) div[style],:host([pfe-c-non-prod]) dl[style],:host([pfe-c-non-prod]) dt[style],:host([pfe-c-non-prod]) em[style],:host([pfe-c-non-prod]) fieldset[style],:host([pfe-c-non-prod]) figcaption[style],:host([pfe-c-non-prod]) figure[style],:host([pfe-c-non-prod]) footer[style],:host([pfe-c-non-prod]) form[style],:host([pfe-c-non-prod]) h1[style],:host([pfe-c-non-prod]) h2[style],:host([pfe-c-non-prod]) h3[style],:host([pfe-c-non-prod]) h4[style],:host([pfe-c-non-prod]) h5[style],:host([pfe-c-non-prod]) h6[style],:host([pfe-c-non-prod]) header[style],:host([pfe-c-non-prod]) hgroup[style],:host([pfe-c-non-prod]) html[style],:host([pfe-c-non-prod]) i[style],:host([pfe-c-non-prod]) iframe[style],:host([pfe-c-non-prod]) ins[style],:host([pfe-c-non-prod]) kbd[style],:host([pfe-c-non-prod]) label[style],:host([pfe-c-non-prod]) legend[style],:host([pfe-c-non-prod]) li[style],:host([pfe-c-non-prod]) mark[style],:host([pfe-c-non-prod]) menu[style],:host([pfe-c-non-prod]) nav[style],:host([pfe-c-non-prod]) object[style],:host([pfe-c-non-prod]) ol[style],:host([pfe-c-non-prod]) p[style],:host([pfe-c-non-prod]) pre[style],:host([pfe-c-non-prod]) q[style],:host([pfe-c-non-prod]) samp[style],:host([pfe-c-non-prod]) section[style],:host([pfe-c-non-prod]) small[style],:host([pfe-c-non-prod]) span[style],:host([pfe-c-non-prod]) strong[style],:host([pfe-c-non-prod]) sub[style],:host([pfe-c-non-prod]) summary[style],:host([pfe-c-non-prod]) sup[style],:host([pfe-c-non-prod]) table[style],:host([pfe-c-non-prod]) tbody[style],:host([pfe-c-non-prod]) td[style],:host([pfe-c-non-prod]) tfoot[style],:host([pfe-c-non-prod]) th[style],:host([pfe-c-non-prod]) thead[style],:host([pfe-c-non-prod]) time[style],:host([pfe-c-non-prod]) tr[style],:host([pfe-c-non-prod]) ul[style],:host([pfe-c-non-prod]) var[style]{border:2px solid #c9190b}:host([pfe-c-non-prod]) abbr[style]:before,:host([pfe-c-non-prod]) address[style]:before,:host([pfe-c-non-prod]) article[style]:before,:host([pfe-c-non-prod]) aside[style]:before,:host([pfe-c-non-prod]) b[style]:before,:host([pfe-c-non-prod]) blockquote[style]:before,:host([pfe-c-non-prod]) body[style]:before,:host([pfe-c-non-prod]) canvas[style]:before,:host([pfe-c-non-prod]) caption[style]:before,:host([pfe-c-non-prod]) cite[style]:before,:host([pfe-c-non-prod]) code[style]:before,:host([pfe-c-non-prod]) dd[style]:before,:host([pfe-c-non-prod]) del[style]:before,:host([pfe-c-non-prod]) details[style]:before,:host([pfe-c-non-prod]) dfn[style]:before,:host([pfe-c-non-prod]) div[style]:before,:host([pfe-c-non-prod]) dl[style]:before,:host([pfe-c-non-prod]) dt[style]:before,:host([pfe-c-non-prod]) em[style]:before,:host([pfe-c-non-prod]) fieldset[style]:before,:host([pfe-c-non-prod]) figcaption[style]:before,:host([pfe-c-non-prod]) figure[style]:before,:host([pfe-c-non-prod]) footer[style]:before,:host([pfe-c-non-prod]) form[style]:before,:host([pfe-c-non-prod]) h1[style]:before,:host([pfe-c-non-prod]) h2[style]:before,:host([pfe-c-non-prod]) h3[style]:before,:host([pfe-c-non-prod]) h4[style]:before,:host([pfe-c-non-prod]) h5[style]:before,:host([pfe-c-non-prod]) h6[style]:before,:host([pfe-c-non-prod]) header[style]:before,:host([pfe-c-non-prod]) hgroup[style]:before,:host([pfe-c-non-prod]) html[style]:before,:host([pfe-c-non-prod]) i[style]:before,:host([pfe-c-non-prod]) iframe[style]:before,:host([pfe-c-non-prod]) ins[style]:before,:host([pfe-c-non-prod]) kbd[style]:before,:host([pfe-c-non-prod]) label[style]:before,:host([pfe-c-non-prod]) legend[style]:before,:host([pfe-c-non-prod]) li[style]:before,:host([pfe-c-non-prod]) mark[style]:before,:host([pfe-c-non-prod]) menu[style]:before,:host([pfe-c-non-prod]) nav[style]:before,:host([pfe-c-non-prod]) object[style]:before,:host([pfe-c-non-prod]) ol[style]:before,:host([pfe-c-non-prod]) p[style]:before,:host([pfe-c-non-prod]) pre[style]:before,:host([pfe-c-non-prod]) q[style]:before,:host([pfe-c-non-prod]) samp[style]:before,:host([pfe-c-non-prod]) section[style]:before,:host([pfe-c-non-prod]) small[style]:before,:host([pfe-c-non-prod]) span[style]:before,:host([pfe-c-non-prod]) strong[style]:before,:host([pfe-c-non-prod]) sub[style]:before,:host([pfe-c-non-prod]) summary[style]:before,:host([pfe-c-non-prod]) sup[style]:before,:host([pfe-c-non-prod]) table[style]:before,:host([pfe-c-non-prod]) tbody[style]:before,:host([pfe-c-non-prod]) td[style]:before,:host([pfe-c-non-prod]) tfoot[style]:before,:host([pfe-c-non-prod]) th[style]:before,:host([pfe-c-non-prod]) thead[style]:before,:host([pfe-c-non-prod]) time[style]:before,:host([pfe-c-non-prod]) tr[style]:before,:host([pfe-c-non-prod]) ul[style]:before,:host([pfe-c-non-prod]) var[style]:before{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee;content:"WARNING: This -moz-element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style);content:"WARNING: This element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style)}.warning-message{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee}\n/*# sourceMappingURL=cp-documentation.min.css.map */\n</style><div id="wrapper" class="rhdocs"></div>'}static get tag(){return"cp-documentation"}static get properties(){return{}}static get slots(){return{}}get templateUrl(){return"cp-documentation.html"}get styleUrl(){return"cp-documentation.scss"}constructor(){super(o,{type:o.PfeType}),this._processLightDom=this._processLightDom.bind(this),this._isDevelopment=this._isDevelopment.bind(this),this._addStyleSheet=this._addStyleSheet.bind(this),this._loadCss=this._loadCss.bind(this),this.loadData=this.loadData.bind(this),this.getData=this.getData.bind(this),this._navigationHandler=this._navigationHandler.bind(this),this._loadChildModules=this._loadChildModules.bind(this),this._addIncludedInGuides=this._addIncludedInGuides.bind(this),this._observer=new MutationObserver(this._processLightDom),this._contentData={},this._contentType=null}connectedCallback(){if(super.connectedCallback(),this.hasAttribute("pfe-css"))this._loadCss();else{let e="/webassets/avalon/j/public_modules/node_modules/@cpelements/cp-documentation/dist/rhdocs.min.css";for(let t=0;t<document.styleSheets.length;t++){const o=document.styleSheets[t];if(o.href&&o.href.includes("/rhdocs.")){e=o.ownerNode.getAttribute("href");break}}this._addStyleSheet(e)}"object"==typeof drupalSettings&&drupalSettings.red_hat_fcc?("string"==typeof drupalSettings.red_hat_fcc.content_metadata?this._contentData=JSON.parse(drupalSettings.red_hat_fcc.content_metadata):"object"==typeof drupalSettings.red_hat_fcc.content_metadata&&(this._contentData=drupalSettings.red_hat_fcc.content_metadata),this._contentType=this._contentData.content_type):window.location.host.includes("access.")&&".redhat.com"===window.location.host.substring(-11)&&(this._contentType=document.querySelector(".rhdocs__header--assembly")?"assembly":"module"),document.querySelector(".rh-docs__sidebar")&&this.classList.add("pfe-documentation--next-to-sidebar"),this._processLightDom(),this._observer.observe(this,t);const e=this.querySelector("#rhdocs-preamble");e&&!e.textContent.trim()&&e.remove(),window.location.hash&&window.addEventListener("load",this._navigationHandler),this.parentElement.classList.contains("rh-docs__content-wrapper")&&document.getElementById("rhdocs-header-external")&&this.classList.add("cp-documentation--has-external-header"),window.addEventListener("hashchange",this._navigationHandler)}disconnectedCallback(){}attributeChangedCallback(e,t,o){switch(super.attributeChangedCallback(e,t,o),e){case"pfe-endpoint":this.loadData()}}_isCrustyBrowser(){return window.ShadyCSS&&!window.ShadyCSS.nativeShadow}_portalEnvironmentFix(e){return e=(e=(e=(e=(e=e.replace("http://","https://")).replace("pantheon2-dev.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.dev.redhat.com")).replace("pantheon2-qa.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.qa.redhat.com")).replace("pantheon2-stage.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.stage.redhat.com")).replace("pantheon2-proxy.ext.us-west.aws.prod.paas.redhat.com","api.docs.redhat.com"),(window.location.host.includes("wruvalca")||window.location.host.includes(".foo."))&&(e=e.substring(e.indexOf("/api"))),e}_isDevelopment(){return this.hasAttribute("debug")}_navigationHandler(){let e=this.shadowRoot.getElementById(window.location.hash.substring(1));e&&window.scrollTo(window.scrollX,e.offsetTop)}_createRelatedContentWrapper(e){"string"!=typeof e&&(e="topic");const t=document.createElement("details"),o=document.createElement("summary"),n=document.createElement("div");return t.classList.add("related-topic-content__wrapper"),"guide"===e&&(t.classList.add("related-topic-content__wrapper--for-guide"),t.setAttribute("open","")),o.classList.add("related-topic-content__title"),n.classList.add("related-topic-content__inner-wrapper"),o.innerText=`Content related to this ${e}`,t.append(o),t.append(n),[t,n]}_createPrintButton(){const e=document.createElement("button");e.innerText="Print",e.classList.add("rhdocs__print-button");const t=document.createElement("pfe-icon");return t.setAttribute("icon","web-print"),t.setAttribute("pfe-size","sm"),e.prepend(t),e.addEventListener("click",()=>{window.print()}),e}_processLightDom(e){this._isCrustyBrowser()&&this._observer.disconnect(),this._isDevelopment()&&console.log(`${this.tag}: Processing Light Dom`,e);const o=this.shadowRoot.getElementById("wrapper"),n=this.shadowRoot.getElementById("content"),s=document.createElement("div");this.childNodes.forEach(e=>{const t=e.cloneNode(!0);s.append(t)});const r=s.querySelectorAll("._additional-resources");for(let e=0;e<r.length;e++){let t=r[e];const o=document.createElement("aside");if(o.setAttribute("class",t.getAttribute("class")),o.innerHTML=t.innerHTML,t.parentElement.replaceChild(o,t),t=o,"assembly"===this._contentType){const o=t.closest("section, article");if(o){const n=t.querySelector("h2"),s=e===r.length-1&&n?"guide":"topic",d=this._createRelatedContentWrapper(s);"guide"===s?(d[1].append(t),o.append(d[0])):(t.replaceWith(d[0]),d[1].append(t))}}}let d=s.querySelector(".rhdocs__header__secondary-wrapper");if(!s.querySelector("#rhdocs-header-external")&&document.getElementById("rhdocs-header-external")&&(d=document.querySelector("#rhdocs-header-external .rhdocs__header__secondary-wrapper")),d&&!d.querySelector(".rhdocs-print-button")){const e=document.createElement("li");e.classList.add("rh-docs-details-item"),e.classList.add("rhdocs-print-button"),e.append(this._createPrintButton()),d.append(e)}n?o.replaceChild(s,n):o.append(s),s.setAttribute("id","content"),this._isCrustyBrowser()&&this._observer.observe(this,t)}_addStyleSheet(e){if(!this.shadowRoot.querySelector(`link[href='${e}']`)){const t=document.createElement("link");t.setAttribute("id","pfe-css"),t.setAttribute("href",e),t.setAttribute("rel","stylesheet"),this.shadowRoot.prepend(t)}}_loadCss(){this.hasAttribute("pfe-css")&&this._addStyleSheet(this.getAttribute("pfe-css"))}loadData(){const e=this.getAttribute("pfe-endpoint");e&&fetch(this._portalEnvironmentFix(e)).then(e=>e.json()).then(e=>{"object"==typeof e.module&&(this.setAttribute("pfe-loaded",""),this._contentData=e.module,this._contentData.body&&(this.innerHTML=this._contentData.body))}).catch(e=>console.error(`${this.tag}: ${e}`))}getData(){return Object.keys(this._contentData).length?this._contentData:null}_addIncludedInGuides(e){let t=this._contentData.variantToModuleMap[e.variant_uuid];if(this._contentData.moduleToVariantMap[t].length>1)console.error(`${this.tag}: The same module is used twice in this assembly, included in guides could not be added.`);else if(t){const o=this.shadowRoot.querySelector(`[pantheon-module-id="${t}"]`);if(o){const t=window.location.pathname.split("/"),n=[];for(let o=0;o<e.included_in_guides.length;o++){const s=e.included_in_guides[o];if(s.uuid!==this._contentData.uuid){const e=document.createElement("a");t[t.length-1]=s.uuid,e.setAttribute("href",`/${t.join("/")}`),e.innerText=s.title,n.push(e)}}let s=null;if(n.length>1){s=document.createElement("ul");for(let e=0;e<s.length;e++){const t=s[e],o=document.createElement("li");o.append(t),s.append(o)}}else s=n[0];const r=parseInt(o.querySelector("h1, h2, h3, h4, h5, h6").tagName.substring(1));let d=r>5?6:r+1;const p=document.createElement("aside");p.classList.add("included-in-guides");const c=document.createElement(`h${d}`);c.classList.add("included-in-guides__title"),c.innerText="Guides Including this topic",p.append(c),p.append(s);let l=o.querySelector(".related-topic-content__wrapper");if(l)l.querySelector(".related-topic-content__inner-wrapper").append(p);else{const e=this._createRelatedContentWrapper();l=e[0],e[1].append(p),o.append(l)}}}}_loadChildModules(){}}e.create(o);export default o;
Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null})
/**
* ChildNode.append() polyfill
* https://gomakethings.com/adding-an-element-to-the-end-of-a-set-of-elements-with-vanilla-javascript/
* @author Chris Ferdinandi
* @license MIT
*/,[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(e){e.hasOwnProperty("prepend")||Object.defineProperty(e,"prepend",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach(function(e){var o=e instanceof Node;t.appendChild(o?e:document.createTextNode(String(e)))}),this.insertBefore(t,this.firstChild)}})}),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(e){e.hasOwnProperty("prepend")||Object.defineProperty(e,"prepend",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach(function(e){var o=e instanceof Node;t.appendChild(o?e:document.createTextNode(String(e)))}),this.insertBefore(t,this.firstChild)}})}),String.prototype.includes||(String.prototype.includes=function(e,t){if(e instanceof RegExp)throw TypeError("first argument must not be a RegExp");return void 0===t&&(t=0),-1!==this.indexOf(e,t)});const t={characterData:!0,subtree:!0,childList:!0};class o extends e{static get version(){return"0.1.44"}get html(){return'<style>:host{display:block}:host([hidden]){display:none}:host([pfe-c-non-prod]) abbr[style],:host([pfe-c-non-prod]) address[style],:host([pfe-c-non-prod]) article[style],:host([pfe-c-non-prod]) aside[style],:host([pfe-c-non-prod]) b[style],:host([pfe-c-non-prod]) blockquote[style],:host([pfe-c-non-prod]) body[style],:host([pfe-c-non-prod]) canvas[style],:host([pfe-c-non-prod]) caption[style],:host([pfe-c-non-prod]) cite[style],:host([pfe-c-non-prod]) code[style],:host([pfe-c-non-prod]) dd[style],:host([pfe-c-non-prod]) del[style],:host([pfe-c-non-prod]) details[style],:host([pfe-c-non-prod]) dfn[style],:host([pfe-c-non-prod]) div[style],:host([pfe-c-non-prod]) dl[style],:host([pfe-c-non-prod]) dt[style],:host([pfe-c-non-prod]) em[style],:host([pfe-c-non-prod]) fieldset[style],:host([pfe-c-non-prod]) figcaption[style],:host([pfe-c-non-prod]) figure[style],:host([pfe-c-non-prod]) footer[style],:host([pfe-c-non-prod]) form[style],:host([pfe-c-non-prod]) h1[style],:host([pfe-c-non-prod]) h2[style],:host([pfe-c-non-prod]) h3[style],:host([pfe-c-non-prod]) h4[style],:host([pfe-c-non-prod]) h5[style],:host([pfe-c-non-prod]) h6[style],:host([pfe-c-non-prod]) header[style],:host([pfe-c-non-prod]) hgroup[style],:host([pfe-c-non-prod]) html[style],:host([pfe-c-non-prod]) i[style],:host([pfe-c-non-prod]) iframe[style],:host([pfe-c-non-prod]) ins[style],:host([pfe-c-non-prod]) kbd[style],:host([pfe-c-non-prod]) label[style],:host([pfe-c-non-prod]) legend[style],:host([pfe-c-non-prod]) li[style],:host([pfe-c-non-prod]) mark[style],:host([pfe-c-non-prod]) menu[style],:host([pfe-c-non-prod]) nav[style],:host([pfe-c-non-prod]) object[style],:host([pfe-c-non-prod]) ol[style],:host([pfe-c-non-prod]) p[style],:host([pfe-c-non-prod]) pre[style],:host([pfe-c-non-prod]) q[style],:host([pfe-c-non-prod]) samp[style],:host([pfe-c-non-prod]) section[style],:host([pfe-c-non-prod]) small[style],:host([pfe-c-non-prod]) span[style],:host([pfe-c-non-prod]) strong[style],:host([pfe-c-non-prod]) sub[style],:host([pfe-c-non-prod]) summary[style],:host([pfe-c-non-prod]) sup[style],:host([pfe-c-non-prod]) table[style],:host([pfe-c-non-prod]) tbody[style],:host([pfe-c-non-prod]) td[style],:host([pfe-c-non-prod]) tfoot[style],:host([pfe-c-non-prod]) th[style],:host([pfe-c-non-prod]) thead[style],:host([pfe-c-non-prod]) time[style],:host([pfe-c-non-prod]) tr[style],:host([pfe-c-non-prod]) ul[style],:host([pfe-c-non-prod]) var[style]{border:2px solid #c9190b}:host([pfe-c-non-prod]) abbr[style]:before,:host([pfe-c-non-prod]) address[style]:before,:host([pfe-c-non-prod]) article[style]:before,:host([pfe-c-non-prod]) aside[style]:before,:host([pfe-c-non-prod]) b[style]:before,:host([pfe-c-non-prod]) blockquote[style]:before,:host([pfe-c-non-prod]) body[style]:before,:host([pfe-c-non-prod]) canvas[style]:before,:host([pfe-c-non-prod]) caption[style]:before,:host([pfe-c-non-prod]) cite[style]:before,:host([pfe-c-non-prod]) code[style]:before,:host([pfe-c-non-prod]) dd[style]:before,:host([pfe-c-non-prod]) del[style]:before,:host([pfe-c-non-prod]) details[style]:before,:host([pfe-c-non-prod]) dfn[style]:before,:host([pfe-c-non-prod]) div[style]:before,:host([pfe-c-non-prod]) dl[style]:before,:host([pfe-c-non-prod]) dt[style]:before,:host([pfe-c-non-prod]) em[style]:before,:host([pfe-c-non-prod]) fieldset[style]:before,:host([pfe-c-non-prod]) figcaption[style]:before,:host([pfe-c-non-prod]) figure[style]:before,:host([pfe-c-non-prod]) footer[style]:before,:host([pfe-c-non-prod]) form[style]:before,:host([pfe-c-non-prod]) h1[style]:before,:host([pfe-c-non-prod]) h2[style]:before,:host([pfe-c-non-prod]) h3[style]:before,:host([pfe-c-non-prod]) h4[style]:before,:host([pfe-c-non-prod]) h5[style]:before,:host([pfe-c-non-prod]) h6[style]:before,:host([pfe-c-non-prod]) header[style]:before,:host([pfe-c-non-prod]) hgroup[style]:before,:host([pfe-c-non-prod]) html[style]:before,:host([pfe-c-non-prod]) i[style]:before,:host([pfe-c-non-prod]) iframe[style]:before,:host([pfe-c-non-prod]) ins[style]:before,:host([pfe-c-non-prod]) kbd[style]:before,:host([pfe-c-non-prod]) label[style]:before,:host([pfe-c-non-prod]) legend[style]:before,:host([pfe-c-non-prod]) li[style]:before,:host([pfe-c-non-prod]) mark[style]:before,:host([pfe-c-non-prod]) menu[style]:before,:host([pfe-c-non-prod]) nav[style]:before,:host([pfe-c-non-prod]) object[style]:before,:host([pfe-c-non-prod]) ol[style]:before,:host([pfe-c-non-prod]) p[style]:before,:host([pfe-c-non-prod]) pre[style]:before,:host([pfe-c-non-prod]) q[style]:before,:host([pfe-c-non-prod]) samp[style]:before,:host([pfe-c-non-prod]) section[style]:before,:host([pfe-c-non-prod]) small[style]:before,:host([pfe-c-non-prod]) span[style]:before,:host([pfe-c-non-prod]) strong[style]:before,:host([pfe-c-non-prod]) sub[style]:before,:host([pfe-c-non-prod]) summary[style]:before,:host([pfe-c-non-prod]) sup[style]:before,:host([pfe-c-non-prod]) table[style]:before,:host([pfe-c-non-prod]) tbody[style]:before,:host([pfe-c-non-prod]) td[style]:before,:host([pfe-c-non-prod]) tfoot[style]:before,:host([pfe-c-non-prod]) th[style]:before,:host([pfe-c-non-prod]) thead[style]:before,:host([pfe-c-non-prod]) time[style]:before,:host([pfe-c-non-prod]) tr[style]:before,:host([pfe-c-non-prod]) ul[style]:before,:host([pfe-c-non-prod]) var[style]:before{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee;content:"WARNING: This -moz-element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style);content:"WARNING: This element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style)}.warning-message{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee}\n/*# sourceMappingURL=cp-documentation.min.css.map */\n</style><div id="wrapper" class="rhdocs"></div>'}static get tag(){return"cp-documentation"}static get properties(){return{}}static get slots(){return{}}get templateUrl(){return"cp-documentation.html"}get styleUrl(){return"cp-documentation.scss"}constructor(){super(o,{type:o.PfeType}),this._processLightDom=this._processLightDom.bind(this),this._isDevelopment=this._isDevelopment.bind(this),this._addStyleSheet=this._addStyleSheet.bind(this),this._loadCss=this._loadCss.bind(this),this.loadData=this.loadData.bind(this),this.getData=this.getData.bind(this),this._navigationHandler=this._navigationHandler.bind(this),this._loadChildModules=this._loadChildModules.bind(this),this._addIncludedInGuides=this._addIncludedInGuides.bind(this),this._observer=new MutationObserver(this._processLightDom),this._contentData={},this._contentType=null}connectedCallback(){if(super.connectedCallback(),this.hasAttribute("pfe-css"))this._loadCss();else{let e="/webassets/avalon/j/public_modules/node_modules/@cpelements/cp-documentation/dist/rhdocs.min.css";for(let t=0;t<document.styleSheets.length;t++){const o=document.styleSheets[t];if(o.href&&o.href.includes("/rhdocs.")){e=o.ownerNode.getAttribute("href");break}}this._addStyleSheet(e)}"object"==typeof drupalSettings&&drupalSettings.red_hat_fcc?("string"==typeof drupalSettings.red_hat_fcc.content_metadata?this._contentData=JSON.parse(drupalSettings.red_hat_fcc.content_metadata):"object"==typeof drupalSettings.red_hat_fcc.content_metadata&&(this._contentData=drupalSettings.red_hat_fcc.content_metadata),this._contentType=this._contentData.content_type):window.location.host.includes("access.")&&".redhat.com"===window.location.host.substring(-11)&&(this._contentType=document.querySelector(".rhdocs__header--assembly")?"assembly":"module"),document.querySelector(".rh-docs__sidebar")&&this.classList.add("pfe-documentation--next-to-sidebar"),this._processLightDom(),this._observer.observe(this,t);const e=this.querySelector("#rhdocs-preamble");e&&!e.textContent.trim()&&e.remove(),window.location.hash&&window.addEventListener("load",this._navigationHandler),this.parentElement.classList.contains("rh-docs__content-wrapper")&&document.getElementById("rhdocs-header-external")&&this.classList.add("cp-documentation--has-external-header"),window.addEventListener("hashchange",this._navigationHandler)}disconnectedCallback(){}attributeChangedCallback(e,t,o){switch(super.attributeChangedCallback(e,t,o),e){case"pfe-endpoint":this.loadData()}}_isCrustyBrowser(){return window.ShadyCSS&&!window.ShadyCSS.nativeShadow}_portalEnvironmentFix(e){return e=(e=(e=(e=(e=e.replace("http://","https://")).replace("pantheon2-dev.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.dev.redhat.com")).replace("pantheon2-qa.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.qa.redhat.com")).replace("pantheon2-stage.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.stage.redhat.com")).replace("pantheon2-proxy.ext.us-west.aws.prod.paas.redhat.com","api.docs.redhat.com"),(window.location.host.includes("wruvalca")||window.location.host.includes(".foo."))&&(e=e.substring(e.indexOf("/api"))),e}_isDevelopment(){return this.hasAttribute("debug")}_navigationHandler(){let e=this.shadowRoot.getElementById(window.location.hash.substring(1));e&&window.scrollTo(window.scrollX,e.offsetTop)}_createRelatedContentWrapper(e){"string"!=typeof e&&(e="topic");const t=document.createElement("details"),o=document.createElement("summary"),n=document.createElement("div");return t.classList.add("related-topic-content__wrapper"),"guide"===e&&(t.classList.add("related-topic-content__wrapper--for-guide"),t.setAttribute("open","")),o.classList.add("related-topic-content__title"),n.classList.add("related-topic-content__inner-wrapper"),o.innerText=`Content related to this ${e}`,t.append(o),t.append(n),[t,n]}_createPrintButton(){const e=document.createElement("button");e.innerText="Print",e.classList.add("rhdocs__print-button");const t=document.createElement("pfe-icon");return t.setAttribute("icon","web-print"),t.setAttribute("pfe-size","sm"),e.prepend(t),e.addEventListener("click",()=>{window.print()}),e}_processLightDom(e){this._isCrustyBrowser()&&this._observer.disconnect(),this._isDevelopment()&&console.log(`${this.tag}: Processing Light Dom`,e);const o=this.shadowRoot.getElementById("wrapper"),n=this.shadowRoot.getElementById("content"),s=document.createElement("div");this.childNodes.forEach(e=>{const t=e.cloneNode(!0);s.append(t)});const r=s.querySelectorAll("._additional-resources");for(let e=0;e<r.length;e++){let t=r[e];const o=document.createElement("aside");if(o.setAttribute("class",t.getAttribute("class")),o.innerHTML=t.innerHTML,t.parentElement.replaceChild(o,t),t=o,"assembly"===this._contentType){const o=t.closest("section, article");if(o){const n=t.querySelector("h2"),s=e===r.length-1&&n?"guide":"topic",p=this._createRelatedContentWrapper(s);"guide"===s?(p[1].append(t),o.append(p[0])):(t.replaceWith(p[0]),p[1].append(t))}}}let p=s.querySelector(".rhdocs__header__secondary-wrapper");if(!s.querySelector("#rhdocs-header-external")&&document.getElementById("rhdocs-header-external")&&(p=document.querySelector("#rhdocs-header-external .rhdocs__header__secondary-wrapper")),p&&!p.querySelector(".rhdocs-print-button")){const e=document.createElement("li");e.classList.add("rh-docs-details-item"),e.classList.add("rhdocs-print-button"),e.append(this._createPrintButton()),p.append(e)}const d=s.querySelectorAll("pre");for(let e=0;e<d.length;e++){const t=d[e],o=document.createElement("pfe-codeblock"),n=t.getAttribute("class");t.setAttribute("codeblock-container","");const s=e=>{const t=n.split(" ");for(let e=0;e<t.length;e++){const o=t[e];if("language-"===o.substring(0,9))return o.substring(9)}};if(n){const e=s(n);e&&o.setAttribute("code-language",e)}t.removeAttribute("class"),t.parentElement.replaceChild(o,t),o.append(t)}const c=s.querySelectorAll("table");for(let e=0;e<c.length;e++){const t=c[e];if(!t.parentElement.classList.contains("table-wrapper")){const e=document.createElement("div");e.classList.add("table-wrapper"),t.parentElement.replaceChild(e,t),e.append(t)}}n?o.replaceChild(s,n):o.append(s),s.setAttribute("id","content"),this._isCrustyBrowser()&&this._observer.observe(this,t)}_addStyleSheet(e){if(!this.shadowRoot.querySelector(`link[href='${e}']`)){const t=document.createElement("link");t.setAttribute("id","pfe-css"),t.setAttribute("href",e),t.setAttribute("rel","stylesheet"),this.shadowRoot.prepend(t)}}_loadCss(){this.hasAttribute("pfe-css")&&this._addStyleSheet(this.getAttribute("pfe-css"))}loadData(){const e=this.getAttribute("pfe-endpoint");e&&fetch(this._portalEnvironmentFix(e)).then(e=>e.json()).then(e=>{"object"==typeof e.module&&(this.setAttribute("pfe-loaded",""),this._contentData=e.module,this._contentData.body&&(this.innerHTML=this._contentData.body))}).catch(e=>console.error(`${this.tag}: ${e}`))}getData(){return Object.keys(this._contentData).length?this._contentData:null}_addIncludedInGuides(e){let t=this._contentData.variantToModuleMap[e.variant_uuid];if(this._contentData.moduleToVariantMap[t].length>1)console.error(`${this.tag}: The same module is used twice in this assembly, included in guides could not be added.`);else if(t){const o=this.shadowRoot.querySelector(`[pantheon-module-id="${t}"]`);if(o){const t=window.location.pathname.split("/"),n=[];for(let o=0;o<e.included_in_guides.length;o++){const s=e.included_in_guides[o];if(s.uuid!==this._contentData.uuid){const e=document.createElement("a");t[t.length-1]=s.uuid,e.setAttribute("href",`/${t.join("/")}`),e.innerText=s.title,n.push(e)}}let s=null;if(n.length>1){s=document.createElement("ul");for(let e=0;e<s.length;e++){const t=s[e],o=document.createElement("li");o.append(t),s.append(o)}}else s=n[0];const r=parseInt(o.querySelector("h1, h2, h3, h4, h5, h6").tagName.substring(1));let p=r>5?6:r+1;const d=document.createElement("aside");d.classList.add("included-in-guides");const c=document.createElement(`h${p}`);c.classList.add("included-in-guides__title"),c.innerText="Guides Including this topic",d.append(c),d.append(s);let l=o.querySelector(".related-topic-content__wrapper");if(l)l.querySelector(".related-topic-content__inner-wrapper").append(d);else{const e=this._createRelatedContentWrapper();l=e[0],e[1].append(d),o.append(l)}}}}_loadChildModules(){}}e.create(o);export default o;
//# sourceMappingURL=cp-documentation.min.js.map
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../../../@patternfly/pfelement/dist/pfelement.umd')) :
typeof define === 'function' && define.amd ? define(['../../../@patternfly/pfelement/dist/pfelement.umd'], factory) :
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../../../@patternfly/pfelement/dist/pfelement.umd'), require('../../../@patternfly/pfe-codeblock/dist/pfe-codeblock.umd')) :
typeof define === 'function' && define.amd ? define(['../../../@patternfly/pfelement/dist/pfelement.umd', '../../../@patternfly/pfe-codeblock/dist/pfe-codeblock.umd'], factory) :
(global.PfeDocumentation = factory(global.PFElement));

@@ -89,3 +89,3 @@ }(this, (function (PFElement) { 'use strict';

/*!
* PatternFly Elements: PfeDocumentation 0.1.43
* PatternFly Elements: PfeDocumentation 0.1.44
* @license

@@ -132,2 +132,79 @@ * Copyright 2020 Red Hat, Inc.

/**
* ChildNode.append() polyfill
* https://gomakethings.com/adding-an-element-to-the-end-of-a-set-of-elements-with-vanilla-javascript/
* @author Chris Ferdinandi
* @license MIT
*/
(function (arr) {
arr.forEach(function (item) {
if (item.hasOwnProperty("prepend")) {
return;
}
Object.defineProperty(item, "prepend", {
configurable: true,
enumerable: true,
writable: true,
value: function prepend() {
var argArr = Array.prototype.slice.call(arguments),
docFrag = document.createDocumentFragment();
argArr.forEach(function (argItem) {
var isNode = argItem instanceof Node;
docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
});
this.insertBefore(docFrag, this.firstChild);
}
});
});
})([Element.prototype, Document.prototype, DocumentFragment.prototype]);
/**
* Prepend Polyfill
* @see https://vanillajstoolkit.com/polyfills/prepend/
* ChildNode.prepend() polyfill
* https://github.com/jserz/js_piece/blob/master/DOM/ParentNode/append()/append().md
*/
(function (arr) {
arr.forEach(function (item) {
if (item.hasOwnProperty("prepend")) {
return;
}
Object.defineProperty(item, "prepend", {
configurable: true,
enumerable: true,
writable: true,
value: function prepend() {
var argArr = Array.prototype.slice.call(arguments),
docFrag = document.createDocumentFragment();
argArr.forEach(function (argItem) {
var isNode = argItem instanceof Node;
docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
});
this.insertBefore(docFrag, this.firstChild);
}
});
});
})([Element.prototype, Document.prototype, DocumentFragment.prototype]);
/**
* Includes Polyfill
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes#polyfill
*/
if (!String.prototype.includes) {
String.prototype.includes = function (search, start) {
if (search instanceof RegExp) {
throw TypeError("first argument must not be a RegExp");
}
if (start === undefined) {
start = 0;
}
return this.indexOf(search, start) !== -1;
};
}
// Config for mutation observer to see if things change inside of the component

@@ -161,3 +238,3 @@ var lightDomObserverConfig = {

get: function get$$1() {
return "0.1.43";
return "0.1.44";
}

@@ -526,2 +603,51 @@ }, {

var codeBlocks = newContentWrapper.querySelectorAll("pre");
var _loop = function _loop(_index) {
var codeBlock = codeBlocks[_index];
var pfeCodeblockWrapper = document.createElement("pfe-codeblock");
var codeBlockClasses = codeBlock.getAttribute("class");
// pfeCodeblockWrapper.setAttribute('code-theme', 'dark');
codeBlock.setAttribute("codeblock-container", "");
var getCodeLanguage = function getCodeLanguage(classString) {
var codeBlockClassesArray = codeBlockClasses.split(" ");
for (var j = 0; j < codeBlockClassesArray.length; j++) {
var className = codeBlockClassesArray[j];
if (className.substring(0, 9) === "language-") {
return className.substring(9);
}
}
};
if (codeBlockClasses) {
var codeLanguage = getCodeLanguage(codeBlockClasses);
if (codeLanguage) {
pfeCodeblockWrapper.setAttribute("code-language", codeLanguage);
}
}
codeBlock.removeAttribute("class");
codeBlock.parentElement.replaceChild(pfeCodeblockWrapper, codeBlock);
pfeCodeblockWrapper.append(codeBlock);
};
for (var _index = 0; _index < codeBlocks.length; _index++) {
_loop(_index);
}
var tables = newContentWrapper.querySelectorAll("table");
for (var _index2 = 0; _index2 < tables.length; _index2++) {
var table = tables[_index2];
if (!table.parentElement.classList.contains("table-wrapper")) {
var tableWrapper = document.createElement("div");
tableWrapper.classList.add("table-wrapper");
table.parentElement.replaceChild(tableWrapper, table);
tableWrapper.append(table);
}
}
// --------------------------------------------

@@ -667,4 +793,4 @@ // End best time to do DOM manipulation in Shadow Dom

relatedTopicContentLinks = document.createElement("ul");
for (var _index = 0; _index < relatedTopicContentLinks.length; _index++) {
var relatedTopicContentLink = relatedTopicContentLinks[_index];
for (var _index3 = 0; _index3 < relatedTopicContentLinks.length; _index3++) {
var relatedTopicContentLink = relatedTopicContentLinks[_index3];
var listItem = document.createElement("li");

@@ -671,0 +797,0 @@ listItem.append(relatedTopicContentLink);

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("../../../@patternfly/pfelement/dist/pfelement.umd.min")):"function"==typeof define&&define.amd?define(["../../../@patternfly/pfelement/dist/pfelement.umd.min"],t):e.PfeDocumentation=t(e.PFElement)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(e,t,o){return t&&n(e.prototype,t),o&&n(e,o),e};function n(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(e,t,o){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,t);if(void 0!==n){if("value"in n)return n.value;n=n.get;return void 0!==n?n.call(o):void 0}if(null!==(e=Object.getPrototypeOf(e)))return r(e,t,o)}var p=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t};Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t}while(null!==(t=t.parentElement||t.parentNode)&&1===t.nodeType);return null});var i={characterData:!0,subtree:!0,childList:!0},o=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(d,e),o(d,[{key:"html",get:function(){return'<style>:host{display:block}:host([hidden]){display:none}:host([pfe-c-non-prod]) abbr[style],:host([pfe-c-non-prod]) address[style],:host([pfe-c-non-prod]) article[style],:host([pfe-c-non-prod]) aside[style],:host([pfe-c-non-prod]) b[style],:host([pfe-c-non-prod]) blockquote[style],:host([pfe-c-non-prod]) body[style],:host([pfe-c-non-prod]) canvas[style],:host([pfe-c-non-prod]) caption[style],:host([pfe-c-non-prod]) cite[style],:host([pfe-c-non-prod]) code[style],:host([pfe-c-non-prod]) dd[style],:host([pfe-c-non-prod]) del[style],:host([pfe-c-non-prod]) details[style],:host([pfe-c-non-prod]) dfn[style],:host([pfe-c-non-prod]) div[style],:host([pfe-c-non-prod]) dl[style],:host([pfe-c-non-prod]) dt[style],:host([pfe-c-non-prod]) em[style],:host([pfe-c-non-prod]) fieldset[style],:host([pfe-c-non-prod]) figcaption[style],:host([pfe-c-non-prod]) figure[style],:host([pfe-c-non-prod]) footer[style],:host([pfe-c-non-prod]) form[style],:host([pfe-c-non-prod]) h1[style],:host([pfe-c-non-prod]) h2[style],:host([pfe-c-non-prod]) h3[style],:host([pfe-c-non-prod]) h4[style],:host([pfe-c-non-prod]) h5[style],:host([pfe-c-non-prod]) h6[style],:host([pfe-c-non-prod]) header[style],:host([pfe-c-non-prod]) hgroup[style],:host([pfe-c-non-prod]) html[style],:host([pfe-c-non-prod]) i[style],:host([pfe-c-non-prod]) iframe[style],:host([pfe-c-non-prod]) ins[style],:host([pfe-c-non-prod]) kbd[style],:host([pfe-c-non-prod]) label[style],:host([pfe-c-non-prod]) legend[style],:host([pfe-c-non-prod]) li[style],:host([pfe-c-non-prod]) mark[style],:host([pfe-c-non-prod]) menu[style],:host([pfe-c-non-prod]) nav[style],:host([pfe-c-non-prod]) object[style],:host([pfe-c-non-prod]) ol[style],:host([pfe-c-non-prod]) p[style],:host([pfe-c-non-prod]) pre[style],:host([pfe-c-non-prod]) q[style],:host([pfe-c-non-prod]) samp[style],:host([pfe-c-non-prod]) section[style],:host([pfe-c-non-prod]) small[style],:host([pfe-c-non-prod]) span[style],:host([pfe-c-non-prod]) strong[style],:host([pfe-c-non-prod]) sub[style],:host([pfe-c-non-prod]) summary[style],:host([pfe-c-non-prod]) sup[style],:host([pfe-c-non-prod]) table[style],:host([pfe-c-non-prod]) tbody[style],:host([pfe-c-non-prod]) td[style],:host([pfe-c-non-prod]) tfoot[style],:host([pfe-c-non-prod]) th[style],:host([pfe-c-non-prod]) thead[style],:host([pfe-c-non-prod]) time[style],:host([pfe-c-non-prod]) tr[style],:host([pfe-c-non-prod]) ul[style],:host([pfe-c-non-prod]) var[style]{border:2px solid #c9190b}:host([pfe-c-non-prod]) abbr[style]:before,:host([pfe-c-non-prod]) address[style]:before,:host([pfe-c-non-prod]) article[style]:before,:host([pfe-c-non-prod]) aside[style]:before,:host([pfe-c-non-prod]) b[style]:before,:host([pfe-c-non-prod]) blockquote[style]:before,:host([pfe-c-non-prod]) body[style]:before,:host([pfe-c-non-prod]) canvas[style]:before,:host([pfe-c-non-prod]) caption[style]:before,:host([pfe-c-non-prod]) cite[style]:before,:host([pfe-c-non-prod]) code[style]:before,:host([pfe-c-non-prod]) dd[style]:before,:host([pfe-c-non-prod]) del[style]:before,:host([pfe-c-non-prod]) details[style]:before,:host([pfe-c-non-prod]) dfn[style]:before,:host([pfe-c-non-prod]) div[style]:before,:host([pfe-c-non-prod]) dl[style]:before,:host([pfe-c-non-prod]) dt[style]:before,:host([pfe-c-non-prod]) em[style]:before,:host([pfe-c-non-prod]) fieldset[style]:before,:host([pfe-c-non-prod]) figcaption[style]:before,:host([pfe-c-non-prod]) figure[style]:before,:host([pfe-c-non-prod]) footer[style]:before,:host([pfe-c-non-prod]) form[style]:before,:host([pfe-c-non-prod]) h1[style]:before,:host([pfe-c-non-prod]) h2[style]:before,:host([pfe-c-non-prod]) h3[style]:before,:host([pfe-c-non-prod]) h4[style]:before,:host([pfe-c-non-prod]) h5[style]:before,:host([pfe-c-non-prod]) h6[style]:before,:host([pfe-c-non-prod]) header[style]:before,:host([pfe-c-non-prod]) hgroup[style]:before,:host([pfe-c-non-prod]) html[style]:before,:host([pfe-c-non-prod]) i[style]:before,:host([pfe-c-non-prod]) iframe[style]:before,:host([pfe-c-non-prod]) ins[style]:before,:host([pfe-c-non-prod]) kbd[style]:before,:host([pfe-c-non-prod]) label[style]:before,:host([pfe-c-non-prod]) legend[style]:before,:host([pfe-c-non-prod]) li[style]:before,:host([pfe-c-non-prod]) mark[style]:before,:host([pfe-c-non-prod]) menu[style]:before,:host([pfe-c-non-prod]) nav[style]:before,:host([pfe-c-non-prod]) object[style]:before,:host([pfe-c-non-prod]) ol[style]:before,:host([pfe-c-non-prod]) p[style]:before,:host([pfe-c-non-prod]) pre[style]:before,:host([pfe-c-non-prod]) q[style]:before,:host([pfe-c-non-prod]) samp[style]:before,:host([pfe-c-non-prod]) section[style]:before,:host([pfe-c-non-prod]) small[style]:before,:host([pfe-c-non-prod]) span[style]:before,:host([pfe-c-non-prod]) strong[style]:before,:host([pfe-c-non-prod]) sub[style]:before,:host([pfe-c-non-prod]) summary[style]:before,:host([pfe-c-non-prod]) sup[style]:before,:host([pfe-c-non-prod]) table[style]:before,:host([pfe-c-non-prod]) tbody[style]:before,:host([pfe-c-non-prod]) td[style]:before,:host([pfe-c-non-prod]) tfoot[style]:before,:host([pfe-c-non-prod]) th[style]:before,:host([pfe-c-non-prod]) thead[style]:before,:host([pfe-c-non-prod]) time[style]:before,:host([pfe-c-non-prod]) tr[style]:before,:host([pfe-c-non-prod]) ul[style]:before,:host([pfe-c-non-prod]) var[style]:before{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee;content:"WARNING: This -moz-element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style);content:"WARNING: This element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style)}.warning-message{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee}\n/*# sourceMappingURL=cp-documentation.min.css.map */\n</style><div id="wrapper" class="rhdocs"></div>'}},{key:"templateUrl",get:function(){return"cp-documentation.html"}},{key:"styleUrl",get:function(){return"cp-documentation.scss"}}],[{key:"version",get:function(){return"0.1.43"}},{key:"tag",get:function(){return"cp-documentation"}},{key:"properties",get:function(){return{}}},{key:"slots",get:function(){return{}}}]),o(d,[{key:"connectedCallback",value:function(){if(r(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"connectedCallback",this).call(this),this.hasAttribute("pfe-css"))this._loadCss();else{for(var e="/webassets/avalon/j/public_modules/node_modules/@cpelements/cp-documentation/dist/rhdocs.min.css",t=0;t<document.styleSheets.length;t++){var o=document.styleSheets[t];if(o.href&&o.href.includes("/rhdocs.")){e=o.ownerNode.getAttribute("href");break}}this._addStyleSheet(e)}"object"===("undefined"==typeof drupalSettings?"undefined":s(drupalSettings))&&drupalSettings.red_hat_fcc?("string"==typeof drupalSettings.red_hat_fcc.content_metadata?this._contentData=JSON.parse(drupalSettings.red_hat_fcc.content_metadata):"object"===s(drupalSettings.red_hat_fcc.content_metadata)&&(this._contentData=drupalSettings.red_hat_fcc.content_metadata),this._contentType=this._contentData.content_type):window.location.host.includes("access.")&&".redhat.com"===window.location.host.substring(-11)&&(this._contentType=document.querySelector(".rhdocs__header--assembly")?"assembly":"module"),document.querySelector(".rh-docs__sidebar")&&this.classList.add("pfe-documentation--next-to-sidebar"),this._processLightDom(),this._observer.observe(this,i);var n=this.querySelector("#rhdocs-preamble");n&&!n.textContent.trim()&&n.remove(),window.location.hash&&window.addEventListener("load",this._navigationHandler),this.parentElement.classList.contains("rh-docs__content-wrapper")&&document.getElementById("rhdocs-header-external")&&this.classList.add("cp-documentation--has-external-header"),window.addEventListener("hashchange",this._navigationHandler)}},{key:"disconnectedCallback",value:function(){}},{key:"attributeChangedCallback",value:function(e,t,o){r(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"attributeChangedCallback",this).call(this,e,t,o),"pfe-endpoint"===e&&this.loadData()}},{key:"_isCrustyBrowser",value:function(){return window.ShadyCSS&&!window.ShadyCSS.nativeShadow}},{key:"_portalEnvironmentFix",value:function(e){return e=(e=(e=(e=(e=e.replace("http://","https://")).replace("pantheon2-dev.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.dev.redhat.com")).replace("pantheon2-qa.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.qa.redhat.com")).replace("pantheon2-stage.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.stage.redhat.com")).replace("pantheon2-proxy.ext.us-west.aws.prod.paas.redhat.com","api.docs.redhat.com"),e=window.location.host.includes("wruvalca")||window.location.host.includes(".foo.")?e.substring(e.indexOf("/api")):e}},{key:"_isDevelopment",value:function(){return this.hasAttribute("debug")}},{key:"_navigationHandler",value:function(){var e=this.shadowRoot.getElementById(window.location.hash.substring(1));e&&window.scrollTo(window.scrollX,e.offsetTop)}},{key:"_createRelatedContentWrapper",value:function(e){"string"!=typeof e&&(e="topic");var t=document.createElement("details"),o=document.createElement("summary"),n=document.createElement("div");return t.classList.add("related-topic-content__wrapper"),"guide"===e&&(t.classList.add("related-topic-content__wrapper--for-guide"),t.setAttribute("open","")),o.classList.add("related-topic-content__title"),n.classList.add("related-topic-content__inner-wrapper"),o.innerText="Content related to this "+e,t.append(o),t.append(n),[t,n]}},{key:"_createPrintButton",value:function(){var e=document.createElement("button");e.innerText="Print",e.classList.add("rhdocs__print-button");var t=document.createElement("pfe-icon");return t.setAttribute("icon","web-print"),t.setAttribute("pfe-size","sm"),e.prepend(t),e.addEventListener("click",function(){window.print()}),e}},{key:"_processLightDom",value:function(e){this._isCrustyBrowser()&&this._observer.disconnect(),this._isDevelopment()&&console.log(this.tag+": Processing Light Dom",e);var t=this.shadowRoot.getElementById("wrapper"),o=this.shadowRoot.getElementById("content"),n=document.createElement("div");this.childNodes.forEach(function(e){e=e.cloneNode(!0);n.append(e)});for(var s=n.querySelectorAll("._additional-resources"),r=0;r<s.length;r++){var p,d,a=s[r],c=document.createElement("aside");c.setAttribute("class",a.getAttribute("class")),c.innerHTML=a.innerHTML,a.parentElement.replaceChild(c,a),a=c,"assembly"!==this._contentType||(p=a.closest("section, article"))&&(d=a.querySelector("h2"),c=r===s.length-1&&d?"guide":"topic",d=this._createRelatedContentWrapper(c),"guide"==c?(d[1].append(a),p.append(d[0])):(a.replaceWith(d[0]),d[1].append(a)))}var l=n.querySelector(".rhdocs__header__secondary-wrapper");(l=!n.querySelector("#rhdocs-header-external")&&document.getElementById("rhdocs-header-external")?document.querySelector("#rhdocs-header-external .rhdocs__header__secondary-wrapper"):l)&&!l.querySelector(".rhdocs-print-button")&&((e=document.createElement("li")).classList.add("rh-docs-details-item"),e.classList.add("rhdocs-print-button"),e.append(this._createPrintButton()),l.append(e)),o?t.replaceChild(n,o):t.append(n),n.setAttribute("id","content"),this._isCrustyBrowser()&&this._observer.observe(this,i)}},{key:"_addStyleSheet",value:function(e){var t;this.shadowRoot.querySelector("link[href='"+e+"']")||((t=document.createElement("link")).setAttribute("id","pfe-css"),t.setAttribute("href",e),t.setAttribute("rel","stylesheet"),this.shadowRoot.prepend(t))}},{key:"_loadCss",value:function(){this.hasAttribute("pfe-css")&&this._addStyleSheet(this.getAttribute("pfe-css"))}},{key:"loadData",value:function(){var t=this,e=this.getAttribute("pfe-endpoint");e&&fetch(this._portalEnvironmentFix(e)).then(function(e){return e.json()}).then(function(e){"object"===s(e.module)&&(t.setAttribute("pfe-loaded",""),t._contentData=e.module,t._contentData.body&&(t.innerHTML=t._contentData.body))}).catch(function(e){return console.error(t.tag+": "+e)})}},{key:"getData",value:function(){return Object.keys(this._contentData).length?this._contentData:null}},{key:"_addIncludedInGuides",value:function(e){var t=this._contentData.variantToModuleMap[e.variant_uuid];if(1<this._contentData.moduleToVariantMap[t].length)console.error(this.tag+": The same module is used twice in this assembly, included in guides could not be added.");else if(t){var o=this.shadowRoot.querySelector('[pantheon-module-id="'+t+'"]');if(o){for(var n=window.location.pathname.split("/"),s=[],r=0;r<e.included_in_guides.length;r++){var p,d=e.included_in_guides[r];d.uuid!==this._contentData.uuid&&(p=document.createElement("a"),n[n.length-1]=d.uuid,p.setAttribute("href","/"+n.join("/")),p.innerText=d.title,s.push(p))}var a=null;if(1<s.length)for(var a=document.createElement("ul"),c=0;c<a.length;c++){var l=a[c],i=document.createElement("li");i.append(l),a.append(i)}else a=s[0];var h=parseInt(o.querySelector("h1, h2, h3, h4, h5, h6").tagName.substring(1)),f=5<h?6:h+1,t=document.createElement("aside");t.classList.add("included-in-guides");h=document.createElement("h"+f);h.classList.add("included-in-guides__title"),h.innerText="Guides Including this topic",t.append(h),t.append(a);f=o.querySelector(".related-topic-content__wrapper");f?f.querySelector(".related-topic-content__inner-wrapper").append(t):(f=(h=this._createRelatedContentWrapper())[0],h[1].append(t),o.append(f))}}}},{key:"_loadChildModules",value:function(){}}]),d);function d(){t(this,d);var e=p(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,d,{type:d.PfeType}));return e._processLightDom=e._processLightDom.bind(e),e._isDevelopment=e._isDevelopment.bind(e),e._addStyleSheet=e._addStyleSheet.bind(e),e._loadCss=e._loadCss.bind(e),e.loadData=e.loadData.bind(e),e.getData=e.getData.bind(e),e._navigationHandler=e._navigationHandler.bind(e),e._loadChildModules=e._loadChildModules.bind(e),e._addIncludedInGuides=e._addIncludedInGuides.bind(e),e._observer=new MutationObserver(e._processLightDom),e._contentData={},e._contentType=null,e}return e.create(o),o});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("../../../@patternfly/pfelement/dist/pfelement.umd.min"),require("../../../@patternfly/pfe-codeblock/dist/pfe-codeblock.umd.min")):"function"==typeof define&&define.amd?define(["../../../@patternfly/pfelement/dist/pfelement.umd.min","../../../@patternfly/pfe-codeblock/dist/pfe-codeblock.umd.min"],t):e.PfeDocumentation=t(e.PFElement)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(e,t,o){return t&&n(e.prototype,t),o&&n(e,o),e};function n(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,o){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,t);if(void 0!==n){if("value"in n)return n.value;n=n.get;return void 0!==n?n.call(o):void 0}if(null!==(e=Object.getPrototypeOf(e)))return s(e,t,o)}var p=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t};Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t}while(null!==(t=t.parentElement||t.parentNode)&&1===t.nodeType);return null}),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(e){e.hasOwnProperty("prepend")||Object.defineProperty(e,"prepend",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Array.prototype.slice.call(arguments),o=document.createDocumentFragment();e.forEach(function(e){var t=e instanceof Node;o.appendChild(t?e:document.createTextNode(String(e)))}),this.insertBefore(o,this.firstChild)}})}),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(e){e.hasOwnProperty("prepend")||Object.defineProperty(e,"prepend",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Array.prototype.slice.call(arguments),o=document.createDocumentFragment();e.forEach(function(e){var t=e instanceof Node;o.appendChild(t?e:document.createTextNode(String(e)))}),this.insertBefore(o,this.firstChild)}})}),String.prototype.includes||(String.prototype.includes=function(e,t){if(e instanceof RegExp)throw TypeError("first argument must not be a RegExp");return-1!==this.indexOf(e,t=void 0===t?0:t)});var _={characterData:!0,subtree:!0,childList:!0},o=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(a,e),o(a,[{key:"html",get:function(){return'<style>:host{display:block}:host([hidden]){display:none}:host([pfe-c-non-prod]) abbr[style],:host([pfe-c-non-prod]) address[style],:host([pfe-c-non-prod]) article[style],:host([pfe-c-non-prod]) aside[style],:host([pfe-c-non-prod]) b[style],:host([pfe-c-non-prod]) blockquote[style],:host([pfe-c-non-prod]) body[style],:host([pfe-c-non-prod]) canvas[style],:host([pfe-c-non-prod]) caption[style],:host([pfe-c-non-prod]) cite[style],:host([pfe-c-non-prod]) code[style],:host([pfe-c-non-prod]) dd[style],:host([pfe-c-non-prod]) del[style],:host([pfe-c-non-prod]) details[style],:host([pfe-c-non-prod]) dfn[style],:host([pfe-c-non-prod]) div[style],:host([pfe-c-non-prod]) dl[style],:host([pfe-c-non-prod]) dt[style],:host([pfe-c-non-prod]) em[style],:host([pfe-c-non-prod]) fieldset[style],:host([pfe-c-non-prod]) figcaption[style],:host([pfe-c-non-prod]) figure[style],:host([pfe-c-non-prod]) footer[style],:host([pfe-c-non-prod]) form[style],:host([pfe-c-non-prod]) h1[style],:host([pfe-c-non-prod]) h2[style],:host([pfe-c-non-prod]) h3[style],:host([pfe-c-non-prod]) h4[style],:host([pfe-c-non-prod]) h5[style],:host([pfe-c-non-prod]) h6[style],:host([pfe-c-non-prod]) header[style],:host([pfe-c-non-prod]) hgroup[style],:host([pfe-c-non-prod]) html[style],:host([pfe-c-non-prod]) i[style],:host([pfe-c-non-prod]) iframe[style],:host([pfe-c-non-prod]) ins[style],:host([pfe-c-non-prod]) kbd[style],:host([pfe-c-non-prod]) label[style],:host([pfe-c-non-prod]) legend[style],:host([pfe-c-non-prod]) li[style],:host([pfe-c-non-prod]) mark[style],:host([pfe-c-non-prod]) menu[style],:host([pfe-c-non-prod]) nav[style],:host([pfe-c-non-prod]) object[style],:host([pfe-c-non-prod]) ol[style],:host([pfe-c-non-prod]) p[style],:host([pfe-c-non-prod]) pre[style],:host([pfe-c-non-prod]) q[style],:host([pfe-c-non-prod]) samp[style],:host([pfe-c-non-prod]) section[style],:host([pfe-c-non-prod]) small[style],:host([pfe-c-non-prod]) span[style],:host([pfe-c-non-prod]) strong[style],:host([pfe-c-non-prod]) sub[style],:host([pfe-c-non-prod]) summary[style],:host([pfe-c-non-prod]) sup[style],:host([pfe-c-non-prod]) table[style],:host([pfe-c-non-prod]) tbody[style],:host([pfe-c-non-prod]) td[style],:host([pfe-c-non-prod]) tfoot[style],:host([pfe-c-non-prod]) th[style],:host([pfe-c-non-prod]) thead[style],:host([pfe-c-non-prod]) time[style],:host([pfe-c-non-prod]) tr[style],:host([pfe-c-non-prod]) ul[style],:host([pfe-c-non-prod]) var[style]{border:2px solid #c9190b}:host([pfe-c-non-prod]) abbr[style]:before,:host([pfe-c-non-prod]) address[style]:before,:host([pfe-c-non-prod]) article[style]:before,:host([pfe-c-non-prod]) aside[style]:before,:host([pfe-c-non-prod]) b[style]:before,:host([pfe-c-non-prod]) blockquote[style]:before,:host([pfe-c-non-prod]) body[style]:before,:host([pfe-c-non-prod]) canvas[style]:before,:host([pfe-c-non-prod]) caption[style]:before,:host([pfe-c-non-prod]) cite[style]:before,:host([pfe-c-non-prod]) code[style]:before,:host([pfe-c-non-prod]) dd[style]:before,:host([pfe-c-non-prod]) del[style]:before,:host([pfe-c-non-prod]) details[style]:before,:host([pfe-c-non-prod]) dfn[style]:before,:host([pfe-c-non-prod]) div[style]:before,:host([pfe-c-non-prod]) dl[style]:before,:host([pfe-c-non-prod]) dt[style]:before,:host([pfe-c-non-prod]) em[style]:before,:host([pfe-c-non-prod]) fieldset[style]:before,:host([pfe-c-non-prod]) figcaption[style]:before,:host([pfe-c-non-prod]) figure[style]:before,:host([pfe-c-non-prod]) footer[style]:before,:host([pfe-c-non-prod]) form[style]:before,:host([pfe-c-non-prod]) h1[style]:before,:host([pfe-c-non-prod]) h2[style]:before,:host([pfe-c-non-prod]) h3[style]:before,:host([pfe-c-non-prod]) h4[style]:before,:host([pfe-c-non-prod]) h5[style]:before,:host([pfe-c-non-prod]) h6[style]:before,:host([pfe-c-non-prod]) header[style]:before,:host([pfe-c-non-prod]) hgroup[style]:before,:host([pfe-c-non-prod]) html[style]:before,:host([pfe-c-non-prod]) i[style]:before,:host([pfe-c-non-prod]) iframe[style]:before,:host([pfe-c-non-prod]) ins[style]:before,:host([pfe-c-non-prod]) kbd[style]:before,:host([pfe-c-non-prod]) label[style]:before,:host([pfe-c-non-prod]) legend[style]:before,:host([pfe-c-non-prod]) li[style]:before,:host([pfe-c-non-prod]) mark[style]:before,:host([pfe-c-non-prod]) menu[style]:before,:host([pfe-c-non-prod]) nav[style]:before,:host([pfe-c-non-prod]) object[style]:before,:host([pfe-c-non-prod]) ol[style]:before,:host([pfe-c-non-prod]) p[style]:before,:host([pfe-c-non-prod]) pre[style]:before,:host([pfe-c-non-prod]) q[style]:before,:host([pfe-c-non-prod]) samp[style]:before,:host([pfe-c-non-prod]) section[style]:before,:host([pfe-c-non-prod]) small[style]:before,:host([pfe-c-non-prod]) span[style]:before,:host([pfe-c-non-prod]) strong[style]:before,:host([pfe-c-non-prod]) sub[style]:before,:host([pfe-c-non-prod]) summary[style]:before,:host([pfe-c-non-prod]) sup[style]:before,:host([pfe-c-non-prod]) table[style]:before,:host([pfe-c-non-prod]) tbody[style]:before,:host([pfe-c-non-prod]) td[style]:before,:host([pfe-c-non-prod]) tfoot[style]:before,:host([pfe-c-non-prod]) th[style]:before,:host([pfe-c-non-prod]) thead[style]:before,:host([pfe-c-non-prod]) time[style]:before,:host([pfe-c-non-prod]) tr[style]:before,:host([pfe-c-non-prod]) ul[style]:before,:host([pfe-c-non-prod]) var[style]:before{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee;content:"WARNING: This -moz-element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style);content:"WARNING: This element has inline styles which can easily break layout on mobile or other contexts. The inline style is " attr(style)}.warning-message{display:block;min-width:320px;max-width:100vw;padding:.5em 1em;background:#fee}\n/*# sourceMappingURL=cp-documentation.min.css.map */\n</style><div id="wrapper" class="rhdocs"></div>'}},{key:"templateUrl",get:function(){return"cp-documentation.html"}},{key:"styleUrl",get:function(){return"cp-documentation.scss"}}],[{key:"version",get:function(){return"0.1.44"}},{key:"tag",get:function(){return"cp-documentation"}},{key:"properties",get:function(){return{}}},{key:"slots",get:function(){return{}}}]),o(a,[{key:"connectedCallback",value:function(){if(s(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"connectedCallback",this).call(this),this.hasAttribute("pfe-css"))this._loadCss();else{for(var e="/webassets/avalon/j/public_modules/node_modules/@cpelements/cp-documentation/dist/rhdocs.min.css",t=0;t<document.styleSheets.length;t++){var o=document.styleSheets[t];if(o.href&&o.href.includes("/rhdocs.")){e=o.ownerNode.getAttribute("href");break}}this._addStyleSheet(e)}"object"===("undefined"==typeof drupalSettings?"undefined":r(drupalSettings))&&drupalSettings.red_hat_fcc?("string"==typeof drupalSettings.red_hat_fcc.content_metadata?this._contentData=JSON.parse(drupalSettings.red_hat_fcc.content_metadata):"object"===r(drupalSettings.red_hat_fcc.content_metadata)&&(this._contentData=drupalSettings.red_hat_fcc.content_metadata),this._contentType=this._contentData.content_type):window.location.host.includes("access.")&&".redhat.com"===window.location.host.substring(-11)&&(this._contentType=document.querySelector(".rhdocs__header--assembly")?"assembly":"module"),document.querySelector(".rh-docs__sidebar")&&this.classList.add("pfe-documentation--next-to-sidebar"),this._processLightDom(),this._observer.observe(this,_);var n=this.querySelector("#rhdocs-preamble");n&&!n.textContent.trim()&&n.remove(),window.location.hash&&window.addEventListener("load",this._navigationHandler),this.parentElement.classList.contains("rh-docs__content-wrapper")&&document.getElementById("rhdocs-header-external")&&this.classList.add("cp-documentation--has-external-header"),window.addEventListener("hashchange",this._navigationHandler)}},{key:"disconnectedCallback",value:function(){}},{key:"attributeChangedCallback",value:function(e,t,o){s(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"attributeChangedCallback",this).call(this,e,t,o),"pfe-endpoint"===e&&this.loadData()}},{key:"_isCrustyBrowser",value:function(){return window.ShadyCSS&&!window.ShadyCSS.nativeShadow}},{key:"_portalEnvironmentFix",value:function(e){return e=(e=(e=(e=(e=e.replace("http://","https://")).replace("pantheon2-dev.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.dev.redhat.com")).replace("pantheon2-qa.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.qa.redhat.com")).replace("pantheon2-stage.int.us-east.aws.preprod.paas.redhat.com","pantheon.corp.stage.redhat.com")).replace("pantheon2-proxy.ext.us-west.aws.prod.paas.redhat.com","api.docs.redhat.com"),e=window.location.host.includes("wruvalca")||window.location.host.includes(".foo.")?e.substring(e.indexOf("/api")):e}},{key:"_isDevelopment",value:function(){return this.hasAttribute("debug")}},{key:"_navigationHandler",value:function(){var e=this.shadowRoot.getElementById(window.location.hash.substring(1));e&&window.scrollTo(window.scrollX,e.offsetTop)}},{key:"_createRelatedContentWrapper",value:function(e){"string"!=typeof e&&(e="topic");var t=document.createElement("details"),o=document.createElement("summary"),n=document.createElement("div");return t.classList.add("related-topic-content__wrapper"),"guide"===e&&(t.classList.add("related-topic-content__wrapper--for-guide"),t.setAttribute("open","")),o.classList.add("related-topic-content__title"),n.classList.add("related-topic-content__inner-wrapper"),o.innerText="Content related to this "+e,t.append(o),t.append(n),[t,n]}},{key:"_createPrintButton",value:function(){var e=document.createElement("button");e.innerText="Print",e.classList.add("rhdocs__print-button");var t=document.createElement("pfe-icon");return t.setAttribute("icon","web-print"),t.setAttribute("pfe-size","sm"),e.prepend(t),e.addEventListener("click",function(){window.print()}),e}},{key:"_processLightDom",value:function(e){this._isCrustyBrowser()&&this._observer.disconnect(),this._isDevelopment()&&console.log(this.tag+": Processing Light Dom",e);var t=this.shadowRoot.getElementById("wrapper"),o=this.shadowRoot.getElementById("content"),n=document.createElement("div");this.childNodes.forEach(function(e){e=e.cloneNode(!0);n.append(e)});for(var r=n.querySelectorAll("._additional-resources"),s=0;s<r.length;s++){var p,a,c=r[s],d=document.createElement("aside");d.setAttribute("class",c.getAttribute("class")),d.innerHTML=c.innerHTML,c.parentElement.replaceChild(d,c),c=d,"assembly"!==this._contentType||(p=c.closest("section, article"))&&(a=c.querySelector("h2"),d=s===r.length-1&&a?"guide":"topic",a=this._createRelatedContentWrapper(d),"guide"==d?(a[1].append(c),p.append(a[0])):(c.replaceWith(a[0]),a[1].append(c)))}var l=n.querySelector(".rhdocs__header__secondary-wrapper");(l=!n.querySelector("#rhdocs-header-external")&&document.getElementById("rhdocs-header-external")?document.querySelector("#rhdocs-header-external .rhdocs__header__secondary-wrapper"):l)&&!l.querySelector(".rhdocs-print-button")&&((e=document.createElement("li")).classList.add("rh-docs-details-item"),e.classList.add("rhdocs-print-button"),e.append(this._createPrintButton()),l.append(e));for(var i=n.querySelectorAll("pre"),h=function(e){var t=i[e],o=document.createElement("pfe-codeblock"),n=t.getAttribute("class");t.setAttribute("codeblock-container","");!n||(e=function(){for(var e=n.split(" "),t=0;t<e.length;t++){var o=e[t];if("language-"===o.substring(0,9))return o.substring(9)}}())&&o.setAttribute("code-language",e),t.removeAttribute("class"),t.parentElement.replaceChild(o,t),o.append(t)},f=0;f<i.length;f++)h(f);for(var u=n.querySelectorAll("table"),y=0;y<u.length;y++){var b,m=u[y];m.parentElement.classList.contains("table-wrapper")||((b=document.createElement("div")).classList.add("table-wrapper"),m.parentElement.replaceChild(b,m),b.append(m))}o?t.replaceChild(n,o):t.append(n),n.setAttribute("id","content"),this._isCrustyBrowser()&&this._observer.observe(this,_)}},{key:"_addStyleSheet",value:function(e){var t;this.shadowRoot.querySelector("link[href='"+e+"']")||((t=document.createElement("link")).setAttribute("id","pfe-css"),t.setAttribute("href",e),t.setAttribute("rel","stylesheet"),this.shadowRoot.prepend(t))}},{key:"_loadCss",value:function(){this.hasAttribute("pfe-css")&&this._addStyleSheet(this.getAttribute("pfe-css"))}},{key:"loadData",value:function(){var t=this,e=this.getAttribute("pfe-endpoint");e&&fetch(this._portalEnvironmentFix(e)).then(function(e){return e.json()}).then(function(e){"object"===r(e.module)&&(t.setAttribute("pfe-loaded",""),t._contentData=e.module,t._contentData.body&&(t.innerHTML=t._contentData.body))}).catch(function(e){return console.error(t.tag+": "+e)})}},{key:"getData",value:function(){return Object.keys(this._contentData).length?this._contentData:null}},{key:"_addIncludedInGuides",value:function(e){var t=this._contentData.variantToModuleMap[e.variant_uuid];if(1<this._contentData.moduleToVariantMap[t].length)console.error(this.tag+": The same module is used twice in this assembly, included in guides could not be added.");else if(t){var o=this.shadowRoot.querySelector('[pantheon-module-id="'+t+'"]');if(o){for(var n=window.location.pathname.split("/"),r=[],s=0;s<e.included_in_guides.length;s++){var p,a=e.included_in_guides[s];a.uuid!==this._contentData.uuid&&(p=document.createElement("a"),n[n.length-1]=a.uuid,p.setAttribute("href","/"+n.join("/")),p.innerText=a.title,r.push(p))}var c=null;if(1<r.length)for(var c=document.createElement("ul"),d=0;d<c.length;d++){var l=c[d],i=document.createElement("li");i.append(l),c.append(i)}else c=r[0];var h=parseInt(o.querySelector("h1, h2, h3, h4, h5, h6").tagName.substring(1)),f=5<h?6:h+1,t=document.createElement("aside");t.classList.add("included-in-guides");h=document.createElement("h"+f);h.classList.add("included-in-guides__title"),h.innerText="Guides Including this topic",t.append(h),t.append(c);f=o.querySelector(".related-topic-content__wrapper");f?f.querySelector(".related-topic-content__inner-wrapper").append(t):(f=(h=this._createRelatedContentWrapper())[0],h[1].append(t),o.append(f))}}}},{key:"_loadChildModules",value:function(){}}]),a);function a(){t(this,a);var e=p(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,a,{type:a.PfeType}));return e._processLightDom=e._processLightDom.bind(e),e._isDevelopment=e._isDevelopment.bind(e),e._addStyleSheet=e._addStyleSheet.bind(e),e._loadCss=e._loadCss.bind(e),e.loadData=e.loadData.bind(e),e.getData=e.getData.bind(e),e._navigationHandler=e._navigationHandler.bind(e),e._loadChildModules=e._loadChildModules.bind(e),e._addIncludedInGuides=e._addIncludedInGuides.bind(e),e._observer=new MutationObserver(e._processLightDom),e._contentData={},e._contentType=null,e}return e.create(o),o});
//# sourceMappingURL=cp-documentation.umd.min.js.map
{
"name": "@cpelements/cp-documentation",
"description": "Documentation element for PatternFly Elements",
"version": "0.1.43",
"version": "0.1.44",
"pfelement": {

@@ -6,0 +6,0 @@ "className": "PfeDocumentation",

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

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