Liferay.Loader.define("dynamic-data-mapping-form-web@4.0.105/admin/js/components/share-form/Link.es",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$classnames","dynamic-data-mapping-form-web$clipboard","liferay!frontend-js-react-web$react","../../util/dom"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(a("@frontend-taglib-clay$clayui/button")),n=i(a("@frontend-taglib-clay$clayui/form")),l=s(a("@frontend-taglib-clay$clayui/icon")),c=s(a("liferay!frontend-js-react-web$classnames")),u=s(a("dynamic-data-mapping-form-web$clipboard")),o=i(a("liferay!frontend-js-react-web$react")),d=a("../../util/dom");function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function i(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={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=r?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(a,n,l):a[n]=e[n]}return a.default=e,t&&t.set(e,a),a}function s(e){return e&&e.__esModule?e:{default:e}}const e=e=>{(0,o.useEffect)((()=>{const t=new u.default(".ddm-copy-clipboard");return t.on("success",e),()=>{t.destroy()}}),[e])};var p=({url:t})=>{const[a,u]=(0,o.useState)(!1),f=(0,o.useRef)(null);return e((0,o.useCallback)((()=>u(!a)),[a])),(0,o.useEffect)((()=>{a&&(0,d.selectText)(f.current)}),[a]),o.default.createElement("div",{className:(0,c.default)("share-form-modal-item-link form-group m-0",{"has-success":a})},o.default.createElement(n.ClayInput.Group,null,o.default.createElement(n.ClayInput.GroupItem,{prepend:!0},o.default.createElement(n.ClayInput,{readOnly:!0,ref:f,value:t}),a&&o.default.createElement(n.default.FeedbackGroup,null,o.default.createElement(n.default.FeedbackItem,null,Liferay.Language.get("copied-to-clipboard")))),o.default.createElement(n.ClayInput.GroupItem,{append:!0,shrink:!0},o.default.createElement(r.default,{"aria-label":a?Liferay.Language.get("copied"):Liferay.Language.get("copy"),className:"ddm-copy-clipboard","data-clipboard-text":t,displayType:a?"success":"secondary"},a?o.default.createElement("span",{className:"pl-2 pr-2 publish-button-success-icon"},o.default.createElement(l.default,{symbol:"check"})):o.default.createElement("span",{className:"publish-button-text"},Liferay.Language.get("copy"))))))};t.default=p}}));
//# sourceMappingURL=Link.es.js.map