Liferay.Loader.define("@liferay/search-experiences-web@3.0.7/sxp_blueprint_admin/js/edit_sxp_blueprint/preview_sidebar/ResultListItem",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/layout","@frontend-taglib-clay$clayui/list","liferay!frontend-js-react-web$classnames","liferay!search-experiences-web$moment","liferay!frontend-js-react-web$react","../../shared/PreviewModal","../../shared/ThemeContext"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=y(a("@frontend-taglib-clay$clayui/button")),n=y(a("@frontend-taglib-clay$clayui/icon")),r=y(a("@frontend-taglib-clay$clayui/layout")),i=y(a("@frontend-taglib-clay$clayui/list")),u=y(a("liferay!frontend-js-react-web$classnames")),c=y(a("liferay!search-experiences-web$moment")),d=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();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("../../shared/PreviewModal"),s=y(a("../../shared/ThemeContext"));function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function y(e){return e&&e.__esModule?e:{default:e}}const e=e=>["entryClassName","content_".concat(e),"createDate","modified","userName"],p=["assetEntryId"],g=["birthDate","createDate","modified"],b=700,w=new RegExp("^(".concat("_",")"));var m=function({explanation:t="",fields:a,id:f,score:y=0}){const{locale:m}=(0,d.useContext)(s.default),[x,h]=(0,d.useState)(!0),E=(e,t)=>t&&d.default.createElement(r.default.Row,{justify:"start",key:e},d.default.createElement(r.default.Col,{className:"semibold",size:4},function(e){return e.replace(w,"")}(e)),d.default.createElement(r.default.Col,{className:(0,u.default)({"text-truncate":x}),size:8},function(e){return e.length>b?e.substring(0,b).concat("..."):e}(function(e,t){return g.includes(e)?(0,c.default)((0,c.default)(t,"YYYYMMDDHHmmss")).locale(Liferay.ThemeDisplay.getBCP47LanguageId()||"en-US").format("lll"):t}(e,t))));return d.default.createElement(i.default.Item,{className:"result-list-item",flex:!0,key:f},d.default.createElement(i.default.ItemField,null,d.default.createElement(o.PreviewModalWithCopyDownload,{fileName:"score_explanation.json",size:"lg",text:t,title:Liferay.Language.get("score-explanation")},d.default.createElement(l.default,{className:"score",displayType:"unstyled",small:!0},y.toFixed(2)))),d.default.createElement(i.default.ItemField,{expand:!0},d.default.createElement(i.default.ItemTitle,null,a.assetTitle),e(m).map((e=>E(e,a[e]))),!x&&d.default.createElement(d.default.Fragment,null,p.map((e=>E(e,a[e]))),d.default.createElement("div",{className:"list-group-header"},d.default.createElement("span",{className:"list-group-header-title"},Liferay.Language.get("document-fields"))),Object.keys(a).sort().map((e=>E(e,a[e]))))),d.default.createElement(i.default.ItemField,null,d.default.createElement(l.default,{"aria-label":x?Liferay.Language.get("expand"):Liferay.Language.get("collapse"),displayType:"unstyled",onClick:()=>h(!x)},d.default.createElement(n.default,{symbol:x?"angle-right":"angle-down"}))))};t.default=m}}));
//# sourceMappingURL=ResultListItem.js.map