Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/app/components/fragment-configuration-fields/URLField",["module","exports","require","@frontend-taglib-clay$clayui/form","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../common/components/CurrentLanguageFlag","../../../common/components/LayoutSelector","../../../core/hooks/useControlledState","../../../core/hooks/useId","../../../prop-types/index","../../utils/editable-value/isMappedToLayout"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({field:t,onValueSelect:a,value:d}){const[i,p]=(0,u.default)(d.href||""),[m,g]=(0,r.useState)(s);(0,r.useEffect)((()=>{(0,c.default)(d)?g(e):d.href&&g(s)}),[d]);const b=(0,f.useId)(),L=(0,f.useId)(),v=e=>{a(t.name,e)};return r.default.createElement(r.default.Fragment,null,r.default.createElement(l.default.Group,{small:!0},r.default.createElement("label",{htmlFor:L},t.label),r.default.createElement(l.ClaySelectWithOption,{id:L,onChange:e=>{a(t.name,{}),g(e.target.value)},options:y,value:m})),m===s&&r.default.createElement(l.default.Group,null,r.default.createElement("label",{htmlFor:b},Liferay.Language.get("url")),r.default.createElement(l.ClayInput.Group,{small:!0},r.default.createElement(l.ClayInput.GroupItem,null,r.default.createElement(l.ClayInput,{id:b,onBlur:()=>v({href:i}),onChange:e=>p(e.target.value),type:"text",value:i||""})),t.localizable&&r.default.createElement(l.ClayInput.GroupItem,{shrink:!0},r.default.createElement(n.default,null)))),m===e&&r.default.createElement(o.LayoutSelector,{mappedLayout:null==d?void 0:d.layout,onLayoutSelect:e=>{e&&Object.keys(e).length?v({layout:e}):v({})}}))};var l=p(a("@frontend-taglib-clay$clayui/form")),r=(d(a("liferay!frontend-js-react-web$prop-types")),p(a("liferay!frontend-js-react-web$react"))),n=d(a("../../../common/components/CurrentLanguageFlag")),o=a("../../../common/components/LayoutSelector"),u=d(a("../../../core/hooks/useControlledState")),f=a("../../../core/hooks/useId"),c=(a("../../../prop-types/index"),d(a("../../utils/editable-value/isMappedToLayout")));function d(e){return e&&e.__esModule?e:{default:e}}function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var a={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=l?Object.getOwnPropertyDescriptor(e,r):null;n&&(n.get||n.set)?Object.defineProperty(a,r,n):a[r]=e[r]}return a.default=e,t&&t.set(e,a),a}const e="fromLayout",s="manual",y=[{label:Liferay.Language.get("url"),value:s},{label:Liferay.Language.get("page"),value:e}]}}));
//# sourceMappingURL=URLField.js.map