Liferay.Loader.define("@liferay/search-experiences-web@3.0.30/sxp_blueprint_admin/js/edit_sxp_blueprint/query_builder_tab/QuerySXPElements",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/layout","@frontend-taglib-clay$clayui/tooltip","liferay!frontend-js-react-web$react","../../shared/JSONSXPElement","../../shared/sxp_element/index","../../utils/constants","../../utils/sessionStorage","../../utils/sxp_element/is_custom_json_sxp_element"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/button")),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/icon")),i=_interopRequireDefault(a("@frontend-taglib-clay$clayui/layout")),r=a("@frontend-taglib-clay$clayui/tooltip"),u=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 i=l?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(a,n,i):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),o=_interopRequireDefault(a("../../shared/JSONSXPElement")),s=_interopRequireDefault(a("../../shared/sxp_element/index")),d=a("../../utils/constants"),c=a("../../utils/sessionStorage"),f=_interopRequireDefault(a("../../utils/sxp_element/is_custom_json_sxp_element"));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}}function QuerySXPElements({elementInstances:e,entityJSON:t,errors:a=[],isIndexCompany:y,isSubmitting:p,indexFields:m,onBlur:g,onChange:_,onDeleteSXPElement:b,onChangeAddSXPElementVisibility:E,searchableTypes:x,setFieldTouched:h,setFieldValue:S,touched:P=[]}){const[q,L]=(0,u.useState)(!1);return u.default.createElement("div",{className:"query-sxp-elements"},u.default.createElement(i.default.Row,{className:"configuration-header",justify:"between"},u.default.createElement(i.default.Col,{size:6},Liferay.Language.get("query-elements")),u.default.createElement(i.default.Col,{size:6},u.default.createElement("div",{className:"builder-actions"},u.default.createElement(l.default,{"aria-label":Liferay.Language.get("collapse-all"),className:"collapse-button",displayType:"unstyled",onClick:()=>L(!q)},q?Liferay.Language.get("expand-all"):Liferay.Language.get("collapse-all")),u.default.createElement(r.ClayTooltipProvider,null,u.default.createElement(l.default,{"aria-label":Liferay.Language.get("add-query-element"),displayType:"primary",monospaced:!0,onClick:()=>{(0,c.setStorageAddSXPElementSidebar)(),E()},small:!0,title:Liferay.Language.get("add-query-element")},u.default.createElement(n.default,{symbol:"plus"})))))),e.length?e.map((({id:e,sxpElement:l,uiConfigurationValues:n},i)=>(0,f.default)(n)?u.default.createElement(o.default,{collapseAll:q,error:a[i],id:e,index:i,isSubmitting:p,key:e,onDeleteSXPElement:b,prefixedId:"".concat(d.SXP_ELEMENT_PREFIX.QUERY,"-").concat(i),setFieldTouched:h,setFieldValue:S,sxpElement:l,touched:P[i],uiConfigurationValues:n}):u.default.createElement(s.default,{collapseAll:q,entityJSON:t,error:a[i],id:e,index:i,indexFields:m,isIndexCompany:y,isSubmitting:p,key:e,onBlur:g,onChange:_,onDeleteSXPElement:b,prefixedId:"".concat(d.SXP_ELEMENT_PREFIX.QUERY,"-").concat(i),searchableTypes:x,setFieldTouched:h,setFieldValue:S,sxpElement:l,touched:P[i],uiConfigurationValues:n}))):u.default.createElement("div",{className:"sheet"},u.default.createElement("div",{className:"selected-sxp-elements-empty-text"},Liferay.Language.get("add-elements-to-optimize-search-results-for-your-use-cases"))))}var y=u.default.memo(QuerySXPElements);t.default=y}}));
//# sourceMappingURL=QuerySXPElements.js.map