Liferay.Loader.define("@liferay/search-experiences-web@3.0.7/sxp_blueprint_admin/js/edit_sxp_element/index",["module","exports","require","liferay!frontend-js-react-web$react","../hooks/useClipboardJS","../shared/ErrorBoundary","../shared/ThemeContext","../utils/constants","../utils/fetch","../utils/language","../utils/toasts","./EditSXPElementForm"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({defaultLocale:t,learnMessages:r,locale:u,namespace:f,redirectURL:p,sxpElementId:h}){const[_,b]=(0,n.useState)(null),[g,E]=(0,n.useState)(null);if((0,a.default)("."+s.COPY_BUTTON_CSS_CLASS),(0,n.useEffect)((()=>{(0,c.openInitialSuccessToast)(),(0,o.fetchData)("/o/search-experiences-rest/v1.0/sxp-elements/".concat(h)).then((e=>E(e))).catch((()=>E({}))),(0,o.fetchData)("/o/search-experiences-rest/v1.0/sxp-parameter-contributor-definitions").then((e=>b(e.items))).catch((()=>b([])))}),[]),!g||!_)return null;return n.default.createElement(l.default.Provider,{value:{availableLanguages:Liferay.Language.available,defaultLocale:t,learnMessages:r,locale:u,namespace:f,redirectURL:p}},n.default.createElement("div",{className:"edit-sxp-element-root"},n.default.createElement(i.default,null,n.default.createElement(d.default,{initialDescription:e(g,t),initialElementJSONEditorValue:y(g,t),initialTitle:m(g,t),predefinedVariables:_,readOnly:g.readOnly,sxpElementId:h,type:g.type}))))};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=p();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=n?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),a=f(r("../hooks/useClipboardJS")),i=f(r("../shared/ErrorBoundary")),l=f(r("../shared/ThemeContext")),s=r("../utils/constants"),o=r("../utils/fetch"),u=r("../utils/language"),c=r("../utils/toasts"),d=f(r("./EditSXPElementForm"));function f(e){return e&&e.__esModule?e:{default:e}}function p(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return p=function(){return e},e}const e=(e,t)=>{let r=e.description_i18n||{[t]:e.description};return 0===Object.keys(r).length&&(r={[t]:""}),(0,u.renameKeys)(r,(e=>e.replace("-","_")))},m=(e,t)=>{const r=e.title_i18n||{[t]:e.title};return(0,u.renameKeys)(r,(e=>e.replace("-","_")))},y=(t,r)=>({description_i18n:e(t,r),elementDefinition:t.elementDefinition,title_i18n:m(t,r),type:t.type})}}));
//# sourceMappingURL=index.js.map