/*! 2024. 5. 2. 오후 4:59:11 */ /******/ (() => { // webpackBootstrap var __webpack_exports__ = {}; (() => { const { EventManager, pageHelper, actions, utils } = ShopbySkin; const myLikeProductListHelper = pageHelper.myLikeProductListHelper(); const searchParams = new URLSearchParams(location.search); const pageNumber = searchParams.get('pageNumber'); const pageSize = searchParams.get('pageSize'); const hasTotalCount = searchParams.get('hasTotalCount'); myLikeProductListHelper.initialize({ pageNumber, pageSize, hasTotalCount, }); const moduleActionHandler = { INQUIRE_PRODUCT: (_, target) => { const productNo = target.closest('[shopby-product-no]')?.getAttribute('shopby-product-no'); const productName = target.closest('[shopby-product-name]')?.getAttribute('shopby-product-name'); const imageUrl = target.closest('[shopby-image-url]')?.getAttribute('shopby-image-url'); const imageType = target.closest('[shopby-image-url]')?.getAttribute('shopby-image-type'); EventManager.fire('OPEN_LAYER_MODAL', { name: 'product-inquiry-form', title: 'Product Inquiry', modalAddClass: 'product-inquiry-form-modal', isFull: false, data: { productNo, productName, unescapedProductName: unescapeHTML(productName), imageUrl, imageType, isModify: false, commonData: myLikeProductListHelper.commonData, }, onClose: ({ reason }) => { if (reason === 'DID_SUBMIT') { EventManager.fire('MODAL_ALERT_OPEN', { noticeType: 'SUCCESS', message: 'The product inquiry has been registered.', onClose: () => { location.reload(); }, }); } }, }); }, DELETE_LIKE_PRODUCT: (_, target) => { const productNo = target.closest('[shopby-product-no]')?.getAttribute('shopby-product-no'); EventManager.fire('MODAL_CONFIRM_OPEN', { noticeType: 'WARNING', message: `Do you want to delete the selected product?`, confirmLabel: 'Confirm', cancelLabel: 'Cancel', onConfirm: async () => { await actions.postProfileLikeByProductNos({ productNos: [productNo] }); EventManager.fire('MODAL_ALERT_OPEN', { noticeType: 'SUCCESS', label: 'Confirm', message: 'Deleted.', onClose: () => { location.reload(); }, }); }, }); }, DELETE_SELECTED_LIKE_PRODUCTS: (_, target) => { const selectedCount = target.getAttribute('shopby-selected-count'); const checkedProductNosAsString = target.getAttribute('shopby-checked-product-nos-as-string'); if (!Number(selectedCount)) { EventManager.fire('MODAL_ALERT_OPEN', { noticeType: 'CAUTION', label: 'Confirm', message: 'There are no selected products.', }); return; } const productNos = checkedProductNosAsString.split(','); EventManager.fire('MODAL_CONFIRM_OPEN', { noticeType: 'WARNING', cancelLabel: 'Cancel', confirmLabel: 'Confirm', message: `Do you want to delete the ${productNos.length} selected products?`, onConfirm: async () => { await actions.postProfileLikeByProductNos({ productNos }); EventManager.fire('MODAL_ALERT_OPEN', { noticeType: 'SUCCESS', message: 'Deleted.', label: 'Confirm', onClose: () => { location.reload(); }, }); }, }); }, }; document.querySelector('like-product-total-count')?.addEventListener('click', ({ target }) => { const action = target.getAttribute('shopby-action'); moduleActionHandler[action]?.(myLikeProductListHelper, target); }); document.querySelector('like-product-list')?.addEventListener('click', ({ target }) => { const action = target.getAttribute('shopby-action'); moduleActionHandler[action]?.(myLikeProductListHelper, target); }); })(); /******/ })() ;