Liferay.Loader.define("layout-reports-web@1.0.56/js/components/IssueDetail",["module","exports","require","@frontend-taglib-clay$clayui/badge","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/layout","@frontend-taglib-clay$clayui/list","@frontend-taglib-clay$clayui/panel","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../context/StoreContext","../utils/normalizeFailingElements"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function IssueDetail(){const{selectedIssue:e}=(0,c.useContext)(o.StoreStateContext);return c.default.createElement("div",{className:"pb-3 px-3"},c.default.createElement(u.default.Group,{className:"panel-group-flush panel-group-sm"},c.default.createElement(HtmlPanel,{content:e.description,title:Liferay.Language.get("description")}),c.default.createElement(HtmlPanel,{content:e.tips,title:Liferay.Language.get("tips")}),c.default.createElement(FailingElementsPanel,{failingElements:e.failingElements,issueType:e.key})))};var l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/badge")),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/button")),r=_interopRequireDefault(a("@frontend-taglib-clay$clayui/layout")),i=_interopRequireDefault(a("@frontend-taglib-clay$clayui/list")),u=_interopRequireDefault(a("@frontend-taglib-clay$clayui/panel")),c=(_interopRequireDefault(a("liferay!frontend-js-react-web$prop-types")),function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var a={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=l?Object.getOwnPropertyDescriptor(e,n):null;r&&(r.get||r.set)?Object.defineProperty(a,n,r):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react"))),o=a("../context/StoreContext"),d=_interopRequireDefault(a("../utils/normalizeFailingElements"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const HtmlPanel=({content:e,title:t})=>c.default.createElement(u.default,{collapsable:!0,displayTitle:c.default.createElement("span",{className:"c-inner",tabIndex:"-1"},c.default.createElement(u.default.Title,{className:"align-self-center panel-title"},t)),displayType:"unstyled",showCollapseIcon:!0},c.default.createElement(u.default.Body,null,c.default.createElement("div",{className:"text-secondary",dangerouslySetInnerHTML:{__html:e}}))),FailingElementsPanel=({failingElements:e,issueType:t})=>{const[a,o]=(0,c.useState)(10),s=(0,d.default)(e,t),f=s.length;return c.default.createElement(u.default,{collapsable:!0,defaultExpanded:!0,displayTitle:c.default.createElement("span",{className:"c-inner",tabIndex:"-1"},c.default.createElement(u.default.Title,null,c.default.createElement(r.default.ContentRow,null,c.default.createElement(r.default.ContentCol,{className:"align-self-center panel-title",expand:!0},Liferay.Language.get("failing-elements")),c.default.createElement(r.default.ContentCol,null,c.default.createElement(l.default,{displayType:0===f?"success":"info",label:f>=100?"+100":f}))))),displayType:"unstyled",showCollapseIcon:!0},c.default.createElement(u.default.Body,null,c.default.createElement(i.default,null,s.slice(0,a).map(((e,t)=>c.default.createElement(FailingElement,{element:e,key:t})))),a<f&&c.default.createElement(n.default,{displayType:"secondary",onClick:()=>{const e=a+10;o(e<f?e:f)}},Liferay.Language.get("view-more"))))},FailingElement=({element:e})=>c.default.createElement(i.default.Item,{className:"border-0 failing-element mb-2 p-0",flex:!0},c.default.createElement(i.default.ItemField,{className:"mb-2 p-0",expand:!0},e.title&&c.default.createElement(i.default.ItemText,{className:"font-weight-semi-bold mb-2"},e.title),e.content&&c.default.createElement(i.default.ItemText,{className:"text-secondary"},e.content),e.htmlContent&&c.default.createElement("div",{className:"text-secondary",dangerouslySetInnerHTML:{__html:e.htmlContent}}),e.snippet&&c.default.createElement(i.default.ItemText,{className:"bg-lighter border border-light mb-2 px-2 py-1 rounded"},c.default.createElement("code",{className:"text-secondary"},e.snippet)),e.sections&&e.sections.map(((e,t)=>c.default.createElement(i.default.ItemText,{className:"mb-2 text-nowrap text-truncate",key:t},c.default.createElement("span",{className:"mr-1 section-label text-secondary"},"".concat(e.label,":")),c.default.createElement("span",{className:"font-weight-semi-bold","data-tooltip-align":"bottom",title:e.value},e.value))))))}}));
//# sourceMappingURL=IssueDetail.js.map