Liferay.Loader.define("commerce-frontend-js@4.0.52/components/add_to_wish_list/AddToWishList",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../utilities/notifications","./util/LegacyWishListResource"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n("@frontend-taglib-clay$clayui/button")),a=s(n("@frontend-taglib-clay$clayui/icon")),i=(s(n("liferay!frontend-js-react-web$prop-types")),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=r?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=e[a]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react"))),o=n("../../utilities/notifications"),l=s(n("./util/LegacyWishListResource"));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function f(e){let{iconOnly:t,isInWishList:n,large:c}=e,s=u(e,["iconOnly","isInWishList","large"]);const[f,d]=(0,i.useState)(n);return i.default.createElement(r.default,{className:"btn-outline-borderless btn-".concat(c?"lg":"sm"),displayType:"secondary",onClick:()=>l.default.toggleInWishList(s).then((({success:e})=>d(e))).catch((e=>{(0,o.showErrorNotification)(e)}))},!t&&i.default.createElement("span",{className:"text-truncate-inline"},i.default.createElement("span",{className:"font-weight-normal text-truncate"},Liferay.Language.get("add-to-list"))),i.default.createElement("span",{className:"wish-list-icon"},i.default.createElement(a.default,{symbol:"heart".concat(f?"-full":"")})))}f.defaultProps={isInWishList:!1,large:!1};var d=f;t.default=d}}));
//# sourceMappingURL=AddToWishList.js.map