Liferay.Loader.define("layout-seo-web@2.0.43/js/seo/display_page_templates/components/MappingSelector",["module","exports","require","@frontend-taglib-clay$clayui/form","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../constants","./MappingPanel"],(function(e,t,r){var n;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=f(r("@frontend-taglib-clay$clayui/form")),l=(r("liferay!frontend-js-react-web$prop-types"),f(r("liferay!frontend-js-react-web$react"))),o=r("../constants"),c=(n=r("./MappingPanel"))&&n.__esModule?n:{default:n};function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function f(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();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 l=n?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var d=function({fields:e,helpMessage:t,label:r,name:n,selectedFieldKey:u,selectedSource:f}){const i=[o.UNMAPPED_OPTION,...e],[s,d]=(0,l.useState)(f),[y,b]=(0,l.useState)(i.find((({key:e})=>e===u))||o.UNMAPPED_OPTION),O=!!y&&y.key!==o.UNMAPPED_OPTION.key,m=f?f.classTypeLabel||f.classNameLabel:"";return l.default.createElement(a.default.Group,null,l.default.createElement("label",{className:"control-label",htmlFor:n},r),l.default.createElement(a.ClayInput.Group,null,l.default.createElement(a.ClayInput.GroupItem,null,l.default.createElement(a.ClayInput,{className:"dpt-mapping-input",id:n,readOnly:!0,type:"text",value:"".concat(O&&m&&"".concat(m,": ")||"").concat(y.label)}),l.default.createElement(a.ClayInput,{name:n,type:"hidden",value:y.key})),l.default.createElement(a.ClayInput.GroupItem,{shrink:!0},l.default.createElement(c.default,{field:y,fields:i,isActive:O,name:n,onSelect:({field:e,source:t})=>{d(t),b(e)},source:p(p({},s),{},{initialValue:m})}))),t&&l.default.createElement(a.default.Text,null,t))};t.default=d}}));
//# sourceMappingURL=MappingSelector.js.map